Quine-McCluskey (Tabular) Minimization Two step process utilizing tabular listings to: Identify prime implicants (implicant tables) Identify minimal PI.

Slides:



Advertisements
Similar presentations
FUNCTION OPTIMIZATION Switching Function Representations can be Classified in Terms of Levels Number of Levels, k, is Number of Unique Boolean (binary)
Advertisements

Glitches & Hazards.
CSEE 4823 Advanced Logic Design Handout: Lecture #2 1/22/15
ECE C03 Lecture 31 Lecture 3 Two-Level Logic Minimization Algorithms Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
ELEC Digital Logic Circuits Fall 2008 Logic Minimization (Chapter 3) Vishwani D. Agrawal James J. Danaher Professor Department of Electrical and.
Quine-McCluskey (Tabular) Minimization  Two step process utilizing tabular listings to:  Identify prime implicants (implicant tables)  Identify minimal.
بهينه سازي با روش Quine-McCluskey
ECE C03 Lecture 21 Lecture 2 Two Level Minimization Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
EDA (CS286.5b) Day 15 Logic Synthesis: Two-Level.
Chapter 3 Simplification of Switching Functions
Gate Logic: Two Level Canonical Forms
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 4-1 Chapter #2: Two-Level Combinational Logic Section 2.3, Switches and Tools.

ECE Synthesis & Verification 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Exact Two-level Minimization Quine-McCluskey Procedure.
ECE 667 Synthesis and Verification of Digital Systems
Courtesy RK Brayton (UCB) and A Kuehlmann (Cadence) 1 Logic Synthesis Two-Level Minimization I.
Two Level Logic Optimization. Two-Level Logic Minimization PLA Implementation Ex: F 0 = A + B’C’ F 1 = AC’ + AB F 2 = B’C’ + AB product term AB, AC’,
11.1 Boolean Functions. Boolean Algebra An algebra is a set with one or more operations defined on it. A boolean algebra has three main operations, and,
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
2-Level Minimization Classic Problem in Switching Theory
1 Simplification of Boolean Functions:  An implementation of a Boolean Function requires the use of logic gates.  A smaller number of gates, with each.
Department of Computer Engineering
Chapter 3. Minimization of Switching Functions. Given a sw function f(x 1, x 2, …, x n ) and some cost criteria, find a representation of f which minimizes.
The covering procedure. Remove rows with essential PI’s and any columns with x’s in those rows.
2-Level Minimization Classic Problem in Switching Theory Tabulation Method Transformed to “Set Covering Problem” “Set Covering Problem” is Intractable.
Two-Level Simplification Approaches Algebraic Simplification: - algorithm/systematic procedure is not always possible - No method for knowing when the.
UM EECS 270 Spring 2011 – Taken from Dr.Karem Sakallah Logic Synthesis: From Specs to Circuits Implementation Styles –Random –Regular Optimization Criteria.
Computer Organization CSC 405 Quine-McKluskey Minimization.
Combinational Logic Part 2: Karnaugh maps (quick).
Two Level Networks. Two-Level Networks Slide 2 SOPs A function has, in general many SOPs Functions can be simplified using Boolean algebra Compare the.
Copyright © 2004 by Miguel A. Marin Revised McGILL UNIVERSITY DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING COURSE ECSE DIGITAL SYSTEMS.
2-1 Introduction Gate Logic: Two-Level Simplification Design Example: Two Bit Comparator Block Diagram and Truth Table A 4-Variable K-map for each of the.
Simplification of incompletely specified functions using QM Tech.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 Topic 5: Quine-McCluskey Method José Nelson Amaral.
Gate-Level Minimization
1 Quine-McCluskey Method. 2 Motivation Karnaugh maps are very effective for the minimization of expressions with up to 5 or 6 inputs. However they are.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
Computer Engineering (Logic Circuits) (Karnaugh Map)
07 KM Page 1 ECEn/CS 224 Karnaugh Maps. 07 KM Page 2 ECEn/CS 224 What are Karnaugh Maps? A simpler way to handle most (but not all) jobs of manipulating.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Combinational Logic Part 3 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
CALTECH CS137 Winter DeHon CS137: Electronic Design Automation Day 15: March 4, 2002 Two-Level Logic-Synthesis.
Prof. Hsien-Hsin Sean Lee
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
1 Example: Groupings on 3-Variable K-Maps BC F(A,B,C) = A ’ B ’ A BC F(A,B,C) = B ’ A
Key Observation Adjacencies in the K-Map
1 Gate Level Minimization EE 208 – Logic Design Chapter 3 Sohaib Majzoub.
Digital Logic (Karnaugh Map). Karnaugh Maps Karnaugh maps (K-maps) are graphical representations of boolean functions. One map cell corresponds to a row.
Boolean Functions 1 ECE 667 ECE 667 Synthesis and Verification of Digital Circuits Boolean Functions Basics Maciej Ciesielski Univ.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
©2010 Cengage Learning SLIDES FOR CHAPTER 6 QUINE-McCLUSKEY METHOD Click the mouse to move to the next page. Use the ESC key to exit this chapter. This.
Technical Seminar II Implementation of
CHAPTER 6 Quine-McCluskey Method
Lecture 6 Quine-McCluskey Method
3-7 Other Two-level Implementations
Lecture #6 EGR 277 – Digital Logic
QUINE-McCLUSKEY METHOD
Plotting functions not in canonical form
CS 352 Introduction to Logic Design
Digital Logic & Design Dr. Waseem Ikram Lecture 12.
Digital Logic & Design Dr. Waseem Ikram Lecture 13.
CHAPTER 5 KARNAUGH MAPS 5.1 Minimum Forms of Switching Functions
CSE 370 – Winter 2002 – Logic minimization - 1
COE 202: Digital Logic Design Combinational Logic Part 3
ECB2212-Digital Electronics
Minimization of Switching Functions
Overview Part 2 – Circuit Optimization
3-Variable K-map AB/C AB/C A’B’ A’B AB AB’
CHAPTER 6 QUINE-McCLUSKEY METHOD
ECE 352 Digital System Fundamentals
Presentation transcript:

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

