■A m BsBBsBni HBIffllBI SwK hmboBrB wmaMumBBBSam HU LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN XJLtoT rftf Report No. UIUCDCS-R-72-U9U ?. yTuUZ ON THE REALIZATION OF BOOLEAN FUNCTIONS USING AND AND OR ELEMENTS by Robert Michael Lefler January 1972 DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN URBANA, ILLINOIS ON THE REALIZATION OF BOOLEAN FUNCTIONS USING AND AND OR ELEMENTS* by ROBERT MICHAEL LEFLER January 12, 1972 Department of Computer Science University of Illinois at Urbana-Champaign Urbana, Illinois 61801 Report No. UIUCDCS-R-72-i+9^ *This work was submitted in partial fulfillment of the requirements for the degree of Master of Science in Computer Science, February 1972 Digitized by the Internet Archive in 2013 http://archive.org/details/onrealizationofb494lefl Ill TABLE OF CONTENTS Page ACKNOWLEDGMENT iv 1. INTRODUCTION 1 2. THE APPROACH TO THE PROBLEM 3 THE CLASSIFICATION ALGORITHM 6 ENUMERATING THE THREE-LEVEL CLASSES 9 THE COVERING HEURISTIC 15 PROOF THAT HARVARD CLASS 163 IS NOT FOUR-LEVEL REALIZABLE 18 IMPLICATIONS FOR FUNCTIONS OF FIVE TO SIXTEEN VARIABLES 21 APPENDIX 26 LIST OF REFERENCES 32 iv ACKNOWLEDGMENT I would like to take this opportunity to thank my mentors, i i Dr. Franco Preparata and Dr. David Muller. I would also like to voice a special appreciation to Mr. James Madden and Mr. Albert Meyers for their assistance from time to time in ferreting out some of the more insidious bugs in my various programs. A special note of appreciation also goes to Mrs. Gayanne Carpenter for typing this paper. 1. INTRODUCTION This project arose as an outgrowth of the work of Dr. Franco Preparata and Dr. David Muller with four-variable Boolean functions [l]. It is known that the number of levels required to generate any four-variable Boolean function using arbitrary two-input, one-output logic modules has a least upper bound of four. It is easily shown [2] that the complete set of logic modules realizing all the Boolean functions of two variables is equivalent to the reduced set of the two- input logic elements AND, OR, and EXCLUSIVE OR, provided that the input variables are available in both true and complemented form. However, AND, OR, and EXCLUSIVE OR do not constitute a minimal set of connectives, while AND and OR do (if both forms of each variable are available). Therefore, a reasonable question was whether the same least upper bound held for such a choice of logic elements . Dr. Muller attempted to find four-level realizations for each Ninomiya class which used strictly two-input AND's and OR's, and he found that he could do so for all except the following six (Ninomiya) classes: 39, 58, 103, 112, 1U5, and 181. As it is not difficult to find five- level realizations for each of these, the conjecture was that the least upper bound for the number of levels required to realize four-variable Boolean functions in a system of strictly AND and OR logic elements is five. This paper shall demonstrate that the above conjecture is true by proving that the functions contained in at least one of the above classes cannot be realized in less than five levels. As a by-product of this demonstration, it shall also be demonstrated that there exist functions of two variables and functions of three variables which cannot be realized in less than two levels and four levels, respectively, using AND and OR elements alone (and, hence, the least upper bound on the number of levels required to generate any function of two variables and any function of three variables is two and four, respectively) . This paper shall further demonstrate that the functions belonging to each of the six "suspect" Ninomiya classes can be realized in five levels in a special manner which can then be used to demonstrate that for n in the range 5 to 16, inclusive, the least upper bound on the number of levels required to generate any function of n variables using only AND and OR elements is n + 1. 2. THE APPROACH TO THE PROBLEM The proof that there exists a function of four variables which cannot be realized in fewer than five levels was essentially a proof by contradiction. Suppose that each of the six suspect Ninomiya classes is realizable in four levels. Then a function belonging to any one of those classes can be generated as the AND or the OR of a function belonging to some three-level realizable class with a function belonging to some class realizable in three or fewer levels. Hence, a logical first step would be to establish a complete list of classes whose representative functions could be generated in three levels or fewer, along with a precise least upper bound for the number of levels required for each class. At this point one approach would be to AND and OR all the representative functions of all the classes whose minimum realization required three levels with all the functions belonging to all the classes which could be realized in three levels or fewer. Clearly, this sledgehammer approach would generate all of the functions which could be realized in four levels, but equally clearly this method is unacceptable due to the tremendous amount of effort required. Consequently, a second step in attacking this problem had to be the development of a heuristic to select a subset of the three-level and lower classes whose functions could plausibly combine to form a representative function from any of the six suspect classes. The sledgehammer approach might still be required in some form, but hope- fully a successful heuristic would narrow the number of functions to be tested to a more manageable number. Implicit in the steps described above is the need for a rapid, accurate, encodable algorithm which could take a given function and identify its class (either Ninomiya or Harvard). Hence, before any other work could be done such an algorithm had to be found, encoded, and tested. There were other questions to be dealt with. What representa- tion should be chosen for the individual functions? Would it be better to work with Harvard classes or would Ninomiya classes be easier to handle? The data used in the research was taken from tables in Harrison [3] and Harvard Ik], and as the bulk of the information was taken from the latter, it was simpler to work with the Harvard classes. There are many ways to represent a Boolean function: as a Karnaugh map, as a set of minterms, as a set of points on the unit cube, to name a few. The representation chosen for use with the programs which comprised the bulk of this research was based on a combination of the Harvard notation and the Karnaugh map. In the Harvard notation, a function of four variables is described as a set of decimal numbers in the range zero to fifteen, with zero corresponding to the minterm x..XpX Xi , one corresponding to the mintern x^x Xi , until fifteen, which corresponds to the mintern x, XpX x> . The ampping from the Harvard notation to the sixteen possible minterns is not difficult to follow if done in two steps. Consider the binary equivalents of the sixteen decimal numbers used. There is an obvious correspondence between these base two integers and k the set of vertices on the unit cube on E , and between the set of vertices and the set of minterms expressed in the x. notation. The representation used for input to the various programs was as a string of sixteen zeroes and ones, where a one in the i position implied that the minterm described in Harvard notation as the integer i - 1 is in the given function and a zero meant that the respective minterm was missing from the given function. Another way to visualize this representation of the function is to consider a Karnaugh map of the function, modified by interchanging the third row with the fourth row and interchanging the third column with the fourth column. Then the first four elements of the input string are identical with the first row of the modified Karnaugh map, the second four elements are identical with the second row of the modified map, and so forth. This representation could have been packed into a single word of computer memory, but as the various programs were written it became clear that processing time would be a far greater limitation than space so for ease of computation a sixteen-word array was used. 3- THE CLASSIFICATION ALGORITHM The classification algorithm chosen is based on an algorithm set forth in a paper by Jackson in Elspas [2] . This algorithm is based on a description of a function of four variables as a set of vectors to k the vertices of the unit cube on E . Consider a function whose weight (i.e., number of minterms) is less than or equal to eight. There is no penalty attached to this restriction, as functions of weight greater than eight can be handled by dealing with the complementary function. If w is the weight and the minterms are represented in form of a set of vectors to the vertices of the unit cube, then define b n , b , ..., b to be the set of vectors which ' 1 ■ 2' * w - 1 W - describe the function. Now calculate the vector c = — Z b. W i=l x If one were to imagine particles of unit mass attached to the vertices of the unit cube at the end of the vectors, then c would be the vector to the center of mass. Now c can be used to compute w second moments: m = Z W [(b - c) • (b. - c)] 2 for i = 1, 2, ..., w j=l 3 where • is the standard inner product. For ease of computation, the set of vectors a^ = b - c are first calculated, which changes the above equation to: ± ■ (a i • a ) for i = 1, 2, . .., w m 0=1 Although the c-vector is not unique for a given equivalence class of functions, the second moments so calculated are invariant for any class. Jackson found that these moments uniquely identify the class of a function, except for the following cases: Case 1 Case 2 Case 3 H #25 and H #26 have the same moments H #20U and H # 233 have the same moments H #236 and H # 237 have the same moments These cases, however, can be readily resolved. Let F be the function to be identified. If F is a Case 1 function, then define G = F x.. , where 9 is the EXCLUSIVE OR logic connective . If G or its complement (whichever has weight six) belongs to Harvard class 71 then F belongs to Harvard class 26; otherwise, F belongs to Harvard class 25 • If F is a Case 2 function, then again define G = F 9 x 1 . If G belongs to Harvard class 18U, then F belongs to Harvard class 233; otherwise, F belongs to Harvard class 20U. Case 3 is only slightly more difficult to resolve. In this case, define G = F 9 x.. $ x p . Then if G is a Case 2 function, then F belongs to Harvard class 237; otherwise, F belongs to Harvard class 236. Jackson further found that it is not necessary to store all of the moments generated, but that it is sufficient to save only the largest moment, the smallest moment, and the fourth-largest moment (if the weight is greater than four) . This algorithm was modified for use as follows: The first step was to count the number of minterms in the test function. If the weight was zero, one, fifteen, or sixteen, then the function was trivial to classify. If the weight was greater than eight then a program variable was set which caused the routine to deal with the complement of the function. Last, based on the weight it was possible to restrict the search for a match of the moments to just that set of classes with the same weight as the test function. 8 Given a function in the representation adopted, the classifi- cation routine picked off the ones (or the zeroes if the weight had been found to be greater than eight), noted their position in the string, and formed the b-vectors. Next the c-vector was calculated, then from it the a- vectors and finally the moments were computed. As the moments were calculated, the routine kept track of the largest and smallest. If the fourth- largest moment had to be determined, then a special subroutine took the unsorted set of w moments and repeatedly found and eliminated the largest moments until the fourth- largest was found. This was con- siderably faster than doing a complete sort on all the moments . The next part of this routine required a simple sequential lookup. There were three arrays, each four hundred words long, with one containing the respective largest moments for Harvard classes one through four hundred, another containing the respective smallest moments, and the third containing the respective fourth- largest moments. Recall that the minterm- counting part of this routine established bounds on the search (no sense looking for the class of a five-minterm among the classes of four-minterm functions) so that the worst case required only seventy-four comparisons to be made . After classifying the function, the routine checked to see if it fell into one of the three ambiguous cases noted earlier. If so, then special subroutines could be invoked to handle these cases. k. ENUMERATING THE THREE-LEVEL CLASSES If the minimum number of levels required to realize a given function using two-input AMD's and CR's is four, then this minimum realization (which need not be unique) must be either the disjunction or the conjunction of two functions. The minimum realization of one of these two functions requires precisely three levels, while the other function must also be three-level realizable, although its minimum realization may require fewer levels. It follows, therefore, that for the minimum realization of a function to require three levels, it must be the AND or the OR of a function whose minimum realization requires precisely two levels with a afunction whose minimum realization requires at most two levels. Continuing this train of thought makes it clear that a logical first step twoards enumerating the three-level classes would be to enumerate the classes which are zero-level and continue by enumerating the classes which are one-level and the classes which are two -level. The algorithm used for implementing this plan worked as follows: Suppose all the classes are known whose minimum realization requires n levels and all the classes are known whose minimum realization requires n - 1 levels or fewer. Then let S be the set of all functions whose class is precisely n-level (i.e., the minimum realization for any function in the class requires n levels) and let S p be a set consisting of one representative function apiece from each class which can be realized in n levels or fewer. Now AND each of the lements of S, with each of the elements of S 9 and OR each of the elements of S with each of the elements of S p . The contention is that at least one function from 10 each class whose minimum realization requires n + 1 levels will be produced "by this algorithm. To prove this contention, first note that every function generated by this algorithm will be (n + 1) -realizable . Hence, every class which has one or more functions generated by this algorithm will be at worst (n + 1) -realizable, and under the assumed knowledge of which classes are realizable in n levels or fewer, it will be possible to pick out those classes which are precisely (n + l)- realizable . Now suppose that there is some class C which is (n + 1) -realiz- able which does not have a representative function generated by this algorithm. Then if g is a function belonging to C, g can be formed as the AND or the OR of two functions f, and fp such that f_ is precisely n-realizable and f p can be realized n levels or fewer. For convenience, assume that g = f + f p , where + denotes the OR connective, (it makes no difference which connective is chosen--the argument applies equally well to the AND connective.) f. e S, by definition, and since g was not produced by the algorithm it follows that fp € Sp . Now permute and/ or complement the variables in f p to produce fp such that f' e S p and simultaneously perform the same permutations and complementations on f 1 , producing f '. Define g' = f ' + f ' . It is clear that g' bears the following relationship to g: g' is the function which would have been formed if the same permutations and complementations were applied to g as were applied to fp to produce f X . Therefore, g' must also belong to C. But since fp and f^ belong to Sp and S , respectively, then this contradicts the assumption that no functions belonging to C were produced by the algorithm. 11 This algorithm must be applied only 2 (card(S..) • card(S ? )) times, so it was very useful in enumerating the two-level and three- level classes. The zero-level and one-level classes were easy to enumerate by inspection. The zero-level Harvard classes had to be precisely H #0, H #16U, and H #^01. Similarly, inspection indicated that the only one-level Harvard classes were H #12 and H #371- For the two-level classes, S, was composed of all the functions belonging to H #12 and H #371, forty-eight in all, and S~ was composed of one function each from H #12, H #l6U, and H #371 (as H #0 and H #U01 are the degenerate functions and 1, respectively, they could not possibly make any contribution) . This, then, required only 2 • 1+8 • 3 = 288 applications of the algorithm and, hence, it could be done by hand. The two-level classes discovered were H #1, H #2, H #6, H #58, H #116, H #17^, H #20U, H #2U6, H #29U, H #390, H #396, and H #U00 . Note that Harvard class 20U is a function of two variables (to be precise, it is the EXCLUSIVE OR) . As this class cannot be produced in fewer than two levels, it follows that the least upper bound on the number of levels required to produce a function of two variables is two. The algorithm was used again to enumerate the three-level classes. In this case, S.. was composed of all the functions belonging to the twelve classes above, a total of 68U in all, and S p contained 15 functions (one from each of the 12 two-level classes plus H #12, H #16U, and H #371)- This meant that a total of 20,520 applications of the algorithm had to be performed, which in turn meant that a computer would have to be used. 12 It was not possible to push all of the effort onto the computer, however. All the elements of S and all the elements of S 2 had to be generated by hand and punched onto cards. It was possible to nearly halve the effort involved by noting that H #2U6, H #29U, H #390, H #396, and H #U00 are the complementary classes of H #116, H #58, H #6, H #2, and H #1, respectively. Hence, it was necessary to generate only the functions in the first seven classes listed above (H #1 through H #20^) and have the machine complement functions which fell into classes H #1, H #2, H #6, H #58, and H #116. As a check to make certain that no functions were used which were not in the required classes and that the correct number of members of each class were generated, a special computer program was written which read in a deck of cards upon which were punched a series of functions (one per card) and printed back the functions along with their classes. This program also kept a count of the number of functions read in so that it was possible to cross reference the number of functions hand generated with the number of members of each class as indicated in the Harvard tables . The main program which enumerated the three-level classes began by reading the 15 functions which comprised S p , along with their respective classes, and storing them in an array. After that the functions comprising S. were read in one by one from a card deck. The function read in was first ANDed with one function from S p , the result was classified, and the class was checked against a list of previously found classes. If the resultant class had not been generated before (i.e., it was not in the list) then it was added to the list. Next the function and ORed with that same function from S ? and again the resultant function was classified and its class checked against the list. Now if the S.. 1 13 function was not a member of one of the two self -complementary classes (H #17U or H #20U) then it was complemented and once more ANDed and ORed, still with the same function from S ? . After this, the cycle was repeated for each of the remaining ik functions from Sp and then the next function was read in from the S^ deck to be processed. Every time a new three-level class was found, the program also made note of the classes of the two functions which had generated it and the logical connective which had been used. At the end of the computer run, all four items of information --the three-level class, the two classes it had been made from, and the logical connective which had gene- rated it, were printed out. This acted as a second check on the data and served also to help checkout the algorithm. Given that the least upper bound on the number of levels required to generate a function of two variables is two, it is an easy matter to prove that the least upper bound on the number of levels required to generate any function of three variables is four or less. Given g, a function of three variables x. , Xp, and x„, g can be written in the form: g = x 1 f 1 (x 2 ,x 3 ) + x 1 f 2 (x 2 ,x ) Each term in this expansion is realizable in three levels and, hence, their union must take four levels. Can all functions of three variables be realized in fewer than four levels? The answer can be found in the results of this step in the solution of the question of the number of levels required for functions of four variables—certain of the classes 11+ of functions of four variables are actually functions of three variables and one of these classes is Harvard class 236. This class was not among the set of three-level classes discovered by the program and, hence, it cannot be realized in less than four levels. Therefore, the least upper bound on the number of levels required to realize a function of three variables is four. 15 5- THE COVERING HEURISTIC A total of 112 classes were discovered whose minimum realization required three levels . A quick glance at the number of functions in each class indicated that the total number of S. functions for this case would be over 20,000, clearly a number too prohibitive for even a computer to handle. Some heuristic had to be found to cut down on the number of functions to be tested. The heuristic used was named the "covering" heuristic by Dr. Franco Preparata. Consider three functions f .. , f ? , and g such that g = f • f , where • represents the AND connective . Due to the idempotency of the AND operation, every minterm of g must be a mintern of f and also a minterm of f p . That is, g must be "covered" by f_ and by f p . Similarly, suppose there are three functions f . , f p , and g such that g = f + f . Every minterm of f must also be a minterm of g and every minterm of f_ must also be a minterm of f . Hence, g must cover both f, and f _ . It is also true that the sum of the minterms in f and the minterms in f must be greater than or equal to the number of minterms in g. The notation of coverings can be extended to Harvard classes in the following manner: a class C_ can be said to cover a class C p if there exists a function in C, which covers at least one function belonging to Cp . Extending this notion even further, a class C can be said to immediately cover another class C p if C covers C» and the functions in C, have one more minterm than the functions in C p . It was not very difficult to establish for any class those classes which immediately cover it and those which it immediately covers. Suppose there is a function f which has n minterms and belongs to class C. 16 Then to find the classes which C immediately covers merely remove one minterm from f and classify the resultant function. Then, restore that minterm to f and remove another minterm, repeating the process until each minterm has been removed once. It is clear that this process generates all the classes which are immediately covered by the given class. A scheme similar to the above will find those classes immed- iately covering C. Add one minterm to f which is not already in f and classify the resultant function. Then remove that new minterm and add another minterm to f which was not previously in f, and repeat this process for all 16 - n minterms which are not in f . Assume that for every class it is know which classes immediately cover it and which classes it immediately covers. Then for any given class it is possible to list all the classes which cover it by listing those classes which immediately cover it, then those classes which immed- iately cover them, and continuing in this manner until H #^-01 (which covers all classes) is reached. Similarly, it is possible to list all the classes which any given class covers by first listing those classes which it immediately covers, then those classes which they immediately cover, and so forth until at last H #0 is reached. The goal was to list all the functions which cover or are covered by each of the six "suspect" classes. As the notion of coverings is not applicable to Ninomiya classes (for the notion of coverings to have any meaning all functions belonging to the class must have the same number of minterms), for each class the corresponding Harvard class counterpart which had eight or fewer minterms was used. There is no penalty attached to this restriction, as DeMorgan's Law provides a mapping which is 17 one-to-one and onto from the pair of functions and the logical connective which make up a function in the one class to the pair of functions and the logical connective which make up the corresponding function in the complementary class. A program was written and executed which read in one function apiece from each of the k02. classes and made two lists for each class, one containing those classes which immediately covered the given class and the other containing those classes which were immediately covered by the given class. Next a program was written and executed which took these lists and for each of the six classes listed all the classes which covered the given class and all the classes which were covered by the given class, using the method outlined above. 18 6. PROOF THAT HARVARD CLASS 163 IS NOT FOUR -LEVEL REALIZABLE The original assumption in this proof by contradiction was that each of the six suspect classes was four-level realizable. In that case, it must, therefore, be possible to generate a function from any one of those classes as the AND of a three-level realizable function with a function which can be realized in three levels or fewer, both functions belonging to classes which cover the given class, or else as the OR of a three-level realizable function with a function which can be realized in -three levels or fewer, both functions belonging to classes which are covered by the given class. Consequently, if the same algorithm which produced the two-level and three-level classes were to be tried with the reduced sets of classes found via the covering scheme and no function from the given class were to be produced then the assumption that the class is four-level realizable has to be wrong. In selecting a class to work with, it became clear that Harvard class 163 (Ninomiya class 112) would be a good choice as it is covered by only Ik classes which are three-level realizable or lower and it covers only h such. A second glance at the classes it covered revealed that the task would be even easier than that. Harvard class 163 is a seven-minterm class, and of the classes it covers one (H #29) is four-minterm, two (H #3 and H #5) are two-minterm, one (H #1) is one-minterm, and the last is H #0. Recall that for one function, g, to be realizable as the OR of two functions f and f_, the sum of the minterms in f and f must be greater than or equal to the number of minterms in g. Therefore, if a function belonging to H #163 could be realized as the OR of two three-level functions, both functions had to belong to H #29. As Harvard class 29 is 19 comprised of only 12 functions, it was a simple matter to OR 11 of them in turn with the 12th. No functions belonging to Harvard class 163 were produced, and hence, it was clear that Harvard class 163 could not be realized as the OR of functions belonging to three-level realizable classes . To attempt to take advantage of the "minterm counting" heuristic with regard to the AND connective, attention was turned to the comple- mentary class, H #293. Recall that by DeMorgan's Laws if there are functions f , f p , and g such that g = f-,f p then it follows that g = f. + fp, where the bar denotes complementation. Hence, if a function belonging to H #163 can be realized as the AND of two functions belonging to three-level realizable classes, C, and Cp, then the corresponding complementary function belonging to H #293 can be realized as the OR of two functions which belong to the complementary classes of C and C p , respectively. The complementary classes of the classes which cover H #163 are H #0, H #1, H #2, H #3, H #k, H #5, H #6, H #7, H #8, H #13, H #15, H #17, H #29, and H #3^« Harvard class 293 is a nine-minterm class, and of these fourteen classes, one (H #3^) is five-minterm and four (H #13, H #15, H #17, and H #29) are four-minterm. Consequently, if a function belonging to H #293 could be generated as the OR of functions belonging to the list of classes above, then one function had to belong to H #3*+ and the other could belong only to H #13, H #15, H #17, H #29, or H #3^- As Harvard class 3*+ is comprised of only sixteen functions, it was a simple matter to generate all the functions which belong to it by hand and test each against one sample function apiece from the other five classes. No function belonging to Harvard class 293 was among the functions 20 generated by this method, and, hence, it must be impossible to generate a function belonging to Harvard class 163 in four levels using AND and OR logic modules alone. With the number of levels required to realize Harvard class 163 established, it was of some interest to see whether the entire set of four -variable classes could each have their minimal number of required levels established; that is, would it be possible to establish the minimum number of levels for the remaining five suspect classes? Harvard class 163 was, however, a "lucky" class to find to work with. Recall that only twenty-eight functions had to be hand-generated to test all the possible ways Harvard class 163 could be generated in four levels. The next simplest class to work with, Harvard class 215 (Ninomiya class 181), would require the hand-generation of no fewer than *+60 functions and the remaining classes are somewhat worse- -Harvard class 55 (Ninomiya class 39), for example, is covered by a total of forty-six Harvard classes which are realizable in three levels or fewer, and the "reduced" S, set for this class would require over three thousand functions to be hand generated. Obviously, if the minimum number of levels required for the remaining five unknown classes was to be determined then either some efficient means of having the computer generate the required representative functions for the reduced S, set, or else an alternative approach had to be tried. The former approach was attempted, but the author was working under a time limitation and was unable to complete the debugging of the program to generate the required S. functions in his remaining time at the University of Illinois at Urbana-Champaign . Consequently, it is not clear at this time whether the functions belonging to the remaining five unknown classes can be realized in four levels, or whether their minimum realization requires five levels. 21 7- IMPLICATIONS FOR FUNCTIONS OF FIVE TO SIXTEEN VARIABLES Dr. Franco Preparata and Dr. David Muller were able to show [l] that, given that Boolean functions of four variables have a least upper bound of four levels required for their realization under the assumption of arbitrary two-input, one-output logic modules, it is nonetheless possible to realize any four-variable Boolean function in a special way so that it is possible to demonstrate that Boolean functions of n variables can be realized in n levels or fewer for n equal to five, six, seven, or eight. Given that Boolean functions of four variables may require up to five levels for their realization under the more restrictive assumption of only AND and OR logic modules, might it be possible to employ a similar scheme to find a bound on the number of levels required to generate functions of n variables, for some set of values of n greater than four? The first step for Dr. Preparata and Dr. Muller was to show that any function of four variables can be decomposed into the AND of a function of four variables realizable in three levels with a function of four variables realizable in two levels. That is: (1) f(x 1 ,x 2 ,x 3 ,x J+ ) = ^(x 1 ,x 2 ,x 3 ,x lf ) $(x 1 ,x 2 ,x 3 ,x 1+ ) where ¥ is realizable in three levels and is realizable in two levels. As there exists at least one class of functions of four variables which cannot be realized in four levels using strictly AND and OR logic elements, it is clearly impossible to find equivalent decompositions into the product of a three-level realizable function and a two-level realizable function under this restricted assumption. It is possible, however, to 22 find decompositions under the restriction of strictly AND and OR elements for an arbitrary function of four variables into the AND of a four-level realizable function with a two-level realizable function. That is: (2) f(x 1 ,x 2 ,x 3 ,x 1+ ) = ^x-^x^x^x^) d)(x 1 ,x 2 ,x 3 ,x u ) for any function f, where Y is realizable in four levels and is reali- zable in two levels using strictly AND and OR elements. As indicated in the introduction, all four-variable Boolean functions except those falling into the noted six Ninomiya classes are known to be realizable in four levels or fewer and, hence, it suffices to find decompositions of the above type (2) for arbitrary representative functions from the eleven Harvard classes which comprise the given six Ninomiya classes. Table I indicates the decomposition of type (2) for these Harvard classes. Any Boolean function g of sixteen variables may be repre- sented as a sum in the disjunctive form: y U ° 95 ^ ^ (3) g = L x, Xp . . . x ? f i=0 where each f . is a function of the remaining four variables and i . i, i • . . i n0 is the binary expression for i. Each x. is either x. 1 2 12 ax j j or x., depending on whether i . is 1 or 0, respectively. The disjunction of the I+O96 terms may be formed as an OR tree of twelve levels and, hence, an upper bound on the number of levels required to realize the function g will be twelve plus the number of levels required to realize a single term of the disjunction. The assertion is that because any f . is either four-level realizable or else admits of a decomposition of type (2), that any term of the disjunction is realizable in five levels. Figure one illustrates this assertion by demonstrating a five-level network which 23 TABLE I TYPE (2) DECOMPOSITIONS FOR CERTAIN HARVARD CLASSES f y $ Class Representative* Class Representative Class Representative 55 0,3,5,6,9 237 0,3,5,6,9, 10,12,15 294 10,11,12, 13,14,15 56 1,2,4,8,15 72 0,1,2,4,8 15 400 104 0,1,6,10,12, 15 129 0,1,6,10,12, 14,15 4oo 14 160 0,1,2,7,11, 13,1^ 235 0,1,2,7,11, 12,13,14 4oo 12 163 0,3,5,6,9, 10,12 237 0,3,5,6,9, 10,12,15 400 15 215 0,1,2,4,7, 11,13,14 3^ 3,5,6,9,12, 15 396 8,10 290 0,1,2,7,11, 13, lU 328 0,1,2,7,11, 14 4oo 13 293 0,3,5,6,9, 10,12 342 0,3,6,9,10, 12 4oo 5 3^0 0,1,7,11,13, 14 364 0,1,7,11,13 4oo 14 368 0,3,5,6,9 384 0,3,5,6 400 9 369 1,2,4,8,15 387 1,2,4,15 400 9 1 ■^Representatives are listed in the notation after Harvard (4) . Functions with more than eight minterms (i.e., those whose class is greater than 237) are represented by the representation for their complementary functions. 2U realizes the term for i = U095 ■ Thus far this paper has established that for n = 3, h, and 16 that every Boolean function of n variables is realizable in n + 1 levels. What of n in the range 5 through 15? It is clear that for n in this range that there is an expansion analogous to (3) of the form: 00 g = * x l x 2 ' ' ' \-k f i 1=0 where f is a function of the remaining four variables. This disjunction 1 n-li , of 2 terms may be realized by an OR tree of n-4 levels . Looking again at figure one, it is clear that removal of variables from the network does not alter the number of levels required for its realization, and hence for n in the range 3 to 16, inclusive, every Boolean function of n variables is realizable in n + 1 levels. An interesting point to the above is that the previous best bound on the number of levels required to realize a function of n variables where n is in the range 9 through 16 was also n + 1 logic modules [l] and hence for n in this range we do not know how to take advantage of arbitrary two-input logic modules against the more basic set of two-input AND and OR. 25 co 3 H CO g H En O H En O CO w CO H < w o H O APPENDIX HARVARD CLASSES REALIZABLE IN THREE LEVELS OR FEWER WITH AND AND OR ELEMENTS 26 CLASS 1 2 3 h 5 6 7 8 12 13 11+ 15 16 17 18 19 22 2k 29 31 LEVELS REQUIRED ' 2 2 3 3 3 2 3 3 1 3 3 3 3 3 3 3 3 3 3 3 27 CLASS LEVELS REQUIRED 32 3 3U 3 35 3 38 3 39 3 1+5 . 3 U6 3 U9 3 58 2 59 .3 60 3 61 3 62 3 63 3 66 3 7h 3 79 3 82 3 85 3 86 3 93 3 97 3 98 3 99 3 100 3 108 3 28 CLASS LEVELS REQUIRED 109 3 110 3 111 3 116 2 119 3 121 , 3 123 3 126 3 127 3 1U0 3 152 3 16U 166 3 167 • 3 169 3 170 3 17U 2 175 3 177 3 179 3 181 3 191 3 20U 3 231 2 29 CLA5S LEVELS REQUIRED 238 2U6 21+9 251 253 256 257 270 282 29U 295 296 297 298 299 302 310 315 318 321 322 329 333 3 239 3 2Uo 2Ul 3 3 2 3 • 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 30 CLASS 33*+ 335 336 3UU 3^5 3^7 3U8 351 352 358 359 362 371 372 373 37*+ 375 376 377 378 381 383 388 390 391 392 LEVELS REQUIRED 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 3 3 3 2 3 3 31 CLASS LEVELS REQUIRED 396 2 397 3 398 3 399 3 UOO 2 UOl 32 LIST OF REFERENCES [l] Preparata, F. P. and Muller, D. E-, "On the Delay Required to Realize Boolean Functions, " IEEE Transactions on Computers, Volume C-20, Number U, April 1971* [2] Elspas, B., Goldberg, J., Jackson, C L., Kautz, W. H., and Stone, H. S., "Properties of Cellular Arrays for Logic and Storage, " Project U6Ul (AFCRL) Stanford Research Institute, Menlo Park, California, July 1967 . [3] Harrison, M. A., Introduction to Switching and Automata Theory , McGraw-Hill Book Company, New York, 1§65 . ~ [U] Staff of the Harvard Computation Laboratory, "Synthesis of Electronic Computing and Control Circuits, " Annals 27, Harvard University Press, 1951 • BLIOGRAPHIC DATA IEET 1. Report No. UIUCDCS-R-72-U9^ 3. Recipient's Accession No. Title and Subtitle ON THE REALIZATION OF BOOLEAN FUNCTIONS USING AND AND OR ELEMENTS 5. Report Date ( date Of January 1972 issue) 6. Author(s) Robert Michael Lefler, graduate student in Dept . of Comp. Sci 8. Performing Organization Rept. No - UIUCDCS-R-72- ' Performing Organization Name and Address University of Illinois at Urbana-Champaign Department of Computer Science Urbana, Illinois 61801 10. Project/Task/Work Unit No. 11. Contract/Grant No. Sponsoring Organization Name and Address 13. Type of Report & Period Covered Master of Science Thesils 14. I Supplementary Notes Abstracts The least upper bound for the number of levels required to realize Boolean functions of n variables has been established for n less than or equal to four under the conditions of arbitrary logic elements and complemented variables. This paper investigated the problem of establishing the bound on the levels required to generate a four-variable Boolean function using the reduced set of strictly AND and OR elements. It was proved that under this restricted condition there exists a class of functions, Harvard class I63, whose elements cannot be realized in less than five levels. As a corollary to this investigation, it is possible to show that no more than n + 1 levels are required to generate a Boolean function of n variables under the restricted conditions of strictly AND and OR elements for n less than or equal to sixteen. I Key Words and Document Analysis. 17a. Descriptors Boolean Functions 7 Identifiers /Open-Ended Terms 7 COSATI Field/Group lo.vailability Statement 19. Security Class (This Report) UNCLASSIFIED 20. Security Class (This Page UNCLASSIFIED 21. No. of Pages 36 22. Price NONE I NTIS-35 ( 10-70) USCOMM-DC 40329-P71 ^ \* fr N JUL 2 6W73 UNIVERSITY OF ILLINOIS-URBANA 510.84 IL6R no. C002 no 493 498(1972 Tree height reduction lor parallel proce 3 0112 088400210