Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result.

Similar presentations


Presentation on theme: "Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result."— Presentation transcript:

1 Logic Gate Level Part 2

2 Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result column of the truth table Works best for table with relatively few 1s in the result column abcx 0000 0011 0100 0111 1000 1010 1100 1110 In the truth table above, x=1 for abc = 001 or 011; so x= a’b’c + a’bc

3 Logic diagram for x= a’b’c + a’bc

4 Sum of products representation In Discrete Math (at least, back in the day), we call this representation (OR of ANDs) the sum of products expansion or disjunctive normal form This representation is a reflection of 2 fun facts: – Any Boolean function may be represented by a Boolean sum of Boolean products of the variables and their complements – All Boolean functions can be represented using only 1 operator (we’ll get back to this one!)

5 5 Sum-of-products example 1 Construct Boolean expressions representing functions with the given values: x y z F G 1 1 1 0 0 1 1 0 1 0 1 0 1 0 1 1 0 0 0 0 0 1 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 F has value 1 only when x=1, y=1, and z=0; one such expression is the Boolean product xyz’ G has value 1 when either x and z are 1, y is 0 or when x and z are 0, y is 1 The first condition is met by xy’z The second is met by x’yz’ So G can be represented by the Boolean sum of the 2 products: xy’z + x’yz’

6 Logic diagrams from previous slide xyz’ xy’z + x’yz’

7 7 Sum-of-products example 2 Find the sum-of-products expansion for F(x,y,z) = (x+y)z’ x y z x+y z’ (x+y)z’ 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 0 0 1 0 0 1 1 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0 0 0 0 0 1 0 The sum-of-products expansion is the Boolean sum of 3 minterms corresponding to the rows that show 1 for the values of F: xyz’ + xy’z’ + x’yz’

8 Logic diagram from previous slide xyz’ + xy’z’ + x’yz’

9 Constructing Boolean expression from truth table Second method: dual technique Create AND of several ORs Each OR is a 0 in the results column Use complements of input combinations that produce the 0 result In the table above, x=0 for abc = 011 and 110 So x = (a+b’+c’)(a’+b’+c)

10 Logic gate for previous slide (a+b’+c’)(a’+b’+c)

11 11 Conjunctive normal form Can find a Boolean expression that represents a Boolean function by taking a Boolean product of Boolean sums - this is the conjunctive normal form or product-of-sums expansion We can find the product-of-sums from sum- of-products by taking duals; for this function: xyz’ + xy’z’ + x’yz’ The product-of-sums is: (x’ + y’ + z)(x’ + y + z)(x + y’ + z)

12 Previous circuit (& its dual) (x’ + y’ + z)(x’ + y + z)(x + y’ + z) xyz’ + xy’z’ + x’yz’

13 13 Functional completeness Every Boolean function can be expressed as a Boolean sum of products Each product is the Boolean product of Boolean variables or their complements So every Boolean function can be represented using Boolean operators., +, and ’ We say that the set {., +, ’} is functionally complete

14 14 Functional completeness If one of the operators from the set {., +, ’} can be expressed in terms of the other two, we can find a smaller set of functionally complete operators We can do this using DeMorgan’s law: x + y = (x’y’)’ (We obtain this by taking complements of both sides of DeMorgan’s second law, then applying double complementation)

15 15 Functional completeness Using DeMorgan’s law, as stated on the previous slide, we can eliminate sums; this means the set {., ’} is functionally complete Using DeMorgan’s first law we can similarly show that the set { +, ’} is functionally complete

16 16 Functionally complete sets containing one operator NAND: {|} 1|1 = 0, 1|0 = 1, 0|1 = 1, 0|0 = 1 NOR: {  } 1  1 = 0, 1  0 = 0, 0  1 = 0, 0  0 = 1 NAND is functionally complete, since: {., ’} is functionally complete and x’ = x|x and xy = (x|y)|(x|y) We can similarly show that NOR is functionally complete

17 Why do we care about this? Keeping circuits as simple as possible isn’t just a nice thing for humans – it improves performance of devices Gate delay: the time it takes for the output of a gate to respond to a change in its input Delay may be significant with a long string of gates – next example is a case in point

18 Logic diagram for (a’bc  c + a + d)’ This diagram is an abbreviated version, omitting the connector lines for a and a’ (the a’ symbol is understood to be input a passing through an inverter) and for input c to 2 different gates (AND and XOR) and shows input d only where it’s relevant (NOR gate) It’s a reasonable representation for the given expression, but it involves 3 gates (because b is a direct or indirect input to all 3); general rule is to try to keep circuits to 2 or less

19 Reducing number of gates reduces gate delay Because of functional completeness, any boolean expression can be written as an OR of ANDed terms – in other words, a two-level AND-OR network Therefore, any function can be implemented with a combinational net with no more than 2 gate delays Same principle applies to dual; can transform any expression into AND of ORed terms if this is more convenient: 2-level OR-AND network

20 Reducing the original expression We apply the rules of Boolean algebra to transform expression to sum of products: (a’bc  c + a + d)’ – transforms, by definition of XOR, to: (a’bcc’ + (a’bc)’c + a + d)’ – we can lose the first term because cc’=0 by complementation, and a’b  0 = 0: ((a’bc)’c + a + d)’ – applying DeMorgan’s law: ((a+b’+c’)c + a + d)’ – applying distribution, complement and identity: (ac + b’c + a + d)’

21 Reduction continued (ac + b’c + a + d)’ – rearranging and applying absorption (ac+c = a): (a + b’c + d)’ – applying DeMorgan : a’(b’c)’d’ – and DeMorgan again: a’(b+c’)d’ – and then distribution: a’bd’ + a’c’d’ – which is a sum of products

22 Result of reduction: 2-level network transforms to:

23 Equivalent gates Recall DeMorgan’s laws: (abc)’ = a’+b’+c’ (a+b+c)’ = a’b’c’ From these we can derive the equivalent gates shown below:

24 Replacing AND-OR net with NAND-NAND net


Download ppt "Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result."

Similar presentations


Ads by Google