on the solution of boolean and pseudo-boolean relations

3
IEEE TRANSACTIONS ON COMPUTERS, OCTOBER 1974 Corresponaence. On the Solution of Boolean and Pseudo-Boolean Relations GEORGE J. KLIR Abstract-This correspondence deals with collections of n binary relations between Boolean and/or pseudo-Boolean functions which are combined by an n-ary relation. A new algorithm is described for solving these relations. Index Terms-Boolean relations, pseudo.Boolean relations. INTRODUCTION It seems that the idea of simultaneous logic equations, a special case of Boolean relations, was first suggested by George Boole (1815-1864) as early as 1854 [1]. He developed a method for solving simultaneous logic equations, and argued that logic equa- tions represent a general tool for formalizing laws of thought. Al- though his method is rigorous and general, it had taken more than a century before applications of logic equations started to be appre- ciated. Various methods for solving simultaneous logic equations as well as some of their applications were suggested in the late 1950's and in the 1960's [2]-[8]. Although the equations are usually called "Boolean equations," in honor of George Boole, the founder of modern symbolic logic, there is no evidence that the people who developed these methods were aware of the ingenious contribution of George Boole to this subject area. The story of George Boole is almost parallel to that of Charles Babbage (1792-1871), whose brilliant idea of a general-purpose digital computer had been ignored for more than 100 years [9]. In the case of Babbage, the failure of recognition of his idea was pri- marily caused by an incompatibility of his design with the tech- nological resources available then; in the case of Boole, his idea was incompatible with the available computing facilities, especially in the area of discrete mathematics. A climax in the development of the theory and applications of simultaneous Boolean equationts in the 1960's was reached when Hammeer and Rudeanu published their remarkable monograph [10]. An extension of Boolean equations to pseudo-Boolean equations and inequalities is an important contribution of these authors. Other authors developed extensions to multiple-valued logics [ll ]-L13]. Methods suggested in [10] are primarily based on algebraic manipulations. As such, they are cumbersome for manual processing and inconvenient for computer processing. As a result, the appli- cability of Boolean or pseudo-Boolean equations is seriously limited to a small number of variables and a small number of equations. Unfortunately, it turns out that most practical problems are far beyond these limits. It seems that these practical restrictions have been the primary reason for the so far demonstrated lack of interest in using Boolean or pseudo-Boolean equations. The available methods have not been of much use for solving real-world problems. The purpose of this correspondence is as follows. 1) To generalize simultaneous Boolean equations to sets of any binary Boolean and/or pseudo-Boolean relations which are combined by an n-ary relation. 2) To describe a new algorithm for solving these relations which is attractive from the standpoint of required memory space. NOTATION AND CONCEPTUAL FRAMEWORK "Boolean variable" will be used here as a name for any variable whose values are taken from the set B = {0,1 t. "Boolean function of n variables" will then be -used as a name for any mapping Bn -* B, where Bn represents the Cartesian product of n sets B. Siinilarly, Manuscript received August 23, 1972; revised June 4, 1973. This work was supported by the Research Foundation of the State University of New Ykork. The author is with the School of Advanced Technology, State Uni- versity of New York, Binghamton, N. Y. 13901. "pseudo-Boolean function of n variables" will be used as a name for any mapping Bn -* R, where R is a set of real numbers. The con- ventional notation f (v1,v2, * . ,vn), g (vl,v2 ... ,vN), etc., will be used for Boolean and pseudo-Boolean functions of variables V1,V2, ...Vn- An element of Bn will be called a state of the corresponding Boolean variables. Individual states of variables vI,V2, *-v. will sometimes be represented by their state identifiers, determined by the formula n s= X 2i-1 i21 where bi stands for a particular value (either 0 or 1) of variable vi. Using the concept of the state identifier s, Boolean and pseudo- Boolean functions can be denoted f(s), g (s), etc. A set of Boolean variables may be partitioned into independent and dependent variables. Independent variables, which will be denoted xi,x2,** ,x,, are those which can assume all possible states (all elements of BP) independently of other variables. Dependent variables, which will be denoted y1,y2,-* ,yq, are those whose values depend on the values of the independent variables. Although it is not necessary, Boolean functions are usually repre- sented by Boolean expressions containing the following. 1) Symbols of participating Boolean variables. 2) Elements of set B. 3) Symbols * (may be omitted), v, and - (overbar), which stand for logic operations AND, OR, and NOT, respectively. 4) Parentheses which specify an order of execution (composition) of participating logic operations. If not specified otherwise by parentheses, it will be assumed that the operations are executed in the order NOT, AND OR. Pseudo-Boolean functions will be represented by pseudo-Boolean expressions containing the following. 1) Symbols of participating Boolean variables. 2) Numbers from the set R. 3) Symbols - (may be omitted), - (overbar), +,- (minus), which stand for logic AND, NOT, and arithmetic addition and sub- traction, respectively. 4) Parentheses which specify an order of execution of partici- pating operations. If not specified otherwise by parentheses, it will be assumed that the operations are executed in the order NOT, AND, addition, or subtraction. "Boolean relation of n variables" will be used as a name for a subset of Bn. Boolean relations of variables v1,v2, *. ,vn will be denoted 4' (vI,V2,v ., ,vn), * (vI,v2,... ,vn), etc. 4 (s) may be used instead of 4' (v1,v2,.. ,vn) for convenience. As a convention, Greek letters will be reserved for relations, while lowercase italic letters will be used for functions, variables, identifiers, indices, etc. In the case of binary relations (n = 2), the symbol of the relation may be put between symbols of the two variables, e.g., V14>V2,ViIV2. Examples of Boolean relations are v, = V2,V1 < V2,V1 v V2, AND (V1,V2,. * ,Vn), and MAJORITY (vI,v2,.-- ,vn). Observe that a Boolean function of n varia- bles can be interpreted as a Boolean relation of n + 1 variables. "Boolean relation 4' of m functions of n variables" will be used as a name for such a subset of Bn which contains only those states s of the respective variables for which 4'(fl(s),f2(s), - fm (s)) is satisfied. "Discrimination function of a relation 4>(s)" will be used as a name for the Boolean function d (s) defined as follows: d)= if s C 4(s) d (s)= {0, otherwise. PROBLEM STATEMENT Let xl,x2,. ,xp and Y1,Y2,. ,yq be independent and dependent Boolean variables, respectively. Let fi (X1,X2, * Xp,Y1,Y2, * *,Yq)(bi9i 414x2, * *,XpyY1,Y2, * *,'Yq),2 ( i = 1,2,... ,n be a set of n Boolean and/or pseudo-Boolean relations which are mutually related by a given relation 4c(d1(xj,x2,. ,Xp,Yl,y2,** , ,y),. . .,dn (x1,x2,. . .x,py,,y2,* . .,yq) (2) 1098

