304
C-20, NO. 3, MARCH 1971
IEEE TRANSACTIONS ON COMPUTERS, VOL.
Fast Algorithm for the Disjunctive
Decomposition of Switching Functions
A
V. YUN-SHEN SHEN, ARCHIE C. McKELLAR,
Abstract-An algorithm for obtaining all simple disjunctive decompositions of a switching function is described. It operates on a
function given as an expression using the operations AND, EXCLUSIVE
OR, and complementation. It uses necessary conditions for the existence of a decomposition to eliminate sets of bound sets from consideration. Thus this technique differs from existing methods in that
it attempts to test fewer bound sets at the expense of additional analysis. The algorithm can also be applied to functions given in a canonical
form. It is shown that for a collection of functions of n variables
chosen at random, the time required grows as n3. Previous methods,
on the other hand, have an exponential growth rate.
Index Terms-Bound set graph, decomposition algorithm, mod 2
canonical form, mod 2 map, partial derivatives of switching functions,
simple disjunctive decompositions, switching functions.
I. INTRODUCTION
HE importance of considering the decomposition
T properties of switching functions in designing economical multistage circuits is well known. The decomposition chart method proposed by Ashenhurst for finding
decompositions [2], [3] requires the testing of 2' - n -2
Karnaugh maps where n is the number of variables and
greater than 1. Thus any implementation of this technique
would have an exponential growth rate for the execution
time. The algorithm presented in [1] is an improvement
over the decomposition chart method as it is ordinarily
used, but the time required still grows as n22'.
In this paper, we will present a method which operates
on a switching function given as an expression using the
operations AND, EXCLUSIVE OR, and complementation. This
leads to an algorithm which can be applied to functions
given in a canonical form and, for a collection of functions
of n variables chosen at random, the time required grows
as n3.
In order to discuss the decomposition properties of
switching functions, we use the following notation and terminology. Letf be a switching function of a set X of n variables, x1, x2, ... , xn. A partition on a set X is a collection
of nonempty, disjoint subsets whose union is equal to X.
Let {A, B} be a partition on X. The functionf is said to have
a simple disjunctive decomposition with bound set A and
free set B if there exist functions F and .iS such that
AND
PETER WEINER,
A{
MEMBER, IEEE
*
F
f
Fig. 1. Multistage realization of a decomposable switching function.
The elements of A are called bound variables and the elements of B are called free variables. The number of elements
in the bound set A will be denoted by k. A function is said
to be decomposable or functionally separable if it has a
nontrivial simple disjunctive decomposition (a simple disjunctive decomposition is nontrivial if 1< k <n). A function in the decomposed form (1), has the multistage realization shown in Fig. 1. This is of interest since it is usually
advantageous to realize two switching functions of k and
n - k + 1 variables rather than one switching function of n
variables [4]. Of course, such realizations are of interest
only if 1 <k<n.
There are other forms of disjunctive decompositions.
Let {A, B, C} be a partition on X. The functionf is said to
have a multiple disjunctive decomposition if there exist
functions F, q, and il such that
f(X)
=
F(q$(A), ifl(B), C)
(2)
and an iterative disjunctive decomposition if
f(X)
=
F(q(q/(A), B), C).
(3)
These decompositions and all their combined forms are
called complex disjunctive decompositions. It has been
shown [2 ], [3] that we can derive all the complex disjunctive
decompositions of a given function from its set of all simple
disjunctive decompositions. Therefore it is important to
construct algorithms for finding all the simple disjunctive
decompositions of a function.
Ashenhurst gave necessary and sufficient conditions for
the existence of a simple disjunctive decomposition with a
given bound set in terms of a Karnaugh map. To find all the
simple disjunctive decompositions of a given function, the
Karnaugh maps corresponding to all nontrivial partitions
of X should be checked. There are 2' - n -2 Karnaugh
(1) maps, when n > 1, since of the 2' subsets of a set of size n,
f(X) = F(O(A), B).
n + 2 cases correspond to trivial decompositions. As in [1 ],
we will exploit a necessary condition in order to reduce this
Manuscript received December 1, 1969; revised September 5, 1970.
V. Y. Shen was with Princeton University, Princeton, N. J. He is now number.
with the Computer Sciences Department, Purdue University, Lafayette,
Ind.
A. C. McKellar was with Princeton University, Princeton, N. J. He is
now with the IBM T. J. Watson Research Center, Yorktown Heights, N. Y.
P. Weiner was with Princeton University, Princeton, N. J. He is now
with the Computer Science Department, Yale University, New Haven,
Conn.
II. NECESSARY CONDITIONS FOR DECOMPOSITION
In this section, we derive a necessary condition for the
existence of a disjunctive decomposition and consider the
implementation of this condition. The condition is derived
305
SHEN et al.: ALGORITHM FOR DISJUNCTIVE DECOMPOSITION OF SWITCHING FUNCTIONS
using the "partial derivatives" of a switching function and f(x1, x2, X3) = a000 E a100xl ( al10lXx2 3 a 11lXlX2X3
is then interpreted in terms of the Karnaugh map (cf.
®) aO1Ox2 (D alOlXlX3
Boolean difference [5]).
(11)
@ aOOlx3 @ aOllX2X3Elementary Properties of Partial Derivatives
A function is determined up to an "additive" constant
The partial derivative off(x1, x2, ---, x.) with respect to (i.e., complementation) by its first-order partial derivatives
as can be seen from the following technique for "integraxi is defined by
tion." Consider the canonical form for a function given in
Of- -- fi =-f(Xl, X2, * * X Xi- 1 1, Xi+ 1, Xn)
(11); we note that for any function f
Zxi @
x2,'',
xi+1, , (4)
(12)
axO
9(X2, X3, * *.* Xn)
The justification for defining partial derivatives in this way
and that
lies in the following trivial consequences of the definition.
f-
''
~(f(Xl,
xi-1,O,
gXn).
1) (f SA)= fisgi
2) (Xl * f(X2, *. X.))1 = f(X2, .. X.)
=(x * f
PX2, X-)) 1
3) (f g)i=
4) (f)ij=(f)ji
5) Let {A, B} be a partition on X, the set of variables.
-
g(o, 09o
(5)
,
0)
,
a,00...0-
(13)
In general, the coefficient aee2.. en can be determined by
(6) taking
the partial derivative of f with respect to all xj such
(7)
that
evaluating the result by setting all other
ej=l
(8) variables toand
zero.
Note that the high-order derivatives can be obtained
from the first-order partial derivatives. Thus all the coefficients except aoo ... 0 are determined and the function is
.Of
001 for all xeA.
af
_Of
aOx
(9)
determined
up to complementation.
Ax aX Ax
Example 2: Let
Properties 1) and 2) provide the techniques for finding the
f(Xl, X2, X3) = X1X2 ( X'2X3.
partial derivatives of a given function. Note that the usual
rule for differentiating the product of functions does not Then
apply.
fioo = f11X2=X3=0 = 0
Example 1: Let
If f(x) = F(4(A), B), then
f(Xl, X2, x3)
X1X2 ®
f0l0
f001
X'2X3.
Then
fl
=
f2
= x1
=
f21X=X3=0 = 0
= f3Kx =x2=0 = 1
and, in a similar fashion, we find f1 0 = fo01 = 1 and
= ft 11=0. Therefore
X2
x3
f = fOOO C x3 (3 x1x2
f3 = X2.
(
f10l
x2x3
= fooo G x1x2 D x'2x3.
It can be easily shown that the operations AND and
EXCLUSIVE OR together with the constant 1 form a complete Necessary Conditions for Decomposition
set. Therefore every switching function can be converted
We adopt the usual use of the Jacobian as a shorthand
into a form where the expression does not have comple- notation in the following discussion. That is,
mented variables and " ." and " G) " are the only two operations. (See, for example, [7, p. 92].) A function of n varif,gX2 = fl f2 =f_92 @ f2gl
(14)
ables has the following canonical form:
(XI, x2J
g1
f (Xl, X2,
x)
=
aee2 ...
exlx2
Xen
where
ei
or
=O
1
The extension to n functions and n variables is obvious but
will not be required here.
In the study of functional dependence, it has been found
(see, for example, pp. 131-142 of [6]) that if we let fl,
f 2,. fn be n continuous functions of the n independent
variables x1, x2,", x", whose first-order partial derivatives
are also continuous, the necessary and sufficient condition
that the functions should be dependent is that their Jacobian
with respect to x1, x2, , xn should be identically zero.
That is,
-
aele2 ... en
XfiI
=
1
Xi
0
1
if ei
if ei
= 0
= 1
and I denotes the EXCLUSIVE-OR operation extended over
all n-tuples of O's and l's.
This expression is called the mod 2 canonical form [9].
For a function of three variables, it reduces to
g2
-
J(fXl,1 fX2,2 *
f
Xn
306
IEEE TRANSACTIONS ON COMPUTERS, MARCH
1971
if and only if there exists a function F such that Using (8), the commutativity of partial derivatives, we have
F(f ',
f
fn)=°.
2 ***
Since a decomposable function and its subfunction are
dependent, we are interested in finding out whether this
result can be extended to the case of switching functions.
The following theorem answers the question in part.
Theorem 1: Let {A, B} be a partition of the variable set
X. If f(x) = F(O(A), B), then
fX,=(fj)=fki
Xjfk
Dfjfk i
fj@
=
jk
F++biFkoqj 0 F+bjFkOqi
=
0.
Q.E.D.
Corollary 1: Let xi, xi, Xk be elements of the variable set
X and J(f, fk/xi, xj) #0. If f is decomposable with any
set A containing xi, xj, then XkeA.
bound
for all xi, xj E A.
(Xi, =) 0
We propose to carry out the test of Corollary 1 for each
possible choice of i, j, and k. One way to do this is by maProof:
nipulations on a function given as an expression involving
the operations AND, EXCLUSIVE OR, and complementation
only. A second approach is to evaluate the Jacobian point
(xig xj) li Xjl
by point. The value of a Jacobian at a point can be deterFrom (9), f = F, * Xi. Therefore,
mined from the value of the function at six points and so
any representation of the function which permits evaluation
|Foi Fopjl
z ,
at a point would be acceptable. Of course evaluation point
by point would terminate whenever a point was found at
= Fo4i)qj (1 F,j4i)
which the Jacobian was nonzero. The next theorem, which
Q.E.D. provides an interpretation of Corollary 1 in terms of the
= 0.
Karnaugh map, suggests a third approach in which the
Example 3: Consider
Jacobian is tested eight points at a time.
Theorem 3: Let xi, Xj, xk be elements of the variable set
f (Xl, X2, X3, X4, X5) = 1 0 X1 0 X2X5 0 X2X4X5
X. Then J(f, fk/xi, xj) = 0 if and only if in the Karnaugh
(0 X2 ( X3X5 0 X3X4X5
map of the function with the variables xi, xj defining the
(0 X3 0 X4X5
columns all pairs of rows differing only in Xk satisfy one of
the following properties:
0 X5
1) One row in the pair contains all 0's.
which has a decomposition with bound set A= {X2, X3} and
4 =zX2O@X3.
2) One row in the pair contains all l's.
3) The rows are identical.
f2 = 1 0 X5 0 X4X5
4) The rows are complements of each other.
f3= 10x5 0 x4x5
Proof-If: Without loss of generality, let i = 1, j = 2,
-02 = 1 = /3k= 3, and consider the rows corresponding to {X3, X4,,
xn} = {0, a4, , an} and {1, a4, ., an} where the a's are
Therefore
either 0 or 1. The Karnaugh map of the function has the
following pair of rows:
(f,+)_ f2 f31=
___
02 03
X2, X3
0.
One might hope that the conditions of Theorem 1 would
also be sufficient for the existence of a decomposition. But
unfortunately this is shown in [8] to be true only if A contains two elements.
The condition of Theorem 1 is not directly suited to our
purpose for finding decompositions since it requires the
knowledge of the function 0. The following theorem reremoves this difficulty.
Theorem 2: Let xi, xi, xk be elements of the variable set
X and F(O(A), B) be a disjunctive decomposition of f(X).
Then
J f(
fk)
Xi, Xj
0
for allxi xj EA
xkcE B.
Proof: Let f(X)= F(4(A), B) with xi, xjeA and xkeB.
From (9),
fi Fooi
fj = Fo j
=
X3X4
... Xn
X1X2
0 0 01
10 1 1
0a4."an
la4 ... an
Since J(f, f3/x1, x2) =f1f23
f2f13,
f, f3)
X13 X2 0,0,O,a4,*
=
=
*,an
(COC4)(cOcC lc20c3)0(cO)C2)(co0cC 1C40C5)
(C1 C5)(CO0Cl 0c20c3)
c1C4(4C5)
0(C1G C3)(COCl
=j(f5f3
(x1Xx)0,0, 1 a4, ** *,a,n
It is easily verified that (15) equals zero if c0, c1,
(15)
c satisfy
,c?
any of the four conditions. A similar argument holds for all
307
SHEN et al.: ALGORITHM FOR DISJUNCTIVE DECOMPOSITION OF SWITCHING FUNCTIONS
other points of the Jacobian involving these eight points of
the Karnaugh map.
Proof-Only if: Suppose
1(X'X)
O,
00,0,a4,
*(j,an
(
v2) 0,0,1,a4,-*an
=***=J'>A
VXl, X2
1,1,1,a4,,
an
=
.
Fig. 2. Bound set graph of a switching function.
In addition to (15) we get three more equations for the
entries of the rows. After simplification, the four equations
obtained are the following:
CO(C3 (3 C5) (f c2(c1 @ CC5) C4(Cl (D C3) = 0 (16)
C2(C5 (e c7) ( C4(C3 @ c7) e c6(c3 e C5) = 0
CO(C5 @ c7) ( c4(cl ( c7) ) C6(Cl 0 C5) = 0
CO(C3 @ c7) (G c2(c1 3 c7) ( c6(c1 () c3) = O.
(18)
(19)
sets.
The result of testing the Jacobians can be put in the form
of a linear graph containing one node for each variabje. The
edge between nodes xi and xj will have a set Wij of variables
as a weight, where
f(fX)
~~Xi, xj
{XkJ(
°}v
(20)
Thus, in view of Corollary 1, any bound set which contains
xi and xj also contains W'j. This graph is called the bound
set graph for the function f and is shown in Fig. 2.
Example 4: Let
3
X2,X3 X5
(17)
It can be verified by perfect induction that the pair of rows
satisfy one of the four conditions stated in the theorem.
Q.E.D.
The necessary conditions on the Karnaugh map, stated
in Theorem 3, follow immediately from the conditions of
Ashenhurst [2]. The interesting thing is that this set of conditions should be identical to a cpndition in terms of
Jacobians.
There is a similar necessary condition based on the mod 2
map representation of a function [1] which is stated in the
following theorem. This condition is not equivalent to the
preceding condition [81.
Theorem 4: Let xi, Xj, Xk be elements of the variable set
X and let the mod 2 map of the function with the variables
xi, xj defining the columns have some pair of rows corresponding to terms.with and without xk which do not'have
either of the following propierties:
1) Except for the first bit, one row in the pair contains
all O's.
2) Except for the first bits, the rows are identical.
Iff is decomposable with any bound set A containing xi,
xj, thenxk EA.
III. GENERATION OF CANDIDATE BOUND SETS
The computation of all possible Jacobians for a given
function will'show that certain bound sets cannot lead to a
decomposition. The remaining bound sets must be tested
further using necessary and sufficient conditions. We now
address the problem of generating the candidate bound
=
X2,x3X4
X4,X5
X2 ,X ,X5
X2,5
(b)
(a)
5
2
2X4
(c)
Fig. 3. (a) The bound set graph of the function in Example 4.
(b) The augmented graph. (c) The reduced graph.
f(X1, X2, x3, x4, x5) = 1 G xI
x2x5 i) x2x4x5
G X2 X3X5 (D x3x4x5
@ x3 @ x4x5
3
EEx5.
To compute the weight of the edge between nodes x1 and
x2, denoted by W12, we test J(f,f k/xl, X2) for k=3, 4, 5. It
can be easily verified that J(f, f4/X1, X2) #0 and J(f, f5/
x1, x2)+0, and the weights of the edge are X4, X5. (W12
= {X4, X5}.) After the Jacobians for other pairs of variables
are tested, we get the graph as shown in Fig. 3(a).
An augmentation process can be carried out on the
bound set graph. If Xk E Wij, then any bound set containing
xi and xj also contains Xk. Thus, any such bound set must
also contain Wik and Wjk even though some of the corresponding Jacobians may be identically zero. This' can be
accomplished by carrying out the following steps:
1) Set FLAG=0.
2) For each edge Eij do the following steps:
a) If Wiju{xi, xj}={
x.} then go to the
next edge.
b) For each Xk E Wij do the following steps:
i) Set -{ Wju Wik}ln{Xi, Xj}
ii) If Wij', Wi then set Wij = Wi and FLAG= 1
iii) Set W= {Wiju W'k}n{xi, xi}
iv) If Wijj: Wi thei set Wij = Wi and FLAG= 1.
c) If FLAG= 1, then go to 1) else stop.
In this example the fully augmented graph is shqwvn in
Fig. 3(b). Note that in the augmented graph many edges
correspond to trivial bound sets, and the condition specified
by one edge may be 'equivalent to that specified by some
IEEE TRANSACTIONS ON COMPUTERS, MARCH 1971
308
1x
/I
xi
(a)
I
(b)
2
Fig. 4. (a) The bound set graph of the function in Example 5.
(b) The reduced graph.
l
L..
other edge. For example, W12 implies a trivial bound set
and both W24 and W25 suggest a bound set {X2, X3, X4, X5}.
In order to obtain a minimal set of "generators" for the list
of candidate bound sets, we reduce the augmented graph
by first defining an equivalence relation, -, between the
edges of the graph by
Eij-Ekm
if and only if
{xi,
Xj}uWj={Xk, Xm}UWkm
We then retain one element of each equivalence class except
for the trivial case. A set of generators can be obtained by
the following steps:
1) For each edge Eij, do the following step:
a) If Eij is not equivalent to any edge in the set, add
it to the set.
Fig. 3(c) is a reduced graph for the example. To see that
the augmented graph can be recovered from the reduced
graph, we observe that W34= {X2, X5} since {X3, X4}
' {X3, X5}UW35. If W34 contained more elements, W35
could be augmented. If it contained fewer elements either it
could be augmented or it would not have been deleted. This
shows that the conditions represented by the reduced graph
are equivalent to the original bound set graph.
To use the reduced graph as a generator for the list of
candidate bound sets, we consider all the nontrivial sets
obtained by taking unions of the conditions for each subset
of edges. Each one of them is then checked against the augmented graph to see if it is indeed a candidate bound set.
For this example the only three distinct sets obtained by
taking union of the conditions of the edges are {X2, X3},
{X4, X5}, and {X2, X3, X4, X5}. They are also the candidate
bound sets because they do not violate the condition specified by any edge in the augmented graph. Further checking
by methods such as those described in [1] shows that they
are exactly the bound sets for which the function is decomposable. Example 5 shows that the final step cannot be
omitted.
Example 5: Let
f(X1, X2, X3, X4)
=
Xl
D
X2
(
X3
ED
gaX1X2
X1X3 e X2X3 (
XlX2X3X4
The bound set graph is shown in Fig. 4(a) and cannot be
augmented. A reduced graph of the function is shown in
Fig. 4(b). The union of the edge weights contains
{X1, X2, X4}, {X1, X3, X4}, and {X2, X3, X4} which violate the
conditions in the bound set graph and need not be tested
for decomposition.
A
/
1-
/
/
/
/
/
0
6
8
n
10
12
14
16
Fig. 5. Running times of the bound set graph algorithm
for randomly chosen functions.
IV. EXPECTED RUNNING TIME
To determine the expected running time of an algorithm
based on the techniques described here, we assume that the
function to be tested is chosen at random from the set of all
functions of n variables, i.e., the probability that the function has the value 0 at a particular point in the Karnaugh
map is 1/2. Further; we assume that each Jacobian is tested
by applying the test of Theorem 3 to pairs of rows from the
Karnaugh map.
It is easy to show that the probability that a pair of rows
will satisfy one of the four conditions of Theorem 3 is
(11/32) and hence the probability that a particular Jacobian
is identically zero is (1l/32)2n-3. On the average, only a
small number (less than 1.53), which is almost independent
of n, of pairs of rows will have to be checked for each
Jacobian to show it is nonzero. Thus one would expect that
the time required to check the (3) Jacobians would grow
approximately as n3.
The algorithm was programmed and executed on an
IBM 360/65. The running times, plotted in Fig. 5, grow approximately as n3 as expected. For the random functions
tested, the bound set graphs had only trivial edges.
It is also interesting to investigate the behavior of this
algorithm for the case of decomposable functions. To do
this, functions F and 4 are chosen at random and used to
construct the function F(f(A), B). The running times,
shown in Fig. 6, increased very rapidly and this experiment
showed that this algorithm was less attractive than the
decomposition graph method [1] for the decomposable
functions tested. This is due to the fact that when a function
has a decomposition with bound set of size k, at least
(k) (n - k) Jacobians are identically zero and hence must be
tested completely.
The algorithm based on Theorem 4, using the mod 2 map
representation of the function, checks pairs of 3-bit rows
for zero and identical patterns only. It can be easily verified
that for randomly chosen functions the probability that
any pair of rows satisfies at least one of the two conditions
SHEN et al.: ALGORITHM FOR DISJUNCTIVE DECOMPOSITION OF SWITCHING FUNCTIONS
10
5.
8
1.
- 0.5
6.-.
.,1'
.
,
'
4
0.1
0.05
2 LU-
NON DECOMPOSABLE
CASES
4
6
8
_n
10
Fig. 6. Running times of the bound set graph algorithm
for decomposable functions.
309
Thus an approach based on Corollary 1 would be of interest for functions which were likely to have a decomposition. Of course, the time required to obtain each Jacobian
would depend critically on the complexity of the expression
which represents the function which in turn depends on the
number of variables involved. Certainly this technique is
very attractive when the given expression is simple. A problem which requires further work is that of determining
whether a given expression, i.e., a Jacobian, is identically
zero. In addition, if the number of variables is so large that
a canonical form cannot be maintained in main memory,
the manipulation of an expression might become even more
attractive.
is also (11/32). Therefore the probability that a weight can
REFERENCES
be added to an edge is (1 1/32)2"- 3, the same as in the algo"An algorithm for the disjunctive
A.
McKellar,
C.
and
V.
Y.
Shen
[1]
rithm based on Kamaugh maps. Thus the running times for
decomposition of switching functions," IEEE Trans. Computers, vol.
this method should differ from the running times of Fig. 5
C-19, pp. 239-248, March 1970.
[2] R. L. Ashenhurst, "The decomposition of switching functions," Proc.
by a constant factor.
Int. Symp. Theory of Switching (Harvard University, Cambridge,
Mass.), 1957. (Reprinted in the appendix of [3].)
V. CONCLUSIONS
[3] H. A. Curtis, A New Approach to the Design of Switching Circuits.
The methods presented here rested on determining
Princeton, N. J.: Van Nostrand, 1962.
whether or not certain Jacobians of a switching function [4] D. E. Muller, "Complexity in electronic switching circuits," IRE
Trans. Electronic Computers, vol. EC-5, pp. 15-19, March 1956.
are zero. Theorem 3 shows that each Jacobian can be con[5] S. B. Akers, "On a theory of Boolean functions," J. SIAM, vol. 7,
veniently tested eight points at a time. This is a very powerDecember 1959.
ful technique if the function to be tested is chosen at random [6] G. A. Gibson, Advanced Calculus. London: Macmillan, 1954.
E. J. McCluskey, Introduction to the Theory of Switching Circuits.
since the expected number of points which must be tested [7] New
York: McGraw-Hill, 1965.
before a particular Jacobian is found to be nonzero is almost [8] V. Y. Shen, "On simple disjunctive decompositions of switching functions," Ph.D. thesis, Dept. of Elec. Eng., Princeton University, Princeindependent of n. Unfortunately, the time required to test
ton, N. J., January 1969.
a function which has a decomposition is greater than the
[9] I. S. Reed, "A class of multiple-error-correcting codes and the decodtime required by the decomposition graph technique [1]
ing scheme," IRE Trans. Inform. Theory, vol. IT-4, pp. 38-49, September 1954.
since many Jacobians are identically zero.
© Copyright 2026 Paperzz