幻灯片 1 - UIC - ECE - University of Illinois at Chicago

advertisement
Multi Function Quine-McCluskey 2-Level
Minimization
Shantanu Dutt
University of Illinois at Chicago
Acknowledgement: Transcribed to Powerpoint by Huan Ren from
Prof. Shantanu Dutt’s handwritten notes
Multiple Output Q-M
 General digital system:
Multiple
i/p’s
Multiple
o/p’s
Share gates as much as
possible to reduce cost
Sometimes sharing reduces cost; however indiscriminate
sharing (e.g., having canonical SOPs for all functions) can
actually increase cost.
Q: How to do this optimally?
A: Multi-function Q-M .
Multiple Output Q-M
f   m(1,3,5,7,13,15)
f  m(8,9,10,11,13,15)
 Separate consideration
f  AD  BD cost  6
A
D
B
D
fα
f   AB  AD cost  6
B
A
A
D
fβ
CD
AB
00 01 11
10
ADα 00
0
8
01
1
11
3
10
2
4
12
1α
5
1α
13
1α
7
1α
15
6
1α β
1α β
14
BDα
1β
9
1 β ADβ
11
1β
10
1β ABβ
ABDαβ
No common terms →
Total cost =12 [six 2-i/p gates] →
12*2=24 transistors
Multiple Output Q-M
 Combined consideration (include common implicants—
PIs of the function f.f—first):
f  AD  ABD
f   AB  ABD
22 transistors
 Total cost
A
D
A
B
D
A
B
4 trans.
4 trans.
fα
6 trans.
4 trans.
4 trans.
fβ
 Total literals in distinct/different implicants + total # of implicants
(non-distinct, i.e., a common impl. occurring multiple times, is
counted as many times as it occurs) over all functions
(2+2+3)+4=11
Multiple Output Q-M
f  m(3,4,5,7,13,15)
CD
ABCα 00
4
1α
12
01
1
5
1α
13
11
3
7
1α
15
6
xβ
14
ACDα
10
f  ACD  ABC  BD cost  8  3  11
f   AB  ACD cost  5  2  7
Total cost=18
00 01 11
0
f   m(8,12,13,14,15)  d(6)
 Taken separately
AB
2
1α
Xβ
ABDαβ
10 ACDβ
1β
8
1α β
9
1α β
1β
1β
11
10
CDβ
Xβ
BDα
ABβ
Multiple Output Q-M (contd.)
 Use heuristic: “Always include common
implicants”
f  ACD  ABC  ABD
f   ACD  ABD  BCD
Total cost= 14+6=20
So how do we determine optimally
when and when not to include a
common term in an expression ?
This can be achieved by the
multiple-function QM method.
Multiple-function QM
 Difference with single function QM
(1) Each minterm is tagged by “flag(s)” of the function it
is in.
(2) For PI formation, the impl./min-term list is formed for
all min-terms/DCs over all functions.
(3) Two impl’s (incl. minterms) can be combined only if
they contain same common flags. The new impl.
formed by this combining is flagged by the set of
common (intersecting) flags.
(4) An impl. i that was combined to form a larger impl.
can be “checked” only if the combined impl. contain
all the flags that i contains.
(5) In the PIT, the cols are separated for each function,
and each minterm for a function is listed under its
function’s group—thus a minterm will have separate
cols for each function it belongs to.
Multiple-function QM (contd.)
 Difference with single function QM (contd.):
(6) In the PIT, each PI covers minterms only for
functions whose flags it contains.
 All other rules of PIT reduction applies,
including the heuristic rules for cyclic PITs.
Example 1
f   m(1,3,5, 7,13,15)
f    m(8,9,10,11,13,15)
Min
term
1
List 1
Flags
0001 α
Min
term
1,3
List 2
Flags
00-1 α
Min
term
1,3,5,7
List 3
Flags
0--1 α PI
2
8
1000 β
1,5
0-01 α
8,9,10,11
10-- β PI
3
3
0011 α
8,9
100- β
5,7,13,15
-1-1 α PI
4
5
0101 α
8,10
10-0 β
9,11,13,15
α
Example 1:
9
1001 β
3,7
0-11
10
1010 β
5,7
01-1 α
7
0111 α
5,13
-101 α
11
1011 β
9,11
10-1 β
13
1101 α β
9,13
1-01 β
15
1111 α β
10,11 101- β
-111
α
11,15 1-11
β
7,15
1--1 β PI
5
f   m(1,3,5, 7,13,15)
f    m(8,9,10,11,13,15)
 PI table
