SEE 6861 D of Digital Systems Handout: Lecture #3 2/4/16 Prof. Steven M. Nowick nowick@cs.columbia.edu Department of omputer Science (and Elect. Eng.) olumbia University New York, NY, US ESPRESSO lgorithm: The EPND Step, continued 1
EPND Step: Expansion Direction (REVIEW) asic 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 EPND Step: Expansion Direction Example #1: illustrates Step #1 + Step #2 Suppose cube has been picked for expansion! - 1 1 0 1 1-0 1 1 1 - D 1 0 0 - E #4 2
EPND Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2! - 1 1 0 1 1-0 STEP #1: expand cube to fully contain as many other cubes as possible 1 1 1 - D 1 0 0 - E #5 EPND Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2! - 1 1 0 1 1-0 STEP #1: expand cube to fully contain as many other cubes as possible - expand cube to fully contain cube 1 1 1 - D 1 0 0 - E #6 3
EPND Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2! - 1 1 0 1 1-0 1 1 1 - D 1 0 0 - STEP #1: expand cube to fully contain as many other cubes as possible - expand cube to fully contain cube - delete cube E #7 EPND Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2! - 1 1 0 1 1-0 STEP #2: expand cube, by 1 variable at a time, to overlap as many other cubes as possible 1 1 1 - D 1 0 0 - E #8 4
EPND Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #2: expand cube, by 1 variable at a time, to overlap as many other cubes as possible! - 1 1 0 1 1-0 Option 1: expand cube in z dimension : overlaps 1 additional cube () 1 1 1 - D 1 0 0 - E #9 EPND Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #2: expand cube, by 1 variable at a time, to overlap as many other cubes as possible! - 1 1 0 1 1-0 Option 2: expand cube in y dimension : overlaps 2 additional cubes (D, E) 1 1 1 - D 1 0 0 - E # 5
EPND Step: Expansion Direction Example #1 (cont.): illustrates Step #1 + Step #2 STEP #2: expand cube, by 1 variable at a time, to overlap as many other cubes as possible! - 1 1 0 1 1-0 Final choice = Option 2: expand cube in y dimension 1 1 1 - D 1 0 0 - E # EPND Step: Expansion Direction Example #2: illustrates Step #2 + Step #3 Suppose cube has been picked for expansion! - 0-0 - - 1 - - 1 1 1 0 1 1 1 #12 6
EPND Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #2: expand cube, by 1 variable at a time, to overlap as many other cubes as possible! - 0-0 - - 1 - Final choice = expand cube in y dimension overlaps cubes & - 1 1 1 0 1 1 1 #13 EPND Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #2: expand cube, by 1 variable at a time, to overlap as many other cubes as possible! - 0-0 - - 1 - Final choice = expand cube in y dimension - 1 1 1 0 1 1 1 #14 7
EPND Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #3: expand cube into a maximal size prime implicant! - 0-0 - - 1 - - 1 1 1 0 1 1 1 #15 EPND Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #3: expand cube into a maximal size prime implicant! - 0-0 - - 1 - Option 1: expand cube in z dimension - becomes - 1 1 1 0 1 1 1 #16 8
EPND Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #3: expand cube into a maximal size prime implicant! - 0-0 - - 1 - - 1 1 1 Option 2: expand cube in w /x dimensions - becomes z 0 1 1 1 #17 EPND Step: Expansion Direction Example #2 (cont.): illustrates Step #2 + Step #3 STEP #3: expand cube into a maximal size prime implicant! - 0-0 - - 1 - - 1 1 1 Final choice = Option 2 - larger prime ( = z) has fewer literals 0 1 1 1 #18 9
ESPRESSO lgorithm: The IRREDUNDNT Step The IRREDUNDNT Step Example over: after expand = prime cover Given: cover F (after EPND) P1! 1 1 0 0 P3 P2 0 1 1 0 0 0 P4 1 1 P5 - - 1 P6 0 Goal: make F irredundant = delete max # of implicants while still maintaining a valid cover #20
The IRREDUNDNT Step pproach #1 (SUOPTIML!): greedily remove one redundant cube at a time P1! 1 1 0 0 P3 P2 0 1 1 0 P1! 1 1 0 0 P2 0 1 1 0 0 0 P4 1 1 P5 0 0 P4 1 1 P5 - - 1 P6 0 - - 1 P6 0 before: after deleting P3: irredundant suboptimal cover #21 The IRREDUNDNT Step pproach #2 (OPTIML!): form & solve an exact optimization problem This is approach used in ESPRESSO : P1! 1 1 0 0 P3 P2 0 1 1 0 0 0 P4 1 1 P5 - - 1 P6 0 Goal: set up a simplified PI table, and solve it exactly, to determine min # of cubes to keep (delete all others) before: #22
The IRREDUNDNT Step Simplified PI Table: prime implicants P1 P2 P3 P4 P5 P6 ON-set minterms #23 The IRREDUNDNT Step pproach: solve PI table exactly Simplified PI Table: prime implicants P1 P2 P3 P4 P5 P6 ON-set minterms Optimal Solution: - select {P1,P2,P5,P6} - discard rest. #24 12
The IRREDUNDNT Step n Issue: - How can afford to compute an exact solution to prime implicant table (like the expensive Quine-Mcluskey 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 IRREDUNDNT Step pproach #2 (OPTIML): final solution P1! 1 1 0 0 P3 P2 0 1 1 0 P1! 1 1 0 0 0 P3 1 1 0 0 0 P4 1 1 P5 0 0 1 1 P5 - - 1 P6 0 - - 1 P6 0 before: after: irredundant optimal cover #26 13
ESPRESSO lgorithm: The REDUE Step The REDUE Step Example over: after expand and irredundant = prime irredundant cover z y x (D) #28 14
The REDUE Step Example over: after expand and irredundant = prime irredundant cover Given: cover F (after EPND/IRRED) z y x (D) Goal: maximally reduce all cubes of cover F, in some order, while still maintaining a valid cover #29 The REDUE Step Key Observation: reduce operation is order-dependent z y (D) z y x (D) x ube Reduction Order #1:,, - only can be reduced #30 15
The REDUE Step Key Observation: reduce operation is order-dependent z y x (D) z (D) y x ube Reduction Order #1:,, z y x (D) ube Reduction Order #2:,, - cubes and can be reduced #31 16