Presentation is loading. Please wait.

Presentation is loading. Please wait.

05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2.

Similar presentations


Presentation on theme: "05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2."— Presentation transcript:

1 05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2

2 05 BA2 Page 2 ECEn/CS 224 Inversion Inversion or Complement of a Function means all 0 outputs become 1 and all 1 outputs become 0

3 05 BA2 Page 3 ECEn/CS 224 Inversion DeMorgan’s Laws ( X + Y ) ’ = X ’ Y ’. ( X Y ) ’ = X ’ + Y ’ Proof:

4 05 BA2 Page 4 ECEn/CS 224 DeMorgan’s Laws For N variables: (X 1 + X 2 + X 3 + …+ X n )’ = X 1 ’ X 2 ’ X 3 ’ … X n ’ ( X 1 X 2 X 3 … X n )’ = X 1 ’ + X 2 ’ + X 3 ’ + …+ X n ’

5 05 BA2 Page 5 ECEn/CS 224 DeMorgan’s Laws For complex expressions, apply DeMorgan’s Laws successively Example: F = A’B + AB’ F’= (A’B + AB’)’ = (A’B)’(AB’)’ = (A+B’)(A’+B) = AA’+AB+A’B’+BB’ = AB+A’B’

6 05 BA2 Page 6 ECEn/CS 224 DeMorgan’s Laws Another Example: [ ( a’b + 1)(cd + e’ + 0) ]’ (a’b + 1)’ + (cd + e’ + 0)’ [(a’b)’ 1’] + (cd)’ (e’)’ 0’ (a + b’) 0 + (c’ + d’) e 1 Note: Expression is not simplified

7 05 BA2 Page 7 ECEn/CS 224 DeMorgan’s Laws - One Step Rule [ f ( X 1, X 2, … X N, 0, 1, +, ) ] ’ = f ( X 1 ’, X 2 ’, … X N ’, 1, 0,, +) 1. Replace all variables with the inverse 2. Replace + with and with + 3. Replace 0 with 1 and 1 with 0 Be careful of hierarchy… This is biggest source of errors Before beginning, surround all AND terms with parens

8 05 BA2 Page 8 ECEn/CS 224 Canonical Forms

9 05 BA2 Page 9 ECEn/CS 224 Canonical Forms Is this equality true? –AD + A ’ D ’ + CD ?=? AD + A ’ D ’ + A ’ C Hard to tell –Both look minimized… –But they look different… For many expressions there are multiple minimal forms Miminimizing is not a good way to determine equality

10 05 BA2 Page 10 ECEn/CS 224 Canonical Forms A canonical form is something written in the standard way –Two expressions which are equal will have identical canonical forms Is there a standard (canonical) way of representing boolean expressions?

11 05 BA2 Page 11 ECEn/CS 224 Truth Tables  Canonical? f = AD + A’D’ + CDf = AD + A’D’ + A’C Same truth table -two different minimal expressions. Are truth tables canonical forms?

12 05 BA2 Page 12 ECEn/CS 224 Minterm Expansions Truth table is unique if rows in set order Each row can be numbered Call each row’s AND term a minterm f = AD + A’D’ + A’C f (A,B,C,D) = m0 + m2 + m3 + m4 + m6 + m7 + m9 + m11 + m13 + m15 f (A,B,C,D) =  m(0,2,3,4,6,7,9,11,13,15)

13 05 BA2 Page 13 ECEn/CS 224 Minterms Are these minterms of 4 variables? abcd yes ab’cd’ yes ab’c no, only 3 literals a’bc’bd no, b more than once

14 05 BA2 Page 14 ECEn/CS 224 Minterms have names Note: the order of the variables is significant.

15 05 BA2 Page 15 ECEn/CS 224 Minterm Expansion A minterm expansion is unique f (A,B,C,D) =  m(0,2,3,7) Useful for: –Proving equality –Shorthand for representing boolean expressions

