Presentation is loading. Please wait.

Presentation is loading. Please wait.

ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and.

Similar presentations


Presentation on theme: "ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and."— Presentation transcript:

1 ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and Computer Engineering Auburn University, Auburn, AL 36849 http://www.eng.auburn.edu/~vagrawal vagrawal@eng.auburn.edu Fall 2015, Oct 23... ELEC2200-002 Lecture 5 1

2 Understanding Minimization... Logic function: Fall 2015, Oct 23... ELEC2200-002 Lecture 5 2 a b c d F AND OR NOT

3 ... Understanding Minimization Reducing products: Fall 2015, Oct 23... ELEC2200-002 Lecture 5 3 Distributivity Complementation Identity Complementation Distribitivity Consensus theorem Distributivity Complement, identity

4 ... Understanding Minimization Reduced SOP: Fall 2015, Oct 23... ELEC2200-002 Lecture 5 4 b d F AND OR NOT

5 ... Understanding Minimization Reducing literals: Fall 2015, Oct 23... ELEC2200-002 Lecture 5 5 b d F OR NOT Absorption theorem d b bd Exercise: This circuit uses 8 transistors in CMOS technology. Can you redesign it with 6 transistors? (Hint: Use de Morgan’s Theorem.)

6 Or, Could Use Karnaugh Map Fall 2015, Sep 30... ELEC2200-002 Lecture 4 6 http://www.ee.calpoly.edu/media/uploads/resources/KarnaughExplorer_1.html

7 Logic Minimization Generally means – –In SOP form: Minimize number of products (reduce gates) and Minimize literals (reduce gate inputs) – –In POS form: Minimize number of sums (reduce gates) and Minimize literals (reduce gate inputs) Fall 2015, Oct 23... ELEC2200-002 Lecture 5 7

8 Product or Implicant or Cube Any set of literals ANDed together. Minterm is a special case where all variables are present. It is the largest product. A minterm is also called a 0-implicant of 0- cube. A 1-implicant or 1-cube is a product with one variable eliminated: Obtained by combining two adjacent 0-cubes ABCD + ABC  D = ABC(D +  D) = ABC Fall 2015, Oct 23... ELEC2200-002 Lecture 5 8

9 Cubes (Implicants) of 4 Variables 04128 15139 371511 261410 Fall 2015, Oct 23... ELEC2200-002 Lecture 5 9 A B D C 1 1 1 Minterm or 0-implicant or 0-cube A  B  C  D 1-implicant or 1-cube ABD 1 1 What is this?

10 Growing Cubes, Reducing Products 04128 15139 371511 261410 Fall 2015, Oct 23... ELEC2200-002 Lecture 5 10 A B D C 1 1 1-implicant or 1-cube  AB D 1-implicant or 1-cube ABD 1 1 2-implicant or 2-cube BD What is this? 04128 15139 371511 261410

11 Largest Cubes or Smallest Products 04128 15139 371511 261410 Fall 2015, Oct 23... ELEC2200-002 Lecture 5 11 A B D C 1 1 What is this? 3-implicant or 3-cube B 1 1 1 1 1 1

12 Implication and Covering A larger cube covers a smaller cube if all minterms of the smaller cube are included in the larger cube. A smaller cube implies (or subsumes) a larger cube if all minterms of the smaller cube are included in the larger cube. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 12

13 Implicants of a Function Minterms, products, cubes that imply the function. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 13 04128 15139 371511 261410 A B D C 1 1 1 1 1 1 1 1

14 Prime Implicant (PI) A cube or implicant of a function that cannot grow larger by expanding into other cubes. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 14 04128 15139 371511 261410 A B D C 1 1 1 1 1 1 1 1 04128 15139 371511 261410 A B D C 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 PI

15 Essential Prime Implicant (EPI) If among the minterms subsuming a prime implicant (PI), there is at least one minterm that is covered by this and only this PI, then the PI is called an essential prime implicant (EPI). Also called essential prime cube (EPC). Fall 2015, Oct 23... ELEC2200-002 Lecture 5 15 11 11 A B C EPI Why not this?

