Boolean Algebra Philipp Koehn 9 September 2016
Core Boolean Operators 1 AND OR NOT A B A and B 0 0 0 0 1 0 1 0 0 1 1 1 A B A or B 0 0 0 0 1 1 1 0 1 1 1 1 A not A 0 1 1 0 AND OR NOT
2 Boolean algebra
Boolean Algebra: Identity for Identity for Monotone Laws x 0 = x x 1 = x 3 Annihilator for x 1 = 1 Annihilator for x 0 = 0 Idempotence for Idempotence for Commutativity for Commutativity for Absorption 1 Absorption 2 x x = x x x = x x y = y x x y = y x x (x y) = x x (x y) = x Associativity for (x y) z = x (y z) Associativity for (x y) z = x (y z) Distributivity of over x (y z) = (x y) (x z) Distributivity of over x (y z) = (x y) (x z)
Boolean Algebra: Nonmonotone Laws 4 Complementation for x x = 0 Complementation for x x = 1 De Morgan 1 x y = (x y) De Morgan 2 x y = (x y)
5 from Boolean expressions to circuits
Truth Table Boolean Expression 6 Truth table A B OUT 0 0 1 0 1 0 1 0 0 1 1 0 Operation: not ( A or B ) (also called nor)
Boolean Expression Circuit 7 Operation: not ( A or B ) Circuit: A B OR NOT OUT
4-Bit AND 8 4 inputs (A, B, C, D), output 1 iff all inputs are 1 Operation: (A and B) and (C and D) Circuit: A B C D AND AND AND OUT
1-Bit Selector 9 Truth table A OUT1 OUT2 0 1 0 1 0 1 Operation: OUT1 = not A OUT2 = A
1-Bit Selector 10 Operation: OUT1 = not A OUT2 = A Circuit: A NOT OUT1 OUT2
A Complicated Example 11 Truth table A B C OUT 0 0 0 0 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 0 1 1 1 0 Operation: Need a better way of doing this instead of relying on intuition
12 disjunctive normal form
DNF: Setup 13 A B C OUT Expression 0 0 0 0 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 0 1 1 1 0 Goal: find expression for each row that yields 1
DNF: One Row 14 A B C OUT Expression 0 0 0 0 0 1 0 1 (not A) and B and (not C) 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 0 1 1 1 0 Expression is 1 only for this row, 0 for all others
DNF: All Rows 15 A B C OUT Expression 0 0 0 0 0 1 0 1 (not A) and B and (not C) 1 0 0 0 1 1 0 0 0 0 1 1 (not A) and (not B) and C 0 1 1 1 (not A) and B and C 1 0 1 0 1 1 1 0
DNF: Complete Operation 16 A B C OUT Expression 0 0 0 0 0 1 0 1 (not A) and B and (not C) 1 0 0 0 1 1 0 0 0 0 1 1 (not A) and (not B) and C 0 1 1 1 (not A) and B and C 1 0 1 0 1 1 1 0 Putting it all together: ((not A) and B and (not C)) or ((not A) and (not B) and C) or ((not A) and B and C)
DNF: Circuit 17 Operation: Circuit: ((not A) and B and (not C)) or ((not A) and (not B) and C) or ((not A) and B and C) OUT AND AND AND OR A NOT B NOT C NOT
18 conjunctive normal form
DNF 19 A B C OUT Expression 0 0 0 0 0 1 0 1 (not A) and B and (not C) 1 0 0 0 1 1 0 0 0 0 1 1 (not A) and (not B) and C 0 1 1 1 (not A) and B and C 1 0 1 0 1 1 1 0 Putting it all together: ((not A) and B and (not C)) or ((not A) and (not B) and C) or ((not A) and B and C)
CNF: One Row 20 A B C OUT Expression 0 0 0 0 not ((not A) and (not B) and (not C)) 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 0 1 1 1 0 Expression is 0 only for this row, 1 for all others
CNF: All Rows 21 A B C OUT Expression 0 0 0 0 not ((not A) and (not B) and (not C)) 0 1 0 1 1 0 0 0 not (A and (not B) and (not C)) 1 1 0 0 not (A and B and (not C)) 0 0 1 1 0 1 1 1 1 0 1 0 not (A and (not B) and C) 1 1 1 0 not (A and B and C)
CNF: Complete Operation 22 A B C OUT Expression 0 0 0 0 not ((not A) and (not B) and (not C)) 0 1 0 1 1 0 0 0 not (A and (not B) and (not C)) 1 1 0 0 not (A and B and (not C)) 0 0 1 1 0 1 1 1 1 0 1 0 not (A and (not B) and C) 1 1 1 0 not (A and B and C) Putting it all together: (not ((not A) and (not B) and (not C))) and (not (A and (not B) and (not C))) and (not (A and B and (not C))) and (not (A and (not B) and C)) and (not (A and B and C))
CNF: Circuit 23 Operation: Circuit: (not ((not A) and (not B) and (not C))) and (not (A and (not B) and (not C))) and (not (A and B and (not C))) and (not (A and (not B) and C)) and (not (A and B and C)) OUT AND AND AND AND AND AND NOT NOT NOT NOT NOT A NOT B NOT C NOT
24 universal gates
Universality of NAND 25 Truth table: A B A nand B 0 0 1 0 1 1 1 0 1 1 1 0 NOT: A nand A AND: (A nand B) nand (A nand B) OR: (A nand A) nand (B nand B)
Universality of NOR 26 Truth table: A B A nor B 0 0 1 0 1 0 1 0 0 1 1 0 NOT: A nor A AND: (A nor A) nor (B nor B) OR: (A nor B) nor (A nor B)