Quine-McCluskey (Tabular) Minimization Two step process utilizing tabular listings to: Identify prime implicants (implicant tables) Identify minimal PI set (cover tables) All work is done in tabular form Number of variables is not a limitation Basis for many computer implementations Don t cares are easily handled Proper organization and term identification are key factors for correct results
Difficulty Note: Can be 2 n minterms ~ 3 n /n primes primes 3 n /n minterms 2 n Thus O(2 n ) rows and O(3 n /n ) columns and minimum covering problem is NP-complete. 2
Eample wy Karnaugh map Primes: Covering Table Solution: {,2} + (also ) F= wyz + wyz + wyz + wyz d= yz + wyz + yz + yz + wyz + wyz w yz z + + wy wy d d d z + d d d d d d is minimum prime cover. wyz wyz z wyz wyz 3 z wy
Covering Table wyz z wy Primes of f+d Minterms of f wyz wyz wyz Row singleton (essential minterm) Essential prime Definition: An essential prime is any prime that uniquely covers a minterm of f. 4
Quine-McCluskey Minimization (cont.) Terms are initially listed one per line in groups Each group contains terms with the same number of true and complemented variables Terms are listed in numerical order within group Terms and implicants are identified using one of three common notations full variable form cellular form,,- form
Eample of Different Notations F(A, B, C, D) = m (4,5,6,8,,3) Full variable Cellular,,- ABCD 4 ABCD 8 2 ABCD 5 ABCD 6 ABCD 3 ABCD 3
Notation Forms Full variable form: variables and complements in algebraic form hard to identify when adjacency applies very easy to make mistakes Cellular form: terms are identified by their decimal inde value easy to tell when adjacency applies; indees must differ by power of two (one bit),,- form: terms are identified by their binary inde value easier to translate to/from full variable form easy to identify when adjacency applies, one bit is different shows variable(s) dropped when adjacency is used Different forms may be mied during the minimization
Implication Table (,,-) Quine-McCluskey Method Tabular method to systematically find all prime implicants ƒ(a,b,c,d) = Σ m (,2.5,6,7,9,) + Σ d (,3,5) Part : Find all prime implicants Step : Fill Column with onset and DC-set minterm indices. Group by number of true variables (# of s). NOTE THAT DCs ARE INCLUDED IN THIS STEP! Column I Implication Table
Minimization - First Pass (,,-) Quine-McCluskey Method Tabular method to systematically find all prime implicants ƒ(a,b,c,d) = Σ m (,2.5,6,7,9,) + Σ d (,3,5) Part : Find all prime implicants Step 2: Apply Adjacency - Compare elements of group with N 's against those with N+ 's. One bit difference implies adjacent. Eliminate variable and place in net column. E.g., vs. yields - vs. yields - When used in a combination, mark with a check. If cannot be combined, mark with a star. These are the prime implicants. Repeat until nothing left. Column I 2 5 6 9 7 3 5 Implication Table Column II -, -,2 -,5 -,9-2,6-2, - 5,7-5,3-6,7-9,3-7,5-3,5
Minimization - Second Pass (,,-) Quine-McCluskey Method Step 2 cont.: Apply Adjacency - Compare elements of group with N 's against those with N+ 's. One bit difference implies adjacent. Eliminate variable and place in net column. E.g., vs. yields - - vs. - yields -- When used in a combination, mark with a check. If cannot be combined, mark with a star. THESE ARE THE PRIME IMPLICANTS. Repeat until nothing left. The set of constitutes the Complete Sum c Column I 2 5 6 9 7 3 5 Implication Table Column II - *, - *,2 -,5 -,9 - * 2,6 - * 2, - 5,7-5,3 - * 6.7-9,3-7,5-3,5 Column III -- *,5,9,3 - - *5,7,3,5
Prime Implicants ƒ(a,b,c,d) = Σ m (,2.5,6,7,9,) + Σ d (,3,5) C C D A B A D B Prime Implicants: - - A BC A C D - - A BD BC D - A BC -- B D -- C D Stage 2: find smallest set of prime implicants that cover the active-set Note that essential prime implicants must be in the final epression
Coverage Table rows = prime implicants columns = ON-set elements (minterms) place an "" if ON-set element is covered by the prime implicant NOTE: DON T INCLUDE DCs IN COVERAGE TABLE; THEY DON T HAVE TO BE MANDATORY COVERED Coverage Chart, - 2 5 6 7 9,2-2,6-2, - 6,7 -,5,9,3 -- 5,7,3,5 --
Row and Column Dominance Definition: Given two rows i and i 2, a row i is said to dominate i 2 if it has checks in all columns in which i 2 has checks, i.e. it is a superset of i 2 Eample: i i 2 i dominates i 2 We can remove row i 2, because we would never choose i 2 in a minimum cover since it can always be replaced by i (i 2 is anymore a prime implicant). DOMINATED ROWS CAN BE ELIMINATED 3
Row and Column Dominance Definition: Given two colums j and j 2, if the set of primes of column j 2 is contained in the set of primes of column j Eample: j 2 dominates j j j2 We can remove column j since we have to choose a prime to cover j 2, any such prime also covers j, that would result covered as well. DOMINATED COLUMNS CAN BE ELIMINATED 4
Pruning the Covering Table. Remove all rows covered by essential primes (columns in row singletons). Put these primes in the cover G. 2. Group identical rows together and remove dominated rows. 3. Remove dominating columns. For equal columns, keep just one to represent them. 4. Newly formed row singletons define n-ary essential primes. 5. Go to if covering table decreased. The algorithm may terminate successfully with a set of primes and an emty table. In case it terminate with a non empty table, the resulting reduced covering table is called the cyclic core. This has to be solved. A minimum solution for the cyclic core must be added to the resulting G. 5
Coverage Table (cont.) Coverage Chart, - 2 5 6 7 9, - 2 5 6 7 9,2 -,2-2,6-2,6-2, - 2, - 6,7-6,7 -,5,9,3 --,5,9,3 -- 5,7,3,5 -- 5,7,3,5 -- If column has a single, than the implicant associated with the row is essential. It must appear in the minimum cover
Coverage Table (cont.), - 2 5 6 7 9, - 2 5 6 7 9,2 -,2-2,6-2,6-2, - 2, - 6,7-6,7 -,5,9,3 --,5,9,3 -- 5,7,3,5 -- 5,7,3,5 -- Eliminate all columns covered by essential primes Find minimum set of rows that cover the remaining columns F = BCD + ABC + CD
Quine Mc Clunskey: Cyclic Core eample F= m (,,3,6,8,9,23,28,3,3) V = Y V = Y W W Z Z F=v w y +v w z+w y z +w yz+vw z +vw y+vwz +vwy+vw yz+vyz A B C D E F G H I J
Implication Table (,,-) Quine-McCluskey Method Tabular method to systematically find all prime implicants ƒ(v,w,,y,z) = Σm(,,3,6,8,9,23,28,3,3) Part : Find all prime implicants Step : Fill Column with activeset and DC-set minterm indices. 6 3 8 Group by number of true variables (# of s). 9 28 23 3 3 Column I Implication Table Column II - * - * - * - * - * - * - * - * - * - * A: C: 6 B: 3 E:6 8 D: 3 9 F: 8 9 I: 9 23 G:28 3 J: 23 3 H: 3 3 F=v w y +v w z+w y z +w yz+vw z +vw y+vwz +vwy+vw yz+vyz A B C D E F G H I J
Quine Mc Clunskey F= 5 (,,3,6,8,9,23,28,3,3) 3 6 8 9 23 28 3 3 A B C D E F G H I J G+J+A+D+E; G+J+B+C+F; G+J+C+B+F; G+J+D+A+E; G+J+E+A+D; G+J+F+B+C.
Quine Mc Clunskey: Cyclic Core eample F= m (,,3,6,8,9,23,28,3,3) V = Y V = Y G:28 3 J:23 3 A: D: 3 9 E:6 8 W W B: 3 C: 6 F:8 9 Z PRIME ESSENTIAL Z I: 9 23 H:3 3 F=v w y +v w z+w y z +w yz+vw z +vw y+vwz +vwy+vw yz+vyz A B C D E F G H I J G+J+A+D+E; G+J+B+C+F
Generating Primes multiple outputs Eample: f(, y, z) = m(3,5,7), f2(, y, z) = m(,2,3) f z y f2 y z - - f=yz+z -- - y z f2=z+y - - z y z y z f f2 z y z z f f2 The idea is that we can share terms: using separate optimizations 6 gates and G=2 sharing a term 5 gates and G=. -- - - f f2= (yz+z)(z+y) f f2 = yz 22
Generating Primes multiple outputs Theorem: if p is a prime implicant for f, and p 2 is a prime implicant for f 2, then if p.p 2, p.p 2 is a prime implicant of f.f 2 Theorem: if p 3 is a prime implicant for f.f 2, then there eist p for f, and p 2 for f 2, such that p 3 =p.p 2 We can conclude that all prime implicants of f.f 2 are minimal sharable products for f and f 2 : and that all prime implicants for f.f 2 are created by products of prime implicants for f and f 2 The way to use this is to make the prime implicants of f.f 2 available to the minimizations of f and f 2 by etending the table concept 23
Generating Primes multiple outputs Procedure similar to single-output function, ecept: include also the primes of the products of individual functions f minterms f 2 minterms Rows for f prime implicants: mark only f columns Rows for f 2 prime implicants: mark only f 2 columns Rows for f f 2 prime implicants: mark both f and f 2 columns
Minimize multiple-output cover f f 2 f f 2 Eample, cont. m 3 = m 5 = m 7 = m = m 2 = m 3 = m 3 = p = y z p 2 = z - - - p 3 = y p 4 = z - p 5 = y z m 3 m 5 m 7 m m 2 m 3 p p 2 p 3 p 4 p 5 f f 2 p p 3 m 3 m 3 p 5 Note that selecting p 5 and removing all columns the marks coverage is complete Min cover has 3 primes: F = { p 2, p 4, p 5 } 25