College of Computer & Information Science Fall 2009 Northeastern University 11 September 2009 CS 1800: Discrete Structures Scribe: Lecture Outline:

• Full Adder

• Laws of Logic

• Logical Equivalence – Truth-Tables to Boolean Formulae to Circuits

• Universality of NAND

1 Logic Statements

Logic statements can be viewed as ordinary English sentences that are either true or false. For instance, “Lions make good pets” is a Logic statement. So is “Giraffes are tall”. Logic is also intimately connected with electronic circuits where computation is being performed over binary numbers. We can see the following equivalence.

T on (pushed)  +5V 1
F off (unpushed) 0V 0

2 Laws of Logic

We are all familiar with elementary laws of arithmetic: Commutativity: a + b = b + a, a × b = b × a Associativity: (a + b) + c = a + (b + c) = a + b + c (same for multiplication) Distributivity: a × (b + c) = a × b + a × c Identity: a + 0 = a; a × 1 = a Inverse: a + (−a) = 0; a × (1/a) = 1; We now present analogous laws in logic Commutativity: p ∨ q = q ∨ p; p ∩ q = q ∩ p Associativity: p ∨ (q ∨ r) = (p ∨ q) ∨ r, similarly for ∩ Distributivity: p ∩ (q ∨ r) = (p ∩ q) ∨ (p ∩ r) Identity: p ∨ F = p; p ∩ T = p Complement: p ∨ ¬p = T; p ∩ ¬p = F