16 Redundant Prime Implicant (RPI) If each minterm subsuming a prime implicant (PI) is also covered by other essential prime implicants, then that PI is called a redundant prime implicant (RPI). Also called redundant prime cube (RPC). Fall 2015, Oct 23... ELEC2200-002 Lecture 5 16 11 11 A B C EPI RPI

17 Selective Prime Implicant (SPI) A prime implicant (PI) that is neither EPI nor RPI is called a selective prime implicant (SPI). Also called selective prime cube (SPC). SPIs occur in pairs. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 17 11 111 A B C EPI SPI

18 Minimum Sum of Products (MSOP) Identify all prime implicants (PI) by letting minterms and implicants grow. Construct MSOP with PI only : Cover all minterms Use only essential prime implicants (EPI) Use no redundant prime implicant (RPI) Use cheaper selective prime implicants (SPI) A good heuristic – Choose EPI in ascending order, starting from 0-implicant, then 1-implicant, 2- implicant,... Fall 2015, Oct 23... ELEC2200-002 Lecture 5 18

19 Example: F=  m(1,3,4,5,8,9,13,15) Fall 2015, Oct 23... ELEC2200-002 Lecture 5 19 04 1 128 1 5 1 13 1 9 1 3 1 715 1 11 261410 A B C D MSOP: F =  A  B D +  A B  C + A B D + A  B  C RPI

20 Example: F=  m(1,3,5,7,8,10,12,13,14) Fall 2015, Oct 23... ELEC2200-002 Lecture 5 20 0412 1 8 1 5 1 13 1 9 3 1 7 1 1511 2614 1 10 1 A B C D MSOP: F =  A D + A  D + A B  C SPI

21 Functions with Don’t Care Minterms F(A,B,C) =  m(0,3,7) + d(4,5) Include don’t care minterms when beneficial. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 21 1  11  A B C 1  11  A B C F = B C +  A  B  CF = B C +  B  C

22 Five-Variable Function F(A,B,C,D,E) =  m(0,1,4,5,6,13,14,15,22,24,25,28,29,30,31) Fall 2015, Oct 23... ELEC2200-002 Lecture 5 22 0 1 4 1 128 1 5 1 13 1 9 3715 1 11 26 1 14 1 10 A = 0 B C D E 16 20 28 1 24 1 17 21 29 1 25 1 192331 1 27 1822 1 30 1 26 A = 1 B C D E F =  A  B  D + A B  D + B C E + C D  E

23 Multiple-Output Minimization Fall 2015, Oct 23... ELEC2200-002 Lecture 5 23 InputsOutputs ABCDF1F2 000000 000110 001000 001100 010000 010110 011000 011111 100001 100111 101001 101101 110000 110111 111000 111111

24 0 4 12 8 1 1 5 13 1 9 1 37 1 15 1 11 1 26 14 10 1 0 4 128 1 5 1 13 1 9 1 37 1 15 1 11 26 14 10 Individual Output Minimization Need five products. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 24 F1 A B C D F2 A B C D

25 0 4 12 8 1 1 5 13 1 9 1 37 1 15 1 11 1 26 14 10 1 0 4 128 1 5 1 13 1 9 1 37 1 15 1 11 26 14 10 Global Minimization Need four products. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 25 F1 A B C D F2 A B C D

26 Minimized SOP and POS F(A,B,C,D) =  m(1,3,4,7,11) + d(5,12,13,14,15) =  M(0,2,6,8,9,10) D(5,12,13,14,15) Fall 2015, Oct 23... ELEC2200-002 Lecture 5 26 0 4 12  8 0 1 5  13  9 0 37 15  11 2 0 6 0 14  10 0 0 4 1 12  8 1 5  13  9 3 1 7 1 15  11 1 26 14  10 A B C D A B C D F = B  C +  AD + C D  F =  B  D + C  D + A  C F =(B + D)(  C + D)(  A + C)

