Close
About
FAQ
Home
Collections
Login
USC Login
Register
0
Selected
Invert selection
Deselect all
Deselect all
Click here to refresh results
Click here to refresh results
USC
/
Digital Library
/
University of Southern California Dissertations and Theses
/
00001.tif
(USC Thesis Other)
00001.tif
PDF
Download
Share
Open document
Flip pages
Contact Us
Contact Us
Copy asset link
Request this asset
Transcript (if available)
Content
Logic V erification and S y n th esis u sin g F unction G raphs by Yung-Te Lai A Dissertation Presented to the FACULTY OF THE GRADUATE SCHOOL UNIVERSITY OF SOUTHERN CALIFORNIA In Partial Fulfillment of the Requirements for the Degree DOCTOR OF PHILOSOPHY (Computer Engineering) December 1993 Copyright 1993 Yung-Te Lai UMI Number: DP22869 All rights reserved INFORMATION TO ALL USERS The quality of this reproduction is dependent upon the quality of the copy submitted. In the unlikely event that the author did not send a complete manuscript and there are missing pages, these will be noted. Also, if material had to be removed, a note will indicate the deletion. Dissertation Publishing UMI DP22869 Published by ProQuest LLC (2014). Copyright in the Dissertation held by the Author. Microform Edition © ProQuest LLC. All rights reserved. This work is protected against unauthorized copying under Title 17, United States Code ProQuest LLC. 789 East Eisenhower Parkway P.O. Box 1346 Ann Arbor, Ml 48106- 1346 UNIVERSITY OF SOUTHERN CALIFORNIA THE GRADUATE SCHOOL UNIVERSITY PARK LOS ANGELES, CALIFORNIA 90007 Ph.D. CpS *43 LI 0 5 3PT5E/, 5-f This dissertation, written by under f/ie direction of h .is Dissertation Committee, and approved by all its members, has been presented to and accepted by The Graduate School, in partial fulfillment of re quirements for the degree of DOCTOR OF PHILOSOPHY D ean o f Graduate Studies Date N ovem b er^ 1 9 A 1993 DISSERTATION COMMITTEE C>6-•Chairperson i k d & M . . . . : ........................... Co-G'Kairperson To my parents, my wife, and my daughters Shirley and Katherine A ck n ow led gm en ts I am indebted to my advisors Dr. Sarma Sastry and Dr. Massoud Pedram for their continuous support, constant encouragement, and guidance. W ithout their help, this research would have not been possible. I would like to express my thanks to my friends King Ho, C. P. Ravikumar, and Tzyh-Yung Wuu for many fruitful discussions. I have had the good fortune of meeting many wonderful people at USC. In particular, I would like to thank Chihshun Ding, Sasan Iman, Wei-Ming Lin, Bahman Nobandegani, Kuo-Rueih Pan, and Hirendu Vaishnav. The funding for my research was provided by Powell Foundation Grant for Research in VLSI and National Science Foundation’s Research Initiation Awards under contract No. MIP-9111206 and MIP-9211668. I gratefully acknowledge that. I am grateful to my father and mother who encouraged me to pursue academics. Above all, I would like to thank my wife, Jane, and my daughters, Shirley and Katherine, for their love and support, and for coping with the hardships of graduate student life. iii C on ten ts List O f Tables vii List O f Figures viii 1 Introduction 1 1.1 CAD for VLSI Design .............................................................................. 1 1.2 Logic S y n th e sis........................................................................................... 3 1.3 Logic V erification........................................................................................ 4 1.4 Design Data R ep resen tatio n.................................................................... 6 1.5 Integer Linear Program m ing.................................................................... 7 1.6 Organization of the T h e s is ....................................................................... 8 2 Edge-Valued B inary-D ecision D iagram s 10 2.1 Ordered Binary-Decision Diagrams . . . .......................................... 10 2.2 D efinitions..................................................................................................... 12 2.3 O perations..................................................................................................... 17 2.3.1 Complexity Analysis and Flattened EV BD D s............................ 20 2.3.2 The Additive P ro p e rty ................................................................... 22 2.3.3 The Bounding P r o p e r t y ............................................................... 24 2.3.4 The Domain-Reducing P ro p e rty .................................................. 26 * 2.4 Representing Boolean F u n ctio n s............................................................. 27 3 Logic Verification 33 iv 3.1 The Verification P a ra d ig m ........................................................................ 35 3.2 Structured E V B D D ..................................................................................... 37 3.3 Ordering S trateg y ......................................................................................... 48 4 B oolean M atching 50 4.1 Matching Filters ........................................................................................ 54 4.1.1 Cardinality of Dependence S e t ..................................................... 55 4.1.2 Cardinality of O n -s e t..................................................................... 56 4.1.3 Sizes of Distance k ........................................................................ 56 4.1.4 Unateness of Input V ariables........................................................ 58 4.1.5 Symmetry Classes of Input V a ria b le s....................................... 59 4.1.6 Use of F i l t e r s .................................................................................. 60 4.1.7 Comparison of F ilters..................................................................... 61 4.2 Don’t Care S e ts ........................................................................................... 64 4.3 Filters Based on Spectral Coefficients.................................................... 65 4.3.1 Spectral EVBDD (SPBDD).............................................................. 68 4.3.2 Boolean Operations in Spectral Domain ................................ 71 4.4 Filters Based on Prime Im plicants........................................................... 75 4.5 Experimental R e su lts................................................................................. 78 5 Integer Linear Program m ing 83 5.1 B ack g ro u n d ..................... 84 5.2 A Model A lgorithm .................................................................................... 86 5.3 The Operator minimize.............................................................................. 91 5.4 D iscussion..................................................................................................... 97 5.5 Experimental Results .................................................................... 98 6 Function D ecom position 101 6.1 Disjunctive D ecom position..........................................................................102 i v 6.2 Non disjunctive D ecom position.................................................................... 108 6.3 Cut_set In Place .....................................................................................114 6.4 Computing Cut_sets for All Possible Bound S e t s ................................... 120 6.5 Multiple-Output D ecom position.................................................................126 6.6 Incompletely Specified Functions ..............................................................129 6.7 Experimental R e su lts.................................................................................... 131 7 C onclusions 134 vi L ist O f Tables 4.1 Comparison of filters................ 63 4.2 Experimental results of Boolean matching................................................ 79 4.3 Experimental results of SPBDDs.................................................................. 81 4.4 Experimental results of PBDDs.................................................................... 82 5.1 Experimental results of ILP problems.......................................................... 100 6.1 Finding all decomposable forms with bound set size < 4 ........................133 L ist O f F igu res 2.1 OBDD representation of a full adder:(a) carry (b) sum.............................. 12 2.2 Two examples........................................................................................................ 15 2.3 Examples for proving canonical property..................................................... 17 2.4 Example of the apply((0, f), (0, g), + ) operation........................................ 19 2.5 The (c„, v ) ’s of X2 ................................................................................................ 21 2.6 An example of flattened EVBDD...................................................................... 21 2.7 A full-adder represented in EVBDDs: (a) carry (b) sum ......................... 29 2.8 A full-adder represented in OBDDs: (a) carry (b) sum ..................................29 3.1 EVBDD expression: 2carry + sum ................................................................... 34 3.2 EVBDD expression: x + y + z ........................................................................... 34 3.3 Graphical representation of SEVBDDs............................................................ 38 3.4 Examples of SEVBDDs........................................................................................ 39 3.5 Examples of type graph of SEVBDDs............................................................. 40 4.1 A simple example................................................................................................ 51 4.2 The operation of replace_root.......................................................................... 52 4.3 The new obddg after replace_root.................................................................... 53 4.4 Function carry represented by (a) OBDD (b) CBDD (c) PBDD................. 78 5.1 A simple example (using flattened EVBDDs and OBDDs).............................87 5.2 Pseudo code for ilp.minimize........................................................................... 89 viii 5.3 An example for conjoining constraints...................................................... 90 5.4 An example for the m inim ize operator.................................................... 96 6.1 A function represented in (a) OBDD and (b) decomposition chart. . 103 6.2 Disjunctive decomposition.............................................................................. 105 6.3 An example of disjunctive decomposition................................................... 108 6.4 Nondisjunctive decomposition........................................................................... I l l 6.5 An example of nondisjunctive decomposition.............................................113 6.6 An example of coded decomposition chart..................................................115 6.7 The decomposition chart with respect bound set {xo,X 2 ,x 4}................ 118 6.8 An example for cut_set in place.....................................................................119 6.9 Operations include and exclude in the decomposition chart............... 121 6.10 Operations include and exclude in the EVBDD representation. . . . 121 6.11 An example of the application of cutlet-all..............................................124 6.12 Example continued...........................................................................................124 6.13 Example continued...........................................................................................125 6.14 An example of cut_set in EVBDD...................................................................127 6.15 An example of disjunctive decomposition in EVBDD................................ 129 6.16 Representation of multiple-output functions.............................................. 130 ix A bstract As scale of integration in VLSI chips increases, designers are paying more at tention to the computational efficiency of the CAD tools. The key to developing efficient algorithms is a concise, yet effective, representation of functions. This function representation must satisfy two important attributes: canonicity and com pactness. A canonical representation simplifies the detection of function properties such as unateness and symmetry checking. A compact representation ensures the efficiency of function manipulation. Ordered Binary-Decision Diagram (OBDD) is a compact, canonical, graphical representation of Boolean functions. OBDDs have been used in many tasks encoun tered in computer aided design, combinatorial optimization, m athem atical logic, and artificial intelligence. While OBDDs are very effective for problems which can be solved through symbolic Boolean manipulation, they are not so effective for those requiring arithmetic operations in the integer domain. This thesis presents a new data structure called Edge-Valued Binary-Decision Diagram (EVBDD) which can represent and manipulate integer functions more effi ciently than the OBDD representation. Because Boolean functions are special cases of arithmetic functions, EVBDDs can also be used to represent Boolean functions. W ith this property, EVBDDs are particularly useful for applications which require both Boolean and integer operations. This thesis also contains a number of ap plications which demonstrate the effectiveness of the EVBDDs and OBDDs. These applications include the following: showing the equivalence between a Boolean function and an arithmetic function, solving integer linear programming problems, showing the equivalence between two Boolean functions modulo input/output per m utation, and function decomposition for the synthesis of multilevel circuits and look-up table based field programmable gate arrays. x C h ap ter 1 In tro d u ctio n 1.1 C A D for V L SI D esig n As scale of integration in VLSI chips increases, the need for computer-aided design (CAD) tools that can quickly produce correct and near-optimal designs increases. Efficient data structures and algorithms are the key to developing such tools. The goal of CAD tools is to automate the transformation from the highest level of abstraction in the behavioral domain to the lowest level in the physical domain. There are five different levels of abstraction: system, algorithmic, register- transfer, logic, and physical design level. Different levels require different synthesis techniques to improve the design quality and verification tools to ensure the design correctness. System-level synthesis transforms a system-level specification (protocols and processes) to one or more subsystem descriptions at the algorithmic level. The techniques used are system-level partitioning and behavioral transformations [72]. Proof theory and theorem-prover are very useful for proving the correctness at this level. For example, an arbiter was proved in [5] by using first-order logic and a microprocessor was proved in [24] by using higher-order logic. 1 The behavior of the algorithmic level is specified as operations and computation sequences on inputs to produce required outputs. Algorithmic-level synthesis, or high-level synthesis, performs the following tasks: functional units of appropriate types and number have to be selected, operations have to be assigned to time slots, and operations need to be assigned to specific functional units. These tasks are called resource allocation, scheduling, and resource assignment, respectively. Examples of CAD tools for high-level synthesis are ADAM [77], CADDY [45], HAL [81], and OLYMPUS [35]. Verification techniques used in this level are the ones used for proving the correctness of software programs [33, 71]. Finite state systems are the behavioral description for the control path at the register-transfer level. Typical synthesis tasks for controllers include the selection of an appropriate controller architecture, state assignment, input/output encoding, and decomposition of controllers into smaller interacting finite state machines. Examples of synthesis tools at this level include CAPPUCINO [34], MUSTANG [36], and NOVA [99]. CIRCAL [73] used a combination of finite state machines and event models to prove the equivalence of finite state systems. Recently, ordered binary- decision diagrams (OBDDs) [16] has been used to model and prove the equivalence of finite state machines [25]. At the logic level, the behavior is described by Boolean functions. Logic synthe sis is often divided into two-level and multilevel. Although the two-level synthesis is simpler, the multilevel synthesis usually produces much more compact, thus eco nomic, designs. The tasks performed in this level are finding minimal covers for two-level logic and extracting common sublogic for multilevel logic. The most suc cessful tools for logic synthesis are ESPRESSO [14] (for two-level) and M IS [15] (for multilevel). Showing the equivalence of Boolean functions is conventionally car ried out by tautology checking. Because of the canonical and compact properties of OBDDs, verifying Boolean functions using OBDDs has become popular [70]. 2 At the physical design level, the circuit representation of each component is converted into a geometric representation. The tasks performed at this level in clude partitioning, floorplanning, placement, routing, and compaction. Examples of layout tools are [62, 101], Bear [30], and TimberWolf [90]. Design verification consists of design rule checking and circuit extraction. Design rule checking is a process which verifies that all geometric patterns meet the design rules imposed by the fabrication process. After design rule checking, functionality of the layout is verified by circuit extraction. Examples of these tools are DRC and EXTRACT commands in MAGIC [67]. 1.2 L ogic S yn th esis Logic synthesis denotes the problem of transforming a specification to an imple mentation such that some cost functions are minimized. Logic synthesis usually contains two phases: a technology-independent step which manipulates general Boolean functions and a technology-mapping step which maps Boolean functions into a set of devices in a specific target technology. The technology-independent phase in logic synthesis is usually divided into two substeps: logic restructuring which identifies common sublogic to produce a near- optimal structure and logic minimization which optimizes the logic with respect to the structure obtained in the previous step. This thesis only considers the problem of identifying common sublogic. There are two approaches for identifying common sublogic: algebraic and Boolean methods. The algebraic methods are fast because the logic function is represented and manipulated as an algebraic expression. Some optimality may, however, be lost as Boolean identities are not exploited by the algebraic methods. 3 The algebraic approach is based on the division operation, namely, / = qd + r where q, d, and r are the quotient, divisor, and remainder, respectively. The theory of division was studied by Bray ton and McMullen [13] and well developed in the M IS package [15]. The problem thus reduces to that of finding good divisors. Because the number of divisors is huge, usually only a subset of the divisors are used. For examples, [15] uses kernels (cube-free primary divisors) and [98] uses double- and single-cubes. Division can be carried out by algebraic [15], coalgebraic [52], and Boolean [15] methods. The division-based methods are directly applicable to both single- and multiple-output functions. The Boolean approach is based on the decomposition operation, namely, f( X , Y) — f'(g (X ), Y) where the number of inputs of f is smaller than that of / . The theory of decomposition was pioneered by Ashenhurst [1], Curtis [27], and Roth and Karp [82]. Because Boolean methods usually take more time to operate, an effective representation and efficient manipulation of functions is the key to the success of these methods. For representing functions, Karnaugh maps, which are not a compact representation, are used in [1, 27, 50] and cubes, which are not a canonical representation, are used in [54, 61, 82]. 1.3 L ogic V erification Logic verification denotes the problem of showing the equivalence between a spec ification of the intended behavior and a description of the implemented design. Based on how circuit behavior is modeled, two logic verification approaches can be identified: logical and functional approaches. In the logical approach, a circuit is viewed as an entity which ‘formulates’ a predicate by itself [9, 19, 49]. It takes an (input, output) pair and returns a value true or false. Logical inference is the main technique to show the equivalence relation between two behaviors. The main advantage of this approach is that the proof theory and theorem-provers are well 4 developed. The expressive power of higher order logic [19, 49] and the capability of modeling timing behavior of interval temporal logic [79] also make this approach appealing. Some disadvantages of this approach are: not every description is exe cutable [79], the ‘false implies everything’ problem [19], and it requires experts in theorem proving (instead of the circuit designer) to setup the proof. In the functional approach, a circuit is viewed as an entity which ‘denotes’ a function [6, 10, 16, 25]. Usually, it can process inputs to produce outputs. Thus, it provides the capability of simulation. A typical technique applicable for this approach is transformation. That is, transforming from a ‘source’ form (e.g., a FSM) to a ‘target’ form (e.g., a reduced FSM) based on a set of identity laws or rewrite rules. Although the basic reasoning technique is restricted to identity substitutions, the loss of proving power is not as much as expected [10]. Moreover, circuits modeled by functions are closer to the way designers think, thus it is easier for them to carry out the proofs themselves. The correctness of a circuit design can only be proved up to the specification used. For example, if the behavior of a 64-bit adder is specified through 65 Boolean functions (64 bits plus carry), then the behavior of arithm etic addition can never be proved. On the other hand, if the specification language allows to specify the operator ‘-f ’ directly (e.g., lx -f y’), then the correctness is up to the arithmetic addition. Although OBDDs have become a popular tool for showing the equivalence of Boolean functions, they cannot directly verify the correctness of arithmetic behavior. When proving the correctness of circuit designs, we may not know in ad vance the correspondence of inputs between the specification and the implementa tion. This usually happens when different tools have been used at various stages which have their own naming conventions. A similar situation also arises in the technology-mapping stage of logic synthesis. In this stage, we want to map parts of a Boolean network (synthesized by technology-independent stage) to library 5 cells which represent circuits in a specific technology. In these cases, we need to perm ute the inputs in order to find the correspondence between pins on the cell and inputs to the candidate match and show the equivalence. This is referred as Boolean matching. Existing Boolean matching techniques [68, 69, 87] are aimed at technology mapping where a Boolean function is usually assumed to have a small number of inputs (e.g., n < 8). Furthermore, these techniques deal with only single-output Boolean function. For logic verification, these techniques must be extended to functions with large number of inputs and/or outputs. 1.4 D esig n D a ta R ep resen ta tio n One key approach to developing efficient CAD tools is to use an effective representa tion of functions. An effective function representation must satisfy two im portant attributes: canonicity and compactness. A canonical representation simplifies the detection of function properties (e.g., equivalence checking); A compact represen tation provides the efficiency of function manipulation. Truth tables, Karnaugh maps, sum of minterms, and exclusive sum of minterms (fixed-polarity Reed-Muller expressions) are canonical, but not compact, represen tations of Boolean functions. Applications based on these representations are only practical for small number of inputs. On the other hand, sum of products, prod uct of sums, and factored Boolean expressions are compact, but not canonical, representations of Boolean functions. Ordered Binary-Decision Diagram (OBDD) [16] is a graphical representation of Boolean functions which is both canonical and compact. W ith the canonical prop erty of OBDDs, we can easily detect many Boolean properties such as the number of supporting variables, the unateness of variables, and the symmetry between variables. W ith the compactness property of OBDDs, we can effectively carry out many Boolean operations. For example, tautology checking and complementation 6 take constant time while conjunction and disjunction take polynomial time in the size of OBDDs. Although the number of nodes in the OBDD representation may be exponential in the input size, OBDDs have a reasonable size in many practical applications [66]. Edge-Valued Binary-Decision Diagrams (EVBDDs) [28] can represent and ma nipulate integer functions more efficiently. Because Boolean functions are special cases of arithm etic functions, we can also use EVBDDs to represent Boolean func tions. W ith this property, EVBDDs are particularly useful for applications which require both Boolean and integer operations. 1.5 In teger L inear P rogram m in g Integer linear programming (iLP) is an NP-complete [42] problem which appears in many CAD problems. For examples, [55] used a 0-1 ILP technique to solve the resource constrained scheduling problem in high level synthesis, [39] formulated the problem of the optimization of complex data-paths relative to a repertoire of specified operations as a 0-1 ILP problem, and [21] employed a 0-1 ILP technique to partition input variables for PL A decomposition. An ILP problem is to find the maximum (or minimum) of a goal function subject to a set of linear inequality constraints. Each constraint defines a feasible subspace which can be represented as a Boolean function. The conjoining of these constraints (i.e., the conjunction of the corresponding Boolean functions) defines the overall feasible subspace. The problem is then solved by finding the maximum (or minimum) of the goal function over the feasible subspace. 7 1.6 O rgan ization o f th e T h esis The remainder of this thesis is organized as follows. Chapter 2 contains the syn tax, semantics, operations, and properties of the Edge-Valued Binary-Decision Diagrams (EVBDDs) [28]. Because Boolean functions are special cases of arith metic functions, we also can use EVBDDs to represent Boolean functions. W ith this property, EVBDDs are particularly useful for applications which require both Boolean and integer operations. Furthermore, EVBDDs enjoy certain properties such as additive, bounding, and domain-reducing properties, which are not seen in OBDDs. W ith these properties, we can effectively perform arithm etic operations and branch and bound algorithms by using EVBDDs. Chapters 3 describes a verification paradigm based on the interpretation of de signs [51]. For example, we interpret a design in Boolean function form as imple menting an arithmetic function. We then can use EVBDDs to show the equivalence between Boolean functions and arithmetic functions. To cope with conditional statements and array data structure, EVBDD is extended to Structured EVBDDs (SEVBDDs) [28]. Chapter 4 presents an OBDD-based Boolean matching algorithm which works for both logic verification and technology mapping. The algorithm is based on checking whether two OBDDs are isomorphic. In particular, the algorithm is carried out in a level-first manner which permits significant pruning of the search space. In addition, a set of filters which further improve the the performance of the matching algorithm is presented. It also present a method of analyzing the effectiveness of a filter and rank the various filters based on their effect/cost ratio. The application of EVBDDs to solving ILP is presented in Chapters 5. This approach combines benefits of the EVBDD data structure (in terms of subgraph sharing and caching of computation results) with the state-of-the-art ILP solving techniques. In addition, the construction and conjunction of constraints in terms 8 of EVBDDs are carried out in a divide and conquer manner in order to manage the space complexity. The theory and practices of OBDD-based function decomposition are investi gated in Chapter 6. This provides the basis for extracting common sublogic from multiple-output functions. The set of decomposition algorithms presented handle disjunctive and nondisjunctive decompositions, decomposition on completely and incompletely specified functions, and decomposition for single- and multiple-output functions. Conclusions are given in Chapter 7. 9 C h ap ter 2 E d ge-V alu ed B in a ry -D ecisio n D iagram s This chapter first gives a brief review of OBDDs [16]. It then presents the syntax, semantics, operations, and properties of EVBDDs. It also presents the analysis of computational complexity of EVBDD operations and the comparison of representing Boolean functions by EVBDDs and OBDDS. 2.1 O rdered B in a ry -D ecisio n D iagram s D efinition 2.1.1 [16] An OBDD is a directed acyclic graph consisting of two types of nodes. A nonterminal node v is represented by a 3-tuple (variable(v), c/u/d/(v), childT(v )) where variable(v) & {xo, . . . , xn-i}. A term inal node v is either 0 or 1. There is no nonterminal node v such that childi(v) = childr(v), and there are no two nonterminal nodes u and v such that u = v. There exist an index function index(x) € { 0 ,..., n — 1} such that for every nonterminal node v, either childi(v) is a terminal node or index(variable(v)) < index(variable(childi(v))), and either childr(v ) is a terminal node or index{variable(y)) < index{variable{childr{y))). The function denoted by (x, vj, vr) is xfi + x f r where // and f r are the functions denoted by v/ and v r, respectively. The functions denoted by 0 and 1 are the constant function 0 and 1, respectively. 10 The following notation are used throughout this thesis. 1. The left edge of a node represent 1 or the true edge and the right edge represents 0 or the false edge. 2. v represents both an OBDD node and the OBDD rooted by node v. 3. index(y) : the index of the variable associated with node v. If v is a terminal node, then m dex(v) = n. 4. , , ,, .. f childAv) if indexiv) = i, l-child(v,i) = < . [ v otherwise. , ,, f childJv) if m dex(v) = i, r-child(v,z) — < [ v otherwise. 5. new-obdd(x, 1, r) returns an OBDD node v such that variable(v) = x , childi(y) = 1, and childT{v ) = r. D efin itio n 2.1.2 Given an OBDD node v representing f ( x 0, ... ,x„_i) and a bit vector (b0, ..., &t_i), the function eval is defined as eval(v, ()) = v, eval(v, (b0, ..., V_i)) = v', where v' is the OBDD representing function f(b0, ..., 6t_i, x,-,..., x n_ i). When i is known, eval(v,p) will be used for eval(v, (bo, ..., where p = 2,~1b0 + . . . + 2°6,--1. E x a m p le 2.1.1 The carry and sum functions of a full adder represented by OBDDs are shown in Fig. 2.1. From Def. 2.1.1, function carry is derived as follows: 11 (a) (b) Figure 2.1: OBDD representation of a full adder:(a) carry (b) sum. fcarry = x f a + x f b = xy + xyz -f xyz — xy + xz + yz, fa = y l + yfc = y + yz, h = yfc + y 0 = yz, f c = 2 1 + ^ 0 = 2. From Def. 2.1.2, the evaluation of x = 1 in carry results node a, th at is, carry( 1, y, z) = a; the evaluation of x = 1 and y = 0 results node c; the evaluation of x = 1, y = 0, and z — 1 results 1. □ 2.2 D efin itio n s EVBDDs are directed acyclic graphs constructed in a similar way to OBDDs. As in OBDDs, each node either represents a constant function with no children or is associated with a binary variable having two children, and there is an input variable ordering imposed in every path from the root node to the terminal node. There is, however, an integer value associated with each edge in EVBDDs. Furthermore, the semantics of these two graphs are quite different. In OBDDs, a node v associated with variable x denotes the B o o lean fu n ctio n (x A fi) V (x A / r ), where // and f r are functions represented by the two children of v. On the other hand, a node v in an EVBDD denotes the a rith m e tic fu n c tio n x(vi + /}) + (1 — x)(vr + f r), where vt and vT are values associated with edges going from v to its children, and 12 fi and f r are functions represented by the two children of v. To achieve canonical property, we enforce vT to be 0. EVBDDs constructed in the above manner are more related to pseudo Boolean functions [47] which have the function type {0, l} n — ► integer. For example, f(x , y, z) — 3x + 4y — 5xz with x ,y ,z 6 {0,1} is a pseudo Boolean function, and /(1 ,1 ,0 ) = 7 and / ( l , 1,1) = 2. However, for functions with integer variables, we must convert the integer variables to vectors of Boolean variables before using EVBDDs. In the above example, if x £ { 0 ,... ,5}, then f ( x , y , z ) = 3(4x2 + 2xi + % o) + 4y — 5(4x2 + 2xi + xQ )z and /(4 ,1 ,1 ) = — 4. By treating Boolean values as integers 0 and 1, EVBDDs are capable of repre senting Boolean functions and perform Boolean operations. Furthermore, when Boolean functions are represented by OBDDs and EVBDDs, they have the same size and require the same time complexity for performiiig operations. Thus, EVBDDs are particularly useful in applications which require both Boolean and integer op erations. The following definitions describe the syntax and semantics of EVBDDs. D efin itio n 2.2.1 An EVBDD is a tuple (c, f) where c is a constant value and f is a directed acyclic graph consisting of two types of nodes: 1. There is a single terminal node with value 0 (denoted by 0). 2. A nonterminal node v is a 4-tuple {variable('v),childi(v),childr(v), value), where variablefv) is a binary variable x € {a?o,..., a ? n-i}* There is no nonterminal node v with childi{v) = childT(y ) and value = 0, and there are no two nodes u and v such that u = v. There exists an index function index(x) € { 0 ,..., n — 1} such that for every nonterminal node v, either child[(y) is a terminal node or index(variable(v)) < index(variable(childi(v))), and either childT(v ) is a terminal node or index{yariable{y)) < index(variable(childT (y))). If v is the terminal node 0, then index(v) = n. 13 D efinition 2.2.2 An EVBDD (c,f) denotes the arithmetic function c + f where / is the function denoted by f. 0 denotes the constant function 0, and (x, 1, r, v) denotes the arithmetic function x(v + 0 + (1 — x)r. In the graphical representation of an EVBDD {c, f), f is represented by a rooted, directed, acyclic graph and c by a dangling incoming edge to the root node of f. The terminal node is depicted by a rectangular node labelled 0. A nonterminal node is a quadruple (a:, 1, r, v), where x is the node label, 1 and r are the two subgraphs rooted at x, and v is the label assigned to the left edge of x. E x a m p le 2.2.1 Fig. 2.2 shows two arithmetic functions / 0 = 3 — 4a: -f 4xy -\-xz — 2y -f yz and f% = 4a;o + 2a: i + £ 2 represented in EVBDDs. The second function is derived as follows: fl ~ 0 + fx0 5 f X o = x0(A + f Xl) + (1 - x0)fXl = 4a:0 + 2xi+a:2, fxt = Zi(2 + f X2) + (1 - Xl)fx2 = 2X! + X2, fx2 = x2{\ + 0) + (1 - a:2)0 = x2. □ Note that an EVBDD requires only n nonterminal nodes to represent an n variable linear function, for example, Fig. 2.2 (b) is a linear function which can also be interpreted as a 3-bit integer. D efinition 2.2.3 Given an EVBDD (c, f) with variable ordering a :0 < . . . < x n- i , the evaluation of (c, f) with respect to an input pattern b — (b0, . . . , &i_i), 0 < i < n is defined as follows: eval((c,0},b) = c, { eval({c -f v, 1), b) if j < i and bj = 1, eval((c, r), 6) if j < i and bj = 0, {c,{xj,l,r,i;)) i f j > i . 14 (a) (b) Figure 2.2: Two examples. From the above definition, function values in an EVBDD representation are obtained by summing edge values (right edge values are always set to 0) along the path associated with the input assignment. For example, in Fig. 2.2 (a), the function value of x = 1, y = 0 and z = 1 is 3 + (— 4) + 04-1 = 0, and the function value of X2 = 1, x\ — 0 and x0 = 1 in Fig. 2.2 (b) is 0 + 4 + 0 + l = 5. EVBDD is a canonical representation of functions from {0, l} n to the set of integers. This is stated in the following lemma. L em m a 2.2.1 Two EVBDDs (cy, f) and (c5, g) denote the sameTunction (i.e., V6 6 B n, eval({cj, f), 6) = eval((cg, g), &)), if and only if cy = cg and f and g are isomorphic. Proof: Sufficiency: If cy = cg and f and g are isomorphic, then V6 eua/((cy, f), b) — eval((cg, g), b) directly follows from the definitions of isomorphism and eval. Necessity: If cy ^ cg then let b = ( 0 ,..., 0) be the input assignment to f and g (e.g., Fig. 2.3 (a)). We have the following eval((cf ,f),b) = cy ^ cg = eval((cg,g),b). Thus, we focus on the latter condition on f and g. We want to show if f and g are not isomorphic, then 36 € B n such that eval((0, f), b) ^ eval((0, g), b). W ithout loss of generality, we assume index(variable(f)) < index(variable(g)). Let k = n — index(variable(f)), we prove the lemma by induction on k. 15 Base: When k = 0, f is a terminal node and so is g. Furthermore, f = g = 0. Thus, f and g are isomorphic. Induction hypothesis: Assume it is true for n — index(variable(i)) < k. Induction: We show that the hypothesis holds for n — index(variablef) = k. Let f = fj,fg,uy). case 1: n — index(variable(g)) = k, that is, g = (xn-k,g h g rivg)- If vf ^ vg, let b = {... ,0 ,1 ,0 ,...), that is, bn- k = 1 and 6 ,- = 0,Ve n - k, then eua/((0,f), b) = vj vg = eval({0,g), b) (e.g., Fig. 2.3 (b)). If vf = vg, then either fj and gj are nonisomorphic, or fr and gr are nonisomorphic. su b c ase 1: If fj and gi are not isomorphic, then from n — index(variable(fi)) < k, n— index(variable(gi)) < k, and induction hypothesis, there exists b = (bQ , . . . , f e n_i) such that eval({ 0, fi), b) ^ eval(( G , gj), 6). Let bf — (b'0,.. ., b ^ } such that b 'n_k — 1 and 6- = 6 * for i n - k, then eval((0,f},b') = eval((vh ii),b') ^ eval((vg, gi), b') = eval((0, g), b') (e.g., Fig. 2.3 (c)). su b c ase 2: Otherwise, fr and gr are not isomorphic, then by similar arguments, letting b 'n_k = 0 and £• = / n - k will result in eval((0 ,f ), 67 ) / eval((Q,g),b'). case 2: n — index (variable^)) < k. By definition of reduced EVBDD, we cannot have both (v/ = 0) and (fj and fr are isomorphic). If Vf ^ 0, let bn- k = 1 and 6 ^ = 0 for i ^ n — k, then et?a/((0,f),6) = vj ^ 0 = eval({0, g), b) (e.g., Fig. 2.3 (d)). (Since g is independent of the first n — k bits.) Otherwise, fi and fr are not iso morphic and at least one of them is not isomorphic to g. If ft (fr ) and g are not isomorphic, then by induction hypothesis, there exist a b such that eoa/((0,fi(fr )), b) ± eval((0, g), 6). Again, let b 'n_k = 1(0) if fi(fr) is not isomorphic to g, and b\ = 6 ,- for i ^ n — k, eval((0, f), b') ^ eval((0, g), b1 ). □ 16 ( a ) ( b ) f J 0 9 J I ' 3/^ (x 3/^ ( * 4 ) 9 , ( ■ * 3) H o / / r \ ° \ / ( c ) \ / u - ( d ) Figure 2.3: Examples for proving canonical property. 2.3 O p eration s The following algorithm describes the function (EVBDD) apply which takes (c /,f), (c3 i g}? and °jP ^ arguments and returns (ch, h) such that Ch+h = (c/-f / ) op (cg+g) where op can be any operator which is closed over the integers. In algorithm apply, a terminal case (line 1) occurs when the result can be computed directly. For example, op = x and (c /,f) = (1,0) is a term inal case because (1,0) = 1 + 0 = 1, (cg, g) = cg + g, and l x ( c } + j ) = (cg + g) = (cg,g), thus the result can be returned immediately without traversing the graph. A comp-table storing previously computed results is used to achieve compu tation efficiency. An entry of comp-table has the form (/, g, op, h) which stands for f op g ~ h. To compute / op g, we first look up the comp-table with key (/, g, op), if an entry is found then the last element of the entry h is retrieved as the result; otherwise, we perform op on the subgraphs of / and g and store the 17 result in comp-table after the completion of / op g. The entries of comp-table are used in line 2 and stored in line 18. After the left and right children have been computed resulting in (chl, hi) and (chr, h r) (lines 14 and 15), if (cA|,hi) = (chr, h r ), the algorithm returns (cA|,h i) to ensure that the case of (x , k, k, 0) will not occur; otherwise, it returns {chr, (var, hi, h r , ch{ —chr)) to preserve the property of right edge value being 0. There is another table (uniq-table) used for the uniqueness property of EVBDD nodes. Before apply returns its result, it checks this table through operation find-or-add which either adds a new node to the table or returns the node found in the table. apply ((c /,f),(c fl,g ), op) { 1 if (terminaLcase((cf,{), (cg,g),op) retu rn ((c/,f) op (cg, g))); 2 if (computable Jookup((cf ,f) , (cg, g), op, ans)) return(aras); 3 if (index(f) > index(g)) { 4 (csnSl) = (c 9 + value(g), childi(g)); 5 < eflr>gr) = (cg,childr(g))-, 6 var = variable(g)', } 7 else { 8 <c,„gi) = (c,r ,g r) = (cj,g); 9 var = variable( f); } 10 if (index(i) < index(g)) { 11 (c/n 4l) = (cf + value(f),childi(f)); 12 (c/r,fr ) = (cf ,childT(i)y, } 13 else { (c/,,fi) = (c/r,fr ) = (c/,f);} 14 {cft(, hi) = apply((Cft,f\), (c3i,gi),op); 15 (chr, h r ) = apply((cfr, fr ), (c3r, gr ), op); 16 if ((cA|,hi) = = (chr, hr)) return ((cA i,hi)); 17 h = findjor-add(var, hj, h r , cA j — cA r); 18 compJ.ableJnsert((cj,f), {cg, g), op, (cAr, h)); 19 return ((cAr,h)); } 18 E x am p le 2.3.1 An example of apply((0, f), {0, g ),+ ) is shown in Fig. 2.4. Let the variable ordering be x0 < x x. Fig. 2.4 (a) shows the initial arguments of apply, (b) is the recursive call of apply on line 14 whose result is (c). Similarly, another call to apply on line 15 and its results are shown in (d) and (e). The final result is shown in (f). □ + i ( a ) (b ) (d) (a) (0 Figure 2.4: Example of the apply((0,f), (0, g), -f) operation. If operator op is commutative, then we do the following normalization to in crease the hit ratio of computational results: if (is-commutative(op)) { if (index(f) > index(g)\\index(f) = = index(f) & & ; addr(f) > addr(g)) swap({cf ,t),(cg,g)y, } where addr{i) is the machine address of EVBDD node f. The above code is carried out before performing comp-table Jookup in line 2 of apply. 19 2.3.1 C o m p le x ity A n a ly sis an d F la tte n e d EVBDDs The tim e complexity of operations in OBDD representation is 0 ( | f | • | g |) where | f | and | g | are the number of nodes of OBDDs f and g. The time complexity of operations in EVBDD representation is however not 0(\ (c /,f) | • | (cfl,g ) |) where | (c /,f) | and | (cgy g) | are the number of nodes of EVBDDs (c /,f) and (cg, g). This is because for an internal node v of (cy, f) or (cg, g), apply may generate more than one (ct,,v) (lines 4, 5, 11, and 12). D efin itio n 2.3.1 Given an EVBDD (c/,f) with variable ordering xq < ... < xn-i and a node v of f with variable we define the domain of v (D*^al), and the cardinality of v (|| v ||) as follows: D™al = {cu | (cu,u ) = eval((cf,f),b) where u = v,V6 G B |v | = | n r ' |- The cardinality of (c /,f), denoted as || (cy,f) ||, is then given as: Ifo.OI = EMI- V€f Note that || {c/,f) | gives the number of possible (c, v )’s which may be generated from (Cf, f) by apply. E x am p le 2.3.2 Let (0,xo) be the EVBDD in Fig. 2.2.1 (b), then ||xo ||= 1, | Xi | 1= 2, ||x 2 ||= 4, 10 1 = 8, and || (0,xo) ||= 15. The (cv,v ) ’s for node x 2 are shown in Fig. 2.5. □ To have a more precise measure of the time complexity of operations in EVBDD I representation, we define flattened EVBDDs as follows. D efin itio n 2.3.2 A flattened EVBDD is a directed acyclic graph consisting of two types of nodes. A nonterminal node v is represented by a 3-tuple (variable(v), childt(v), childr(v)) where variable{y) G {^o,.. •, xn_i}. A terminal node v is 20 Figure 2.5: The (cv, v )’s of X2 . Figure 2.6: An example of flattened EVBDD. associated with an integer v. Reduced, ordered, flattened EVBDDs are defined in the same way as OBDDs. Definition 2.3.3 Given a flattened EVBDD f with variable ordering x0 < ... < x„_i, the evaluation of f with respect to an input pattern (b0, . . . , 0 < i < n is defined as follows: evalf (v, (b0, ...,& j_i)) = v evalf((xj,l, r), {b0, . . . , &;_i)) if v is a term inal node, evalf( 1, (b0, . . . , & ,•- 1 )) if j < i and bj evalf(r, (& o > • • •, h-i)) if j < * and bj ( x j , l,r) if j > i . 1, 0, E x am p le 2.3.3 The flattened EVBDD for the function in Fig. 2.2 (b) is shown in Fig. 2.6. □ From the above definition, flattened EVBDDs are exactly the same as Multi- Terminal OBDDs in [22]. Function values in the flattened EVBDD representation 21 are obtained in the same way as in the OBDD representation. The flattened EVBDD representation also preserves the canonical property. L em m a 2.3.1 Two flattened EVBDDs f and g denote the same function if and only if they are isomorphic. Proof: The proof of the canonical property of OBDD representation in [16] can be used to prove the canonical property of flattened EVBDD representation by replacing terminal nodes 0 and 1 by terminal nodes u and v where t i / « . □ L em m a 2.3.2 Given a function / represented by an EVBDD (c, f) and a flattened EVBDD f', || <C, f ) || = | f'|. Proof: For any b £ B % , eval({c, f), b) = {cv, v) and evalf(f, b) = v ' denote the same function. Since both EVBDD and flattened EVBDD are canonical representations, the mapping between {c, v) and v ' is one-to-one. Thus, for any b ^ eval/(f', b) = evalf(f ,b') if and only if eval((c, f), b) = eua/((c,f), & '). □ Since EVBDDs are acyclic directed graphs and there is no backtracking in apply, the time complexity of apply is 0(|| (cy, f) || • || (cg, g) ||). In many practical applica tions, the number of nodes in an EVBDD may be small, but its cardinality can be very large. For example, an n-bit integer represented by an EVBDD requires only n nonterminal nodes, but its flattened form requires exponential number of nodes. apply is a general procedure for performing operations in EVBDDs without in corporating any property to reduce complexity. In the following, we present a number of properties that can be used to reduce the computational complexity of apply in many situations. 2.3.2 T h e A d d itiv e P ro p er ty The EVBDD representation enjoys a distinct feature, called additive property, which is not seen in the OBDD representation. 22 D efin itio n 2.3.4 An operator op applied to (c/, f) and (cg, g) is said to satisfy the additive property if (c/ + / ) op (cg +g) = (cf op cg) + ( f op g). Examples are (C f + f) + (cg+g), (c/ + / ) — (cg+g), (cf + f ) x ( c + 0), and (c/ + f ) < < (c + 0) where « is a left shift operator as in C programming language [63] (i.e., (C/ + f ) x 2C ). We use (c/ + / ) — (cg + g) as an example: (c/ + / ) - ic9 + 9 ) = (cf ~ cg) + ( / - #)• Because the values c/ and cg can be separated from the functions / and g, the key for this entry in compJable is ((0,f), (0,g), — ). After the computation of ((0, f), (0, g), — ) resulting in (c^, h), we then add cj — cg to ch to have the complete result of ((c /,f), {cg, g), — ). Hence, every operation ((cy,f), (c'g,g), —) can share the computation result of ((0,f), (0, g), — ). This will then increase the hit ratio for caching the computational results. For operators satisfying the additive property, the tim e complexity of apply is 0(\ (c/,f) | • | {cg, g) |) (as opposed to 0 ( | (c /,f) || • I (<**>!))■ To implement this class of operators, we insert the following lines between lines 1 and 2 of apply: 1.1 cfg = cf op Cg; 1.2 Cf — cg = 0; We also replace lines 2, 16, and 19 of apply by the following lines: 2 if (comp-tableJookup({cf, f), (c5,g),op, (c/j,h))) return ((ch + c/5,h}); 16 if ((chn hi) = = (chr, hr )) return ((chl + cfg, hj)); 19 return ((chr + cfg, h)); For cases of (c/ + / ) x c and (c/ + / ) < < c, we can further separate the processing of edge values. The following pseudo code times_c((c/,f),c) performs 23 operation (c/ + / ) x c with time complexity 0 {\f |). Note that the new edge value value(f) x c is computed in line 5 instead of passing down to the next level in line 3 (cf. line 4 or 11 of apply). times-c((cf, f), c) { 1 if (f = = 0) return (c/ x c, 0); 2 if (comp-tableJookup({0, f),c, timesuc, (0,h))) return (cf x c, h); 3 (chn h\) — times jc({0,childi({)),c)', 4 (chr1hr) = times-c((0,childr(f)),c)-, /*Chr = 0 * / 5 h = find-.or~add(yariable(i), hi, h r , value(i) x c); 6 comp-tableJnsert({0, f), c, times-c, (0, h)); 7 return (c/ x c, h); } An im portant application of this class of operators is to interpret a vector of Boolean functions as an integer function: 2m-1/o -f . . . + 2 2.3.3 T h e B o u n d in g P ro p er ty Before defining this property, we present a new type of computation sharing occurring for relational operations. We use operator < as an example. Let (c/?f) <v (cg, g) denote that (c/, f) < (cg, g) holds for all input patterns. It follows that (0,f) <v (0,g) and (cf - cg) < 0 implies (c /,f) < v (cg, g) which can be seen to be true based on the following derivation: (0, f) <v (0,g) =» 0-+ f <v 0 + g, 0 <v f 4 * g i (Cf Cg) < 0 = 4 * C f Cg f 4- g, =* c/ + / <V C 5 + g, = * (c /,f) < v (c 5,g). 24 c To achieve the above computation sharing, we can have a comp-table entry ((0,f), (0, g), < v, (1,0)}. However, we can do better as follows. Consider the fol lowing transformation of the above implication: (0,f) <v (0,g) ( 0 ,f ) - ( 0 ,g ) <v(0,O ), => maa:((0,f) — (0, g)) < 0, — m = m ax((0,f) — (0, g)) < 0, (cy — cg) < m (cy — cg) — m < 0, = > (cf — cg) + max((0 ,f) — (0, g)) < 0, = $ > max((cf , f) - (c5,g )) < 0, ^ (c/>^) — ' (C 3 5S) — V (0,0), ^ (c/ ,f ) — v(c5,g). Based on the above implication, we replace (cy,f) < (cg, g) by two operations: (cy,f) — (c5,g) = (c/i,h) and(c^,h) < (0,0). We store the maximum and minimum function values with each EVBDD node and have the following terminal cases: if (cy + maa;(f)) < 0 return (1, 0), and if (cy + m m (f)) > 0 return (0,0). Another im portant reason for the inclusion of the maximum and minimum val ues in each node is that we can easily incorporate branch-and-bound algorithms into EVBDD representation and thus can solve optimization problems more effec tively. Definition 2.3.5 An operator op applied to (cy, f) and (c3,0 ) is said to satisfy the bounding property if ((cy + m (f)) op cg) = 0, 1, or (cy + / ) , where rn(f) is the maximum or minimum of / . As a result, when the maximum or minimum of a function exceeds a boundary value (e.g., cg in Def. 2.3.5) in an operation, then the result can be determined without further computation. 25 As an example, the following pseudo code leqO((cj, f)) performs operation (c/ + / ) < 0: leqO((cf, f)) f { 1 if ((Cf + max(f)) < 0) return((l, 0}); 2 if ((c/ -f m m (f)) > 0) return({0,0)); 3 if (compJableJookup({cf, f ),leq0, ans)) return(ans); 4 (c/j{,hi) = leq0({cj + value(f),childi(f))); 5 (chr,h r) = leqO({cf,childr(f)))- 6 if ({cftn hi) = = (cAr,h r)) return ((cfc|,hi)); 7 h = find-or-add(variable({),hi,hT,Ch, — c^r); 8 comp-tableJnsert((cf ,f), leqO, (c^r,h)); 9 return ((cfcr,h)); } 2 .3 .4 T h e D o m a in -R e d u cin g P ro p er ty In (C/,f) op (c3, g) where op satisfies the additive property, exactly one (0,v) pair is generated for each node v of f and g. Thus, the ‘effective’ domain of each node becomes {0}. There are other operators which have similar effect on reducing the domain of EVBDD nodes. Definition 2.3.6 Given an EVBDD (c /,f), the domain of a node v of f with respect to an operator op is defined as: D°p = {cv | (cvjV^s are the pairs that need to be generated with respect to op}. Definition 2.3.7 An operator op applied to (c/, f) and (cg, g) is said to satisfy the domain-reducing property if there exist some node v of f or g such that 'Dff C D^fal. 26 An example of this is the following: (c/ -f / ) mod c = ((c/ mod c) + / ) mod c. The domain of a node v of f is D™od = D*fal H { 0 ,..., c — 1}. In this case, (cf -f A rc , f) can share the computation result of (cf, f) for any integer k. When c is small, computation sharing is large; when c is large, then the following check (using the boundary property) can be used to increase the computation saving: if ((c/ + maar(f)) < c 8z& c (c/ + rain(f)) > 0) then (c/,f). Another example is integer division operator with constant divisor: (c/ + f ) / c = (cf / c) + ((c/ mod c) + f)/c, assuming both c/ and c are positive integers for this example. In fact, integer divi sion operator with constant division satisfies the three properties: (cf/c) satisfies the additive property, (c/ mod c) satisfies the domain-reducing property, and if ((Cf + max(f)) < c && c/ + m in(f) > 0) then 0 satisfies the bounding property. 2.4 R ep resen tin g B o o lea n F u n ction s By using integers 0 and 1 to represent Boolean values false and true, Boolean operations can be implemented through arithm etic operations as shown below: x A y = xy , (2.1) x\J y = x + y — xy, (2.2) x@y = x + y - 2 xy, (2.3) x = 1 — x. (2.4) 27 Thus, Boolean functions are a special case of integer functions and OBDDs are a special case of EVBDDs. E x am p le 2.4.1 The sum and carry of a full adder in EVBDD are shown in Fig. 2.7. By using the above equations, we have the following arithm etic functions for sum and carry: sum = x -f y + z — 2 xy — 2 yz — 2 zx + 4xyz, carry = xy -f yz -f zx — 2xyz. □ A full adder represented by arithm etic functions may seem more complicated than when it is represented by Boolean functions. However, the above equations are only for converting from Boolean functions to arithmetic functions. Pseudo code apply is capable of directly performing Boolean operations. For example, Boolean dis junction is carried out through apply({cj,f), (cg, g), V) with the following terminal cases: 1.1 if « c /, f) = = (1,0) || < c5, g) = = (1,0)) return((l, 0)); 1.2 if « c ,,f ) = = (0,0) 1 (c/,f) = = (cg, g)) return((cff,g)); 1.3 if ((ca, g) = = (0,0)) return({c/ , f)); Furthermore, when a Boolean function is represented by an EVBDD, it requires the same number of nonterminal nodes and nearly the same topology as when it is represented by an OBDD. This is shown by the following algorithm and lemmas. A lg o rith m A: Converting a Boolean function from OBDD representation to EVBDD representation. 1. Convert terminal node 0 to (0,0) and 1 to (1,0). 2. For each nonterminal node (x,-,l,r) in OBDD such that 1 and r have been converted to EVBDDs as (c/, 1'} and (cr , r'), apply the following conversion rules: 28 Figure 2.7: A full-adder represented in EVBDDs: (a) carry (b) sum. (a ) (b ) Figure 2.8: A full-adder represented in OBDDs: (a) carry (b) sum. (a) (a:,-, (0,1'), (0 ,r'» = > (0, (z,-, 1', r '? 0)), (b) (a:,-, (0, F), ( l , r ;)> = £ • (1, (a:,-, 1', r', — 1)), (c) (*i,(l,r),{0,r'))=»(0,{a!ill#,r',l)), (d) (a:t - ,( l ,l ') ,{ l,r ') ) ^ ( l,{ x ,,F ,r ',0 ) ) . E x a m p le 2.4.2 Fig. 2.8 shows the OBDD representation of carry and sum. After Algorithm A, they will be converted to the EVBDDs in Fig. 2.7 □ L em m a 2.4.1 Algorithm A converts an OBDD v to either (0,v') EVBDD or (1, v') EVBDD. 29 Proof: In step 1, only (0,0) or (1,0) can be generated, and in step 2, only (0,v) and (1, v) can be generated for some v. □ L em m a 2.4.2 Algorithm A will neither add nor delete any nonterminal node or edge. Proof: Directly follows from Algorithm A. L em m a 2.4.3 Algorithm A preserves functionality. T hat is, given an OBDD v, if the application of Algorithm A on v results in an EVBDD (c, v'), then v and (c, v') denote the same function. Proof: Let v represents a Boolean function with n variables, we prove the lemma by induction on n. Base: n = 0. v is 0 or 1 and denotes constant function 0 or 1. From step 1 of Algorithm A, (c, v') = (0,0) or (1,0) and denotes the function 0 + 0 = 0 or 1 + 0 = 1. Induction hypothesis: Assume it is true for n = 0,..., k — 1. Induction: Let v be an OBDD node (x, 1 , r) representing the Boolean function (iA l)V (iA r) where I and r are the functions represented by 1 and r respectively, and each has less than k variables. By induction hypothesis, 1 and r can be converted into (c/, 1') and (er , r') such that 1 = ci + V and r = cr + r'. From step 2 of Algorithm A, v will be converted into (c, v') and we need to show (xAl)V(xAr) = c + v'. In the following, we only prove the correctness of case (b) above, the other three cases can be proved similarly. In case (b), (c/, F) = (0,1') and (cr,r') = (1, r'). From induction hypothesis, / = 0 + V = /' and r = 1 + r'. LHS = (i A I)V(j A r) = xl + (1 — x)r — xl( 1 — x)r = xl + r — xr — xlr + xlr = xl + r — xr = xV + (1 + r') — a:(l + r') = xV + 1 + r' — x — xr' 30 RHS = 1 + v' = 1 + x (—1 + V) + (1 — x)r' = 1 — x + xl' + r' — xr' = LHS □ T h eo rem 2.4.1 Given a Boolean function represented by an OBDD v and an EVBDD (c, v'), then v and v' have the same topology except that the terminal node 1 is absent from the EVBDD v ’ and the edges connected to it are redirected to the terminal node 0. Proof: It directly follows from lemmas 2.4,1, 2.4.2, and 2.4.3 and the canonical property of EVBDD representation. □ L em m a 2 .4 .4 When EVBDDs are used to represent Boolean functions, exactly one of (0 ,v ) or ( l,v ) can be generated during the process of apply (lines 4, 5, 9, 13, 14, and 16) where v is a nonterminal node. Proof: If (c, v) is generated where c ^ 0 and c ^ 1, then eval({c, v), (0,..., 0)) = c which implies that it is not a Boolean function. If both (0, v) and (1, v) are gener ated, then there exist 60 and bx such that eval((0, v), b0) = 0 and eval((0, v), &i) = 1 because v is a nonterminal node (i.e., v denotes nonconstant function). Then, eval((l,v ),6 0) = 1 and eval((l,v ),6 X ) = 2 which again leads to a non-Boolean function. □ T h eo re m 2 .4 .2 Given two OBDDs f and g and the corresponding EVBDDs (c/, f') and (cg, g'), the time complexity of Boolean operations on EVBDDs (using apply) is O flf | • |g|). Proof: From lemma 2.4.4, since only one (c, v) can exist for every nonterminal node v during the process of apply, we have | (c /,f) |= | (c/, f) || and | (c5, g) |=|| (cgi S) I I - ^ is well known that the time complexity of Boolean operations in OBDD 31 representation is 0 (\ f | • | g |) where | f | and | g | are the number of nodes in OBDD representation. From theorem 2.4.1, both representations have the same number of nonterminal nodes, thus the complexities are also the same. □ Based on the above theorem, we can use EVBDDs to replace OBDDs for repre senting Boolean functions with the following overhead: 1. An integer representing the dangling edge for each function (graph), 2. An integer representing the left edge value for each nonterminal node, and 3. One addition and one subtraction for each call of apply operation (lines 4 and 20). In the following chapters, several applications of EVBDDs will be presented. For the sake of readability, the flattened form of EVBDDs will also be used. In flattened form, edge values are pushed down to the bottom such that a term inal node is some integer representing the function value. 32 C h ap ter 3 L ogic V erification The process of logic verification is to show the equivalence between the specifi cation of intended behavior and the description of implemented designs. If both specification and implementation are Boolean expressions, then the correctness can only be proved up to the Boolean behavior. On the other hand, if the specification is an arithm etic function while the implementation is a set of Boolean expressions, then the correctness is up to the arithmetic behavior. When used for logic verification, EVBDDs provide two advantages over OBDDs. First, they allow equivalence checking between Boolean functions and arithm etic functions. Second, they handle hierarchical designs, th at is, the implementation of a design can be described using previously verified components rather than having to flatten the design down to the gate level. This chapter first presents a simple example of how to use EVBDDs to verify the functional behavior of circuit designs and then describes a verification paradigm for proving data paths. In order to verify control paths and do hierarchical verification, EVBDDs are extended to structured EVBDDs. Finally, the input variable ordering strategy for logic verification will be discussed. 1 1The experimental results in this chapter were generated on a Sun 3/200 with 8 MB of memory. 33 Figure 3.1: EVBDD expression: 2carry + sum. I P (x) Figure 3.2: EVBDD expression: x + y + z. E x a m p le 3.0.3 We prove that carry(x,y,z ) and sum(x,y, z) implement the full adder x + y-\-z. T hat is, with the interpretation of (carry, sum) as a 2-bit integer, we show 2carry + sum = x -f y 4- z. Given a gate-level (Boolean) description of a full adder, it is easy to construct the EVBDD representation of the carry and sum functions as shown in Fig. 2.7. Carrying out the expression 2carry + sum results in the rightmost EVBDD shown in Fig. 3.1. On the other hand, the specification of the arithm etic behavior of the full adder, x + y + z, represented in EVBDDs is shown in Fig. 3.2. The equivalence between 2carry -f sum and x-\-y + z can then be checked by comparing the two rightmost EVBDDs in Figures 3.1 and 3.2. □ As shown in the above example, the implementation of a design is described by Boolean functions while its behavioral specification is described as an arithm etic function. The equivalence checking between two different levels of abstraction is carried out by using one representation - EVBDD. 34 3.1 T h e V erification P a ra d ig m We are given the following: 1. The description of an implementation: iffipijC ix, . . . , Xnk) = i • • • j 9m (* * -1 1 j • • • , ^nfc)) ? where xtj ’s are Boolean variables and gf s are Boolean functions. 2. The interpretation of the input variables Xij’s: X i = fi(x u , ...,x ij) (for a j-b it integer), x n - fn(xni, • • •, Xnk) (for a fe-bit integer), where Xi = /,( x ,i,. . . , x,-p) describes how variables (x,i,..., X{p) should be interpreted as a p-bit integer through function Thus, Xi is an integer variable and /,- specifies the number system used. A number system may be unsigned, two’s complement, one’s complement, sign-magnitude, or residue. For example, if Xi is an unsigned integer, then fi(xn, ..., Xiv) = 2p-1x,i + . . . + 2 °xip. 3. The interpretation of the output variables gCs: G = g(gi,. . . , gm)- Again, g is a function representing a number system. 4. The description of a specification: SpCC^Xj, . . . , Xn) fi^Xj, . . . , Xn)i where function / specifies the intended behavior of the implementation. 35 To show imp realizes spec, we show the following equivalence relation: / ( A * , ..., = d id ly 9m) o r f{fl{x 11, x lj)i - ‘ ‘ 1 fn{xnh •••ixnk)) = xnk)i • • • ■ > 9m{xlli •••» ^nfc))- Using the example in the previous section, we have: imp{x,y,z) = {carry(x,y,z),sum (x,y,z)), X = Z, Y = y, Z — z, G = 2carry + -sum, spec(X, Y,Z) = X + Y + Z. And, the correctness of the full adder is verified by showing x+y+z = 2carry(x, y, z) + sum(x,y,z). The above paradigm can be reversed to become a procedure for functional syn thesis. Again, we use the full adder as an example except now the goal imp(x, y, z ) is not given. From the description of spec, we have sum (x,y,z) = spec mod 2, carry(x,y,z) = {spec — {spec mod 2 ))/2, where spec = x + y + z. The following sequence of apply operations on EVBDDs then produces the sum and carry automatically: <0,xy} = apply{{0,x), (0,y ), + ), <0,fa) = apply{{0, z), (0, xy ), + ), (0, sum ) = apply({0, fa), (2,0), mod), (0, te m p ) = apply{{0, fa), (0 ,su m ), — ), (0, c arry ) = apply{{0, te m p ), (2,0),/). As presented in Sec. 2.3.4, operations modulo and integer division can be ef fectively carried out in EVBDDs. An application of the above synthesis procedure is in logic verification without variable binding. For example, we can specify a 64-bit adder as (x + y ’ while the variable sets in the implementation are a ’s and 6’s. In this case, we first convert the arithm etic expression into a vector of Boolean functions and then use Boolean matching [57] to perform the equivalence checking. 36 E x a m p le 3.1.1 The design (imp) is a 64-bit 3-level carry lookahead adder which has 129 inputs, 65 outputs, and 420 logic gates. The intended behavior (spec) is specified as: unsigned(65) add64(x, y, c) unsigned(64) x, y; unsigned c; { return(x + y + c); } where (64) and (65) declare the number of bits. In the experimental implementa tion, the generation of 65 EVBDDs of imp (575 nodes in total) takes 1.47 seconds and the generation of one EVBDD of spec (129 nodes) takes 0.17 seconds. The verifica tion process which converts 65 EVBDDs into one, performing 264 x &o+ • • - + 2° x & 6 4 ? and then compares the result with the spec takes 4.48 seconds. T hat is, it takes less than 5 seconds to show 65 Boolean expressions are really carrying out an addition. □ 3.2 S tru ctu red E V B D D As shown in the previous section, EVBDDs can be used to show the equivalence between Boolean expressions and arithm etic expressions. To show the equivalence between Boolean expressions and conditional expressions, EVBDDs are extended to Structured EVBDDs, or SEVBDDs for short. For example, the implementation of a multiplexer can be described as l(x A y) V (x A z)' while the specification can be described as ‘if x then y else z \ In addition to the specification of conditional statem ents, SEVBDDs also allow the declaration of vectors. 37 f f. 1 m t P e (a) (b) <c) Figure 3.3: Graphical representation of SEVBDDs. D efin itio n 3.2.1 SEVBDDs are recursively defined as follows: 1. An EVBDD is an SEVBDD. (This is the atomic type of SEVBDDs.) 2. (p — > t;e) is an SEVBDD if p is an SEVBDD with the {0, 1} range, and t and e are SEVBDDs. For every input assignment b, the function denoted by (p — * t\ e) returns the value t(b), if p(b) = 1; otherwise it returns e(b). (This is the conditional type of SEVBDDs.) 3. [fi,. . ., f m] is an SEVBDD if / i , ..., /m are SEVBDDs. For some input assign ment b, [ft, ..., f m] returns the vector (ft(b),..., / m(6))* (This is the vector type of SEVBDDs.) In graphical representation of SEVBDDs, terminal nodes are atomic type SEVBDDs (Fig. 3.3 (a)) and there are two types of nonterminal nodes: a conditional node which has three children (Fig. 3.3 (b)) and a vector node which has an indefinite number of nodes (Fig. 3.3 (c)). E x a m p le 3.2.1 Let x,y,z,yo,y\,zo , and z\ be EVBDDs. Consider 1. x, x A y, x A z, and 2. (x A y) V (x A z)\ 3. (x — » y \z ), (x — » x A y; z), (x — > y; x A z), (x — ► x A y\x A z), and 38 (a) (b) Figure 3.4: Examples of SEVBDDs. 4. (x -* > [yo,yi];[*b,2i]); 5. [(x -> y0; Z0), (X -> yi; J8i)] and 6. [(a; A y0) V (iA z0), (x — » • x A yi; x A zi)]. SEVBDDs in groups 1 and 2 are atomic type SEVBDDs; Those in groups 3 and 4 are conditional type SEVBDDs; Those in groups 5 and 6 are vector type SEVBDDs. Note that the SEVBDDs in groups 2 and 3 represent a 1-bit multiplexer while the SEVBDDs in groups 4, 5, and 6 represent two 1-bit multiplexers which have the same control signal x. The graphical representation of those in groups 4 and 5 are shown in Fig. 3.4 (a) and (b), respectively. □ D e fin itio n 3.2.2 The type graph of an SEVBDD f is obtained by replacing all term inal nodes of f by a unique term inal node A. E x a m p le 3.2.2 The type graphs of the SEVBDDs in Fig. 3.4 are shown in Fig. 3.5. □ SEVBDD would be a canonical representation if two SEVBDDs denote the same function if and only if they are isomorphic. This is however not true because we can have two SEVBDDs denoting the same function which have different types (e.g., 39 0 > ) (a ) Figure 3.5: Examples of type graph of SEVBDDs. Ex. 3.2.1). However, with proper restrictions, SEVBDDs can still have the canonical property. T hat is, if two SEVBDDs satisfy those conditions then they denote the same function if and only if they are isomorphic. In the following, two conditions are defined such that the subset of SEVBDDs which satisfy these conditions have the canonical property. The first condition is to be isotypic which is defined as follows: D efin itio n 3.2.3 Two SEVBDDs are isotypic if their type graphs are isomorphic. Equivalently, two SEVBDDs / and g are isotypic if 1. Both / and g are EVBDDs, or 2• / = (Pf -» g = (pg -> tg-,eg), pf and pg are isotypic, tf and tg are isotypic, and e/ and eg are isotypic, or 3. f = [fi, frn], g = [gi, ,gm\ and every pair of /,• and g{ are isotypic. E x am p le 3.2.3 In Ex. 3.2.1, the SEVBDDs in groups 1 and 2 are isotypic; the SEVBDDs in group 3 are isotypic but none of them is isotypic to that of 4; SEVBDDs in groups 5 and 6 are not isotypic. □ Note that two SEVBDDs which are isotypic but are not isomorphic, may still denote the same function. In Ex. 3.2.1, the SEVBDDs in group 3 are isotypic but are not isomorphic, yet they all denote the same function. Given an SEVBDD p — * ■ < ; e, 40 for any input assignment b such that p{b) = 1, the function value of e(6) will not influence the result; similarly, if p(b) = 0 , then t(b) is irrelevant. Therefore, we can use operators cofactorx(p,t) and cofactor0(p, e) to transform t and e to t' and e' such that if p(b) = 1, then t'(6) = t(b) and e'(b) = 0; if p(b) = 0, then t'(b) = 0 and e'(b) = e(b). Consequently, we obtain a reduced form (p — > tf; e') for p — *t',e. Operator cofactorx(p,t) is carried out in a similar way to the restrict operator in [25] except for the following differences: When p = 0, restrict returns error while cofactori returns 0; Restrict applies to Boolean functions while cofactorx applies to arithmetic and Boolean functions. The second condition for SEVBDDs to have the canonical property is to be reduced as defined in the following: D e fin itio n 3 .2 .4 An SEVBDD is reduced if 1. It is an EVBDD, or 2. It is a conditional SEVBDD of the form {p — ► i; e) with cof actorx(p,t) = t, cofactoro(p, e) = e, and t and e are reduced, or 3. It is [ / i , . . . , / m] and every /,• is reduced. In Ex. 3.2.1, the SEVBDDs in groups 1 and 2 are reduced; the last SEVBDD in group 3 and the one in group 6 are also reduced. To show the canonical property of the restricted form of SEVBDDs, a function level is defined on SEVBDDs as follows: D efin itio n 3 .2 .5 The function level : SEVBDD — > integer is defined recursively as: 1. level(ev) = 0, if ev is an EVBDD, 2. level(p — * t; e) = 1 -f max{level(t), /eue/(e)}, 3. /eu e/([/o,. . . , f m- 1 ]) = 1 + m aa:{/eue/(/o),. . . , level(fm- X )}. 41 In Ex. 3.2.1, the SEVBDDs in groups 1 and 2 have level 0; the SEVBDDs in group 3 have level 1, and the SEVBDDs in groups 4, 5, and 6 have level 2. L em m a 3 .2 .1 If two SEVBDDs / and g are isotypic and reduced, then / and g denote the same function if and only if they are isomorphic. Proof: Necessity: It is trivial to show that if / and g are isomorphic, then they denote the same function. Sufficiency: If / and g are not isomorphic, then they denote different functions, that is, 36 6 B n such that e u a /(/, 6) ^ eval(g, 6). This is shown by induction on level(f). Base: level(f) = 0, then both / and g are EVBDDs. This is true from lemma 2.2.1. Induction hypothesis: Assume it is true for level(f) < k. Induction: Case 1: / = (p — ► t f ; e/) and g = (p — * tg; eg). Since / and g are not isomorphic, then tf and tg are not isomorphic and/or e/ and eg are not isomorphic. If tf and tg are not isomorphic then by induction hypothesis there exists 6 such that eval(tf,b) ^ eval(tg,b). Because tf and tg are reduced, that is, if eval(p,b) — 0 then eval(tf,b) = eval(tg,b) = 0 by operator cofactorx, we have eval(p, b) = 1. Thus, eval(f, b) = eval(tf, b) / eval(tg, b) = eval(g, b). By a similar reasoning, we can show that the induction step holds true when ef and eg are not isomorphic. Case 2: / = [/i,..., f m] and g = [gx, . . . , gm]. There exist 1 < i < m such that f and gi are not isomorphic and from induction hypothesis there exists 6 such that eval(fi,b) ^ eval{g^b). Then, eval(f,b ) = {..., eval(fi, 6 ) , . . ^ , eval(gi, 6),...) = eval(g, 6). □ After proving that isotypic and reduced SEVBDDs enjoy the canonical property, we need procedures for converting an SEVBDD from one form to another and/or reducing an SEVBDD. Operator cofactorx and cofactorQ are used for converting 42 from atomic (EVBDDs) to conditional form. To convert from conditional to atomic form, we use operator ite which is nearly the same as the one described in [12] except that the ite operator used here also applies to arithmetic functions. Op erator ite takes a conditional SEVBDD such as (p — > t \ e) (t and e are EVBDDs) as argument and returns an EVBDD / such that (p — > t; e) and / denote the same function. The following pseudo codes are for converting the forms of SEVBDDs and reducing SEVBDDs, where cof actor S \ , cof actors0, and i t e s are SEVBDD versions of cofactori, cof actor and ite, respectively. convert(f, g) /* converting g to the same form as that of / */ /* assuming / and g have the same number of outputs, e.g., both / and g */ /* are atomic form or vector form with the same number of elements */ { if ( / is an EVBDD) if (g is an EVBDD) return(^); if (g == (p — » £;e)) return(ite(p,convert(f,t),convert(f,e)))] else if ( / == (p — » t ; e)) return(p — » convert(t, cof actor -Si(p, < ?)); convert(e,cofactors0(p,g))); else /* f = [fi,‘--,fm]*/ i f ( 9 = = (P - * *5 e )) return(ite~s(p, convert(f, t),convert(fi e))); else return([conuer<(/i,5' 1), ...,convert(fm,gm)]); } 43 reduce(f) { if ( / is an EVBDD) return(/); else if ( / = = (p — > f; e)) return(reduce(p) — » ■ reduce(cof actor s x(p, <)); reduce(cof actor s 0(p, e))); else return([re<f«ce(/i),. . . , reduce(fm)]); cof actor s i (p, t ) { if (t is an EVBDD) retuin(cof actorx(p, £)); else if (f = = p' — > t'; e') return (co / actor s x(p, p') — » • cof actor S\{p, t')- cof actor s x(p, e')); else /* f = [fl5... ,fm] */ return( [co/acfor_s1(p, <x), - •., cof actor s x(p, < m)]); } ites(p,t,e) /* assuming t and e are isotypic */ { if (p is a conditional SEVBDD) return(*fe-^(i<e_^(p) — * t; e)); if (t is an EVBDD) return(i£e(p, t, e)); if (t == (pt — > tf, et) & :& e = = (pe — > te; ee)) return(e<e^s(p,pi,pe) — * ites(p,tt.,te)-,ites(p, e«;ee)); if (f —— [^lj • • ■ ? ^ m ] c — — • • • ? ® m ]) return([i<e^s(p, < 1 , ea),..., ites(p, tm, em)]); } 44 To show the equivalence between a specification and an implementation de scribed in two different forms, we need to convert from one form to another. The following experimental results use the specification as the target form. This is because specifications usually have more compact representations than th at of im plementations have. For example, a specification of lx < y — » x + y; x — y ’ where x and y are n-bit integers, requires 3n, 2 n, and 2 n nonterminal nodes for representing ® < Vi x + Vi and x — y, respectively. On the other hand, a gate implementation of the above specification requires n + 1 Boolean functions in which the ith func tion (for generating ith bit) requires at least 2 i nonterminal nodes, and the carry function (bit) requires at least 2n nonterminal nodes. Thus, it requires at least n(n + 3) nonterminal nodes. The following two examples verify SN74L85 and SN74181 chips [95], where the first one is a 4-bit comparator and the second one is a 4-bit ALU. E x a m p le 3.2.4 The implemented design (imp) is the SN74L85 chip [95] which is a 4-bit comparator. This chip has 11 inputs, 3 outputs and 33 gates. The specification (spec) of the design may be described as: unsigned(3) comp4(x, y, gt, It, eq) unsigned(4) x, y; unsigned gt, It, eq; { if (x > y) retu rn ((l, 0 , 0 )); else if (x < y) return(( 0 , 1 , 0 )); else return((gt, It, eq)) } It takes 0.05 seconds to generate the SEVBDD of imp which has 39 nodes and it takes 0.02 seconds to construct the conditional SEVBDD of spec which has 25 nodes. The conversion from the SEVBDD of imp to that of spec and then the comparison | take 0 . 0 2 seconds. □ 45 E x a m p le 3.2.5 The implementation is the SN74181 chip which is a 4-bit ALU [95]. A partial specification is given below. Note: un-comp, two and unsigned perform type coercion, un-comp results in an unsigned integer, with the most significant bit being complemented, two means that the result is to be a two’s complement integer. SN74181(M, S, A, B, Cin) unsigned M, Cin; unsigned(4) S, A, B; { if (M = 0) if (S = 0) return((un_comp (5)) A + (— Cin)); else if (S = 3) return((two(5)) — Cin); else if (S = 6 ) return((un_comp(5)) A — B — Cin); else if (S = 0) return((unsigned (4)) not(A)); else if (S = l) return((unsigned(4)) not{A o rB )); } Note th at it is allowed that the interpretation of the same outputs to differ ent number systems as well as different sizes in different branches of conditional statements. The implementation SEVBDD has 765 nodes and can be generated in 0.31 sec onds. The specification SEVBDD has 187 nodes and can be constructed in 0.13 seconds. And the verification process takes 0.35 seconds to complete. □ 46 In addition to providing the ability to check equivalence between Boolean and arithm etic expressions and between conditional and nonconditional expressions, SEVBDDs are suitable for hierarchical verification, i.e., verification without having to flatten a component which has already been verified. In the following two exam ples, a 64-bit comparator and a 64-bit adder, the implementations are constructed from 4-bit comparators and 4-bit ALU’s. The construction of implementation SEVBDDs are however based on the specification SEVBDDs of the 4-bit comparator and 4-bit ALU’s. E x a m p le 3.2.6 The design is a 64-bit comparator implemented through serial connection of 16 SN74L85s. A net-list description used for this design is as follows: outl SN74L85 aO a l a2 a3 bO b l b 2 b3 gt It eq out2 SN74L85 a4 a5 a 6 a7 b4 b5 b 6 b7 outl o u tl 6 SN74L85 a60 a61 . . . b62 b63 outl5 O utput : o u tl 6 where a net list has the form of : output-name module-name input-nameJist. The specification of this design is the same as the one in Example 3.2.4 except that the size declaration is changed from 4 to 64. Generation of implementation and specification SEVBDDs take 0.26 and 0.39 seconds respectively, and the proof takes 3.35 seconds. □ E x a m p le 3.2.7 The design is a 64-bit ripple-carry adder implemented through serial connection of 16 SN74181s. The specification of this design is exactly the same as the one used in Example 3.1.1. A net-list description used for this design is as follows: 47 scl SN74181 G P G G P aO a l a 2 a3 bO b l b 2 b3 cO si tail scl cl head scl sc2 SN74181 G P G G P a4 a5 a6 a7 b4 b5 b 6 b7 cl sl5 tail scl5 cl5 head scl5 scl 6 SN74181 G P G G P a60 a61 ... b62 b63 cl5 O utput : si s2 ... sl4 sl5 sc l 6 The first 5 param eters of each SN74181 are connected to the ground or power to select the addition operation, tail groups all the inputs except the first one (the most significant bit) while head selects the first bit. Time to generate the SEVBDDs for the implementation and specification are 2.09 and 0.16 seconds, respectively and time to verify their equivalence is 0.98 second. Note that generation of implementation SEVBDD takes longer tim e while verification takes less time than the case in Example 3.1.1. This is because, here, 16 SEVBDDs are generated each with the sum of 4 bits instead of 64 SEVBDDs each with the sum of 1 bit. □ 3.3 O rdering S tra teg y The conditional type of SEVBDDs provides information for determining the ordering of input variables. For example, for SEVBDD (p — + t\ e), variables occurring in p are assigned lower indices compared to those in t and e. This ordering strategy matches the suggestion (controlling variables should be put on top of OBDDs) in [16]. It is more difficult to identify controlling variables in a Boolean expression. In addition, variables with larger integer coefficients are assigned lower indices compared to those with smaller integer coefficients. This ordering strategy also matches the 48 observation in [16], and is easier to identify from arithmetic expressions than from Boolean expressions. 49 C h a p ter 4 B o o le a n M a tch in g The problem of Boolean matching is defined as follows: Given two vectors of Boolean functions (fi(xo,..., a:n_ i), . . f m(x:0, ..., Sn-i)) and (gx(y0, . . y„_i), . . gm(yo, • • yn- 1 )), does there exist two bijections ir0 : { / i , . . . , f m} -> (yj, • • •, 9m) and *i ■ {^o, • • •, *n- 1 } -+ {yo» • • ■ » Vn-1 } such that fk{x 0 , . . . , X n_X ) = ?ro(/jfc)(7rj(«o), ■ • • , *l{Xn-l)), for 1 < k < m, where g% — Qk or 1 < k < m, yj = t/j or y], 0 < j < n? When such bijections do exist, ( / 1, ..., / m) and (gi,..., gm) are said to be input- negation, input-permutation, output-negation, and output-permutation equivalent or npnp-equivalent for short. A straightforward way to determine whether two Boolean functions are npnp- equivalent is to explicitly enumerate the set of all bijections, of which there are 2mra!2nn! in number, and perform tautology checking. This is clearly not practical. This chapter presents a matching algorithm based on the isomorphism checking on OBDDs which can be carried out in the time proportional to the sizes of OBDDs. This chapter first describes the basic algorithm for checking input-permutation equivalence based on two OBDDs and then discusses how it can be extended to 50 u u X (a ) Figure 4.1: A simple example. check output-perm utation, input- and output-negation equivalences. The various filters that speed up the process will be presented in the following sections. Given two functions / and g, we first construct their OBDDs, obddf and obddg. Then obddg is incrementally transformed to the same form as obddf. The trans formation is carried out by permuting a subset of variables of g while performing a check for isomorphism. To check whether obddf and obddg are isomorphic, the function graphs are searched in a level-first manner, that is, pairs of nodes to be m apped are added to a set M. and elements of this set are processed in the order of the index of the node in obddf. As an example, consider the OBDDs shown in Fig. 4.1. Using a breadth- first search, the order of processing the elements is (uo, uo)j ui)> (u 2 i v 2 ), • • • while using a level-first search, the order would be (uo, v0), (u i , ^ 2} ? (mi, Vi), — At each level i, we perform the following operations. For every (u, v) in M. such that index(u) = i, we first check index(v). If index(y) = i, we then check if (child[(u),childi(v)) and (childr(u),childr(v)) will cause conflicts. A conflict between two nodes exists if both of them are term inal nodes but have different values, or if one of them is a term inal node while the other one is not. If there is no conflict, then we proceed to the next level. If indexiy) ^ i or there is a conflict between childi{u) and child\{y) or between childr(u) and childr{y), then 51 we perform the replace.root operation as shown in Fig. 4.2. In Fig. 4.2(a), the right child of u and v cause a conflict. Thus, we make yj to be the new root of the subtree previously rooted at t/» (Fig. 4.2(b)). After performing replace-root, we carry out another check for isomorphism starting at level i for the new perm utation (..., yj, yi, y»+i,..., Vj-i, Vj+i, •••, )• Note th at all the (n — i — 1 )! perm utations of {y0, ■ ■ • ,Vi *) (with y0, . .., iu fixed in the first i + 1 positions) have been discarded. If yj still fails, then we try yk which has not yet been tried as a new root. This replace-root operation can be repeated until no yi can be the new root, at which point we backtrack to level i — 1 and perform a replace-root operation on ? /* •_ i . Proceeding in this manner, an isomorphism is found if we advance to level n, or we conclude that no isomorphism exists when we backtrack to level — 1 . obddj obddg P\ " R ' A A / A ' v A ' A - • A / (a) (b) Figure 4.2: The operation of replace_root. In the following procedure replace-root, cofactor creates two OBDDs, obddi and obddr, such that the functions h, I and r denoted by obddh, obddi and obddr satisfy h = zl + zr. The procedure new-obdd creates a new OBDD rooted by a node v with name(v) = z,childi{v) = obddi, and childr(v) = obddr. For every variable z' with 52 Figure 4.3: The new obddg after replace_root. index(z) > index(z') > index(obddh), procedure updateJndex changes its index to index(z') + 1 and then changes the index of z to index(obddh). replace.root^obddh, z) { if (index (obdd^) > index(z)) leturn(obddh); else { (obdd\, obddr) = cofactor(obddh, z); obddnew = new-obdd(z, obddi, obddr); update-index(obddnew, index(z)); return (obddnew); } } E xam ple 4.0.1 As an example of how the above Boolean m atching algorithm works, consider the OBDDs shown in Fig. 4.1. Initially, M. consists of {(uo^o)}- At level 0, we first check if index(v0) = 0, and then add (u2 > t> 2 )} to the set A4. At level 1, since index(u2) = 1 , we check if the index of v2 is 1, as it is in this case. We then find th at childr(u2) and childr(v2) cause a conflict. Thus we perform replace-root operation on variable y2. After replace_root, we have the new obddg as shown in Fig. 4.3 and the steps outlined above are carried out. □ 53 For output-permutation equivalence, two vectors of OBDDs are used for iso morphism checking. To handle input-negation equivalence, the conflict checking of ( childi(u),childi(v)) and ( childr(u),childr(v)) is replaced by the checking of (childi(u),childr{y)) and (childr(u),childi{y)). In the basic algorithm, the termi nal node with value 1(0) is isomorphic with the terminal node with value 1(0), while in the case of output-negation equivalence checking, the terminal node with value 1(0) is isomorphic with the terminal node with value 0(1). 4.1 M a tch in g F ilters An output variable filter is a function F out : {/i,. . . ,/m } — * r, r <E R (F out), where R (F out) is some finite set, and / , • is a Boolean function on n variables. Similarly, an input variable filter is a function F tn : (f(xo,... , xn_i),xt) —> r, Xi € (so* •.. ,a;n_i}, r € R(F,n) where R(F m) is some finite set. To speed up the task of Boolean matching, we examine a set of output and input variable filters which are derived from the necessary conditions for npnp- equivalence, that is, they have the properties that if F out{fi) ^ F out(gj) then (..., /,-,...) and (..., gj, ...) cannot result in npnp-equivalent under gj = Ko(fi), and if F ,n(f, x t) ^ F m(g, yJ) then /( ..., x,-,...) ^ g(..., y] , ...) under yt = 7rj(x,). An example of a simple filter is the size of the on-set. All filters presented in this section are computed using the OBDD representa tion. A filter can be applied to the entire OBDD prior to the execution of Boolean matching, or to the subgraph of an OBDD during the execution of Boolean match ing. Clearly, there is a tradeoff between how expensive it is to compute a filter and how effective it is in pruning the search space. Section 4.1.7 describes a way to measure the effectiveness of a filter and provides a comparison of the various filters based on an effect/cost ratio. 54 4 .1 .1 C a rd in a lity o f D e p e n d e n c e S et The dependence set of a function f ( x 0, ... ,x n- 1), denoted as Dep(f), is the set {#,• | 3 two assignments Bi = 6 ,_i, 1, 6*+i,...} and Bq = (..., 6,_i, 0, 6l+i , ...) such that f(B i) ^ f(Bo)}. Fdep(f) = l Dep(f) | is the cardinality of the dependence set of / with the range R(Fdep) — {0,1,..., n). The algorithm for computing the dependence set is shown below. Dep can be computed in O(m) time, where m is the number of nodes of an OBDD. Dep(obdd) { if (index(obdd) = = n) return(^); else { left = Dep(childt(obdd))’ , right = Dep(childr(obdd))] return(/e/< U right U index (obdd)); } } Fdep can be used during Boolean matching by applying it to subtrees rooted at nodes that are being compared. It can also be applied to the outputs of a m ultiple-output circuit. The latter is particularly useful for circuits th at implement arithm etic functions where almost every output function results in a unique value of Ff**. An input variable filter based on the dependence set is Xi) = true(false), if X{ is (is not) in Dep(f). 55 4 .1 .2 C a rd in a lity o f O n -set The on-set of a function / ( x 0 ,...,x n_i) is the set of input assignments where / = 1 . F™* is the cardinality of the on set of / and can be computed in 0(m) time and R{F%?) = {0 , 1 ,..., 2 n}. K T ( f ) i if (index(f) == n ) return(ua/ue(/)); else { I _ F out(childi(f)) * 2index(childdf))~indexU)-1 r _ F out(childr(f)) * 2index(childrU))— * ndex(f)— i return(f + r); } } Fon*'! as defined above, can be used to reduce the number of possible map pings between the outputs of two multiple-output circuits. It can also be used to reduce the number of mappings among input variables. For this we define a function F™(f,Xi) = F™*(f(x0t..., x,-_i, l,xt+1, ..., x ^ ) ) . If = ••• = Fon(f^xh) = Fonid 1 Vh) = ... = F™(g,yjk), then the set of variables {xtl, ..., x,fc } must be mapped to the set ,yjk}. This property can be used when attem pting to m atch X j to yj during Boolean matching. Furthermore, for two functions f ( x 0 ,..., xn_i) and g(y0,..., yn- i ) to be p-equivalent, the multi- sets {Fj”( / ,x 0),...,F^(/,x„_!)} and {F™(g,y0),..., F™(g, yn-i)} must be the same. Thus, a new filter F £ ^ ( f) can be defined as {F™(f, x0),..., F™(f, xn_x)}. 4.1.3 S izes o f D ista n c e k Let Dk{f) denote the set of pairs of one-points of /(x 0, ..., xn_i) whose Hamming distance is k. Then =| Dk(f) | and R{F%1) = {0,1,..., F™1 56 represents a set of filters. F ^ 1 can be applied to the outputs of a m ulti-output circuit prior to executing Boolean matching, thereby reducing the num ber of pos sible mappings between the outputs of two circuits. can also be used while performing Boolean matching. The following algorithms show how to determine F ^ f and F % £_ . In general, the computation of F ^ 1 can be carried out in the same way as of F^ x. F£?(obJJ) { if (index(obdd) = = n) return(O); else { dn = F°^t(obdd-and(childi(obdd),swap(childr(obdd))))', if (index(ckildi(obdd)) > index (childT (obdd))) r e t u m ( d n * Q in de x (ch ild r (°b d d ))—index(obdd.) — \ else return (dn * 2index^ hild^ obdd^ - index^obdd^~1)] } } swap(obdd) { if (index (obdd) == n) return (obdd)} else return(neio_o6 dd (variable(obdd), swap(childr(obdd')), swap(childi(obdd))))\ } In F£*f, both F™* and swap take 0(m ) time, but the operation of obdd-and(u, v) takes 0 ( m 2) time. Thus, the complexity of F £f is 0 (m 2). 57 F t.,(o b d d ) { n l = 0 ; for (i = 0 ; i < n; i + -f) { cof actor (obdd, Xi, obddi, obddr); left = F ff1 (update J,ndex(obddi, Xi))-, right = Ffff (update J,ndex(obddT, xf)); nl = n l + left + right; } return(nl); } Both cofactor and updateJndex take 0(m ) time while F f f f takes 0 ( m 2) time, thus the complexity of F % f f is 0 (n m 2). In general, the complexity of comput ing distance n — k is 0(C%m2). Similar to F™(f,X{), we define Fi:(f,xi) = Fd ? ( f{-• • > x% -1» h x*+ 1» • • •))• 4 .1 .4 U n a te n e ss o f In p u t V ariab les A variable x,- is monotone increasing (monotone decreasing) in a function / if for all input assignments of Xj ^ x,- / ( ..., x 1+1, ...) < (>) / ( ..., x,_i, 1 , x,-+i,...). A variable x,- is binate in / if x,- is neither monotone increasing nor monotone decreasing. The unateness of an input variable can be used as a filter F ™ ate( f , X i ) £ {inc, dec, binate}. This property can also be used as an output variable filter in the following way. Let S inc( f ) = {xt - | F ™ ate( f , x,) = inc}. S dec( f ) andS binate(f) are defined similarly. Then the cardinalities of these sets define the filter F°^ate( f ) = (I Sine |) | S dec |, | iS binate |) with R(F%£U) = {(ra,0,0), (n — 1 ,1,0), < n - 2 , l , l ) , (0,0,n)} and | |= C „ " « 58 The function F™ate(f,Xi) can be computed in 0 (m 2) as shown below: Kl«te{°hddixi) { cof actor {obdd, x obddij obddT ); if (obddjoperator(obddi, obddr, > )) return(m c); else if (obdd-operator(obddi, obddr, < )) return(dec); else return( 6m aie); } 4 .1 .5 S y m m e tr y C la sses o f In p u t V ariab les Two variables X j and Xj are symmetric if they can be interchanged without chang ing the function value, that is, / ( . . . , Xj, . . Xj, ...) = / ( . . . , xj, ..., Xj,...). We can determine if x,- and Xj are symmetric by testing if / ( . . . , x,_], 0, x*+1, ..., Xj-j, l,x J+1, ...) = / ( . . . , 1, a!i+i, Xj_i, 0, Xj+i, ...)• The following al gorithm returns true if x; and xy are symmetric under the function denoted by obdd. symmetry (obdd, x,-, xj) { cof actor (obdd, xob d d it, obddn ); cofactorfobddii, xj, obdd^ij, obddiiTj)] cof actor (obddTi, xj, obddTii}, obddriTj); return(o 6 dd;ir> = = obddrii}); } Let Ssym(f) be the maximal symmetry classes of / , that is, Fsym(f} — {X \ 5 • • • i Xk}, 53X% = {xo,..., xn_ j} •, X% O X j — < j> , Xj and Xj are symmetric if and only if X j € X\ and Xj € Xi, for some 1 . 59 The input and output variable filters based on S3ym(f) are F%LU) = { | X , | , . . . , | X t |}and FS,Jf,Xi) = I X, I, where x, € X,. The ranges of these filters are R(F™^) = {{1,..., 1}, {1,..., 1,2},..., {n}} and R{Flym) — {1,..., n}. The cardinality of R{F°y^) is the number of decompo sitions of the integer n. 4 .1 .6 U se o f F ilters This section explains, by the way of a small example, how the various filters can be used. Consider the following Boolean functions each of which has three inputs a, 6 , and c, where f{a, b, c) = ab + be + abc, g0(a,b,c) = ab + abc, gi(a,b,c) = bc+bc, g2 (a,b,c) = ab + bc + ac, # 3 (a, b, c) = ab + ac + abc, and g*{a, b, c) = ab + ac+bc. We want to find out which of s are p-equivalent to / . Applying F%£ to the above functions results in : (f,9o,gi,g2,g3,g4) = (3,3,2,3,3,3), which prunes g\ . Then we apply F™* and get F% n '• (f , 9 0 , 9 2 , 9 3 , 9 4 ) = {4,3,4,4,4). 60 This filter prunes function go. Next, we apply F™ to the rest of functions: * £ (/(< ., 4,«:)) = (2,1,2), F'2(m) = (2,1,3), f £ ( m ) = (1,2,2), and * £ ( * ) = (3,1,3). By comparing the multi-sets of F™ we know that both <72 and <74 cannot be p-equivalent to / . Furthermore, variable b of f can only be m apped by variable a of g3 because they have the same F™ value. This reduces the number of possible mappings among the inputs between / and g3 to 2! instead of 3!. Alternatively, instead of using F™ as an output filter we can use F™* to prune g-i and <74 because W , 92,93, 9 4 ) = <2,3,2,3), Fd?(f,92,g3,g4) = (3,2,3,3), and V ( 1 , 9 2 , 9 3 , 9 4 ) = ( 1 , 1 , 1 , 0 ). 4 .1 .7 C om p arison o f F ilters As mentioned earlier, there is a tradeoff between the cost of applying a filter and how effective it is in pruning the search space. To measure a filter’s effectiveness we need to examine the distribution of values of the filter over the sample space of all Boolean function of n variables. A filter partitions the set of all 2 2" functions of n variables into equivalence classes, where two functions belong to the same equivalence class if they have the same filter value. Let rj(F, n) be the number of equivalence classes formed by F and N(F, n, k) denote the number of Boolean functions f of n variables such th at F(f) = k, 0 < k < tj(F, n ). Let P(F,n) be the probability that two arbitrarily chosen functions / and g of n variables result in F(f) = F(g). P(F,n) can be used as measure of a filter’s effectiveness. The condition P(F\,n) < P(F2,n) implies th at two arbitrary 61 functions will be less likely to have the same filter value under Fi than under F2. Thus, Fi is more likely than F2 to declare that the two non-jp-equivalent functions are indeed not p-equivalent. Once we know the number of equivalence classes r)(F,n) and the cardinality of each class, then P(F,n) is easily computed. This is given in the following lemma. L em m a 4.1.1 p < f n) _ a s - 1 "■* ! + * : (4 » '' ’ * (22" + l)2 2" ‘ ^ ’ P ro o f : The proof rests on the following fact. Given a set of m elements, the number of ways of selecting j of them without regard to order and with repetitions allowed is (binomial coefficient). Therefore the total num ber of ways of selecting two functions from the set of all 22" functions of n variables without regard to order and with repetitions allowed is Tn = (22” + l)2 2"/2. Using the same argument, the number of ways of selecting two functions from one of the rj(F, n ) equivalence classes which has N(F, n, k) elements is (N(F, n, k) + l)N(F, n, k) An,k — 2 Therefore, P(F,n) = A ,'t . J- n The result follows since N(F, n, k) = 22". □ As an example, consider F™1 . Then n) = 2n, N{F°^1^ n, k) = C l'”, and p (Fon^ n) is given by ( 2; r W ' W . ’O = V + V - ^ < « ) 62 Filter F Cost | P ( F ) I - 1 = 7 ? ( F > ) Fdep O(m) n Fon 0 {m) 2” Fdk 0 [ C lm k) C'”2n~1 F unate o \ m z) Qn+i F * sym 0 (n2m ) 1 £ o Table 4.1: Comparison of filters. For Ffg, v(FSep, n) = n and N(F$£,n,k) is given by N(F%, " . * ) = ( £ ) E ( ~ 1 )’ ( • ) 22‘"‘ ■ (4-3) It can been shown that P (F "“*,n) < P { F ^ 1 n), which implies th at F™1 would be more effective than F$£*. Similarly, we can determine the forms of P (P , n ) for each of the filters described in this section. In this way it is possible to order the filters based on increasing values of P (P , n). A complete analysis of the filters is beyond the scope of this section. However, it is possible to get another equivalent but highly simplified measure of a filter’s effectiveness. This is simply the cardinality of R ( F ) . For the set of filters discussed in this section, the order obtained using the simplified measure is the same as the one based on P (F , n). Table 4.1.7 shows the cost of applying each filter and the cardinality of its range. Based on the simplistic measure of a filter’s effectiveness, we note th at 1. F on has the best effect/cost ratio, a property that is supported by experi m ental results 4.5. 2. Although the effect/cost ratio of Fdep is not as good as F on and F dk, it is very inexpensive to compute. Furthermore, the computation of F on and F dk requires determining the dependence set. 63 3. The effect/cost ratio of Fdk is moderate for extreme values of k with respect to n. Note that in the above analysis, each filter is analyzed independently of other filters. A much more accurate analysis is possible if the effect of one filter is taken into account in evaluating another. 4.2 D o n ’t C are S ets This section presents the effect of Boolean functions with don’t cares on Boolean matching. A Boolean function / with don’t cares is denoted by (f 0n,fdc) where the on-set of f on is the on-set of / and the on-set of f dc is the don’t care set of / . Before extending the matching algorithm, we have the following definitions and lemmas. D efin ition 4.2.1 Two Boolean functions / and g are unifiable, denoted by f = g, if fon Q g0n + 9 d c and gon C f on -f f dc. T hat is, there exist some don’t care assignments such that / and g can become equal. D efin ition 4.2.2 Given two Boolean functions / and g which are unifiable, the maximum unifier of / and g, denoted by / fj, g, is is the function derived by the minimum don’t care assignment on / and g such that they become equal. L em m a 4.2.1 If / = g then / fi g = (hon, hdc) where hon = f on -f gon and hdc — fdc9dc~ L em m a 4.2.2 If / = g then / fi g = g // / . \ { f = g A f = h A g = h then ( f p g) p h = f (i (g fi h). If / S g A ( / fi g) ¥ h then ( / p h V g h). Lemma 4.2.2 has the following im portant implication: the unification process can be carried out in arbitrary order without backtracking. More specifically, when a 64 backtrack occurs in the matching algorithm, it is due to a wrong m atch not the wrong order of unification process. W ith the above definitions and lemmas, the extension of the m atching algo rithm to cover don’t care sets is straightforward. A function / now is represented by two OBDDs obddon and obdddc• The conflict checking in the basic algorithm is extended to check the unifiable property between two nodes. For example, if a node u of / is mapped to two different nodes v and v' of g during the matching process, then we check if v and v' are unifiable. If they cannot be unified, a con flict results; otherwise we have a possible m atch between u and v" where v" is the maximum unifier of v and v'. Since a Boolean function with don’t cares actually represents a set of Boolean functions, a filter of such a function then becomes a set of values instead of a single one. For example, F ^ d fo n , fdc)) becomes {F°“*(/on) ,.. •, F °^ t{ f on) + F ^ t ( f dc) } . Consequently, the testing of filter values between two nodes is changed to ri n r 2 / < ^ , where r\ and r 2 are sets of filter values. Note, two variables may be symmetric under one don’t care assignment but not symmetric under another assignment. Thus, the filtering properties of Fsym (and Funate) are lost when don’t cares are present. 4.3 F ilte r s B a sed on S p ectra l C oefficien ts This section presents a set of filters based on spectral coefficients. The main purpose of spectral methods [100] is to transform Boolean functions from Boolean domain into another domain so that the transformed functions have more compact implementations. It was conjectured th at these methods would provide a unified approach to the synthesis of analog and digital circuits [97]. Although spectral techniques have solid theoretical foundation, until recently they did not receive much attention due to their expensive computation times. W ith new applications 65 in fault diagnosis, spectral techniques have recently invoked interest [53]. New computational methods have been proposed. In [40], a technique based on arrays of disjoint ON- and DC-cubes is proposed. In [97], a cube-based algorithm for linear decomposition in spectral domain is proposed. Recently, [23] proposed two OBDD-based methods for computing spectral coeffi cients. The first method was to treat integers as bit vectors and integer operations as the corresponding Boolean operations. The main disadvantage of this represen tation is that arithmetic operations must be performed bit by bit which is very time consuming. The second method employed a variation of OBDD called Multi- Terminal Binary Decision Diagrams (MTBDDs) [22] which are exactly the same as the flattened form of EVBDDs. The major problem with using MTBDDs is the space requirement when the number of distinct coefficients is large. The work on spectral techniques is motivated by the following observations. First, it is well-known that OBDD-based algorithms have outperformed cube-based algorithms in many logic synthesis and verification applications. Second, spectral methods are based on orthogonal transform techniques in which arithmetic oper ations and integer domain are used rather than Boolean operations and Boolean domain. This section presents an EVBDD-based algorithms for computing Hadamard (sometimes termed Walsh-Hadamard) spectrum [100]. In this approach, the ma trix representing Boolean function values used in spectral methods is represented by EVBDDs. This takes advantage of compact representation through subgraph sharing. The transformation matrix and the transformation itself are carried out through EVBDD operations. Thus, the benefit of caching computational results is achieved. The algorithms presented here include both the transformation from Boolean domain to spectral domain and the operations within the spectral domain itself. 66 The Hadamard transformation is carried out in the following form: T n g 7 ' R n, (4.4) where T n is a 2n x 2n m atrix called transformation matrix, Z n is a 2" x 1 m atrix which is the tru th table representation of a Boolean function, and R n is a 2n x 1 m atrix which is the spectral coefficients of a Boolean function. Different transformation matrices generate different spectra. In this section, we use the Hadam ard transformation m atrix [100] which has a recursive structure as follows: 'J 'n —X rp n —1 rpn— 1 and rp 0 1. E x a m p le 4.3.1 The spectrum of function f ( x , y ) = x 0 y is computed as ’ 1 1 1 1 ' 1 o 1 1 to 1 - 1 1 - 1 1 0 1 1 - 1 - 1 1 0 1 - 1 - 1 1 I o 1 ...1 1 I The order of each spectral coefficient r,- (ith row of R n) is the number of l ’s in the binary representation of i,0 < i < 2n — 1. For example, roo is the zeroth-order coefficient, roi and rio are the first-order coefficients, and r n is the second-order coefficient. Let = { multi-set of the absolute value of r^’s where r*. is an ith- order coefficient of R 1}, 0 < i < n. In Example 4.3.1, R q = {2}, R\ = {0,0}, and R \ = {2}. An operation on / and its R n which does not modify the sets R? is referred as an invariance operation. Given a function f ( x i , . . . , x n) with spectrum 67 RJ1 , three invariance operations on / and R n are as follows (formal proofs may be found in [38]): 1. Input negation invariance: if Xi is negated, then the new spectrum R n is formed by r'k = —rk where the ith bit of it is 1, and rk = rk otherwise. 2. Input perm utation invariance: if input variables Xi and xj are exchanged, then the new spectrum is formed by exchanging rk s and r/’s where k — 21 = l — 2j . T hat is, the ith and j th bits of k and I are (1,0) and (0,1), respectively, while all other bits of k and I are the same. 3. O utput negation invariance: if / is negated, the RJ1 ' is formed by replacing all rk by - r k. L em m a 4.3.1 Two Boolean functions are input-negation, input-perm utation, and output-negation equivalent (npn-equivalent) only if their i?"’s are equivalent. Proof: For negation equivalent, since | rk |= | —rk |, replacing rk by —rk will not change R%. For perm utation equivalent, since rk s and r/’s have the same order, exchanging their values is equivalent to permuting values in multi-set R □ From Lemma 4.3.1, we have a new set of filters: Jf2". The following shows how to use EVBDDs to represent Boolean functions in spectral domains. The resulting data structure is called an SPBDD. The function value of an input pattern bo . . . 6n_j in SPBDDs is an element of R% if the pattern contains i I ’s. 4 .3 .1 S p e ctr a l EVBDD ( s p b d d ) The m ajor problem with Equation 4.4 is that all matrices involved are of size 2n. Therefore, only functions with a small number of inputs can be computed. To overcome this difficulty, we use EVBDDs to represent both Z n and RJ1. When an EVBDD is used to represent R n, it is referred as SPectral EVBDD, or SPBDD for 68 short. The difference between EVBDDs and SPBDDs is in the semantics, not the syntax. A path in EVBDDs corresponds to a function value while a path in SPBDDs corresponds to a spectral coefficient. The m atrix m ultiplication by T n is implicitly carried out in the transformation from Z n to R n (i.e., from EVBDD to SPBDD). Z n and Rn are recursively defined as follows: Z n - ryn— 1 "0 Z ? -1 and Rn = Then, Equation 4.4 can be rew ritten as: .n — 1 O Rl D B - Kq in — 1 r p n —l r p n —1 ' z r 1 ' p n —X ^ n —\ + p n - \ Z n - 1 ' o n —1 t l 0 r £ n —\ __r p n —1 Z n - 1 p n —l z ™ ~ ^ __ p n —l g n —l R r 1 Equation 4.5 then is implemented through EVBDD 1 as : (4.5) T ({x ,zr\zz~')) r( 1) r( 0) ~ r i Z r ^ r i Z r 1) + r i Z r 1)), (4.6) 1, (4.7) 0. (4.8) where r is the transformation function which converts an EVBDD representing a Boolean function to an SPBDD. To show the above equations correctly implement Equation 4.5, we prove the following lemma. 1For the sake of readability, flattened EVBDD is used in this section. 69 L e m m a 4.3.2 Let r : EVBDD — ► SPBDD as defined in Equations 4.6-4.8, then r implements T, th at is, r ( / n) = T nf n, where f n is an n-input function. Or, equivalently, r((x n, Z f_1, Z£-1)) = {xn, J??-1 , Proof: By induction on input size n. Base: n = 0, f ° = c is a constant function, c G {0,1}, r(c) = c by Equations 4.7 and 4.8, T°[c] = [l][c] = [c]. Induction hypothesis (IH): assume it is true for 0 < n < fc — 1, r ( / n) = T " /n. Induction: = (x*, t (Zo- 1) - rCZ,*-1) , ^ - 1) + rCZ^-1)) by Equation 4.6 = (x k, T k- xZ ^ -x - T k~xZl~x, T k~l Z%-x + T ^ Z } - 1) by IH = (xk, TJo-1} by Equation 4.5 □ E x a m p le 4.3.2 The exclusive-or function in Example 4.3.1 is redone in term s of EVBDD representation. = (*,7-({y,l,0)) - r « y ,0 ,l) ) ,r ( ( y ,l,0 ) ) + r((y ,0 ,l))) = {*, <^,^(0) - r ( l) ,r ( 0 ) + r (l)) - (y ,r (l) - r(0), r ( l) + r(0)), (yM °) - T(1)»r (0) + r (1)> + (y^C1) - T(°)>T(1) + r (°))) = (x > (y> - 1» i> - <y> ii i)» (y» - i » + (y> i)> = (* ,< y ,-2 ,o ),(y ,o ,2 )). □ Pseudo code evbddJospbdd(ev, level, n) is the implementation of Equation 4.5. Because of the following situation, this procedure requires level and n as parame ters: r((x ,z ,z )) = < x ,t ( z ) - t ( z ) ,t ( z ) - |- t ( z ) ) , = (x,0,2 x r(z)). 70 In reduced EVBDD, (x ,z,z) will be reduced to z while (x,0,2 x r(z )) cannot be reduced in SPBDD. We need to keep track of the current level so th at when the index of the root node ev is greater than level, we generate (level, 0,2 x r(ev)) (lines 3-8). evbddJto-spbdd(ev, level, n ) { 1 if (level = = n) return ev, 2 if (ev = = 0 ) return 0; 3 if (index(ev) > level) { 4 sp = evbddJtospbdd(ev, level -f 1, n); 5 le ft = 0; 6 right = evbdd-add(sp,sp) 7 return newjevbdd(level, left, right); 8 } 9 spi = evbddJ,ospbdd(childi(ev), level -f l,n ); 10 spr = evbdd-to~spbdd(childr(ev), level + 1 ,n); 11 left = evbdd^sub(spT,spi)\ 12 right = evbdduadd(spr,spi); 13 return new-evbdd(level, left, right); } 4 .3 .2 B o o le a n O p era tio n s in S p e ctr a l D o m a in This section shows how to perform Boolean operations in SPBDDs. It first presents the algorithm for performing Boolean conjunction in SPBDDs by the following def inition. D e fin itio n 4.3.1 Given two SPBDDs / and g, the operator A is carried out in the following way: 71 f A g = f x g, if / and g are terminal nodes; otherwise, (x,ft,fr) A (x,gt,gr) = (x, (/( A + f r A f lf t)/2, (// A gi + f r A gr)/2). The following lemma and theorem prove that the above definition carries out the Boolean conjunction in SPBDDs. L em m a 4.3.3 ( f + g)A(i+j) = f A i + fAj+ gAi + gAj, where f,g, i,j € SPBDD. (Note th at + ’ s may be replaced by — ’ s.) Proof: by induction on the size of inputs. Base: n = 0, /, g, i, and j are constant functions. (/ + 9 ) A ( * ' + j ) from LHS = ( / + 9) x (* + j) by Def- 4-31 = f x i + f xj -j-gxi + g xj by distributive laws of x and + f A i + fA j + g A i + g A j from RHS = f x i + f x j + g x i + g x j by Def. 4.3.1 Induction hypothesis (IH): assume it is true for 0 < n < k. Induction: let / = (xk,ft,fr), g = ( x k,gt,gT), i = {xk,it,iT), and j = (xk,jt,jr), where ft, f r, gi, gT, it, ir, jt, and j T have at most k — 1 inputs. (>^ k , f t , f r ) A { x k , it, i r ) -)- { x k;, f t , f r ) A ( x k , j t , J r ) ” f" {xk,g t,g T) A ( x k,i t , i r) + ( x k,g t,g r) A (xk,jt,jr) from RHS = { x k, (ft A ir + /r A *'/)/2, (ft A it + f r A iT) j2)+ (x k , ( f t A j r + f r A j l ) / 2 , ( f t A j t + f r A j r ) / 2 ) + ( ^ j A i r gT A i t ) / 2 , (<7 / A 4 5 r A i T) / 2 ) - \ - (**, (#< A j r + gT A j t ) / 2 , (gi A j t + gr A j r ) / 2) by Def 4.3.1 = i x k, ( f t A i r + f r A i {) / 2 + ( f t A j r + f r A j t ) / 2 + {gi A ir + g r A */)/2 + (37 A j r + g r A >i)/2, (// A it + /r A ir)/2 + (/; A j t + f T A j r ) / 2 + (gi A it + gT A i r ) / 2 + (gt A j t + gr A j r ) /2) by + in SPBDD = i p 'k , (// A i r f r A i t - f * //A / • “I ” f r A j t +gt A *r + gr A + 37 A *r + gr A jt)/2, (// A l| f r A i , - //A j t "f /r A jr +fir< A it + gr A iT + gt A jt + gr A jr)/2) by + and / 72 ((Xk,fhfr) + {Xk,9h9r)) A ((x k,ii,i r) + (xkJ h j r)) from LHS (Xk, fi + gi, /r + 9r) A <x*, it + ji, ir + j'r) by + in SPBDD (xk, ((ft + 9l) A (ir + ir) + (fr + 9r) A (*| + j[))/2, ((// + 9i) A (*/ + i / ) + (/r + sv) a (ir + i r ) ) / 2 ) by Def 4.3.1 (xk, (fl A ir + // A jr + 91 A ir + gi A i r +/r A i; + /r A ii + $ > r A t/ + A i^)/2, ( // A i{ + fi A ji +gi A ii + 91 A j'j -f- ir A ir ir A j r " 4 " 5 V A i'r “ I - P r A Jr)/2) by IH □ T h e o re m 4.3.1 Given two Boolean functions / and g represented in EVBDDs, T( f ' 9 ) = = T(f) A t(</), where • is the conjunction operator in Boolean domain. Proof: by induction on the size of inputs. Base: n = 0, / and g are term inal nodes or constant functions. r(f -g) = r(f x g) = f x g. T(f) A r(g) = / A g = f x g. Induction hypothesis (IH): assume it is true for 0 < n < k — 1. Induction: let / = (xk,fi,fr} and g = (x k,gi,gT) where f t , / r , gi and gr have at most k — 1 inputs. T{(x k-,fhfr)-(xk,gi,gr)) from LHS r ((x k, fi - gu fr ■ gr)) by • in EVBDD (xk, r ( f r • gr ) - r(fi • # ) , r ( / r • gT) + r ( /, • fi-/)) by r operation (**, r (/r) A r(gr) - r(fi) A r(gi), T(fr) A r(^ r ) + r(fi) A r(flrj)) by IH 73 T(xk,fi,fr))/\T{(xk,gh gr)) (RHS) = (xk,T(fr) - r(/z), r(fr) + r(/0)A (xk, r(gT) - r(g{), r(gr) + r(gt)) (r) = (**> ((r (/r) - r(fi)) A (T(flfr ) + r{gi))+ (T{fr) + r(/i)) A (r(gr) - r(gt)))/2, (O'C/r) - r(fi)) A {r{gr) - r (# ))+ (r(fr) + r(fi)) A (r(flir) + r(gt)))/2) (A) = (**» (r(/r) A r(^r) + T(fr) A T(gi) — T{fi) A T(srr ) - r ( / , ) A r ( # )+ r{fr) A r(^r) - r ( / r) A r(gt)+ T{fi) A r($r) - r(/,) A r(gi))/2, (T(/r) A r($r) - r ( / r) A t ^ , ) - r (/i) A r(flrr) + r(/i) A t ( # ) + T(/r) A r(gr) + r ( / r) A r (# )+ t(/,) A t( * ) + r(/,) A r(sf,))/2) (LEMMA 4.3.3) = (**, r ( / r) A r($ rr) - r(/,) A t ( # ) , T(/r) A r(pr) + r(/j) A t(#)> (+> /) □ Other Boolean operations in SPBDDs are carried out by the following equations: /Vflr = / + fif-/A ^, ( 4 .9 ) f ® 9 = / + J - 2 x ( / A j), (4.10) / = J n - / , (4.11) where V, 0 , an d -, are or, xor, and not in spectral domain (SPBDD), J n = [2n, 0,..., 0]*. These operations V, 0 , and- are from [53] with minor modification to m atch the r operation. Operations + , —, and x are carried out in the same way as in EVBDDs (Sec. 2.3). 74 4 .4 F ilte r s B a se d on P r im e Im p lica n ts This section describes a set of filters based on the complete set of prime implicants of a function and presents OBDD-based data structures and algorithms for efficient computation of this set of filters. D efin ition 4.4.1 Given a function f ( x 0, ..., ® n- i) , let P rim es(f) = {p | p is a prime implicant of /} , Pfrt ~ {p \ P € P rim es(f) A p C x}, Pf,x = {P I P € P rim es(f) A p C x}, p f,*e = { p I P € P rim es(f) A p % x A p £ z}, P d f, x) = (m m (| Pf> x |, | PJ < X |), m a x (| Pf> x |, | Pf> x |), | Pf> X e |), and Pconnt(f) = $Pc(f,x) | X € S U p p o r t ( f ) } . where -J J represents a multi-set. We have the following propositions. Let F 0U t and F tn denote output and input filters as defined in Sec. 4.1. P rop osition 4.4.1 | P rim es(f) | is an F out. P rop osition 4.4.2 Pc(f,x) is an F tn. P rop osition 4.4.3 P C O u n t ( f ) is an F out. To compute the complete set of prime implicants of a function, a variation of OBDD was developed which is inspired by the Coudert and M adre’s work [26]. In this variant of OBDD, each nonterminal node has three children left, center and right and denotes the function xf\ + / c + x f r where f c = fifr. The resulting OBDD is referred as the Consensus OBDD, or CBDD for short. The computation of P rim es(f) is carried out in two steps. In the first step, we generate all prime implicants as well as some nonprime implicants based on the consensus operation. In the second step, we remove the nonprime implicants. 75 To perform the first step, we must convert OBDDs to CBDDs. The conversion is described by the following algorithm obdd-to-cbdd. obdd-to-.cbdd( f) { if (f = = 0) return 0; if (f = = 1) return 1; fc = obdd-and(ii,fr)', return cbdd-con struct (variable(f), obddJo-cbdd(fi), obdd-to-cbdd{fc), obdd-to-cbdd{fr )); } where cbdd-construct builds a nonterminal node with root variable(f) and three children. After the operation obdd-.to.cbdd, the resulting CBDD contains not only all prime implicants but also some nonprime implicants. In the second step, we remove the nonprime implicants from the CBDD using the following formula: P rim es(f) = (Prim es(fi) — P rim es(fifr)) U (P rim es(fr) — P rim e s(fifr)) U P rim es{fifT) The operation is carried out by the cbdd-tojpbdd procedure. The resulting OBDD is referred as Prim e OBDD, or PBDD for short, in which every path to a term inal node 1 corresponds to a prime implicant. Note that, a PBDD f contains all the prime implicants of function / and its center child contains all the prime implicants of function fifr, but its left (right) child neither contains all the prime implicants of fi (f r) nor contains all the prime implicants of fi — f r (f r — //). This is because the ‘subtract’ (pbddsub) operation is not closed under PBDDs. 76 cbddJt o-pbdd(f) { if (f = = 0) return 0; if (f = = 1) return 1; h; = cbdd-to-.pbdd(fi); hr = ebdd-to-pbdd( fr); new c = cbdd-to-pbdd( fc); new / = pbddsub(hi, new c); n ew r = pbdd^sub(hr, n ew c); return pbdd-construct(variable(f), new;, n ew c, n ew r); } pbddsub{ f , g) { if (f = = 0) return 0; if (g = = 0) return f; if (f = = g) return 0; if (variable(f) > variable{g)) return pbddsub(f, gc); if (yariable(f) < variable^g)) return pbdd-construct(variable(f),fi,pbddsub(fc, g), fr); return pbdd-Construct(variable(f),pbddsub(fi, g/), pbddsub(fc, gc),pbdd~sub(fr, gr)); } Filters described in propositions 4.4.1, 4.4.2, and 4.4.3 can be easily constructed using the PBDDs. For example, | Primes(f) | is equivalent to computing the number of 1-paths in the PBDD for / . 77 1 0 1 0 1 0 (a) (b) (c) Figure 4.4: Function carry represented by (a) OBDD (b) CBDD (c) PBDD. E x a m p le 4.4.1 The function carry of a full adder represented by OBDD, CBDD, and PBDD is shown in Fig. 4.4. The CBDD representation of carry in Fig. 4.4 (b) is derived by applying procedure obddJto-cbdd on the OBDD in Fig. 4.4 (a), and the PBDD in Fig 4.4 (c) is derived by applying procedure cbdd-tojpbdd on the one in Fig. 4.4 (b). The set of prime implicants of carry is {xy,yz,xz}. Note th at the implicants of carry represented by 4.4 (b) are {x y , xyz, xz, y z , xyz} where xyz and xyz are not prime implicants. The set of filters defined in this section for carry is as follows: = 3, = (0, 2, 1), = (0,2,1), = (0,2,1), and = 1(0,2,1), (0,2,1), (0 ,2,1)1. □ 4.5 E x p erim en ta l R esu lts The Boolean m atching algorithm and the various filters have been tested on the MCNC and ISCAS benchmark circuits. For each circuit we constructed two OBDDs. | Primes(carry) | Pc{carry, x) Pc(carry,y) Pc(carry, z) Pcount (carry) 78 The second OBDD was generated by randomly perm uting and renaming the vari ables of the first. Table 4.2 shows the characteristics of each circuit, the number of nodes in each OBDD and the execution times (in CPU seconds on a Sparc Station II with 64 MB of memory) for the Boolean matching algorithm w ith and without the use of various filters. The following legend describes the d ata in each column. 1. A : Boolean matching with no filters used. 2. B : F™ computed and checked during Boolean matching. 3. C : F£ep, F™*, F ^ \ a n d F used in the given order as long as more than two outputs have the same filter value. These filters are computed and checked prior to Boolean matching. 4. D : F out filters are used as in C (before matching) and then Fon is used as in B (during matching). in,out A B C D sao2 .T 0 7 I.. 1X39’ 0.85 0.73 0.40 rd73 7 ,3 1.85 O.lO 0.07 0.12 rd84 8 ,4 6.27 0.22 0.02 0.08 misexl 8, 7 13.13 12.52 0.03 o:o9 misex2 .2'Sr;'18 — — "3:68 ' ...r : 8 7 " .. misex3 14, 14 — — 13.25 6.08 apexl .45; 45.. — - — — 165.80 apex2 39, 3 — ..221.42“ — 62.47 duke2 22, 29 — — 3.50 2.54 c432 36, 7 — 1279.72 29.55 34.10 Table 4.2: Experimental results of Boolean matching. 79 The results displayed in Table 4.2 are summarized below. • Comparing columns A and B , we find that in those cases where the Boolean matching was completed in a reasonable amount of tim e, the application of F™* resulted in speed up ranging from 19 to 28 times. • Comparing columns A and C , we find a speed up ranging from 17 to 430 times. We also note th at for circuits misex2, misexS, duke2, and c432 the matching algorithm without any filters had to be aborted. However, use of the filters and resulted in successful completion within a very short period of time. • W hen F™ was applied in conjunction with the filters in {F ^*, F™*, Ffi^, Fd?*}> then the matching algorithm was successful in all cases. • For circuits with a small number of inputs, the filters in {F££, F™1, F ^ , F™*} seem to be more effective than F™. However, F™ is very effective for larger circuits. The above results are generated using arbitrary variable orderings for the initial OBDDs. Using any of the other ordering strategies th at have been reported [12], we expect further improvement in performance. Table 4.3 shows the results of some benchm arks represented in both EVBDD and SPBDD forms. Column ‘EVBDD’ depicts the size and tim e required for representing and constructing a circuit using EVBDDs while column ‘SPBDD’ depicts the size of SPBDDs and the tim e required for converting from EVBDDs to SPBDDs. In average, the ratio of the number of nodes required for representing SPBDDs over th at of EVBDDs is 6.8, and the ratio of the conversion tim e for SPBDDs over the construction tim e of EVBDDs is 41. The performance of a filter depends on its capability of pruning (effectiveness) and its computation tim e (cost). Experimental results of [23] show that this filter 80 is quite good because it rejected all unm atchable functions th at were encountered. However, according to results of Table 4.3, this filter is relatively expensive to compute when comparing with other filters [57]. Therefore, this filter should be used only after other filters have failed to prune the search space. In Out EVBDD SPBDD Size Time Size 'lim e 9symml 9 1 24 0.17 39 0.15 c8 28 18 142 0.09 1310 4.79 cc 21 20 76 0.02 951 1.59 cmb 16 4 35 0.04 88 0.17 comp 32 3 145 0.10 809 35.31 cordic 23 2 84 0.09 208 1.35 count 35 16 233 0.14 1197 8.39 cu 14 11 66 0.04 266 0.67 f51m 8 8 65 0.08 295 0.34 lal 26 19 99 0.07 1111 2.99 mux 21 1 86 0.11 144 0.99 parity 16 1 16 0.02 30 0.14 pcle 19 9 94 0.03 640 1.18 pcler8 27 17 139 0.05 1617 4.53 pm l 16 13 57 0.01 465 0.74 set 19 15 101 0.07 1295 2.42 ttt2 24 21 173 0.23 2046 5.35 unreg 36 16 134 0.04 816 5.78 x2 10 7 41 0.01 305 0.42 z4ml 7 4 36 0.09 83 0.13 b9 41 21 212 0.10 1809 12.08 alu2 10 6 248 0.69 889 2.69 alu4 14 8 1166 3.78 5913 66.12 term l 34 10 614 1.39 5643 104.35 apex7 49 37 665 0.35 3017 52.51 cht 47 36 133 0.08 452 5.19 example2 85 66 752 0.22 5163 23.14 Table 4.3: Experimental results of SPBDDs. In Table 4.4, columns ‘OBDD’, ‘CBDD’, and ‘PBDD’ depict the tim e required for constructing a circuit using OBDDs, CBDDs, and PBDDs, respectively. Column Prim es’ depicts the number of prime implicants of a circuit. Since the construction of the PBDD filters requires operations similar to those performed while construct ing we should apply these filters only after has failed to prune the search space. 81 OBDD CBDD PBDD # Primes 9symml 0.17 0.77 0.05 1680 c8 0.08 0.2 0.07 228 cc 0.02 0.08 0.04 52 cmb 0.04 0.11 0.01 26 comp 0.09 80.73 0.1 196606 cordic 0.06 9.3 0.06 1742 count 0.11 0.39 0.16 336 cu 0.02 0.07 0.05 29 f51m 0.06 0.18 0.09 94 lal 0.05 0.21 0.08 102 mux 0.08 0.84 0.16 81 parity 0.02 0.08 0.01 32768 pcle 0.03 0.08 0.08 81 pcler8 0.04 0.12 0.09 119 pm l 0.02 0.04 0.01 37 set 0.05 0.18 0.11 78 ttt2 0.19 0.51 0.12 160 unreg 0.04 0.12 0.1 112 x2 0.01 0.05 0.03 33 z4ml 0.06 0.15 0.03 59 b9 0.08 0.32 0.14 146 alu2 0.58 2.6 0.47 328 alu4 2.88 38.28 9.51 1980 term l 1.11 7.52 1.44 330 apex7 0.28 1.66 0.99 1027 cht 0.08 0.14 0.08 120 example2 0.19 0.41 0.28 461 Table 4.4: Experimental results of PBDDs. 82 C h a p ter 5 In teg er L inear P ro g ra m m in g Integer Linear Programming (iLP) is an NP-hard problem [42] that appears in many applications. Most of existing techniques for solving ILP such as branch- and-bound [64, 31, 76] and cutting-plane methods [43, 44] are based on the linear programming (lp) method. While they may sometimes solve hundreds of vari ables, they cannot guarantee to find an optimal solution for problems with more than , say, 50 variables. It is believed that an effective ILP solver should incor porate integer or combinatorial programming theory into the linear programming method [ 4 ] . Jeong et al. [59] describe an OBDD-based approach for solving the 0-1 pro gramming problems. This approach does not, however, use OBDDs for integer re lated operations such as conversion from linear inequality form of constraints into Boolean functions and optimization of nonbinary goal functions. Consequently, the caching of computation results is limited to only Boolean operations (i.e., for constraint conjunction). This chapter presents an approach for solving the ILP by combining benefits of the EVBDD data structure (in term s of subgraph sharing and caching of com putation results) with the state-of-the-art ILP solving techniques. The approach uses a minimization operator in EVBDD which computes the optim al solution to a given goal function subject to a constraint function. In addition, the construction 83 and conjunction of constraints in terms of EVBDDs are carried out in a divide and conquer manner in order to manage the space complexity. 5.1 B ack grou n d An ILP problem can be formulated as follows: n minimize c,xt, j=i n subject to ^ aijXi < bj, 1 < j < m, i= i Xi integer. The first equation is referred as the goal function and the second equation is re ferred as constraint functions. It is assumed that the problem to be solved is a minimization problem. A maximization problem can be converted to a minimiza tion problem by changing the sign of coefficients in the goal function. There are three classes of algorithms for solving ILP problems [93]. The first class is known as the branch-and-bound m ethod [64, 31, 76]. This m ethod usually starts with an optimum continuous LP solution which forms the first node of a search tree. If the initial solution satisfies the integer constraints, it is the optim um solution and the procedure is term inated. Otherwise, we split on variable x (with value x* from the initial solution) and create two new subproblems: one with the additional constraint x < [a;*J and the other with the additional constraint x > [a:*J + 1. Each subproblem is then solved using the LP methods, e.g., the simplex m ethod [32] or the interior point m ethod [60]. A subproblem is pruned if there are no feasible solutions, the feasible solution is inferior to the best one found, or all variables satisfy the integer constraints. In the last case, the feasible solution becomes the new best solution. The problem is solved when all subproblems are processed. Most commercial programs use this approach [65]. 84 The second class is known as the implicit enumeration technique which deals with 0-1 programming [2, 3, 91]. Initially, all variables are free. Then, a sequence of partial solutions is generated by successively fixing free variables, i.e., setting free variables to 0 or 1. A completion of a partial solution is a solution obtained by fixing all free variables in the partial solution. The algorithm ends when all partial solutions are completions or are discarded. The procedure proceeds similar to the branch-and-bound except that it solves a subproblem using the logical tests instead of the LP. A logical test is carried out by inserting values corresponding to a given (partial or complete) solution in the constraints. A complete solution is feasible if it satisfies all constraints. A partial solution is pruned if it cannot reach a feasible solution or could only produce an inferior feasible solution (compared to the current best solution). One advantage of this approach is that we can use partial order relations among variables to prune the solution space. For example, if it is established th at x < y, then portions of the solution space which correspond to x = 1 and y = 0 can be immediately pruned [11, 48]. In the early days, these two methods were considered to be sharply different. The branch-and-bound m ethod is based on solving a linear program at every node in the search space and uses a breadth first strategy. The implicit enumeration m ethod is based on logical tests requiring only additions and comparisons and employs a depth first strategy. However, successively versions of both approaches have borrowed substantially from each other [3]. The two term s branch and bound and implicit enumeration are now used interchangeably. The third class is known as the cutting-plane m ethod [43, 44]. Here, the in teger variable constraint is initially dropped and an optimum continuous variable solution is obtained. The solution is then used to chop off the solution space while ensuring that no feasible integer solutions are deleted. A new continuous solution 85 is computed in the reduced solution space and the process is repeated until the con tinuous solution indeed becomes an integer solution. Due to the machine round-off error, only the first few cuts are effective in reducing the solution space [93]. 5.2 A M o d e l A lg o rith m This section first shows a straightforward method to solve the ILP problem using EVBDDs. It then describes how to improve this m ethod in this and the following sections. E x a m p le 5.2.1 For the sake of readability, flattened EVBDDs (see Sec. 2.3.1) are used in this example. The following is a 0-1 ILP problem: minimize 3a: -f Ay, subject to 6a; -f Ay < 8, (1) 3x —2y < 1, (2) € {0, 1}- We first construct an EVBDD for the goal as shown in Fig. 5.1 (a). We then construct the constraints. The left hand side of constraint (1) represented by an EVBDD is shown in Fig. 5.1 (b). After the relational operator < has been applied on constraint (1), the resulting EVBDD is shown in Fig. 5.1 (c). Similarly, EVBDDs for constraint (2) are shown in Fig. 5.1 (d) and (e). The conjunction of two constraints, Fig. 5.1 (c) and (e), results in the EVBDD in Fig. 5.1 (f) which represents the solution space of this problem. A feasible solution corresponds to a path from the root to 1. We then project the constraint function c onto the goal function g such th at for a given input assignment X , if c(X) = 1 (feasible) then p(X) = g(X); otherwise p(X) = infeasiblejvalue. For minimization problems, the infeasiblejvalue is any value which is greater than the maximum of g, and for maximization problems, 86 1 1 1 0 3 4 0 7 0 10 6 4 (a) (b) (c) 0 1 1 1 1 0 1 0 0 3 -2 1 (d) (e) (0 0 8 4 8 (g ) Figure 5.1: A simple example (using flattened EVBDDs and OBDDs). the infeasiblejvalue is any value which is smaller than the m inimum of g. This example uses 8 as the infeasiblejvalue. Thus, in Fig. 5.1 (g), the two leftmost term inal values have been replaced by value 8. The last step in solving the above ILP problem is to find the minimum in Fig. 5.1 (g) which is 0. □ The above approach has three problems: 1. Converting a constraint from inequality form to a Boolean function may require exponential number of nodes; 2. Even if all constraints can be constructed without using excessive amounts of memory, conjoining them altogether at once may create too big an EVBDD; and 3. The operator projection is useful when we want to find all optim al solu tions. However, in many situations, we are interested in finding any optimal 87 solution. Thus, full construction of the final EVBDD (e.g., Fig. 5.1 (g)) is unnecessary. The remainder of this section will show how to overcome the first two problems by divide and conquer methods, and the next section will present an operator minimize which combines the benefits of computation sharing and branch-and- bound techniques to compute any optimal solution. Every constraint is converted to the form A X — b < 0. Thus, it only need one operator leqO (Sec. 2.3.3) to perform the conversion. A X < b is converted to A X — 6 + 1 < 0 (since all coefficients are integer); A X > b is converted to —A X + 6 < 0; and A X = 6 is converted to two constraints A X — b < 0 and —A X + 6 < 0. Initially, every constraint is an EVBDD representing the left hand side of an inequality (i.e., A X — b) which requires n nonterm inal nodes for an n-variable function. FGILP provides users with an n su p p param eter such that only if a constraint has less than n su p p supporting (dependent) variables, then it will be converted to a Boolean function. FGILP allows users to set another param eter c s iz e to control the size of EVBDDs. Only if constraints, in Boolean function form, are smaller in size than this param eter, they will be conjoined. Param eters n su p p and c s iz e provide two advantages. First, they provide FGILP with a space-time tradeoff capability. The more memory FGILP has, the faster it runs. Second, combined with the branch-and-bound technique, some subproblems may be pruned before the conversion to the Boolean functions or the conjunction of constraints are carried out. W hen there is only one constraint and it is in Boolean form, then the problem is solved through m inim ize. Otherwise, the problem is divided into two subprob lems and is solved recursively. Since both the goal and constraint functions are represented by EVBDDs. The new goal and constraint functions for the first sub problem are the left children of the root nodes of the current goal and constraints. 88 ilpsninimize(goal, const, lower Jbound, upper-bound, n su pp, c size ) { 1 if (max(goal) < lower-bound) return; 2 if (min(goal) > upper-bound) return; 3 if (3c € const such that m inim i ze(goal, c, upper .bound) = = 0) return; 4 new-const = conjunction-Const(const, csize); 5 if (new-const has only one element and is in Boolean form) { 6 (void) m inim i ze(goal, newsonst, upper-bound)', 7 } 8 else { 9 ((goali,new-consti), (goal-r,new-constr)) = divide-problem(goal, newjconst, nsupp)', 10 ilp-minimize(goali, newsonsti, lower-bound, upper-bound, nsupp, csize)', 11 ilpjminimize(goalr, new sonstT, lower -bound, upper-bound, n su pp, csize); 12 } } Figure 5.2: Pseudo code for ilp-minimize. Similarly, the new goal and constraint functions for the second subproblem are the right children of the root nodes of the current goal and constraints. The main algorithm, ilp-minimize, employs a branch-and-bound technique as shown in Fig. 5.2. In addition to goal and constraint functions, nsupp , and csize, there are two param eters which are used as bounding condition: Lower bound is either given by the user or computed through linear relaxation or Lagrangian relaxation methods; Upper bound represents the best feasible solution found so far. The initial value of the upper bound is the maximum of the goal function plus 1. If the maximum of goal function is less than the lower bound or the minimum of goal function is greater than or equal to the upper bound, the problem is pruned. Furthermore, if there exists a constraint whose minimum feasible solution is greater than or equal to the current best solution (upper bound), then again the problem is pruned. 89 ( a ) 0 > ) ( c ) z w _ z 1 0 1 a A A 1 o o ( d ) ( < = ) (0 Figure 5.3: An example for conjoining constraints. E x a m p le 5.2.2 We want to solve the following problem: minimize —Ax 4- 5y + z 4- 2w, subject to 3x + 2y — Az — w < 0, 2x + y + 3z — Aw < 0, x ,y,z,w € {0,1}. 1. The initial goal and constraint EVBDDs are shown in Fig. 5.3 (a). Suppose both param eters n su p p and c s iz e are set to 4. 2. Since the number of supporting variables in the constraint EVBDDs is not less than A, we divide the problem into two subproblems: one with x — 1 (Fig. 5.3 (b)) and the other with x — 0 (Fig. 5.3 (c)). The final solution is the minimum of solutions to these two subproblems. 90 3. Next, we want to solve the subproblem with x = 1. Since the number of supporting variables in constraint EVBDDs is smaller than n su p p , we convert the constraint EVBDDs into Boolean functions by carrying out operation leqO (Fig. 5.3 (d)). 4. Since the size of constraint EVBDDs are not less than c size , we divide the problem into two subproblems: one with y = 1 (Fig. 5.3 (e)) and the other with y = 0 (Fig. 5.3 (f)). 5. Now, we want to solve the subproblem with y = 1. Since the size of both constraint EVBDDs are less than c size , we conjoin them together and then solve this subproblem using the minimize operator (Sec. 5.3). 6. The remaining subproblems are solved in the same way. Note that the so lution found from a subproblem can be used as an upper bound for the subproblems which follow. □ 5.3 T h e O p erator minimize Operator minimize is similar to the apply operator with one additional param eter b. Given a goal function g, a constraint function c, and an upper bound b, minimize returns 1 if it finds a minimum feasible solution v < b of g subject to c; otherwise, minimize returns 0. If v is found, b is replaced by v, otherwise, b is unchanged. Note that when m inim ize returns 0, it does not imply that there are no feasible solutions with respect to g and c. This is because m inim ize only searches for feasible solutions that are smaller than b. Those feasible solutions which are greater than or equal to b are pruned because of the branch and bound procedure. The param eter b serves two purposes: it increases the hit ratio for computation caching and is a bounding condition for pruning the problem space. To achieve the first goal, an entry of the computed table used by minimize has the form 91 (g, c, (6, v)) where v is set to the minimum of g which satisfies c and is less than b. If there is no feasible solution (with respect to g and c) which is less than b, then v is set to b. The following pseudo code implements minimize. Lines 1-8 test for term inal conditions. In line 1, if the constraint function is the constant function 0, there is no feasible solution. In line 2, if the minimum of the goal function is greater than or equal to the current best solution, the whole process is pruned. If the goal function is a constant function, it must be less than bound; otherwise, the test in line 2 would have been true. Thus, a new minimum is found in line 3. In line 6, if the constraint function is constant 1, then the minimum of the goal function is the new optimum. Again, this must be true, otherwise, the condition tested in line 2 would have been true. Lines 9-17 perform the table lookup operation. If the lookup succeeds, no further computation is required; otherwise, we traverse down the graph in lines 19-26 in the same way as apply. Since minimize satisfies the additive property (Sec. 2.3.2), we subtract cg from bound to obtain a new local bound {local-bound) in line 9. cg will be added back to bound in lines 13 or 32 if a new solution is found. Suppose we want to compute the minimum of g subject to c w ith current local upper bound local-bound. We look up the computed table with key (g,c). If an entry (< 7,c, {entry .bound, entry .value)) is found, then there are the following possibilities: 1. entry .value < entry .bound, i.e., a smaller value v was previously found with respect to g, c, and entry.bound (i.e., the minimization of g with respect to c has been solved and the result is entry.value). (a) If entry.value < local-bound, then entry .value is the solution we wanted. (b) Otherwise, the best we can find under g and c is entry .value which is inferior to local-bound, so we return with no success. 92 2. entry .bound = entry.value, i.e., there was no feasible solution with respect to g, c, and entry.bound (i.e., there is no stored result for the minimization of g with respect to c and entry .bound). (a) If local-bound < entry.bound, then we cannot possibly find a solution better than entry .bound for g under c. Therefore, we return with no success. (b) Otherwise, no conclusion can be drawn and further computation is re quired. Although there is no better feasible solution than entry.bound, it does not imply that there will be no better solution than local-bound. In cases l.b and 2.a pruning takes place (also computation caching), in case l.a, com putation caching is a success, while in case 2.b both operations fail. Note that there is no need for updating an entry (of the computed table) except in case 2.b. In lines 25-30, the branch whose minimum value is smaller is traversed first since this increases chances for pruning the other branch. Finally, we update computed table and return the computed results in lines 31-39. 93 minimize{(cg, g ) , (cC ) c ), bound) { 1 if ({cc, c) = = (0 , 0 )) return 0 ; 2 if (ram((ca,g )) > bound) return 0 ; 3 if ((c„g) = = (^ ,0)) { 4 bound = cg\ 5 return 1; } 6 if « C c , c ) = = ( 1 , 0 )) { 7 bound — min((cg,g)); 8 return 1 ; } 9 local-bound = bound — c3; 1 0 if (comp-tabteJookup((0 ,g), (cCic), entry)) { 1 1 if [entry.value < entry.bound) { 1 2 if {entry.value < local-bound) { 13 bound = entry, value + c .g\ 14 return 1; } 15 else return 0; } 16 else { 17 if (local-bound < entry .bound) return 0 ; } } 18 entry.bound = local-bound; 19 (cgi, gi) = (value(g),childi(g)); 2 0 (c 3r,gr) = (0 ,childr(g)); 2 1 if (index(variable(c)) < index(variable(g ))) { 2 2 (cC (, ci) = (cc + ua/ue(c), childi(c)); 23 (cC r ,c r) — (cc, child? (c )), } 24 else { <cC (,Ci) = (cC r ,c r) = (cc,c); } 94 25 if (m m (gi) < m in(gr )) { 26 tjret = m inim i ze((cgi, gi), {cC (, ci), local-bound); 27 e-ret = minimize((cgr, gr ), (cCr, cr ), local-bound); } 28 else { 29 e_ret = m inimize((cgr, gr ), (cCr, cr ), local-bound); 30 f_re£ = minimize({cgi, gi), (cC { , cj), local-bound); } 31 if (tjret || ejret) { 32 bound = local-bound + c5; 33 entry.value = local-bound; 34 comp-tableJ,nsert((Q, g), (cc, c), entry); 35 return 1; } 36 else { 37 entry.value = entry .bound; 38 comp-tableJnsert({0, g), (cc, c), entry); 39 return 0; } } E x a m p le 5.3.1 We want to minimize the goal function — ^ 4 a ; + 5y + z + 2tu subject to the constraint (xzw V xy zw W xy zV x yzw = 1) shown in Fig. 5.4. For the sake of readability, the goal function is represented in EVBDD while the constraint function is represented in OBDD. The initial upper bound is max(goal) + l = 04-5+1+2+1 = 9. The reason for plus 1 is to recognize the case when there are no feasible solutions. (a) We traverse down to nodes a and b through path x — 1 and y = 1. By subtracting the coefficients of x and y from upper bound, we have 9 — (— 4) — 5 = 8 which is the local upper bound with respect to nodes a and b. T hat is, we look for a minimum of a subject to b such that it is smaller than 8. It is easy to see that the best feasible solution of a subject to b is 1 which corresponds the assignments of z — 1 and w = 0. Thus, we insert 95 1 1 0 0 (a) (b ) Figure 5.4: An example for the m inim ize operator. (a, b, (8,1}) as an entry into the computed table and recalculate the upper bound as — 4 + 5 + 1 + 0 = 2. (b) We traverse down to nodes a and b this time through path x = 1 and y = 0. The new local upper bound is 2 — (— 4) — 0 = 6 , i.e., we look for a feasible solution which is smaller than 6. From computed table look up, we find that 1 is the best solution with respect to a and b and it is smaller than 6. Thus, the new upper bound is — 4 + 0 + 1 = — 3. (c) We reach a and b through path x = 0 and y = 1. The local upper bound is — 3 — 0 — 5 = — 8. Again, from the computed table, we know 1 is the best solution which is larger than — 8. Thus, no better solution can be found under a and b with respect to bound — 8 and the current best solution remains — 3. (d) We reach nodes a and c through path x = 0 and y = 0. The local upper bound is — 3 — 0 — 0 = — 3. The minimum of the goal function a is 0 which is greater than — 3. The optimal solution is — 3 with ar = l,y = 0, 2 = 1, and w = 0. □ 96 i 5.4 D iscu ssio n A branch-and-bound/im plicit enumeration based ILP solver can be characterized by the way it handles search strategies, branching rules, bounding procedures and logical tests. The following discuss these parameters in turn to analyze and explore possible improvements to the algorithm, called FGILP, in the previous section. Search Strategy Search strategy refers to the selection of next node (subproblem) to process. There are two extreme search strategies. The first one is known as breadth first which always chooses nodes with best lower bound first. This approach tends to generate fewer nodes. The second one is depth first which chooses a best successor of the current node, if available, otherwise backtracks to the predecessor of the current node and continues the search. This strategy requires less storage space. FGILP uses the depth first strategy. Branching Rule This param eter refers to the selection of next variable to branch. Various selection criteria which have been proposed use priorities [75], penalties [37, 95], pseudo cost [7], and integer infeasibility [3] conditions. Currently, FGILP uses the same variable ordering as the one used to create EVBDDs because it simplifies the imple m entation. W hen the variable selected does not correspond to the variable ordering of EVBDD, operation cofactor (instead of childi and childr) should be used. Bounding Procedure The most im portant component of a branch-and-bound m ethod is the bounding procedure. The better the bound, the more pruning of the search space. The most frequently used bounding procedure is to use the linear programming method. Other procedures which can generate better bounds, but are more difficult to im plement include the cutting planes, Lagrangian relaxation [41, 90], and disjunctive 97 programming [4]. The bounding procedure used in FGILP is similar to the one pro posed in [2]. The most pruning takes place at line 3 of the code for ilpjminimize. This pruning rule however has two weak points. First, it is carried out on each constraint one at a time. Thus, it is only a ‘local’ method. Second, it can only be applied to a constraint which is in the Boolean form. The other bounding pro cedures described above are ‘global’ methods which are directly applicable to the inequality form. Logical Tests It is believed that logical tests may be as im portant as the bounding procedure [80]. In addition to partial ordering of variables, a particularly useful class of tests, when available, are those based on dominance [56, 59]. Currently, FGILP employs no log ical tests. It is believed that the inclusion of logical tests in FGILP will improve its performance. Despite the fact that there are many improvements which can be m ade to FGILP, the performance of FGILP, as it is now, is already comparable to th at of LINDO [ 8 8 ] which is one of the most widely used commercial tools [80] for solving ILP problems. 5.5 E x p erim en ta l R e su lts FGILP has been implemented in C under the SIS environment. Table 5.1 shows experimental results on ILP problems from MIPLIB [74]. It also shows the results of LINDO [ 8 8 ] (a commercial tool) on the same set of benchmarks. FGILP was run under SPARC station 2 (28.5 MIPS) with 64 MB memory while LINDO was run under SPARC station 10 (101.6 MIPS) with 384 MB memory. In Table 5.1, column ‘Problem ’ lists the name of problems, columns ‘Inputs’ and ‘Constraints’ indicate the number of input variables and constraints, and columns ‘FGILP’ and ‘LINDO’ 98 are the running tim e in seconds for obtaining the optimal solution shown in the last column. FGILP provides three options for the order in which constraints are conjoined together. W hen all constraints are conjoined together, the order of conjunction will not affect the size of final EVBDD, but it does affect sizes of the intermediate EVBDDs. It is possible th at an interm ediate EVBDD has size much larger than the the final one. The motivation for this ordering is to control the required memory space and save computation time. These three options are: 1. Based on the order of constraints in the input file. This provides users with direct control of the order. 2. EVBDDs with smallest size are conjoined first. 3. Constraints with the highest probability of not being satisfied are conjoined first. The param eters used for the problems in Table 5.1 are summarized below: 1 . Constraint conjunction order. Using the third option in problem ‘p0201’ led to much less space and computation tim e than the other two options. The same option led to more tim e in other problems due to the overhead of computing the probability of function values being 0. For consistency, results are reported for this option only. 2. EVBDD size of constraints. W ithout setting c size , ‘bm23’ failed to finish and ‘stein27’ required 71.56 seconds. The run time reported in Table 1 for the above two problems were obtained by setting c s iz e — 8000 while others were run under no lim itation of c size . In general, this param eter has a significant impact on the run tim e and the correct value for c s iz e is dependent on the size of available memory for the machine. 99 3. Size of supporting variables. There was no lim itation on the size of nsupp. As results indicate, the performance of FGILP is comparable to that of LINDO. Since ILP is an NP-complete problem, it is quite normal that one solver outperforms the other solver in some problems while performs poorly in others. FGILP, however, requires much more space than LINDO. As technology im proves, memory is expected to become cheaper in cost and smaller in size. In creasing the available memory size will improve the speed of FGILP while will not benefit LINDO as much. Problem Inputs Constraints FGILP (sec) LINDO (sec) Optim al bm23 “ 27" 2 0 1509.07 Error 34 lseu 89 28 Unable 186.44 1 1 2 0 p0033 33 16 2.91 4.31 3089 p0040 40 23 0.98 0.37 62027 p 0 2 0 1 2 0 1 133 765.48 529.46 7615 steinl5 15 36 1.44 1 . 6 6 9 stein27 27 118 51.24 120.03 18 stein9 9 13 0.13 0.31 5 Table 5.1: Experimental results of ILP problems. 100 C h a p ter 6 F u n ctio n D ec o m p o sitio n The m otivation for using function decomposition in logic synthesis is to reduce the complexity of the problem by a divide-and-conquer paradigm: A function is decomposed into a set of smaller functions such that each of them is easier to synthesize. The function decomposition theory was studied by Ashenhurst [1], Curtis [27], and Roth and Karp [82]. In Ashenhurst-Curtis method, functions are represented by Karnaugh maps and the decomposability of functions are determined from the num ber of distinct columns in the map. In Roth-Karp method, functions are represented by cubes and the decomposability of functions are determined from the cardinality of compatible classes. Recently, researchers [8 , 20, 29, 83] have used OBDDs to determine decomposability of functions. However, most of these works only consider single-output Boolean functions. D e fin itio n 6 .0 . 1 A function f ( x o , . . . , x n_x) is said to be decomposable under bound set {x0, . . . , x,_x} and free set {x,_s, . . . , xn_x} , 0 < * < n , 0 < s i f / can be transformed to f'{go{x0, . . ., Xj_x), ..., g j-i(xQ j ..., x,_x), x,_s, ..., xn_x), where 0 < j < i — s. If s equals 0 then it is disjunctively decomposable; otherwise, it is nondisjunctively decomposable. If j equals 1 then it is simply decomposable. Function f is referred as the F-function and each gi is referred as a G-function. 101 6.1 D isju n c tiv e D ec o m p o sitio n D efin itio n 6 .1 .1 Given an OBDD v representing / ( * o ,..., *n_i) with variable ordering x 0, . . . , *n_i and bound set B = {*o,. . . , * i-i}, we define c u tset(v, B ) = {u | u = eval(v,p), 0 < p < 2 ® } . In the above definition, each element in c u tset(y, B) corresponds to a distinct column in the Ashenhurst-Curtis decomposition charts [1, 27]. Furthermore, [log2 | cut s e t (v, B ) |] determines the minimum number of G-functions required for a decomposition of / under B. E x a m p le 6.1.1 Let / = * 0 * i* 2*3 + *o*i*2 * 3 *4 + *o*i*2 * 4 + *o*i*2 *4 + *o*i*2 * 3 + *o*i* 2 * 4 + *0 * 1 * 2 * 3 + *0 * 1* 2 * 3 + *0 * 1 * 2 *3 * 4 + *o*i*2 *3 , the OBDD repre sentation and the decomposition chart of /(*o, *1 , * 2 > *3 ? * 4 ) with respect to the bound set {*0, * 1 , * 2 } and the free set {* 3, * 4 } are shown in Fig. 6.1 (a) and (b) re spectively. In the OBDD representation, c u tset( f, {*0 , * 1 , * 2 }) = { a jb ,c } . Nodes a, b , and c correspond to distinct columns 1100, 1010, and 1011 respectively. Since there are three distinct columns / is not simply decomposable under the bound set {*0 , * 1 , * 2 } and the free set {*3 5 * 4 }. □ When bound variables are on the top of OBDDs, the computation of cutjsets is straightforward. The following procedure assumes that bound variables B are already on the top of OBDDs. The tim e complexity of computing cut-sets depends on the size of OBDDs. c u tset(v, B ) { if (m de*(v) > index(last(B))) return({ v }); else return( cutset(childi('v), B) U cutset(childr(v), B ) ); } 102 0 1 I 1 X, X, 2 2 2 XS 1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 1 01 0 0 0 0 01 a (a) (b ) Figure 6.1: A function represented in (a) OBDD and (b) decomposition chart. To move a bound variable x to the top of an OBDD, we carry out new-obdd(x, fx, fx) where fx and fx are the cofactor of / with respect to x and x respectively. In the worst case, both fx and fx have about the same size as that of f. Thus, moving a variable to the top may double the size of an OBDD. To move bound variables to the top is therefore practical only for small size of bound sets. An algorithm for computing the cutjset without moving the bound variables to the top will be presented in Sec. 6.3. It is clear that the computation of cut_sets of all 2n bound sets is very expensive. However, in practical applications, we need compute the cut_sets of C£ bound sets where k is a small number such as 4 or 5. The time complexity of computing the cut_sets of n choose k bound sets is then 0 (n km ) and the space complexity is 0(2km ) where m is the size of an OBDD. The following algorithm shows how to perform the disjunctive decomposition • • • > >£n— l ) — f (flr o ( ‘Eo* • • • > ■£»—l ) ? • • • j 9 j —1 (a :o , • • • 5 ® i —1 ) J •£*J • • • J ® n —1 ) directly on an OBDD. 103 A lg o rith m decompose (pseudo code decompose): Given a function / represented in an OBDD Vf and a bound set B, a disjunctive decomposition with respect to B is carried out in the following steps: 1. Compute the cut-set with respect to B. Let cu<_sef(v, B ) = {uo, • •., uic.j}. 2. Encode each node in the cut_set by [log2 A f| = j bits (Fig. 6.2 (a)). Let the encoding of u q be q. 3. Construct V f< to represent function / ': Replace the top part of Vf by a new set of variables g0, . . . , gj-i such that eva/(vf<, q) = u q for 0 < q < k — 1 , eval(vp, q) — Uk_i for k — 1 < q < 2 J (Fig. 6.2 (b) and pseudo code decomp-f). 4. Construct v gp’s to represent gp’s, 0 < p < j: Replace each node u with encoding b0, . . . , bj_x in the cut_set by term inal node bp (Fig. 6.2 (c) and pseudo code decomp-g). For example, in Fig. 6.2 (c) Ui is replaced by terminal node 1 in the construction of v g. and by J • term inal node 0 in the construction of other v gp’s. The idea behind Algorithm decompose is the following: For any input pattern m in the bound set, the evaluation of m in function / will result at a node in the cut_set with encoding e. The evaluation of m on these gp functions will produce the function values e. Then, the evaluation of e in function / ' will also end at the same node in the cut-set. Thus, the composition of / ' and gp’s is equivalent to / . If k < 2J, then not every jr-bit pattern is used for the encoding of the cut_set. Function gp s can never generate those function values which correspond to the patterns not used for encoding, thus we can assign arbitrary node to these pattern in function / '. In step 4, we assign them to the last node in the cut-set (u k -i)- Alternatively, we can assign don’t-cares instead. 104 A ? i -1 6 k -l U 1 U 0 ( a ) (b) i -1 « k -l « ! U 0 i-1 U U u o k -l (c) Figure 6.2: Disjunctive decomposition. In step 2 of Algorithm decompose, we use an arbitrary encoding which is not unique. Different encodings will result in different decompositions. Different en coding strategies can be used for different applications. For example, in the map ping of G-functions to fc-input LUT FPGAs where a fc-input LUT can implement any Boolean function of up to k variables, any encoding strategy would be the same if the bound-set size is k. decompose(vj, cutset) /* cutset = { u q , . { Vf/ = decomp-f (cutset, {yj- 1, ..., j/o}); for (p = 0 ;p < j;p + + ) v gp = decomp.giy j , cutset, p); return V// and v 3p’s; } 105 decomp-f (cutset, ids) cutset: an array of OBDD nodes with 2J _ 1 < length(cutset) < 2J return: an OBDD V// with variables y0, . . . , . . . , xn^\ { p trJd = 0 ; while (length(cutset) > 1 ) { /* do until cutset becomes a root node * / id = ids\ptrJ,d + +]; p = 0 ; /* pointer to cutset */ p tr = 0 ; /* pointer to new set */ while (p < length(cutset)) { if (p —= length(cutsei) — 1 ) { /* the last element of cutset */ newset\ptr + + ] = cutset[p\', /* just move it to newset */ p + + ; /* p is increased by 1 */ } else { /* create a new node with new variable ym */ newset[ptr + + ] = newJbdd(id, cutset[p + 1 ], cutset\p]); p-j- = 2 ; /* p is increased by 2 */ } } for (q = 0 ; q < ptr\q + + ) /* move nodes from newset to cutset */ cutset[q] = newset[q]; } return(cutsef[0]); /* cuisei[0] contains Vj> */ } 106 decomp-g{y, cutset, p) v: an OBDD cutset: an array of OBDD nodes with 2J _ 1 < length(cutset) < p: an integer between 0 and j — 1 return: v gp { for (q = 0 ; q < length(cutset); q + + ) { v q = cutset[q]; if (bit(p, 9 ) = = 0 ) /* pth bit from right of q */ v = replace-node(v, v q, 0 ); /* replace v q in v by 0 */ else v = replace-node(v, v q, 1 ); /* replace v q in v by 1 */ } return v; /* as v gp */ } E x a m p le 6.1.2 As an example of how decompose works, consider the OBDDs shown in Fig. 6.3. Since X 4-node in f has encoding 01, it has been replaced by terminal nodes 0 and 1 in go and g i respectively. The evaluation of x 0 — 1 , x\ = 0, and # 2 = 1 in f ends at ^4 -node in the cutjset. The evaluation of the same pattern 1 0 1 in g o and g i produce function values 0 and 1 for new variables go and g\. Then, the evaluation of 01 in f also ends at the same a ;4-node. Because there is no encoding 11 in the cut_set, variables go and g\ can never be 11. We can assign arbitrary value for this pattern. In this example, we assign the left x3-node so that the left #i-node can be reduced in f'. □ L e m m a 6.1.1 Given an OBDD Vf with variable ordering x0 < ... < £n- i rep resenting f{ x o , . . . , x n_i), a bound set B = {a?o,... the c u tse t(v f, B ) = {1 1 0 , . . . , U k _ i} , and algorithm decompose returning OBDDs Vf/, v g(), . . . , vgj _ l 5 107 0 0 1 0 L o i 00 10, o 1 Figure 6.3: An example of disjunctive decomposition. then f (X0 , • • • r 3'n— l ) — f (9 o(xo, • • • ) % i— 1 ), • • • , Qj—1 (•^ ' 0 ? • * • » •£ » — 1 ) j X ! % 1 • • • » 3'n— 1 ) where / ' , g0, . . . , gj-% are the functions denoted by Vf», vgQ,..., v g^ 1, respectively. Proof: Consider the behavior of an input pattern (bo, ..., & ,•_ i) on Vf, V f< and Vgp’s. Suppose u q with encoding q is the node we reach in Vf using the input pattern, that is, eval(vf, (b0, ..., 6 ,_i)) = u q, where u q = f(b0, ..., 6*_i, ..., Since u q has been replaced by the pth bit of q in v gp, eua/(vgp, (bo, ..., 6,-_i)) = bqp, that is, gp(bo, ..., bi-1 ) = bqp. Because of the way we construct Vf», eua/(vf», (bqo, ..., f e 9i_x)) — uq, that is, f (bqQ , . . . , b q , Xj, . . . , Xji— l ) Uq / (^0 j • • • ? ^i-l) ■ j *£n —1 )* Thus, _ / " (go(bo, ..., ..., ^t— 1)> • • •? ®n— 1) = f(bo, ..., ..., a ;n_ i), for any input pattern in the bound set. □ 6.2 N o n d isju n c tiv e D e c o m p o sitio n Before describing how to perform nondisjunctive decomposition based on the OBDD representation, the concept of c u tset is extended in the following definition. 108 D efin itio n 6 .2 . 1 Let R = {xo, • • • S = {xs, x;_i}, and T = {x», xn_x}, 0 < s < i < n. Given an OBDD v representing f ( x 0, . . . , Xn-i), a bound set R U S, and a free set S U T , we define c u tse t jnd(v, R, S, p) = {eval(w,p) | w £ c u ts e t (v, f?)}, where 0 < p < 2 ^ . W ith the above definition, c u ts e t(v , B ) can be represented by c u tset jnd(v, B , < j> , 0). The following presents a pseudo code for computing cu tsetjn d and an example of it. c u tse t jnd(v, R, S ,p ) /* 0 < p < 2 ^ * / { if (m dex(v) < index(head(S))) Teturn(cutset-nd(childi(v), R , S ,p ) U cutset-nd(childr(-v), R, S , p )); else if (index(head(S)) < index(v) < index {last (S'))) { q _ 2in d ex(la st(S ))—in d e x (v ). if (q < p) /* then traverse down through left edge */ return (cu tset jnd{childi{v), R ,S ,p — q)); else Te%\xxn(cutset-nd(childr(y), R, S ,p )); } else return({v}); } E x a m p le 6.2.1 The OBDD in Figure 6.1 (a) has cutsetjnd(f, {xo,xi}, {x2 } ,0 ) = {a, b}, c u tsetjn d (f, {xo,Xi}^ {x2} ,l) = {b ,c }, cutset.nd(f, {x0}, {xj, x 2}, 0 ) = {a}, cutset.nd{f, {xo}, {xi, x 2}, 1 ) = {b, c}, cutset.nd({, {xo}, {xi, x2}, 2 ) = {a, b}, and cu tset.n d(f, {xo}, {xi, x2}, 3) = {b, c}. □ 109 A lg o rith m decompjnd (pseudo code decompjnd): Given a function / represented in an OBDD Vf, a bound set {xo, • • • ? x si • • • ? and a free set {xs, . . . , Xi_ l 5 . . . , xn_ i), a nondisjunctive decomposition with respect to the given bound set and free set is carried out in the following steps: 1. Compute cutsetjnd(vf, R, S,r) for 0 < r < 2 ^ where R = {xo,. . . , xs_i} and S = {xs, . . . , Xj_i} (Fig. 6.4 (a)). Let c u tse t jnd(vf, R , S, r) = {urio, • • * ) u r> i}, m ax{| c u tse t jnd(vf, R , S, r) |} = k, and j = [log2 A :]. 2. Construct Vf/ to represent function f in two steps (Fig. 6.4 (b) and pseudo code decomp-f .nd): (a) Construct v q, 0 < q < k, such that eua/(vq, r) = u q)f where u qiI is the qth element in c u tset jnd(vf , R, S\ r) or the last element if q > | cutset-nd(vf, R, S,r) |. (b) Construct Vf/ such th at eval(vfr,q) = v q for 0 < q < k — 1 and eval(vf>,q) = Vk-i for k — 1 < q < 2 L 3. Construct v gp’s to represent s for 0 < p < j (Fig. 6.4 (c) and pseudo code decomp-g~nd): Replace each node uq>r (qth node of c u ts e t_nd(vf, R, S, r)) from Vf by the term inal node whose value is bq p where bq p is the pth bit from the least sig nificant bit of integer q. Note th at, a node u may be the tth element of c u tset jnd(vf, R, S, ri) and the j tiL element of c u tsetjn d (v f, R, 5, r 2 ) which requires different encodings for u. This will not cause a problem because we can first duplicate the node u and then assign each copy a different encoding. An alternative statem ent is that if paths p\ and p 2 both end at node u and require different encodings b\ and 6 2> then we let pi end at term inal node bi and p2 end at term inal node b 2. 110 /V o (c) Figure 6.4: Nondisjunctive decomposition. decompjnd{vf, {xo, • • •, {xs, . . . ,x,_i}) { for (r = 0 ; r < 2 * '_*;r + + ) cutsetndr = cut-3etjnd(vf, {xo, • • - ? } > {x a, . . . , r) k = m ax{| cutsetndr |}; j = [log2 k] ; V f< = decomp.f jnd({cutsetnd!s}, { x ,_ i,. . . , xs}, {yj- 1 ,.. •, yo}); for (p = 0 ;p < j',p + +) vgp = decomp-gjnd(vf, {cutsetndfs},p); return Vjv and Vgp ’s; } 111 decomp-.f jnd(cutsetnds, idx, idy) cutsetnds :{cutsetndr | 0 < r < 2,- s } with max{\ cutsetndr |} = i f c ; and [log2 A f| = j; cutsetndg> r :qth element of cutsetndT, or the last element of cutsetndr if q > | cutsetndr |; %dx « {xt— ij ■ • • j , idy : { y j- i, ..., y0}; return: an OBDD Vfi with variables yo, ..., y j- 1, x8, ..., , x n_i; { for (q = 0; q < fc ; q + + ) v q = decomp-f({cutsetndqtr | 0 < r < 2*~s},idx)] V f< = decomp-f({vq | 0 < q < fc},edy); return V/<; } decomp-g~nd(vf, cutsetnds, p) return: v gp; { for (r = 0 ; r < 2 ‘-1 ; r + + ) { if (eua/(vf, r) = = cutsetndqtP) let er;a/(vgp ,r) = bit(q,p); } return v 3p; } E x a m p le 6.2.2 One possible nondisjunctive decomposition of the OBDD in Fig. 6.1 (a) with respect to the bound set {xo, x\, x2} and the free set {x2 ,X3 , x4} is shown in Fig. 6.5. In this decomposition, we use the following coding: {a = 112 1 0 10 0 1 0 1 c 1.1 0,0 1.0 o 1 Figure 6.5: An example of nondisjunctive decomposition. uo.o,b = u 0 ,i} = cu tset jnd(vf, {xo, Xi}, {^ 2 }? 0 ) and {c = 1 1 1,1 , b = Ui,o} = c u tse t jnd(vf, {xo, Xi}, {* 2 }) 1 )- n L em m a 6 .2 .1 Given an OBDD Vf with variable ordering x0, ..., representing / ( x 0, • • •, Xn-\), and k = max{ | c u tse t aid (v f, {x 0, ..., x s_ i}, {xs, ..., x,-_x}, r) | 0 < r < 2t-s }, 2J - 1 < k < 2 \ the algorithm decomp-nd returns j + 1 OBDDs Vf/,vg0, ..., Vgj^j such that /(x0, . . = f(g o (x 0, - • •, -.., g j-i(x0, .. x ,_ i), x s_ i, ..., x,-_ 1 , ..., x n-\) where f ,go, • • • ,gj-i are the functions denoted by v f'> v g0’ • • • » v gj_i’ respectively. Proof: Consider the behavior of an input pattern (b0,..., bs, ..., 6,_i) on Vf, V f< and Vgp’s. Let eua/(vf, {b0,..., bs, ..., 6,_i)) = uq>r, where r = 2% ~s~1 bs + . . . -f 2°6j_i. Since u q > r has been replaced by b qp in v gp, we have eua/(vgp, (bo, ..., bs, ..., &i-i)) = bqp. Then from eval(vf>, (bqo, ... ,bqj_,)) = v q and eua/(vq,r ) = u q > r = ewa/(vq, (6 S, ..., fej_x)), we have eval(vfi, (bqo,..., bqj_l t bs, ..., = uq,r = et>a/(vf , (b0, ... ,bs, . . . , 6;_i}). □ 113 6.3 C ut_set In P la c e This section considers only disjunctive decomposition. It first presents an algo rithm for computing an encoded decomposition chart from the tru th table of a function. It then shows a similar algorithm which computes cut_sets without mov ing bound variables to the top of OBDDs. D efin itio n 6.3.1 Given a function / with n variables and a bound set B with size i < n, the encoded decomposition chart of / with respect to B is a vector c with length 2 * where each distinct element of c corresponds to a distinct column of the decomposition chart of / . D e fin itio n 6.3.2 Operator encode is defined as follows: encode((v0 > 0 , . . . , Uo^-i)? ■ ■ ■ , (um-i,o, • • •, vm_1 > 2<_i) = (vm,o, • • • ,vmiv -i) where vm > Q = 0 , and vm iP = q if {vQ < p , . . . , um_ilP ) is the qth distinct m -tuple of (uot0, i,o), ,2*-l • > • • • i^m -l,2 *-l)- E x a m p le 6.3.1 The decomposition chart shown in Fig. 6 . 6 (a) has Xi and xj as the free set. We show how to convert the decomposition chart into an encoded decomposition chart one variable at a time. W ith respect to variable a:,-, we encode the first two rows and the last two rows in Fig. 6 . 6 (a) by: encode(( 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 ), (1 , 1 , 1 , 0 , 1 , 0 , 1 , 0 )) and encode((0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 ), (0 , 0 , 1 , 0 , 1 , 0 , 1 , 1 )), respectively. The result is shown in Fig. 6 . 6 (b). W ith respect to variable xj, we carry out encode((0,0 ,0 ,1 ,0 ,2 ,0 ,1 ), (0 ,0 ,1 ,2 ,3 ,0 ,1 ,3 )) and derive the encoded decomposi tion chart as shown in Fig. 6 . 6 (c). □ D efin itio n 6.3.3 An encoded decomposition vector (edv) is a vector ([eo.o, • • •, eo,2>-iL • • •» [e2*-i,0j • • • > e2*-i,2J|- i ] ) where j > 0, i > 0, ek,i is an integer. Each element of an edv, [e^o,. . . , is called an encoded decomposition column (edc). 114 X I X i (a) (c) Figure 6 .6 : An example of coded decomposition chart. Pseudo code gen^edc constructs the encoded decomposition chart of a given function and bound set as described before. Initially, we have an edv containing only one edc which is the tru th table representation of the given function (line 1 ). Each variable, from x0 to x„_i (line 2), is processed in the following way: If x p is in the bound set, we use include to double the number of edc’s by breaking each edc into two edc’s such th at each new edc corresponds to either xp — 0 or xp — 1 (line 3); otherwise, we use exclude to cut the size of each edc and to perform the encode operation in the same way as in Ex. 6.3.1 (line 4). After all variables have been processed, the number of edc’s will be 2 * where i is the size of the bound set (due to the calling of include i times), and each edc contains only one element (due to the calling of include and exclude n times in total). We then flatten the edv to get the encoded decomposition chart. 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 0 0 0 110 0 10 0 0 10 10 11 ] X. 0001 0 0 12 0 2 01 3 0 13 (b ) 0 0 1 2 3 4 15 115 gen-edc(f, B) f : a Boolean function with n variables represented by the truth table form as [m0, ..., m 2n_ 1] where mo, m i , , m2»-1 - 1 are the minterms correspond to xq = 0 and m0, m2, ..., m2n_2 are the minterms correspond to xn- i = 0; B : a bound set; { 1 ed u = ( [ m o , . . . , m 2n_i]); 2 for (p = = 0; p + + ; p < n) { 3 if (a:,, € B) edv = include(edv); 4 else edv = exc/ude(edt>); 5 } 6 return(//a<ten(edu)); } melude(([eo,o, • • •, eo,2*_i], • • •, [e 2’- i ,05 • • •»e2»— x,2-»— i])) { return({[e0,o, • • •, e0l2j-i-i], [eo^*-^ • • •, e0)2>_i],..., [e2‘-l,0j • • • 5 e2*-l,2>— 1 — 1 ]> [e2 * — 1 ,2 -» — 15 • • • > e2'-l,2>-l])); } exclude(([e0)o , .. •, e 0> 2> _ i], .. •, [e2<_it0, • • •, e2i— i,2>_i])) { (d0)o, • • •, d0> 2i - i _ i , dli0, . . . , d 1) 2j - i _ i , .. •, d 2i_lj0, . . . , d 2i_ ij2J- i _ i ) = encode((eo,o, • • •, e0)2>-i_i, ei,o,. . . , • • •, e2i_1)0, • • •, e 2i_li2j-i_i), (eo,2i - i , .. •, e0 )2J-i, eii2>-i,..., e1> 2i_l5..., e2i_1)2>-i,..., e2i_ii2J_i)); return(([do,o, • • •, doi2> -i_ i], [d i,o ,. . . , d i i2j - i _ i ] , . . . , [d2; _ i (o, ■ • •, d 2i_i, 2>— 1— i]))? } 116 flatten(([e0],.. -, [e2i-i])) { return((e0, . . . , e2i_i)); } E x a m p le 6.3.2 The application of gerue.dc to the function in Ex. 6.1.1 with bound set {^o? x 2, £4 } is summarized below: 1. Initially, we have {[1100 1011 1100 1010 1100 1010 1010 1011]). 2. Since xq is in the bound set, we execute bound-V and have {[1100 1011 1100 1010], [1100 1010 1010 1011]). 3. After applying freejv on x\, we have Vo : 1100 1011 1100 1010 Vi : 1100 1010 1010 1011 = ► {[0011 0102], [0231 0103]). C : 0011 0102 0231 0103 4. After processing x 2, we have {[0011], [0102], [0231], [0103]). 5. The computation of freejv on x% is: V o : 00 01 02 01 V x : 11 02 31 03 {[00], [12], [34], [15]). C : 00 12 34 15 6. After the processing of x4 and fla tte n , we have the encoded decomposi tion chart {0,0,1,2,3,4,1,5) which implies that there are 6 different distinct columns in the decomposition chart as shown in Fig. 6.7. 117 X 0 1 .........1 1 1 x 2 X 2 1 1 1 I X 4 x 4 X 4 X 4 1110 1110 x , 1110 10 10 0 0110 0 10 X 1 0 010 10 11 0 0 1 2 3 4 15 Figure 6.7: The decomposition chart with respect bound set {a:0, x% , x4}. The following pseudo code c u tset Jp is the OBDD version of gen-edc. c u tse t spinode-vector, B , p) { 1 if (p > index(last{B))) return {node-vector)] 2 if (xp € B ) Teturn(includeu>bdd(node-vector, B,p)); 3 else TetnTn(excludesbdd(node-vector, B,p))] } includejobdd((vq, ... { Teturn(cutsetJp({r-ckild(vQ,p), l.child(vo,p),... ,r-child{v2\_x,p), l-child(y2i_l t p)), B ,p + 1)); } 118 e h i o X X 2 I c d f h f 9 1 1 1 1 * 4 a X 4 1 0 0 1 0 1 1 0 0 1 0 0 * 5 b XA 1 1 1 0 1 1 0 0 X 4 0 1 1 1 X 1 0 0 0 1 1 a 9 h A s d e ( a ) 0>) Figure 6.8: An example for cut-set in place. excludejobdd((vo, ..., v 2i_ 1 ),5,p) { TetuTn(encode(cutset Jp((r-child(vo,p),..., rjchild{v2\_x,p)), B ,p + 1), cutset-ip((l-child(vo,p) ,..., ljchild{v^\ } E x a m p le 6.3.3 The execution of cutset-ip on the OBDD shown in Fig. 6.8 (a) with bound set B = {a^, 2 2 } is summarized below: initial: cutset Jp((v), B , 0), p = 0: encode(cutsetJp({a), B , 1), cutset Jp((b), B , 1)), p = 1 : encode(cutsetJp((c, d), B , 2), cutset-ip({d, e), B , 2)), p = 2: encode(cutsetJp((f, h, f, g), B , 3), cutset Jp((f, g, g, h), B , 3)), p = 3: encode(({, h, f , g), ( f, g, g, h ) ), result: <0,1,2,3). The decomposition chart is shown in Fig. 6.8 (b). □ 119 6.4 C o m p u tin g C u t_sets for A ll P o ssib le B o u n d S ets The previous sections showed how to perform function decomposition directly on OBDDs when a bound set is given. This section will show how to compute the c u ts e ts for all bound sets of (single-output) Boolean functions using EVBDDs. The m ethod is based on the encoding of columns as integers. Initially, every variable is in the free set. For each variable xt, we perform the following two operations: 1. include: include X{ in the bound set to derive a new cut-set, and 2. exclude: partially encode the columns such that distinct columns are given unique codes and variable X{ is perm anently excluded from the bound set. E xam ple 6.4.1 Fig. 6.9 (a) shows a decomposition chart where variable x is in the free set and a,b, c, d, e, / , and g are Boolean values. To perform the include operation, we move the two bottom rows to the left of the top two rows such that x now is in the bound set (Fig. 6.9 (b)). To perform the exclude operation, we encode bit vectors (c,a), (d, b), (g,e ), and (A ,/) as 2c -j- a, 2d + 6, 2g + e, and 2h + / , respectively (Fig. 6.9 (c)). The coded decomposition chart preserves the distinctness of columns, that is, column (a, 6, c, d) is distinct from column (e, / , g, h) if and only if column (2c + a ,2d + b) is distinct from column (2g + e,2h + f). Furthermore, variable x is absent from the encoded decomposition chart and will never be included in the bound set. □ Given an EVBDD v with the top variable Xi, the right and left children of v correspond to the top and bottom halves of rows in the decomposition chart. Thus, operations include and exclude in the EVBDD representation are carried out in the following way: 120 X [ b f y c g a c 2c+a 2g+e c g d h b f y 2d+b 2h+f d h y 2d+b 2c+a 2h+f 2g+e (a) (b) (c) Figure 6.9: Operations include and exclude in the decomposition chart. 7 ; u C y )(7 ) (7)(F ^ d c b a h 9 f e h gf e d c b a (a) <b) (c) Figure 6.10: Operations include and exclude in the EVBDD representation. 1. include: construct the set {childt(v),childr(v)}, and 2. exclude: construct an EVBDD representing 22’ x childi{v) 4- childT{y) where 22’ is to ensure that the resulting EVBDD has a unique encoded representation. E x a m p le 6.4.2 Fig. 6.10 (a) is the EVBDD representation of the decomposition chart in Fig. 6.9 (a). The corresponding operations include and exclude are shown in Fig. 6.10 (b) and (c), respectively. □ Pseudo code c u ts e t jail computes the cardinality of the cut_set for every pos sible bound set of a given function. The routine returns the set {{b, k) | b is a bound set and k is the cardinality of the cut_set of & }. Initially, we have * = 0 and n o d e set = {v } where v is the EVBDD representing the given function. This corresponds to the bound set B = < j > and free set X where X is the set of input variables. If i = n, then we reach the term inal case and n o d e set is the (encoded) cut_set for bound set B (line 1); otherwise, we perform include and exclude opera tions with respect to variable X{ (lines 2 and 3). We repeat the process for variable 121 xt+1 in lines 4 and 5. In line 6, the union of (6, fc)’s from lines 4 and 5 is returned. Pseudo code include and exclude perform the include and exclude operations for a set of EVBDD nodes. c u ts e t s ll(n o d e s e t, B , i) { 1 if (i = = n) return({{.B, | n o d eset |)}); 2 in c s e t = include{nodeset, i)] 3 e x c se t = exclude(nodeset,«); 4 inc = c u tse t-a ll(in c se t, B U {xj}, i + 1); 5 exc = cu tsetu a ll(excset, B ,i + 1)', 6 return(m c U exc)] } include{nodeset, i) { 1 new s e t = < f> ] 2 for each node u G n o d e set { 3 if (index(variable{u)) = = i) 4 n e w s e t = n e w s e t U {childi(u), childr(u)}] 5 else /* index(u) > i * / 6 n e w s e t — n e w s e t U {u}; 7 } 8 return new set] } 122 exclude(nodeset, i) { 1 n e w s e t = 4 > \ 2 for each node u £ n o d eset { 3 if (index(variable(u)) = = i) 4 n e w s e t = n e w s e t U {22’ x childi(\i) + childr(u)}] 5 else /* mdea:(u) > i * / 6 n e w s e t = n e w s e t U {22' x u + u}; 7 } 8 return n e w s e t; } E x a m p le 6.4.3 Fig. 6.11 (a) shows a function represented by both a tru th table and a flattened EVBDD. Initially, the bound set is empty. The application of include and exclude with respect to variable xq are shown in Fig. 6.11 (b) and (c), respectively. In Fig. 6.11 (b), the bound set is {a:o} and the cardinality of the cut_set is 2; In Fig. 6.11 (c), the bound set is < j > with cut_set size 1. The application of include and exclude on Fig. 6.11 (b) with respect to variable Xi results in Fig. 6.12 (a) and (b) with bound sets {a:0, and {so} and cut_set sizes 2 and 2, respectively. The application of include and exclude on Fig. 6.11 (c) with respect to variable x\ results in Fig. 6.12 (c) and (d) with bound sets {^i} and < f ) and cut_set sizes 2 and 1, respectively. The application of include and exclude on Fig. 6.12 (b) with respect to variable x 2 results in Fig. 6.13 (a) and (b) with bound sets {aro,aj2} and {#0 } and encoded cut-sets {0,1, 5,4} and {5,12}, respectively. In Fig. 6.13, the top row shows the encoded decomposition charts, the second row shows the encoded cut_sets, and the third row shows the decomposition charts. The encodings used for the bottom row in Fig. 6.13 (a) and (b) are 1 x rowl + 4 x row2 and 1 x row 1 + 2 x row2 + 4 x row3 + 8 x row4, respectively. □ 123 { - [ ( 1 0 0 1 1 1 0 0 e b 0 10 1 0 11 0 (b) 2 1 3 0 0 3 12 (C) Figure 6.11: An example of the application of c u tset-a ll. X X X 0 0 0 1 l 1 0 5 4 0 0 0 1 X p 0 1 e f 9 h 3 2 0 1 * i * © © h 0 5 1 4 (b) Figure 6.12: Example continued. x 2) k 14 1 (d ) 124 0 o 0 1 5 4 5 1 2 I ; I X, {0 ,1,5, 4 } (5 , 12} 0 1 1 0 0 0 1 1 I i (a) '•[ 1 0 0 1 1 1 0 0 (b ) Figure 6.13: Example continued. Since there are 2n different bound sets for an n variable function, the compu tation of the c u ts e t for every bound set is very expensive. If we replace line 1 in cut s e t sill by 1 if (level == n || | v a r s e t |< k) return({(I?, | n o d e set |)}), then c u tse t-a ll becomes a routine for computing the cardinality of the cut_set for every bound set whose size is less than or equal to k which is useful for the technology mapping of £-input look-up table field programmable gate arrays [58]. A naive way to compute the c u ts e t for every bound set is to move bound vari ables to the top of the EVBDD. Compared to this approach, the above approach has the following advantages. First, it is well known that the size of OBDD (and EVBDD) is very sensitive to the variable ordering (at least in many practical appli cations [66]). Moving bound variables to the top will change the variable ordering and hence may cause storage problems. The EVBDD-based method will not change the variable ordering. Second, the number of variables in the direct variable ex change approach is never reduced. In contrast, in EVBDD-based method, after the include and exclude operations, the number of variables will be decreased by 1. 125 6.5 M u ltip le-O u tp u t D ec o m p o sitio n Given a vector of Boolean functions / 0, . . . , f m - 1 on n variables, we can not extend the concept of c u ts e t by taking the set union of the c u ts e ts for the individual functions. To see this, consider the two extreme cases U S )1 c u tset(v{, 0) (bound set size 1) and U S 1 c u ts e t(v i,n — 1) (bound set size n ). The cardinality of the former might be greater than 2. This implies that more than two distinct functions must be implemented by a single variable which is not possible. On the other hand, the c u ts e t of the latter is always {0, 1}. This implies that m Boolean functions could be implemented by only one output line which is again not possible. This is because even when an OBDD node is shared by ith and j th functions, it should be treated differently. While a problem with finite domain can be solved by conversion to Boolean functions, a problem related to multiple-output Boolean functions can also be solved by interpreting them as the bit representation of an integer function. For example, a multiple-output Boolean function ( /o ,. . . , / m- i) can be transformed to an integer function F by F = 2Tn-1/o + . . . + 2 ° /m_i. Based on this formulation, we show how to perform multiple-output decomposition using EVBDDs. We first extend the definitions of function decomposition and cut_sets to EVBDD represen tation. We then develop an EVBDD-based disjunctive decomposition algorithm. D e fin itio n 6.5.1 A pseudo Boolean function f ( x o,..., z n- i) is said to be decom posable under bound set {a:0, . . . , a \-i} and free set {x{,... £n-i} , 0 < i < n, if / can be transformed to f > (go{xo,..., x,_i),... ,g j(xo,..., £»,..., x n- i ) such that the number of inputs to f is smaller than that of / . If j equals 1, then it is simply decomposable. Note that since inputs to a pseudo Boolean function are Boolean variables, function g ^s are Boolean functions. Here, we consider only disjunctive decompo sition (the intersection of bound set and free set is empty). 126 d(x. a [x. b (x 5 6 4 56 34 126 Figure 6.14: An example of cut_set in EVBDD. D efin itio n 6.5.2 Given an EVBDD (c, v) representing f ( x 0, ... ,x n- i) with vari able ordering x 0 < . . . < x n- \ and bound set B = {x0, ..., £,•}, we define cutset-jev((c, v), B ) = {(c', v') | {c',v'} = ei>a/({c, v), j) , 0 < j < 21}. For readability, the flattened form of EVBDDs is used in this section. E x a m p le 6.5.1 Given a function / as shown in Fig. 6.14 with bound set B — {x Q ,x 1,X 2 }, cut~set(f, B ) = {a, b,c,d}. □ A lg o rith m decomp-ev: Given a function / represented in an EVBDD Vf and a bound set B , a disjunctive decomposition with respect to B is carried out in the following steps: 1. Compute the cut_set_ev with respect to B . Let cu£_se£_eu(v, B ) — {uo, ..., U k - l } - 2. Encode each node in the cut_set_ev by [log2 k] = j bits. 3. Construct v m’s to represent gm's, 0 < m < j: Replace each node u with encoding bQ , . . . , 6j_i in the cut_set_ev by term inal node b m . 127 4. Construct Vf/ to represent function /': Replace the top part of Vf by a new top on variables go,.. . , gj-i such that eval(vf>, I) = ui for 0 < / < k — 1, eval(vf», I) = Uk_i for k — 1 < / < 2J. The correctness of this algorithm can be intuitively argued as follows: For any input pattern m in the bound set, the evaluation of m in function / will result at a node in the cut_set_ev with encoding e. The evaluation of m on the gi functions should thus produce the function values e. The evaluation of e in function / ' should also end at the same node in the cut_set_ev. Thus, the composition of / ' and g{s becomes equivalent to / . L em m a 6.5.1 Given an EVBDD Vf with variable ordering x0 < ... < £ n- i repre senting f ( x o ,. . . , Xn-i), a bound set B = {£o,. . . , £ ,-i} and cu tset _eu(vf, B) = { u o ,. . . , Uk_i}, if decompsv returns EVBDDs Vf/, v gQ, . . . , v g j _ 1 , then f (* T 0 ? • • • j -T n — 1) — f (go(xO i • • • j xi-l )? • • • i gj— \ (^0) • • • i * r » — 1) j X{ j • • • » Xn— 1) where / ' , gQ ,..., gj-\ are the functions denoted by Vf/, v gQ,..., , respectively. Proof: Consider the behavior of an input pattern (bo, ..., &i_i) on Vf, Vf/ and v gm’s. Suppose u m is the node we reach in Vf using the input pattern, that is, eval(v f , { & o , • • •, &«-i)) = um , where u m = f(b 0, ..., £,-,..., Since u m has been replaced by the 1 th bit of m in v gl, eval(vSi, (b0, . .. = bmi, that is, gi(b0, ..., = bmr Because of the way we construct Vf/, eval(vf>, (bmo, ..., = um, that is, f (bmo, ..., bm^ _ £,',..., £n_i) = u — f(^o, ..., b{— x,X{, ..., x n— i). Thus, f (go(bo, ..., ..., gj— i(5o, • ■ • > b % — 1 ), x% , ..., 2:^-1 ) f(bo, ..., 6,_i, Xi, ..., xn_i), for any input pattern in the bound set. □ E x a m p le 6.5.2 Fig. 6.15 shows an example of disjunctive decomposition by using EVBDDs. The evaluation of the input pattern xq = 1, x\ = 0, and £ 2 = 1 in function F will end at the leftmost £ 4-node which has encoding 10. The evaluation of the same input pattern in functions go and g\ would produce function values 1 and 128 3. 1 0 0 0 1 0 1 1 5 6 4 56 34 1 2 6 Figure 6.15: An example of disjunctive decomposition in EVBDD. 0. Then, with go being 1 and g\ being 0 in function F ', it would also end at the leftmost X 4-node. □ W hen an EVBDD is used to represent a Boolean function, decomp-ev corre sponds to a disjunctive decomposition algorithm for Boolean functions; when an EVBDD represents an integer function, then decomp..ev can be used as a disjunc tive decomposition algorithm for m ultiple-output Boolean functions as shown in the following example. E x a m p le 6.5.3 A 3-output Boolean function as shown in Fig 6.16 (a) can be converted into an integer function as shown in Fig. 6.16 (b) through / = 4 /0 -f 2 /i + / 2 . The application of decomp-ev on F is the one shown in the previous example. After applying the synthesis paradigm described in Sect. 3.1 on F ', we can convert / back to a 3-output Boolean function /q, and f 2. □ 6.6 In c o m p le te ly S p ecified F u n ctio n s W hen functions are incompletely specified, the detection of decomposability be comes very complicated. For example, the compatibility in the Roth-Karp m ethod is no longer an equivalence relation. The determination of k compatible classes 129 0 b(X 5 6 4 56 34 1 2 6 1 1 0 0 (a) < b> Figure 6.16: Representation of m ultiple-output functions. then requires solving the minimum clique covering problem for the compatibility graph which is NP-hard [42]. A similar task has to be performed on OBDDs. We first extend OBDDs to include a third term inal node dc to represent the constant function dc. Next, we compute the c u ts e t as before. Since each node in c u ts e t may represent an incompletely specified function, we need to compute the compatibility between any two nodes in the c u ts e t so that a minimal k can be found. The determ ination of compati bility between two OBDD nodes, or the compatibility between their corresponding functions, can be carried out by algorithm is.compatible. After this step, the con struction of compatibility graph and the computation of minimum clique cover is the same as in the Roth-Karp algorithm. 130 isjcom patible(f, g) j* f and g are OBDDs with dc */ { 1 if (f = = dc || g = = dc || f = = g) return 1; 2 if (f = = 0 & & g = = l || f = = 1 & feg = = 0 ) return 0; 3 gi = l-child(g, m in (in d ex(f), m dex(g))); 4 gr = r-child( g, m in(index( f), index( g))); 5 fi = Lchild({, m in(index(f),index(g))); 6 fr = r-child({, m in (in d ex(f), index(g))); 7 } 8 else { fj = fr = f; } 9 return(?s_compah‘6/e(fi, gi) M z is-compatible(fr, gr)); } 6 .7 E x p erim en ta l R e su lts The algorithm cut^setuall has been implemented and compared with the Roth- Karp decomposition algorithm implemented in SIS. In particular, the following command is used on a number of mcnc91 benchmark sets: “xl-k-decomp1 -n 4 -e -d -f 100” which for every node in the Boolean network, finds the best bound set of size < 4 that reduces the node’s variable sup port after decomposition, and then decomposes the node, and modifies the network to reflect the change. An equivalent EVBDD-based command was implemented. 1xlJzjdecom p does not process circuits with > 32 inputs. 131 To assign a unique encoding for each EVBDD node, we need integers with 2 * bits where i is the number of variables considered so far. This is clearly very expensive. One way to overcome this difficulty is to relax the uniqueness condition (e.g, use 2 instead of 22’). Then, two different EVBDD nodes representing different functions may be assigned the same encoding. As a result, the size of the cut_set for a given bound set may be underestimated. This scheme may be used as a filter. For example, to find the bound set which has the smallest cut_set, we first perform cut^setjall to find the best ones, and then check for the real cut-sets by moving the bound variables to the top of the EVBDD. Results shown in Table 6.1 used 2 as the weight in exclude operation. The processes were stopped when they took more than 5000 cpu seconds on a Sun Sparc-Station II with 64 MB of memory. The EVBDD-based approach obtains significant speed-ups (by an average factor of 35.4). 132 Circuit karp EVBDD Speed-up 5xpl 31.1 2.9 ... 10.7 9sym 513.6 3.7 13878 ... apex4 2544.8.. 49.8 51.1 misex3 > 5000 ...381.9" 13.1 misex3c > 5000 131.8 37.9 Z5xpl 31.4 4.3 7.3 misex‘ 2 416.8 - g7:7 4.8 sao2 337.9 23.6 14.3 xor5 2.0 '""'0.3""... 6.7 bl2 74.3 6.4 11.6 exlUlU > 5000' 48.5 > 103.1 squar5 473 0.9 4.8 Z9sym 508.2 4.2 121.0 t48l . > 5000 ... 62.1..... ....> 8075.... alu4 > 5000 124.5 >40.2 table3 > 5000 318.6 > 15.7 table5 > 5000 1225.8 > 4.1 cordic > 5000 1331.7 > 3.8 vg2 > 5000 "2051.3“ > 2.4 seq NA > 5000 — apexl NA > 5000 — apex2 NA > 5000 — apex3 NA > 5O00 — e64 N'A > 5000 — Average 35.4 Table 6.1: Finding all decomposable forms with bound set size < 4. 133 C h ap ter 7 C on clu sion s It was demonstrated that by associating an integer with each edge of an OBDD and giving a new meaning to each node of the OBDD, a new graphical data structure was created whose domain is that of the integer functions. The new data structure, called EVBDD, admits arithm etic operations, preserves the canonical property, and provides the capability to cache computational results. W ith these properties, we have found EVBDDs to be valuable in many applications. Because of the compactness and canonical properties, EVBDDs were shown to be effective for handling verification problems. An extension of EVBDDs, denoted by SEVBDDs, were successfully used to model conditional statem ents and array data structure. A future extension is to model loop statem ents and recursive functions which can then be used for verifying sequential machines. Because of the additive property, EVBDDs are also useful for solving integer linear programming problems. A possible improvement is to incorporate linear programming techniques (e.g., simplex m ethod) in order to obtain better bounds and hence improve the runtim e of the procedure. An OBDD-based Boolean matching algorithm using a level-first search strategy was presented. Unlike depth-first and breadth-first strategies, a level-first strategy permits significant pruning of the search space. In addition, a set of filters which further improve the the performance of the matching algorithm was presented 134 Future research directions include the matching of arithm etic functions and finite state machines. Again, the key issue is to identify properties which can work as filters for pruning the search spaces. Because OBDDs are a compact and canonical representation of Boolean func tions, the function decomposition algorithms presented here are more efficient than the cube-based function decomposition implementation. However, the OBDD-based extraction of common sublogic to minimize the literal cost of the circuits remains an open problem to be studied in future. 135 R eferen ce L ist [1] R. L. Ashenhurst, “The Decomposition of Switching Functions,” Ann. Com putation Lab., Harvard University, vol. 29, pp. 74-116, 1959. [2] E. Balas, “An Additive Algorithm for Solving Linear Programs with Zero-One Variables,” Operations Research, 13 (4), pp. 517-546, 1965. [3] E. Balas, “Bivalent Programming by Implicit Enum eration,” Encyclopedia o f Computer Science and Technology Vol.2, J. Belzer, A.G. Holzman and Kent, eds., M. Dekker, New York, pp. 479-494, 1975. [4] E. Balas, “Disjunctive Programming,” Annals o f Discrete Mathematics 5, North-Holland, pp. 3-51, 1979. [5] J. C. Barros and B. W. Johnson, “Equivalence of the Arbiter, the Synchro nizer, the Latch and the Inertial Delay,” IE E E Trans, on Computers, C-32(7), July 1983. [6] H. G. Barrow, “VERIFY: A Program for Proving Correctness of Digital Hard ware Designs,” Artificial Intelligence, 24:437-491, 1984. [7] M. Benichou, J. M. Gauthier, P. Girodet, G. Hentges, G. Ribiere and O. Vincent, “Experiments in Mixed-Integer Linear Programming,” Math. Pro gramming 1, pp. 76-94, 1971. 136 [8] M. Beardslee, B. Lin, and A. Sangiovanni-Vincentelli, “Communication Based Logic Partitioning,” Proc. o f the European Design Automation C onf, pp. 32- 37, 1992. [9] G. V. Bochmann, “Hardware Specification with Temporal Logic: An Exam ple,” IE E E Trans, on Computers, 31(3):223-231, March 1982. [10] R. T. Boute, “Representational and Denotational Semantics of Digital Sys tem s,” IEEE Trans, on Computers, 38(7):986-999, July 1989. [11] V. J. Bowman, Jr. and J. H. Starr, “Partial Orderings in Implicit Enumera tion,” Annals of Discrete Mathematics, 1, North-Holland, pp. 99-116, 1977. [12] K. S. Brace, R. L. Rudell, and R. E. Bryant, “Efficient Implementation of a BDD Package,” Proc. o f the 27th Design Automation Conference, pp. 40-45, 1990. [13] R. Brayton and C. McMullen, “The Decomposition and Factorization of Boolean Expressions,” Proc. Int. Sym. Circ. Syst. (ISCAS-82), pp. 49-54, May 1982. [14] R. Brayton, G. Hachtel, C. McMullen, and A. Sangiovanni-Vincentelli, Logic Minimization ALgorithms for VLSI Synthesis, Boston: Kluwer Academic Publishers, 1984. [15] R. Brayton, R. Rudell, A. Sangiovanni-Vincentelli, and A. Wang, “MIS: Multiple-Level Interactive Logic Optimization System,” IE E E Trans. Corn- put. Aided Design, vol. CAD-6, no. 6, pp. 1062-1081, Nov. 1987. [16] R. E. Bryant, “Graph-based Algorithms for Boolean Function M anipulation,” IEEE Transactions on Computers, C-35(8): 677-691, August 1986. [17] R. E. Bryant, “Symbolic Boolean M anipulation with Ordered Binary-Decision Diagrams,” Computing Surveys, Vol. 24, No. 3, pp. 293-318, Sept. 1992. 137 [18] J. R. Burch and D. E. Long, “Efficient Boolean Function Matching,” Int. Conf. Computer-Aided Design, pp. 408-411, 1992. [19] A. Camilleri, M. Gordon, and T. Melham, “Hardware Verification Using Higher-Order Logic,” Technical Report 91, Computer Laboratory, University of Cambridge, Cambridge CB2 3QG, U.K., Sept. 1986. [20] S-C. Chang and M. Marek-Sadowska, “Technology Mapping via Transforma tions of Function Graph,” Proc. International Conf. on Computer Design, pp. 159-162, 1992. [21] M. J. Ciesielski and S. Yang, “PLADE: A Two-Stage PLA Decomposition,” IEEE Trans, on Computer-Aided Design, Vol. 11, No. 8, pp. 943-954, Aug. 1992. [22] E. M. Clarke, M. Fujita, P. C. McGeer, K. L. McMillan, and J. C.-Y. Yang, “Multi-Terminal Binary Decision Diagrams: An Efficient D ata Structure for M atrix Representation,” International Workshop on Logic Synthesis, pp. 6a:l- 15, May 1993. [23] E. M. Clarke, K. L. McMillan, X. Zhao, M. Fujita, and J. C.-Y. Yang, “Spec tral Transforms for Large Boolean Functions with Applications to Technology Mapping,” Proc. o f the 30th Design Automation Conference, pp. 54-60, 1993. [24] A. Cohn, “A Proof of Correctness of the V IPER Microprocessor: the First Level,” Technical Report 104, Computer Laboratory, University of Cam bridge, Cambridge CB2 3QG, U.K., Jan. 1987. [25] O. Coudert, C. Berthet, J. C. Madre, “Verification of Synchronous Sequential Machines based on Symbolic Execution,” Proc. o f the Workshop on Automatic Verification Methods fo r Finite State Systems, Grenoble, France, June 1989. 138 [26] 0 . Coudert and J. C. Madre, “Implicit and Incremental Com putation of Primes and Essential Primes of Boolean Functions,” Proc. o f the 29th De sign Automation Conference, pp.36-39, 1992. [27] H. A. Curtis, “A New Approach to the Design of Switching Circuits,” Prince ton, N .J., Van Nostrand, 1962. [28] Y-T. Lai and S. Sastry, “Edge-Valued Binary Decision Diagrams for Multi- Level Hierarchical Verification,” Proc. o f 29th Design Automation Conf., pp. 608-613, 1992. [29] Y-T. Lai, M. Pedram and S. Sastry, “BDD Based Decomposition of Logic Functions with Application to FPGA Synthesis,” Proc. o f 30th Design Au tomation Conf, pp. 642-647, 1993. [30] W.-M. Dai, M. Sato, and E. S. Kuh, “A Dynamic and Efficient Representation of Building-Block Layout,” Proc. 24th Design Automation Conf., pp. 376-384, 1987. [31] R. J. Dakin, “A Tree-Search Algorithm for Mixed Integer Programming Prob lems,” Comput. J. 9, pp. 250-255, 1965. [32] G. B. Dantzig, Linear Programming and Extensions, Princeton, N. J.: Prince ton University Press, 1963. [33] J. A. Darringer, “The Application of Program Verification Techniques to Hardware Verification,” Proc. o f 16th Design Automation Conference, pp. 375-381, June 1979. [34] G. De Micheli, “Symbolic Design of Combinational and Sequential Logic Cir cuits Implemented by Two-Level Macros,” IE E E Trans, on Computer-Aided Designs, Vol. 5, No. 9, pp. 597-616, Sept. 1986. 139 [35] G. De Micheli, D. Ku, F. Mailhot, and T. Truong, “The Olympus Synthesis System,” IE E E Design and Test of Computer, 7(5), pp. 37-53, 1990. [36] S. Devadas, H.-K. Ma, and A. R. Newton, “MUSTANG: State Assignment of Finite State Machines Targeting Multilevel Logic Im plementations,” IEEE Trans, on Computer-Aided Design, Vol. 7, No. 12, pp. 1290-1300, Dec. 1988. [37] N. J. Driebeck, “An Algorithm of the Solution of Mixed Integer Programming Problems,” Management Science 12, pp. 576-587, 1966. [38] C. R. Edwards, “The Application of the Rademacher-Walsh Transform to Boolean Function Classification and Threshold-Logic Synthesis,” IEEE Trans actions on Computers, C-24, pp. 48-62, 1975. [39] H. Eveking and S. Horeth, “Optimization and Resynthesis of Complex D ata paths,” Proc. o f 30th Design Automation Conf, pp. 637-641, June 1993. [40] B. J. Falkowski, I. Schafer and M. A. Perkowski, “Effective Computer Meth ods for the Calculation of Rademacher-Walsh Spectrum for Completely and Incompletely Specified Boolean Functions,” IE E E Transaction on Computer- Aided Design, Vol. 11, No. 10, pp. 1207-1226, Oct. 1992. [41] M. L. Fisher, “The Lagrangian Relaxation M ethod for Solving Integer Pro gramming Problems,” Management Science, pp. 1-18, 1981. [42] M. R. Garey and D. S. Johnson, “Computers and Intractability: A Guide to the Theory of NP-Completeness,” Freeman, San Francisco, 1979. [43] R. E. Gomory, “Outline of an Algorithm for Integer Solutions to Linear Pro gram ,” Bulletin o f the American Mathematical Society 64, pp. 275-278, 1958. [44] R. E. Gomory, “Solving Linear Programming Problems in Integers,” in Com binatorial Analysis, R.E. Bellman and M. Hall, Jr., eds., American M athe m atical Society, pp. 211-216, 1960. [45] p. Gutberlet, H. Kramer, and W. Rosenstiel, “CASCH - a Scheduling Al gorithm for High Level Synthesis,” Proc. of European Design Automation Conference, pp. 311-315, Feb. 1991. [46] G. D. Hachtel and F. Somenzi, “A Symbolic Algorithm for Maximum Flow in 0-1 Networks,” International Workshop on Logic Synthesis, pp. 6b:l-6, May 1993. [47] P. L. Hammer and S. Rudeanu, Boolean Methods in Operations Research and Related Areas, Heidelberg, Springer Verlag, 1968. [48] P. L. Hammer and B. Simeone, “Order Relations of Variables in 0-1 Pro gramming,” Annals o f Discrete Mathematics, 31, North-Holland, pp. 83-112, 1987. [49] F. K. Hanna and N. Daeche, “Specification and Verification Using Higher- Order Logic,” in C. J. Koomen and T. Moto-Oka, eds, 7th In t’ l Symp. Com puter Hardware Description Languages and their Applications, pp.418-433, IFIP, North-Holland, Aug. 1985. [50] S. He and M. Torkelson, “Disjoint Decomposition with Partial Vertex C hart,” International Workshop on Logic Synthesis, pp. p2a:l-5, 1993. [51] Yung-Te Lai and Sarma Sastry, “HINTS: A Hardware Interpretation System,” International Workshop on Formal Methods in VLSI Design 1991. [52] W -J. Hsu and W-Z. Shen, “Coalgebraic Division for Multilevel Logic Synthe sis,” Proc. o f 29th Design Automation Conf., pp. 438-442, June 1992. [53] S. L. Hurst, D. M. Miller and J. C. Muzio, Spectral Techniques in Digital Logic, London, U.K. : Academic, 1985. 141 [54] T-T. Hwang, R. M. Owens, and M. J. Irwin, “Efficiently Computing Commu nication Complexity for Multilevel Logic Synthesis,” IE E E Trans, on CAD, Vol. 11, No. 5, pp. 545-554, May 1992. [55] C-T. Hwang and Y-C. Hsu, “Zone Scheduling,” IE E E Trans, on Computer- Aided Design, Vol. 12, No. 7, pp. 926-934, July 1993. [56] T. Ibaraki, “The Power of Dominance Relations in Branch and Bound Algo rithm ,” J. Assoc. Comput. Mach. 24, pp. 264-279, 1977. [57] Y-T. Lai, S. Sastry and M. Pedram, “Boolean Matching Using Binary Deci sion Diagrams with Applications to Logic Synthesis and Verification,” Proc. International Conf. on Computer Design, pp.452-458, 1992. [58] Y-T. Lai, K-R. Pan, M. Pedram, and S. Vrudhula, “FGMap: A Technol ogy Mapping Algorithm for Look-Up Table Type FPGAs based on Function Graphs”, International Workshop on Logic Synthesis, 1993. [59] S-W. Jeong and F. Somenzi, “A New Algorithm for 0-1 Programming based on Binary Decision Diagrams,” Logic Synthesis Workshop, in Japan, pp. 177- 184, 1992. [60] N. Karmarkar, “A New Polynomial-Time Algorithm for Linear Program ming,” Combinatorica, 4:373-395, 1984. [61] R. M. Karp, “Functional Decomposition and Switching Circuit Design,” J. Soc. Indust. Appl. Math., Vol. 11, No. 2, pp. 291-335, June, 1963. [62] B. W. Kernighan and S. Lin, “An Efficient Heuristic Procedure for Partition ing Graphs,” Bell System Technical Journal, 49(2), pp. 291-307, 1970. [63] B. W. Kernighan and D. M. Ritchie, The C Programming Language. Engle wood Cliffs, NJ: Prentice-Hall, 1978. 142 [64] A. H. Land and A. G. Doig, “An Automatic Method for Solving Discrete Programming Problems,” Econometrica 28, pp. 497-520, 1960. [65] A. Land and S. Powell, “Computer Codes for Problems of Integer Program ming,” Annals of Discrete Mathematics 5, North-Holland, pp. 221-269, 1979. [66] H-T. Liaw and C-S Lin, “On the OBDD-Representation of General Boolean Functions,” IEEE Trans, on Computers, C-41(6): 661-664, June 1992. [67] R. N. Mayo, M. H. Arnold, W. S. Scott, D. Stark, and G. T. Hamachi, “1990 DECW RL/Livermore Magic Release,” Western Research Laboratory, WRL Research Report 90/7, Sept. 1990. [68] F. Mailhot and G. De Micheli, “Technology Mapping Using Boolean Match ing,” Eruopean Design Automation Conf., pp. 180-185, 1990 [69] F. Mailhot and G. De Micheli, “Algorithms for Technology Mapping Based on Binary Decision Diagrams and on Boolean Operations,” IE E E Trans, on Computer-Aided Design, Vol. 12, No. 5, pp. 599-620, May 1993. [70] S. Malik, A. Wang, R. Brayton, and A. Sangiovanni-Vincentelli, “Logic Veri fication using Binary Decision Diagrams in a Logic Synthesis Environm ent,” Proc. Int. Conf. Computer-Aided Design, pp. 6-9, 1988. [71] M. C. McFarland and A. C. Parker, “An Abstract Model of Behavior for Hardware Descriptions,” IE EE Trans, on Computers, C-32(7):621-637, July 1983. [72] P. Michel, U. Lauther, and P. Duzy, The Synthesis Approach to Digital System Design, Kluwer Academic Publishers, 1992. [73] G. J. Milne, “CIRCAL and the Representation of Communication, Concur rency, and Tim e,” AC M Trans, on Programming Languages and Systems, 7(2):270-298, April 1985. 143 [74] Department of M athematical Sciences, Rice University, Houston, TX 77251. [75] G. M itra, “Investigation of Some Branch and Bound Strategies for the Solu tion of Mixed Integer Linear Programs,” Math. Programming 4, pp. 155-170, 1973. [76] L. G. M itten, “Branch-and-Bound Methods: General Formulation and Prop erties,” Operations Research, 18, pp. 24-34, 1970. [77] M. Mlinar, A. C. Parker, and J. T. Pizarro, “MAHA: A Program for Data Path Synthesis,” Proc. o f 23rd Design Automation Conference, pp. 235-240, June 1986. [78] J. Mohnke and S. Malik, “Perm utation and Phase Independent Boolean Com parison,” EDAC, pp. 86-92, 1993. [79] B. Moszkowski, “A Temporal Logic for Multilevel Reasoning about Hard ware,” IEEE Computer, pp. 10-19, Feb. 1985. [80] G. L. Nemhauser and L. A. Wolsey, Integer and Combinatorial Optimization, Wiley, New York, 1988. [81] P. G. Paulin, “High-Level Synthesis of Digital Circuits Using Global Schedul ing and Binding Algorithms,” Ph.D. thesis, Carleton University, 1988. [82] J. P. Roth and R. M. Karp, “Minimization over Boolean Graphs,” IB M Jour nal, pp. 227-238, April 1962. [83] T. Sasao, “FPGA Design by Generalized Functional Decomposition,” in Logic Synthesis and Optimization, Sasao ed., Kluwer Academic Publisher, pp. 233- 258, 1993. 144 [84] G. Saucier, C. Duff, and F. Poirot, “State Assigment of Controllers for Op tim al Area Implementation,” Proc. o f 1st European Design Automation Con ference, pp. 546-551, 1990. [85] H. Savoj and H. Y. Wang, “Improved Scripts in MIS-II for Logic Minimization of Combinational Circuits,” Proc. of Int. Workshop on Logic Synthesis, May 1991. [86] U. Schlichtmann, F. Brglez, and M. Hermann, “Characterization of Boolean Functions for Rapid Matching in EPGA Technology Mapping,” Proc. of 29th Design Automation Conf, pp. 374-379, 1992. [87] U. Schlichtmann, F. Brglez, and P. Schneider, “Efficient Boolean Matching Based on Unique Variable Ordering,” International Workshop on Logic Syn thesis, May 1993. [88] L. Schrage, Linear, Integer and Quadratic Programming with LINDO, Scien tific Press, 1986. [89] C. Sechen and A. Sangiovanni-Vincentelli, “The TimberWolf Placement and Routing Package,” IEEE Journal of Solid-State Circuits, SC-20(2):510-522, 1985. [90] J. F. Shapiro, “A Survey of Lagrangian Techniques for Discrete Optimization,” Annals o f Discrete Mathematics 5, North-Holland, pp. 113-138, 1979. [91] K. Spielberg, “Enumerative Methods in Integer Programming,” Annals of Discrete Mathematics 5, North-Holland, pp. 139-183, 1979. [92] A. Srinivasan, T. Kam, S. Malik and R. Brayton, “Algorithms for Discrete Function M anipulation,” Proc. Int. Conf. CAD, pp. 92-95, 1990. 145 [93] H. A. Taha, “Integer Programming,” in Mathematical Programming fo r Opera tions Researchers and Computer Scientists, ed. A.G. Holzman, Marcel Derrer, pp.41-69, 1981. [94] Texas Instrum ents, “The TTL Data Book for Design Engineers,” Texas In struments, 1984. [95] J. A. Tomlin, “Branch and Bound Methods for Integer and Non-convex Pro gramming,” in J. Abadie, ed., Integer and non-linear programming, North- Holland, Amsterdam, 1970. [96] D. Varma and E. A. Trachtenberg, “Design Autom ation Tools for Efficient Implementation of Logic Functions by Decomposition,” IE E E Transactions of Computer-Aided Design, Vol. 8, No. 8, Aug. 1989, pp. 901-916. [97] J. Vasudevamurthy and J. Rajski, “A Method for Concurrent Decomposition and Factorization of Boolean Expressions,” Proc. o f Int. Conf. on CAD, pp. 510-513, 1990. [98] T. Villa and A. Sangiovanni-Vincentelli, “NOVA: State Assignment of Finite State Machines for Optimal Two-Level Logic Implementation,” IEEE Trans, on Computer-Aided Designs, Vol. 9, No. 9, pp. 905-924, Sept. 1990. [99] J. S. Wallis, “Hadamard Matrices,” Lecture Notes No. 292, Springer-Verlag, New York, 1972. [100] T. Yoshimura and E. S. Kuh, “Efficient Algorithms for Channel Routing,” IE E E Trans, on Computer-Aided Designs, 1(1), pp. 25-35, 1982. 146
Linked assets
University of Southern California Dissertations and Theses
Conceptually similar
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
PDF
00001.tif
Asset Metadata
Core Title
00001.tif
Tag
OAI-PMH Harvest
Permanent Link (DOI)
https://doi.org/10.25549/usctheses-oUC11255803
Unique identifier
UC11255803
Legacy Identifier
DP22869