CSEE 6861 CAD of Digital Systems Handout: Lecture #3 2/4/16 Prof. Steven M. Nowick nowick@cs.columbia.edu Department of Computer Science (and Elect. Eng.) Columbia University New York, NY, USA ESPRESSO Algorithm: The “ EXPAND ” Step, continued 1
“ EXPAND ” Step: Expansion Direction (REVIEW) Basic idea: - Once cube c in cover F is selected for expansion, expand it in “ good directions ” 3 Heuristic Expansion Steps (in sequence): to expand a cube c 1. Expand c to completely contain (i.e. “ swallow up ” ) as many other cubes of cover F as possible - delete these completely-contained cubes immediately! 2. Once #1 done -- continue to expand c to partially overlap as many other cubes of cover F as possible - the goal is to “ induce redundancies ” , which then get deleted in the IRRED step 3. Once #2 done -- continue to expand c into a “ maximal size ” prime implicant New Focus: Step #2 and #3 #3 “ EXPAND ” Step: Expansion Direction Example #1: illustrates Step #1 + Step #2 Suppose cube A has been picked for expansion wx 00 01 11 10 � yz - 1 1 0 00 C A 1 1 - 0 B 01 1 1 1 - 11 D 1 0 0 - 10 E #4 2
“ EXPAND ” Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #1: expand cube A to fully contain as many other cubes as possible wx 00 01 11 10 � yz - 1 1 0 00 C A 1 1 - 0 B 01 1 1 1 - 11 D 1 0 0 - 10 E #5 “ EXPAND ” Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #1: expand cube A to fully contain as many other cubes as possible wx 00 01 11 10 � yz - 1 1 0 00 C A ’ 1 1 - 0 B - expand cube A to fully contain cube B 01 1 1 1 - 11 D 1 0 0 - 10 E #6 3
“ EXPAND ” Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #1: expand cube A to fully contain as many other cubes as possible wx 00 01 11 10 � yz - 1 1 0 00 C A ’ 1 1 - 0 - expand cube A to fully contain cube B B 01 - delete cube B 1 1 1 - 11 D 1 0 0 - 10 E #7 “ EXPAND ” Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #2: expand cube A ’ , by 1 variable at a time, to overlap as many other cubes as possible wx 00 01 11 10 � yz - 1 1 0 00 C A ’ 1 1 - 0 B 01 1 1 1 - 11 D 1 0 0 - 10 E #8 4
“ EXPAND ” Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #2: expand cube A ’ , by 1 variable at a time, to overlap as many other cubes as possible wx 00 01 11 10 � yz Option 1: expand cube A ’ in “ z ’ dimension ” : - 1 1 0 00 overlaps 1 additional cube (C) C A ’ 1 1 - 0 B 01 1 1 1 - 11 D 1 0 0 - 10 E #9 “ EXPAND ” Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #2: expand cube A ’ , by 1 variable at a time, to overlap as many other cubes as possible wx 00 01 11 10 � yz Option 2: expand cube A ’ in “ y dimension ” : - 1 1 0 00 overlaps 2 additional cubes (D, E) C A ’ 1 1 - 0 B 01 1 1 1 - 11 D 1 0 0 - 10 E #10 5
“ EXPAND ” Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #2: expand cube A ’ , by 1 variable at a time, to overlap as many other cubes as possible wx 00 01 11 10 � yz - 1 1 0 00 C Final choice = Option 2: A ’’ expand cube A ’ in “ y dimension ” 1 1 - 0 B 01 1 1 1 - 11 D 1 0 0 - 10 E #11 “ EXPAND ” Step: Expansion Direction Example #2: illustrates Step #2 + Step #3 Suppose cube A has been picked for expansion wx 00 01 11 10 � yz - 0 - 0 00 A - - 1 - 01 - 1 1 1 11 C B 0 1 1 1 10 #12 6
“ EXPAND ” Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #2: expand cube A, by 1 variable at a time, to overlap as many other cubes as possible wx 00 01 11 10 � yz - 0 - 0 00 Final choice = A expand cube A in “ y dimension ” - - 1 - 01 overlaps cubes B & C - 1 1 1 11 C B 0 1 1 1 10 #13 “ EXPAND ” Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #2: expand cube A, by 1 variable at a time, to overlap as many other cubes as possible wx 00 01 11 10 � yz - 0 - 0 00 A ’ Final choice = expand cube A in “ y dimension ” - - 1 - 01 - 1 1 1 11 C B 0 1 1 1 10 #14 7
“ EXPAND ” Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #3: expand cube A ’ into a maximal size prime implicant wx 00 01 11 10 � yz - 0 - 0 00 A ’ - - 1 - 01 - 1 1 1 11 C B 0 1 1 1 10 #15 “ EXPAND ” Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #3: expand cube A ’ into a maximal size prime implicant wx 00 01 11 10 � yz - 0 - 0 00 Option 1: expand cube A ’ in “ z ’ dimension ” - - 1 - A ’ 01 - A ’ becomes wx - 1 1 1 11 C B 0 1 1 1 10 #16 8
“ EXPAND ” Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #3: expand cube A ’ into a maximal size prime implicant wx 00 01 11 10 � yz - 0 - 0 00 Option 2: expand cube A ’ in w ’ /x ’ dimensions - - 1 - A ’ - A ’ becomes z 01 - 1 1 1 11 0 1 1 1 B 10 C #17 “ EXPAND ” Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #3: expand cube A ’ into a maximal size prime implicant wx 00 01 11 10 � yz - 0 - 0 00 A ’’ Final choice = Option 2 - - 1 - - ‘ larger ’ prime (A ’’ = z) has fewer literals 01 - 1 1 1 11 0 1 1 1 B 10 C #18 9
ESPRESSO Algorithm: The “ IRREDUNDANT ” Step The “ IRREDUNDANT ” Step Example Cover: after “ expand ” = prime cover Given: cover F (after EXPAND) wx 00 01 11 10 � P1 yz Goal: make F irredundant = 1 1 0 0 00 delete max # of implicants P3 P2 while still maintaining a valid cover 0 1 1 0 01 P4 P5 0 0 1 1 11 - - 1 0 P6 10 #20 10
The “ IRREDUNDANT ” Step Approach #1 (SUBOPTIMAL!) : greedily remove one redundant cube at a time wx wx P1 00 01 11 10 � P1 00 01 11 10 � yz yz 1 1 0 0 1 1 0 0 00 00 P3 P2 P2 0 1 1 0 0 1 1 0 01 01 P4 P4 P5 P5 0 0 1 1 0 0 1 1 11 11 - - 1 0 - - 1 0 P6 P6 10 10 after deleting P3: before: irredundant suboptimal cover #21 The “ IRREDUNDANT ” Step Approach #2 (OPTIMAL!) : form & solve an exact optimization problem This is approach used in ESPRESSO…: wx P1 00 01 11 10 � yz 1 1 0 0 Goal: set up a simplified PI table, 00 P3 and solve it exactly, to determine P2 min # of cubes to keep 0 1 1 0 01 (delete all others) P4 P5 0 0 1 1 11 - - 1 0 P6 10 before: #22 11
The “ IRREDUNDANT ” Step Simplified PI Table: prime implicants P1 P2 P3 P4 P5 P6 X 0000 X X 0100 X X ON-set minterms 0101 X X 1101 X X 1111 X 1011 X 1110 #23 The “ IRREDUNDANT ” Step Approach: solve PI table exactly Simplified PI Table: prime implicants P1 P2 P3 P4 P5 P6 X 0000 X X 0100 Optimal Solution: X X - select {P1,P2,P5,P6} ON-set minterms 0101 - discard rest…. X X 1101 X X 1111 X 1011 X 1110 #24 12
The “ IRREDUNDANT ” Step An Issue: - How can afford to compute an exact solution to prime implicant table (like the expensive Quine-McCluskey method!) in the inner loop of a fast heuristic algorithm (espresso)? Justification: - This is not the same as the QM method! Key Observation: columns in this table are only the primes in current cover, -- not all the primes of the function! Hence, there is no prime generation step, and often a (much) smaller table! #25 The “ IRREDUNDANT ” Step Approach #2 (OPTIMAL) : final solution wx wx P1 P1 00 01 11 10 � 00 01 11 10 � yz yz 1 1 0 0 1 1 0 0 00 00 P3 P2 0 P3 1 1 0 0 1 1 0 01 01 P4 P5 P5 0 0 1 1 0 0 1 1 11 11 - - 1 0 - - 1 0 P6 P6 10 10 after: before: irredundant optimal cover #26 13
ESPRESSO Algorithm: The “ REDUCE ” Step The “ REDUCE ” Step Example Cover: after “ expand ” and “ irredundant ” = prime irredundant cover A B (DC) z y x C #28 14
The “ REDUCE ” Step Example Cover: after “ expand ” and “ irredundant ” = prime irredundant cover A Given: cover F (after EXPAND/IRRED) B (DC) z y Goal: maximally reduce all cubes of cover F, x in some order, while still maintaining a valid cover C #29 The “ REDUCE ” Step Key Observation: reduce operation is order-dependent A A B ’ B (DC) z y (DC) z y x x Cube Reduction Order #1: B, A, C C - only B can be reduced #30 15
The “ REDUCE ” Step Key Observation: reduce operation is order-dependent A A B ’ B (DC) z y (DC) z x y A Cube Reduction Order #1: B, A, C x C B ’ (DC) z y Cube Reduction Order #2: C, B,A - cubes C and B can be reduced x C ’ #31 16
Recommend
More recommend