16 05 BA2 Page 16 ECEn/CS 224 Maxterms are POS Equivalents to Minterms Note that maxterms are the inverse of minterms

17 05 BA2 Page 17 ECEn/CS 224 Maxterm Expansion Are these maxterms of 4 variables? a + b + c + d yes a + b’ + c + d’ yes a + b’ + d’ no, only 3 literals a’ + b + c’ + a’ + d no, a’ more than once

18 05 BA2 Page 18 ECEn/CS 224 Maxterm Expansion Any function can be written as a product of maxterms. This is called a: Standard Product of Sums (Standard POS) Use the 0’s for f to write the POS: f (A,B,C) =M 0 M 2 M 3 M 4 f (A,B,C) =  M(0, 2, 3, 4 ) f = (A+B+C)(A+B’+C)(A+B’+C’)(A’+B+C)

19 05 BA2 Page 19 ECEn/CS 224 Maxterm Expansion Maxterm expansions are useful –For the same things as minterm expansions We will use them when we want POS instead of SOP representations

20 05 BA2 Page 20 ECEn/CS 224 Minterm / Maxterm Relationships f (A,B,C) = m 1 + m 5 + m 6 + m 7 f (A,B,C) = M 0 M 2 M 3 M 4 For any function, if a minterm is in the Minterm Expansion, the corresponding maxterm is not in the Maxterm Expansion. Makes it easy to convert between SOP and POS

21 05 BA2 Page 21 ECEn/CS 224 Minterm Example Is this equation true? AD + A’D’ + CD = AD + A’D’ + A’C 1.Write each side as a truth table 2.Compare which minterms each contains Minterm expansions  shorthand truth tables…

22 05 BA2 Page 22 ECEn/CS 224 Minterm Example Minimize the following: f (A,B,C) = m 1 + m 5 + m 7 1.Write out as SOP f = A’B’C + AB’C + ABC 2.Minimize f = B’C + AC minterm expansions  shorthand expressions…

23 05 BA2 Page 23 ECEn/CS 224 Maxterm Example Minimize the following: f (A,B,C) = M 1 M 5 M 7 1.Write out as SOP f = (A+B+C’)(A’+B+C’)(A’+B’+C’) 2.Minimize f = (B+C’)(A’+C’) maxterm expansions  shorthand expressions…

24 05 BA2 Page 24 ECEn/CS 224 Minterm/Maxterm Example Convert the following to POS: F = AB + C 1.Write minterm expansion F = m1+m3+m5+m6+m7 (use truth table if it helps) 2.Convert to maxterm expansion F = M0 M2 M4 3.Write POS from maxterm expansion F = (A+B+C)(A+B’+C)(A’+B+C) 4.Simplify if desired F = (B+C)(A+C)

25 05 BA2 Page 25 ECEn/CS 224 Algebraic Simplification

26 05 BA2 Page 26 ECEn/CS 224 Algebraic Simplification Objectives Why Simplify? –Simpler equations  less hardware to implement, faster, cheaper, less power By inspection: f = A’B’C + AB’C + ABC’ + ABC Simplifying: f = A’B’C + AB’C + ABC’ + ABC f = B’C + AB XY’+XY=X 4 3-input AND gates 1 4-input OR gate 2 2-input AND gates 1 2-input OR gate

27 05 BA2 Page 27 ECEn/CS 224 Hardware Cost Exact cost depends on technology –nMOS, CMOS, TTL, I 2 L, GaAs, FPGA, … In general: –Fewer literals  smaller/faster/lower power circuit –Inverters don’t count Free in some technologies Insignificant difference in others

28 05 BA2 Page 28 ECEn/CS 224 Algebraic Simplification: Which Theorems To Use? Suggestions: 1.Focus on yellow ones 2.Create duals on right as needed 3.Be familiar with 4

29 05 BA2 Page 29 ECEn/CS 224 4 Methods of Algebraic Simplification 1.Combine terms 2.Eliminate terms 3.Eliminate literals 4.Add redundant terms

