1 lect # 2 boolean algebra and logic gates boolean algebra defines rules for manipulating symbolic...

37
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. a symbolic binary logic expression consists of binary variables and the operators AND, OR and NOT (e.g. A+BC) The possible values for any Boolean expression can be tabulated in a truth table. Can define circuit for expression by combining gates.

Upload: christiana-willis

Post on 18-Jan-2016

240 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

1

Lect # 2 Boolean Algebra and Logic Gates• Boolean algebra defines rules for manipulating symbolic binary logic

expressions.– a symbolic binary logic expression consists of binary variables and the

operators AND, OR and NOT (e.g. A+BC)• The possible values for any Boolean expression can be tabulated in a

truth table.• Can define circuit for expression

by combining gates.

Page 2: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

2

Page 3: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

3

Common axioms (or postulates):1. Closure: A set S is closed with respect to a binary operator ,if the operator specifies a rule for obtaining an element of S. For example, the set of natural numbers is closed w.r.t binary operator (+) but not close w.r.t. binary operator (-). 2. Associative: A binary operator . on a set S is said to be associative if(x . y) . z = x . (y . z)3. Commutative: A binary operator . on a set S is said to be commutative ifx . y = y . x

Page 4: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

4

4. Identity element: Set S is said to have an identity element with respect to binary operation . on S if there exists an element e member of S such thate . x = x .e = x for every x member of S» Example: The element 0 is an identity element w.r.t. operation + on the set of integers I sincex + 0 = 0 + x = x , x member of I5. Inverse: A set S having the identity element e with respect to a binary operator . is said to have an inverse whenever, for every x member of S, there exists an element y member of S such that x . y = e» Example: The inverse of an element a is (-a) such thata + (-a) = 06. Distributivity: If . and ¤ are two binary operators on a set S, . is said to be distributive over ¤ whenever x . (y ¤ z) = (x . y) ¤ (x . z)

Page 5: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

5

Boolean Algebra: Algebra for binary values. Developed by George Boole in 1854. Huntington postulates for Boolean algebra (1904):• Closure with respect to operator + and operator ·x @ y → B, @ = {+ • ‘ } for ∀ x,y ∈ B• Identity element 0 for operator + and 1 for operator ·• Commutativity with respect to + and · x+y = y+x, x·y = y·x• Distributivity of · over +, and + over ·x·(y+z) = (x·y)+(x·z) and x+(y·z) = (x+y)·(x+z)• Complement for every element x is x’ with x+x’=1, x·x’=0• There are at least two elements x,y member of B such that x is not y

Page 6: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

6

Boolean vs. Ordinary Algebra

• Postulates do not include associativity

• Distributivity of + over · holds for Boolean, not for ordinary algebra

» x+(y·z) = (x+y)·(x+z)

• Boolean does not have inverse elements for + or ·

» Thus, no subtraction or division operators

• Complement is not defined in ordinary algebra

• Set of elements in Boolean algebra not yet defined

» But there must be at least two elements

• Boolean 0 and 1 represent the state of a voltage variable (logic level) and is used to express the effects that various digital circuits have on logic inputs

Page 7: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

7

Basic Theorems of Boolean Algebra

Theorem 1 (Idempotency)

(a) x + x = x; (b) x x = x.

Theorem 2

(a) x + 1 = 1; (b) x . 0 = 0.

Theorem 3 (Absorption)

(a) yx + x = x; (b) (y + x)x = x.

Theorem 4 (Involution)

(x`)` = x.

Duality PropertyTo obtain a dual of a given expression: • Interchange + and • operators • Replace all 0s with 1s with and all 1s and with 0s.

Page 8: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

8

Theorem 5 (De Morgan)(a) (x + y)` = x` . y`; (b) (xy)` = x` + y`.

Theorem 6 (De Morgan (generalized))

The theorems usually are proved algebraically (i.e., by transformations based on axioms and theorems) or by truth table.

Page 9: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

9

Page 10: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

10

Page 11: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

11

Page 12: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

12

BOOLEAN FUNCTIONS

Page 13: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

13

BOOLEAN FUNCTIONSBoolean algebra deals with binary variables and logic operations• Boolean function is an algebraic expression that consists of: • Binary variables • Constants 0 and 1 • Logic operation symbols

The number of rows in the table is 2n, where n is the number of variables in the function.

Page 14: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

14

LOGIC CKT DIAGRAM OF BOOLEAN FUNCTION

Page 15: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

15

• A literal is a variable or its complement in a boolean expression, e.g., F1 has 8 literals, 1 OR term (sum term), and 3 AND terms (product terms).• The complement of any function F is F0, which can be obtained by De Morgan’stheorem: 1) take the dual of F

(Interchange AND and OR, and 1s & 0s)

, and 2) complement each literal in F.

NOTE for next slide see boole.pdf page 5 of 21

Page 16: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

16

Page 17: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

17

Page 18: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

18

Algebraic Manipulation

• Consider functionXZZYX YZ X F

Page 19: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

19

Simplify Function

XZZYX YZ X F

XZZ Z YX F )(

XZYX F 1

XZYX F

Apply

Apply

Apply

X(Y + Z) = XY + XZ

X + X` = 1

X . 1 = X

Page 20: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

20

Canonical form is algebraic representationof truth table. Uses minterms as basic component. A minterm is a product (ANDing) of all variables. Each variable of function appears in minterm.

A maxterm is a sum (OR) of all variables in respective polarities• Maxterm contains every variable in the function• All the variables are OR-ed together in a maxterm

Page 21: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

21

Page 22: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

22

Both function (F1 & F2) = sum of all minterms where truth table is 1.

Page 23: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

23

Fewer GatesFewer Gates XZYX F

Page 24: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

24

Standard Forms• Sum-of-products (sop)• Product-of-sums (pos)• Product terms (or implicants) are the AND terms, which can have fewer literals than the minterms.• Sum terms are the OR terms, which can have fewer literals than the maxterms.Standard forms are not unique!Standard forms can be derived from canonical forms by combining terms that differ in one variable, i.e., terms with distance 1.Sop form: F = w`x`yz + wxy`z`.Pos form: F = (w + x`)(w` + y`)(y + z`)(z + x)Non-Standard Form: (AB + CD) (A`B` + C`D`)

Page 25: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

25

Page 26: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

26

Other Logic Operations• There are 22n different boolean functions for n binary variables.

• There are 16 different boolean functions if n = 2.

Page 27: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

27

Page 28: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

28

Page 29: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

29

Page 30: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

30

NAND is Universal

• Can express any Boolean Function

• Equivalents below

Page 31: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

31

Using NAND as Invert-OR

Page 32: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

32

Sum of Products with NAND

Page 33: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

33

AND-OR Circuit Easy to Convert

Page 34: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

34

• Inverter and buffer cannot be extended to multiple inputs

• AND and OR are cummutative

x+y = y+x, x•y = y•x

and associative

(x+y)+z = x+(y+z) = x+y+z

(x•y) • z = x•(y•z) = x•y•z

• NAND and NOR are cummutative, but not associative. They are redefined as complemented OR and AND gates: x↓y↓z = (x+y+z)’ , x↑y↑z = (x•y•z)’

Extension to Multiple Inputs

Page 35: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

35

The final function is the XOR - Exclusive OR.Verbally it can be stated as ‘Either A or B, but not both’.For the 2 input XOR gate, a HIGH o/p will occur when one and only one i/p is logic HIGH.

Page 36: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

36

Page 37: 1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression

37