Minimization of Switching Functions
Minimization of Switching Functions
1
Zvi Kohavi and Niraj K. Jha
1
The Map Method
Algebraic procedure to combine terms using the Aa + Aa’ = A rule
Example: w’xy’z’ + w’xy’z + wxy’z’ + wxy’z = xy’(w’z’ + w’z + wz’ + wz) = xy’
wx
yz 00 01 11 10
00 1 1 1
01 1 1
11 1
10 1
2
Minimization (Contd.)
Example: f = yz’ + xy
• Use of cell 6 in forming both cubes justified by idempotent law
Minimization (Contd.)
Minimal expression: cover all the 1 cells with the smallest number of cubes
such that each cube is as large as possible
• A cube contained in a larger cube must never be selected
• If there is more than one way of covering the map with a minimal number
of cubes, select the cover with larger cubes
• A cube contained in any combination of other cubes already selected in
the cover is redundant by virtue of the consensus theorem
3
Minimization (Contd.)
Example: Two irredundant expressions for f(w,x,y,z) = (0,4,5,7,8,9,13,15)
Minimization (Contd.)
Example: f(w,x,y,z) = (1,5,6,7,11,12,13,15)
• Only one irredundant form: f = wxy’ + wyz + w’xy + w’y’z
• Dotted cube xz is redundant
wx
yz 00 01 11 10
00 1
01 1 1 1
11 1 1 1
10 1
4
Minimal Product-of-sums
Dual procedure: product of a minimum number of sum factors, provided
there is no other such product with the same number of factors
and fewer literals
• Variable corresponding to a 1 (0) is complemented (uncomplemented)
• Cubes are formed of 0 cells
Don’t-care Combinations
Don’t-care combination : combination for which the value of the function
is not specified. Either
• input combinations may be invalid
• precise output value is of no importance
10
5
Code Converter
Example: code converter from BCD to excess-3 code
• Combinations 10 through 15 are don’t-cares
Truth table
Output functions
11
00 1 1 1 00 1 1 1
01 01
11 11 1 1
10 1 1 10
f1 map f2 map
wx wx
yz 00 01 11 10 yz 00 01 11 10
00 1 00 1
01 1 1 01 1 1
11 1 11 1
10 1 10 1
f3 map f4 map
f1 = z’
f2 = y’z’ + yz
f3 = x’y + x’z + xy’z’
12
f4 = w + xy + xz
6
Logic Network for Code Converter
Two-level AND-OR realization:
z f1
y
z
f2
y
z
x
y
x
z f3
x
y
z
x
y
w f4
x
z
13
Five-variable Map
General five-variable map:
vwx
yz 000 001 011 010 110 111 101 100
00 0 4 12 8 24 28 20 16
01 1 5 13 9 25 29 21 17
11 3 7 15 11 27 31 23 19
10 2 6 14 10 26 30 22 18
14
7
Minimal Functions and Their Properties
00 1 1 1
01 1 1 1
11 1 1
10
Essential prime implicants: covers at least one minterm not covered by any
other prime implicant, e.g., xz
• Since all minterms must be covered, all essential prime implicants must
be contained in any irredundant expression of the function
16
8
Minimal Expressions (Contd.)
Example: prime implicants of f(w,x,y,z) = (4,5,8,12,13,14,15) are all
essential
wx
00 01 11 10
00 1 1 1
01 1 1
11 1
10 1
17
18
9
Tabulation Procedure for Obtaining the
Set of All Prime Implicants
Systematic Quine-McCluskey tabulation procedure: for functions with a
large number of variables
• Fundamental idea: repeated application of the combining theorem
Aa + Aa’ = A on all adjacent pairs of terms yields the set of all prime
implicants
19
Example: w’x’y’z (0001) and wx’y’z (1001) can be combined into -001,
indicating w has been absorbed and the combined term is x’y’z
20
10
Tabulation Procedure (Contd.)
Procedure:
1. Arrange all minterms in groups, with all terms in the same group having
the same number of 1’s. Start with the least number of 1’s (called the
index) and continue with groups of increasing numbers of 1’s.
2. Compare every term of the lowest-index group with each term in the
successive group. Whenever possible, combine them using the
combining theorem. Repeat by comparing each term in a group of index
i with every term in the group of index i + 1. Place a check mark next to
every term which has been combined with at least one term.
3. Compare the terms generated in step 2 in the same fashion: generate a
new term by combining two terms that differ by only a single 1 and
whose dashes are in the same position. Continue until no further
combinations are possible. The remaining unchecked terms constitute
the set of prime implicants.
21
Example
Example: apply procedure to f2(w,x,y,z) = (0,1,2,5,7,8,9,10,13,15)
Step (i) Step (ii) Step (iii)
w x y z w x y z w x y z
0 0 0 0 0 0,1 0 0 0 -- 0,1,8,9 -- 0 0 -- A
1 0 0 0 1 0,2 0 0 -- 0 0,2,8,10 -- 0 -- 0 B
2 0 0 1 0 0,8 -- 0 0 0 1,5,9,13 -- -- 0 1 C
8 1 0 0 0 1,5 0 -- 0 1 5,7,13,15 -- 1 -- 1 D
5 0 1 0 1 1,9 -- 0 0 1
9 1 0 0 1 2,10 -- 0 1 0
10 1 0 1 0 8,9 1 0 0 --
7 0 1 1 1 8,10 1 0 -- 0
13 1 1 0 1 5,7 0 1 -- 1
15 1 1 1 1 5,13 -- 1 0 1
9,13 1 -- 0 1
7,15 -- 1 1 1
13,15 1 1 -- 1
22
11
Tabulation Procedure using Decimal
Notation in the Presence of Don’t-cares
Example: apply procedure to f3(v,w,x,y,z) = (13,15,17,18,19,20,21,23,25,
27,29,31) + (1,2,12,24)
1 1,17 (16) H 17,19,21,23 (2,4)
2 2,18 (16) G 17,19,25,27 (2,8)
12 12,13 (1) F 17,21,25,29 (4,8)
17 17,19 (2) 13,15,29,31 (2,16) B
18 17,21 (4) 19,23,27,31 (4,8)
20 17,25 (8) 21,23,29,31 (2,8)
24 18,19 (1) E 25,27,29,31 (2,4)
13 20,21 (1) D (c)
19 24,25 (1) C
21 13,15 (2) 17,19,21,23,25,27,29,31 (2,4,8) A
25 13,29 (16) (d)
15 19,23 (4)
23 19,27 (8)
27 21,23 (2)
29 21,29 (8)
31 25,27 (2)
(a) 25,29 (4)
15,31 (16)
23,31 (8)
27,31 (4)
29,31 (2)
(b)
23
12
Don’t-care Combinations
Don’t-cares: not listed as column headings in the prime implicant chart
13
Example (Contd.)
Use propositional calculus: define prime implicant function p to be 1 if each
column is covered by at least one of the chosen prime implicants,
and 0 if not
p = (H + I)(G + I)(F + H)(E + F)(D + E)
= EHI + EFI + DFI + EGH + DFGH
At least three rows are needed to cover the reduced chart: E, H, and I, or
E, F, and I, and so on
Since all prime implicants in the reduced chart have the same literal count,
there are four minimal sum-of-products:
f4(v,w,x,y,z) = A + B + E + H + I = wxz + w’yz + vw’xz’ + v’w’y’z’ + v’w’x’y’
f4(v,w,x,y,z) = A + B + E + F + I = wxz + w’yz + vw’xz’ + w’xy’z’ + v’w’x’y’
f4(v,w,x,y,z) = A + B + D + F + I = wxz + w’yz + vw’xy + w’xy’z’ + v’w’x’y’
f4(v,w,x,y,z) = A + B + E + G + H = wxz + w’yz + vw’xz’ + v’w’x’z + v’w’y’z’
27
Example: f5(v,w,x,y,z) =
(1,3,4,5,6,7,10,11,12,13,14,15,18,19,20,21,22,23,25,26,27)
28
14
Example (Contd.)
29
Dominating Column
10 11 18 19 26
C
D
E
F
G
H
I
30
Final solution is still: f5(v,w,x,y,z) = A + B + J + K + C + E
15
Branching Method
When chart has no essential prime implicant, dominated row or dominating
column: use branching method
5 7 8 10 14 15 1 5 7 10 14 15
B A
C B
D C
E D
F E
G F
H G
Map-entered Variables
Map-entered variables: entering variables into the map cells in addition to
0, 1 or don’t-care. An n-variable map can now specify functions
of more than n variables
32
16
Procedure for Covering Map-entered
Variables
Procedure:
1. Treat all map-entered variables as 0’s and find a minimal expression for
the resulting map
2. To cover a map-entered variable, treat all other map-entered variables
as 0’s and treat all 1’s as don’t-cares. Find a minimal cover for the
resulting map.
3. Repeat step 2 for each map-entered variable (a variable and its
complement are treated as distinct variables.
33
17
Minimization Example
Direction and order of expanding the implicant: has a bearing on the
quality of the result
Example
Since implicants obtained after the reduce step need not be prime, it is
followed by expand and irredundant steps to derive another, possibly
superior covering:
• Process continued until no longer possible to improve on the best
solution seen so far
• To save time, essential prime implicants can be identified and set aside
so that they are not subjected to further transformation
Example: consider an initial cover of f obtained by applying expand and
irredundant to the initial set of minterms. After the set of
transformations, a superior minimal sum-of-products is obtained.
36
18
Equivalent Transformations Using
Encoded Truth Tables
37
Example: Consider f1 and f2. Since all four prime implicants are essential,
the two-level circuit can be obtained as shown
xy xy
z 00 01 11 10 z 00 01 11 10
0 1 1 0 1
1 1 1 1 1
(a) f1 = xy + yz . (b) f2 = x y + x z .
x
y
f1
y
z
x
y
f2
x
z 38
19
Multi-output Two-level Circuit
Minimization (Contd.)
Separate minimization of outputs quite sub-optimal: it does not allow
sharing of logic among outputs
39
40
20
Augmented Chart Example
Example: Consider f1 and f2
• Since none of the prime implicants of f1 and f2 are also a prime implicant
of f1f2, all five prime implicants deserve further consideration
• Since dominated rows cannot be eliminated, we use prime implicant
function p on the reduced chart
p = (B+E)(C+E) = BC + E
• This leads to the multi-output implementation
xy xy xy
z 00 01 11 10 z 00 01 11 10 z 00 01 11 10
0 1 1 0 1 0 1
1 1 1 1 1 1
x
(a) f1. (b) f2. (c) f1f2. y
f1
x
f1 f2
Prime y
Function implicant 2 6 7 1 2 3 z
Prime f1 f2 f2
A = xy Function implicant 2 2 x
f1
B = yz z
f1 B = yz
C=xy
f2
D=xz f2 C=xy
f1f2 E = x yz f1f2 E = x yz
41
(d) Augmented prime implicant chart. (e) Reduced chart.
42
21