Lect 2 Boolean Algebra and Logic Gates Boolean
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+B×C ) • The possible values for any Boolean expression can be tabulated in a truth table. • Can define circuit for expression by combining gates. 1
2
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 if x. y =y. x 3
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 that e. 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 since x + 0 = 0 + x = x , x member of I 5. 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 that a + (-a) = 0 6. 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) 4
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 at least two elements x, y member of B such that x is not y 5
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 6 digital circuits have on logic inputs
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 Property To obtain a dual of a given expression: • Interchange + and • operators • Replace all 0 s with 1 s with and all 1 s and with 0 s. 7
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. 8
9
10
11
BOOLEAN FUNCTIONS 12
BOOLEAN FUNCTIONS Boolean 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 2 n, where n is the number of variables in the function. 13
LOGIC CKT DIAGRAM OF BOOLEAN FUNCTION 14
• A literal is a variable or its complement in a boolean expression, e. g. , F 1 has 8 literals, 1 OR term (sum term), and 3 AND terms (product terms). • The complement of any function F is F 0, which can be obtained by De Morgan’s theorem: 1) take the dual of F (Interchange AND and OR, and 1 s & 0 s) , and 2) complement each literal in F. NOTE for next slide see boole. pdf page 5 of 21 15
16
17
Algebraic Manipulation • Consider function 18
Simplify Function Apply X(Y + Z) = XY + XZ X + X` = 1 X. 1=X 19
Canonical form is algebraic representation of 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 20
21
truth table is 1. 22
Fewer Gates 23
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`) 24
25
Other Logic Operations • There are 22 n different boolean functions for n binary variables. • There are 16 different boolean functions if n = 2. 26
27
28
29
NAND is Universal • Can express any Boolean Function • Equivalents below 30
Using NAND as Invert-OR 31
Sum of Products with NAND 32
AND-OR Circuit Easy to Convert 33
Extension to Multiple Inputs • 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)’ 34
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. 35
36
37
- Slides: 37