30 05 BA2 Page 30 ECEn/CS 224 Methods of Algebraic Simplification Combine terms Use X Y + X Y’ = X ABC’ + A’B’C + A’BC’ = BC’ + A’B’C Eliminate terms Eliminate literals Add redundant terms

31 05 BA2 Page 31 ECEn/CS 224 Methods of Algebraic Simplification Combine terms Eliminate terms A’B + B ( A’D + C) A’B + A’BD + BC Use X + X Y = X A’B + BC Eliminate literals Add redundant terms

32 05 BA2 Page 32 ECEn/CS 224 Methods of Algebraic Simplification Combine terms Eliminate terms Eliminate literals Use X + X ’ Y = X + Y A’B + A’B’C’D’ + ABCD’ A’( B + B’C’D’) + ABCD’ A’( B + C’D’) + ABCD’ A’B + A’C’D’ + ABCD’ A’C’D’ + B( A’ +ACD’) A’C’D’ + B( A’ +CD’) A’B + BCD’ + A’C’D’ Add redundant terms

33 05 BA2 Page 33 ECEn/CS 224 Methods of Algebraic Simplification Combine terms Eliminate terms Eliminate literals Add redundant terms A’B’C + AB’C + ABC A’B’C + AB’C + AB’C + ABC B’C + AC

34 05 BA2 Page 34 ECEn/CS 224 Proving an Equation is True 1.Construct a truth table for both sides i.Tedious, not very elegant ii.Computers love this method 2.Convert Both Sides to minterm/maxterm expansion 3.Manipulate one side algebraically to equal the other 4.Perform the same operation on both sides

35 05 BA2 Page 35 ECEn/CS 224 Perform the same operation on both sides Valid Operations –Complement –Construct the duals Invalid Operations –Add a term to both sides (not reversible) –Multiply (AND) both sides by a term (not reversible) –Subtract a term from both sides (subtraction?)

36 05 BA2 Page 36 ECEn/CS 224 Proving an Equation Add a term to both sides Prove y = z Add 1 to both sides y + 1 = z + 1 Use X + 1 = 1 1 = 1 Therefore y = z But not really, you cannot add an arbitrary term to both sides. This does not prevent you from duplicating an existing term: Y = Z  Y+Y = Z

37 05 BA2 Page 37 ECEn/CS 224 Proving an Equation Multiply (AND) both sides by a term Prove y = z Multiply both sides by 0 y 0 = z 0 Use X 0 = 0 0 = 0 Therefore y = z But not really, you cannot multiply both sides by an arbitrary term But, you can multiply by a redundant existing term: y z = y y z

38 05 BA2 Page 38 ECEn/CS 224 Proving an Equation is False Show one combination of values which is false (counter example) Use Boolean algebra manipulation –Reduce to sum of products form –Minimize –Compare the 2 sides –Be careful – some expressions have >1 minimal forms…

39 05 BA2 Page 39 ECEn/CS 224 Converting English to Boolean Expressions

40 05 BA2 Page 40 ECEn/CS 224 The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

41 05 BA2 Page 41 ECEn/CS 224 1. Identify phrases F = air conditioner should be turned on A = temperature is greater than 75  B = time is between 8a.m. and 5 p.m C = it is not a holiday The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

42 05 BA2 Page 42 ECEn/CS 224 2. Identify connective words implied and = The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

43 05 BA2 Page 43 ECEn/CS 224 3. Construct a Boolean Expression F = air conditioner should be turned on A = temperature is greater than 75  B = time is between 8a.m. and 5 p.m C = it is not a holiday F = A B C’ The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday.

44 05 BA2 Page 44 ECEn/CS 224 4. Draw the Network F = A B C’ The air conditioner should be turned on if and only if: - the temperature is greater than 75 , - the time is between 8a.m. and 5 p.m., - and it is not a holiday. B A C F

