Binary Decision Diagram Overview • • • • • • • • • • Introduction Definition of BDD Why BDD Reduction Rules BDD Construction Optimization of BDD Types of BDD Comparison Applications Conclusion Introduction • Binary decision diagram is a compact data structure of Boolean logic. It is a graph based representation of Boolean function. BDD is defined as directed acyclic graph. Definition of BDD A Binary decision diagram is a rooted directed acyclic graph with • Two types of vertices-terminal and non-terminal • A terminal vertex V has a value(v) € {0,1} and terminal symbol is □ • A non-terminal vertex V has two children low(v) and high(V) and non-terminal symbol is ⃝ Definition of BDD … f 1 0 0 1 0 0 1 1 Why BDD • Requires Less Space/Memory. For example, K-Map requires 2n rows for n input variables while BDD requires 2n – 1 nodes. • Efficient ordering algorithm can be applied to reduce the number of nodes. Reduction Rules • Node Elimination • Node Sharing Node Elimination • Eliminating redundant nodes (with both edges pointing to the same node a b b Node Sharing • Merge duplicate nodes (Isomorphic sub graphs) f1 f2 a a b c a b c Construction F = ac + bc A B C f 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 1 a b b c 0 c 0 0 c 1 0 c 1 0 1 Construction … a b c b c 0 c c 1 Construction … a b c b c 0 c c 1 Construction … a b b c c 0 1 Construction … a b b c c 0 1 Construction … a b c 0 1 Optimization of BDD Algorithm of grouping input variables • Grouping of input variables • Ordering of multiple variables • Grouping of output function Optimization of BDD Three methods exist to reduce the number of nodes in a BDD • • • • • Derive the dependency matrix Calculate weight Construct assignment graph Obtain the minimum weighted matching Group the input variables according to minimum weighted matching Why Ordering Bad Ordering can cause significant space problem ƒ(x1, ..., x8) = x1x2 + x3x4 + x5x6 + x7x8 Why Ordering Good Ordering of the previous equation ƒ(x1, ..., x8) = x1x2 + x3x4 + x5x6 + x7x8 Optimization of BDD Three methods exist to reduce the number of nodes in a BDD • • • • • Derive the dependency matrix Calculate weight Construct assignment graph Obtain the minimum weighted matching Group the input variables according to minimum weighted matching Dependency Matrix f0=X1 + X3 f1=X2 X3 f2=X1 X3 f3=X3 + X4 f0 f1 f2 f3 X1 1 0 1 0 X2 0 1 0 0 X3 1 1 1 1 X4 0 0 0 1 Grouping & Weight Calculation f0 f1 f2 f3 W [x1 , x2] 1 1 1 0 3 [x1 , x3] 1 1 1 1 4 [x1 , x4] 1 0 1 1 3 [x2 , x3] 1 1 1 1 4 [x2 , x4] 0 1 0 1 2 [x3 , x4] 1 1 1 1 4 Finding Minimum Weight x1 3 x2 3 2 4 4 x3 4 [x1 , x2] , [x3 , x4] [x1 , x3] , [x2 , x4] [x1 , x4] , [x3 , x4] 4+3 = 7 4+2 = 6 4+4 = 8 x4 [x1,x3] , [x2,x4] contains minimum weight 6, hence selected Types of BDD Different types of BDD Shared BDD(SBDD) Multi-Terminal BDD(MTBDD) Shared Multi-Terminal BDD Shared BDD(SBDD) Representing multiple-output function by sharing node among BDDs Reduce the number of nodes f1=a+b a f2=ab b 0 a b 1 0 1 Shared BDD(SBDD) f1=a+b f2=ab a a b 1 0 Multi-terminal BDD • Multiple output terminals • Make simulation faster a b f1 f2 f3 0 0 0 1 0 0 1 1 0 0 1 0 1 1 1 1 1 1 0 0 a b b f1 0 1 0 f2 1 0 1 f3 0 0 0 SBDD vs MTBDD SBDD vs MTBDD Comparison of Evaluation Time SBDD vs MTBDD Comparison of Space Problem Shared Multi-terminal BDD [f1, f2] • Shared internal nodes • Multiple output terminals • Group output variables a b f1 f2 f3 f4 0 0 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 1 0 [f3, f4] a a b b f1 f3 0 0 1 f2 f4 0 1 1 SMTBDD vs SBDD SMTBDD vs SBDD Comparison of Evaluation time & Space Problem SMTBDD vs MTBDD SMTBDD vs MTBDD Comparison of Evaluation time & Space Problem Application of BDD • • • • Logic Synthesis Testing Verification Fault Tree Analysis References • http://en.wikipedia.org/wiki/Binary_decision_diagram • http://www.columbia.edu/ ~gss2117/ MSRutgersThesis.ppt • Hafiz Md. Hasan Babu and T.sasao , “Shared Multi Terminal Binary Decision Diagrams for Multiple-Output Logic Functions”, the sixth workshop on Synthesis and System Integration of Mixed Technologies(SASIMI’96), fukuoka, Japan, pp 212-217 ,Nov 1996. • S.B Akers, “Binary Decision Diagrams” , IEEE Trans.Comput; vol C-27, no-6, pp.509-516, June 1978. Conclusion BDD are a data structure that has been used for years to provide a cogent representation of boolean functions. Indeed, they are now such a common part of computer aided design research that one can safely assume a working knowledge of BDD’s on the part of virtually any reader