INTEGRATION, the VLSI journal 45 (2012) 197–204
Contents lists available at SciVerse ScienceDirect
INTEGRATION, the VLSI journal journal homepage: www.elsevier.com/locate/vlsi
Exact ESOP expressions for incompletely specified functions M. Sampson n, M. Kalathas, D. Voudouris, G. Papakonstantinou Computer Science Laboratory, School of Electrical and Computer Engineering, National Technical University of Athens, Greece
a r t i c l e i n f o
abstract
Article history: Received 29 April 2010 Received in revised form 13 October 2011 Accepted 14 October 2011 Available online 28 October 2011
In this paper, a method for finding an exact ESOP expression for an incompletely specified arbitrary boolean function of up to six input variables is proposed. To achieve this, the weight of all 5-variable functions, has been tabulated in a compressed table, which is used extensively in our approach and speeds-up computation time. To the best of our knowledge, this is the first paper dealing with exact solutions of incompletely specified functions. & 2011 Elsevier B.V. All rights reserved.
Keywords: ESOP Minimization Do not cares Six variables
1. Introduction Research on the minimization of logic functions has been lately focused on ESOP (Exclusive or Sum of Products) expressions. Although minimization of ESOP expressions is more difficult than the minimization of respective SOP (Sum of Products) expressions, certain attractive properties of ESOPs can compensate for the increased intricacy. For example, in application domains like arithmetic, telecommunications or error correcting applications, the use of XOR (eXclusive OR) gates may reduce the complexity of logic circuits [1,2]. For an n-variable function, the upper bound in the number of cubes is 29 2n7 , for n 4 6 [3], as opposed to 2n1 for SOPs. Interest in XOR minimization has also increased recently due to their extensive use in reversible and quantum circuits. For those circuits, the XOR gate is the basic building block, since it is inherently reversible and XOR minimization algorithms lead to smaller and more efficient implementations. ESOP expressions have been extensively studied in the past. A variety of algorithms and systematic methods have been proposed for the generation of ESOP expressions for arbitrary, completely specified logic functions. However, most problems rely on incompletely specified functions, which contain do not care terms. The mapping of incompletely specified functions, of one or multiple outputs, as well as the minimization of the
n
Corresponding author. Tel.: þ306947040464; fax: þ302107721533. E-mail addresses:
[email protected],
[email protected] (M. Sampson),
[email protected] (M. Kalathas),
[email protected] (D. Voudouris),
[email protected] (G. Papakonstantinou). 0167-9260/$ - see front matter & 2011 Elsevier B.V. All rights reserved. doi:10.1016/j.vlsi.2011.10.001
respective ESOP expressions remain open research. The existence of do not care terms increases the difficulty and complexity of the problem and, currently, only heuristic algorithms exist at this moment for minimization of these functions. Efforts to represent incompletely specified functions in compact form, using different categories of decision diagrams, can be found in the literature. In [7], Ordered Ternary Decision Diagrams (OTDD) are described and used to represent such functions, while in [8] several categories of decision diagrams, including Kronecker Decision Diagrams (KDD), which may represent incompletely specified functions, are introduced. In the present paper we do not use decision diagrams at all. Moreover, the above papers cannot guarantee minimality, as opposed to this paper. Apart from decision diagrams, other ways for ESOP minimization of incompletely specified functions are also present in the literature. Perkowski and Chrzanowska-Jeske [9] describe a minimization algorithm, based on Helliwell’s decision function for even/odd covering problems, stating that it is very time consuming. No experimental results to be compared with are available. MINT [10] and EXORCISM-MV-2 [6] are heuristic ESOP minimization algorithms, based on cube transformation rules, and hence they also cannot guarantee minimality. Simple rewrite rules and simulated annealing are used by Parilla et al. [11] to construct a non-deterministic heuristic minimizer which cannot guarantee minimality. In another work [12], a cube transformation operation has been used, to construct the non-deterministic heuristic algorithm QuickDCMIN. A constant number of cubes is selected in each step, forming a new function which, in turn, is decomposed into its subfunctions. We stress that the aforementioned heuristic algorithms differ from the approach used in this work in the sense
198
M. Sampson et al. / INTEGRATION, the VLSI journal 45 (2012) 197–204
that they do not produce exact expressions (i.e. expressions with the minimum number of product terms). A method has been proposed in [13], for finding almost minimal ESCT (Exclusive-or Sum of Complex Terms) expressions (a superset of ESOP expressions) for arbitrary, incompletely specified functions. This method is based on Boolean decompositions and heuristic pruning techniques. Nevertheless, it does not guarantee the minimality of the produced expressions and it mainly concerns a different class of problems, i.e. ESCT expressions. Concluding, all the above methods, dealing with incompletely specified functions, are heuristic and they cannot guarantee minimality as it is the case in this work. In this paper we propose a method for finding an exact ESOP expression, for an incompletely specified arbitrary boolean function f, of up to six input variables. To the best of our knowledge, this is the first paper dealing with this problem. The state of the art, for exact ESOP minimization algorithms, only deals with completely specified random functions of at most six input variables [3,4]. As far as symmetric functions are concerned, there are ESOP minimization algorithms [5] that minimize completely specified functions with seven input variables requiring, in some cases, weeks of computation time. In this work, the weight of all 5-variable functions has been tabulated in a compressed table, in order to speed-up the computation time. The current methods in the literature either utilize weight tabulation of all 4-variable functions [4] or use equivalent classes [3]. All these methods are slower than the used tabulation method in our work. Hence, all other proposed methods for ESOP minimization can benefit from our approach. The rest of this work is organized as follows: In Section 2, a theoretical background is given. In Section 3, the general motivation is presented. In Section 4, the tabulation of the weight of all 5-variable functions is described. In Section 5, a method for finding an exact expression of incompletely specified functions is proposed. In Section 6, implementation details as well as the evaluation of the proposed method are described. In Section 7, the conclusion and future work are discussed.
Definition 5. Gn is defined as the set of all functions of n variables. The following definition covers the information representation adopted throughout the theory developed in this paper. Definition 6. The minterm formulation (MT) of a switching function of n variables f is a bitvector of size 2n , where the i-th bit is 1 if the i-th minterm of f is 1 and 0 otherwise (counted from right to left). Example 1. Let f ¼ x1 x2 x3 x1 x4 x2 x4 be a switching function of 4 input variables. Then the minterm formulations of the three cubes of f are [0000 1100 0000 0000], [0000 0000 0101 0101] and [1010 0000 1010 0000], respectively. The cube e.g. x1 x2 x3 has two minterms, x1 x2 x3 x4 and x1 x2 x3 x4 , that is 1010 and 1011 (the 10th and 11th minterm). The minterm formulation of f is [1010 1100 1111 0101], or, more compactly, in hexadecimal form ½acf 5, if we consider x1 as the most significant bit and x4 as the least significant one. The following two definitions introduce a grouping of the minterms in three sets in respect to the output value of the corresponding minterms. This grouping is necessary in order to define the incompletely specified functions and is extensively used in the developed theory. Definition 7. Let f be a binary output incompletely specified function. The set of minterms for which the output value is 1 is defined as the ON-set of f. The set of minterms for which the output value is 0 is defined as the OFF-set of f. The set of do notcare minterms is defined as the DC-set for which the output value may be 0 or 1. The three above defined sets are pairwise disjoint and the union of these sets is the set of all the minterms of f. Example 2. Let f be an incompletely specified function of 3 input variables, with ON-set, OFF-set and DC-set as follows: ON-set ¼ fx1 x2 x3 ,x1 x2 x3 ,x1 x2 x3 ,x1 x2 x3 g ¼ f000; 010,011; 110g ¼ f0; 2,3; 6g
ð1Þ
2. Theoretical background
OFF-set ¼ fx1 x2 x3 ,x1 x2 x3 g ¼ f001; 101g ¼ f1; 5g
ð2Þ
This section covers all the necessary definitions for the proper understanding of the theory developed in the following sections. In this way, the reader can easily recover any references made. The following five definitions are given in order to recall some basic definitions from the area of ESOP minimization.
DC-set ¼ fx1 x2 x3 ,x1 x2 x3 g ¼ f100; 111g ¼ f4; 7g
ð3Þ
Then, f can be any of the following functions in MT formulation: ½01001101, ½01011101, ½11001101, ½11011101
ð4Þ
or
i
Definition 1. A subfunction f , i ¼ 0; 1,2 of a function 0 1 f ðx1 ,x2 , . . . ,xn Þ is defined as f ¼ f ð0,x2 , . . . ,xn Þ, f ¼ f ð1,x2 , . . . ,xn Þ, 2 0 1 f ¼ f f , where means modulo-2 addition. An arbitrary ordering of the input variables x1 ,x2 , . . . ,xn is assumed.
½4d, ½5d, ½cd, ½dd
ð5Þ
in hexadecimal format, for all possible combinations of the DCs.
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 8. For a function f, we denote f on as the function that is composed only by the minterms of f’s ON-set. f DC is composed only by the minterms of f’s DC-set, if they are considered as ONset for the f DC .
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.
Example 3. For the function in Example 2 f ON ¼[01001101] ¼[4d] and f DC ¼[10010000] ¼[90].
Definition 4. An exact ESOP expression 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.
The following three definitions are important, since they introduce some new quantities which are necessary for the description of the methodology in Section 5 and for understanding the proposed algorithms.
We also recall here some basic formulas. 0 1 f ¼ x1 f x1 f Shannon expansion 0 2 f ¼ f x1 f Positive Davio expansion 1 2 f ¼ f x1 f Negative Davio expansion
Definition 9. The reduced function red(f) of a given incompletely specified or completely specified function f, is the function we obtain if we omit, in the MT representation, all the bits corresponding to the minterms of a DC set.
M. Sampson et al. / INTEGRATION, the VLSI journal 45 (2012) 197–204
Table 1 RT DC table for the function of Example 2.
0
2
1
2
199
wðf gÞ þ wðf gÞ þ wðgÞ or
redðf Þ
Weight w
wðf gÞ þ wðf gÞ þ wðgÞ
[000000] ^ [101101] ^
0 ^ 2 ^
is minimum for all functions g and hence find an exact ESOP expression for f. The aforementioned approaches in the bibliography differentiate in the techniques they use in order to reduce the excessive computation time.
ð7Þ
Algorithm 1. Create the table RT for all functions f A G5 . begin /*Initialize the entire table to zero*/
Table 2 RT table for the function of Example 2. Function f
Weight w
[00]¼ [00000000] ^ [4d] ¼ [01001101] ^ [5d] ¼ [01011101] ^ [cd] ¼[11001101] ^ [dd]¼ [11011101] ^
0 ^ 3 ^ 2 ^ 2 ^ 2 ^
for f ¼ 1 to 232 1 do RTðf Þ ¼ 0; endfor
We note that if f is an incompletely specified function, the DC set of the previous definition is identical to the DC-set of f. Example 4. For the function in Example 2 the red(f) is red(f)¼ [101101]¼[2d]. Definition 10. The reduced table of the incompletely specified functions f : f A Gn with the same DC-set DC, RT DC , is defined as the table for which RT DC ðredðf ÞÞ ¼ minðwðf ÞÞ, for all f with the same red(f). Example 5. The reduced table for the DC-set of the function in Example 2 is given in Table 1. We can see that table RT DC has weight 2 for the function red(f). This is true, according to Definition 9, and Table 2, which gives the weight of functions of 3 input variables, since 2 is the smallest weight for all possible functions ([4d], [5d], [cd], [dd]) with the same red(f). Definition 11. The representative function repðf Þ of an incompletely specified or a completely specified function, is the one(s), among all functions f with the same reduced function, with weight wðf Þ ¼ RT DC ðredðf ÞÞ.
for all product terms p (total number of 35 1 product terms) do RTðpÞ ¼ 1; endfor /*The following loop gradually allocates the weight for each function. Initially only product terms have weight 1.*/ for i ¼ 2 to 8 do for each f of table RT, for which f a0 and RTðf Þ ¼ i1 do for each product term p do /*The following XOR-sum corresponds to a function. If this function has a weight entry 0 it means that it is not a product term and thus has weight equal to i or 1 for the case of 8.*/ if RTðf pÞ ¼ 0 then RTðf pÞ ¼ ðio 8?i : 1Þ; exit; endif endfor endfor endfor end Algorithm 2. Create table RT DC . begin set each element of RT DC to the value 9; for each function f A G5 do if RT DC ðredðf ÞÞ 4RTðf Þ then RT DC ðredðf ÞÞ ¼ RTðf Þ; exit; endif endfor end
Again, if f is incompletely specified, the DC set of the previous definition is identical to the DC-set of f. Example 6. According to Definition 11, the representative function repðf Þ, for the function in Example 2, can be any one of the functions [5d], [cd] and [dd] with weight w ¼ 2.
Our motivation was to use the same approach as described previously, taking into account that we examine incompletely specified functions. The following techniques are used in order to reduce the computation time, taking into account that we deal with incompletely specified functions.
3. General idea Most minimization algorithms e.g. [3–5] are based on the following obvious relations: 0
1
0
2
f ¼ x1 ðf gÞ x1 ðf gÞ g ¼ ðf gÞ x1 ðf gÞ 1
2
x1 g ¼ ðf gÞ x1 ðf gÞ x1 g n
n1
0
1
ð6Þ
2
and f ,f ,f are the subfunctions of f. If we where f A G , g A G consider all possible functions g and find the weights for 0 1 2 g,f g,f g,f g, then we can find a g such that 0
1
wðf gÞ þ wðf gÞ þwðgÞ or
1. The tabulation of the weights of all functions, of five variables, in a compact table RT (Reduced Table), that requires minimum memory space. 2. The creation of another table RT DC (Reduced Table for a given DC-Set).
4. Tabulation of the weight for all 5 input variable functions 5
The number of 5-variable Boolean functions is 22 ¼ 4294967296 and their weight is w r 9 [3]. Hence, 4 Gbytes of memory are
200
M. Sampson et al. / INTEGRATION, the VLSI journal 45 (2012) 197–204
required in order to store a table T containing their weights. In order to reduce this required space, we have created a table RT, which uses only 3 bits for the weight of each function. Hence, the total required space for RT is 4294967296 3=8 ¼ 1610612736 bytes. The problem is that we have to represent the weights w,0 r wr 9 using only 3 bits. Obviously, the weight w ¼ 0 is true only for the function f ¼ 0. Therefore, we can use value 0 to denote weight 9. Moreover, if we decide to store the weights 1 and 8 as the 1 value, then we need to represent exactly eight different weights, which can be done with 3 bits. The only remaining issue is to differentiate between weights 1 and 8. This can easily be accomplished, since we can use the following Algorithm 3 to find out if a function is a product term, which means that it has weight w ¼ 1. Algorithm 3. Find if a function f has weight w ¼ 1 or 8. begin g¼f; w¼1; for i¼1 to 4 do if g 1 ¼ 0 then g ¼ g0 ; endif else if g 0 ¼ 0 then g ¼ g1; else if g 1 ¼ g 0 then g ¼ g1; endif else w ¼ 8; exit; endif exit; endfor exit; end
In order to create the table RT, we have to execute Algorithm 1. Finally, to find the weight w of a function, using the table RT, we have to use Algorithm 4.
a small reduction in finding the weight, will drastically reduce the overall computation time. Our proposed tabulation method is practically a direct access look-up table and can easily be incorporated in all other known minimization algorithms in order to enhance their performance.
5. Finding an exact expression Let us consider an incompletely specified function of n variables with a given ON-set, OFF-set and DC-set. Definition 12. F is defined as the set of all possible completely specified functions f A Gn , where we assign all possible combinations of values 0 or 1 to the minterms of the DC-set of an incompletely specified function keeping, in the MT representation of f, all other bits the same as those of the incompletely specified function. Definition 13. An exact expression of an incompletely specified function, is defined as an exact expression of a function f A F, such that wðfÞ rwðf Þ for all f A F. Lemma 1. If h A Gn is a given function, then redðf hÞ, repðf hÞ and RT DC ðredðf hÞÞ, are the same for any f A F and considering the given DC-set. Proof. Lemma 1 is a consequence of Definitions 9–11. Let an ESOP expression of a function f A F be: 1
0
1
begin if f ¼ 0 then w ¼ 0; exit; endif w ¼ RTðf Þ; if w ¼ 0 then w ¼ 9; exit; endif if w ¼ 1 then execute Algorithm 3 to find if w is 1 or 8 endif end
To the best of our knowledge, this is the first attempt to tabulate the weight of all 5-variable functions. Until now, the ESOP minimization algorithms use tables for the weights of all 4-variable functions [4] or use the equivalent classes of 5-variable functions [3]. In the first case, one more level of recursion or iteration has to be executed and in the second case an algorithm has to be executed in order to find the equivalent class of the given 5-variable function. Therefore, both approaches are more time consuming than the one proposed here. Since finding the weight of a 4 or 5 variable function must be used repeatedly in the known minimization algorithms [3–5], it is obvious that even
0
ð8Þ
0
where f h, f h, h are ESOP expressions of n1 variables. In order to find the f with the minimum weight (i.e an exact expression of the incompletely specified function), we have to 1 0 consider all possible f , f and h for all functions f A F and 1 0 n1 hA G , evaluate the weights wðf hÞ, wðf hÞ, wðhÞ and find 1 0 those f , f , h for which 1
Algorithm 4. Find the weight of function f (for n r 5).
1
f ¼ x1 ðf hÞ x1 ðf hÞ h ¼ x1 f x1 f
0
wðf hÞ þwðf hÞ þ wðhÞ
ð9Þ
is minimum. For a given h and a given DC set it holds that, 1
1
wðf hÞ ZRT DC 1 ðredðf hÞÞ and
0
0
wðf hÞ ZRT DC 0 ðredðf hÞÞ
ð10Þ 1
0
according to Definition 10, for any function f ¼ ðx1 f x0 f Þ A F. In Relations (10), DC 1 -set and DC 0 -set are subsets of the DC-set such that DC 1 -set includes all the minterms x1 ,x2 , xn1 of the DCset with xi ¼ xi ,xi for 2 r ir n1 and DC 0 -set includes all the minterms x1 ,x2 , xn1 of the DC-set. Obviously, DC-set ¼ DC 1 S T 1 -set DC 0 -set and DC 1 -set DC 0 -set ¼ |. RT DC 1 ðredðf hÞÞ and 0 RT DC 0 ðredðf hÞÞ are the same for all functions f A F and h is a given function such that h A Gn1 (according to Lemma 1). Hence, the minimum of Expression (9) is the minimum of 1
0
RT DC 1 ðredðf hÞÞ þRT DC 0 ðredðf hÞÞ þ RTðhÞ 1
0
ð11Þ
Since, RT DC 1 ðredðf hÞÞ and RT DC 0 ðredðf hÞÞ are the same for all functions f A F and h given, we can choose f to be a function with zeros, in its MT representation, for all minterms of the corresponding DC-set, i.e. the function whose minterms are those of the ON-set, which is the function f ON . We can now consider all possible functions h A Gn1 and find which one(s) minimizes the
M. Sampson et al. / INTEGRATION, the VLSI journal 45 (2012) 197–204
and RT DC for the example function.
expression: 1 RT DC 1 ðredðf ON
0 hÞÞ þRT DC 0 ðredðf ON
hÞÞþ RTðhÞ
ð12Þ
(Algorithm 5). An exact expression of the initial incompletely specified function (given its ON-set, OFF-set and DC-set), is 1 x1 repðredðf ON
hÞÞ
0 x1 repðredðf ON
hÞÞ h
f1 ¼ repðredðf 1ON hÞÞ ¼ repð00Þ ¼ 0 In the same way, 0
Example 7. Let f be the same function as the one in Example 2. An exact expression of f is f ¼ x1 x2 x3 x3 . Using the previously presented theory we can find it as: 0
0
wðf Þ ¼ RT DC 0 ðredðf ON hÞÞ
ð13Þ
according to Definition 11. The representative functions for a given DC-set, can be stored during the generation of RT DC table (Algorithm 1). &
1
201
¼ RT DC 0 ðredð½1101 ½0101ÞÞ ¼ RT DC 0 ðredð½1000ÞÞ ¼ RTð½1000Þ ¼ 1
and
f0 ¼ repðredðf 0ON hÞÞ ¼ repð½1000Þ ¼ x2 x3 Hence, 1
0
f ¼ x1 f x1 f h
wðf Þ ¼ wðf Þ þwðf Þ þwðhÞ ¼ 0 þ1 þ 1 ¼ 2
we have
and an exact solution is
1 f ON
f ¼ x1 0 x1 x2 x3 x3
¼ ½0100 ¼ ½4
0
f ON ¼ ½1101 ¼ ½d DC 1 -set ¼ fx2 x3 ,x2 x3 g ¼ ½1001 ¼ ½9 DC 0 -set ¼ fg ¼ ½0000 ¼ ½0 Examining exhaustively all 2-variable functions h, we shall examine the function h ¼ x3 ¼ ½0101 ¼ ½5. For h ¼ x3 : 1
1
wðf Þ ¼ RT DC 1 ðredðf ON hÞÞ ¼ RT DC 1 ðredð½0100 ½0101ÞÞ ¼ RT DC 1 redð½0001Þ ¼ RT DC 1 ð½00Þ ¼ 0 (where we remove bits 0,3 since they correspond to DC minterms) according to Tables 3 and 4. These tables are the corresponding RT
Table 3 RT table for the function of Example 7. f
w
Expression
0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
0 1 1 1 1 1 2 2 1 2 1 2 1 2 2 1
0 x2 x3 x2 x3 x2 x2 x3 x3 Not applicable Not applicable x2 x3 Not applicable x3 Not applicable x2 Not applicable Not applicable 1
Table 4 RT 1DC table for the function of Example 7. red(f)
w
repðf Þ
00 01 10 11
0 1 1 1
0 x2 x3 ,x2 ,x3 x2 x3 ,x3 ,x2 1
Algorithm 2 creates the table RT DC for a given DC-set considering all 5-variable functions. Having the table RT DC , we can use any known minimization algorithm in the bibliography (for completely specified functions), in order to find the exact ESOP expression of an incompletely specified function of six variables. However, there are some limitations we have to take into account. For example, we have to use only the Shannon expansion and not the Davio expansions in these algorithms. This is because 1 0 although the DC-sets for f and f are independent, the DC set 2 1 0 for f depends on the ones of f and f , which complicates the algorithm in order to keep track of the do not-care minterms that have been chosen so far in each step. As an example consider Algorithm 3 of [3] or Algorithm min-ESOP of [4] which are similar. They can be transformed for incompletely specified functions of 6 input variables as indicated in Algorithm 5, where RT DC 1 is the 1 reduced table of f A Gn1 with DC 1 -set as DC-set and RT DC 0 is the 0 reduced table of f A Gn1 with DC 0 -set as DC-set. Algorithm 5. Find an exact expression of an incompletely specified function f. begin w ¼ 15; for each h A G5 do 1
0
g 1 ¼ RT DC 1 ðredðf ON hÞÞ; g 0 ¼ RT DC 0 ðredðf ON hÞÞ; g 2 ¼ RTðhÞ; g ¼ g 1 þ g 0 þ g 2 ; if g is less than w then w ¼ g; endif endfor end
It is noted that Algorithm 5 is an exhaustive one which guarantees that an exact expression will be found. However, our method can be combined with other known algorithms of the bibliography for exact minimization, like the min_tauðf Þ of [4]. In this case we have to use only the Shannon expansion (and not the Davio ones). Moreover, the presence of do not care minterms, has the consequence that Lemmas 4,5 of [4] are not valid and, therefore, the upper bounds (see Section 4 of [4]) are not valid. We have chosen to take a looser upper bound, i.e. kðf Þ ¼ minimumð9,s2Þ, where 9 is the maximum weight of any five variable function and s is the current weight of the six variable function to be minimized. Moreover, we stop the recursion to 5-variable functions, where we use RT DC for the weight of
202 1
M. Sampson et al. / INTEGRATION, the VLSI journal 45 (2012) 197–204 0
f h and f h and RT for the weight of h (Expression (11)). This modified algorithm will be called Algorithm 6.
We carried out four kinds of experiments, further explained in the following sections.
Algorithm 6. Find an exact expression of an incompletely specified function modifying min_tauðf Þ.
6.1. Comparison with exact methods for completely specified functions
begin It is the min_tauðf Þ algorithm [4] with the following modifications 1. Use only the Shannon expansion 2. Take as upper bound kðf Þ ¼ minimumð9,s2Þ 3. Stop recursion to 5-variable functions 1
0
4. Use the RT DC 1 , RT DC 0 for the weights of f h and f h, respectively and RT for the weight of h (Expression 11) end
6. Implementation The proposed method has been implemented using an Intel Core 2 Duo T7500 CPU @ 2.20 GHz and 2.00 GB of RAM. The algorithms were implemented in GFORTRAN. Algorithm 1 required about 24 h to create the RT table, but this was done only once. Algorithm 2 requires about 2 h, in order to create both the RT DC 1 and RT DC 0 tables for a given DC-set. Once we have created these tables, we can use them for every function of six input variables with the same DC-set. Algorithm 5 requires about 130 min in order to find an exact expression of an incompletely specified function of six input variables regardless of the number of the do not cares or the weight of the function to be minimized. However, our method can be combined with other known algorithms of the bibliography, like the min_tauðf Þ of [4] as it was explained previously (Algorithm 6). Since there are not, to the best of our knowledge, any published results for exact solutions of incompletely specified functions of six variables, we have to use randomly generated incompletely specified functions, in order to test our method. Hence, we have created 500 randomly generated functions of six variables, with weights between 6 and 10, as indicated in Table 5.
The first experiment was to check the efficiency in computation time, as well as the quality of the results of our approach, when compared to exact methods for completely specified functions. For this purpose we used Algorithm min_tauðf Þ [4], as well as our Algorithms 5, 6 for three different DC-set s, DC 1 -set with 12 minterms, DC 2 -set with 16 minterms and DC 3 with 18 minterms. In Table 6 we can see the results. The set of random function used had a mean weight equal to 8.02. As we can infer from Table 6: 1. Regarding the quality of the results, Algorithms 5 and 6 outperform min_tauðf Þ, as it was expected, because min_tauðf Þ does not take into account the do not care minterms. 2. Regarding computation time, min_tauðf Þ gives better computation times. Moreover, it must be noted that Algorithms 5 and 6 require about 2 h to generate the RT DC tables, (7200) in Table 6. For the minimization of many functions having the same DC-set, this generation has to be done only once.
6.2. Comparison with heuristic methods for incompletely specified functions The second experiment was to compare our approach to heuristic methods for incompletely specified functions, regarding computation time and quality of results. For this purpose, we used Algorithm QuickDCMIN of [12]. In Table 6 we can see that: 1. Regarding quality of the results, Algorithms 5 and 6 outerperform Algorithm QuickDCMIN. 2. Regarding computation time, Algorithms 5 and 6 are worst than Algorithm QuickDCMIN.
6.3. Comparison with exhaustive methods Table 5 Weights of the randomly generated functions. Weight 6 7 8 9 10
Percentage 4 22 44 28 2 100
The third experiment was to compare our approach with exhaustive methods, i.e. with methods for finding exact solutions for completely specified functions, considering all possible combinations of the minterms of the DC-set. If the DC-set has m minterms, then we have to run the program for exact solutions of completely specified functions, 2m times for all possible combinations of do not cares. For this purpose, we used exhaustively min_tauðf Þ, 2m times. We shall call this algorithm ‘‘Exhaustive Algorithm’’. It is noted that due to computation time limitations,
Table 6 Experimental results comparing Algorithms 5 and 6 with Algorithms min_tauðf Þ and Algorithm QuickDCMIN.
Average Average Average Average
weight of functions using the DC 1 -set weight of functions using the DC 2 -set weight of functions using the DC 3 -set computation time in s using the DC 1 -set
Average computation time in s using the DC 2 -set Average computation time in s using the DC 3 -set
Algorithm 5
Algorithm 6
Algorithmmin_tauðf Þ
Algorithm QuickDCMIN
7.2 7.00 6.82 7800 (þ 7200) 7800 (þ 7200) 7800 (þ 7200)
7.2 7.00 6.82 16.43 (þ 7200) 15.11 (þ 7200) 9.70 (þ 7200)
8.02 8.02 8.02 0.017
7.62 7.58 7.49 2.00
0.017
2.00
0.017
2.00
M. Sampson et al. / INTEGRATION, the VLSI journal 45 (2012) 197–204
203
Table 7 Experimental results comparing Algorithms 5 and 6 with the exhaustive algorithm.
Average computation time in s using the DC 1 -set Average computation time in s using the DC 2 -set Average computation time in s using the DC 3 -set
Algorithm 5
Algorithm 6
7800 (þ 7200) 7800 (þ 7200) 7800 (þ 7200)
11.02 (þ 7200) 17.146 (þ 7200) 7.41 (þ 7200)
we used a set of 10 randomly generated functions. In Table 7, we can see that: 1. Regarding quality of results, all algorithms give the same results, since they give exact solutions (not included in Table 7). 2. Regarding computation time, the Exhaustive Algorithm requires prohibitive computation times for a large number of do not care minterms in the DC-set (greater or equal than 16). Computation time, for the Exhaustive Algorithm, increases exponentially with the increase of the number of minterms in the DC-set. We have also observed that in the Exhaustive Algorithm case, computation time increases almost linearly with the weight of the function, for the same DC-set. Hence, even for small weights of functions, the dominating factor is the number of do not care minterms. For this reason, we have chosen the weights of the generated functions to be small, in order to have a fair comparison of the Exhaustive Algorithm with our Algorithms 5 and 6. Algorithm 5 requires constant computation time, regardless of the weights of the functions to be minimized or the number of the do not care minterms. Computation time for Algorithm 6 is independent of the weights of the functions to be minimized or the number of the do not care minterms as we can see from Tables 6 and 7. As we can infer from Table 7, Algorithms 5 and 6 outperform the Exhaustive Algorithm, which practically cannot be applied for a large number of do not care minterms. It is conjectured that the upper bound is lower than the one taken (kðf Þ ¼ minimumð9,s2Þ), which results in a drastic reduction of the computation time. Taking empirically as upper bound 1 0 kðf Þ 5 r kðf Þ ¼ s1g r9 with g ¼ maximumðwðf Þ,wðf ÞÞ, we received the same experimental results, but with a speed up of at least one order of magnitude in the computation time. The overhead for creating the RT DC tables is not included in this comparison. 6.4. Use of Algorithm 6 for more than six variables as a heuristic one As a final experiment, we used Algorithm 6 for functions of more than six input variables, decomposing it using the Shannon expansion (although we could also use the expansions of Davio as well), till the level of six variables. We used Algorithm 6 to evaluate the exact solutions at this level and evaluate the weight at each node of the tree, adding the weights of the subfunctions of the node. For this purpose, we used the benchmark function ‘‘bench’’ [12,6], with six inputs and eight outputs. Its characteristic function [2] as well as the corresponding DC-set are given below: f ON ¼ ½a004000800c000800000204400500000 a801c000000001009000400000020020 000300001005000000000000000e4300 04000800046000140000400808a00400
Exhaustive algorithm 1137.80 25122.20 98632.47
f DC ¼ ½43c321e5dd33bf 6ffffbdd397f 2f 776f 07fa3fad7d3f 68f 76d5ebabfdff 4fbd3 af 7cafb7ebfaf 7ff 4975ebcf 6ff 1bcfb e2fed5bff 90aceaaabfa2d77f 74bf 3eb The weight found with Algorithm 6 and the decomposition was 24. It took about 8 2 ¼ 16 h to create the DC tables at the leaves of the decomposition tree. Algorithms QuickDCMIN [12] and EXORSISM-MV-2 [6] give weights 18 and 24, respectively. Hence, Algorithm 6 gives worst result than QuickDCMIN, but the same result with EXORSISM-MV-2 for this function.
7. Conclusions and future work In this paper we have proposed a method that finds exact solutions for an arbitrary, incompletely specified function. To the best of our knowledge, this is the first attempt to solve the above problem. Although our method is computationally intensive, it is tractable and gives practical solutions. The method can easily be expanded to multi-output functions and serves as a heuristic method for more than six variables. The proposed method is the first that guarantees minimal ESOP expressions for functions of less than seven input variables in reasonable computing time. The method can theoretically be scalable. By knowing the exact solutions for n variables, we can produce the necessary DC tables and find exact solutions for n þ 1 variables, using similar algorithms. Nevertheless, it is not practically possible to produce minimal ESOP expressions for functions with more than six input variables, as that would require huge DC tables and would result to prohibitive computation times and resources. This is an inherent problem for the simpler case of completely specified functions as well, where the state of the art for exact solutions for random completely specified functions is only six and in some cases seven input variables [3–5]. However, this methodology for computing exact ESOP expressions for incompletely specified random functions can be used to measure the quality of the results of other heuristic ESOP minimizers. Moreover, it can provide exact solutions in cases of large numbers of do not care minterms, where the only alternative can be the exhaustive solution for all possible combinations of do not care minterms, using algorithms for completely specified functions, which is practically impossible. We could use our method as a heuristic one for more than six variables in the way shown in Section 6.4, i.e. decomposing the original function as an exclusive or of 6-variable subfunctions and applying our method for each subfunction separately, adding the weights of the subfunctions. In this case, the results are not better than other heuristic methods and therefore we do not suggest this specific use of our method. Our future work aims at extending our approach to produce the Exclusive-or Sum of Complex Terms (ESCT) expressions, as well as developing more efficient algorithms for the RT DC tables generation.
204
M. Sampson et al. / INTEGRATION, the VLSI journal 45 (2012) 197–204
References [1] T. Sasao, P. Besslich, On the complexity of mod-2 sum PLA’s, IEEE Transactions on Computers 39 (2) (1990) 262–266. [2] T. Sasao, Switching Theory for Logic Synthesis, Kluwer Academic Publishers, 1999. [3] A. Gaidukov, Algorithm to derive minimum ESOP for 6-variable function, in: 5th IWBP, September 2002. [4] T. Hirayama, Y Nishitani, T. Sato, A faster algorithm of minimizing AND-EXOR expressions, in: IEICE Transactions on Fundamentals, vol. E85-A, No. 12, December 2002, pp. 2708–2714. [5] T. Hirayama, Y. Nishitani, Exact minimization of AND-EXOR expressions of practical benchmark functions, Journal of Circuits, Systems, and Computers 18 (3) (2009) 465–486. [6] N. Song, M.A. Perkowski, Minimization of exclusive sum-of-products expressions for multiple-valued input, incompletely specified functions, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 15 (4) (1996). [7] G. Jennings, Symbolic incompletely specified functions for correct evaluation in the presence of indeterminate input values, in: Proceedings of the 28th Annual Hawaii International Conference on System Sciences (HICSS’95), 1995. [8] M.A. Perkowski, M. Chrzanowska-Jeske, A. Sarabi, I. Schafer, Multi-level logic synthesis based on Kronecker decision diagrams and Boolean ternary decision diagrams for incompletely specified functions, VLSI Design 3 (3–4) (1995) 301–313. [9] M. Perkowski, M. Chrzanowska-Jeske, An exact algorithm to minimize mixedradix exclusive sums of products for incompletely specified boolean functions, IEEE International Symposium on Circuits and Systems 2 (May) (1990) 1652–1655. [10] T. Kozlowski, E.L. Dagless, J.M. Saul, An enhanced algorithm for the minimization of exclusive-or sum-of-products for incompletely specified functions, in: IEEE International Conference on Computer Design (ICDD’95), 1995, p. 244. [11] L. Parrilla, J. Ortega, A. Lloris, Nondeterministic AND-EXOR minimisation by using rewrite rules and simulated annealing, IEE Proceedings on Computers and Digital Techniques 146 (1) (1999) 1–8. [12] M. Kalathas, D. Voudouris, G. Papakonstantinou, A heuristic algorithm to minimize ESOPs for multiple-output incompletely specified functions, in: 2006 ACM Great Lakes Symposium on VLSI – GLSVLSI 2006, Philadelphia, PA, USA, 30 April–2 May 2006, pp. 357–361. [13] M. Kalathas, D. Voudouris, G. Papakonstantinou, ESCT minimization for incompletely specified functions, Journal of Multiple-Valued Logic and Soft Computing, accepted for publication.
Marinos Sampson received his Diploma in Computer Engineering and Informatics from the University of Patras in 2004. He has also received his PhD diploma in the school of Electrical and Computer Engineering at the National Technical University of Athens where he is currently research associate. His research interests include Quantum Circuits, Logic Synthesis, mapping and minimization of cellular architectures and reversible circuits.
Marios Kalathas received his Diploma in Electrical and Computer Engineering from the National Technical University of Athens in 2001. He also received his PhD in Electrical and Computer Engineering from the National Technical University of Athens in 2011. His research interests include logic synthesis, ESOP minimization, mapping and minimization of cellular architectures, reversible circuits and quantum circuits. More specifically his research deals with minimization algorithms for incompletely specified functions.
Dimitrios Voudouris received his Diploma and PhD in Electrical Engineering from the National Technical University of Athens in 2001. He has also received his PhD diploma in the school of Electrical and Computer Engineering at the National Technical University of Athens. His research interests include Logic Synthesis and more specifically ESOP minimization, mapping and minimization of cellular architectures and reversible circuits.
Dr. George Papakonstantinou received his Diploma in Electrical Engineering from the National Technical University of Athens in 1964, the P.I.I. Diploma in Electronic Engineering from Philips Int. Inst in 1966, and his M.Sc. in Electronic Engineering from N.U.F.F.I.C. Netherlands in 1967. In 1971 he received his Ph.D. in Computer Engineering from the National Technical University of Athens. He has worked as a Research Scientist at the Greek Atomic Energy Commission/Computer Division (19691984) and as Director of the Computer Division at the Greek Atomic Energy Commission (1981-1984). From 1984 till 2009 he served as a Professor of Computer Engineering at the National Technical University of Athens. Currently he is Professor Emeritus at the same University. His current research interests include Knowledge Engineering, Syntactic Pattern Recognition, Logic Design, Embedded Systems, as well as Parallel Architectures and Languages. He has published more than 300 papers in international referred journals and in proceedings of international conferences (more than 1000 citations, h-index:16). He has also published 9 Greek textbooks and contributed 7 chapters in English textbooks, on computer engineering. He has taught several undergraduate and graduate courses at NTUA, supervised many diploma and Ph.D. theses, and has been reviewer in International Journals, Conferences, and research project proposals. He has participated (as project leader or member) in about 25 Greek and European R&D projects.