27 SOP and POS Circuits F(A,B,C,D) =  m(1,3,4,7,11)+d(5,12,13,14,15) =  M(0,2,6,8,9,10) D(5,12,13,14,15) Fall 2015, Oct 23... ELEC2200-002 Lecture 5 27 F = B  C +  AD + C DF = (B + D)(  C + D)(  A + C) A B C D F A B C D F Are two circuits functionally Identical?

28 How Don’t Cares Occur Consider two crossroads: A highway with traffic signals, red (R), yellow (Y) and green (G), and A rural road with red (r) and green (g) signals. Here R, Y, G, r and g are Boolean variables; a 1 implies light is on, 0 means light is off. Highway signals R, Y and G are controlled by a computer. Rural traffic can cross highway (g = 1) only when R = 1, Y = G = 0, and r =  g. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 28

29 Traffic Signals Fall 2015, Oct 23... ELEC2200-002 Lecture 5 29

30 Completely Specified Function Truth Table mintermRYGg 00000 10010 20100 30110 41001 51010 61100 71110 Fall 2015, Oct 23... ELEC2200-002 Lecture 5 30 1 g = R  Y  G R Y G RYGRYG g

31 Incompletely Specified Function Truth Table mintermRYGg 0000Φ 10010 20100 3011Φ 41001 5101Φ 6110Φ 7111Φ Fall 2015, Oct 23... ELEC2200-002 Lecture 5 31 1 g = R R Y G Rg Φ Φ ΦΦ Φ Additional condition: Exactly one highway light can be on. Φ or X denotes “don’t care”

32 Absorption Theorem For two Boolean variables: A, B A + A B = A Proof: Fall 2015, Oct 23... ELEC2200-002 Lecture 5 32 B A AB

33 Consensus Theorem For three Boolean variables: A, B, C A B +  A C + B C = A B +  A C Proof: Fall 2015, Oct 23... ELEC2200-002 Lecture 5 33 B A C AB  AC BC

34 Growing Implicants to PI F = AB +  CD +  ABCDinitial implicants =AB +  ABCD + BCD +  CDconsensus th. =AB + BCD +  CDabsorption th. =AB + BCD +  CD + BDconsensus th. =AB +  CD + BD absorption th. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 34 A B C D A B C D A B C D

35 Identifying EPI Find all prime implicants. From prime implicant SOP, remove a PI. Apply consensus theorem to the remaining SOP. If the removed PI is generated, then it is either an RPI or an SPI. If the removed PI is not generated, then it is an EPI Fall 2015, Oct 23... ELEC2200-002 Lecture 5 35

36 Example PI SOP: F = A D +  A  C +  CD Is AD an EPI? F – {AD}=  A  C +  CD, no new PI can be generated Hence, AD is an EPI.Similarly, A  C is an EPI. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 36 A B C D AD ACAC

37 Example (Cont.) PI SOP: F = A D +  A  C +  CD Is  CD an EPI? F – {  CD } = A D +  A  C = A D +  A  C +  C D(Consensus theorem) Hence  C D is not an EPI (it is an RPI) Fall 2015, Oct 23... ELEC2200-002 Lecture 5 37 A B C D  CD Minimum SOP: F = A D +  A  C

38 Finding MSOP 1. 1. Start with minterm or cube SOP representation of Boolean function. 2. 2. Find all prime implicants (PI). 3. 3. Include all EPI’s in MSOP. 4. 4. Find the set of uncovered minterms, {UC}. 5. 5. MSOP is minimum if {UC} is empty. DONE. 6. 6. For a minterm in {UC}, include the largest PI from remaining PI’s (non-EPI’s) in MSOP. 7. 7. Go to step 4. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 38