Upload: gj

Post on 22-Sep-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: On the Solution of Boolean and Pseudo-Boolean Relations

IEEE TRANSACTIONS ON COMPUTERS, OCTOBER 1974

Corresponaence.

On the Solution of Boolean and Pseudo-Boolean Relations

GEORGE J. KLIR

Abstract-This correspondence deals with collections of n binaryrelations between Boolean and/or pseudo-Boolean functions whichare combined by an n-ary relation. A new algorithm is described forsolving these relations.

Index Terms-Boolean relations, pseudo.Boolean relations.

INTRODUCTION

It seems that the idea of simultaneous logic equations, a specialcase of Boolean relations, was first suggested by George Boole(1815-1864) as early as 1854 [1]. He developed a method forsolving simultaneous logic equations, and argued that logic equa-tions represent a general tool for formalizing laws of thought. Al-though his method is rigorous and general, it had taken more than acentury before applications of logic equations started to be appre-ciated.Various methods for solving simultaneous logic equations as well

as some of their applications were suggested in the late 1950's andin the 1960's [2]-[8]. Although the equations are usually called"Boolean equations," in honor of George Boole, the founder ofmodern symbolic logic, there is no evidence that the people whodeveloped these methods were aware of the ingenious contribution ofGeorge Boole to this subject area.The story of George Boole is almost parallel to that of Charles

