ELE 2200-002 igital Logic ircuits Fall 205 Logic Minimization (hapter 3) Vishwani. grawal James J. anaher Professor epartment of Electrical and omputer Engineering uburn University, uburn, L 36849 http://www.eng.auburn.edu/~vagrawal vagrawal@eng.auburn.edu Fall 205, Oct 23... ELE2200-002 Lecture 5
Understanding Minimization... Logic function: a b NOT F = ab + ab + bd + N N cd N OR F c d N Fall 205, Oct 23... ELE2200-002 Lecture 5 2
... Understanding Minimization Reducing products: F = ab + ab + bd + cd = b( a + a) + bd + cd = b + bd + cd = b( c + c) + bd + cd = bd + bc + cd + bc = bd + bc + bc = bd + b( c + c) = bd + b istributivity omplementation Identity omplementation istribitivity onsensus theorem istributivity omplement, identity Fall 205, Oct 23... ELE2200-002 Lecture 5 3
... Understanding Minimization Reduced SOP: F = bd + b b NOT d N OR F Fall 205, Oct 23... ELE2200-002 Lecture 5 4
... Understanding Minimization Reducing literals: F = bd + b = d + b b bd d bsorption theorem b d NOT OR Exercise: This circuit uses 8 transistors in MOS technology. an you redesign it with 6 transistors? (Hint: Use de Morgan s Theorem.) Fall 205, Oct 23... ELE2200-002 Lecture 5 5 F
Or, ould Use Karnaugh Map http://www.ee.calpoly.edu/media/uploads/resources/karnaughexplorer_.html Fall 205, Sep 30... ELE2200-002 Lecture 4 6
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 205, Oct 23... ELE2200-002 Lecture 5 7
Product or Implicant or ube ny set of literals Ned together. Minterm is a special case where all variables are present. It is the largest product. minterm is also called a 0-implicant of 0- cube. -implicant or -cube is a product with one variable eliminated: Obtained by combining two adjacent 0-cubes + = ( + ) = Fall 205, Oct 23... ELE2200-002 Lecture 5 8
ubes (Implicants) of 4 Variables What is this? 0 4 2 8 5 3 9 3 7 5 Minterm or 0-implicant or 0-cube 2 6 4 0 -implicant or -cube Fall 205, Oct 23... ELE2200-002 Lecture 5 9
Growing ubes, Reducing Products -implicant or -cube 0 4 2 8 2-implicant or 2-cube 5 3 9 3 7 5 What is this? 2 6 4 0 -implicant or -cube Fall 205, Oct 23... ELE2200-002 Lecture 5 0
Largest ubes or Smallest Products 0 4 2 8 What is this? 5 3 9 3 7 5 2 6 4 0 3-implicant or 3-cube Fall 205, Oct 23... ELE2200-002 Lecture 5
Implication and overing larger cube covers a smaller cube if all minterms of the smaller cube are included in the larger cube. smaller cube implies (or subsumes) a larger cube if all minterms of the smaller cube are included in the larger cube. Fall 205, Oct 23... ELE2200-002 Lecture 5 2
Implicants of a Function Minterms, products, cubes that imply the function. F = + + + 0 4 2 8 5 3 9 3 7 5 2 6 4 0 Fall 205, Oct 23... ELE2200-002 Lecture 5 3
Prime Implicant (PI) cube or implicant of a function that cannot grow larger by expanding into other cubes. 0 4 2 8 0 4 2 8 PI 5 3 9 3 7 5 5 3 9 3 7 5 2 6 4 0 2 6 4 0 Fall 205, Oct 23... ELE2200-002 Lecture 5 4
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). lso called essential prime cube (EP). EPI Why not this? Fall 205, Oct 23... ELE2200-002 Lecture 5 5
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). lso called redundant prime cube (RP). EPI RPI Fall 205, Oct 23... ELE2200-002 Lecture 5 6
Selective Prime Implicant (SPI) prime implicant (PI) that is neither EPI nor RPI is called a selective prime implicant (SPI). lso called selective prime cube (SP). SPIs occur in pairs. EPI SPI Fall 205, Oct 23... ELE2200-002 Lecture 5 7
Minimum Sum of Products (MSOP) Identify all prime implicants (PI) by letting minterms and implicants grow. onstruct MSOP with PI only : over all minterms Use only essential prime implicants (EPI) Use no redundant prime implicant (RPI) Use cheaper selective prime implicants (SPI) good heuristic hoose EPI in ascending order, starting from 0-implicant, then -implicant, 2- implicant,... Fall 205, Oct 23... ELE2200-002 Lecture 5 8
Example: F= m(,3,4,5,8,9,3,5) 0 4 3 5 2 8 3 7 5 9 2 6 4 0 MSOP: F = + + + RPI Fall 205, Oct 23... ELE2200-002 Lecture 5 9
Example: F= m(,3,5,7,8,0,2,3,4) SPI 0 4 2 8 MSOP: F = + + 3 5 7 3 2 6 4 9 5 0 Fall 205, Oct 23... ELE2200-002 Lecture 5 20
Functions with on t are Minterms F(,,) = m(0,3,7) + d(4,5) Include don t care minterms when beneficial. Φ Φ Φ Φ F = + F = + Fall 205, Oct 23... ELE2200-002 Lecture 5 2
Five-Variable Function F(,,,,E) = m(0,,4,5,6,3,4,5,22,24,25,28,29,30,3) = 0 = 0 4 2 8 6 20 28 24 5 3 3 7 5 2 6 4 9 0 E 7 2 29 9 23 3 8 22 30 25 27 26 E F = + + E + E Fall 205, Oct 23... ELE2200-002 Lecture 5 22
Multiple-Output Minimization Inputs Outputs F F2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Fall 205, Oct 23... ELE2200-002 Lecture 5 23
Individual Output Minimization Need five products. F F2 0 4 2 8 0 4 2 8 5 3 7 3 5 9 2 6 4 0 5 3 3 7 5 9 2 6 4 0 Fall 205, Oct 23... ELE2200-002 Lecture 5 24
Global Minimization Need four products. F F2 0 4 2 8 0 4 2 8 5 3 7 3 5 9 2 6 4 0 5 3 3 7 5 9 2 6 4 0 Fall 205, Oct 23... ELE2200-002 Lecture 5 25
Minimized SOP and POS F(,,,) = m(,3,4,7,) + d(5,2,3,4,5) = Π M(0,2,6,8,9,0) (5,2,3,4,5) 0 4 2 Φ 8 0 0 4 2 Φ 8 0 3 5 7 Φ 3 Φ 5 Φ 2 6 4 Φ 9 0 5 Φ 3 Φ 3 7 5 Φ 2 0 6 0 4 Φ 9 0 0 0 F = + + F = + + F = ( + )( + )( + ) Fall 205, Oct 23... ELE2200-002 Lecture 5 26
SOP and POS ircuits F(,,,) = m(,3,4,7,)+d(5,2,3,4,5) = Π M(0,2,6,8,9,0) (5,2,3,4,5) F = + + F = ( + )( + )( + ) F F re two circuits functionally Identical? Fall 205, Oct 23... ELE2200-002 Lecture 5 27
How on t ares Occur onsider two crossroads: highway with traffic signals, red (R), yellow (Y) and green (G), and rural road with red (r) and green (g) signals. Here R, Y, G, r and g are oolean variables; a 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 = ) only when R =, Y = G = 0, and r = g. Fall 205, Oct 23... ELE2200-002 Lecture 5 28
Traffic Signals Fall 205, Oct 23... ELE2200-002 Lecture 5 29
ompletely Specified Function Truth Table minterm R Y G g 0 0 0 0 0 0 0 0 2 0 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 G R Y G Y g = R Y G R g Fall 205, Oct 23... ELE2200-002 Lecture 5 30
Incompletely Specified Function dditional condition: Exactly one highway light can be on. Truth Table minterm R Y G g 0 0 0 0 Φ 0 0 0 2 0 0 0 3 0 Φ 4 0 0 5 0 Φ 6 0 Φ 7 Φ Φ or X denotes don t care g = R Fall 205, Oct 23... ELE2200-002 Lecture 5 3 G Y R Φ Φ Φ Φ Φ R g
bsorption Theorem For two oolean variables:, + = Proof: Fall 205, Oct 23... ELE2200-002 Lecture 5 32
onsensus Theorem For three oolean variables:,, + + = + Proof: Fall 205, Oct 23... ELE2200-002 Lecture 5 33
Growing Implicants to PI F = + + initial implicants = + + + consensus th. = + + absorption th. = + + + consensus th. = + + absorption th. Fall 205, Oct 23... ELE2200-002 Lecture 5 34
Identifying EPI Find all prime implicants. From prime implicant SOP, remove a PI. pply 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 205, Oct 23... ELE2200-002 Lecture 5 35
Example PI SOP: F = + + Is an EPI? F {} = +, no new PI can be generated Hence, is an EPI. Similarly, is an EPI. Fall 205, Oct 23... ELE2200-002 Lecture 5 36
Example (ont.) PI SOP: F = + + Is an EPI? F { } = + = + + (onsensus theorem) Hence is not an EPI (it is an RPI) Minimum SOP: F = + Fall 205, Oct 23... ELE2200-002 Lecture 5 37
Finding MSOP. Start with minterm or cube SOP representation of oolean function. 2. Find all prime implicants (PI). 3. Include all EPI s in MSOP. 4. Find the set of uncovered minterms, {U}. 5. MSOP is minimum if {U} is empty. ONE. 6. For a minterm in {U}, include the largest PI from remaining PI s (non-epi s) in MSOP. 7. Go to step 4. Fall 205, Oct 23... ELE2200-002 Lecture 5 38
Finding Uncovered Minterms, {U} {U} = ({PI} # {PMSOP}) # {} Where: {PI} is set of all prime implicants of the function. {PMSOP} is any partial SOP. {} is set of don t care minterms. Sharp (#) operation between oolean expressions X and Y, X # Y, is the set of minterms covered by X that are not covered by Y. Fall 205, Oct 23... ELE2200-002 Lecture 5 39
Example: # (Sharp) Operation # = {, } # = {, } Fall 205, Oct 23... ELE2200-002 Lecture 5 40
Minterms overed by a Product product from which k variables have been eliminated, covers 2 k minterms. Example: For four variables,,,, Product covers 2 2 = 4 minterms: ) 2) 3) 4) Obtained by inserting the eliminated variables in all possible ways. (4) (2) (3) () Fall 205, Oct 23... ELE2200-002 Lecture 5 4
Quine-Mcluskey Willard V. O. Quine 908 2000 Edward J. Mcluskey b. 929 Fall 205, Oct 23... ELE2200-002 Lecture 5 42
Quine-Mcluskey Tabular Minimization Method W. V. Quine, The Problem of Simplifying Truth Functions, merican Mathematical Monthly, vol. 59, no. 0, pp. 52-53, October 952. E. J. Mcluskey, Minimization of oolean Functions, ell System Technical Journal, vol. 35, no., pp. 47-444, November 956. Textbook, Section 3.9, pp. 2-225. Fall 205, Oct 23... ELE2200-002 Lecture 5 43
Q-M Tabular Minimization Minimizes functions with many variables. egin with minterms: Step : Tabulate minterms in groups of increasing number of true variables. Step 2: onduct 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 205, Oct 23... ELE2200-002 Lecture 5 44
F(,,,) = m(2,4,6,8,9,0,2,3,5) Q-M Step : Group minterms with true variable, 2 true variables, etc. Minterm Groups 2 000 4 000 8 000 6 00 9 00 0 00 2 00 : single 2: two s 3 0 3: three s 5 4: four s Fall 205, Oct 23... ELE2200-002 Lecture 5 45
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 and, written as 0 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. heck the minterm (or product) and repeat for all other minterms (or products). Fall 205, Oct 23... ELE2200-002 Lecture 5 46
Step 2 Executed on Example List List 2 _List 3 Minterm PI? Minterms PI? Minterms PI? 2 000 X 2, 6 0-0 PI_2 8,9,2,3-0- PI_ 4 000 X 2,0-00 PI_3 8 000 X 4,6 0-0 PI_4 6 00 X 4,2-00 PI_5 9 00 X 8,9 00- X 0 00 X 8,0 0-0 PI_6 2 00 X 8,2-00 X 3 0 X 9,3-0 X 5 X 2,3 0- X 3,5 - PI_7 Fall 205, Oct 23... ELE2200-002 Lecture 5 47
Step 3: Identify EPI s overed by EPI x x x x x Minterms 2 4 6 8 9 0 2 3 5 PI_ is EPI x x x x PI_2 x x PI_3 x x PI_4 x x PI_5 x x PI_6 x x PI_7 is EPI x x Fall 205, Oct 23... ELE2200-002 Lecture 5 48
Step 4: over Remaining Minterms Remaining minterms 2 4 6 0 PI_2 x x PI_3 x x PI_4 x x PI_5 PI_6 Integer linear program (ILP), available from Matlab and other sources: efine integer {0,} variables, xk =, select PI_k; xk = 0, do not select PI_k. Minimize k xk, subject to constraints: x2 + x3 x4 + x5 x2 + x4 x3 + x6 solution is x3 = x4 =, x2 = x5 = x6 = 0, or select PI_3, PI_4 Fall 205, Oct 23... ELE2200-002 Lecture 5 49 x x
Linear Programming (LP) mathematical optimization method for problems where some cost depends on a large number of variables. n easy to understand introduction is: S. I. Gass, n Illustrated Guide to Linear Programming, New York: over Publications, 970. Very useful tool for a variety of engineering design problems. vailable in software packages like Matlab. ourses on linear programming are available in Math, usiness and Engineering departments. Fall 205, Oct 23... ELE2200-002 Lecture 5 50
Q-M MSOP Solution and Verification F(,,,) = PI_ + PI_3 + PI_4 + PI_7 = -0- + -00 + 0-0 + - = + + + See Karnaugh map. EPI s in MSOP Non-EPI s in MSOP Non-EPI s not in MSOP Fall 205, Oct 23... ELE2200-002 Lecture 5 5
Minimized ircuit PI PI3 PI4 F PI7 Fall 205, Oct 23... ELE2200-002 Lecture 5 52
QM Minimizer on the Web http://quinemccluskey.com/ Fall 205, Oct 23... ELE2200-002 Lecture 5 53
Function with on t ares F(,,,) = m(4,6,8,9,0,2,3) + d(2, 5) Q-M Step : Group all minterms with true variable, 2 true variables, etc. Minterm Groups 2 000 4 000 8 000 6 00 9 00 0 00 2 00 : single 2: two s 3 0 3: three s 5 4: four s Fall 205, Oct 23... ELE2200-002 Lecture 5 54
Step 2: Same s efore on ll Minterms List List 2 List 3 Minterm PI? Minterms PI? Minterms PI? 2 000 X 2, 6 0-0 PI2 8,9,2,3-0- PI 4 000 X 2,0-00 PI3 8 000 X 4,6 0-0 PI4 6 00 X 4,2-00 PI5 9 00 X 8,9 00- X 0 00 X 8,0 0-0 PI6 2 00 X 8,2-00 X 3 0 X 9,3-0 X 5 X 2,3 0- X 3,5 - PI7 Fall 205, Oct 23... ELE2200-002 Lecture 5 55
Step 3: Identify EPI s Ignoring on t ares overed by EPI x x x x Minterms 4 6 8 9 0 2 3 PI is EPI x x x x PI2 x PI3 x PI4 x x PI5 x x PI6 x x PI7 x Fall 205, Oct 23... ELE2200-002 Lecture 5 56
Step 4: over Remaining Minterms Remaining minterms 4 6 0 PI_2 PI_3 PI_4 x x PI_5 PI_6 Integer linear program (ILP), available from Matlab and other sources: efine integer {0,} variables, xk =, select PI_k; xk = 0, do not select PI_k. Minimize k xk, subject to constraints: x4 + x5 x2 + x4 x3 + x6 solution is x3 = x4 =, x2 = x5 = x6 = 0, or select PI_3, PI_4 x x x x Fall 205, Oct 23... ELE2200-002 Lecture 5 57
Q-M MSOP Solution and Verification F(,,,) = PI_ + PI_3 + PI_4 = -0- + -00 + 0-0 = + + See Karnaugh map. EPI s in MSOP EPI s not selected Non-EPI s in MSOP Non-EPI s not in MSOP Fall 205, Oct 23... ELE2200-002 Lecture 5 58
Minimized ircuit PI PI3 F PI4 Fall 205, Oct 23... ELE2200-002 Lecture 5 59
Further Reading Incompletely specified functions: See Example 3.25, pages 28-220. Multiple output functions: See Example 3.26, pages 220-222. Fall 205, Oct 23... ELE2200-002 Lecture 5 60