Transcript 4

Chapter 4
Function
Minimization
Algorithms
Techniques other than K-map.
Particularly useful for larger problems.
Quine-McCluskey Method for Generating
Prime Implicants
1. Write minterms using binary values.
2. Group minterms by the number of 1’s
3. Apply adjacency (a b´ + a b = a) to each pair of terms,
forming a second list.
4. Check those terms in the first list that are covered by
the new terms. Note that only terms in adjacent groups
(that differ by one 1) need be paired.
5. Repeat process with second list (and again if multiple
terms are formed on a third list).
A+B=J
A+C=K
B+D=L
B+C=M
C+E=N
D+F=O
F+H=P
G+H=Q
Then
J + N =R
K+M=R
Don’t cares must be included in first column.
Prime implicants are the combined terms that remain,
And have not been checked
Prime Implicants
L = 010- w’xy’
O = 01-0 w’xz
P = -111 xyz
Q = 1-11 wyz
R = --00 y’z’
The iterated consensus algorithm for single functions is as follows:
1. Find a list of product terms (implicants) that cover the function. Make sure
that no term is equal to or included in any other term on the list. (These
terms could be prime implicants or minterms or any other set of implicants.
However, the rest of the algorithm proceeds more quickly if we start with
prime implicants.)
2. For each pair of terms, ti and tj (including terms added to the list in step 3),
compute ti ¢ tj.
3. If the consensus is defined, and the consensus term is not equal to
or included in a term already on the list, add it to the list.
4. Delete all terms that are included in the new term added to the list.
5. The process ends when all possible consensus operations have
been performed. The terms remaining on the list are ALL of the
prime implicants.
MAKE A PI TABLE.
$=# gates= # literals + OR
OBJ: find min # rows so all cols
has at least 1 X; minterms covered
1. Find essential PI – only 1 X in col
This is C & E, they are shaded
2. Check off all other mins that are
covered by those terms
3. Make reduced table of cols not
covered
This is the don’t cares after PI used
A row is dominated if another
row covers the minterm at no
more cost.
PI D covers all the remain non-used
F = C + D + E = wyz + y’z’ + w’xz
Get PI from k-map or QM
Construct a table of all PI
F(a,b,c,d) = Σm(1,3,4,6,7,9,11,12,13,15)
Remove essential PI & all minterms (cols) covered
Each row has 2 x’s
Each col has 2 x’s
B & C are cheaper, so try to use them
A is essential
E (or F) covers 4, pick E & get 12
Then C dominates D to get 13 & 15
The G covers 6 & 7
F=A+E+C+G
F = Σm(1,3,4,6,7,9,11,12,13,15)
Use k-map, QM, iterated consensus to find PI and make PI table.
$
√
√
1
3
x
x
4
b’d* -0-1
3
A
cd
--11
3
B
ad
1—1
3
C
abc’ 110-
4
D
bc’d -100
’
4
E
x
a’bd 01-0
’
4
F
x
a’bc 011-
4
G
$
4
3
B
3
C
4
D
4
E
x
4
F
x
4
G
6
6
x
7
√
√
9
11
x
x
x
12
x
x
x
x
13
x
x
x
x
Reduced table has
2 x in each row
2 x in each column
need 3 terms
Use B & C if possible
They cost less.
Two different ways
Each use less cost term
x
x
12
15
x
x
7
13
EX 4.5
x
15
x
x
x
x
x
x
x
x
x
A + C + E + G
A + F + B + D
Petrick’s Method
A third tool for reducing a function.
1. Use reduced table after essential PI, but before dominated rows.
2. Create a POS expression by using 1 term for each column in the reduced
table.
3. Combine the terms to get a SOP form.
4. Select any term that has less literals as the PI to be used.
5. Add the essential PI to get the result.
$
4
3
B
3
C
4
D
4
E
x
4
F
x
4
G
6
7
12
13
x
x
x
x
x
A + C + E + G
A + F + B + D
(E + F )(F + G)(B + G)(D + E)(C + D)(B + C)
x
x
x
15
x
= (F + EG)(B + CG)(D + CE)
x
= (BF + BEG + CFG + CEG)(D + CE)
= BDF + BDEG + CDFG + CDEG + BCEF
+ BCEG + CEFG + CEG
Same result as before.
F = A + C & E & G)
F = A + (B & D & F)
Sec 4.4: Q-M for multiple outputs
f(a, b, c) = ∑m(2, 3, 7)
Convert the decimal to binary
Also note the literal equivalent
Add a column for the output using a tag
g(a, b, c) = ∑m(4, 5, 7)
m
2
3
4
5
7
literals
a´ b c´
a´ b c
a b´ c´
a b´ c
a b c
tag
g´
g´
f´
f´
binary
010
011
100
101
111
fg
–0
–0
0–
0–
––
abc
111
Tag for multiple outputs
f g
- if included
0 if not included
Create Q-M chart from the rows.
Reduce the chart to get data for a
PI table
4.6
Found all product termsCreate PI table w/ section for
each output
F=Σ(2,3,7)
G=Σ(4,5,7)
X only in column for implicant
Essential is only one in column
Cover all possible implicants
Shown in brown in equations
Create reduced table of uncovered
Find term that covers most
A →abc term
The two outputs share the term
So have minimum total cost
f = a´b + abc
g = ab´ + abc
Ex 4.8
f(a, b, c, d) = ∑m(2, 3, 4, 6, 9, 11, 12) + ∑d(0, 1, 14, 15)
g(a, b, c, d) = ∑m(2, 6, 10, 11, 12) + ∑d(0, 1, 14, 15)
Two functions
Find terms that can be shared.
List all minterms, with tags
Group by number of 1’s
Check terms that differ by only 1
The terms that can be shared do not
have a check at the end
a’b’c’, a’b’d’, a’cd’, bcd’, abd’, acd, abc
The PI is found from the tags
f PI has a blank in first col
g PI has a blank in second col
f PI = a’b’, a’d’, b’d, bd’
g PI = cd’, ac
Tag for multiple outputs
f g
- if included
0 if not included
EX 4.10
f(a, b, c, d) = ∑m(2, 3, 4, 6, 9, 11, 12) + ∑d(0, 1, 14, 15)
Same problem,
g(a, b, c, d) = ∑m(2, 6, 10, 11, 12) + ∑d(0, 1, 14, 15)
but use k-Map
Two functions
Find terms that can be shared.
K-map fg, list all minterms of both functions
K-map f, list minterms of f, with DC
K-map g, same thing
Group minterms of k-map to find product terms for the 2 functions
Use common terms where possible
Use product terms to make PI table
4.12
Continue multiple output
Create 2 sections
For f & g
X if function is used
Find essential PI
Cover other PI with it
Check col
Make reduced PI
Next page
f(a, b, c, d) = ∑m(2, 3, 4, 6, 9, 11, 12) + ∑d(0, 1, 14, 15)
g(a, b, c, d) = ∑m(2, 6, 10, 11, 12) + ∑d(0, 1, 14, 15)
4.12
Reduced PI table
f(a, b, c, d) = ∑m(2, 3, 4, 6, 9, 11, 12) + ∑d(0, 1, 14, 15)
g(a, b, c, d) = ∑m(2, 6, 10, 11, 12) + ∑d(0, 1, 14, 15)
For g, select N
It covers 11 & 10
Create another reduced
Table w/o these tersm
4.12
Reduced
Reduced PI table
f(a, b, c, d) = ∑m(2, 3, 4, 6, 9, 11, 12) + ∑d(0, 1, 14, 15)
g(a, b, c, d) = ∑m(2, 6, 10, 11, 12) + ∑d(0, 1, 14, 15)
Continue to select terms to cover
2 & 6 covers both f & g
Use that term, C
Then cover the remaining PI
f = b´d + abd´ + a´d´
g = ac + abd´ + cd´