Boolean Algebra and Logic Gates 1 Boolean Algebra
Boolean Algebra and Logic Gates 1
Boolean Algebra § § 1. 3. 5. 7. 9. Invented by George Boole in 1854 An algebraic structure defined by a set {0, 1}, together with two binary operators (+ and ·) and a unary operator ( ) X+0= X X+1 =1 X+X =X X+X =1 X=X 10. X + Y = Y + X 12. (X + Y) + Z = X + (Y + Z) 14. X(Y + Z) = XY + XZ 16. X + Y = X. Y 2. 4. 6. 8. X. 1 =X Identity element X. 0 =0 X. X = X Idempotence X. X = 0 Complement Involution 11. XY = YX Commutative Associative 13. (XY) Z = X(YZ) 15. X + YZ = (X + Y) (X + Z) Distributive De. Morgan’s 17. X. Y = X + Y Boolean Algebra and Logic Gates 2
Some Properties of Boolean Algebra § A two-valued Boolean algebra is also know as Switching Algebra. § The dual of an algebraic expression is obtained by interchanging + and · and interchanging 0’s and 1’s. § Sometimes, the dot symbol ‘ ’ (AND operator) is not written when the meaning is clear Boolean Algebra and Logic Gates 3
Dual of a Boolean Expression § Example: F = (A + C) · B + 0 dual F = (A · C + B) · 1 = A · C + B § Example: G = X · Y + (W + Z) dual G = (X+Y) · (W · Z) = (X+Y) · (W+Z) § Example: H = A · B + A · C + B · C dual H = (A+B) · (A+C) · (B+C) Boolean Algebra and Logic Gates 4
Boolean Algebraic Proof – Example 1 § A+A·B=A Proof Steps A+A·B =A· 1+A·B = A · ( 1 + B) =A· 1 =A (Absorption Theorem) Justification Identity element: A · 1 = A Distributive 1+B=1 Identity element Boolean Algebra and Logic Gates 5
Boolean Algebraic Proof – Example 2 § AB + AC + BC = AB + AC (Consensus Theorem) Proof Steps Justification = AB + AC + BC = AB + AC + 1 · BC Identity element = AB + AC + (A + A) · BC Complement = AB + AC + ABC Distributive = AB + ABC + ACB Commutative = AB · 1 + ABC + AC · 1 + ACB Identity element = AB (1+C) + AC (1 + B) Distributive = AB. 1 + AC. 1 1+X = 1 = AB + AC Identity element Boolean Algebra and Logic Gates 6
Useful Theorems § Minimization XY+XY=Y § Minimization (dual) (X+Y) = Y § Absorption X+XY=X § Absorption (dual) X · (X + Y) = X § Simplification X+XY=X+Y § Simplification (dual) X · (X + Y) = X · Y § De. Morgan’s § X+Y=X·Y § De. Morgan’s (dual) § X·Y=X+Y Boolean Algebra and Logic Gates 7
Truth Table to Verify De. Morgan’s X+Y=X·Y X·Y=X+Y X Y X·Y X+Y X · Y X·Y X+Y 0 0 1 1 0 1 0 0 0 1 1 1 0 0 1 0 1 0 0 0 1 1 1 0 § Generalized De. Morgan’s Theorem: X 1 + X 2 + … + X n = X 1 · X 2 · … · Xn = X 1 + X 2 + … + X n Boolean Algebra and Logic Gates 8
Complementing Functions § Use De. Morgan's Theorem: 1. Interchange AND and OR operators 2. Complement each constant and literal § Example: Complement F = xy z + x y z F = (x + y + z) § Example: Complement G = (a + bc)d + e G = (a (b + c) + d) e Boolean Algebra and Logic Gates 9
Expression Simplification § An application of Boolean algebra § Simplify to contain the smallest number of literals (variables that may or may not be complemented) A B + ACD + A BD + AC D + A BCD = AB + ABCD + A C D + A B D = AB + AB(CD) + A C (D + D) + A B D = AB + A C + A B D = B(A + AD) +AC = B (A + D) + A C (has only 5 literals) Boolean Algebra and Logic Gates 10
Canonical Forms § Minterms and Maxterms 1 - Sum-of-Minterm (SOM) Canonical Form 2 - Product-of-Maxterm (POM) Canonical Form Boolean Algebra and Logic Gates 11
Minterms § Minterms are AND terms with every variable present in either true or complemented form. § Given that each binary variable may appear normal (e. g. , x) or complemented (e. g. , x), there are 2 n minterms for n variables. § Example: Two variables (X and Y) produce 2 x 2 = 4 combinations: XY (both normal) X Y (X normal, Y complemented) XY (X complemented, Y normal) X Y (both complemented) § Thus there are four minterms of two variables. Boolean Algebra and Logic Gates 12
Maxterms § Maxterms are OR terms with every variable in true or complemented form. § Given that each binary variable may appear normal (e. g. , x) or complemented (e. g. , x), there are 2 n maxterms for n variables. § Example: Two variables (X and Y) produce 2 x 2 = 4 combinations: X + Y (both normal) X + Y (x normal, y complemented) X + Y (x complemented, y normal) X + Y (both complemented) Boolean Algebra and Logic Gates 13
Minterms & Maxterms for 2 variables § Two variable minterms and maxterms. x y Index Minterm Maxterm 0 0 0 m 0 = x y M 0 = x + y 0 1 1 m 1 = x y M 1 = x + y 1 0 2 m 2 = x y M 2 = x + y 1 1 3 m 3 = x y M 3 = x + y § The minterm mi should evaluate for each combination of x and y. § The maxterm is the complement of the minterm Boolean Algebra and Logic Gates 14
Minterms & Maxterms for 3 variables x 0 0 1 1 y 0 0 1 1 z 0 1 0 1 Index 0 1 2 3 4 5 6 7 Minterm m 0 = x y z m 1 = x y z m 2 = x y z m 3 = x y z m 4 = x y z m 5 = x y z m 6 = x y z m 7 = x y z Maxterm M 0 = x + y + z M 1 = x + y + z M 2 = x + y + z M 3 = x + y + z M 4 = x + y + z M 5 = x + y + z M 6 = x + y + z M 7 = x + y + z Maxterm Mi is the complement of minterm mi Mi = mi and mi = Mi Boolean Algebra and Logic Gates 15
Purpose of the Minterms and Maxterms § Minterms and Maxterms are designated with an index § For Minterms: • ‘ 1’ means the variable is “Not Complemented” and • ‘ 0’ means the variable is “Complemented”. § For Maxterms: • ‘ 0’ means the variable is “Not Complemented” and • ‘ 1’ means the variable is “Complemented”. Boolean Algebra and Logic Gates 16
Standard Order § All variables should be present in a minterm or maxterm and should be listed in the same order (usually alphabetically) § Example: For variables a, b, c: • Maxterms (a + b + c), (a + b + c) are in standard order • However, (b + a + c) is NOT in standard order (a + c) does NOT contain all variables • Minterms (a b c) and (a b c) are in standard order • However, (b a c) is not in standard order (a c) does not contain all variables Boolean Algebra and Logic Gates 17
Sum-Of-Minterm Examples § F(a, b, c, d) = ∑(2, 3, 6, 10, 11) § F(a, b, c, d) = m 2 + m 3 + m 6 + m 10 + m 11 abcd+abcd+abcd § G(a, b, c, d) = ∑(0, 1, 12, 15) § G(a, b, c, d) = m 0 + m 12 + m 15 abcd+abcd+abcd Boolean Algebra and Logic Gates 18
Product-Of-Maxterm Examples § F(a, b, c, d) = ∏(1, 3, 6, 11) § F(a, b, c, d) = M 1 · M 3 · M 6 · M 11 (a+b+c+d) § G(a, b, c, d) = ∏(0, 4, 12, 15) § G(a, b, c, d) = M 0 · M 4 · M 12 · M 15 (a+b+c+d) Boolean Algebra and Logic Gates 19
Standard Forms § Standard Sum-of-Products (SOP) form: equations are written as an OR of AND terms § Standard Product-of-Sums (POS) form: equations are written as an AND of OR terms § Examples: • SOP: A B C + B • POS: (A + B) · (A+ B + C )· C § These “mixed” forms are neither SOP nor POS • (A B + C) (A + C) • A B C + A C (A + B) Boolean Algebra and Logic Gates 20
Standard Sum-of-Products (SOP) § A sum of minterms form for n variables can be written down directly from a truth table. § This form often can be simplified so that the corresponding circuit is simpler. Boolean Algebra and Logic Gates 21
Standard Sum-of-Products (SOP) § A Simplification Example: F( A, B, C) = S (1, 4, 5, 6, 7) § Writing the minterm expression: F = A B C + ABC § Simplifying: F = A B C + A (B C + B C) F = A B C + A (B (C + C) + B (C + C)) F = A B C + A (B + B) F=ABC+A F=BC+A § Simplified F contains 3 literals compared to 15 Boolean Algebra and Logic Gates 22
AND/OR Two-Level Implementation § The two implementations for F are shown below It is quite apparent which is simpler! Boolean Algebra and Logic Gates 23
SOP and POS Observations § The previous examples show that: • Canonical Forms (Sum-of-minterms, Product-of-Maxterms), or other standard forms (SOP, POS) differ in complexity • Boolean algebra can be used to manipulate equations into simpler forms • Simpler equations lead to simpler implementations Boolean Algebra and Logic Gates 24
- Slides: 24