Improved Variable Entered Karnaugh Map P
Improved Variable Entered Karnaugh Map P
00
Printed in Great Britain. All rights reserved Copyright © 1987 Pergamon Journals Ltd
ALl M . RUSHDI
Department of Electrical Engineering, King Abdulaziz University, P.O. Box 9027, Jeddah-21413,
Saudi Arabia
Abstract--An improved variable-entered Karnaugh map (VEKM) procedure for obtaining the
minimal disjunctive form of a switching function and a dual procedure for obtaining its minimal
conjunctive form are presented. These procedures apply to any general switching function of
moderate complexity that can be incompletely specified with respect to all its variables. Existing
VEKM procedures are compared to the new ones and are shown to be special cases of them.
Various examples are given to illustrate the details of the new procedures and to demonstrate their
efficiency and power.
1, I N T R O D U C T I O N
2. P L O T T I N G THE VEKM
ft2,,_l)=f(1,1,...,1,X"+l,...,X,). (2)
The expansion (1) expresses the n-variable function f in terms of 2" subfunctions f ,
i = 0 , 1. . . . . ( 2 " - 1 ) which are functions of the (n-m) variables X"+j,X"+2,.. , , X ,
(henceforth called entered variables). The subfunctions can be obtained in a variety of
ways, e.g.
(a) I f f is given by an algebraic expression, then its subfunctions f are deduced from
it through appropriate assignments to the keystone variables according to equation (2).
Improved variable-enteredKarnaughmap procedures 43
Example 1
Consider the function f ( A , B, C, D) given by the truth table in Fig. 1, which is taken
from Ref. [3], p. 165. Choosing A and B as keystone variables and C and D as entered
variables, the table is partitioned into the 4 tables shown representing fo, f~, f2 and f3.
Hence, the VEKM representing f is as shown in Fig. 2.
Example 2
A fairly complex 5-variable functionf (A, B, C, D, E) given in Ref. [9], p. 929 is defined
algebraically by equation (3) and
I
Map I Entered
variables I variables
A B I C D f
I
o 0 I 0 0 d "
I
0 0 I 0 1 d
I fo
0 0 I 1 0
o 0 II 1 1 0
I
I
0 1 I o o 1
0 1 0 1 1 I
0 1
I
0 1 I 1 1 0
I
1 0 I 0 0 0
I
1 0 I 0 I 0
I f2
1 0 I 1 0 1
i
1 0 1 1 I
1
I
. . . . I. . . . . . . .
1 1 I 0 0 0
I
1 1 I 0 , ©
I f3
1 1 I 1 0 0
I
1 1 I 1 , Q
I
i
Fig. 1. Partitioning the truth table for f(A, B, C, D) to obtain its 4 subfunctions.
f o : C 5 ud(C) f2 = C
f3 = CD ud (CD1
B I fl=~ ud I C D ]
E =
A=
B=O
Fig. 3. Expansion tree off(E, A, B, C, D) about its three most frequently used variables E, A,
and B.
CuD d (C) 1
E CD CD
A
u d (C)
The simplified (usually minimal) s-o-p expression for the VEKM function f is given by:
is a function of the map variables only, while P, itself is a function of the entered variables
only. The following set of rules are used in the determination' of various contributions
Co(P,) for the different values of r.
of both lists. Furthermore, the former list is to be sorted in the order to be used in further
processing. Generally, the Pr's involving more literals should appear earlier, so that any
P, will precede other asserted implicants subsdmed by it. Moreover, if P, is the consensus
of some asserted implicants, it may prove useful if Pr is placed earlier to these implicants.
from Pt.
If within a loop Co,(Pr) on the C K M representing Co(P,), P, can be unioned with a
don't care implicant to form an implicant P,, subsumed by P,, then the term P, Cos (Pr)
in equation (5) should be replaced by Prs Cos (P~), so that equation (5) is finally replaced
by the minimal disjunctive form:
f = ~ Prs Cos (P,). (7)
r,s
Example 1 (continued)
The subfunctions prime implicants that appear in the cells of the VEKM of Fig. 2 are
asserted CD, CD, C, and C together with don't care CD, CD, and C. The contributions
of the asserted implicants are obtained by the CKMs shown in Fig. 5. Since in the 2 cells
of the loop .~ covering Co (CD), the product CD can be unioned with C/') (which is present
as a part of C = C / 3 0 C D ) , then the product CO is replaced b y / ) . This replacement is
useful in simplifying the map for Co(C), since now its cell AB is entered by a d rather
than 1 in accordance with the exception of rule 2 in Section 3.2; the C in that cell is totally
covered in the maps of Co(CD) and Co(D). The final expression for the function, f is:
f = CDB U D~I UCAJB, (8)
which is the minimal s-o-p expression f o r f a s obtained in Ref. [3]. This minimal expression
is also obtained when values of m other than 2 are used.
Example 2 (continued)
The subfunctions prime implicants that appear in the cells of the VEKM of Fig. 4 are
asserted CO, CD, C, D, and 1, and don't care C, C and 1. [The don't care 1 is written
simply dinstead of d(1)]. The subsumption relations among them are: CO subsumes C and 1,
CD subsumes D, C, and 1 and both C and D subsume 1. The contributions of the asserted
Improved variable-entered Karnaugh map procedures 47
I d d
[ d ' )
Co {c) = o co (c) = AB
Fig. 5. The CKMs representing the contributions of the asserted implicants of the subfunctions
given by the VEKM in Fig. 2.
E
I
I-°
I~A I
Co (CD)= E *Co (D)
d d d
Co (C'D) - B
,)
d
0(0 d
Co (D) * A
I1 al
'1 I~
Co (1) - B E u A B
Fig. 6. The CKMs required for the function in Fig. 4.
48 ALl M. RUSFIDI
implicants are obtained by the CKMs shown in Fig. 6. The final expression for the function
fis:
f = DEUCDBUCT~ UDA UBEU74B, (9)
which is one of three minimal sums that the function f has [9]. Another minimal sum is
also obtained by the present method, since as shown by the dotted loop in Fig. 6, Co(C)
can be taken as/~ instead of ~, so that f becomes:
f = DE U CDB U CB U DA U B E U TtB, (10)
The VEKM procedure is actually required to yield one minimal sum rather than all
minimal sums. However, it can be used to clarify why a third minimal sum exists in the
present case. If Co(C) is taken equal t o / / t h e n the 1 in the cell EAB is partially covered,
and it is needed to cover only its C' part, which is easily done by an E loop. Hence, the
third minimal sum for f is:
f = D E U C D B U C B UDA UCEU74B. (11)
4. U S I N G T H E V E K M TO O B T A I N MINIMAL PRODUCT OF S U M S
Use of the VEKM to handle product of sums is based on the product-of-sums (p-o-s)
version of Shannon's expansion Ref. [2], p. 83, viz.
f (Xl, )(2 . . . . . Xm, Xm+ l . . . . . Xa) ~- ( f 0 U X l U X 2 U . . . U Xm)
(flUXlUX2U...UXm)...(f(2._l)UXlUX2U...Uz~m) , (12)
where the subfunctions f0,f~ . . . . f2m-~ are again given by equation (2) and are still the
entries for the m-variable VEKM representingf The incompletely specified functionfcan
now be defined through a pair (p,q) of switching functions such that:
{p =0} implies {f=0}, and [{p = 1}n{q = 1}] implies { f = 1},
so that f is written in the form:
f =pd(q). (13)
The subfunctions f of f a r e given by:
f = p, d(qi ), (1 4)
where p~ and q~ are the corresponding subfunctions o f p and q respectively, and should be
written in minimal p-o-s forms. Sums appearing in these forms are to be respectively called,
not-asserted and don't care selected prime implicates of the subfunctions f . Reading the
VEKM in the present case yields the p-o-s form:
,A
(CuD) d (C) C
I (CuD)d (CUD)
f (A,B,C, D)
D d (Cu D)
] l° °}
(C UD), C and D and don't care (t~ UD), (• UD) and C. None of the not-asserted
implicates strictly subsumes or is the consensus of other implicates. The various CKMs
of Fig. 7 yield the shown contributions, and hence the resulting p-o-s expression o f f is:
f = (C' U/5 UA) (C UB) (D UA. UB). (17)
Which can be shown to be minimal and has the same gate/connection cost as that of
equation (8). It is interesting to repeat the above work for m = 1. In this case, two of the
not-asserted implicates in Fig. 8, viz. D and/5 subsume 0, and the symbol d stands for
d(O), The various CKMs of Fig. 8 yield the shown contributions, and hence the same
expression (17) is obtained for fi
I A
d I D 0
CF 5 Dd(O) Od(5) 1
t a I
f (A, B,C,D)
d d
Co'(O) =AuB
id
Io o) d
C o ' ( D ) =A u~"
IO.
Co'(O)= B u C
C,AEE 131--D
50 AH M. RUSHDZ
5. AN APPLICATION
The power of the VEKM technique can be demonstrated by showing its efficient
handling of switching functions of moderate complexity. For example, the VEKM
technique has been applied successfully for implementing the basic modular operations of
addition, subtraction and multiplication in the Residue Number System (RNS). The
following example illustrates the utility of the VEKM in the design of a mod 5 subtractor,
a task involving 10-variable switching functions.
Example 4
Figure 9 shows the block diagram of a residue mod 5 subtractor [10,11]. The inputs X
and Y are decoded simultaneously by producing the binary signals 0(~and #~ for i = 0, 1,
2, 3, 4 such that
0(i = 1 i# X = i; = 0 otherwise
#i = 1 i# Y = i; = 0 otherwise.
X -= (OOCZ1 ~22ct3 a4 )
,,l
Residue Mod 5 Subtroctor
The output Z = (X - Y)5 is given by its 3-bit usual binary representation {Z2 Zj Z0 }. The
problem of designing the residue mod 5 subtractor amounts to finding minimal represent-
ations for three 10-variable functions Z:(o4, fl;), j = 0, 1, 2 and i = 0, 1, 2, 3, 4. These
functions are represented by the VEKM's of Fig. 10. Each of these VEKMs has 5 map
variables #0, #t, #2, f13 and #4, and hence has all its cells except fiv.e being entered with
d's thanks to the way the #{s are defined. The five cells that have non-d entries are cells
for which a certain fl~ = 1 while the other four fl:'s are all 0. For example, the cell {fl0 = 1,
#1 = #2 = ~3 = #4 = 0} has
z = ( x - 0)5 = (X)5 = {~,, (~2 u~3), (0(, U 0(3)}
and hence the entries (0(~U0(3) in the Zo-map, (0(2U0(3) in the Z : m a p , and 0(4 in the Z2-map
are obtained. Entries in other non-d cells of the maps are obtained similarly. The minimal
s-o-p forms for the output functions are:
Zo = 0(0#2U C(o#4 U ~lf13 U 0(lfloU 0(2#4U 0~2#I U ~3#0 U 0~3#2 U (~4#1 U ~4#3, (18a)
Zl = 0(0fl2U go#3 U ~1#3 U ~1#4 U 0(2#4U Qg2#oU 0(3#0 U g3#l U 0(4fll U 0(4#2, (18b)
Z 2 = 0~0# 1 U (~1#2U 0(2#3U 0(3#4U ~4flo. (18c)
While their minimum p-o-s forms are:
Zo = (0~] U 0~3U flo) (0(2 U 0(4 U fll ) (0(3 U 0(0U f12) (0~4O ~1U f13) (0~0U 0~2U :4), (19a)
Z, = (~-, U 0(3U/~'o) (c~3U oq U/~',) (0(4U 0(oU ~=) (~o U 0(t U,8"3) (oq U 0(2U fi,), (19b)
Z2 = (0(4 U A ) (0(0 Ufl'l ) (0(1U:2) (0(2 U ~ ) (0(3 Ufl'4)" (19c)
Improved variable-entered Karnaugh map procedures 51
81 80
I
d ~sU a 0 d a2U 04 QI U Q3 d d
aoU a 2 d d d d d d d
d d d d d d d d
O4U a I d d d d d d d
I
(o) Z o
d a4 o a 0 d a s U 04 aZu a3 d d d
a 1 u a2 d d d d d d d
d d d d d d d d
1
a0 u a1 d d d d d d d
(b) ZI
d QI oo a4 d d d
a3 d d d d d d
d d d d d d d
a2 d d d d d d
(c) Z2
Fig. 10. VEKMs representing the three output bits for the mod 5 subtractor.
The p-o-s implementation in equation (19) is more economical than the s-o-p imple-
mentation in equation (18). No NOT gates are really needed for the implementation in
equation (19), since Y can be decoded in terms of/~:s instead of fi/s right from the
beginning. The implementhtion equation (19) compares favorably in terms of speed (gate
delay) and gate count with the one in Ref. [11].
The insight obtained from this VEKM experience allows the writing of minimal
expressions for the outputs of a residue mod n subtractor, just by inspection. For example,
the residue mod 7 subtractor is given by:
where the summations in the subscripts of equation (20) are to be calculated modulo 7.
52 ALl M. RUSHDI
REFERENCES
1. V. Rhyne, P. Noe, M. McKinney and U. Pooch, A new technique for the fast minimization of switching
functions. 1EEE Trans. Comput. C-26, 757-764 (1977).
2,' S. Muroga, Logic Design and Switching Theory. Wiley, New York (1979).
3, W. I. Fletcher, An Engineering Approach to Digital Design. Prentice Hall, Englewood-Cliffs, N.J. (1980).
4. R. Burgoon, Improve your Karnaugh mapping skills. Electron Des. 20, 54-56 (21 Dec. 1972).
5. C. R. Clare, Designing Logic Systems Using State Machines. McGraw-Hill, New York (1973).
6. A. M. Rushdi, Map derivation of the minimal sum of a switching function from that of its complement.
Microelectron. Reliab. 25, 1055-1065 (1985).
7. C. H. Roth Jr, Fundamentals of Logic Design, (3rd edn) West Publishing, St. Paul, MN (1985).
8. A. E. A. Almaini, Electronic Logic Systems. Prentice-Hall, Englewood-Cliffs, N,J. (1986).
9. B. Reusch, Generation of prime implicants from subfunctions and a unifying approach to the covering
problem. IEEE Trans. Comput. C-24, 924-930 (1975).
10. R. K. Arora and S. Kaushik, Conversion schemes in residue code. Comput. & Elect. Engng 9, 33-43 (1982).
11. S. Kaushik and R. K. Arora, Implementation schemes for basic modular operations. Comput. & Elect. Engng
11, 9-18 (1984).