670 likes | 689 Views
Digital Design & Computer Architecture Dr. Robert D. Kent. Lecture 2b Gates & Combinational Networks, Simplification of Boolean Expressions. Circuit Design for Computers. We continue developing the basic notions required for the design of digital circuits for computers.
E N D
Digital Design & Computer Architecture Dr. Robert D. Kent Lecture 2b Gates & Combinational Networks, Simplification of Boolean Expressions
Circuit Design for Computers • We continue developing the basic notions required for the design of digital circuits for computers. • We have defined the Boolean Algebra and its important aspects • axioms • elements, literals, constants • operators • Boolean calculus as expression manipulation • theorems • Our next goal is to develop and employ methods for expressing combinational circuits and, in particular, techniques for simplifying the logic.
Boolean Expressions - Expansion Theorem • Shannon, the pioneer who developed information theory, also provides several powerful theorems useful in manipulating boolean expressions.
Boolean Expressions - Expansion Theorem • Shannon, the pioneer who developed information theory, also provides several powerful theorems useful in manipulating boolean expressions. • The first theorem is the Expansion Theorem.(a) f(x1, …, xk, …, xN) = xk .f(x1, …, 1, …, xN) + xk’.f(x1, …, 0, …, xN)(b) f(x1, …, xk, …, xN) = [xk + f(x1, …, 0, …, xN)] . [xk’ + f(x1, …, 1, …, xN)]
Boolean Expressions - Expansion Theorem • Shannon, the pioneer who developed information theory, also provides several powerful theorems useful in manipulating boolean expressions. • The first theorem is the Expansion Theorem.(a) f(x1, …, xk, …, xN) = xk .f(x1, …, 1, …, xN) + xk’.f(x1, …, 0, …, xN)(b) f(x1, …, xk, …, xN) = [xk + f(x1, …, 0, …, xN)] . [xk’ + f(x1, …, 1, …, xN)] • In the expressions above, the values 1 (or 0) are substituted for the variable xk whereever it appears in the function f. Note the duality between (a) and (b) expressions.
Boolean Expressions - Expansion Theorem • Example: Given the expressionf(w,x,y,z) = w’x’ + (wx + y)zAssume you want an expression of the form: f = x g1(w,y,z)+x’ g2(w,y,z)
Boolean Expressions - Expansion Theorem • Example: Given the expressionf(w,x,y,z) = w’x’ + (wx + y)zAssume you want an expression of the form: f = x g1(w,y,z)+x’ g2(w,y,z)Then, using g1(w,y,z) = f(w,1,y,z) andg2(w,y,z) = f(w,0,y,z),
Boolean Expressions - Expansion Theorem • Example: Given the expressionf(w,x,y,z) = w’x’ + (wx + y)zAssume you want an expression of the form: f = x g1(w,y,z)+x’ g2(w,y,z)Then, using g1(w,y,z) = f(w,1,y,z) andg2(w,y,z) = f(w,0,y,z),f = x [w’.1’ + (w.1 + y)z] +x’ [w’.0’ + (w.0 + y)z]
Boolean Expressions - Expansion Theorem • Example: Given the expressionf(w,x,y,z) = w’x’ + (wx + y)zAssume you want an expression of the form: f = x g1(w,y,z)+x’ g2(w,y,z)Then, using g1(w,y,z) = f(w,1,y,z) andg2(w,y,z) = f(w,0,y,z),f = x [w’.1’ + (w.1 + y)z] +x’ [w’.0’ + (w.0 + y)z] = x [w’.0 + (w + y)z] +x’ [w’.1 + (0 + y)z]
Boolean Expressions - Expansion Theorem • Example: Given the expressionf(w,x,y,z) = w’x’ + (wx + y)zAssume you want an expression of the form: f = x g1(w,y,z)+x’ g2(w,y,z)Then, using g1(w,y,z) = f(w,1,y,z) andg2(w,y,z) = f(w,0,y,z),f = x [w’.1’ + (w.1 + y)z] +x’ [w’.0’ + (w.0 + y)z] = x [w’.0 + (w + y)z] +x’ [w’.1 + (0 + y)z] = w’ = 0
Boolean Expressions - Expansion Theorem • Example: Given the expressionf(w,x,y,z) = w’x’ + (wx + y)zAssume you want an expression of the form: f = x g1(w,y,z)+x’ g2(w,y,z)Then, using g1(w,y,z) = f(w,1,y,z) andg2(w,y,z) = f(w,0,y,z),f = x [w’.1’ + (w.1 + y)z] +x’ [w’.0’ + (w.0 + y)z] = x [w’.0 + (w + y)z] +x’ [w’.1 + (0 + y)z] = x (w + y) z +x’ (w’ + y.z)
Boolean Expressions - Expansion Theorem • Example: Given the expressionf(w,x,y,z) = w’x’ + (wx + y)zAssume you want an expression of the form: f = x g1(w,y,z)+x’ g2(w,y,z)Then, using g1(w,y,z) = f(w,1,y,z) andg2(w,y,z) = f(w,0,y,z),f = x [w’.1’ + (w.1 + y)z] +x’ [w’.0’ + (w.0 + y)z] = x [w’.0 + (w + y)z] +x’ [w’.1 + (0 + y)z] = x (w + y) z +x’ (w’ + y.z) This technique can be reapplied to generate successive product expressions by expanding g1(w,y,z) andg2(w,y,z) and so on.
Boolean Expressions - Reduction Theorem • The next set of theorems from Shannon concern reduction of the expression to a product form in one variable.
Boolean Expressions - Reduction Theorem • The next set of theorems from Shannon concern reduction of the expression to a product form in one variable. • Given a function of N variables, f(x1, …, xk, …, xN), the first part of the Reduction Theorem deals with the variable xk.(a) xk . f(x1, …, xk, …, xN) = xk .f(x1, …, 1, …, xN)(b) xk + f(x1, …, xk, …, xN) = xk + f(x1, …, 0, …, xN)
Boolean Expressions - Reduction Theorem Xk only! • The next set of theorems from Shannon concern reduction of the expression to a product form in one variable. • Given a function of N variables, f(x1, …, xk, …, xN), the first part of the Reduction Theorem deals with the variable xk.(a) xk . f(x1, …, xk, …, xN) = xk .f(x1, …, 1, …, xN)(b) xk + f(x1, …, xk, …, xN) = xk + f(x1, …, 0, …, xN) • In the expressions above, the values (a) 1 or (b) 0 are substituted for the variable xk whereever it appears in the function f.
Boolean Expressions - Reduction Theorem • Given a function of N variables, f(x1, …, xk, …, xN), the second part of the Reduction Theorem deals with the complement of the variable xk’.
Boolean Expressions - Reduction Theorem • Given a function of N variables, f(x1, …, xk, …, xN), the second part of the Reduction Theorem deals with the complement of the variable xk’.(c) xk’ . f(x1, …, xk, …, xN) = xk’ . f(x1, …, 0, …, xN)(d) xk’ + f(x1, …, xk, …, xN) = xk’ + f(x1, …, 1, …, xN)
Boolean Expressions - Reduction Theorem Xk’ only! • Given a function of N variables, f(x1, …, xk, …, xN), the second part of the Reduction Theorem deals with the complement of the variable xk’.(c) xk’ . f(x1, …, xk, …, xN) = xk’ . f(x1, …, 0, …, xN)(d) xk’ + f(x1, …, xk, …, xN) = xk’ + f(x1, …, 1, …, xN) • In the expressions above, the values (c) 0 or (d) 1 are substituted for the variable xk’ whereever it appears in the function f.
Boolean Expressions - Reduction Theorem • Example: Given the expressionf(w,x,y,z) = x + x’y’ + w’x’(w + z)(y+w’z)
Boolean Expressions - Reduction Theorem • Example: Given the expressionf(w,x,y,z) = x + x’y’ + w’x’(w + z)(y+w’z)Then, definingg(w,x,y,z) = x’y’ + w’x’(w + z)(y+w’z)
Boolean Expressions - Reduction Theorem • Example: Given the expressionf(w,x,y,z) = x + x’y’ + w’x’(w + z)(y+w’z)Then, definingg(w,x,y,z) = x’y’ + w’x’(w + z)(y+w’z) we arrive at the expression: f = x + g(w,x,y,z)
Boolean Expressions - Reduction Theorem • Example: Given the expressionf(w,x,y,z) = x + x’y’ + w’x’(w + z)(y+w’z)Then, definingg(w,x,y,z) = x’y’ + w’x’(w + z)(y+w’z) we arrive at the expression: f = x + g(w,x,y,z)By the reduction theorem (b), it follows thatf = x + g(w,0,y,z)
Boolean Expressions - Reduction Theorem • Example: Given the expressionf(w,x,y,z) = x + x’y’ + w’x’(w + z)(y+w’z)Then, definingg(w,x,y,z) = 0’.y’ + w’ 0’.(w + z)(y+w’z) we arrive at the expression: f = x + g(w,x,y,z)By the reduction theorem (b), it follows thatf = x + g(w,0,y,z)
Boolean Expressions - Reduction Theorem • Example: Given the expressionf(w,x,y,z) = x + x’y’ + w’x’(w + z)(y+w’z)Then, definingg(w,x,y,z) = 1 .y’ + w’ 1 .(w + z)(y+w’z) we arrive at the expression: f = x + g(w,x,y,z)By the reduction theorem (b), it follows thatf = x + g(w,0,y,z) = x + y’ + w’ . (w + z)(y+w’z)
Boolean Expressions - Reduction Theorem • Continuing, f(w,x,y,z) = x + y’ + w’ . (w + z)(y+w’z)
Boolean Expressions - Reduction Theorem • Continuing, f(w,x,y,z) = x + y’ + w’ . (w + z)(y+w’z) From the third term, we now define h(w,y,z) = (w + z)(y+w’z)
Boolean Expressions - Reduction Theorem • Continuing, f(w,x,y,z) = x + y’ + w’ . (w + z)(y+w’z) From the third term, we now define h(w,y,z) = (w + z)(y+w’z) and arrive at the expression: f = x + y’ + w’ . h(w,y,z)
Boolean Expressions - Reduction Theorem • Continuing, f(w,x,y,z) = x + y’ + w’ . (w + z)(y+w’z) From the third term, we now define h(w,y,z) = (w + z)(y+w’z) and arrive at the expression: f = x + y’ + w’ . h(w,y,z) By the reduction theorem (c), it follows that f = x + y’ + w’ . [(0 + z)(y+0’.z) ]
Boolean Expressions - Reduction Theorem • Continuing, f(w,x,y,z) = x + y’ + w’ . (w + z)(y+w’z) From the third term, we now define h(w,y,z) = (w + z)(y+w’z) and arrive at the expression: f = x + y’ + w’ . h(w,y,z) By the reduction theorem (c), it follows that f = x + y’ + w’ . [(0 + z)(y+0’.z) ] = x + y’ + w’.z(y+z)
Boolean Expressions - Reduction Theorem • Again, continuing, f(w,x,y,z) = x + y’ + w’.z(y+z)
Boolean Expressions - Reduction Theorem • Again, continuing, f(w,x,y,z) = x + y’ + w’.z(y+z) Defining k(w,x,y,z) = x + w’.z(y+z) it follows thatf(w,x,y,z) = y’ + k(w,x,y,z)
Boolean Expressions - Reduction Theorem • Again, continuing, f(w,x,y,z) = x + y’ + w’.z(y+z) Defining k(w,x,y,z) = x + w’.z(y+z) it follows thatf(w,x,y,z) = y’ + k(w,x,y,z) Using reduction theorem (d) we findf(w,x,y,z) = y’ + k(w,x,1,z)
Boolean Expressions - Reduction Theorem • Again, continuing, f(w,x,y,z) = x + y’ + w’.z(y+z) Defining k(w,x,y,z) = x + w’.z(y+z) it follows thatf(w,x,y,z) = y’ + k(w,x,y,z) Using reduction theorem (d) we findf(w,x,y,z) = y’ + k(w,x,1,z) = y’ + x + w’.z(1+z)
Boolean Expressions - Reduction Theorem • Again, continuing, f(w,x,y,z) = x + y’ + w’.z(y+z) Defining k(w,x,y,z) = x + w’.z(y+z) it follows thatf(w,x,y,z) = y’ + k(w,x,y,z) Using reduction theorem (d) we findf(w,x,y,z) = y’ + k(w,x,1,z) = y’ + x + w’.z(1+z) = y’ + x + w’.z
Boolean Expressions - Reduction Theorem • Again, continuing, f(w,x,y,z) = x + y’ + w’.z(y+z) Defining k(w,x,y,z) = x + w’.z(y+z) it follows thatf(w,x,y,z) = y’ + k(w,x,y,z) Using reduction theorem (d) we findf(w,x,y,z) = y’ + k(w,x,1,z) = y’ + x + w’.z(1+z) = y’ + x + w’.z • Recall we started with: f(w,x,y,z) = x + x’y’ + w’x’(w + z)(y+w’z)
Boolean Expressions: Complement of Canonical Forms • Previously, we defined the terms canonical DNF (SOP) and CNF (POS). • DNF (SOP) Sum m( {k} ) • CNF (POS) Prod M( {k} )where the notation {k} refers to the set of all indices kj that appear in the sum of minterms mk or product of maxterms Mk.
Boolean Expressions: Complement of Canonical Forms • Previously, we defined the terms canonical DNF (SOP) and CNF (POS). • DNF (SOP) Sum m( {k} ) • CNF (POS) Prod M( {k} )where the notation {k} refers to the set of all indices kj that appear in the sum of minterms mk or product of maxterms Mk. • The complement, f’, of a canonical DNF or CNF function f(x) of N variables x=(x1,.., xj,.., xN) is found by replacing the set of indices {k} by its set complement {k}’. • The set complement {k}’ includes all indices that remain after removing the set {k} from the complete set formed from the index sequence [0..N-1].
Boolean Expressions: Complement of Canonical Forms DNF (SOP) Complement f(x1,.., xj,.., xN) = Sum m( {k} )f’(x1,.., xj,.., xN) = Sum m( {k}’ ) CNF (POS) Complement f(x1,.., xj,.., xN) =Prod M( {k} )f’(x1,.., xj,.., xN) = Prod M( {k}’ ) • Previously, we defined the terms canonical DNF (SOP) and CNF (POS). • DNF (SOP) G m( {k} ) • CNF (POS) A M( {k} )where the notation {k} refers to the set of all indices kj that appear in the sum of minterms mk or product of maxterms Mk. • The complement, f’, of a canonical DNF or CNF function f(x) of N variables x=(x1,.., xj,.., xN) is found by replacing the set of indices {k} by its set complement {k}’. • The set complement {k}’ includes all indices that remain after removing the set {k} from the complete set formed from the index sequence [0..N-1].
Boolean Expressions: Complement of Canonical Forms • Example: 4 input variable function, F(W,X,Y,Z) - SOP form K W X Y Z F 0 0 0 0 0 0 1 0 0 0 1 1 2 0 0 1 0 0 3 0 0 1 1 0 F = Sum m( {k} ) 4 0 1 0 0 1 5 0 1 0 1 1 6 0 1 1 0 1 7 0 1 1 1 0 8 1 0 0 0 0 9 1 0 0 1 1 10 1 0 1 0 0 11 1 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 0 14 1 1 1 0 1 15 1 1 1 1 1
Boolean Expressions: Complement of Canonical Forms • Example: 4 input variable function, F(W,X,Y,Z) - SOP form K W X Y Z F 0 0 0 0 0 0 1 0 0 0 1 1 {k} = 1, 4, 5, 6, 9, 11, 14, 15 2 0 0 1 0 0 3 0 0 1 1 0 F = Sum m( {k} ) 4 0 1 0 0 1 5 0 1 0 1 1 6 0 1 1 0 1 7 0 1 1 1 0 8 1 0 0 0 0 9 1 0 0 1 1 10 1 0 1 0 0 11 1 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 0 14 1 1 1 0 1 15 1 1 1 1 1
Boolean Expressions: Complement of Canonical Forms • Example: 4 input variable function, F(W,X,Y,Z) - SOP form K W X Y Z F 0 0 0 0 0 0 1 0 0 0 1 1 {k} = 1, 4, 5, 6, 9, 11, 14, 15 2 0 0 1 0 0 3 0 0 1 1 0 F = Sum m( {k} ) 4 0 1 0 0 1 5 0 1 0 1 1 = Sum m(1, 4, 5, 6, 9, 11, 14, 15) 6 0 1 1 0 1 7 0 1 1 1 0 8 1 0 0 0 0 9 1 0 0 1 1 10 1 0 1 0 0 11 1 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 0 14 1 1 1 0 1 15 1 1 1 1 1
Boolean Expressions: Complement of Canonical Forms • Example: 4 input variable function, F(W,X,Y,Z) - SOP form K W X Y Z F 0 0 0 0 0 0 1 0 0 0 1 1 {k} = 1, 4, 5, 6, 9, 11, 14, 15 2 0 0 1 0 0 3 0 0 1 1 0 F = Sum m( {k} ) 4 0 1 0 0 1 5 0 1 0 1 1 = Sum m(1, 4, 5, 6, 9, 11, 14, 15) 6 0 1 1 0 1 7 0 1 1 1 0 8 1 0 0 0 0 F’ = Sum m( {k}’ ) Complement 9 1 0 0 1 1 10 1 0 1 0 0 11 1 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 0 14 1 1 1 0 1 15 1 1 1 1 1
Boolean Expressions: Complement of Canonical Forms • Example: 4 input variable function, F(W,X,Y,Z) - SOP form Full Index Set {j in [0..N-1]} 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 SOP Index Set {k} 1, 4, 5, 6, 9, 11, 14, 15 SOP Complement Index Set {k}’ 0, 2, 3, 7, 8, 10, 12, 13 K W X Y Z F 0 0 0 0 0 0 1 0 0 0 1 1 {k} = 1, 4, 5, 6, 9, 11, 14, 15 2 0 0 1 0 0 3 0 0 1 1 0 F = Sum m( {k} ) 4 0 1 0 0 1 5 0 1 0 1 1 = Sum m(1, 4, 5, 6, 9, 11, 14, 15) 6 0 1 1 0 1 7 0 1 1 1 0 8 1 0 0 0 0 F’ = Sum m( {k}’ ) 9 1 0 0 1 1 10 1 0 1 0 0 11 1 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 0 14 1 1 1 0 1 15 1 1 1 1 1
Boolean Expressions: Complement of Canonical Forms • Example: 4 input variable function, F(W,X,Y,Z) - SOP form Full Index Set {j in [0..N-1]} 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 SOP Index Set {k} 1, 4, 5, 6, 9, 11, 14, 15 SOP Complement Index Set {k}’ 0, 2, 3, 7, 8, 10, 12, 13 K W X Y Z F 0 0 0 0 0 0 1 0 0 0 1 1 {k} = 1, 4, 5, 6, 9, 11, 14, 15 2 0 0 1 0 0 3 0 0 1 1 0 F = Sum m( {k} ) 4 0 1 0 0 1 5 0 1 0 1 1 = Sum m(1, 4, 5, 6, 9, 11, 14, 15) 6 0 1 1 0 1 7 0 1 1 1 0 8 1 0 0 0 0 F’ = Sum m( {k}’ ) 9 1 0 0 1 1 10 1 0 1 0 0 = Sum m(0, 2, 3, 7, 8, 10, 12, 13) 11 1 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 0 14 1 1 1 0 1 15 1 1 1 1 1
Boolean Expressions: Complement of Canonical Forms • Example: 4 input variable function, F(W,X,Y,Z) - POS form K W X Y Z F 0 0 0 0 0 0 1 0 0 0 1 1 {k} = 1, 4, 5, 6, 9, 11, 14, 15 2 0 0 1 0 0 3 0 0 1 1 0 F = Prod M( {k} ) 4 0 1 0 0 1 5 0 1 0 1 1 = Prod M(1, 4, 5, 6, 9, 11, 14, 15) 6 0 1 1 0 1 7 0 1 1 1 0 8 1 0 0 0 0 9 1 0 0 1 1 10 1 0 1 0 0 11 1 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 0 14 1 1 1 0 1 15 1 1 1 1 1
Boolean Expressions: Complement of Canonical Forms • Example: 4 input variable function, F(W,X,Y,Z) - POS form K W X Y Z F 0 0 0 0 0 0 1 0 0 0 1 1 {k} = 1, 4, 5, 6, 9, 11, 14, 15 2 0 0 1 0 0 3 0 0 1 1 0 F = Prod M( {k} ) 4 0 1 0 0 1 5 0 1 0 1 1 = Prod M(1, 4, 5, 6, 9, 11, 14, 15) 6 0 1 1 0 1 7 0 1 1 1 0 8 1 0 0 0 0 F’ = Prod M( {k}’ ) 9 1 0 0 1 1 10 1 0 1 0 0 = Prod M(0, 2, 3, 7, 8, 10, 12, 13) 11 1 0 1 1 1 12 1 1 0 0 0 13 1 1 0 1 0 14 1 1 1 0 1 15 1 1 1 1 1
Boolean Expressions: Complementing Forms • For general boolean expressions, particularly those that are not canonical, use de Morgan’s theorems. Be methodical in their application, deriving each step carefully.
Incomplete Boolean Expressions • It does happen in circuit design that the specification of output values for some terms of the output function F are missing.
Incomplete Boolean Expressions • It does happen in circuit design that the specification of output values for some terms of the output function F are missing. • When this occurs and the impact of those missing terms is irrelevant, they are referred to as don’t care conditions or terms. • We use the notation: dc( {h} )to denote the SOP (or POS) expression of all the don’t care terms in the index set {h}.
Incomplete Boolean Expressions • It does happen in circuit design that the specification of output values for some terms of the output function F are missing. • When this occurs and the impact of those missing terms is irrelevant, they are referred to as don’t care conditions or terms. • We use the notation: dc( {h} )to denote the SOP (or POS) expression of all the don’t care terms in the index set {h}. • Thus, a typical function might be represented as:F(x) = Sum m( {k} ) + dc( {h} )