Babbage (1792-1871), whose brilliant idea of a general-purposedigital computer had been ignored for more than 100 years [9]. Inthe case of Babbage, the failure of recognition of his idea was pri-marily caused by an incompatibility of his design with the tech-nological resources available then; in the case of Boole, his idea wasincompatible with the available computing facilities, especially inthe area of discrete mathematics.A climax in the development of the theory and applications of

simultaneous Boolean equationts in the 1960's was reached whenHammeer and Rudeanu published their remarkable monograph [10].An extension of Boolean equations to pseudo-Boolean equations andinequalities is an important contribution of these authors. Otherauthors developed extensions to multiple-valued logics [ll]-L13].Methods suggested in [10] are primarily based on algebraic

manipulations. As such, they are cumbersome for manual processingand inconvenient for computer processing. As a result, the appli-cability of Boolean or pseudo-Boolean equations is seriously limitedto a small number of variables and a small number of equations.Unfortunately, it turns out that most practical problems are farbeyond these limits. It seems that these practical restrictions havebeen the primary reason for the so far demonstrated lack of interest inusing Boolean or pseudo-Boolean equations. The available methodshave not been of much use for solving real-world problems.The purpose of this correspondence is as follows.1) To generalize simultaneous Boolean equations to sets of any

binary Boolean and/or pseudo-Boolean relations which are combinedby an n-ary relation.

2) To describe a new algorithm for solving these relations whichis attractive from the standpoint of required memory space.

NOTATION AND CONCEPTUAL FRAMEWORK

"Boolean variable" will be used here as a name for any variablewhose values are taken from the set B = {0,1 t. "Boolean functionof n variables" will then be -used as a name for any mapping Bn -* B,where Bn represents the Cartesian product of n sets B. Siinilarly,

Manuscript received August 23, 1972; revised June 4, 1973. This workwas supported by the Research Foundation of the State University ofNew Ykork.The author is with the School of Advanced Technology, State Uni-

versity of New York, Binghamton, N. Y. 13901.

"pseudo-Boolean function of n variables" will be used as a namefor any mapping Bn -* R, where R is a set of real numbers. The con-ventional notation f (v1,v2, * . ,vn), g (vl,v2 ... ,vN), etc., will be usedfor Boolean and pseudo-Boolean functions of variables V1,V2, ...Vn-An element of Bn will be called a state of the corresponding Booleanvariables. Individual states of variables vI,V2, *-v. will sometimes berepresented by their state identifiers, determined by the formula

ns= X 2i-1

i21

where bi stands for a particular value (either 0 or 1) of variable vi.Using the concept of the state identifier s, Boolean and pseudo-Boolean functions can be denoted f(s), g (s), etc.A set of Boolean variables may be partitioned into independent

and dependent variables. Independent variables, which will bedenoted xi,x2,** ,x,, are those which can assume all possible states(all elements of BP) independently of other variables. Dependentvariables, which will be denoted y1,y2,-* ,yq, are those whose valuesdepend on the values of the independent variables.Although it is not necessary, Boolean functions are usually repre-

sented by Boolean expressions containing the following.1) Symbols of participating Boolean variables.2) Elements of set B.3) Symbols * (may be omitted), v, and - (overbar), which stand

for logic operations AND, OR, and NOT, respectively.4) Parentheses which specify an order of execution (composition)

of participating logic operations.If not specified otherwise by parentheses, it will be assumed that

the operations are executed in the order NOT, AND OR.Pseudo-Boolean functions will be represented by pseudo-Boolean

expressions containing the following.1) Symbols of participating Boolean variables.2) Numbers from the set R.3) Symbols - (may be omitted), - (overbar), +,- (minus),

which stand for logic AND, NOT, and arithmetic addition and sub-traction, respectively.

4) Parentheses which specify an order of execution of partici-pating operations.

If not specified otherwise by parentheses, it will be assumed thatthe operations are executed in the order NOT, AND, addition, orsubtraction.

