EXACT MINIMIZATION OF ESOP EXPRESSIONS WITH LESS THAN

Journal of Circuits, Systems, and Computers
c World Scientific Publishing Company
EXACT MINIMIZATION OF ESOP EXPRESSIONS
WITH LESS THAN EIGHT PRODUCT TERMS
STERGIOU STERGIOS
[email protected]
Department of Electrical and Computer Engineering
National Technical University of Athens
N.T.U.A. Campus
Athens, 15780 Zografou, Greece
PAPAKONSTANTINOU GEORGE
[email protected]
Department of Electrical and Computer Engineering
National Technical University of Athens
N.T.U.A. Campus
Athens, 15780 Zografou, Greece
Received
Revised
Accepted
An algorithm is proposed in this paper that finds exact exclusive-or sum-of-products
of an arbitrary function, provided the number of product terms is less than eight. If
the number of product terms in the minimal expression is more than seven, then the
algorithm detects it and heuristically returns near-optimal expressions. The algorithm
is time and space efficient even for functions with many input variables.
1. Introduction
The problem of the minimization of exclusive-or sum-of-products (ESOP) expressions has attracted the interest of the scientific community for many decades, due
to their advantages in some application areas of logic synthesis, design test, product
term count e.t.c.1 Although efficient heuristic methods have been developed in the
past1,2,3,4 , exact solutions for arbitrary functions of more than five variables, have
not been practically developed4 and this problem seems to be still open.
ESOPs have been shown to require fewer product terms than the corresponding
SOP expressions.1 Moreover, both the space and time specifications are identical for
LUT-based fpgas, effectively depicting ESOP minimization as an attractive complement of the current fpga logic synthesis process.
In Ref. 5 some theorems have been proved for testing whether a switching
function can be expressed as an ESOP of up to five product terms provided that all
S. Stergiou & G. Papakonstantinou
exact solutions of its subfunctions are known. Moreover, based on these theorems,
the exact solution of an arbitrary function of n = 4 variables can be obtained. In
Ref. 6 some theorems have been proved for finding an exact ESOP of an arbitrary
switching function of n = 5 variables. To the best of the authors’ knowledge, this
work was the first to efficiently solve the exact ESOP minimization problem for up
to five variables.
In Refs. 7,8 another solution that finds exact expressions of n = 5 variables is
given. That work is an improvement upon Ref. 9. Other approaches for the exact
ESOP minimization problem can be found in Refs. 10, 11, 12, 4.
In Ref. 8, results for up to nine variables have been presented but the algorithm
is exhaustive, requiring a prohibited amount of time and it works if the number of
the product terms in the exact expression is very small, with published results of
up to four product terms. To the best of our knowledge, the exact minimization
of ESOPs for arbitrary functions of five variables is still the only practical solution
which is stated in the bibliography. A very good survey in the subject of ESOP
minimization can be found in Ref. 13.
In this paper, some theorems are presented from which all exact ESOPs with a
number of product terms less than six can be obtained for an arbitrary switching
function. Moreover, if the number of product terms is more than five and less than
eight, at least one exact ESOP can be obtained. If the number of product terms is
more than seven then a near-optimal expression is heuristically obtained.
A new operation, recursive combine is presented. An algorithm is then proposed
that identifies exact or near-optimal ESOPs for a switching function f , depending
on the number of product terms. The experimental results show that the time
required for the minimization process is very small for an arbitrary function with
many input variables, hence it is very efficient.
Furthermore, from the experimental results it is concluded that the time requirements for the algorithm are superior relative to the other exact minimization
approaches.
2. Definitions
Let xji denote xi , xi , 1 for j = 0, 1, 2 respectively.
Definition 1. A subfunction f i , i = 0, 1, 2 of a function f (x1 , x2 , . . . , xn ) is defined
as
f 0 = f (0, x2 , . . . , xn )
f 1 = f (1, x2 , . . . , xn )
(1)
f2 = f0 ⊕ f1
where ⊕ means modulo-2 addition. An arbitrary ordering of the input variables
x1 , x2 , . . . , xn is assumed.
Exact minimization of ESOP expressions with less than eight product terms
Definition 2. An ESOP is an exclusive–or of zero or more cubes. A cube is a
product term consisting of literals. A literal is a variable or its negation.
Definition 3. The weight w(f ) of a switching function f is defined as the minimum number of product terms in an ESOP among all possible ESOPs of the
switching function f .
Definition 4. An exact ESOP of a switching function f (or an exact expression
for simplicity), is an ESOP of the function f , with the number of product terms
equal to its weight.
We also recall here some basic formulas.
f = x1 f 0 ⊕ x1 f 1
f = f 0 ⊕ x1 f 2
f = f 1 ⊕ x1 f 2
Shannon expansion
positive Davio expansion
negative Davio expansion
(2)
3. Theorems
Theorem 1. All exact ESOPs of a switching function f can be derived from its
subfunction f j iff another subfunction f i of f is zero, with j = 1, 0, 1 for i = 0, 1, 2
respectively.
Proof: From (1) and (2), when one subfunction f i of a switching function f of n
variables is zero, then the other two subfunctions are equal and f can be written
as:
f = xe1 f j
(3)
with e = 1, 0, 2 and j = 1, 0, 1 for i = 0, 1, 2 respectively.
Subfunction f j does not depend on variable x1 . Multiplying an ESOP g of f j
by x1 in any polarity, does not increase or decrease the number of product terms
in g. From (3) we conclude that w(f ) = w(f j ) hence the theorem is proved 2.
Theorem 2. All exact ESOPs of a switching function f with weight less than six,
can be obtained from the exact ESOPs of its subfunctions.
Proof: An exact expression of a switching function f can be written in the form:
f = xa1 (P11 ⊕ . . . ⊕ P1q ) ⊕ xb1 (P21 ⊕ . . . ⊕ P2r ) ⊕ xc1 (P31 ⊕ . . . ⊕ P3s )
(4)
where a, b, c ∈ [0, 1, 2], Pij is a product term and w(f ) = q + r + s.
Case 1 Let a = b = c. Then relation (4) can be written as
f = xa1 (P11 ⊕ . . . ⊕ P1q ⊕ P21 ⊕ . . . ⊕ P2r ⊕ P31 ⊕ . . . ⊕ P3s )
(5)
S. Stergiou & G. Papakonstantinou
or f = xa1 f j where j = 1, 0, 1 for a = 1, 0, 2 respectively, according to (2).
Hence the theorem is true for this case, according to Theorem 1.
Case 2 Let only two of the a, b, c be equal, e.g. a = b 6= c 6= a. Then (4) can be
written as
f = xa1 (P11 ⊕ . . . ⊕ P1q ⊕ P21 ⊕ . . . ⊕ P2r ) ⊕ xc1 (P31 ⊕ . . . ⊕ P3s )
(6)
Equation (6) is an exact expression of f and f = xa1 f i ⊕xc1 f j with i, j ∈ [0, 1, 2]
according to (2). Hence w(f ) = q + r + s and w(f i ) = q + r, w(f j ) = s, since
if there was an exact solution for f i , f j with w(f i ) < q + r or w(f j ) < s then
there would be an expression of f (according to (2)) with weight w(f ) < q+r+s
which contradicts our assumption that w(f ) = q + r + s. Hence the theorem
is true for this case.
Case 3 Let a 6= b 6= c 6= a. Since we have assumed that w(f ) < 6, at least one of
q, r, s is 1, say s = 1. Then (4) can be written as
f
= xai (P11 ⊕ . . . ⊕ P1q )
⊕xbi (P21 ⊕ . . . ⊕ P2r ) ⊕ xci P31
(7)
or
= xa1 (P11 ⊕ . . . ⊕ P1q ⊕ P31 )
f
⊕xb1 (P21 ⊕ . . . ⊕ P2r ⊕ P31 )
(8)
or f = xa1 f i ⊕ xb1 f j with i, j = 0, 1, 2 and
fi
= P11 ⊕ . . . ⊕ P1q ⊕ P31
(9)
j
= P21 ⊕ . . . ⊕ P2r ⊕ P31
(10)
f
Since w(f ) = q + r + 1 ≤ w(f i ) + w(f j ), there are according to (9) and (10)
the following subcases.
Subcase 1 w(f i ) = q + 1 and w(f j ) = r + 1
Subcase 2 w(f i ) = q + 1 and w(f j ) = r
Subcase 3 w(f i ) = q and w(f j ) = r + 1
In subcase 1, expression (9) is an exact expression of the subfunction f i and
expression (10) is an exact expression of the subfunction f j . Hence two of the
exact expressions of the subfunctions f i and f j of f have a common product
term. Since all exact expressions of f i and f j are assumed known, we can
identify the exact expressions (6) and (10) and produce expression (7) from
these expressions.
Exact minimization of ESOP expressions with less than eight product terms
In subcases 2 and 3, one of the expressions (9), (10) of the subfunctions f i ,
f j respectively, will be an exact expression, e.g. (9) for f i . Since all exact
expressions of f i are known, then all their product terms are known. Forming
for each such product term P31 the function ϕ = P31 ⊕ f j and using (10) for
f j we obtain
ϕ = (P21 ⊕ . . . ⊕ P2r ⊕ P31 ) ⊕ P31 = P21 ⊕ . . . ⊕ P2r
(11)
The weight of ϕ according to (11) is w(ϕ) = r. It cannot be less than r since
if it is e.g. w(ϕ) = r − 1 then according to (11) P21 ⊕ . . . ⊕ P2r would have
weight r − 1 and w(f ) would be q + r according to (7). But we have assumed
that w(f ) = q + r + 1. If we can find all exact expressions of ϕ, having weight
r, then for each such expression (11) we shall have an expression (7) for f .
Hence, the theorem is true for this case.
In Case 3, the problem is reduced to finding all the exact expressions of function
ϕ = P31 ⊕ f j . We can easily see that the function ϕ has n − 1 variables (x1 is
missing) i.e. one variable less than the variables of the function f . It is also obvious
that w(ϕ) = r < q + r + 1 = w(f ) < 6.
Consequently the problem is reduced to an equivalent problem of another function with fewer variables and less weight. Recursively we reach an equivalent problem for a function g with fewer variables and weight equal to one. This function g
is a product term function.
Moreover, the depth of the recursion in Case 3 is less than five, because w(f ) <
6 and at each recursion step the weight is reduced by at least one. Hence the
computational cost is not high 2.
Theorem 3. At least one exact expression of a switching function f with weight
less than eight can be obtained from the exact expressions of its subfunctions.
Proof: Every exact expression of f can be written in the form given in (4). The
following three cases exist.
Case 1 a = b = c. Then the proof follows that of Case 1 of Theorem 2.
Case 2 Only two of the a, b, c are equal. Then the proof follows that of Case 2 of
Theorem 2.
Case 3 a 6= b 6= c 6= a. Then (4) can be written as:
f = xa1 (P11 ⊕. . .⊕P1q ⊕P31 ⊕. . .⊕P3s )⊕xb1 (P21 ⊕. . .⊕P2r ⊕P31 ⊕. . .⊕P3s ) (12)
The following two functions are formed:
f a = P11 ⊕ . . . ⊕ P1q ⊕ P31 ⊕ . . . ⊕ P3s
(13)
S. Stergiou & G. Papakonstantinou
f b = P21 ⊕ . . . ⊕ P2r ⊕ P31 ⊕ . . . ⊕ P3s
a
(14)
b
Without loss of generality, w(f ) ≥ w(f ) and q ≥ r ≥ s can be assumed.
Hence, since w(f ) < 8, s ≤ 2, w(f a ) ≤ 6 and w(f b ) ≤ 4. Let g a ,g b be
exact expressions of functions f a ,f b respectively. According to the weights
w(f a ), w(f b ), the following four subcases exist.
Subcase 1 w(f a ) + w(f b ) = w(f ). Then an exact expression of f is obtained
from functions g a , g b in the form:
f = xa1 g a ⊕ xb1 g b
(15)
Subcase 2 w(f a ) + w(f b ) = w(f ) + 1 and w(f a ) = 6. Since q + r + s < 8
and w(f a ) = 6 ≤ q + s, then s = 1 and both (13) and (14) are exact
expressions of f a ,f b respectively.
All exact expressions of function f b can be obtained with the help of
Theorem 2. For every product term p of function g b , a new function g =
g a ⊕ p is formed. Also, function g 0 comprises all the product terms of g b
except p. Weight w(g) cannot be less than q since then, w(f ) < q + r + s,
which cannot hold because (4) is an exact expression for function f .
At least one of the new functions g will have w(g) = q, because at least
one of the product terms p will be P31 . In this case, w(g) = w(P11 ⊕· · ·⊕
P1q ⊕ P31 ⊕ P31 ) = q and an exact expression is obtained for function f
in the form:
f = xa g ⊕ xb g 0 ⊕ xc p
(16)
Subcase 3 w(f a ) + w(f b ) = w(f ) + 1 and w(f a ) ≤ 5. According to Theorem
2, all exact expressions of functions f a ,f b can be obtained, since w(f a ) <
6 and w(f b ) < 6.
[a] Let s = 1. Then both (13) and (14) are exact expressions for
f a ,f b respectively. An exact expression for function f in the form of
(12) is then obtained by detecting the common product term P31 in the
functions g a ,g b .
[b] Let s = 2. Then one of the equations (13), (14) is an exact expression for functions f a ,f b respectively, since otherwise w(f a )+w(f b ) =
w(f ). Without loss of generality, let (13) be an exact expression for
function f a . Let p1 ,p2 be two product terms from function g a . A new
function g = g b ⊕ p1 ⊕ p2 is then formed. Also, function g 0 comprises all
the product terms of function g a except p1 , p2 .
Weight w(g) cannot be less than r, since then w(f ) < q + r + s which
cannot hold since (4) is an exact expression of function f . At least one
of the new functions g will have w(g) = r, because at least one product
term pair p1 , p2 will be equal to P31 , P32 . Then an exact expression is
obtained for function f in the form:
f = xa g 0 ⊕ xb g ⊕ xc (p1 ⊕ p2 )
(17)
Exact minimization of ESOP expressions with less than eight product terms
Subcase 4 w(f a ) + w(f b ) = w(f ) + 2. Then equations (13), (14) are exact
expressions for functions f a ,f b respectively. Since s ≤ 2, then w(f a ) < 6,
hence all exact expressions of functions f a ,f b can be obtained with the
help of Theorem 2. An exact expression for function f in the form of (4)
is then obtained by detecting the two common product terms P31 ,P32 in
functions g a ,g b .
For all possible w(f a ), w(f b ), at least one exact expression is obtained for f .
Hence the theorem is proved.
As in Theorem 2, the exact expressions of a function with less variables and less
weight have to be obtained. Since the weight of the newly formed function g in
Case 3, Subcases 2 and 3b cannot be more than five if an exact expression for f is
to be obtained from it, the exact expressions of g can be obtained with the help of
Theorem 2 2.
Corollary 1. The exact expressions of a switching function f in which a variable
xi exists in only one of its three forms xi , xi , 1, are directly obtained from one of its
non–zero subfunctions.
Proof: Case 1 of Theorems 2 and 3 2.
Corollary 2. The exact expressions of a switching function f in which a variable
xi exists in only two of its three forms xi , xi , 1, are directly obtained from two of
its subfunctions.
Proof: Case 2 of Theorem 2. Case 2 and Case 3, Subcase 1 of Theorem 3 2.
Corollary 3. The exact expressions in which a variable xi exists in all three forms
xi , xi , 1, are obtained from pairs of its subfunctions f i , f j such that w(f i )+w(f j ) =
w(f ) + k and k common product terms exist in pairs of their exact expressions.
Proof: Case 3, Subcase 1 of Theorem 2. Case 3, Subcases 3a, 4 of Theorem 3 2.
Corollary 4. The exact expressions in which a variable xi exists in all three forms
xi , xi , 1 are obtained considering pairs of subfunctions f i , f j such that operation
recursive combine on f i , f j , as defined in the next section, produces an exact expression.
Proof: Case 3, Subcases 2 and 3 of Theorem 2. Case 3, Subcases 2 and 3b of
Theorem 3 2.
S. Stergiou & G. Papakonstantinou
4. Algorithm Outline
Based on the above theorems, an algorithm was designed and implemented that
finds the minimal modulo-2 sum of products of any function with a number of
product terms less than eight.
At first, subfunctions f 0 , f 1 , f 2 are generated from the given function. For each
subfunction, its corresponding subfunctions are recursively generated, essentially
forming a rooted ternary tree, called the generation tree, where every node’s children
are its subfunctions. The recursion ends when a subfunction is either 0 or 1. This
decomposition is performed according to a variable ordering x1 , x2 , . . . , xn , hence
the i-th level from the root comprises functions of variables xi+1 , xi+2 , . . . , xn .
Each function is represented as a bit vector where each bit declares the presence
or the absence of a specific minterm. This very redundant representation requires
an exponential, relatively to the number of variables, number of bits but has some
interesting properties. For an n-bit vector, the n2 most significant bits represent f 1
and the rest represent f 0 . f 2 can easily be generated by f 1 ⊕ f 0 .
→
Similarly, when we wish to calculate xi f with the n-bit vector −
v of f given, we
create a 2n-bit vector with the n most significant bits zeroed and the rest equal to
−
→
→
v when i = 0, the n least significant bits zeroed and the rest equal to −
v when
−
→
i = 1, and both n-bit groups equal to v when i = 2.
Starting from the leaves, all exact expressions of each node are created. When
a child is zero, the exact expressions are generated from the non-zero child, simply
by multiplying with the corresponding level variable. This step is named Simple
Combine and corresponds to Corollary 1. It is depicted in Algorithm 1.
When all three children are non-zero, then the following two processing steps
take place.
Complex Combine Let two subfunctions f i , f j , with k i , k j minimum ESOPs respectively. Let el , em be two expressions from these k i , k j minimum ESOPs.
A new ESOP e is created with the terms of el multiplied by xi and the terms of
em multiplied by xj . Each common product term p of el , em is excluded from
the above calculation and xn p is added to e. It is known that i, j, n ∈ [0, 1, 2]
and i 6= j 6= n 6= i.
This processing step is named Complex Combine and corresponds to Corollaries 2 and 3. It is applied three times, for subfunction pairs (f 1 , f 0 ), (f 1 , f 2 ),
(f 0 , f 2 ) and is depicted in Algorithm 2.
Recursive Combine Let two subfunctions f i , f j and em an exact expression for
f i . For every function g1 formed from 1 or 2 product terms of em , all exact
expressions for function g = g1 ⊕ f j are calculated. If w(g) + w(f i ) = W (f ),
where W (f ) is the weight of f as found up until that moment, then a number
of k new ESOPs hl are generated for f , where k is the number of minimum
ESOPs in g.
Exact minimization of ESOP expressions with less than eight product terms
Each hl contains the product terms of em (excluding term p) multiplied by
xi , function g1 multiplied by xn and the product terms of the l-th ESOP of g
multiplied by xj . It is known that i, j, n ∈ [0, 1, 2] and i 6= j 6= n 6= i.
This processing step is named Recursive Combine and corresponds to Corollary 4. It is applied six times for subfunction pairs (f 1 , f 0 ), (f 0 , f 1 ), (f 1 , f 2 ),
(f 2 , f 1 ), (f 0 , f 2 ), (f 2 , f 0 ) and is depicted in Algorithm 3.
The implied recursion is indirect, since the operation Recursive Combine requires the exact expressions of function g, the calculation of which may require
the operation Recursive Combine.
Only cases which, according to Theorems 2 and 3, can produce exact expressions are evaluated. These cases for a subfunction pair (f a , f b ) and weight
pair (w(f a ), w(f b )) are given below. Moreover, only for the weight pairs (5, 3),
(4, 4), (4, 3) need the subfunction g1 consist of 2 product terms.
1. w(f a ) + w(f b ) = 8: Only weight pairs (5, 3), (4, 4) are examined.
2. w(f a ) + w(f b ) = 7: Only weight pairs (6, 2), (4, 3) are examined.
3. w(f a ) + w(f b ) = 5: Only weight pairs (4, 1), (3, 2) are examined.
4. w(f a ) + w(f b ) = 4: Only weight pairs (3, 1), (2, 2) are examined.
For each of the generated ESOPs e, the following 3 cases exist. If the number
of product terms of e (W1 ) is smaller than the weight of f , as found up until that
moment (W2 ), then all product terms already generated for f , are discarded and e
is added. If W1 is larger that W2 then e is discarded. Finally, if W1 = W2 then e is
added to the list of exact ESOPs for f .
The proposed algorithm is outlined in Algorithm 4. Its implementation is available upon request.
5. Experimental Results
A number of random functions were automatically generated in order to test the
efficiency of the algorithm. Two different function sets were generated in order to
test the execution times for minimizing functions with weight up to five, and up to
seven.
For a variable count n ∈ [5..20] and a minterm count m ∈ [5..mi ], ci random
functions were generated, where m1 = 10, m2 = 15, c1 = 250, c2 = 10 and i ∈ [1, 2].
Let these functions be fi (n, m, l). For each fi (n, m, l), the time to compute its
minimum ESOPs was obtained, under an AMD Athlon 900MHz Linux Box with
768MB RAM.
Let t[fi (n, m, l)] denote the time measured in the previous step. For each funcPci
t[fi (n, m, l)] was obtained. The results
tion group containing ci functions, c1i l=1
are presented in Figures 1 and 2. The measured memory requirements of the algorithm are insignificant for the provided results and mainly correspond to the
S. Stergiou & G. Papakonstantinou
minterm formulation adopted. The memory utilized was less than 4MB in the
worst case.
Comparing the performance with that of another approach for exact ESOP
minimization8 , the results obtained are clearly superior. In Ref. 8, on an HP
9000 Model 720 with 64MB of memory, functions with n = 8 and m = 3, 4, 5
require about 110, 700 and 1400 seconds to compute while functions with n = 9
and m = 3, 4 require 790 and 3600 seconds respectively.
In Ref. 4, exact ESOPs are obtained for n = 8 and m = 11, but the exactness
is proved by a comparison with a lower bound estimation and the method does not
guarantee minimality.
To the best of our knowledge, no published results of exact ESOPs for switching
functions with more than nine variables exist.
3
5 MinTerms
6 MinTerms
7 MinTerms
8 MinTerms
9 MinTerms
10 MinTerms
2.5
secs
2
1.5
1
0.5
0
4
6
8
10
12
Variables
14
16
18
20
Fig. 1. Mean execution time relative to the number of variables and minterms, for functions with
up to five product terms
6. Conclusion
In this correspondence, some theorems have been proved from which at least one
exact ESOP of a switching function f is obtained, provided that the number of
product terms in the exact expression is less than eight. Otherwise, a near-optimal
expression is obtained. An algorithm is then proposed that verifies the theoretical
results. From the experimental results it is concluded that the algorithm is very
Exact minimization of ESOP expressions with less than eight product terms
efficient even for a function with relatively many variables.
5 MinTerms
3
6 MinTerms
3
Minimum
Mean
Maximum
2.5
2.5
1
secs
2
1.5
secs
secs
2
1.5
1
0.5
0
0.5
-0.5
0
4
6
8
10
12
14
16
18
20
4
6
8
10
8 MinTerms
14
16
18
20
4
20
15
60
25
50
20
40
10
5
0
10
-5
12
14
Variables
16
18
20
6
8
10
25
20
15
10
5
0
4
6
8
10
16
18
20
12
14
Variables
16
18
100
90
80
70
60
50
40
30
20
10
0
-10
6
20
20
8
10
12
14
Variables
16
18
20
16
18
20
Minimum
Mean
Maximum
60
50
40
30
20
10
0
-10
4
6
8
10
12
14
Variables
16
18
20
4
6
8
10
12
14
Variables
15 MinTerms
45
Minimum
Mean
Maximum
secs
180
160
140
120
18
13 MinTerms
70
Minimum
Mean
Maximum
14 MinTerms
200
secs
4
secs
secs
40
35
30
12
14
Variables
12 MinTerms
Minimum
Mean
Maximum
16
-5
4
11 MinTerms
50
45
14
0
0
10
12
15
5
8
10
Minimum
Mean
Maximum
30
20
10
6
8
10 MinTerms
35
30
4
6
Variables
Minimum
Mean
Maximum
70
secs
secs
20
15
10
9 MinTerms
80
25
secs
12
secs
30
35
30
25
Variables
Minimum
Mean
Maximum
35
Minimum
Mean
Maximum
5
0
-5
Variables
40
7 MinTerms
45
40
Minimum
Mean
Maximum
100
80
60
40
20
0
Minimum
Mean
Maximum
40
35
30
25
20
15
10
5
0
-5
4
6
8
10
12
14
Variables
16
18
20
4
6
8
10
12
14
Variables
16
18
20
Fig. 2. Minimum, mean and maximum execution time relative to the number of variables, for
functions with up to seven product terms
S. Stergiou & G. Papakonstantinou
7. Algorithms
Algorithm 1: simple combine(func fi , func f , int j)
begin
for esops e in fi do
n = new esop for f
for terms t in e do
add new term tn = t · xj in n
endfor
endfor
end
Algorithm 2: complex combine(func fi , func fj , func f , int k, int m)
begin
for esops ci in fi do
for esops cj in fj do
n = new esop for f
for terms t in ei do
add new term tn = t · xk in n
endfor
for terms t in ej do
if t · xk is already in n then
replace term t · xk with tn = t · (xk ⊕ xm )
else
add new term tn = t · xm in n
endif
endfor
endfor
endfor
end
Exact minimization of ESOP expressions with less than eight product terms
Algorithm 3: recursive combine(func fi , func fj , func f , int k, int m, int w)
begin
if an ESOP with weight less than w can be generated then
v = number of variables in f
for esops ei in fi do
for functions s consisting of 1 or 2 terms from ei do
fn = s ⊕ fj
g = find minimum(fn , v − 1)
weight = g.weight + fi .weight
if (weight = f.weight) then
for esops eg in g do
n = new esop for f
for terms ti in fi not in s do
add term tn = ti · xk in n
endfor
for terms te in eg do
add term tn = te · xm
endfor
xs = xk ⊕ xm
for terms ts in s do
add term tn = ts · xs in n
endfor
endfor
endif
endfor
endfor
endif
end
S. Stergiou & G. Papakonstantinou
Algorithm 4: find minimum(func f , int n)
begin
generate f1 , f0 , f2
if f1 = 0 then
if f0 = 1 then
add new ESOP to f with a single term p = f0 multiplied by x
else
find minimum(f0 , n − 1)
simple combine(f0 , f, 0)
endif
else if f0 = 0 then
if f1 = 1 then
add new ESOP to f with a single term p = f1 multiplied by x
else
find minimum(f1 , n − 1)
simple combine(f1 , f, 1)
endif
else if f2 = 0 then
if f1 = 1 then
add new ESOP to f with a single term p = f1
else
find minimum(f1 , n − 1)
simple combine(f1 , f, 2)
endif
else
find minimum(f1 , n − 1)
find minimum(f0 , n − 1)
find minimum(f2 , n − 1)
complex combine(f1 , f0 , f, 1, 0)
complex combine(f1 , f2 , f, 2, 0)
complex combine(f0 , f2 , f, 2, 1)
weight = min(f1 .wgt + f0 .wgt, f1 .wgt + f2 .wgt, f0 .wgt + f2 .wgt)
recursive
recursive
recursive
recursive
recursive
recursive
endif
end
combine(f1 , f0 , f, 1, 0, weight)
combine(f1 , f2 , f, 2, 0, weight)
combine(f0 , f2 , f, 2, 1, weight)
combine(f0 , f1 , f, 0, 1, weight)
combine(f2 , f1 , f, 0, 2, weight)
combine(f2 , f0 , f, 1, 2, weight)
Exact minimization of ESOP expressions with less than eight product terms
Acknowledgments
The authors would like to thank an anonymous referee for helping minimizing the
proof of Theorem 1.
References
1. Tsutomu Sasao, “EXMIN2: A simplification algorithm for exclusive-OR sum-ofproducts expressions for multiple-valued input two-valued output functions”, IEEE
Trans. on Computer-Aided Design of Integrated Circuits and Systems 27 (1993) 621–
632.
2. Ning Song and Marek Perkowski, “Minimization Of Exclusive Sum Of Products Expressions For Multiple-Valued Input Incompletely Specified Functions”, IEEE Trans.
on Computer Aided Design of Circuits and Systems 15 (1996) 385–395.
3. Alan Mishchenko and Marek Perkowski, “Fast Heuristic Minimization of ExclusiveSums-of-Products”, in Proc. 5th International Workshop on Applications of the Reed
Muller Expansion in Circuit Design, August 2001.
4. Bernd Steinbach and Alan Mishchenko, “SNF: A Special Normal Form for ESOPs”,
in Proc. 5th International Workshop on Applications of the Reed Muller Expansion in
Circuit Design, August 2001.
5. George Papakonstantinou, “Minimization of Modulo-2 Sum of Products”, IEEE Trans.
on Computers 28 (1979) 163–167.
6. George Papakonstantinou, “Minimal modulo-2 expressions of switching functions with
five variables”, International Journal of Electronics 50 (1981) 211-214.
7. Tsutomu Sasao, “An exact minimization of AND-EXOR expressions using BDDs”, in
Proc. of IFIP WG 10.5 Workshop on Applications of the Reed-Muller Expansion in
Circuit Design, 1993, 91–98.
8. Tsutomu Sasao, “An exact minimization of AND-EXOR expressions using reduced
covering functions”, in Proc. of the Synthesis and Simulation Meeting and International
Interchange, October 1993, 374–383.
9. M. Perkowski and M. Chrzanowska-Jeske, “An exact algorithm to minimize mixed-radix
exclusive sums of products for incompetely specified Boolean functions”, in ISCAS,
1990, 1652–1655.
10. A. Mukhopadhyay and G. Schmitz, “Minimization of exclusive OR and logical equivalence of switching circuits”, IEEE TC C–19 (1970) 132–140.
11. G. Bioul, M. Davio and J. P. Deschamps, “Minimization of ring-sum expansions of
Boolean functions””, Philips Res. Rep. 28, (1973) 17–36.
12. N. Koda and T. Sasao, “Four-variable AND-EXOR minimum exressions and their properties”, in System Computer of Japan (U.S.A.), 23 (1992) 27–41.
13. Tsutomu Sasao, “Switching Theory for Logic Synthesis”, Kluwer Academic Publishers,
1999.