CHAPTER 3 PRINCIPLES OF COMBINATIONAL LOGIC Sections 3
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC (Sections 3. 1 – 3. 5)
3. 1 DEFINITION OF COMBINATIONAL LOGIC Logic circuits without feedback from output to the input, constructed from a functionally complete gate set, are said to be combinational. · · Combinational Logic Functions · · Inputs · · Outputs
3. 1. 1 PROBLEM STATEMENTS TO TRUTH TABLES n E. g : Conveyor system(P 85, Ex. 3. 1) M=a’bms+ab’ms+abms
3. 1. 1 PROBLEM STATEMENTS TO TRUTH TABLES n E. g. A NASA system(P 87, Ex. 3. 2) C 2 C 1 C 3
3. 1. 1 PROBLEM STATEMENTS TO TRUTH TABLES n E. g. Conveyor system(P 88, ex. 3. 4) S 3 m 3 S 2 m 2 S 1 m 4
3. 1. 1 PROBLEM STATEMENTS TO TRUTH TABLES n The process of converting a verbal problem statement into a truth table : Determine the input variables and output variables that are involved Assign mnemonic or letter or number symbols to each variable determine the size of the truth table; how many input combinations exist: 2 x=y where x=number of input variables and y=number of combinations. Construct a truth table containing all of the input variable combinations By careful reading of the problem statement determine the combinations of inputs that cause a given output to be true
3. 1. 1 PROBLEM STATEMENTS TO TRUTH TABLES n Exe: Design a truth table to indicate a majority of three inputs is true I 3 I 2 I 1 O 1 0 0 0 1 1 1 0 0 1 1 0 1 0 1 0 1 1 1
3. 1. 2 Deriving Switching Equations n Definitions n Product term: literals connected by • n Sum term: literals connected by + n Minterm: a product term in which all the variables appear exactly once, either complemented or uncomplemented n Maxterm: a sum term in which all the variables appear exactly once, either complemented or uncomplemented
Minterm Represents exactly one combination in the truth table. n Denoted by mj, where j is the decimal equivalent of the minterm’s corresponding binary combination (bj). n A variable in mj is complemented if its value in bj is 0, otherwise is uncomplemented. n M(a, b, m, s)=a’bms+ab’ms+abms n (m 7) (m 11) (m 15)
Maxterm n n Represents exactly one combination in the truth table. Denoted by Mj, where j is the decimal equivalent of the maxterm’s corresponding binary combination (bj). A variable in Mj is complemented if its value in bj is 1, otherwise is uncomplemented. F(a, b, c)=(a’+b+c’)(a+b’+c’) 101 011 M 5 M 1 M 3
Truth Table notation for Minterms and Maxterms 3 variables x, y, z (order is fixed)
3. 2 Canonical(规范) Forms Any Boolean function F( ) can be expressed as a unique sum of minterms and a unique product of maxterms (under a fixed variable ordering). n every function F() has two canonical forms: n Canonical Sum-Of-Products (sum of minterms) n Canonical Product-Of-Sums (product of maxterms) n
Convert switching equations to canonical form Expand non-canonical terms by inserting equivalent of 1 in each missing variable x: (x + x’) = 1 n Remove duplicate minterms n f 1(a, b, c) = a’b’c + bc’ + ac’ = a’b’c + (a+a’)bc’ + a(b+b’)c’ = a’b’c + abc’ + a’bc’ + ab’c’ = a’b’c + abc’ + a’bc + ab’c’ n
Convert switching equations to canonical form SOP E. g. P=f(a, b, c)=ab’+ac’+bc =ab’(c+c’)+ac’ (b+b’)+bc(a+a’) =ab’c+ab’c’+ab’c’+abc+a’bc =ab’c+ab’c’+abc+a’bc n
Convert switching equations to canonical form n n n Expand noncanonical terms by adding 0 in terms of missing variables (e. g. , xx’ = 0) and using the distributive law Remove duplicate maxterms f 1(a, b, c) = (a+b+c) • (b’+c’) • (a’+c’) = (a+b+c) • (aa’+b’+c’) • (a’+bb’+c’) = (a+b+c) • (a+b’+c’) • (a’+b+c’) • (a’+b’+c’) = (a+b+c) • (a+b’+c’) • (a’+b+c’)
Convert switching equations to canonical form POS E. g. T=f(a, b, c)=(a+b’)(b’+c) =(a+b’+cc’)(b’+c+aa’) =(a+b’+c) (a+b’+c’)(a+b’+c)(a’+b’+c) =(a+b’+c) (a+b’+c’)(a’+b’+c) n
Convert switching equations to canonical form n Exe: P=f(w, x, y, z)=w’x+yz’ T=f(a, b, c, d)=(a+b’+c)(a’+d) n Ans: P=f(w, x, y, z)=wxyz’+wx’yz’+w’xyz’+w’xy’z’+w’x’yz’ T=f(a, b, c, d)= (a+b’+c+d) (a+b’+c+d’) (a’+b+c+d) (a’+b’+c+d) (a’+b+c’+d) (a’+b’+c’+d)
3. 3 GENERATION OF SWITCHING EQUATIONS FROM TRUTH TABLES Canonical Sum-Of-Products: The minterms included are those mj such that F( ) = 1 in row j of the truth table for F( ). n Canonical Product-Of-Sums: The maxterms included are those Mj such that F( ) = 0 in row j of the truth table for F( ). n
Example n n Truth table for f 1(a, b, c) at right The canonical sum-of-products form for f 1 is f 1(a, b, c) = m 1 + m 2 + m 4 + m 6 = a’b’c + a’bc’ + ab’c’ + abc’ The canonical product-of-sums form for f 1 is f 1(a, b, c) = M 0 • M 3 • M 5 • M 7 = (a+b+c) • (a+b’+c’) • (a’+b’+c’). Observe that: mj = Mj’ a 0 0 1 1 b 0 0 1 1 c 0 1 0 1 f 1 0 1 0 1 0
Shorthand: ∑ and ∏ n n n f 1(a, b, c) = ∑ m(1, 2, 4, 6), where ∑ indicates that this is a sum-of-products form, and m(1, 2, 4, 6) indicates that the minterms to be included are m 1, m 2, m 4, and m 6. f 1(a, b, c) = ∏ M(0, 3, 5, 7), where ∏ indicates that this is a product-of-sums form, and M(0, 3, 5, 7) indicates that the maxterms to be included are M 0, M 3, M 5, and M 7. ∑ m(1, 2, 4, 6) = ∏ M(0, 3, 5, 7) = f 1(a, b, c)
Conversion Between Canonical Forms n n Replace ∑ with ∏ (or vice versa) and replace those j’s that appeared in the original form with those that do not. Example: f 1(a, b, c) = a’b’c + a’bc’ + ab’c’ + abc’ = m 1 + m 2 + m 4 + m 6 = ∑(1, 2, 4, 6) = ∏(0, 3, 5, 7) = (a+b+c) • (a+b’+c’) • (a’+b’+c’)
Karnaugh Maps Why Karnaugh maps? to simplify boolean equations n Karnaugh maps (K-maps) are graphical representations of boolean functions. n One map cell corresponds to a row in the truth table. n one map cell corresponds to a minterm or a maxterm in the boolean expression n
Karnaugh Maps CD AB B A 0 1 0 m 2 1 m 3 AB 00 01 11 C 10 00 m 4 m 12 m 8 01 11 m 5 m 13 m 9 m 3 m 7 m 15 m 11 10 m 2 m 6 m 14 m 10 00 01 11 0 m 2 m 6 m 4 1 m 3 m 7 m 5 n n 10 Logic adjacency : Any two adjacent cells in the map differ by ONLY one. Example: m 0 (=x 1’x 2’) is adjacent to m 1 (=x 1’x 2) and m 2 (=x 1 x 2’) but NOT m 3 (=x 1 x 2)
2 -Variable Map -- Example n E. g. f(x 1, x 2) = x 1’x 2’+ x 1’x 2 + x 1 x 2’ = m 0 + m 1 + m 2 n What (simpler) function is represented by each dashed rectangle? n n x 1’x 2’+ x 1’x 2 =x 1’(x 2’+x 2)=x 1’x 2’+ x 1 x 2’=x 2’(x 1’+x 1) =x 2’ f(x 1, x 2) =x 1’+x 2’ x 1 x 2 0 1 2 0 0 1 1 3 1 0
Minimization as SOP using K-map Enter 1 s in the K-map for each product term in the function n Group adjacent K-map cells containing 1 s to obtain a product with fewer variables. Groups must be in power of 2 (2, 4, 8, …) n Handle “boundary wrap” for K-maps of 3 or more variables. n
Three-Variable Map yz x 00 0 0 1 m 0 4 1 01 3 m 1 5 m 4 11 2 m 3 7 m 5 10 m 2 6 m 7 m 6 -Note: variable ordering is (x, y, z); yz specifies column, x specifies row. -Each cell is adjacent to three other cells (left or right or top or bottom or edge wrap)
Three-Variable Map (cont. ) minterm The types of structures that are either minterms or are generated by repeated application of the minimization theorem on a three variable map are shown at right. Groups of 1, 2, 4, 8 are possible. group of 2 terms group of 4 terms
Simplification n n Example: f(a, b, c) = ac’ + abc + bc’ =a(b+b’)c’+abc+(a+a’)bc’ =abc’+ab’c’+abc’+a’bc’ =abc’+ab’c’+abc+a’bc’ Result: f(a, b, c) = ac’+ab+bc’ c ab 00 0 1 01 11 10 1 1
More Examples xy n f 1(x, y, z) = ∑ m(2, 3, 5, 7) z f 1(x, y, z) = x’y + xz n f 2(x, y, z) = ∑ m (0, 1, 2, 3, 6) f 2(x, y, z) = x’+yz’ 00 0 1 xy z 0 1 00 1 1 01 11 10 1 1 01 1 1 10
Four-Variable Maps YZ 00 01 11 10 00 m 1 m 3 m 2 01 m 4 m 5 m 7 m 6 11 m 12 m 13 m 15 m 14 10 m 8 m 9 m 11 m 10 WX n n Top cells are adjacent to bottom cells. Leftedge cells are adjacent to right-edge cells. Note variable ordering (WXYZ).
Four-variable Map Simplification n n One square represents a minterm of 4 literals. A rectangle of 2 adjacent squares represents a product term of 3 literals. A rectangle of 4 squares represents a product term of 2 literals. A rectangle of 8 squares represents a product term of 1 literal. A rectangle of 16 squares produces a function that is equal to logic 1.
Example n n Simplify the following Boolean function (A, B, C, D) = ∑m(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 13). First put the function g( ) into the map, and then group as many 1 s as possible. cd ab 00 01 00 1 1 01 1 1 10 1 1 11 10 1 1 1 1 g(A, B, C, D) = a’+b’d’+bc’d 1
Implicants , Prime Implicants (PIs) and Essential Prime Implicant (EPI) n n AB Implicant: any single minterm CD 00 Prime Implicant (PI): (PI) a 00 group of minterms that cannot be combined with 01 any other minterms or groups Essential Prime Implicant 11 (EPI): a PI in which one 1? 10 or more miniterms are unique How to find PI and EPI? A’BC’D 01 BCD 11 10 1 1 1 ABC’ BD AC’D’
Example n n a’b’ is not a prime implicant because it is contained in b’. acd is not a prime implicant cd ab because it is contained in ad. b’, ad, and a’cd’ are prime implicants. b’, ad, and a’cd’ are essential a’b’ prime implicants. b’ ad 1 1 1 1 1 a’cd’ 1 1 acd
Another Example Consider f 2(a, b, c, d), whose K-map is shown below. n The only essential PI is b’d. n ab cd 1 1 1 1 1
Systematic Procedure for Simplifying Boolean Functions 1. 2. Load the minterms into the K-map by placing a 1 in the appropriate square. Look for groups of minterms (PI) 1. 2. 3. 4. 5. The group size must be a power of 2 Find the largest groups of minterms first, then smaller collections until all groups are found. Find all essential PIs. For remaining min-terms not included in the essential PIs, select a set of other PIs to cover them. The resulting simplified function is the logical OR of the product terms selected above.
Example f(a, b, c, d) = ∑m(0, 1, 4, 5, 8, 11, 12, 13, 15). n F(a, b, c, d) = c’d’ + a’c’ + bc’ + acd n ab cd 1 1 1 1 1
Homework Simplifying Boolean Functions F(x, y, z)=∑(0, 2, 3, 4, 5, 7) F(a, b, c, d)=∑(0, 3, 4, 5, 7, 11, 13, 15) F(w, x, y, z)=∑(0, 1, 4, 5, 9, 11, 13, 15) F(a, b, c, d)=∑(0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 14) F(a, b, c, d)=∑(1, 3, 4, 5, 7, 8, 9, 11, 15) F(w, x, y, z)=∑(1, 5, 7, 8, 9, 10, 11, 13, 15) n P 151: 4 -c, 4 -e n
- Slides: 39