+ All Categories
Home > Documents > Adaptive exact optimisation of minimally testable FPRM expansions

Adaptive exact optimisation of minimally testable FPRM expansions

Date post: 20-Sep-2016
Category:
Upload: bj
View: 216 times
Download: 2 times
Share this document with a friend
10
Adaptive exact optimisation of minimally testable FPRM expansions C.-H. Chang B.J.Falkowski Indexing terms: Algebraic ternary decision trees, Boolean functions, Optimi,sution, Reed-Muller expansions Abstract: An adaptive method to minimise fixed- polarity Reed-Muller expansions, combining the advantages of efficient data structures in form of both lookup tables and ternary decision trees, is presented. The algorithm developed converts arrays of cubes to exact solutions based on the desired cost criteria for the systems of completely specified functions. The method also allows one to combine the design for testability together with minimisation of hardware realisation. The algorithm shown is fast, efficient and requires smaller space and time complexity than known algorithms. 1 introduction Any Boolean function can be represented in the mod- ulo-2 algebra known in the literature [l-141 as the com- plement-free ring sum or Reed-Muller expansion. For a given boolean function each Reed-Muller expansion is both unique and canonic. The circuits based on exclusive-OR gates are known to be more efficient for some classes of functions. Such situations happen fre- quently for many useful functions applied in arithmetic and telecommunication circuits having a high content of so called linear part (EXOR part of the function). Some of the examples of such functions are adders and parity checkers. What is more, the circuits built around the EXOR gates are easily testable. Fault detection of any logical circuit by verification of its Reed-Muller coefficients was considered in [12]. The AND-EXOR arrays based on the Reed-Muller canonical expansions of boolean functions possess a universal test set of length n + 4 for detecting stuck-at faults, and they can also be tested for bridging faults with a universal test set of length 2n + 4 [15]. The problem of finding optimal Reed-Muller expan- sions with the least number of terms has received much attention among researchers. It can be reformulated in terms of coding or graph theory or solved by means of digital signal processing techniques such as fast trans- 0 IEE, 1998 IEE Proceedings online no. 19982342 Paper first received 7th November 1997 and in revised form 8th July 1998 C.-H. Chang is with the Electronics Design Centre, French-Singapore Institute, Nanyang Polytechnic, 180 Ang MO Kio Ave 8, Singapore 569830 B.J. Falkowski is with the School of Electrical and Electronic Engineer- ing, Nanyang Technological University, Blk S1, Nanyang Avenue, Singa- pore 639798 IEE Proc -Coinput. Digit. Tech., Vol. 145, No. 6, November I998 forms and convolution [3, 61. Nonexhaustive minimisa- tion methods for Reed-Muller expansions based on the extended truth vector were considered in [3, 81. These algorithms have a space complexity of O(3"). In [5], a boolean hypercube structure for minimisation of Reed- Muller expansions has been proposed. This algorithm uses geometrical operations to minimise Reed-Muller expansions and has limitations owing to computational complexity. In general, the computational complexity of the min- imisation problem for Reed-Muller expansions seems unmanageable when the number n of variables is greater or equal to four. This computational complex- ity has led various authors to present heuristic solu- tions to minimisation problems when n 2 4 [3, 161. When the original function is represented in reduced form such as arrays of cubes or decision diagrams, cal- culation of Reed-Muller expansions directly from such representations have also been considered [l, 4, 13, 171. For example, in [13], an exact and quasiminimal algo- rithm based on disjoint cubes has been presented. A total search is necessary to find an optimal expansion. To minimise the number of operations, such a search is performed in Gray-code ordering. This algorithm can handle only a single output completely specified func- tion. Recently, a number of exact and heuristic algorithms to minimise FPRMs have been developed [l, 2, 18-21]. Most of the exact algorithms can minimise functions with around 15 variables. Some heuristic methods can deal with functions of about 100 input variables [18-201 or even a few hundred variables [22-241. A method of finding an optimal Reed-Muller expansion of incom- pletely specified boolean functions was proposed by Zakrevskij [22]. His staircase method can be called irre- dundant because it does not use 'don't cares' from the initial function. This method was developed for gener- alised heuristic [25, 261 and exact [24] Zakrevskij's algo- rithms (GZA). The heuristic GZA allows one to minimise the O-polarity k-valued logic function and fixed polarity k-valued logic functions. So the GZA is a wide generalisation of Zakrevskij's method and only in one case, when an optimal positive-polarity Reed- Muller function is sought, both approaches are equiva- lent. A recent article on the topic [21] presents an exact algorithm to extract FPRM expansions by using corre- spondence matrices of size 2" x 2". Such matrices are, in fact, exactly the same and have the same properties as known transform matrices for Reed-Muller expan- sions [3, 61. When the order of generated Reed-Muller coefficients is arbitrary, the latter method is very simi- 385
Transcript
Page 1: Adaptive exact optimisation of minimally testable FPRM expansions

Adaptive exact optimisation of minimally testable FPRM expansions

C.-H. Chang B.J.Falkowski

Indexing terms: Algebraic ternary decision trees, Boolean functions, Optimi,sution, Reed-Muller expansions

Abstract: An adaptive method to minimise fixed- polarity Reed-Muller expansions, combining the advantages of efficient data structures in form of both lookup tables and ternary decision trees, is presented. The algorithm developed converts arrays of cubes to exact solutions based on the desired cost criteria for the systems of completely specified functions. The method also allows one to combine the design for testability together with minimisation of hardware realisation. The algorithm shown is fast, efficient and requires smaller space and time complexity than known algorithms.

1 introduction

Any Boolean function can be represented in the mod- ulo-2 algebra known in the literature [l-141 as the com- plement-free ring sum or Reed-Muller expansion. For a given boolean function each Reed-Muller expansion is both unique and canonic. The circuits based on exclusive-OR gates are known to be more efficient for some classes of functions. Such situations happen fre- quently for many useful functions applied in arithmetic and telecommunication circuits having a high content of so called linear part (EXOR part of the function). Some of the examples of such functions are adders and parity checkers. What is more, the circuits built around the EXOR gates are easily testable. Fault detection of any logical circuit by verification of its Reed-Muller coefficients was considered in [12]. The AND-EXOR arrays based on the Reed-Muller canonical expansions of boolean functions possess a universal test set of length n + 4 for detecting stuck-at faults, and they can also be tested for bridging faults with a universal test set of length 2n + 4 [15].

The problem of finding optimal Reed-Muller expan- sions with the least number of terms has received much attention among researchers. It can be reformulated in terms of coding or graph theory or solved by means of digital signal processing techniques such as fast trans-

0 IEE, 1998 IEE Proceedings online no. 19982342 Paper first received 7th November 1997 and in revised form 8th July 1998 C.-H. Chang is with the Electronics Design Centre, French-Singapore Institute, Nanyang Polytechnic, 180 Ang MO Kio Ave 8, Singapore 569830 B.J. Falkowski is with the School of Electrical and Electronic Engineer- ing, Nanyang Technological University, Blk S1, Nanyang Avenue, Singa- pore 639798

IEE Proc -Coinput. Digit. Tech., Vol. 145, No. 6 , November I998

forms and convolution [3, 61. Nonexhaustive minimisa- tion methods for Reed-Muller expansions based on the extended truth vector were considered in [3, 81. These algorithms have a space complexity of O(3"). In [5], a boolean hypercube structure for minimisation of Reed- Muller expansions has been proposed. This algorithm uses geometrical operations to minimise Reed-Muller expansions and has limitations owing to computational complexity.

In general, the computational complexity of the min- imisation problem for Reed-Muller expansions seems unmanageable when the number n of variables is greater or equal to four. This computational complex- ity has led various authors to present heuristic solu- tions to minimisation problems when n 2 4 [3, 161. When the original function is represented in reduced form such as arrays of cubes or decision diagrams, cal- culation of Reed-Muller expansions directly from such representations have also been considered [l, 4, 13, 171. For example, in [13], an exact and quasiminimal algo- rithm based on disjoint cubes has been presented. A total search is necessary to find an optimal expansion. To minimise the number of operations, such a search is performed in Gray-code ordering. This algorithm can handle only a single output completely specified func- tion.

Recently, a number of exact and heuristic algorithms to minimise FPRMs have been developed [ l , 2, 18-21]. Most of the exact algorithms can minimise functions with around 15 variables. Some heuristic methods can deal with functions of about 100 input variables [18-201 or even a few hundred variables [22-241. A method of finding an optimal Reed-Muller expansion of incom- pletely specified boolean functions was proposed by Zakrevskij [22]. His staircase method can be called irre- dundant because it does not use 'don't cares' from the initial function. This method was developed for gener- alised heuristic [25, 261 and exact [24] Zakrevskij's algo- rithms (GZA). The heuristic GZA allows one to minimise the O-polarity k-valued logic function and fixed polarity k-valued logic functions. So the GZA is a wide generalisation of Zakrevskij's method and only in one case, when an optimal positive-polarity Reed- Muller function is sought, both approaches are equiva- lent.

A recent article on the topic [21] presents an exact algorithm to extract FPRM expansions by using corre- spondence matrices of size 2" x 2". Such matrices are, in fact, exactly the same and have the same properties as known transform matrices for Reed-Muller expan- sions [3, 61. When the order of generated Reed-Muller coefficients is arbitrary, the latter method is very simi-

385

Page 2: Adaptive exact optimisation of minimally testable FPRM expansions

lar to cne shown in [4, 13, 171. The complexity of this algorithm is O(jn) where j is the number of Reed- Muller coefficients involved [21]. In the worst case, j = 2" making the complexity of this method the same as that for previously known methods. The same paper proposes also a new heuristic algorithm to find the optimal polarity that is based on the concept of a boolear centre for vertices. The authors write: 'deriving the Boolean center may not be computationally feasi- ble' ancl that 'it may not exist for some functions'. The heuristic used in this algorithm is implemented very efficienily in the form of a decision tree and one needs only to traverse once through the graph during the exe- cution of the algorithm. Experimental results of this latest a gorithm on the standard benchmark functions are compared with the results of our new algorithm. The latest algorithm handles multiple output functions but does not solve the problem of optimal assignment of 'don't care' minterms, so in this respect our new algorithm is superior.

In this article the concept of minimally testable reali- sation cf FPRM expansions [l 13 is considered and new procedures for achieving such realisations are shown. The minimally testable criterion can be regarded as one of the cost functions during the search for an optimal realisation. The peculiar feature of this algorithm is that it is adaptable to various cost functions defined by the designer and the results obtained will change based on the variation of these cost functions. The method accepts arrays of cubes and generates exact solutions for a system of completely specified boolean functions. Since this algorithm was introduced in our earlier con- ference paper [l], we concentrate on the details of the algorithm implementation that have not been pre- sented. The data structure combines a decision tree with lookup tables and can use different sizes of such tables depending on the problem size. The method allows calculation of only some Reed-Muller coeffi- cients if the whole vector is not required. This article also shows the ability to include a criterion for mini- mally testable FPRM expansion into the search for an optimal solution. Such a possibility is unique and extends further the adaptability of our algorithm to the differen: requirements of the design process in the search -or the final optimal realisation. For incom- pletely specified functions, our algorithm decouples the effect of 'don't care', one at a time. We attempt to improve the final result by assigning the most influen- tial 'don't care' that forms the largest Reed-Muller product in the current optimal polarity. If the assign- ment reiwlts in a new optimal polarity, the 'don't care' mintemt that forms the largest Reed-Muller product in the new optimal polarity is then assigned, or else the one that forms the next largest product in the same polarity is assigned.

2 FPRM expansions

An arbitrary n-variable boolean function can be expressed as a canonical Reed-Muller expansion [ 1, 3-13, 15, 17, 18, 27-31] of 2" terms as follows:

2"-1 n

F(Zn,Zn-I,. ' . , m ) = @ a2 rI 2; (1) z=o 3=1

where B) denotes the modulo-2 addition, a, E (0, I ) is called a Reed-Muller coefficient and the binary n-tuple of the integer i = in ... iJ ... i2il. When iJ = 0, the literal

386

x j +.absent in the product term xp. If either a positive literal xi or a negative literal x i , ( I = 1, 2, ..., n) is used consistently throughout the expansion (eqn. l), the expansion is known as a fixed polarity Reed- Muller (FPRM) expansion. The polarity number w of an FPRM expansions is an integer computed by taking the decimal equivalent of the n-bit straight binary code formed by writing a 0 for a positive literal and a 1 for a negative literal. Whenever necessary the polarity number w may be written as a binary n-tuple <w, ... w2 wl> instead of the decimal form.

For an n-variable boolean function, there are 2" FPPM expansions corresponding to 2" different polar- ity numbers. Each of such expansions is a canonical representation of a completely specified boolean func- tion. An ordered set of fixed-polarity Reed-Muller coefficients [ao al ... a2fl-1] in some chosen polarity w is called a polarity vector A m . A polarity coefficient matrix PC(F) of an n-variable boolean function F is a 2" x 2" binary matrix where the element mu in row i, columnj ( i , j = 0, 1, ... 2" - 1) is the coefficient ai of the FPRM expansion in polarity number w = i.

The polarity coefficient matrix PC(F) can be decom- posed into four submatrices of order 2"-' as [ l , 41

where? = F(0, xn-l, ..., x2, XI),^' = F(1, ~ " - 1 , ..., x2, XI) and = ? 0 fl. By applying eqn. 2 recursively, the polarity coefficient matrix of order 2n can be decom- posed into p 2 submatrices of order 2k, where p = 2n-k. Each submatrix is a polarity coefficient matrix of a k variable subfunction and the total number of unique subfunctions is equal to 3n-k. Each subfunctionf" of k- variables is associated with a ternary (n - k)-tuple an-k-l ... a2 al>, where ai E (0, 1, 2). If ai E (0, 1) for all 1 5 i 5 n - k, fa = F(an-k, an-k-l , ... a2, al , xk, ..., x2, xl). If there exists an ai = 2 for any 1 5 i 5 n - k, then f" = fB of/ where ... ai+l O ai-l ... a2 al> and y = <an_k

The weight of an FPRM expansion is used to assess its cost of implementation. The weight wp(w) is the number of nonzero coefficients in the polarity vector A" and the weight wxw) is the total number of literals present in an FPRM expansion in polarity w. An ordered set of all 2" weights wp or w[ of PC(F) in ascending order of the polarity number w is denoted by the column vector Wp or W,, respectively. The optimal polarity of a boolean function F in an FPRM expan- sion is equal to the row numbers of Wp or W, with minimal weight depending on whether the number of product terms or literals is used as the optimisation cri- teria.

= ... ai+l 1 ai-l ... a2 al>.

3 FPRM expansions

An algorithm that utilises only a subset of Walsh coef- ficients to reveal all the information carried by the polarity Coefficient matrix of any three variable boolean functions has been developed [27]. The method cannot be easily extended to handle larger boolean functions owing to the increasing number of different classes. However, by decomposing the polarity coeffi- cient matrix into submatrices of smaller dimension, exact optimal generation of FPRM expansions for large n can be solved by means of a divide-and-conquer algorithm.

Adaptive algorithm for exact minimisation of

IEE ProcCompur. Digit. Tech.. Vol. 145. No. 6 , November 1998

Page 3: Adaptive exact optimisation of minimally testable FPRM expansions

Theorem I: The weight vectors W(F> of an n-variable boolean function F can be decomposed into [W@) Wcfl) ... W(f"-k-')] where each subvector Wyl) is a weight vector of a k-variable subfunction?. The sub- vectors W p r ) and W f l ) in terms of the number of products and literals can be expressed as

-1 2" F

WP(f') = WP(fr*3) (3a)

Wl( f ' ) =

3=O

y - L - 1

[W(f ' * j ) + H ( j ) x WP(fT* j ) ] j =O

(3b) where 0 s k < n, r and j are decimal equivalents of binary (n - k)-tuples <r,_k r,,-k-l ... r l > and <jn-k jn,_, ... j l> . H(i> is the number of ones in the binary (n - k)- tuple of j . The operator * : {0, l}k x (0, l}k - (0, 1, 2Sk is defined by the following componentwise Table of operation:

second owerand

f i r s t t-ppfp-1 operand 2

Proof: See [l]. Three two-dimensional integer-array lookup tables NP, NL and R M are created. The entry in row i, column j of the array NP, denoted as NP[i][l'J, is the weight wp of the polarity vector AJ for the subfunctionp where i = %(fa) . The row index %p) is the integer Z,2_ko1 2'm, where mr E (0, 1) is the binary value of the rth minterm of the k-variable subfunctionfa. Note that %p) = 22k - 1 - %(fa) . The entry NL[i][l'l of the array N L is the weight w1 of the polarity vector AJ for the subfunction f a or depending on the value of i since i = min(%(ja), %p)) in this case. The entry Rn/l[dL] of the array RA4 is the decimal equivalent of the polarity vector AJ for the subfunction f a if i = min("j"), %p)) = %p) or 1 O AJ for the subfunction f" if i = %p). Notice that wfl) = wrcfa) since A W p ) and A W V ) differ only in the constant term ao. For k = 3, the size of the lookup table wp is 256 x 8 and the sizes of the other two lookup tables are both equal to 128 x 8. These tables can be easily generated by the algorithm in [27]. Based on theorem 1, the following corollaries that make use of the lookup tables form the basis of our exact minimiser of FPRM expansions. Corollary I : The exact weight of any n-variable com- pletely specified boolean function in polarity w can be calculated as follows:

M-1

j = O

(4a)

j=O

where " w >> k" is the right shift operator of the binary number w by k positions, M = 2n-k and w mod 2k is the remainder of w divided by 2k. Corollary 2:

AA-1

j = O

(5) where Cj = 1 if 'iR(fw>>k)*J) 2r 22k-', otherwise CJ = 0.

In corollary 2 the polarity vector A" of the n-variable boolean function is represented by a decimal integer whose binary equivalent is equal to <a2n-1 ~ 2 n - 2 ... al ao>. In fact, AW is formed as a concatenation of the binary representations of C. Od Rwmin(%iV(w>>k)*J), 22k

the operator Od is the dyadic addition between two integers.

The minimisation of FPRM expansions can be divided into two steps [4]. The first step is to find an optimal polarity and the second is to realise the FPRM expression of the switching function with this polarity. Most approaches to the first problem are formidable in varying cost functions and usually identify only one out of many possible optimal polarities. With an appropriate data structure, corollary 1 provides effi- cient and flexible means for the identification of all optimal as well as suboptimal polarities based on dif- ferent criteria if necessary. Once the optimal polarities for a chosen type of implementing structure have been identified, realisation of the FPRM expansions at those polarities is straightforward by applying corollary 2. The implementation of the algorithm is discussed in the following Section after the theorems for the exact mini- misation of multiple output functions have been pre- sented.

Many ESOP minimisers use a two-phase method when dealing with multiple output functions. Each out- put of the multiple output functions is first treated as an independent single-output function. After applying the minimisation procedure, each output is further min- imised according to some predetermined order based on the previously obtained expressions. Such an approach, however, cannot guarantee global minimal- ity. Particularly for the cube-based methods [4, 13, 17, 211, the second phase employs an iterative improve- ment technique that has both the final result and a complexity relying greatly on the ordering of the out- puts and the sorting of cubes, which has been experi- mentally demonstrated in [21]. Obviously the minimal polarity for one output is not likely to be optimum for the complete system of functions as there may be repli- cation of identical product terms in a number of out- puts. To obtain an exact global minimisation for a system of completely specified functions, common terms for each polarity must be sought. Theorem 2 gives a method for determining the exact weight of the FPRM expansion in any polarity with product terms shared by more than one output counted only once. Theorem 2: Letfi,fZ, ..., f , be the outputs of an n-vari- able m-output function F, then the weight of the FPRM expansion of F in any polarity w is given by

- 1 - %(f""k)*j>)][w mod 2 k ] f o r j = 0, 1, ..., A4 - 1 and

IEE Proc.-Comput. Digit. Teeh., Vol. 145, No. 6, November 1998 387

Page 4: Adaptive exact optimisation of minimally testable FPRM expansions

(6) where g, h, j E { l , 2, ..., m}. g z h, h z j , g z j . Proof: See [l]. Corol/arji 3: It follows from corollary 1 and theorem 2 that for a system of m n-variable completely specified boolean functions F, the weight of the FPRM expan- sion in polarity m is given by

1 W,(U) := - 2m-1

1 Wl (w) == - 2"-1

( 7b) where s is the decimal number and s, is the ith (i = 1, 2, ..., m) bit in binary m-tuple of s. Ji is the ith output of F. Theorewl 3: For a system of boolean functions F, define F, as the system of any g functions selected from F. Let cw(F,) be the number of common product terms cw,(F,) or the total number of literals in all common product terms cwXF,) among g outputs. Then

cw(E'g1 = X w ( 4 ) - C W ( F g 2 ) + C W ( F g 3 ) - . . . + (-11,

+ (-1)"lw(Fgg) - - c(-l)z+l W(F,J

d P g ( g - 1 ) )

9

z= 1

( 8 ) where Zw(F,,) is the arithmetic sum over weights of gCi possible combinations of i functions selected from Fg. Proof: The weights of the nonzero Reed-Muller coeffi- cients that are common to polarity vectors A I , A,, ..., A, of Fg can be obtained by logically ANDing all the corresponding coefficients of A , , A,, ..., A,. Thus CW(F,) I= W ( f i A f 2 A ... A&).

h A h = = h +h-h v f 2 .

h A S 2 J \ f3 = vi + fi -h v f 2 ) A h = f l + fi -h v f 2 +

h - C f ; + h - h V f i ) V f 3 = f l + f 2 + f 3 - c f l V f 2 + h V h +h \ I f 3 ) +.h v h v f 3 .

In general, f l A f2 A ... A fk = f l + f 2 + ... + fR - Z(al1 combinations of ORing of two functions) + Z(all com- binations of ORing of three functions) + ... + (-l)g+'

388

f 1 v f2 v ... v fg. Hence, in a similar way cw(F,) = w(fl) + ~ ( $ 2 ) + ... + ivcfg) - Zw(0Ring of any two functions) + Xw(0Ring of any three functions) + ... + (-I)g+I wcfl v f2 v ... v f,), where C means summation over weights of all possible combinations of ORing i out of g func- tions for i = 1, 2, ..., g. Example I : Consider the minterm lists of a five-variable three-output function F taken from [9]

f l ( 2 5 r 2 4 , 2 3 9 2 2 1 2 1 )

= ~m(6,7,11,14,16,18,20,23,30,31)

f 2 ( Z 5 , 5 4 , z 3 1 x2,21)

= 1 m(2,10,11,17,19,21,22,26)

f 3 ( 2 5 , 2 4 , x 3 , x 2 , 2 1 )

= 1 m(1,5,7,10,14,18,22,25,29,31)

By eqn. 7a with the three-variable lookup table, the weight vector Wp of F is calculated to be [18 22 24 27 17 21 23 27 15 19 22 26 15 18 22 24 19 20 22 25 19 21 22 26 18 22 24 27 17 21 23 271. Thus the optimal polar- ity copmm = 8, 12 and the minimal weight w,,,,, = 15. The sample calculation of iv, for m = 8 = <01000> is shown as follows:

M = 25-3 = 4. w >> 3 = (00001). 8mod8 = 0 For j = 0, %zv;<O1>*.coO>) = %v7°1>) = %(<01001000>)

= 72, %(J2<01>) 1 %(<00001100>) = 12, %cf;<O1>) '%( < O 1000 100,) = 68; %vl'ol')Od %(f2"" ) = % ( < 0 1 0 0 0 1 0 0 ~ ) = 68, %cf l '01 ' )Od%(f3<01>) = %(<00001 l o o > ) = 12, %(f2'01>)Od%(f3<01>) =

= %(~00000000>) = 0. For j = 1, %cfl<O1>*<O1> ) = %(fi'02') = %(fl<OO>@d

fl'O1') = %(<lOOOlOOO>) = 136, %.iV;<O1>*<O1> I =

'%(<0100 1 OOO>) = 72; %i(fi<012)0d%~2<01>)0d%~<01>)

'%cf2'02') = %(<00001000>) = 8, %(f3<O1>*<O1>) = '%cf3'02>) = %(<111001 IO>) = 230; '%cfi<02')0d%cf2<02>) = %(<10000000>) = 128, % c f ~ < 0 2 > ) O ~ % ~ 3 < 0 2 > ) =

%(<11101110>) = 238; % ( ( f i ' 0 2 > ) O d % ( ( f 2 ' 0 2 > ) 0 d %(<011011 l o > ) = 110, %(f2'02'>Od%(f3<02>)

.y3'02') = ~ ( ~ 0 1 1 0 0 1 lo>) = 102. For j = 2, ~(f l '01>*<~0> ) = ,(fl'2~') =

'% (f, .< 0 1 > * < 1 0 >

% ( f 1 < ~ l > ) @ d % ( f 2 ' ~ ~ > ) = %(< 10000000>) = 128, % ( f 1 ' 2 1 > ) ~ d % ( f 3 c 2 1 > ) = %(<O11O11 I O > ) = 110,

%(fl <01'Odf1 < I I > ) = %(<10001000>) = 136, ) = %(f2 '21 ' ) = %(<00001000>) = 8,

%(f3c01>*<10> ) = %(f3'21") = %(<11100110>) = 230;

%(f2'21')0d%(~3"211') = % ( < l l l O l l l o > ) = 238;

= 102. % ( f i ' 2 1 ' ) 0 , % ( f 2 )0,%(f3'21') = %(<011001 lo>)

For j = 3 , %zcflcOlz*<ll>) = %cfl'22') = %tCfi<20>Od

p') = % ~ l < 0 0 > 0 d f i < 1 0 > 0 d ~ f i 2 1 > ) = %(~11011101>) = 221, ~cf2<01>*<11> ) = %(J2'22') = %(<01100110~) = 102, ~c f3<01>*<11> ) = %y;<22>) = %(<00000000>) = 0;

%((fi'22')Od%(f3<22') = % ( < I 101 1101>) = 221, % ( f , ' 2 2 ' ) 0 ~ % ( f 3 < 2 2 ' ) = %(<011001 lo>) = 102; % (fl'0I>)Od% (f2<ol ' )0d% (h'OI>) % (< 101 1 10 1 1 >)

%((fi'22')0JR(f2<22>) = %(<lo1 11011>) = 187,

= = 187.

Let P, be the abbreviation of NP[a][O]. By eqn. 7a, wp = ( p 7 2 + P12 + P6X + p68 + p12 + P72 + +

p 8 + p230 + p128 + pl10 + p238 + p102 + p136 + p p -I- p230 + p128 + pl10 + p238 + +

p187 + p221 + p102 + p187)/4 = {2(p72 + P I 2 + p6X + PO + p136 + p 8 + p230 + p12X + pl10 + p238 + p221 + p187)

IEE Proc-Coniput Digit Tech Vol 145 No 6 November 1998

+

+ p221 + p102 +

Page 5: Adaptive exact optimisation of minimally testable FPRM expansions

+ 4 P , , , } / 4 = { 2 ( 2 + 2 + 2 + 0 + 1 + 2 + 3 + 1 + 4 + 3 + 3 + 3) + 4(2)}/4 = 15.

lated by eqn. 5 as follows:

00001000 00001000 01001000]. Asv2) = 8RM[102][0] + 4RM[8][0] + 2RM[8][0] +

RM[l2][0] = [611361136(68] = [OOOOOllO 10001000 10001000 01000100].

A8(f3) = 8RM[0][0] + 4(1 OdRM[25][0]) + 2(1 Od RM[25][0]) + RM[68][0] = [Oil341 1341121 = [00000000 100001 10 100001 10 00001 1001.

4 Data structure and implementation

The theorems in Section 3 form the basis of a versatile method for exact extraction of the information on the polarity coefficient matrix for an arbitrary system of completely specified functions. To facilitate the job, a good data structure amenable to functional decomposi- tion and analysis of subfunctions y, f and J' is desired. In this Section we introduce a new data structure anal- ogous to EXOR ternary decision diagram (ETDD) [ 141 but having the following distinctive features: (i) There are n - k + 1 levels instead of n + 1 levels as compared with the generation tree or ETDD. k is the number of variables of the subfunctions referenced by the lookup tables. (ii) Each leaf of the tree consists of a pointer to an array of integers as opposed to the use of multiplace decision diagram for multiple output functions.

The new data structure is called algebraic ternary decision tree (ATDT) in view of the nonbinary terminal values. ATDT is a rooted directed acyclic graph with vertex set V, comprising two basic types of vertices. A nonterminal vertex Y has as an attribute index(v) E { n - k, n - k - 1, ..., l } and three children Iow(v), high(v) and A(Y) E V. A terminal vertex, commonly called a leaf v, has as attributes an index(v) = 0 and a pointer value(v) to an integer array S, where S[z] E (0, 1, ..., 22k - 1) for 1 s i 5 m is the row index of the ith output of the m output functions. For readability, we denote the integer S[i] by valut.(v) +- i in the description of the algorithms. In addition, the edges connected to low(v), high(v) and A(v) are called the 0-, 1- and 2-edges of v, respectively. ,f;ow(v) and high(,) are cofactors generated from the decomposition off, with respect to X i and xi, respectively, where i = index(v) + k, fAcv) = J~o,c,) 0

The generation of ATDT is accomplished by the following algorithm in pseudocode. Procedure BuildATDT

The FPRM expansion in polarity w = 8 can be calcu-

A 8 ~ ) = 8(1O&M[34][0]) + 4(1 OdRM[l19][0]) + 2(1 O$~l19] [0 ] ) + Rw72][0] = [111818172] = [00001011

path := <OO0...0>3; i := 1; while i 5 2Izuk

flag := TRUE; I : = n - k while path( # 2

decrement I ; i f 1 = 0

flag := FALSE; for each output &, j := 1 to m

end for crehte a new terminal vertex Y := Ver- tex(ni1);

nqb] := decompose(,+;, path);

IEE Proc.-Comput. Digit. Tech.. Vol. 145, No. 6, Nowmber 1998

put v into Queue; increment i; increment path; break;

end if end while if flag

q := 3'; counter := q; Repeat

for j := 1 to m

end for create a new terminal vertex v := Ver-

put vinto Queue; increment i; increment path; decrement counter;

nm := ni - 2qlb-I 0 ni - q1b-I;

tex( WD;

until counter = 0 end if

end while do

get v0, v1, v2 from Queue sequentially; I := index(v0) + 1; create a new non terminal vertex v := Vertex(Z, a, v1, v2); put v into Queue;

while 1 # n - k get root from Queue; return root;

end Procedure In the procedure Build-ATDT, each path from root to leaf is represented by a ternary (n - k)-tuple path where the ith digit of path is formed by taking the edge value of the vertex at level i. If all digits of path are either 0 or 1, value(v) 4 j of the leaf v can be obtained directly by decomposing the j th output function with respect to path using the procedure decomposegl path). nil is an array of m integers pointed to by the zth leaf and nz'l[11 represents %(fa) for thejth output of the ith leaf. Pro- cedure Vertex( nil) with a single argument n i l gener- ates a new terminal vertex with index(v) = 0 and value(v) = address of nz]. Procedure Vertex(l, v0, v1, v2) is a constructor of a new nonterminal vertex with index(v) = 1, Zow(v) = 1.0, high(v) = VI and A(v) = v2. A link list implementation of Queue is used to store and retrieve vertices so that nonterminal vertices are gener- ated in a breadth first-order manner, level by level, from the leaves to the root. Finally, the top vertex root is returned by Build-ATDT.

Procedure decomposev; , path) computes %(fa) directly from a reduced representation such as a sum- of-product (SOP) form without requiring the truth- table representation of the function f;. The system of boolean functions is given initially in the form of an array of cubes, not necessary disjoint. Each cube C has an input part I(C) = <c, c,-~ ... cI> and an output part O(C) = <c,+,, c,,+,,-~ ... c,+~> where for 1 s i s n, c, = 0, 1, - corresponding to the presence of a positive, nega- tive or the absence of the variable x, in a SOP term, respectively, c, = 0, 1 for n + 1 5 i s IZ + m correspond- ing to the presence or absence of the term Z(C) in the (i

389

Page 6: Adaptive exact optimisation of minimally testable FPRM expansions

- n)-th output. A componentwise matching operator = between two digits a and b is also defined by the fol- lowing Table:

a EleB 1 0 1 1

Procedure decompose$, path) is stated as follows: Procedure decompose$, path)

tvalul? := 0; for each cube C from the On array

if c,+~ = 1 flag := TRUE; for r := 1 to k

ifbath, E C,-k-l+,.) = 0 pug := FALSE; break;

end if end for if Jag

create a cube D = <ck ck-1 .. c2 c1> for each minterm m, covered by cube D

end for tvalue := tvalue v 2';

end if eiidif

end for return tvalue

end Procedure After creating the ATDT the row index %.iCf(w>>k)*J) in eqns. 4a, 4b and 5 can be easily obtained by traversing the tree. Procedure traverse(w, j ) which returns a leaf Y and H(j) is Procedure traverse( w, j )

path := 0 ; i := w >> k; f o r b : = 1 t o n - k - 1

if ib = 1

end if

iSjh = 0

path := path + 3b-1;

else path := path + 2 x 3b-1; end if

end for vertex Y := root; H(j) := 0 ; i := n - k; while i > 0

il'path, = 0

else if path, = 1 Y := high(v);

else Y := A(Y) ; increment H(j); end if decrement i;

end while return Y, H(j);

Y := low(v);

end Procedure To search for the optimal polarities an object consist- ing of two components w and w is defined. An array of 2" such objects is generated according to the following

390

procedure. For each w = 0, 1, 2 to 2" - 1, the algorithm loops through j = 0, 1, ... to M - 1 where M = 2"-k, and executes traverse(w, j ) to reach the appropriate leaf Y. Since %.iV;(w'>k)*i) is equal to vahe(v) + [z], eqns. 7a or 7b can be applied to calculate the weight w for polarity w of each object depending on the primary cost criterion. Once all 2" objects are created, the array of objects are sorted in ascending order of the compo- nent w. All polarities of objects, having the same w as the top object, are optimal. The FPRM expansions of each output can be calculated using eqn. 5 for these optimal polarities. If there is a secondary cost criterion, further optimisation among these polarities is carried out in a similar procedure as before with a reduced search space. If only one of the optimal polarities is required, an algorithm can be used to avoid sorting an array of objects.

5 Minimally testable FPRM expansions

The theorems and corollaries presented earlier can be easily extended to any cost function of the form awl + bwp where a and b are any constants used to balance the cost of implementation. Any realisations of a switching function based on Reed-Muller canonical expansion can be tested for all single stuck-at faults by application of only n + 2ne + 4 input vectors where n, is the number of variables appearing in an even number of product terms in the Reed-Muller canonical expansion [ll]. The 2ne inputs are not required if the network is provided with an extra observation point, thus reducing the number of test vectors to n + 4. Pro- vision of the extra observation point increases package pin count and may complicate the checking process [ll]. It is therefore important to consider n, as an optional secondary criterion to combine the design for testability together with minimisation of hardware complexity. Definition 1: Each polarity vector A" is associated with a purity vector Pw = bn pn-l ... p2 p l ] where pi = 1 if the literal x i appears in A" in an odd number of product terms and 0 otherwise for i = 1, 2, ... n.

Let 0, and I , be two streams of 2"' '0' and 'l', respectively. Let Bi denote a binary n-tuple formed by alternative blocks of Oi, and I , with MSB = 1 and LSB = 0, i.e., Bi = IiOiIiOi ... OiIiOi. Then pi = 1 if H(A" & Bi) is odd and 0 otherwise where & is the operator for bitwise ANDing of two integers. H(i) is the number of ones in the binary representation of the integer i.

It is convenient to partition the parity vector Pw into

pl]. The following procedure shows how the upper par- ity vector U" can be obtained without generating the FPRM expansion. Procedure Uppergarity-vector( w)

two subvectors U" = [p, Pn-l ... Pk+l] and L" [ p k Pk-1 .,,

U" := [OOO ... 01; for j := 1 to M - 1

for eachj, = 1

is odd

end if

if 1/2m-1 Z2M-1 s=l NP[@si %E1W>>k)*9][w mod 2k]

Pt+k := Pt+k @ 1;

end for end for

end Procedure

IEE Proc.-Compui. Digit. Tech., Vol. 145, No. 6 , November 1998

Page 7: Adaptive exact optimisation of minimally testable FPRM expansions

In procedure Upperqarity-vector, M = 2n-k, NP[Osi %('$w"k)*j)][~ mod 2k] has the same meaning as in corollary 3 and the row index can be obtained by traversing ATDT. The principle used in procedure Uppergarity-vector is that for any t = 1, 2, ..., n - k , xl+k appears in all the product terms of the submatrices PCV;:(wz>k)*j) whenever j , = 1. Thus if the sum of weights wP(w) of these submatrices is odd, Pt+k = 1. Since only the parity (odd or even number) of the number of product terms is of interest, instead of add- ing up the integer weights, we need only to complement the parity of Pl+k each time an odd weight is encoun- tered. Replicated product terms have been accounted for by the summation over weights of row indices Os, % ~ ( w > > k ) * j ) .

Since each PC submatrix consists of the polarity vec- tors of k-variable subfunction involving the literals x t for t = I , 2, ..., k , we apply property (ii) to all polarity vectors of subfunctions obtained by traverse(o, j ) for all j = 0, 1, ..., A4 - 1. Procedure Lowerqarity-vector is given as follows: Procedure Lowerqarity-vector(o)

LW := [OOO ... 01 f o r j : = 0 to M - 1

AW := 0; for i = 1 to m

if %ZV;:(o>>k)*j) < 22k-l AW = AW v RM[%Cf;(w"k)*j)][w mod 2k]; I" bitwise ORing of two binary numbers "I

AW = AW v (1 Od RM[22k - 1 -

%K(w"k)*j)][w mod 29);

else

end if end for for t := 1 to k

if H(A" & B,) is odd

end if pt := pt 0 1;

end for end for

end Procedure The number of literals appearing in even number of product terms n, is given by

n

ne = n - Cp2 (9) 2=1

In [l I] a procedure is presented for selecting FPRM expansion with minimum n, without the necessity of determining all the 2" possible FPRM expansions. This procedure considers only a single-output function. For multiple output functions, shared product terms have to be accounted for, as in our algorithms, for determin- ing the upper and lower parity vectors. Nevertheless, two propositions from [ 1 11 regarding adjacent polarised FPRM expansions may be exploited by our algorithms to avoid scanning all 2" polarities. Thus, an upper bound of 2n-log2(n+1) parity vectors of different polarities must be derived from our algorithms before applying Page's method to predict the remaining parity vectors of adjacent polarities. Additionally, for large n proce- dure Lowergarity-vector can be skipped as ne = n - E;!&+, p i . The error is only 6 = ZL, pi s k. This simpli- fication is particularly meaningful if minimisation of n, is a secondary criterion.

IEE Proc.-Comput. Digit. Tech.. Vol. 145, No. 6, November 1998

Example 2: Consider the five-variable three-output function F from example 1. The sample calculation of IY according to procedure Uppergarity-vector is shown as follows:

For k = 3, M = 4, o >> k = <00001>, o mod 2k = 0. p s = p4 = 0 initially.

F o r j = 1 = <01>, sincejl = 1, t = 1. From example 1, we have %Y;'02') = 136, %(J2'02') = 8, %Y;'02') = 230; %(f1'02~)0d%(f2"02') = 128, %ul'02')0d%Y;'02>) = 1 10, %Y;'02')Od%(f3'02') = 238; %~l'02')Od%(f2c02>) Od%(f3'02>) = 102. Since 1/4{NP[136][0] + NP[8][0] + NP[230][0] + NP[128][0] + NP[IlO][O] + NP[238][0] + NP[lO2][0]} = 1/4{1 + 2 + 3 + 1 + 4 + 3 + 2) = 4 is even, P I + , = p 4 remains as 0.

For j = 2 = <IO>, since j 2 = 1, t = 2. From example 1, we have %Y;'21>) = 136, %Y;'21>) = 8, %(f3'21') = 230; %,Y;'21>)0d%V;c21') = 128, %Y;'21')Od%~3'21') =

Od%V;'21') = 102. Since 1/4{NP[136][0] + NP[8][0] + NP[230][0] + NP[128][0] + NP[I lO][O] + NP[238][0] + NP[102][0]} = 4 is even, p2+3 = p 5 remains as 0.

F o r j = 3 = <11>, sincej2 = j , = 1, t = (1, 2). From example 1, we have %(fl'22') = 221, %Y;'22') = 102,

1 10, %V;c21>)0d%(f3c21>) = 238; %y;'21>)Od%V;<21')

%(f3'22') 0; % 2 ( f 1 < 2 2 ' ) 0 d % ( f 2 c 2 2 > ) = 187, %zcfi'22')0d%(f3<22>) = 221, %~2'22')Od%(f3 '22>) = 102; %(fl'ol>)Od%(i'ol') Od%(f3'01>) = 187. Since 1/4{NP[221][0] + NP[102][0] + NP[O][O] + NP[187][0] + NP[221][0] + NP[102][0] + NP[187][0]} = 1/4{3 + 2 i- 0 + 3 + 3 + 2 + 3) = 4 is even, p 4 = p s = 0.

The sample calculation of the lower parity vector L8 according to procedure Lowerqarity-vector is shown as follows:

F o r j = 0, the inner for loop yields A s = RM[72][0] v RM[12][0] v Rw68][0] = 78 v 68 v 12 = <01001000> v <01000100> v <OOOOlIOO> = <010011OO>. Since H ( A ~ & B,) = H(<01001100> & ~10101010>) = H(<OO001000>) = 1 is odd, p , = 1. Since H(A8 & B2) = H(<01001100> & <11001100>) = H(<01001100~) = 3 is odd, p2 = 1. Since H(A8 & B,) = H(<01001100> & <11110000>) = H(<01000000>) = 1 is odd, p 3 = 1.

For j = 1, A8 = (10dRM[119][O]) v RM[8][0] v

~ 1 0 0 0 1 0 0 0 ~ v ~ 1 0 0 0 0 1 1 0 ~ = <100011 lo>. Since

is odd, p l = 1 0 I = 0. Since H(<10001110> & <11001100>) = H(~10001100~) = 3 is odd,p2 = 1 0 1 = 0. Since H(<10001110> & <11110000>) = H(<10000000>) = 1 is odd, p 3 = 1 0 1 = 0.

For j = 2, As = (l@dRM[119][0]) v RM[8][0] v (1OdRM[25][0]) = <10001110>. Since As is the same as the case o f j = l , p l = p 2 = p 3 = 1 0 0 = 1.

For j = 3, AS = (1OdRM[34][0]) v RM[102][0] v RM[O][O] = 11 v 6 v 0 = <00001011> v <00000110> v <00000000~ = <0000111 l>. Since H(<00001111> & <10101010>) = H(<OO001010~) = 2 is even, p l remains as 1. Since H(<OOOO1111> & <11001100>) = H(<OO001100>) = 2 is even, p 2 remains as 1. Since

is even, p 3 remains as 1. Hence the parity vector Ps = [OOl 1 I]. From eqn. 9, n,

= 5 - 3 = 2. There are two literals (x5 and X4) that appeared in an even number of unique product terms.

6 Experimental results

The algorithm presented in Section 3 is implemented with the data structure described in Section 4. Three variable lookup tables with k = 3 are used. A range of

(lOdRM[25][0]) = 8 v 136 v 134 = <00001000> v

H(<10001110> & <10101010>) = H(<10001010>) = 3

H(<00001111~ & < 11 110000>) = H ( ~ 0 0 0 0 0 0 0 0 ~ ) = 0

391

Page 8: Adaptive exact optimisation of minimally testable FPRM expansions

benchmark examples have been tested on the Sun Sparc IPC workstation with 22 MB of system memory. Some two-level examples from MCNC benchmarks minimised with wp as the primary cost criterion and w[ as the sxondary criterion have been summarised in Table 1. The columns labelled ‘n’ and ‘m’ are the number of input and output variables, respectively. The columns labelled ‘w,,,~~,,’ and are the resulting number I3f product terms and literals, respectively. The entries in column 6 are the numbers of FPRM expan- sions with number of product terms and literals equal to wpnIm and w~,,,, respectively. The column labelled ‘Time’ is split into two subcolumns ‘usr’ and ‘sys’ for the user and system execution time in seconds, respec- tively. The last column provides some polarity numbers of those FPRM expansions that fulfilled the cost crite- ria. The results compared favourably with previous algorithms. Our results for all completely specified functions agree with the exhaustive search routine of Cannes [2, 211. For the incompletely specified function inc, our algorithm uses a simple heuristic that decou- ples ‘don’t care’ minterms one at a time in a sequence based 01 the latest obtained best polarity [l]. The number of terms generated by our algorithm for this function is only one more than that of the exhaustive routine of Cannes. Unfortunately, no timing informa- tion is given in [2] .

To assess the execution time of our algorithm, we compare our execution time in Table 1 with MIN- GRM, an exact minimiser which deals only with single output completely specified functions [I31 in Table 2. In Table 2, the column labelled ‘MINGRM time’ is the execution time of MINGRM on a Sequent S27 machine with two 386 processors in a time-shared envi- ronment for the benchmark functions with selected output 1131. In addition, the published results from FDD algorithm [ 181 run for the single-output functions on the same benchmarks with HP Apollo Series 700 workstai ion are also given under the column labelled ‘FDD time’. The comparison shows that our program is able 1.0 produce optimal results significantly faster even for the same benchmark functions with all the outputs. Comparing our results for multiple-output functions with the results published in [18, 211, the overall run times of our algorithm were on average about 115 second, while the run times for algorithm

from [21] were on average 1/2 second on DEC 5000 workstation and for exact FDD algorithm from [IS] were in the magnitude of tens to hundreds of seconds. Finally, the same set of benchmarks from Table 1 was minimised with wI and w,, as the primary and secondary criteria, respectively. These results are not given since for most of the benchmark functions, the time required and the results were almost the same as the results from Table 1. Comparing results, it has been observed that minimising the number of product terms wp is a more stringent requirement since the resulting FPRM expansions tend to have the minimal number of literals as well. The reverse, however, is not generally true.

Table 2: Execution time of MINGRM and FDD ~~~~~~

Function MINGRM time, s FDD time, s

Ssym

con12

rd532

rd732

rd842

sa022

sa023

5xpl1

1851.3

1.2

1.1

49.6

364.2

642.1

905.9

5.6

8.1 -

0.4

1.8 -

16.3

16.2

1.8

To compare our algorithm with Zakrevskij’s method we apply the irredundant Zakrevskij’s search method for heuristic minimisation of 0-polarity and fixed polar- ity Reed-Muller expansions for some incompletely specified functions [29]. The same benchmark functions are also minimised by our algorithm extended for incompletely specified boolean functions with the heu- ristic described in [l]. The results are analysed and shown in Table 3. The GZA (GZA-0 = 0-polarity and GZA-FP = fixed polarity) minimisers based on heuris- tic approach have been run on a PC Cyrix 150+ with Linux OS. The heuristic Zakrevskij’s algorithms [22- 261 have been designed mainly for multivalued logic function minimisation, but they have been tested (to compare with our algorithm) for binary logic functions. For testing, the standard MCNC and PSU benchmarks have been used. The second and third columns show results for the heuristic zero polarity GZA-0 and the

Table 1: Minimisation with wp as primary criterion and w, as secondary criterion

Examples of optimal polarities Optimal Time, s Function n m wpmin wlmin FPRMs

usr sys

5xp 1 7 10 61 224 1 15.3 0.1 0

Ssym 9 1 173 636 252 5.5 0.2 85, 86,89,90,91, ... con 1 7 2 17 48 2 0.1 0.1 1,5

inc 7 9 48 174 - 522.2 0.5 31 with dcs2 of f4 = 1

misexl 8 7 20 68 8 7.5 0.1 31, 63, 95, 127, 159, 191, 223, 225

rd53 5 3 20 45 1 0.0 0.1 0

rd73 7 3 63 189 1 0.3 0.1 0

rd84 8 4 107 352 1 1.5 0.1 0

sa02 10 4 100 707 2 18.8 0.3 820, 868

squar5 5 8 23 56 1 0.2 0.1 0

xor5 5 1 5 5 16 0.0 0.1 0, 3, 5, 6, 9, I O , 12, 15, 18, 20, ... Z9svm 9 1 173 636 252 5.6 0.2 92, 93, 94, 171, 172, 173, 174, ... clip 9 5 206 995 2 8.2 0.2 33, 452

392

~~

IEE Pror.-Comput. Digit. Tech.. Vol. 145, No. 6, November 1998

Page 9: Adaptive exact optimisation of minimally testable FPRM expansions

Table 3: Comparison with Zakrevskij‘s algorithms

GZA-0 heuristic GZA-FP heuristic Our algorithm

terrnsIIiteraIs time* termslliterals time* termsIIiterals time+ Function Inputs Outputs

add0 8 1 711 9 0.00 318 0.04 231121 0.01 add4 8

ch 177f0 8

ch30f0 8

ch52f4 8

ch83f2 8

interval1 8

kddlO 8

kdd3 8

kdd7 8

modulus2 8

remainder2 8

con 1 7

misexl 8

xor5 5

bw 5

squar5 5

rd53 5

inc 7

5xpl 7

f51m 8

rd73 7

9sym 9

clip 9

rd84 8

sa02 10

1

1

1

1

1

1

1

1

1

1

1

2

7

1

28

8

3

9

10

8

4

1

5

4

4

10123

212 6/17

10122

11/21

11/25

911 9

14133

8/20

10127

812 1

1 915 1

6011 89

515

3218 1

23/56

20145

841280

611225

561198

6311 89

210/756

2 1711 045

1071352

100215118

0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.02 0.00 0.00

0.00

0.00

0.04

3.16

0.02

0.01

0.10

0.62

0.06

0.31

611 2

212

215

318

611 3

611 4

511 0

111

3/7

319 6/13

17/49

20168

515

22/65

23/56

20145

4711 68

611223

561194

6311 89

1731637

2061996

1071352

100/707

0.04

0.04

0.02

0.02

0.04

0.04

0.02

0.02

0.02

0.02

0.04

0.47

5.29

0.00

0.20

0.00

0.01

3.34

3.16

4.33

1.63

55.18

211.11

12.68

322.81

2311 05

251132

8/38

5/32

2411 28

221120

2311 00

251104

39117a

12/55

2411 15

17/49

20168

515 22/65

23/56

20145

481174

611224

561194

6311 89

1731636

2 06/99 5

1071352

100/707

0.01

0.01

0.01

0.01

0.01

0.01

0.01

0.01

0.01

0.01

0.01

0.10

0.10

0.01

0.94

0.10

0.10

0.50

0.10

0.40

0.10

0.20

0.20

0.10

0.30

* PC Cyrix 200, t HP Apollo Series 715 workstation

heuristic fixed polarity GZA-FP minimisers, respec- tively. Our algorithm is exact for the minimisation of completely specified functions and heuristic for incom- pletely specified functions. Since our algorithm does not use backtracking in assignment of ‘don’t cares’, the results for incompletely specified functions are worse than that obtained for the stair algorithm. The results show that the stair algorithm is especially advantageous for incompletely specified functions with many ‘don’t care’. On the other hand, our algorithm obtains better results for systems of completely specified functions.

Some features of each of the algorithms are not com- parable. For example, the GZA method can handle very large weakly specified, incompletely specified func- tions and their multiple-valued equivalents. On the other hand, our algorithm was designed mainly for exact minimisation of a system of completely specified functions with various optimisation criteria. Also our method can search the solution with a total restricted number of termdliterals or the best solution in the number of terms or literals separately. This explains why for some benchmark functions the results in terms of the number of terms are the same for the algorithms compared, but our algorithm still can find a better result in the number of literals for some polarity. For systems of functions, our algorithm tries to find as many overlapping terms as possible so as to minimise the cost of the final solution. Besides being exact for completely specified functions, our algorithm is also

IEE Proc.-Conzput. Digit. Tech.. Vol. 145. No. 6, November 1998

adaptable to various cost functions which is lacking in many existing minimisers.

7 Conclusions

Details of the data structure and implementation of an adaptive algorithm for the exact minimisation of fixed- polarity Reed-Muller expansions of multiple output completely specified boolean functions have been pre- sented. The described data structure is based on alge- braic ternary decision trees combined with lookup tables. This article described an adaptive algorithm for minimisation of Reed-Muller expansions based on dif- ferent optimisation cost criteria including testability. Theoretically any cost functions of the form awl + bw, + en, where a, b, c are integer constants are allowed. For convenience, our current implementation attempts to search for all the optimal FPRM expansions that meet the user-specified primary optimisation criterion based on the requirements of a specific target device. Among those optimal polarities, further minimisation is performed according to the secondary criterion, if any. The primary and secondary criteria may be any of wl, wp or n,. There is also an option to allow the user to specify some upper bounds on wI and wp. To the best of our knowledge, an exact algorithm having flexible user specified criteria has been proposed for the first time by us. Our program will search for such polarities that fulfill the requirements and produce FPRM expan- sions of those polarities. Since the number of vertices in

393

Page 10: Adaptive exact optimisation of minimally testable FPRM expansions

ATDT for the current implementation is equal to 1/ 2(3n-k+’ - 1) and each of the 3fl-k leaves points to an array of size m, the space complexity of our algorithm is O(m x 3fl-k). On the average ATDT is traversed 2” -

1 times, thus the time complexity is O(2” x 3fl-k). For large boolean functions, the time and space complexity of the algorithm can be improved by collapsing the algebraic ternary decision tree to a reduced ternary decision diagram with attributed edges.

In addition, our algorithm can be used as an effective preprocessor for such methods of ESOP minimisation that start from a near-minimal fixed-polarity Reed- Muller cxpansion as an initial solution [30]. Such a possibility is applicable in the optimisation of Reed- Muller universal logic modules (ULMs) [6, 31, 321. For example. in the recent paper [32], instead of using the zero-polarity Reed-Muller form as the initial expres- sion, the best polarity expansion obtained with our algorithrn could further reduce the total number of ULMs. The results of the research summarised here can serve as a basis for assessing the quality of various heuristic minimisers.

8 Acknowledgment

The authors would like to thank G. Holowinski and K. Malecki from the Technical University of Szczecin in Poland for providing experimental results of their imdemeintation of Zakrevskii’s algorithms.

9

1

2

3

4

5

6

7

8

9

References

CHANG, C.H., and FALKOWSKI, B.J.: ‘Flexible optimization of fixed polarity Reed-Muller expansions for multiple output compleely and incompletely specified Boolean functions’. Pro- ceedings of the IEEE/IEICE Asia and South Pacific conference on Design automation, ASP-DAC’95, Makuhari, Chiba, Japan, Aug. 1995, pp. 335-340 CSANICY, L., PERKOWSKI, M.A., and SCHAEFER, I.: ‘Canonical restricted mixed-polarity exclusive-OR sums of prod- ucts arid the efficient algorithm for their minimization’, IEE Proc.-Comput. Digit. Tech., 1993, 140, ( I ) , pp. 69-77 DAVIO, P., DESCHAMPS, J.P., and THAYSE, A.: ‘Discrete and switching functions’ (George and McGraw-Hill, New York, 1978) FISHER, L.T.: ‘Unateness properties of AND-Exclusive-OR logic cl-cuits’, IEEE Trans., 1974, C-23, (2), pp. 166-172 FLEISIIER, H., TAVEL, M., and YEAGER, J.: ‘A computer a1goritk.m for minimizing Reed-Muller canonical forms’, IEEE Trans., 1987, C-36, (2), pp. 247-250 GREEN, D.: ‘Modern logic design’ (Addison-Wesley, Woking- ham, VIA, 1986) GREEN, D.: ‘Reed-Muller canonical forms with mixed polarity and their manipulations’, IEE €‘roc.-Comput. Digit. Tech., 1990, 137, ( I ) , pp. 103-113 KODANDAPANI, K.L., and SETLUR, R.V.: ‘A note on mini- mal Reed-Muller canonical forms of switching functions’, IEEE Trans., 1977, C-26, (3), pp. 310-313 LIN, T.L., and TRAN, A.: ‘Minimization of multiple-output exclusiye-OR switching functions’, Int. J. Electron., 1993, 75, (4), vv. 665-674

14

15

16

17

18

19

20

21

22

23

SASAO, T.: ‘Optimization of Pseudo-Kronecker expressions using multiple-place decision diagrams’, IEICE Trans. Inf: Syst.,

DAS, D.K., CHAKRABORTY, S., and BHATTACHARYA, B.B.: ‘Universal and robust testing of stuck-open faults in Reed- Muller canonical CMOS circuits’. Proceedings of the 3rd IFIP WG10.5 workshop on Applications of the Reed-Muller expansion in circuit design, Reed-Muller ’97, Oxford, UK, Sep. 1997, pp. 259-268 ALMAINI, A.E.A., THOMSON, P., and HANSON, D.: ‘Tabu- lar techniques for Reed-Muller logic’, Int. J. Electron., 1991, 70,

FALKOWSKI, B.J., and PERKOWSKI, M.A.: ‘On the calcula- tion of generalized Reed-Muller canonical expressions from dis- joint cube representation of Boolean functions’. Proceedings of the 33rd IEEE midwest symposium on Circuits and systems, Cal- gary, Alberta, Aug. 1990, pp. 1131-1134 DRECHSLER, R., THEOBALD, M., and BECKER, B.: ‘Fast OFDD-based minimisation of fixed polarity Reed-Muller expres- sions’, IEEE Trans., 1996, C 4 5 , (Il), pp. 12941299 SASAO, T., and IZUHARA, F.: ‘Exact minimization of AND- EXOR expressions using multi-terminal EXOR ternary decision diagrams’. Proceedings of the 2nd IFIP WG10.5 workshop on Applications of the Reed-Muller expansion in circuit design, Reed- Muller ’95, Makuhari, Chiba, Japan, Sep. 1995, pp. 213-220 SASAO, T., and IZUHARA, F.: ‘Exact minimization of FPRMs using multi-terminal EXOR TDDs’ in SASAO, T., and FUJITA, M. (Eds.): ‘Representations of discrete functions’ (Kluwer, Bos- ton, MA, 1996) TSAI, C.C., and MAREK-SADOWSKA, M.: ‘Minimization of fixed polarity ANDKOR canconical network‘, IEE Proc. -Com- put. Digit. Tech., 1994, 141, (6), pp. 369-374 ZAKREVSKIJ, A.: ‘Minimum polynomial implementation of systems of incompletely specified Boolean functions’. Proceedings of the 2nd IFIP WG10.5 workshop on Applications of the Reed- Muller expansion in circuit design, Reed-Muller ‘95, Makuhari, Chiba, Japan, Sep. 1995, pp. 250-256 ZAKREVSKIJ, A.: ‘Minimizing polynomial implementation of

1993, E76-D, ( S ) , pp. 562-570

( I ) , pp. 23-34

weakly specified logic functions and systems’. Proceedings of the 3rd IFIP WG10.5 workshop on Applications of the Reed-Muller expansion in circuit design, Reed-Muller ’97, Oxford, UK, Sep. 1997, pp. 157-165

24 ZAKREVSKIJ, A., JAROSZEWICZ, D., and YANUSHKEV- ICH, S.: ‘Minimization of Reed-Muller expansions for systems of incompletely specified MVL functions’. Proceedings of the 3rd international symposium on Methods and models in automation and robotics, Miedzyzdroje, Poland, Sep. 1996, Vol. 3, pp. 1085- 1090

25 HOLOWINSKI, G., and YANUSHKEVICH, S.: ‘Fast heuristic minimization of MVL functions in generalized Reed-Muller domain’. Proceedings of the 3rd international conference on Applications of computer systems, Szczecin, Poland, Nov. 1996, pp. 57-64

26 HOLOWINSKI, G.: ‘Parallel version of generalized Zakrevskij’s algorithm for minimization of incompletely specified multi-valued logic functions’. Proceedings of the international conference on Pattern recognition and information processing, Minsk, Belarus, PRIP ’97, 1997, pp. 332-339

27 FALKOWSKI, B.J., and CHANG, C.H.: ‘Generation of fixed polarity Reed-Muller expansions from subset of Walsh spectral coefficients for completely specified Boolean functions’. Proceed- ings of the 5th workshop on Spectral techniques, Beijing, China, Mar. 1994, pp. 214-219

28 FALKOWSKI, B.J., and CHANG, C.H.: ‘An exact minimizer of fixed polarity Reed-Muller expansions’, Int. J. Electron., 1995, 79, (4) pp. 389409

29 FALKOWSKI, B.J., HOLOWINSKI, G., and ,MALECKI, K.: Effective minimization of logic functions in Reed-Muller

domain’. Proceedings of the 4th International conference on Applications . ~~~ of computer systems, Szczecin, Poland, Nov. 1997,

~

10 McKEI~ZIE, L., ALMAINI, A.E.A., MILLER, J.F., and pp. 248-255 THOMSON, p,: ‘Optimisation of Reed-Muller logic functions’, 30 TRAN, A.: ‘Graphical method for the conversion of minterms to Int. J. Zlectron., 1993, 75, (3), pp. 451466 Reed-Muller coefficients and the minimisation of exclusive-OR

11 PAGE, E.W.: ‘Minimally testable Reed-Muller canonical forms’, switching functions’, IEE Proc.-Comput. Digit. Tech., 1987, 134, IEEE Trans., 1980, C-29, (8), pp. 746750

12 REDDY, S.M.: ‘Easily testable realizations for logic functions’, 31 XU, L., ALMAINI, A.E.A., MILLER, J.F., and McKENZIE, IEEE Trans.. 1972. C-21. (1 1). nn. 1183-1 188 L.: ‘Reed-Muller universal logic module networks’. IEE Proc. -

(2), pp. 93-99

, ~ ,, ~~~ ~~~~ ~~~~

13 SARAISI, A.’, and’PERKOWSK1, M.A.: ‘Fast exact and quasi- minimal minimization of highly testable fixed-polarity AND/ XOR canonical networks’. Proceedings of the 29th ACM/IEEE conference on Design automation, Jun. 1992, pp. 30-35

Comput. Digit. Tech., 1993, 146, (2), pp. 105-108 32 TAN, E.C., and CHIA, C.Y.: ‘Alternative algorithm for optimi-

sation of Reed-Muller universal logic module networks’, IEE Proc.-Comput Digit. Tech., 1996, 143, (6), pp. 385-390

394 IEE Proc.-Comput. Digit. Tech., Vol. 145, No. 6, November 1998


Recommended