Minimization
Minimization
One good question is “how do we minimize combinational circuits?” And the answer to that question is more complex
than you’d think. Part of the problem is it isn’t clear what it means to minimize. Do we mean to use the fewest number
of gates? If so, we could end up taking something like the canonical sum-of-products and making a really, really, long
path. That would greatly slow the clock.
We probably mean to reduce the number of gates as much as possible while keeping the delay bounded by some value.
In this class, we’ll just look at finding the minimal sum-of-products and product-of-sums forms for a given logic equation.
This is called two-level logic because the worst-case path through the circuit will consist of exactly two gate delays.
Motivational Example #1
Consider the logic statement F(a,b,c)=ab’c+abc+abc’. You’ll notice that we are using three 3-input AND gates and one
three input OR gate to implement this logic (let us assume that all literals are available, so a and a’ can both be used and
don’t require a NOT gate). What can you do to reduce the complexity of this circuit while keeping ourselves to two
levels of logic?
First notice that ab’c+abc can be combined (using the “combining rule” from the first lecture of the year). We can also
combine abc+abc’. So we get: __________________________ as a simplified version of this. As you’ve likely noticed, it
isn’t always easy to find pairs that can combine, and sometimes those pairs are well hidden inside of various terms.
Motivational Example #2
Consider the following: a’b’c+a’cd’+bcd. It turns out that equation can be reduced to a’c+bcd. How the heck can we
figure that out? One trick is to drop back to the canonical sum-of-products form. That gets us:
__________________________________________________________________________________
You might notice that all four the terms that have a’c in them are true. So we can combine those four into a’c. That
leaves abcd. It can be combined with a’bcd to make bcd. It turns out we can’t combine any more and this point and so
we’ve succeeded!
We got the right answer this way, but it wasn’t obvious. Heck, it wasn’t obvious that we are done. So the question is,
how do we make it obvious? How can we quickly see what terms combine and prove to ourselves that we are done?
What we’d like is an easy way to visualize exactly
Karnaugh Maps
Consider ab’c+abc+abc’ from above. Let’s write the truth table in a rather odd way:
ab/c 00 01 11 10
0 0 0 1 0
1 0 0 1 1
Notice that box which represents abc is adjacent to the three different terms it can be combined with. In this case we
can quickly see how the combining rule can be applied. We end up with two product terms: _________ and _________
Now consider
ab/c 00 01 11 10
0 1 1 1 1
1 0 0 0 0
In this case, we can combine all four terms into a single term: ____________________
ab/c 00 01 11 10
0 1 0 0 1
1 0 0 0 0
And notice we “wrap around” the edges. So this combines to be: ____________________
Informal Algorithm
What we are going to do is circle groups of “1s” that are rectangles 1 where each side is a power of 2 in length. The first
K-map on this page had a 2x1 and a 1x2 rectangle, the second a 1x4 and the third a 1x2. We never circle a rectangle that
is part of a larger legal rectangle. We only circle enough rectangles so that every 1 is circled.
ab/c 00 01 11 10
0 0 0 1 1
1 0 1 1 0
Notice that in the K-map above there are three rectangles we could circle, but two of them cover all the “1s”.
Let’s practice a bit.
1
Recall a square is special case of a rectangle.
EECS 270, Lecture notes 3: Minimization Page 3 of 11
EECS 270, Lecture notes 3: Minimization Page 4 of 11
An interesting example
Circle all rectangles: Answer 1 Answer 2
ab/c 00 01 11 10 ab/c 00 01 11 10 ab/c 00 01 11 10
0 1 1 1 0 0 1 1 1 0 0 1 1 1 0
1 1 0 1 1 1 1 0 1 1 1 1 0 1 1
Terminology (p308-310)
Notice that we are finding sum-of-products solutions.
• Recall that a minterm is a product term that includes all of the functions variables exactly once.
• The on-set of a function is the set of minterms that define when the function should evaluate to 1 (the minterms
that have a 1 in the truth table.)
o The off-set is the set of minterms that evaluate to zero.
• An implicant of a function is a product term that evaluates to 1 only in places that function evaluates to 1. (The
on-set of an implicant of a function is a subset of the on-set of the function.)
ab/c 00 01 11 10 ab/c 00 01 11 10
0 1 1 0 0 0 0 1 1 0
1 1 1 0 0 1 1 1 1 0
ab/c 00 01 11 10
0
2
This term isn’t used by our text, they skip from prime implicant directly to essential prime implicant.
EECS 270, Lecture notes 3: Minimization Page 5 of 11
EECS 270, Lecture notes 3: Minimization Page 6 of 11
ab/c 00 01 11 10
0 1 1 1 0
1 1 0 0 1
4-variable
ab/cd 00 01 11 10
00 0 1 1 0
01 0 1 1 0
11 0 0 1 1
10 0 0 0 0
What’s left?
• Don’t cares
• 5+ variable
• Product-of-sums
• Programmable techniques
• Lots of practice.
• More context. Remember this is only for 2-level logic…
EECS 270, Lecture notes 3: Minimization Page 7 of 11
Don’t cares:
Note: I’m leaving the zeros blank to make things more readable!
F = ∑W , X ,Y , Z (1,5,7,11,15) + d (8,12,13,14)
F
WX
YZ 00 01 11 10
00 d d
01 1 1 d
11 1 1 1
10 d
5-variable
EECS 270, Lecture notes 3: Minimization Page 8 of 11
Product of Sums:
Let F be: Then F’ is:
ab/cd 00 01 11 10 ab/cd 00 01 11 10
00 1 1 1 00 1
01 1
11 1
1
1
1 1 01
FF’
11 1 1
10 1 1 10 1 1
Programmable techniques
• Later in the semester, time allowing.
More context
Basically, just remember that this doesn’t find the “minimal” solution. If finds the minimal sum-of-products. It’s not
even clear how we would measure “minimal” over all. Least delay? Least number of gates? Least “gate inputs”? Recall
we did a “least delay” solution for GA1. This would have helped find a nice starting point, but wouldn’t have solved the
problem.
But this technique does let us find the minimal two-level solution (SoP or PoS). Which is pretty cool.
Questions:
1. Why isn’t this a great technique for a computer? Why is it good for people?
State minimization
One thing to be aware of is that the 2nd edition of our text somehow got worse at covering this material. I’ve posted the
relevant 6 pages from the 1st edition on the website, you should take a look at it.
Motivational Example
Consider the following two machines. Are they equivalent?
Inputs: x; Outputs: y
x’ x x’ x x’ x’ x x’
x x’ x x
S0, S1,
S0 S1 S2 S3
S2 S3
y=0 y=1 y=0 y=1 y=0 y=1
Say x were 0, 1, 1, 0, 0. What would be the output of the larger one? The smaller one? Are they always the same? How
can you be sure?
Inputs: x; Outputs: y
x’
x’ x x’ x
x x’ x
S0 S1 S2 S3
y=0 y=1 y=1 y=1
Let’s use an implication table.
EECS 270, Lecture notes 3: Minimization Page 10 of 11
Inputs: x; Outputs: y
S1
x’ x x’ x x’
x x’ x
S2 S0 S1 S2 S3
y=0 y=1 y=0 y=1
S3
S0 S1 S2
Which states can’t be equivalent? Any with differing outputs! Cross those out.
S1 x’ x x’ x
x x’ x
S0 S1 S2 S3
S2 y=0 y=1 y=1 y=1
S0 S1 S2
S Inputs: x; Outputs: y
x’ x’
x
S3 S0 S4
S
y=0 x’ y=0 x y=0
x’ x’
x x
S S2 S1
y=1 y=1
S S S S