1 / 20

ECE 667 Synthesis and Verification of Digital Systems

ECE 667 Synthesis and Verification of Digital Systems. Exact Two-level Minimization Quine-McCluskey Procedure. Slides adopted (with permission) from A. Kuehlmann, UC Berkeley, 2003. Outline. QM Theorem Generating all primes Single output functions Multiple output functions

leann
Download Presentation

ECE 667 Synthesis and Verification of Digital Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECE 667Synthesis and Verificationof Digital Systems Exact Two-level Minimization Quine-McCluskey Procedure Slides adopted (with permission) from A. Kuehlmann, UC Berkeley, 2003

  2. Outline • QM Theorem • Generating all primes • Single output functions • Multiple output functions • Setting up a covering table • Solving the Unate Covering Problem • Reduction rules • Solving cyclic core ECE 667 - Synthesis & Verification

  3. Quine-McCluskey Theorem Theorem(Quine): There is a minimum cover that is prime Proof: Consider a minimum cover that is not prime. Each non-prime implicant can be replaced by a prime implicant that covers it. Thus the resulting set of implicants is a cover and has the same cardinality as the original cover. Hence, there is a minimum cover that is prime. • Given initial cover for F = (f,d,r), find a minimum cover G of primes where: f  G  f+d G is a prime cover of F ; f = on-set, r = off-set, d = don’t care set ECE 667 - Synthesis & Verification

  4. Quine-McCluskey Procedure (Exact) Q-M Procedure: 1. Generate all primes(f+d), call it {Pi} 2. Generate all minterms of (f+d), call it {mi} 3. Build a covering (prime implicant) matrix B, where Bij = 1 if mi Pj = 0 otherwise 4. Solve the minimum column covering problem for B (unate covering problem), UCP. ECE 667 - Synthesis & Verification

  5. (on set) (don’t care set) xy xy xy xy y’ zw xz w zw y’ w x’z’ x’y’z’w’ zw x’y z’w zw x y’z’w x’y zw Example Covering table Primes: y’ + w + x’z’ ECE 667 - Synthesis & Verification

  6. y’ w x’z’ x’y’ z’w’ x’y z’w Minterms of f x y’ z’w Row singleton (essential minterm) x’y z w Essential prime Covering Table {p1 p2 p3} Primes of (f+d) Recall: An essential prime is any prime that uniquely covers a minterm of f. Solution: {p1,p2} y + w is minimum prime cover. (Also w + xz) Possible approach (SAT):(p1+p3)(p2 +p3)(p1+p2)p2 ECE 667 - Synthesis & Verification

  7. Table reduction - Column Dominance Definition: A column P1 whose 1-entries are a superset of another column P2 is said to dominateP2. Example: P1dominates P2 (it has 1 everywhere P2 has) P1P2 1 0 0 0 1 1 0 0 1 1 We can remove dominated columnP2 since P1covers all those rows and more. We would never choose P2 in a minimum cover since it can always be replaced by P1. ECE 667 - Synthesis & Verification

  8. Dominatingrow Row Dominance and equality Definition: A row m1 whose set of primes contains the set of primes of row m2 is said to dominate m2.. Example: m1 011110 m2 011010 m1dominates m2 : it has 1 everywhere m2 has 1 • We can remove dominating rowm1: • any prime that covers m2 also covers m1 (covered automatically). • Row Equality: • In practice, many rows are identical. That is there exist minterms that are contained in the same set of primes. ECE 667 - Synthesis & Verification

  9. primes 3n/n 0 1 minterms 2n 0 0 0 1 Difficulty Thesize of table: • ~ 2n minterms • ~ 3n/n primes We have O(2n) rows and O(3n/n ) columns AND minimum covering problem is NP-complete. Hence it can probably be double exponential in size of input, i.e. difficulty is O(23n) ECE 667 - Synthesis & Verification

  10. Pruning the Covering Table 1. 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 dominating rows. 3. Remove dominated columns. For equal columns, keep one prime to represent them. 4. Newly formed row singletons define essential primes. 5. Go to step 1 if covering table decreased. • The resulting reduced covering table is called the cyclic core. • This has to be solved (unate covering problem). • A minimum solution is added to G (set of essential primes). • The resulting G is a minimum cover. ECE 667 - Synthesis & Verification

  11. 3456 1000 1110 Essential prime + column dominance G = P1 0101 Essential primes + column dominance: G = P1 + P3 0011 0110 0111 456 456 Row dominance 101 101 011 011 110 110 111 Example 1234567 P1 is essential P3 is essential P3 dominates P2 P4 dominates P7 Cyclic Core ECE 667 - Synthesis & Verification

  12. 1 1 1 0 1 1 1 1 1 1 C A Solving the Cyclic Core • Best known method (for unate covering) is branch and bound with some clever bounding heuristics. • Independent Set Heuristic: • Find a maximum set of “independent” rows I. • Two rows Bi, Bkare independent if they have no column in common Example: Covering matrix B rearranged with independent sets first. B = I = Independent set of rows ECE 667 - Synthesis & Verification

  13. 1 1 1 0 1 1 1 1 1 1 C A Solving the Cyclic Core Lemma: | Cover |  | I | I ECE 667 - Synthesis & Verification

  14. 1 1 1 0 1 1 1 1 1 1 C A Heuristic Let I= { I1, I2, …, Ik } be the independent set of rows • Choose column j  Ii which covers the most rows of A. • Put j  J • Eliminate all rows covered by column j • Update I  I \ {Ii} • If | I |  0, go to step 1 • If B is empty, then done (in this case we have the guaranteed minimum solution, |J| = |I |) else, choose an independent set of B and go to 1 • Can you think of some Improved heuristics? • What about weighted optimization problem: min  wi ? ECE 667 - Synthesis & Verification

  15. Branch and Bound Algorithm (generic) ECE 667 - Synthesis & Verification

  16. w’ x’ y’  w’ x’ z’  x’ y’ z’  x’ y’ z  x’ y z’  w x’ y’  w x’ z’  w y’ z w y z’ w x y w x z w’ x’ y’ z’  w’ x’ y’ z  w’ x’ y z’  w x’ y’ z’  w x’ y’ z  w x’ y z’  w x y z’  w x y’ z  w x y z  x’ y’ x’ z’ Generating Primes - single output func. Tabular method (based on consensus operation): • Start with all minterm canonical form of F • Group pairs of adjacent minterms into cubes • Repeat merging cubes until no more merging possible; mark () + remove all covered cubes. • Result: set of primes of f. Example: F= x’ y’ + w x y + x’ y z’ + w y’ z F= x’ y’ + w x y + x’ y z’ + w y’ z ECE 667 - Synthesis & Verification

  17. x y z 0 – 0 0 1 1 1 – 1 f1 f2 0 1 1 1 1 0 f2 011 111 f1 011 111 001 001 101 101 010 110 010 110 000 100 x y z 0 – 0 0 1 – – 1 1 1 – 1 f1 f2 0 1 0 1 1 0 1 0 000 100 y x z Generating Primes – multiple outputs • Procedure similar to single-output function, except: • include also the primes of the products of individual functions Example: ECE 667 - Synthesis & Verification

  18. 000 | 01  010 | 01  011|11 101 | 10  111 | 10  0 – 0|01 0 1–|01 – 1 1|10 1 – 1|10 f2 f1 011 111 011 111 x y z 0 – 0 0 1 – – 1 1 1 – 1 f1 f2 0 1 0 1 1 0 1 0 001 001 101 101 010 010 110 110 000 100 000 100 Generating Primes - example • Modification (w.r.t single output function): • When two adjacent implicants are merged, the output parts are intersected There are five primes listed for this two-output function. - What is the min cover ? ECE 667 - Synthesis & Verification

  19. 000 | 01 010 | 01 011 | 01 011 | 10 101 | 10 111 | 10 0 1 0 0 0 0 1 1 0 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 1 1 IMPORTANT: Multiple-output minterms must be split into individual, single-output cubes to solve covering f1 f2 011 111 011 111 001 001 101 101 010 010 110 110 000 100 000 100 Minimize multiple-output cover - example • List multiple-output primes • Create a covering table, solve p1 p2 p3 p4 p5 p1 = 0 1 1 | 11 p2 = 0 – 0 | 01 p3 = 0 1 – | 01 p4 = – 1 1 | 10 p5 = 1 – 1 | 10 Min cover has 3 primes: F = { p1, p2, p5 } ECE 667 - Synthesis & Verification

  20. Summary Q-M: 1. Generate cover of all primes2. Make G irredundant (in optimum way) Note: Q-M isexacti.e., it gives an exact minimum Heuristic Methods: • Generate (somehow) a cover of F using some of the primes • Make G irredundant (maybe not optimally) • Keep best result - try again (go to 1) ECE 667 - Synthesis & Verification

More Related