39 Finding Uncovered Minterms, {UC} {UC} = ({PI} # {PMSOP}) # {DC} Where: {PI} is set of all prime implicants of the function. {PMSOP} is any partial SOP. {DC} is set of don’t care minterms. Sharp (#) operation between Boolean expressions X and Y, X # Y, is the set of minterms covered by X that are not covered by Y. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 39

40 Example: # (Sharp) Operation AD #  CD = {A B C D, A  B C D}  CD # AD = {  A B  C D,  A  B  C D} Fall 2015, Oct 23... ELEC2200-002 Lecture 5 40 A B C D AD  CD

41 Minterms Covered by a Product A product from which k variables have been eliminated, covers 2 k minterms. Example: For four variables, A, B, C, D Product AC covers 2 2 = 4 minterms: 1) 1) A  B C  D 2) 2) A  B C D 3) 3) A B C  D 4) 4) A B C D Obtained by inserting the eliminated variables in all possible ways. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 41 (4)(2) (3)(1) A B C D

42 Quine-McCluskey Fall 2015, Oct 23... ELEC2200-002 Lecture 5 42 Willard V. O. Quine 1908 – 2000 Edward J. McCluskey b. 1929

43 Quine-McCluskey Tabular Minimization Method W. V. Quine, “The Problem of Simplifying Truth Functions,” American Mathematical Monthly, vol. 59, no. 10, pp. 521-531, October 1952. E. J. McCluskey, “Minimization of Boolean Functions,” Bell System Technical Journal, vol. 35, no. 11, pp. 1417-1444, November 1956. Textbook, Section 3.9, pp. 211-225. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 43

44 Q-M Tabular Minimization Minimizes functions with many variables. Begin with minterms: Step 1: Tabulate minterms in groups of increasing number of true variables. Step 2: Conduct linear searches to identify all prime implicants (PI). Step 3: Tabulate PI’s vs. minterms to identify EPI’s. Step 4: Tabulate non-essential PI’s vs. minterms not covered by EPI’s. Select minimum number of PI’s to cover all minterms. MSOP contains all EPI’s and selected non-EPI’s. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 44

45 F(A,B,C,D) =  m(2,4,6,8,9,10,12,13,15) Q-M Step 1: Group minterms with 1 true variable, 2 true variables, etc. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 45 MintermABCDGroups 20010 1: single 1 40100 81000 60110 2: two 1’s 91001 101010 121100 1311013: three 1’s 1511114: four 1’s

46 Q-M Step 2 Find all implicants by combining minterms, and then combining products that differ in a single variable: For example, 2 and 6, or  A  B C  D and  A B C  D →  A C  D, written as 0 – 1 0. Try combining a minterm (or product) with all minterms (or products) listed below in the table. Include resulting products in the next list. If minterm (or product) does not combine with any other, mark it as PI. Check the minterm (or product) and repeat for all other minterms (or products). Fall 2015, Oct 23... ELEC2200-002 Lecture 5 46

47 Step 2 Executed on Example Fall 2015, Oct 23... ELEC2200-002 Lecture 5 47 List 1List 2_List 3 MintermABCDPI?MintermsABCDPI?MintermsABCDPI? 20010X2, 60-10PI_28,9,12,131-0-PI_1 40100X2,10-010PI_3 81000X4,601-0PI_4 60110X4,12-100PI_5 91001X8,9100-X 101010X8,1010-0PI_6 121100X8,121-00X 131101X9,131-01X 151111X12,13110-X 13,1511-1PI_7

48 Step 3: Identify EPI’s Covered by EPI →xxxxx Minterms →2468910121315 PI_1 is EPIxxxx PI_2xx PI_3xx PI_4xx PI_5xx PI_6xx PI_7 is EPIxx Fall 2015, Oct 23... ELEC2200-002 Lecture 5 48

49 Step 4: Cover Remaining Minterms Remaining minterms →24610 PI_2xx PI_3xx PI_4xx PI_5x PI_6x Fall 2015, Oct 23... ELEC2200-002 Lecture 5 49 Integer linear program (ILP), available from Matlab and other sources: Define integer {0,1} variables, xk = 1, select PI_k; xk = 0, do not select PI_k. Minimize  k xk, subject to constraints:x2 + x3 ≥ 1 x4 + x5 ≥ 1 x2 + x4 ≥ 1 x3 + x6 ≥ 1 A solution is x3 = x4 = 1, x2 = x5 = x6 = 0, or select PI_3, PI_4

