CH3 Boolean Algebra (cont d) Lecturer: 吳 安 宇 Date:2005/10/7 ACCESS IC LAB
v Today, you ll know: Introduction 1. Guidelines for multiplying out/factoring expressions 2. Exclusive-OR and Equivalence operations 3. Positive logic and negative logic 4. More about consensus theorem 5. Algebraic simplification of switching expressions 6. Approach to prove validity of an equation 7. The difference between ordinary algebra and Boolean algebra pp. 2
Guidelines for Multiplying Out and Factoring vuse X(Y+Z) = XY + XZ...(1) (X+Y)(X+Z) = X + YZ...(2) (X+Y)(X +Z) = XZ + X Y...(3) vfor multiplying out, (2) and (3) should be generally applied before (1) to avoid generating unnecessary terms vfor factoring, apply (1), (2), (3) from right terms to left terms pp. 3
Multiplying Out Expression EX. F = (Q + AB)(C D + Q ) = QC D + Q AB or F = QC D + QQ + AB C D + AB Q EX. (A+B+C )(A+B+D)(A+B+E)(A+D +E)(A +C) = (A+B+C D)(A+B+E)[AC+A (D +E)] Distributed Law = (A+B+C DE)(AC+A D +A E) = AC+ABC+A BD +A BE+A C DE (SOP form) => By brute force => 162 terms pp. 4
Factoring Expression v EX. AC + A BD + A BE + A C DE = AC + A (BD + BE + C DE) XZ + X Y = (X + Y)(X + Z) = (A + BD + BE + C DE)(A + C) = [ A + C DE + B (D + E) ](A + C) X + YZ = (X+Y)(X+Z) = (A + C DE + B)(A + C DE + D + E)(A + C) = (A + B + C )(A + B + D)(A + B + E)(A + D + E)(A + C) pp. 5
3.2 Exclusive-OR Operations vexclusive-or (XOR) X Y X Y 0 0 0 1 1 0 1 1 0 1 1 0 Truth Table Symbol Boolean Expression : X Y = X Y + XY pp. 6
Exclusive-OR Operations vuseful Theorems : X 0 = X X Y = Y X (commutative) X 1 = X (X Y) Z = X (Y Z) (associative) X X = 0 X(Y Z) = XY XZ (distributive) X X = 1 (X Y) = X Y = X Y = XY + X Y pp. 7
Proof of Distributive Laws vxy XZ = XY(XZ) + (XY) XZ = XY(X + Z ) + (X + Y )XZ = XYZ +XY Z = X(YZ + Y Z) = X(Y Z) pp. 8
Equivalence Operations (Exclusive NOR) X Y X Y (X Y) 0 0 0 1 1 0 1 1 1 0 0 1 1 0 0 1 X Y = XY + X Y pp. 9
Simplification of XOR and XNOR vx X Y = X Y + XY Y = X Y + XY EX (see p.62). F = (A B C) + (B AC ) = [(A B)C + (A B) C ] + [B (AC ) + B(AC ) ] = A BC + (A+B )C + AB C + B(A +C) = B(A C + A + C) + C(A + B + AB ) = B(A + C) + C (A + B ) ( can be further simplified) pp. 10
3.3 Consensus Theorem XY + X Z + YZ = XY + X Z (YZ is redundant ) Proof : XY + X Z + YZ = XY + X Z + (X + X )YZ = (XY + XYZ) + (X Z + X YZ) = XY(1 + Z) + X Z(1 + Y) = XY + X Z pp. 11
How to Find Consensus Term? 1. Find a pair of terms, one of which contains a variable and the other contains its complement A C D + A BD + BCD + ABC + ACD (A A ) 2. Ignore the variable and its complement, the left variables composite the consensus term (A BD) + (ABC) BD BC = BCD (redundant term) pp. 12
Consensus Theorem vapplication to eliminate redundant terms from Boolean Expressions a b + ac + bc + b c +ab = a b + ac + bc pp. 13
Consensus Theorem Dual form of consensus theorem (X + Y)(X + Z)(Y + Z) = (X + Y)(X + Z) Example (others are on p.67) : (a + b + c )(a + b + d )(b + c + d ) = (a + b + c )(b + c + d ) (a+ b + c ) + (b + c +d ) a+b + b+d = a+b+d Simplification of Boolean Expression can reduce the cost of realizing the network using gates pp. 14
Algebraic Simplification of Switching Expression va. Combining Terms XY + XY =X(Y + Y ) = X EX.1 abc d + abcd = abd (X = abd, Y = c) EX.2 ab c + abc + a bc = ab c + abc + abc + a bc = ac + bc EX.3 (a + bc)(d + e ) + a (b + c )(d + e ) = d + e pp. 15
Algebraic Simplification of Switching Expression vrule B -- Eliminating Terms : X + XY = X XY + X Z + YZ = XY + X Z EX.1 a b + a bc = a b (X = a b) a bc + bcd + a bd = a bc + bcd (X = c, Y = bd, Z = a b) pp. 16
Algebraic Simplification of Switching Expression vrule C -- Eliminating Literals : X + X Y = (X + X )(X + Y) = X + Y EX. A B + A B C D + ABCD = A (B + B C D ) + ABCD (common term -A ) = A (B + C D ) + ABCD (Rule C) = B(A + ACD) + A C D (common term -B) = B(A + CD) + A C D (Rule C) = A B + BCD + A C D (final terms) pp. 17
Algebraic Simplification of Switching Expression vrule D -- Adding Redundant Terms vadd XX = 0 vmultiply by (X + X ) = 1 vadd YZ to (XY + X Z) (reverse of Consensus) Because XY + X Z + YZ = XY + X Z vadd XY to X pp. 18
Algebraic Simplification of Switching Expression vex.1 of Adding Redundant Terms WX + XY + X Z + WY Z = WX + XY + X Z + WY Z + W Z (add W Z by Consensus Theorem) = WX + XY + X Z + WZ (eliminate WY Z by WZ ) = WX + XY + X Z pp. 19
Algebraic Simplification of Switching Expression EX.2 A B C D + A BC D + A BD + A BC D + ABCD + ACD + B CD = A C D + A BD + B CD + ABC (A, B, C, D methods are applied) No easy way to determine when a Boolean Expression has a min. no. of terms or literals Systematic way is presented in Ch.5 & CH.6 pp. 20
Proving Validity of an Equation vapproach : vconstruct a Truth Table vmanipulate one side of the equation till it s identical to the other side vreduce both sides independently to the same equation v(a) Perform same operation on both sides (b) Cannot Subtract or Divide both sides (Subtraction, Division NOT defined) pp. 21
Proving Validity of an Equation vusually : vreduce both sides to Sum of Products (SOP) vcompare both sides vtry to Add or Delete terms by using Theorems pp. 22
Proving Validity of an Equation vex.1 Show that A BD + BCD + ABC + AB D = BC D + AD + A BC By Consensus Theorem : A BD + BCD + ABC + AB D + BC D + A BC + ABD = AD + A BD + BCD + ABC + BC D + A BC 1 2 3 1 + 2 1 + 3 2 + 3 = AD + BC D + A BC pp. 23
Proving Validity of an Equation vex.2 Show A BC D + (A + BC)(A + C D ) + BC D + A BC = ABCD + A C D + ABD + ABCD + BC D Reducing the left side A BC D + (A + BC)(A + C D ) + BC D + A BC = (A + BC)(A + C D ) + BC D + A BC = ABC + A C D + BC D + A BC = ABC + A C D + BC D pp. 24
Proving Validity of an Equation vex.2(cont.) vreducing the left side ABCD + A C D + ABD + ABCD + BC D = ABC + A C D + ABD + BC D = ABC + A C D + BC D Because both sides were independently reduced to the same expression, the original equation is valid pp. 25
Boolean Algebra & Ordinary Algebra vboolean Algebra Ordinary Algebra EX.1 X + Y = X + Z => Y = Z (?) X = 1, Y = 0 => 1 + 0 = 1 + 1 But 0 1 EX.2 If XY = XZ then Y = Z True : when X 0 False : when X = 0 pp. 26
Boolean Algebra & Ordinary Algebra vex.3 if Y = Z then X + Y = X + Z (V) if Y = Z then XY = XZ (V) Add/Multiply the same term => Valid Subtract/Divide the same term => Not Valid Check programmed exercise 3.1, 3.2,,3.5 for practice pp. 27