1
1
1
1
5
5
2
2
2
fα
PIs
*5
* 1
* 2
3+1
PI1αβ
2+1
PI2α
2+1
PI3β
3
2+1
PI4α
4
2+1
PI5β
C
1 3 5
7
2
5
5
fβ
13
15
8
9
10
11
13 15
More Rules:
(5) The covering rules apply across the entire PIT, not just in the sub-PIT
corresponding to each function.
(6) The EPI defn, however, applies to only single functions, and if a multi-function PI g
is an EPI for some funcs and not for all for which it is an impl, it is only chosen for the
former function(s) and not right away for the latter. After this partial inclusion (for
some funcs), g’s cost is reduced to 1, and it maybe chosen later based on this reduced
cost. The reduction in cost corresponds to the AND gate cost of g which has already
been incurred. The remaining 1 cost corresponds to the OR gate cost in each
remaining function for which it may be included at a later time.
Note: We will provide an alternative for rule (6) in which an EPI/pseudo-EPI for one
func is also automatically included in all other funcs for which it is an implicant. This
alternative uses a sweep-up phase.
f  PI1  PI2 f  PI1  PI3
Example 2:
Min
term
4
f  m(3,4,5,7,13,15) f   m(8,12,13,14,15)  d(6)
List 1
Flags
0100 α
Min
term
4,5
List 2
Min
Flags
010- α
List 3
term
PI1 5,7,13,15
-1-1 α PI
5
8
1000 β
8,12
1-00 β
PI2 12,13,14,15 11-- β PI
6
3
0011 α
3,7
0-11
5
0101 α
5,7
01-1 α
6
0110 β
5,13
-101 α
12
1100 β
6,14
-110
β
7
0111 α
12,13 110-
β
13
1101 α β
12,14 11-0
β
14
1110 β
7,15
α
15
1111 α β
13,15 11-1
αβ
14,15 111-
β
-111
α
PI3
PI7
PI4
3 1
1
3
7
7
2
2
fα
PIs
*
*
*
C
1
PI1α3+1
2
PI2β3+1
3
PI3α3+1
PI4αβ3+1
* 7
* 5
PI5α2+1
C
C
6
4
3 4 5
7
5
5
fβ
13
15
8
12 13 14 15
PI6β2+1
PI7β3+1
f  PI1  PI3  PI5
f   PI 2  PI 6
5
Total cost
=13+5=18
Example 3
DE
BC
A=0
00 01 11
10
00
0
4
1α
12
1β
8
01
1
5
1α β
13
1α β
9
11
3
7
1α β
15
10
2
6
1α
14
1α β
1β
DE
1α
11
10
ABCα ACEαβ
ABCβ ABDEα
PI1
PI3
PI2
PI4
BC
A=1
00 01 11
10
00
16
20
28
24
01
17
21
1β
29
25
11
19
23
1α
31
10
18
22
1
α
30
1α
CDEβ
CDEα
PI5
PI6
1β
27
1α
1β
1α
26
ADEα
PI7
 Taking # of MTs covered and cost into consideration
fα
C
PIs
*β1
*α 8
* 5
* 2
3+1
PI1α
3+1
1
PI2αβ
3+1
PI3β
4+1
PI4α
7
3+1
PI5α
3+1
PI6β
3+1
PI7α
*
*
6
3
4 5 6 7 9 13
15
fβ
19
27
31 5 7 12
13
14
15
21
29
4
5
4
6
6
4
8
C
23
4
5
1
2
3
Note: For every choice of a multi-func PI g as an EPI/pseudo-EPI for a function,
mark each inclusion choice of g by the flag of the function(s) for which it is an
EPI/pseudo-EPI. At the end, the flags will determine which functions g should be
included in
f  PI1  PI2  PI4 +PI7
f   PI2  PI3 +PI6
Total cost=26
Three Output Function Example
f (A, B, C, D)   m(0, 2, 7,10)  d(12,15)
f  (A, B, C, D)   m(2,4,5)  d(6, 7,8,10)
f (A, B, C, D)   m(2,7,8)  d(0,5,13)
Min
term
List 1
Min
term
Flag
0
0000 αγ
2
0010 αγβ
PI1
List 2
Min
Flag
term
0,2
00-0 αγ
PI2 4,5,6,7 01-- β
0,8
-000 γ
PI3
2,6
0-10 β
PI4
-010 α β
PI5
0
4
0100 β
8
1000 βγ
5
0101 βγ
4,5
010- β
6
0110 β
4,6
01-0 β
10
1010 α
8,10
10-0 β
PI6
12
1100 Α
5,7
01-1 β γ
PI7
5,13
-101 γ
PI8
6,7
011-
β
7,15
-111
α
7
PI11 2,10
β
β
0111 αγ
PI1
2
PI1
3
13
15
1101 γ
1111 α
List 3
PI9
PI1
fα
PIs
αγ
0 2 7 10
1
2+1 PI1 β
2
3+1 PI2αγ
New cost = 1
fβ
2
4
fγ
5
2
3+1 PI3γ
3+1 PI5αβ
3+1 PI6β
3+1 PI7βγ
C
3+1 PI8γ
3+1 PI9α
4
4+1 PI10αβ γ
4+1 PI11β
4+1 PI12α
γ
4+1 PI13αβ
8
5
3+1 PI4β
3
7
γ
2
2
3
3
1
1
5
γ
f =PI 2  PI5  PI13
f  =PI1  PI5
Reduced PIT
PIs
γ
4
3+1 PI3γ
C
3+1 PI7βγ
1
3+1 PI9
2 4+1
C
α 3 4+1
γ
fα
fγ
7
7 8
f =PI 2  PI3  PI13
A
5
PI13
γ
D
PI2
αβ γ
fα
6
γ
New cost = 1
C
PI1
α
PI11β
B
3
4
PI3
PI4
PI5
fβ
fγ
Multi-function QM: Rule 7: Alternative to
Rule 6
 If a PI is found to be essential for one or more functions
that it covers, delete it completely. Also, include it in
other functions fj (for which it is currently non-essential)
whose minterms it covers only if not all such MTs of fj
have been deleted so far.
 At the end of the PIT phase when all MTs have been
covered do the following sweep-up phase
 In each function fj’s expression, mark each implicant of fj that
was included in it because it was either an essential-PI or
pseudo-essential PI for fj.
 For each unmarked implicant PIk in a function fj , delete PIk
from fj’s expression only if each MT of fj that it covers is also
covered by some marked implicant of fj.
Utility of the Sweep-up Phase
Example:
1
PIs
1
fα
1
2
4
2
fβ
αβ
PIjαβ
β
PIkβ
4
PIlβ
3
PIrβ
2
*
1
….
*C
β
*
fα =PIj+……
fβ=PIj+PIk+PIr
We thus get fβ =PIk+PIr, reducing
the cost by 1.
Deleted in the sweep-up phase.
Exercise: Use this alternative to rule 6 to find a minimum-cost covering of the problem
in Example 3 (PIT given on slide 14)
Download