50 Linear Programming (LP) A mathematical optimization method for problems where some “cost” depends on a large number of variables. An easy to understand introduction is: S. I. Gass, An Illustrated Guide to Linear Programming, New York: Dover Publications, 1970. Very useful tool for a variety of engineering design problems. Available in software packages like Matlab. Courses on linear programming are available in Math, Business and Engineering departments. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 50

51 Q-M MSOP Solution and Verification   F(A,B,C,D) =PI_1 + PI_3 + PI_4 + PI_7 =1-0- + -010 + 01-0 + 11-1 =A  C +  B C  D +  A B  D + A B D   See Karnaugh map. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 51 111 11 1 111 A B C D EPI’s in MSOP Non-EPI’s in MSOP Non-EPI’s not in MSOP

52 Minimized Circuit Fall 2015, Oct 23... ELEC2200-002 Lecture 5 52 PI1 PI3 PI4 PI7 AB A B C C D D F

53 QM Minimizer on the Web http://quinemccluskey.com/ Fall 2015, Oct 23... ELEC2200-002 Lecture 5 53

54 Function with Don’t Cares F(A,B,C,D) =  m(4,6,8,9,10,12,13) +  d(2, 15) Q-M Step 1: Group “all” minterms with 1 true variable, 2 true variables, etc. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 54 MintermABCDGroups 20010 1: single 1 40100 81000 60110 2: two 1’s 91001 101010 121100 1311013: three 1’s 1511114: four 1’s

55 Step 2: Same As Before on “All” Minterms Fall 2015, Oct 23... ELEC2200-002 Lecture 5 55 List 1List 2List 3 MintermABCDPI?MintermsABCDPI?MintermsABCDPI? 20010X2, 60-10PI28,9,12,131-0-PI1 40100X2,10-010PI3 81000X4,601-0PI4 60110X4,12-100PI5 91001X8,9100-X 101010X8,1010-0PI6 121100X8,121-00X 131101X9,131-01X 151111X12,13110-X 13,1511-1PI7

56 Step 3: Identify EPI’s Ignoring Don’t Cares Covered by EPI →xxxx Minterms →4689101213 PI1 is EPIxxxx PI2x PI3x PI4xx PI5xx PI6xx PI7x Fall 2015, Oct 23... ELEC2200-002 Lecture 5 56

57 Step 4: Cover Remaining Minterms Remaining minterms →4610 PI_2x PI_3x PI_4xx PI_5x PI_6x Fall 2015, Oct 23... ELEC2200-002 Lecture 5 57 Integer linear program (ILP), available from Matlab and other sources: Define integer {0,1} variables, xk = 1, select PI_k; xk = 0, do not select PI_k. Minimize  k xk, subject to constraints:x4 + x5 ≥ 1 x2 + x4 ≥ 1 x3 + x6 ≥ 1 A solution is x3 = x4 = 1, x2 = x5 = x6 = 0, or select PI_3, PI_4

58 Q-M MSOP Solution and Verification   F(A,B,C,D) =PI_1 + PI_3 + PI_4 =1-0- + -010 + 01-0 = A  C +  B C  D +  A B  D   See Karnaugh map. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 58 111 11 1 111 A B C D EPI’s in MSOP Non-EPI’s in MSOP Non-EPI’s not in MSOP EPI’s not selected

59 Minimized Circuit Fall 2015, Oct 23... ELEC2200-002 Lecture 5 59 PI1 PI3 PI4 AB A B C C D D F

60 Further Reading Incompletely specified functions: See Example 3.25, pages 218-220. Multiple output functions: See Example 3.26, pages 220-222. Fall 2015, Oct 23... ELEC2200-002 Lecture 5 60


Download ppt "ELEC 2200-002 Digital Logic Circuits Fall 2015 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and."

Similar presentations


Ads by Google