2 Difficulty Note: Can be 2 n minterms ~ 3 n /n primes Thus O(2 n ) rows and O(3 n /n ) columns AND minimum covering problem is NP-complete. Hence can probably be double exponential in size of input, i.e. difficulty is O(2 3 n ) n /n minterms primes 2n2n

3 Example Primes:  y + w +  x  z Covering Table Solution: {1,2}   y + w is minimum prime cover. (also w +  x  z) xyxy xyxyxyxyxyxy zwzw  z w z w zwzw xzxz w Karnaugh map yyw xzxz x  y  z w  x y z w  x y  z w xyzwxyzw yy

4 Covering Table Definition: An essential prime is any prime that uniquely covers a minterm of f. yyw xzxz x  y  z w  x y z w  x y  z w xyzwxyzw Primes of f+d Minterms of f Essential prime Row singleton (essential minterm)

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 1,0,- form

Example of Different Notations F(A, B, C, D) =  m(4,5,6,8,10,13) 1ABCD ABCD ABCD ABCD ABCD ABCD Full variable Cellular 1,0,-

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 index value Easy to tell when adjacency applies; indexes must differ by power of two (one bit) 1,0,- form - terms are identified by their binary index 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 mixed during the minimization

Implication Table (1,0,-) Quine-McCluskey Method Tabular method to systematically find all prime implicants ƒ(A,B,C,D) = Σ m(1,2.5,6,7,9,10) + Σ d(0,13,15) Part 1: Find all prime implicants Step 1: Fill Column 1 with active- set and DC-set minterm indices. Group by number of true variables (# of 1’s). NOTE THAT DCs ARE INCLUDED IN THIS STEP! Implication Table Column I

Minimization - First Pass (1,0,-) Quine-McCluskey Method Tabular method to systematically find all prime implicants ƒ(A,B,C,D) = Σ m(1,2.5,6,7,9,10) + Σ d(0,13,15) Part 1: Find all prime implicants Step 2: Apply Adjacency - Compare elements of group with N 1's against those with N+1 1's. One bit difference implies adjacent. Eliminate variable and place in next column. E.g., 0000 vs yields vs yields -000 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. Implication Table Column I Column II

Minimization - Second Pass (1,0,-) Implication Table Column I Column II 000- * 00-0 * * -010 * * Column III * * Quine-McCluskey Method Step 2 cont.: Apply Adjacency - Compare elements of group with N 1's against those with N+1 1's. One bit difference implies adjacent. Eliminate variable and place in next column. E.g., 0000 vs yields vs yields -0-0 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

Minimization - Second Pass (1,0,-) Quine-McCluskey Method Step 2 cont.: Apply Adjacency - Compare elements of group with N 1's against those with N+1 1's. One bit difference implies adjacent. Eliminate variable and place in next column. E.g., 0000 vs yields vs yields -000 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. Implication Table Column I Column II 0-00 * -000 * * 10-0 * * Column III 01-- * -1-1 *

Prime Implicants Prime Implicants: X X X C D A A B C B D Stage 2: find smallest set of prime implicants that cover the active-set Note that essential prime implicants must be in final expression

rows = prime implicants columns = ON-set elements (minterms) place an "X" if ON-set element is covered by the prime implicant Coverage Chart 0, , , , , ,5,9, ,7,13, XX1XX 2XXX2XXX 5XX5XX 6XX6XX 7XX7XX 9X9X 10 X Coverage Table NOTE: DON’T INCLUDE DCs IN COVERAGE TABLE; THEY DON’T HAVE COVERED BY THE FINAL LOGIC EXPRESSION!

14 Row and Column Dominance Definition: Given two rows i 1 and i 2, a row i 1 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 Example: i 1 x x x x x x i 2 x x x x i 1 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 1 (i 2 is anymore a prime implicant). DOMINATED ROWS CAN BE ELIMINATED

15 Row and Column Dominance Definition: Given two colums j 1 and j 2, if the set of primes of column j 2 is contained in the set of primes of column j 1 is said to be dominated by j 1. Example: j 1 dominates j 2 We can remove column j 1 since we have to choose a prime to cover j 2, any such prime also covers j 1, that would result covered as well. DOMINATING COLUMNS CAN BE ELIMINATED j1 j2 xx x

16 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 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 1 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.

Coverage Table (cont.) rows = prime implicants columns = ON-set elements place an "X" if ON-set element is covered by the prime implicant Coverage Chart 0, , , , , ,5,9, ,7,13, XX1XX 2XXX2XXX 5XX5XX 6XX6XX 7XX7XX 9X9X 10 X If column has a single X, than the implicant associated with the row is essential. It must appear in minimum cover 0, , , , , ,5,9, ,7,13, XX1XX 2XXX2XXX 5XX5XX 6XX6XX 7XX7XX 9X9X 10 X

Coverage Table (cont.) F = BCD + ABC + CD Eliminate all columns covered by essential primes 0, , , , , ,5,9, ,7,13, XX1XX 2XXX2XXX 5XX5XX 6XX6XX 7XX7XX 9X9X 10 X Find minimum set of rows that cover the remaining columns 0, , , , , ,5,9, ,7,13, XX1XX 2XXX2XXX 5XX5XX 6XX6XX 7XX7XX 9X9X 10 X

Quine Mc Clunskey: Cyclic Core example F=  5 (0,1,3,16,18,19,23,28,30,31) F=v’w’y’x’+v’w’x’z+w’x’y’z’+w’x’yz+vw’x’z’+vw’x’y+ vwxz’ +vwxy+vw’yz+ vxyz A B C D E F G H I J X Y Z W V = 0 X Z W V = 1 Y

Implication Table (1,0,-) Quine-McCluskey Method Tabular method to systematically find all prime implicants ƒ(v,w,x,y,z) = Σm(0,1,3,16,18,19,23,28,30,31) Part 1: Find all prime implicants Step 1: Fill Column 1 with active- set and DC-set minterm indices. Group by number of true variables (# of 1’s). Implication Table Column I Column II * * * * * * * * * * A: 0 1 C: 0 16 B: 1 3 E:16 18 D: 3 19 F: I: G: J: H: F=v’w’y’x’+v’w’x’z+w’x’y’z’+w’x’yz+vw’x’z’+vw’x’y+vwxz’+vwxy+vw’yz+vxyz A B C D E F G H I J

Quine Mc Clunskey F=  5 (0,1,3,16,18,19,23,28,30,31) A x x B x x C x x D x x E x x F x x G x x H x x I x x J x x 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+B+C+F.

Quine Mc Clunskey: Cyclic Core example F=  5 (0,1,3,16,18,19,23,28,30,31) F=v’w’y’x’+v’w’x’z+w’x’y’z’+w’x’yz+vw’x’z’+vw’x’y+ vwxz’ +vwxy+vw’yz+ vxyz A B C D E F G H I J X Y Z W V = 0 X Z W V = 1 Y PRIME ESSENTIAL

f f Generating Primes – multiple outputs Example: f1(x, y, z) =  m(3,5,7), f2(x, y, z) =  m(0,2,3) x y z – 1 f1=yz+zx x y z x z y x z x f1 f2 – – – z x z y z x y f1 f2 x – – z – The idea is that we can share terms: using separate optimizations 6 gates, sharing a term 5 gates. x y z 0 – – f2=xz+xy - -- f1 f2= (yz+zx)(xz+xy) f1 f2 = xyz

24 Generating Primes – multiple outputs Theorem: if p 1 is a prime implicant for f 1, and p 2 is a prime implicant for f 2, then if p 1.p 2  0, p 1.p 2 is a prime implicant of f 1.f 2 Theorem: if p 3 is a prime implicant for f 1.f 2, then there exist p 1 for f 1, and p 2 for f 2, such that p 3 =p 1.p 2 We can conclude that all prime implicants of f 1.f 2, are minimal sharable products for f 1 and f 2 : and that all prime implicants for f 1.f 2 are created by products of prime implicants for f 1.f 2 The way to use this is to make the prime implicants of f 1.f 2 available to the minimizations of f 1 and f 2 by extending the table concept

Generating Primes – multiple outputs Procedure similar to single-output function, except: include also the primes of the products of individual functions f 1 mintermsf 2 minterms Rows for f 1 prime implicants: mark only f 1 columns Rows for f 2 prime implicants: mark only f 2 columns Rows for f 1 f 2 prime implicants: mark both f 1 f 2 columns

26 Minimize multiple-output cover Example, cont. f1f1 f2f Min cover has 3 primes: F = { p 2, p 4, p 5 } - m 3 = m 5 = m 7 = m 0 = m 2 = m 3 = p 1 = y z p 2 = x z p 3 = x y p 4 = x z p 5 = x y z f1f1 f2f2 f 1 f 2 m3m3 m5m5 m7m7 m0m0 m2m2 m3m3 p1p1 p2p2 p3p3 p4p4 p5p5 m3m3 m3m3 p1p1 p3p3 p5p5 Note that selecting p 5 and removing all columns the marks coverage is complete