Combinational Logic Circuits Part II -Theoretical Foundations
Overview Boolean Algebra Basic Logic Operations Basic Identities Basic Principles, Properties, and Theorems Boolean Function and Representations Truth Table Canonical and Standard Forms Minterms and Maxterms Canonical Sum-Of-Products and Product-Of-Sums forms Standard Sum-Of-Products and Product-Of-Sums forms Conversions Karnaugh Map (K-Map) 2, 3, 4, and 5 variable K-maps Complement of a Boolean function Fall 27 Digital Technique by Todor Stefanov, Leiden University 2
Boolean Function Representations Truth Table (unique representation) Size of a truth table grows exponentially with the number of variables involved This motivates the use of other representations Boolean Equation Canonical Sum-Of-Products (CSOP) form (unique) Canonical Product-Of-Sums (CPOS) form (unique) Standard Forms (NOT unique representations) Map (unique representation) We can convert one representation of a Boolean function into another in a systematic way Fall 27 Digital Technique by Todor Stefanov, Leiden University 3
Canonical and Standard Forms Canonical and Standard forms of a Boolean functions are boolean equation representations To introduce them we need the following definitions: Literal: A variable or its complement Product term: literals connected by Sum term: literals connected by + Minterm: a product term in which all the variables appear exactly once, either complemented or uncomplemented Maxterm: a sum term in which all the variables appear exactly once, either complemented or uncomplemented Fall 27 Digital Technique by Todor Stefanov, Leiden University 4
Minterm: Characteristic Property A minterm of N variables defines a boolean function that represents exactly one combination (b j ) of the binary variables in the truth table The function has value for this combination and value for all others There are 2 N distinct minterms for N variables A minterm is denoted by m j j is the decimal equivalent of the minterm s corresponding binary combination (b j ) A variable in m j is complemented if its value in (b j ) is, otherwise it is uncomplemented Fall 27 Digital Technique by Todor Stefanov, Leiden University 5
Minterms for Three Variables For 3 variables,, Z there are 2 3 minterms (products of 3 literals): m = Z m = Z m 2 = Z m 3 = Z m 4 = Z m 5 = Z m 6 = Z m 7 = Z Example: consider minterm m 5 : m 5 defines a boolean function that represents exactly one combination (b 5 =) the function has value for this combination and value for all others variable in m 5 is complemented because its value in b 5 is Z m m m 2 m 3 m 4 m 5 m 6 m 7 b b b 2 b 3 b 4 b 5 b 6 b 7 Fall 27 Digital Technique by Todor Stefanov, Leiden University 6
Maxterm: Characteristic Property A maxterm of N variables defines a boolean function that represents exactly one combination (b j ) of the binary variables in the truth table The function has value for this combination and value for all others There are 2 N distinct maxterms for N variables A maxterm is denoted by M j j is the decimal equivalent of the maxterm s corresponding binary combination (b j ) A variable in M j is complemented if its value in (b j ) is, otherwise it is uncomplemented Fall 27 Digital Technique by Todor Stefanov, Leiden University 7
Maxterms for Three Variables For 3 variables,, Z there are 2 3 maxterms (sums of 3 literals): M = ++Z M = ++Z M 2 = + +Z M 3 = + +Z M 4 = ++Z M 5 = ++Z M 6 = + +Z M 7 = + +Z Example: consider maxterm M 5 : M 5 defines a boolean function that represents exactly one combination (b 5 =) the function has value for this combination and value for all others variables and in M 5 are complemented because their values in b 5 are Z M M M 2 M 3 M 4 M 5 M 6 M 7 b b b 2 b 3 b 4 b 5 b 6 b 7 Fall 27 Digital Technique by Todor Stefanov, Leiden University 8
Canonical Forms (Unique) Any Boolean function F( ) can be expressed as: a unique sum of minterms a unique product of maxterms In other words, every function F( ) has two canonical forms: Canonical Sum-Of-Products (CSOP) (sum of minterms) Canonical Product-Of-Sums (CPOS) (product of maxterms) The words product and sum do not imply arithmetic operations in Boolean algebra! they specify the logical operations AND and OR, respectively Fall 27 Digital Technique by Todor Stefanov, Leiden University 9
Canonical Sum-Of-Products It is a sum of minterms The minterms included are those m j such that F( ) = in row j of the truth table for F( ) Example: Truth table for F(,,Z) at right The canonical sum-of-products form for F is: F(,,Z) = m + m 2 + m 4 + m 6 = = Z + Z + Z + Z Z F m = Z m 2 = Z m 4 = Z m 6 =Z Fall 27 Digital Technique by Todor Stefanov, Leiden University
Canonical Product-Of-Sums It is a product of maxterms The maxterms included are those M j such that F( ) = in row j of the truth table for F( ) Example: Truth table for F(,,Z) at right The canonical product-of-sums form for F is: F(,,Z) = M M 3 M 5 M 7 = = (++Z) (+ +Z ) ( ++Z ) ( + +Z ) Z F M =++Z M 3 =+ +Z M 5 = ++Z M 7 = + +Z Fall 27 Digital Technique by Todor Stefanov, Leiden University
Shorthand: and F(,,Z) = m + m 2 + m 4 + m 6 = = Z + Z + Z + Z = = m(,2,4,6), indicates that this is a sum-of-products form m(,2,4,6) indicates to included minterms m, m 2, m 4, and m 6 F(,,Z) = M M 3 M 5 M 7 = = (++Z) (+ +Z ) ( ++Z ) ( + +Z ) = = M(,3,5,7), indicates that this is a product-of-sums form M(,3,5,7) indicates to included maxterms M, M 3, M 5, and M 7 m(,2,4,6) = M(,3,5,7) = F(,,Z) Fall 27 Digital Technique by Todor Stefanov, Leiden University 2
Conversion Between Canonical Forms Get the shorthand notation Replace with (or vice versa) Replace those j s that appeared in the original form with those that do not Example: F(,,Z) = Z + Z + Z + Z = m + m 2 + m 4 + m 6 = m(,2,4,6) = M(,3,5,7) = (++Z) (+ +Z ) ( ++Z ) ( + +Z ) Fall 27 Digital Technique by Todor Stefanov, Leiden University 3
Standard Forms (NOT Unique) There are two types of standard forms: Sum-of-Products (SOP) forms (NOT unique) Product-of-Sums (POS) form (NOT unique) In standard forms, not all variables need to appear in the individual product or sum terms! Example: F(,,Z) = Z + Z + Z F(,,Z) = Z + Z + Z are two standard sum-of-products forms Example2: F(,,Z) = (++Z) (+ +Z ) ( + Z ) F(,,Z) = (++Z) ( +Z ) ( + Z ) are tow standard product-of-sums form Z F Fall 27 Digital Technique by Todor Stefanov, Leiden University 4
Conversion from Standard to Canonical SOP form Expand non-canonical product terms by inserting equivalent of for each missing variable V: (V + V ) = Remove duplicate minterms Example: F(,,Z) = Z + Z + Z = = Z + (+ )Z + (+ )Z = Z + Z + Z + Z + Z = Z + Z + Z + Z Can you do it: F(,,Z) = Z + Z + Z Z F Fall 27 Digital Technique by Todor Stefanov, Leiden University 5
Conversion from Standard to Canonical POS form Expand non-canonical sum terms by adding for each missing variable: V V = Remove duplicate maxterms Example: F(,,Z) = (++Z) ( +Z ) ( +Z ) = = (++Z) ( + +Z ) ( + +Z ) = (++Z) (+ +Z ) ( + +Z ) ( ++Z ) ( + +Z ) = (++Z) (+ +Z ) ( + +Z ) ( ++Z ) Can you do it for: F(,,Z) = (++Z) (+ +Z ) ( + Z ) Z F Fall 27 Digital Technique by Todor Stefanov, Leiden University 6
Karnaugh Maps (Unique) A Karnaugh map (K-map) is a unique graphical representation of a Boolean functions K-map of a Boolean function of N variables consists of 2 N cells One map cell corresponds to a row in the truth table Also, one map cell corresponds to a minterm in the Boolean function Multiple-cell areas of the map correspond to standard terms The K-map representation is useful for Boolean functions of up to 5 variables Fall 27 Digital Technique by Todor Stefanov, Leiden University 7
Two-Variable K-map 2 3 F(,) F(,) F(,) F(,) F(,) F(,) F(,) m = m = 2 3 2 3 F(,) F(,) m 2 = m 3 = Cell corresponds to row in the truth table and represents minterm ; Cell corresponds to row and represents ; etc. If Boolean function F(,) has value in a row of the truth table, i.e., a minterm is present in the function, then a is placed in the corresponding cell. Fall 27 Digital Technique by Todor Stefanov, Leiden University 8
Two-Variable K-map -- Examples Truth Table K - map Canonical and Standard SOP F F2 F3 F4 F = m 3 = F2 = m 2 + m 3 = + = F3 = m + m 2 = + F4 = m + m + m 3 = + + = + (canonical) (canonical) (standard) (canonical) (canonical) (standard) Fall 27 Digital Technique by Todor Stefanov, Leiden University 9
Two-Variable K-map (cont.) Any two adjacent cells in the map differ by ONL one variable appears complemented in one cell and uncomplemented in the other Example: m (= ) is adjacent to m (= ) and m 2 (= ) but NOT m 3 (=) Multiple-cell areas of the map correspond to standard terms Examples: 2-cell area m 2 m 3 corresponds to term : m 2 + m 3 = + = ( +) = 4-cell area m m corresponds to constant : m 2 m 3 m + m + m 2 + m 3 = + + + = = ( +) + ( +) = + = Fall 27 Digital Technique by Todor Stefanov, Leiden University 2 m = m 2 = m = m 2 = m = m 3 = m = m 3 =
2 3 4 5 6 7 Three-Variable K-map Z F(,,Z) F(,,) F(,,) F(,,) F(,,) F(,,) F(,,) F(,,) F(,,) Cell corresponds to row in the truth table and represents minterm Z ; Cell corresponds to row and represents Z; etc. If F(,,Z) has value in a row of the truth table, i.e., a minterm is present in the function, then a is placed in the corresponding cell. Fall 27 Digital Technique by Todor Stefanov, Leiden University 2 Z Z F(,,) 4 5 Z 3 2 7 6 F(,,) F(,,) F(,,) F(,,) F(,,) F(,,) F(,,) m = Z 4 5 Z 3 2 7 6 m = Z m 3 = Z m 2 = Z m 4 = Z m 5 = Z m 7 =Z m 6 =Z
Three-Variable K-map -- Examples Truth Table K - map Canonical and Standard SOP Z F Z Z F = m + m 3 + m 5 + m 6 = = Z + Z + Z + Z (canonical) Z F2 Z Z F2 = m + m 2 + m 3 + m 6 + m 7 = = Z + Z + Z + Z + Z = Z + (canonical) (standard) Fall 27 Digital Technique by Todor Stefanov, Leiden University 22
Three-Variable K-map (cont.) Z m = Z 4 5 3 2 7 6 m = Z m 3 = Z m 2 = Z m 4 = Z m 5 = Z m 7 =Z m 6 =Z Z NOTE: variable ordering is important assume function F(,,Z) then specifies the rows in the map and Z the columns Each cell is adjacent to three other cells (left, right, up or down). Left-edge cells are adjacent to right-edge cells! One cell represents a minterm of 3 literals A rectangle of 2 adjacent cells represents a product term of 2 literals A rectangle of 4 cells represents a product term of literal A rectangle of 8 cells encompasses the entire map and produces a function that is equal to logic Fall 27 Digital Technique by Todor Stefanov, Leiden University 23
2 3 4 5 6 7 8 9 2 3 4 5 W Four-Variable K-map Z F(W,,,Z) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) F(,,,) Z W W 3 m =W Z m =W Z Cell corresponds to row in the truth table and represents minterm W Z ; Cell corresponds to row and represents W Z; etc. If F(W,,,Z) has value in a row of the truth table, i.e., a minterm is present in the function, then a is placed in the corresponding cell. Fall 27 Digital Technique by Todor Stefanov, Leiden University 24 4 5 7 6 m 4 =W Z m 5 =W Z m 7 =W Z 2 m 2 =W Z m 3 =W Z 3 5 m 3 =W Z m 5 =WZ 8 9 m 8 =W Z m 9 =W Z m =W Z Z 2 4 m 2 =W Z m 6 =W Z m 4 =WZ m =W Z
W Four-Variable K-map -- Examples Z F Truth Table K - map Z W W Fall 27 Digital Technique by Todor Stefanov, Leiden University 25 F = m + m 2 + m 3 + Z m 8 + m 9 + m + m + m 2 + m 3 + m 4 + m 5 = = W Z + W Z + W Z + W Z + W Z + W Z + W Z + W Z + W Z + WZ + WZ = W Z + W Z + W Z + W Z + W Z + W Z + W Z + W Z + W Z + WZ + WZ = W Z + + W Z + W Z + W Z + W Z + W Z + W Z + WZ + WZ = W Z + + W K - map Canonical and Standard SOP (canonical form) (standard form) (standard form) (standard form)
W Z W Four-Variable K-map (cont.) m 3 m m 3 W Z W Z W Z W Z 4 5 7 6 m 4 m 5 m 7 W Z W Z W Z 2 3 5 m 2 m 3 m 5 2 m 2 m 6 W Z 4 m 4 W Z W Z WZ WZ 8 m 9 m 8 9 m m W Z W Z W Z W Z Z NOTE: variable ordering is important assume function F(W,,,Z) then W specifies the rows in the map and Z the columns Each cell is adjacent to four cells (left, right, up, down) Top cells are adjacent to bottom cells; Left-edge cells are adjacent to right-edge cells One cell represents a minterm of 4 literals A rectangle of 2 adjacent cells represents a product term of 3 literals A rectangle of 4 cells represents a product term of 2 literals A rectangle of 8 cells represents a product term of literal A rectangle of 6 cells produces a function that is equal to logic Fall 27 Digital Technique by Todor Stefanov, Leiden University 26
Five-Variable K-map F(T,W,,,Z) Z W Z W 6 2 7 2 T= 9 23 8 22 3 28 2 29 3 3 4 5 7 24 6 25 27 26 2 8 3 5 4 9 TWZ T= T WZ Can you draw six-variable K-map? Fall 27 Digital Technique by Todor Stefanov, Leiden University 27
Complement of a Boolean Function The complement representation of function F is denoted as F F can be obtained by interchanging s to s and s to s in the column showing F of the truth table F can be derived by applying DeMorgan s theorem on F F can be derived by taking the dual of F, i.e., interchanging with +, and with in F and complementing each literal The complement of a function IS NOT THE SAME as the dual of the function Fall 27 Digital Technique by Todor Stefanov, Leiden University 28
Complementation: Example Consider function F(,,Z) = Z + Z Table method Z F F DeMorgan method: F = ( Z + Z ) -- apply DeMorgan = ( Z ) ( Z ) -- DeMorgan again = (+ +Z) ( ++Z) Dual method: F = Z + Z -- interchange with + to find the dual of F G = ( ++Z ) (+ +Z ) G is the dual of F -- complement each literal to find F F = (+ +Z) ( ++Z) Fall 27 Digital Technique by Todor Stefanov, Leiden University 29