Download ESPRESSO: A Heuristic Algorithm for Logic Optimization - Prof. Susan Lysecky and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!
ECE 474a/575a Susan Lysecky
1 of 15
ECE 474A/57A
Computer-Aided Logic Design
Lecture 9
ESPRESSO
ECE 474a/575a Susan Lysecky
2 of 15
Some Problems are Hard
Using Exact Algorithms vs. Heuristics
Quine-McCluskey
Calculated all prime implicants to derive the optimal solution(s)
Petrick’s Method derives all covers to determine minimum cover set(s)
Number of prime implicants grow quickly -- solution space is huge!
Finding the minimum cover set in a class of NP complete problems
Determining optimal solution is difficult
Move to heuristics
Look at generating a quality solution quickly (not necessarily optimal)
ECE 474a/575a Susan Lysecky
3 of 15
Logic Optimization Techniques
Logic Optimization Techniques
K-maps (Graphical)
Quine-McCluskey (Exact Algorithm)
Espresso (Heuristic)
Other Generalized Heuristics
Branch-and-bound
Simulated Annealing
Dynamic Programming
many more exists …
ECE 474a/575a Susan Lysecky
4 of 15
Local Search
cost of a solution
possible solutions
x
F(x)
Don’t generating all prime implicants and
minterms
Instead, ESPRESSO successively modify a
given initial cover
This technique is called alocal search
algorithm
Idea behind local search
Search space or solution space - set of all
possible values and cost associated with
solution
Start with an initial value
Search all points in neighborhood for a
feasible point whose cost is less than current
Different problems have different neighborhood definitions
If one is found, start process over
ECE 474a/575a Susan Lysecky
5 of 15
Local Search
F(x)
x
local minimum
global/absolute minimum
Drawback of local searches is local optimality
Solution is locally optimal if its neighborhood does not contain any solutions with a
lower cost
Locally optimal solution may not be the optimal solution
Modify local search so we don’t get stuck at the local minimum
ECE 474a/575a Susan Lysecky
6 of 15
Espresso
Espresso utilizes local search (keeping in mind local minimum problem)
Probably most popular minimization algorithm
Extremely efficient Boolean manipulation
Composed of three main operations
EXPAND, REDUCE, IRREDUNDANT
Other operations include
COMPLEMENT, ESSENTIAL PRIMES, LASTGASP, MAKESPARSE
Espresso Heuristic (in a nutshell)
Apply Expand and Irredundant operators to optimize the current function
specification
Uses the reduce operator to get out of local minimum
Iterated until the solution converges
ECE 474a/575a Susan Lysecky
10 of 15
Espresso – Reduce Operator
Goal is to decrease the size of
implicants such that expansion
may lead to a better solution
Avoiding a local minimum
0 1 1 1
00 01 11 10
1 1
0
1 0 1
F yz x
x’z x’y
xy’ xz’
Reduce x’y to x’yz’
No implicant can be expanded
Is it valid? Yes.
0 1 1 1
00 01 11 10
1 1
0
1 0 1
F yz x
x’z x’yz’
xy’ xz’
Is it valid? Yes.
Reduce xz’ to xyz’
Is it valid? Yes.
Expand x’yz’ to yz’
0 1 1 1
00 01 11 10
1 1
0
1 0 1
F yz x
x’z
xy’ yz’
F = x’z + yz’ + xy’
Reduction helped find a better solution!
0 1 1 1
00 01 11 10
1 1
0
1 0 1
F yz x
x’z x’yz’
xy’ xyz’
ECE 474a/575a Susan Lysecky
11 of 15
Espresso – Irredundant Operator
yz’ is redundant
x’y and xz’ cover all minterms contained in yz’
F yz x
x’z (^) x’y
xy’
yz’
xz’
F yz x
x’z x’y
xy’
xz’
IRREDUNDANT
Implicant in a cover is
redundant if all the minterms
covered by it are contained in
other implicants in the cover
ECE 474a/575a Susan Lysecky
12 of 15
Espresso – Irredundant Operator
Irredundant cover is not the
same as minimal cover
F yz x
x’z x’y
xy’
xz’
F yz x
x’z
xy’
yz’
irredundant cover
irredundant cover
minimal cover
ECE 474a/575a Susan Lysecky
13 of 15
Espresso – Additional Concerns
F (^) bc a
(^0 1 0 0) ab
F (^) bc a abc
F (^) bc a bc
which way should we expand?
F yz x
x’z x’y
xy’
yz’
xz’
which implicant should we reduce? which literal should we add?
Additional concerns
Validity check operations
Which direction should the
move make?
ECE 474a/575a Susan Lysecky
14 of 15
Espresso
espresso(F,D) { R = complement(F U D); F = expand(F,R); // initial expansion F = irredundant(F,D); // initial irredundant cover E = essentials(F,D); // detect essential prime implicants
F = F – E; // remove essential prime implicants from f D = D U E; // add essential prime implicants to D repeat { φ 1 = |F |; F = reduce(F,D);
F = expand(F,R); F = irredundant(F,D); } until (|F | ≥ φ 1 ); F = F U E; D = D – E;
RETURN F; }
repeated application of REDUCE, EXPAND, IRREDUNDANT operations while cost keeps decreasing
F is the on-set, D is the don’t care set
ECE 474a/575a Susan Lysecky
15 of 15
ESPRESSO, to be continued…
Presented high-level idea behind ESPRESSO
ESPRESSO performs extremely efficient Boolean manipulation
How are these operations actually performed?