"Boolean relation of n variables" will be used as a name for asubset of Bn. Boolean relations of variables v1,v2, *. ,vn will bedenoted 4' (vI,V2,v., ,vn), * (vI,v2,... ,vn), etc. 4 (s) may be usedinstead of 4' (v1,v2,.. ,vn) for convenience. As a convention, Greekletters will be reserved for relations, while lowercase italic letterswill be used for functions, variables, identifiers, indices, etc. In thecase of binary relations (n = 2), the symbol of the relation may beput between symbols of the two variables, e.g., V14>V2,ViIV2. Examplesof Boolean relations are v, = V2,V1 < V2,V1 v V2, AND (V1,V2,.* ,Vn), andMAJORITY (vI,v2,.-- ,vn). Observe that a Boolean function of n varia-bles can be interpreted as a Boolean relation of n + 1 variables.

"Boolean relation 4' of m functions of n variables" will be used asa name for such a subset of Bn which contains only those states s ofthe respective variables for which 4'(fl(s),f2(s),- fm (s)) issatisfied.

"Discrimination function of a relation 4>(s)" will be used as aname for the Boolean function d (s) defined as follows:

d)=if s C 4(s)d(s)=

{0, otherwise.

PROBLEM STATEMENT

Let xl,x2,. ,xp and Y1,Y2,. ,yq be independent and dependentBoolean variables, respectively. Let

fi (X1,X2, * Xp,Y1,Y2, * *,Yq)(bi9i 414x2, * *,XpyY1,Y2, * *,'Yq),2 (

i = 1,2,... ,n be a set of n Boolean and/or pseudo-Boolean relationswhich are mutually related by a given relation

4c(d1(xj,x2,. ,Xp,Yl,y2,** , ,y),. . .,dn (x1,x2,. . .x,py,,y2,* . .,yq) (2)

1098

Page 2: On the Solution of Boolean and Pseudo-Boolean Relations

CORRESPONDENCE

where di stands for a discrimination function defined for I), (i =1,2, .*,n). The problem consists in determining such functions=IkW3(~i,~2,. . (3)

which, when substituted for yi (j = 1,2,.-. ,q) to (1), satisfy

relations (1) for each state of the independent variables x1,X2, ,xp

in accordance with the relation 4). Each particular set of functions

(3) is regarded as the solution of relations (1) subject to relation

the superscript k = 1,2,--- is used to mark different sets of

tions wj in case the solution is not unique.

ALGORITHM

In all of the known methods for solving the first problem,

steps can be recognized.Step 1: A single discrimination function is determined for

given relations 4)i (i = 1,2,.-. ,n) subject to relation (D. This

by determining discrimination functions di for the individual

tions 4)i (i = 1,2,.--,n) first, and then determining for the relation

4)(di,d2,-. ,d.) a discrimination function d. States for

d(s) = 1 satisfy relations ti(i = 1,2,-.- ,n) subject to relation

all other states do not satisfy them. For instance, if are

taneous equations, then

[1, if fi (s) = gi(s)

di(s) =

10, otherwiseand

n

d(s) = II di(s).i=1

Step 2: Discrimination function d is analyzed to determine

tions (3). Quite diverse approaches to implementing this

used in different methods.Step 1 is conceptually very simple, but is associated

tational difficulties consisting primarily of a large memory

needed for storing the discrimination functions. Indeed, the number

2P+q of states of the involved variables grows rapidly with

ing number p + q of the variables.

Step 2 is also associated with serious computational difficulties

the number of solutions is too large. It is well known

the number N of solutions of (1) is given by the inequalities

0 <N 2q2P

where the least upper bound2sq2P is, indeed, a large number,

for a modest number of variables.

While all of the known algorithms start Step 2 after Step

completed for all states of the involved variables, the new algorithm,

which is suggested in this correspondence, proceeds to

diately after Step is completed for a single state of the independent

variables and all states of the dependent variables. When

completed for this subspace, the algorithm returns to Step

executes it for another state of the independent variables.

algorithm terminates when all states of the independent variables

are exhausted.Thus only2-. of the memory space required by other algorithms

is needed when the proposed algorithm is used. Another

of the new algorithm consists of a new way of implementing

which makes it possible to manage problems with considerably

solutions than those manageable by other methods.

The basic philosophy of implementing Step 2 consists

mining one of the following values for each of the functionsWW(82),i =22 - .,q and a fixed statekl of the independent

O

ifw(s) =0 ;

lif 1(l

1;2 ifwj(s) is a DON'T CARE state;3 if wi (§) is a DON'T CARE state, but the values (s

related to values of Wk(§S), k j; such a state will be DON'T

CARE state with restrictions;4 if

&.does not belong to the domain of the function(ss).

The proper value w3 (§) for a particular pair(s,,J) is determined

on the basis of the values of the discrimination function(s,s,8for a fixed s, andsv == 01, - 1 in two steps.

1) Values of d(sz,8y) are determined for such states

ys = 0 and such states 8y that y2 = 1. Each of these

values is tested for: a) all zeros, b)2a-1 ones, c) some zeros