45 05 BA2 Page 45 ECEn/CS 224 Converting English to Boolean 1. Identify phrases 2. Identify connective words 3. Construct a Boolean Expression 4. Draw the Network

46 05 BA2 Page 46 ECEn/CS 224 Converting English to Boolean Be careful: Boolean algebra is precise, English is not. The roads will be very slippery if it snows or rains and there is oil on the road. F = A + BC or F = (A + B) C A B C Which is it?

47 05 BA2 Page 47 ECEn/CS 224 AND/OR vs. OR/AND Logic Forms

48 05 BA2 Page 48 ECEn/CS 224 AND/OR Logic from Truth Table 1. Write the SOP by inspection from f ABCABC f f = A’B’C +AB’C + ABC’ + ABC

49 05 BA2 Page 49 ECEn/CS 224 AND/OR Logic from Truth Table 2. Simplify the equation f = A’B’C +AB’C + ABC’ + ABC f = (A + A’) B’C + AB ( C + C’) f = AB + B’C

50 05 BA2 Page 50 ECEn/CS 224 AND/OR Logic from Truth Table 3. Draw the logic network f = AB + B’C A B C f

51 05 BA2 Page 51 ECEn/CS 224 OR/AND Logic from Truth Table ABCABC f f ‘ = A’B’C’ + A’BC’ + AB’C’ f = (A + B + C)(A + B’ + C)(A’ + B + C) 1.Write a POS by inspection from f

52 05 BA2 Page 52 ECEn/CS 224 OR/AND Logic from Truth Table 3. Simplify the equation: f = (B+C)(A+C) 4. Draw the logic network A C B C f

53 05 BA2 Page 53 ECEn/CS 224 Incompletely Specified Functions

54 05 BA2 Page 54 ECEn/CS 224 Incompletely Specified Functions wxyzwxyz ABCABC F N1N1 N2N2 Known: N 1 does not generate outputs A B C with values of 101 or 111 The X’s represent don’t care – since those input combos never occur, you don’t care what the output is.

55 05 BA2 Page 55 ECEn/CS 224 Incompletely Specified Functions f 1 = A’B’C + AB’C’ + ABC’ f 1 = A’B’C + AC’ f 2 = A’B’C + AB’C’ + ABC’ + ABC f 2 = A’B’C + AC’(B’ + B) + AB(C’ + C) f 2 = A’B’C + AC’ + AB Worse than f 1 Multiple ways to choose those X’s when minimizing. Cost of minimal solution will depend on which one chosen.

56 05 BA2 Page 56 ECEn/CS 224 Incompletely Specified Functions f 1 = A’B’C + AC’ f 3 = A’B’C + AB’C’ + AB’C + ABC’ f 3 = A’C( B + B’) + AB’( C’ + C) f 3 = A’C + AB’ Better than f 1 f 4 = A’B’C + AB’C’ + AB’C + ABC’ + ABC f 4 = (A’ + A)B’C+ AB’(C’ + ’C) + AB(C’ + C) f 4 = B’C+ AB’ + AB = B’C + A Best

57 05 BA2 Page 57 ECEn/CS 224 Incompletely Specified Functions If the function has n don’t cares –Must solve 2 n truth tables –Ouch A better way will be shown in a later chapter…

58 05 BA2 Page 58 ECEn/CS 224 Don’t Cares - Minterm Representation Use d 0 … d 7 to represent don’t care minterms F = m 1 + m 4 + m 6 + d 5 + d 7 F =  m( 1, 4, 6) +  d( 5, 7)

59 05 BA2 Page 59 ECEn/CS 224 Don’t Cares - Maxterm Representation Use D 0 … D 7 to represent don’t care maxterms F = M 0 M 2 M 3 D 5 D 7 F =  M(0, 2, 3)  D(5, 7)


Download ppt "05 BA2 Page 1 ECEn/CS 224 Boolean Algebra – Part 2."

Similar presentations


Ads by Google