260 likes | 358 Views
Don´t Care Minimization of *BMDs: Complexity and Algorithms. Christoph Scholl Marc Herbstritt Bernd Becker Institute of Computer Science Albert-Ludwigs-University 79110 Freiburg im Breisgau, Germany. Overview. Motivation Decision Diagrams: BDDs, BMDs and *BMDs
E N D
Don´t Care Minimization of *BMDs:Complexity and Algorithms Christoph Scholl Marc Herbstritt Bernd Becker Institute of Computer Science Albert-Ludwigs-University 79110 Freiburg im Breisgau, Germany
Overview • Motivation • Decision Diagrams: BDDs, BMDs and *BMDs • More details on BMDs • Problem Formulation • Complexity Results • Algorithms • Experiments • Conclusions
Motivation • Decision Diagrams (DDs): • function representation • used in: logic synthesis, testing, and verification • Don´t Care conditions: • can occur between function modules • by system specification • Use Don´t Cares to minimize DD-representation • well-known for bit-level DDs (BDD, FDDs) • unknown for word-level DDs (BMD, *BMDs, ...)
Related Work • Zilic, Radecka, IWLS, 1998: „Don´t Care FDD minimization by interpolation“ Problem: FDD represents boolean function, *BMD represents integer-valued function • Varma, Trachtenberg, IEE Proceedings, 1991: „Computation of Reed-Muller expansions of incompletely specified boolean functions from reduced representations“ Problem: Spectral technique not applicable in case of integer-valued functions
Decision Diagrams: BDDs • Representation for boolean functions: • Iterative Shannon-decomposition: • Transformation into directed, acylic graph: • Reduction: eliminate v iif low(v)=high(v) v low(v) high(v)
Decision Diagrams: BMDs (1) • Representation for integer-valued functions • Iterative positive Davio decomposition: • Transformation into directed, acyclic graph: • Reduction: eliminate v iif high(v) = 0 v low(v) high(v)
Decision Diagrams: BMDs (2) Example:
Decision Diagrams: *BMDs • More compact than BMDs: extract multiplicative factor of terminals into edge weights • Example:
BMD-nodes reached by • Node v labeled with variable • low(v)=0-successor(v), high(v)=1-successor(v) • Node reached by : • Follow starting at root node • Special case: not labeled with • Let , choose with: • Go to node
Reduced BMD: Non-reduced BMD: Example • (0,0)-node: terminal 1 • (0,1)-node: terminal 5 • (1,0)-node: terminal 4 • (1,1)-node: terminal 0
Modification of -node, , changes function represented by node v Function represented by a BMD-node • Let B be a BMD, ,v is a -node. • Funtion represented by v is:
+k -k +k Example
Problem Formulation Problem:DC*BMD Given: *BMD B, BDD C, Find: *BMD B*, such that and B* has minimal number of nodes. Problem:DCBMD Like DC*BMD, but BMD instead of *BMD.
Complexity Theorem: DC*BMD and DCBMD are NP-complete. Proof: NP-hardness: Reduction from graph colorability problem. NP-membership: Using WLCDs.
Method min_polynomial (1) • Idea: Minimize size of polynomial extracted from BMD • Polynomial contains term with iif node reached by is terminal • Size of BMD B, , is less or equal to size of polynomial representing . • Property holds also for *BMDs.
Method min_polynomial (2) • Try to change terminal c reached by to have value 0 by using don´t cares. • If , change to : • Important: Adjustment of all terminals
-1 +1 +1 -1 -7 Method min_polynomial (3) • dc(0,0)=1 • dc(1,1)=1
Method min_polynomial (4) *BMD min_polynomial( *BMD b, BDD dc) 1. ifdc=1return 0; ifdc=0returnb; ifb=constantreturnb 2. if(result,b,dc) in Computed Table returnresult 3. Let v be top variable of b and dc 4. b*low=min_polynomial(blow, dclow) 5. b*high=min_polynomial(bhigh +(blow-b*low), dchigh) 6. b*= b*low+v*b*high 7. ifsize(b*) size(b) then b*= b 8. insert (b*,b,dc) into Computed Table 9. return b*
Method independent_dfs (1) • Idea: Use don´t cares to assign high(v) to 0 application of Davio-reduction rule. • At node v, to check if w=high(v) can be set to 0: 1. check if low(w) can be set to 0, 2. if 1. succeeds, check if high(w) can be set to 0.
+3 -11 -3 -3 +3 Method independent_dfs (2) • dc(0,0)=1 • dc(1,1)=1
Method independent_dfs (3) *BMD independent_dfs( *BMD b, BDD dc) 1. ifdc=1return 0; ifdc=0returnb; ifb=constantreturnb 2. if(result,b,dc) in Computed Table returnresult 3. Let v be top variable of b and dc# 4. (success, blow-diff)=check_zero(bhigh , dclow, dchigh) 5. ifsuccess then b*=independent_dfs(blow+blow-diff,dclow*dchigh) else b* low=independent_dfs(blow,dclow) b* high=independent_dfs(bhigh +(blow -b* low ),dchigh) b*= b* low+v* b* high 7. ifsize(b*) size(b) then b*= b 8. insert (b*,b,dc) into Computed Table 9. return b*
Experimental Results (1) • Experimental setup: • Generated incompletely specified functions: • Collapse benchmark to sum-of-products • Select cubes with probability of 40% to be included in Don´t Care set • Compute BDD C for Don´t Care Set • Build *BMD B for the outputs of the benchmark, where is: • Compute min_polynomial(B,C) and independent_dfs(B,C)
Experimental Results (2) • init: initial size of benchmark • az: setting all don´t cares to 0 • mp: min_polynomial • dfs: independent_dfs
Experimental Results (3) Initial *BMD: , minimized *BMD: Ratio:
Conclusions • We presented methods do minimize *BMD/BMDs using Don´t Care conditions • Two methods: min_polynomial, independent_dfs • very effective in reducing the size of *BMDs • time efficient (most benchmarks finish in a few seconds)
Future Work • Modification of independent_dfs to independent_bfs: Idea: Don´t care assignments which could be made „at the top in the right half“ of the *BMD can become not applicable due to assignments made „at the bottom in the left half“ • Extension of existing methods to K*BMDs: K*BMDs use several decomposition types: Shannon, positive and negative Davio • Application of Don´t Care based minimization methods for verification of division circuits