ones. A proper value of w, (ks,) can be identified for each pair of these

cases as follows:

Yi = 1

a) b) c)a) [4 1 11

y1=(0 b) 0 2 3 =T.

c) o 3 3

It can be easily proven that the values 0,1,2,4 in the matrix T arefinal values of wj(AS), while the value 3 (a DON'T CARE state withrestrictions) may sometimes be modified to 2 (a real DON'T CAREstate). This is a great advantage since it is much easier to workwith real DON'T CARE states rather than DON'T CARE states withrestrictions. Therefore, if wj(S5) = 3 for a fixed ., and some j, weapply the following correction procedure.

2) Individual subspaces of the space of all states of the dependentvariables are determined. We may modify all values 3 in wj(52),j = 1,2,- *,q, from 3 to 2 if and only if d (k,s,) = 1 exactly in thestates sy, representing a subspace of the space of all states sy.

It will be assumed that in the algorithm to be described, Booleanof pseudo-Boolean functions fi,g,,di (i = 1,2,- ,n) and d will berepresented by matricesFi,Gi,Di,D, in which rows and columns areassociated, respectively, with states of the dependent and independ-ent variables. A natural one-to-one correspondence will be used toassign states of the respective variables to rows or columns of thematrices. If s, and s, represent the state identifiers of dependent andindependent variables, respectively, then row a (a= 0,1,*. ,22 - 1)will be assigned to state s, = a and vice versa; similarly, columnb (b = 0,1,.. *2P - 1) will be assigned to state sc = b and viceversa. Then, clearly, if a matrix F represents a Boolean or pseudo-Boolean function f, then the element of F in rows s, and column s,stands for f(s) wheres = s, X 2P + s, and p is the number of inde-pendent variables.The matrices described above are, essentially, the same constructs

as the Marquand charts used in the Svoboda method [6].Now we are able to describe more precisely the above-outlined

algorithm for the solution of Problem 1. Although no programminglanguage is used, the following features of APL language are em-

ployed for convenience: vector and matrix operations are used,M[a;b] stands for the elementma,b of matrix M, M[;b] representscolumn b of matrix M.Algorithm: Given (1) and (2) to determine (3).

Step 1:1)s. 4-1-.

2) s., s + 1.3)s,1 .4) s,, <-sy+ 1.5) i-0.6) i-i+1.7) Calculate Dj[sy1;sr].8) If i <n, go to 6.9) Calculate D[sy;sj].

10) If sy <27-1,goto4.

Step 2:11) Let a matrix T be defined as

4 1 1

T= 02 3

0 3 312) j.-0.13) j ^+-j1.14) u --DEg(yi= 0),sr] where 8y(yj= 0) stands for thosestates of the dependent variables in whichyj = 0.15) v<-D[s(y; = I);s.] wheres(y(yj = 1) stands for thosestates of the dependent variables in which yi = 1.16) Y[ j;s] I-T[r;c] where r= 0 if u contains only zeros,r = 1 if u contains2q-1 ones, r= 2 otherwise; similarly, c = 0if v contains only zeros, c = 1 if v contains2a-1 ones, c = 2otherwise.17) If j <q,gotol13.18) IfY[;sx ] does not contain any 3, go to 2.19) IfD[;sx ] does not contain a power of two ones, go to 2.20) E-;3= Y[;s.].21) t -0.22) t1-t+1.

1099

