Switching Algebra W pp. 194-206 Logic What is a logical argument? an argument that is true by virtue of its form; i.e. if premises true conclusion must be true Positive example P1) All men are mortal P2) Harry is a man ----------------C) Therefore, Harry is mortal Negative examples P1) If I study hard in 200, I will get an A. P2) I got an A in 200. -----------------C) Therefore, I studied hard. P1) Katz believes that 200 is easy. P2) Katz is a dufus. ------------------C) Therefore, 200 is difficult. In the mid-19th century, Boole formalized logic. We will be studying a subset of formal logic known as the propositional calculus. Switching Algebra Axioms of the propositional calculus (1) All variables must take one of the values 0 or 1 (2) Rules for not X X’ W pp. 194-206 ----------0 1 1 0 (3) Rules for and X Y X·Y ---------------------0 0 0 0 1 0 1 0 0 1 1 1 (4) Rules for or X Y X+Y -----------------------0 0 0 0 1 1 1 0 1 1 1 1 Switching Algebra W pp. 194-206 Theorems of the propositional calculus (T1) (T2) (T3) (T4) (T5) (T6) (T7) (T8) (T9) theorem X+0=X X+1=1 X+X=X (X’)’ = X X + X’ = 1 X+Y=Y+X (X + Y) + Z = X + (Y + Z) X · Y + X · Z = X · (Y + Z) (X · Y)’ = X’ + Y’ Proof by truth table dual X ·1=X X ·0=0 X ·X=X (X’)’ = X X · X’ = 0 X·Y=Y·X (X + Y) + Z = X + (Y + Z) (X + Y) · (X + Z) = X + Y · Z (X + Y)’ = X’ · Y’ name identity null elements idempotency involution complement commutativity associativity distributivity DeMorgan’s Fact All theorems of the pc can be proven with a truth table, i.e., by systematically examining every case and showing that the theorem hold for these cases (this method also is known as perfect induction). Examples Prove (T5): X 0 1 X’ 1 0 X + X’ 1 1 Prove the dual of (T9): X Y X+Y (X + Y)’ X’ Y’ X’ · Y’ 0 0 1 1 0 0 1 1 0 1 0 1 1 0 0 0 1 0 0 1 1 1 1 1 Switching Algebra 0 0 W pp. 194-206 Proof by simplification Method Successive application of previously proven theorems to produce a shorter expression Example Prove T9: X+X·Y=X X+X·Y =X·1+X·Y = X · (1 + Y) =X·1 =X (T1 dual) (T8) (T2) (T1 dual) Advantages and disadvantages advantage - no need to provide destination disadvantage - need to choose among existing theorems 0 0 Duality Principle Any theorem or identity remains true if 0 and 1 are swapped and · and + are swapped throughout. Generalized DeMorgan [F(X1, X2, .... Xn )]’ = FD(X1’, X2’, .... Xn’ ) Switching Algebra W pp. 194-206 Minterm and Maxterm representations of a function row# X Y Z minterm maxterm 0 0 0 0 X’Y’Z’ X+Y+Z 1 0 0 1 X’Y’Z X+Y+Z’ 2 0 1 0 X’YZ’ X+Y’+Z 3 0 1 1 X’YZ X+Y’+Z’ 4 1 0 0 XY’Z’ X’+Y+Z 5 1 0 1 X’YZ’ X+Y’+Z 6 1 1 0 XYZ’ X’+Y’+Z 7 1 1 1 XYZ X’+Y’+Z’ Principle A function can be represented as a) the sum of the minterms where the function is true, OR b) the product of the maxterms where the function is false Example F = X’ + YZ row# 0 1 2 3 4 5 X 0 0 0 0 1 1 Y 0 0 1 1 0 0 Z 0 1 0 1 0 1 minterm X’Y’Z’ X’Y’Z X’YZ’ X’YZ XY’Z’ X’YZ’ maxterm X+Y+Z X+Y+Z’ X+Y’+Z X+Y’+Z’ X’+Y+Z X+Y’+Z F 1 1 1 1 0 0 6 7 1 1 1 1 0 1 XYZ’ XYZ X’+Y’+Z X’+Y’+Z’ 0 1 minterm representation X,Y,Z(0,1,2,3,7) = X’Y’Z’ + X’Y’Z + X’YZ’ + X’YZ + XYZ maxterm representation X,Y,Z(4,5,6) = (X’+Y+Z) (X+Y’+Z) (X’+Y’+Z) Switching Algebra W pp. 194-206 Why are minterm and maxterm representations equivalent? a) [X,Y,Z(i,j...n)]’ = X,Y,Z(i,j...n) b) but, X,Y,Z(i,j...n) is just the inverse of X,Y,Z(p,q,..r), where p,q,..r are the complement of i,j,..n c) therefore, by the principle of double negation, X,Y,Z(i,j...n) = X,Y,Z(p,q,..r) Terminology review There are two equivalent representations of a function: i) X,Y,Z sum of minterms sum of products (SOP) ii) X,Y,Z product of maxterms product of sums (POS) Combinational-Circuit Analysis Basic gates W pp. 209-214 And gate Or gate Not gate Combinational-Circuit Analysis W pp. 209-214 Truth Table from Circuit Examples easy harder