Sunteți pe pagina 1din 6

XOR realization using KH-map

A.T.M. Shafiqul Khalid a n d A . 4 . S.Awwal


Computer Science &- Engineering Department,
Wright S t a t e University, Dayton,
Ohio 45435, USA
akhalidQvalhal1a.cs. Wright .edu

Abstract is no other such expression with the same number


of terms and with fewer number o i variables. In a
Logic design using XOR gates is becoming more KH-map, a point P on the circle represents a uniquc
popular due to testability and cost effectiveness. combination: there exists numerous points on the
For designing logic circuit, K-map is still an un- circle, each symmetric (adjacent) to the point P
parallel tool to a logic designer. Due to geometric about a line passing through the center. The new
constraint of I(-map, derivation of XOR relation is method exploits this symmetry of circles, and ad-
not as simple as those incorporating AND-OR rela- dress these symmetric points in such a way that
tion. However, for large problem one totally relies they can be adjacent to P. One can easily trace two
on mechanical approach such as computer simula- adjacent (symmetric) points on a circle satisfying
tion where intuition is less effective. KH-map is some conditions or findjng the mirror image only.
a newly proposed technique of mapping large logic
functions in limited physical system and offers bet-
ter way of realizing minimized logic functions. This 2 Preliminaries and KH-map
paper gives soiiie rules that can be effectively used
in realizing XOR-relations from KH-map.
X KH-map is a modified form of a truth table in
which the arrangement of the combinations is par-
ticularly convenient. liH, represents a KH-map of
1 Introduction n variables containing 2" cells equally spaced within
a circle. The cells represent all possible combina-
Physical construction of a I<-map accommo- tions of n variables and any combination will be
dates only 4 adjacent cells of a cell in a single of the form ( X n , X n - 1 , .... X I ) . One can draw the
unit(4x4 matrix) and 2"-4(n > 4) different units AH, map for a function F, using the following I i H
are required to represent an n variable function. algorithm:
Binar decision diagram (BDD) is much efficient in
representing logic function [l]while it suffers from K H algorithm:
finding isomorphic subgraphs in the m minimiza-
tion step which is more complicated than finding // Let Xi?X 2 , ...,X , be the variables.
subcubes in a K-map.
1. Draw a circle of any suitable radius.
This paper introduces a new mapping method 2. Draw a chord XAX, passing through the center
proposed by Khalid [7] with application in which is called X , line.
EX-OR realization. The map shortly called
KII-map can be used to simplify a switch- 3 . For i = 12 - 1 t o 1 do
ing function E( X I , X 2 , ..., X,) to an expression Equally divide the cells of the circle by
G(X I X2, ... X , ) . The simplified expression G is
~ 2,-2-1 new chords each passing through the
equivalent to F and minimizes the number of terms center.
in a sum-of-product expression, ensuring that there //Each of these chords is called X , line and

CH35934-9610000-0280 $1.00@1996IEEE 280


the set of these lines is called X ; line set. 3 Minimization Using KH-map
Mark the end points of all chords as X i , X j
starting from X h in a clockwise direction. Definition 3.1 Adjacent nodes: Two vertices V k
//This step will generate a KH-map of and 14 are called adjacent t o X , line if only and only
2n-i+l cells. if the address associated with the vertices differ by
End-for X , variable. For instance, if the address of V k and
are BI, and -Bl respectively then BI, @ Bi = X,.
B, indicates binary combinations associated with
The minterms (combination of all binary liter-
vertex V, in ith cell. Analysis shows that the fol-
als) associated with each cell can be obtained
lowing conditions are sufficient for the vertices Vk
using algorithm I.
and I$ t o be adjacent t o the X , line: (,a) the line
( L ) joining the vertices Nk and Nl never intersects
Identify the cells that contain the combinations X, line where j > i ; and ( b ) X, is a perpendicular
for which function value F is TRUE. Mark mid bisector of L.
point of the arc of each of those cells by a small
circle or node. This node will be called a ver- Definition 3.2 KH-polygon: A polygon consist-
tex. ing of a collection of 2” vertices each aldjacent to
m vertices of the collection, is called a 1I;H-polygon.
The KH-polygon is said t o cover all 2” vertices,
In all the figures and examples w, IC, y and z have where, 0 5 m 5 n. Two consecutive vertices of the
been used instead of X q t X 3 , X 2 and X - 1 . KX-map KH-polygon must be adjacent. The KH-polygon
of three and four variables are shown in fig. 1.a will be represented by a product term (p) which
and 1.c respectively. In the figure binary number covers all minterms associated with the vertices of
in each cell represents variables combinatiotn asso- the collection. This polygon is called a IiH-polygon
ciated with that cell. of dimension m.

Algorithm I:
3.1 AND-OR minimization:
1. Start from the node of any cell in an anti-
In order t o obtain a minimal expression for a
clockwise direction.
boolean function, all vertices must be covered with
the smallest possible number of KH-polygons, such
2. Collect the n end point markers of all X , lines that each KH-polygon is as large as possible. A KH-
for i = 1 , 2 , ...,n on a first-come first--served polygon contained in another larger KH-polygon
basis. The end point markers will correspond must never be selected. Function F can be ex-
t o the node address in cell Ci. pressed as a sum of those product terms that corre-
spond t o the KH-polygon(s) necessary t o cover all
For example, if one moves in an anti-clockwise di- its vertices.
rection from the cell containing 1000 in Fig. 2(b),
one gets the literals z’y’zx’z’yzw which after includ- Example 1: Figure 2.a and 2.b map the func-
ing only the literals that appear first yields z’y’dw. tion F(x,y,z)= C(O,3,4,6) using KH-map and
Therefore, the combination associated with the cell K-map respectively. In fig. 2.a vertex CL has no ad-
is wz’y’z’ i.e., 1000. If for any cell the end points jacent vertex(i.e., no mirror image). Therefore. this
are w’xy’z, then the address of the nodes in that is marked as a KH-polygon of zero dimension. lrer-
cell is 0101. Algorithm I1 implies that the address tex b has only a single adjacent vertex d that forms
of any node can be easily calculated using the end a KH-polygon of one dimension. Uncovered vertex
point markers of chords in a KH-map. Therefore, c makes cd KH-polygon. Now, the KH-polygons CL,
the explicit address placement required in conven- bd and cd cover all the vertices and prolduct terms
tional mapping is no longer required in the proposed for them aredyz, y’z’ and xz‘ respectively. Product
represent ation. term of bd excludes 5 variable as z variable line(z’z)

281
perpendicularly bisects bd. Thus the expression for Theorem 4.2: If vertices V k and are EX-
+ +
the function is F ( z , y, z ) = z’yz y’z’ zz’. OR adjacent about lines X ; and X , and L is the
line joining the vertices then
Example 2: Figure 2.c and 2.d represent the a. L intersect only one X , line where i < j .
function F(w,x,y , ~ = ) C(3,5,8,10,11,12,14,15) b. L intersect Odd number of AY, lines.
using KH-map and K-map respectively. In fig. c. L never intersect X I , where ,k > j .
2.c vertex a form a KH-polygon of zero dimen-
sion. Vertices b and g form a IiH-polygon of one Definition 4.2 : EX-OR polygon A poly-
dimension. Vertex c has two adjacent vertices d gon consisting of 2” vertices is called EX-OR poly-
and f . But. froin the figure we observe that d is gon if two consecutive vertices are EX-OR adja-
adjacent to e and e is adjacent to f resulting a cent about any two variable line. EX-OR poly-
larger KH-polygon cdef of two dimensions. Two gon will be uniquely determined by PQ where P =
IiH-polygons cf and de produce the similar re- B1 @ B2@,..., $B, where B1, B2, ..., B, represents
sult. Uncovered vertex g form a one dimensional the address associated with vertices of the polygon.
KH-polygon with the vertex h, which eventually Q is EX-ORof all the variable not present in P.
form a larger KH-polygon of two dimensions with Q is called EX-OR product. For example in fig.
tlic d e KH-polygon. Now, the IiH-polygons a , by. 3.b. EX-ORpolygon abcd will be repr esented as
c d e f and g d e h cover all the vertices and product Y(W 8 2 $ 2).
term for them are w‘xy’z. x‘yz,wz‘ and wy respec-
tively. Product term for c d e f excludes z and y Polarity determination: If vertices Vk and
variables as x variable line z‘x and y variable line 14 are EX-OR adjacent about lines X , and X ,
y’y’ perpendicularly bisect the arms d e ( cf also) then EX- 0 R polygon containing only the vertices
and cd. Thus the expression for the function is VL-and I$ may be represented by P ( X , @ X , ) or
+
F ( w , z ,y,z)= w’zy’z z’yz t wz’t wy. In fig. P ( X , @ X , ) . Let the line L joining the vertices in-
2.d equivalent subcubes of the KH-polygon bg and tersect only one X , line. Consider all the end points
c d e f are formed by folding the Ii-map. of X , line intersected by L in on a fixed side. If there
are even number of X , points then take X : other-
wise take X,.Now, if the points are X,,XJ or Xi,lYi
then take P ( X , @I X,) otherwise take P ( X , @ X j ) .
4 EX-OR minimization and
properties In order t o obtain a minimal expression in the
form EX-OR AND OR, all vertices must be covered
Definition 4.1: Two vertices VI,and V, will be with the smallest possible number of KH-polygons
called EX-OR adjacent about lines X , and X , if and EX-OR polygon, such that each IiH-polygon is
there exist a vertex V such that V is adjacent t o I,i as large as possible.
and about line X , and X , respectively. This im-
plies that combination associated with the vertices Example 3: Figure 3.a. represents the func-
must differ by only two variable. tion F(w,x, y, 2 ) = (1,2,7,11,13,14). In the fig-
Theorem 4.1: Two vertices V k and 15 will be ure vertex a and b are EX-OR adjacent about z and

.>.
always EX-OR adjacent about lines X, and X,-1 if w line. End points of z and w lines on the same side
line joining the vertices passes through the center. of ab i s either wx or w’x’. Therefore EX-OR poly-
gon ab will be represented by yz‘(w @ Product
Proof: From the construction of KH-map we term yz‘ can easily be found applying technique in
know that the single lines in an n variable map is the previous section. For the EX-OR polygon c d e f ,
X, and X,-1. All other lines are 2“(k > 0) in num- EX-OR product would be 20 @ z @ z . Therefore ex-
ber. Line passing through the center intersect all pression is y ( w CE z @ .)+ yz‘(w @ .).
the Xi lines. Therefore, combination associated w
ith the vertices must differ by X, and X,-1. Example 4: Figure 3.b. represents the func-
tion F ( w ,I C , y, z ) = (1,2,4,7,8,11,13)and after

282
minimization we get F= y(w GI 5 e?)+ wx‘yz + Simplijcation of Multi-variable Boolean Func-
Z ’ W ’ ( Z ) . tion,” IEEE NAECON’95 proc. Dayton, Ohio,
pp. 256-261, 1995.

5 Conclusion
From the foregoing discussion it is clear that the
technique provides an intuitive and geomietric way
to minimize logic function. It is also cleax that al-
most the same approach used in realizing AND-OR
relation using KH-map can be used in XOR-AND-
OR for other minimization. The only difference is
the way of defining KH-polygon and XOR,-.polygon.
Examples used in this paper show how the EX-OR
relation can be realized simply. It is hoped that
KH-map will be an important tool t o analyze and
design complicated EX-OR based circuits and EX-
OR production rules.

References

1. S. B. Akers, ‘( Binary Decision Diagram!”


IEEE Trans Comput., vol C-27, pp. 509-516,
June 1978.

2. M. Karnaugh, ‘‘ The Map Method fofar Synthe-


sis of Combinational Logic Circuits, ” Trans.
AIEE. pt. I, vol. 72, no. 9, pp.593-599, 1953.

3. C. Y. Lee., ‘(Representation of switching cir-


cuits by binary decision programs,” Bell Syst.
Tech. J., vol 38, pp. 985-999, July 1950.

4. E. J. McCluskey, “Minimization of Boolean,


functions” , Bell System Tech. J., vol. 35,
no 6, pp. 1417-1444, Nov. 1956.

5 . S. Muroga , “Logic Design and Switching The-,


ory,” New York:Wiley, 1979.

6. W . E. Veitch, “A Chart Method for Simplify-


ing Truth Functions, ” Proc. ACM, Pittsburgh.,
May 2-3, 1952, pp. 127-133.

7. A. T. M. Shafiqul Khalid, “A New Mapping


Method f o r Boolean Function Manipulation,”
Journal of Institute of Engineers, Bangladesh.,
vol. 22, no. 2, pp. 99-104, 1994.

8. A. T. M. Shafiqul Khalid, Farid Ahnied, M. A,,


Karim “A Composite Mapping Tec,hnique for

283
J

Figure 1.
(a) ICH-map for 3 variables
( b ) IC-map for 3 variables
( c ) KH-map for 4 variables
j d ) I<-map for 4 variables

284
@ XY*
: x
X

d c

Y'

VZ
,

w'
C
z

Figure 2. ( a ) . ( b ) IiH-map and I(-map for the function


F ( 5 . y, Z ) = c(O,3.1 G .)
(c), ( d ) IiH-map and I(-map for the function
F ( E . n', y. z ) = ~ ( 3 , 5 , 8 , 1 0 , 1 1 , 1 2 , 1 4 , 1 3 )

wxyz

Figure 3 . (a) KH-map for the function F ( w ,N , y, z ) = (1,2,7,11,13,14).


(b) KH-map for the functionF(w,z,y,z) = ~ ~ ( 1 , 2 , 4 . 7 , 8 , 1 1 , 1 3 )

285

S-ar putea să vă placă și