Yi kWi (XI,X2, ' ' ' yXp) (3)

Page 3: On the Solution of Boolean and Pseudo-Boolean Relations

IEEE TRANSACTIONS ON COMPUTERS, OCTOBER 1974

23) Determine for the ternary number t = t2tv_ - t1 such aconjunction zt of sy (y =,0) and sy(yj = 1), j = 1,2,-.,q inwhich sv,(y, = 1) or s, (y, = 0) participate if t, = 1 or t, = 2,respectively.24) If Zt D[;s..], go to 27.25) If t < 3 - 1, go to 22.26) Go to 28.27) Y[;s.] -- Y[;s8]- E.28) If s15 < 2v-1, go to 2.29) Print D and Y.30) Stop.

CONCLUSIONS

It was shown elsewhere [10], [16] that Boolean and pseudo-Boolean relations can be used in many problems associated withlbgic design. As such, they have a considerable effect on developinga unified methodology of logic design. This, in turn, has a positiveeffect on research as well as education in this area.The development of powerful methods and computer programs

facilitating solutions of Boolean or pseudo-Boolean relations withmany variables is essential to make this tool appealing to the logicdesigner. Progress in this respect is reported in this correspondence.A new method for solving Boolean and/or pseudo-Boolean rela-

tions was described, which is attractive from the standpoint ofrequired memory space and provides the user with a compact formof the solution. Further refinements of the solution are possible.For instance, DON'T CARE states with restrictions can be identifiedby parameters, as suggested by Brown [14]. However, it was notintended to include such aspects in this correspondence.

REFERENCES[11 G. Boole, An Investigation of the Laws of Thought. New York:

Dover, 1958. (Originally published by Macmillan in 1854.)[2] R. S. Ledley, Digital Computer and Control Engineering. New

York: McGraw-Hill, 1960, ch. 12-14.[3] G. J. Klir, "Solution of systems of Boolean equations" (in Czech),

Aplikace Matematiky, vol. 7, no. 4, pp. 265-271, 1962.14] K. K. Maitra, "A map approach to the solution of a class of Boolean

equations," Commun. Electron., vol. 59, pp. 34-36, 1962.[5] S. Rudeanu, "Boolean equations and their applications to the

study of bridge-circuits," Bull. Math. Soc. Sci. Math. Phys. R. P. R.,vol. 3(51), no. 4, pp. 445-473, 1959.

[6] A. Svoboda, "An algorithm for solving Boolean equations," IEEETrans. Electron. Comput., vol. EC-12, pp. 557-559, Oct. 1963.

[71 H. Wang, "Circuit synthesis by solving sequential Boolean equa-tions," Z. Math. Logic and Grundlagen der Math., vol. 5, pp. 291-322,

[81 M. Phister, Jr., Logical Design of Digital Computers. Now York:Wiley, 1958, Appendix I, ch. 5, 6.

[9] J. Bernstein, The Analytical Engine. New York: Random House,1963.

[10] P. L. Hammer and S. Rudeanu, Boolean Methods in Operations Re-search. New York: Springer-Verlag, 1968.

[111 G. J. Klir and L. K. Seidl, Synthesis of Switching Circuits. London:ILIFFE, 1968 and New York: Gordon and Breach, 1969.

[121 B. Zavisca, "Synthesis techniques in multiple-valued logic systems,"Ph.D. dissertation, Dep. Elec. Eng., State Univ. New York, Buffalo,Sept. 1970.

[13] D. D. Givone, 'A method for solution for multiple-valued logicexpressions," IEEE Trans. Comput., vol. C-20, pp. 464-467, Apr.1971.

114] F. M. Brown, "Reduced solutions of Boolean equations," IEEETrans. Comput., vol. C-19, pp. 976-981, Oct. 1970.

[15] M. Davio and J. P. Deschamps, "Classes of solutions of Booleanequations," Philips Res. Rep., vol. 24, pp. 373-378, Oct. 1969.

[161 G. J. Klir, Introduction to the Methodology of Switching Circuits.New York: Van Nostrand, 1972.

A Note on Self-Checling Checkers

S. M. REDDY

Abstract-Totally self-checking checkers for k-out-of-(2k + 1),(k + )-out-of-(2k + 1), and k-out-of-2k codes are given. The newcheckers for the k-out-of-2k codes -require only 2k tests to detectall stuck-at faults.

Index Terms-r-out-of-n codes, totally self-checking checkers.

Manuscript received July 10, 1973; revised March 18, 1974. This workwas supported by NSF Grant GK-36377. A preliminary version of this

rwas presented at the Allerton Conference on Circuit and SystemTheory,October 1972.The author is with the Department of Electrical Engineering, Uni-

versity of Iowa, Iowa City, Iowa 52242.

I. INTRODUCTION

Recently there have been some results on the problem of designingtotally self-checking check circuits for m-out-of-n-codes [1]-E63.The results obtained so far solve the problem for k-out-of-2k codesdirectly, and the general case is solved by the intermediate steps ofconverting an m-out-of-n code to a -out-of-Cm' code, which is thenconverted to an appropriate k-out-of-2k code [1]. The choice ofk-out-of-2k code depends on the number of tests required to test thechecker for the k-out-of-2k code and on C,n [1]. For this reason, thedesign of totally self-checking checkers for the 1-out-of-3 and 1-out-of-7 codes has remained open so far.

In this correspondence we will present systematic design algorithmsfor the design of two-level checkers for k-out-of- (2k + 1) and(k + 1)-out-of- (2k + 1) codes, for k > 1, and multilevel checkersfor k-out-of-2k codes that require only 2k test inputs. The newdesign of the checker for the 3-out-of-6 code helps solve the problemof the design of a checker for the 1-out-of-7 code. It can be shownthat if the checkers contain only AND and OR gates, then a totallyself-checking checker cannot exist for the 1-out-of-3 code. Webelieve that no totally self-checking checker exists for the l-out-of-3code.The basic idea in designing two-level checkers for k-out-of- (2k + 1)

codes is to first convert the k-out-of- (2k + 1) code into a 1-out-of-Ck1k+1 code by using one level of AND gates, as suggested earlier [1],and then converting the 1-out-of-Ck'l+1 code into a 1-out-of-2 codeusing one level of OR gates. The proposed checkers are totally self-checking for unidirectional faults. It is further indicated that thetest sets proposed detect all stuck-at faults in the checkers. Thislatter result is important for acceptance testing of the checkers.

II. CHECKERS FOR k-OUT-OF-(2k + 1) CODES

A k-out-of- (2k + 1) code is the set of binary (2k + 1 )-tuples withexactly k ones. As indicated earlier, we convert a k-out-of- (2k + 1)code word to a word in a 1-out-of-Ck2k+l by using Ck2k+l AND gates.As an example, Fig. 1 gives the converting network for a 2-out-of-5to a 1-out-of-10 code. Notice that each AND gate output is one forexactly one binary k-tuple in the k-out-of- (2k + 1) code. To convertthe 1-out-of-CkSk+l code into the 1-out-of-2 code, we use two OR gateswhose inputs are connected to the outputs of the AND gates in such away that the output of an AND gate is connected to an input of asingle OR gate. In other words, we have to partition the set of ANDgates into two disjoint sets.We will use the following notation to indicate the partitioning of

the AND gates into two disjoint subsets. Since each AND gate outputis one for only one input in the k-out- (2k + 1) code, we see thatthere is a one-to-one correspondence between the words of this codeand the AND gates. We choose to work with the code words, and wewill indicate a word in the code when we want to indicate an ANDgate. The words in the k-out-of-(2k + 1) code will be representedin two different ways. In the first representation, we give the indicesof the positions in which the word has ones. For example, 1 1 0 0 0is represented by 12 and 1 0 1 1 0 1 0 is represented by 1346. Thesecond way of representation uses a 3-tuple of integers. Let a binary(2k + 1)-tuple be divided into three parts as shown below.

| A B C l

A binary (2k + l)-tuple is then represented by the 3-tuple (a b c)where a, b, and c are the number of ones in the A, B, and C regions,

X1 - IT

X3 - _ _ '__,_

X4- -IELI

X5 _ _ . t 7 _ t

Fig. 1. 2-out-of-5 to 1-out-of-10 converter.

I1100