symposium on innovation of computer science curriculum in higher education athens 2004
DESCRIPTION
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004. Decision Diagrams: Principles of Programming. Dragan Jankovi ć [email protected] Faculty of electronic engineering University of Niš. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/1.jpg)
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
Decision Diagrams:Decision Diagrams:Principles of Programming Principles of Programming
Dragan Janković[email protected]
Faculty of electronic engineeringUniversity of Niš
![Page 2: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/2.jpg)
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
OUTLINES- Introduction
- Binary decision diagrams- Multiple-valued decision diagrams- Applications in Logic design
- Implementation principles- Shared DDs- Unique table- Strong canonicity- Attributed edges- Computed table- Memory management and dynamic reordering
- Universal DD package - Conclusion
![Page 3: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/3.jpg)
“Give me enough strong support,I will move the Earth up “
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 4: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/4.jpg)
Verification of synthesized netlist vs. final netlistFinal
– 2843 inputs, 4178 outputs, 150215 states– 2.634 million gates– 3861939 loc (parsed in 1:41 min)
Synthesis– 2843 inputs, 4178 outputs, 150218 states– 2.635 million gates– 222610 loc (parsed in 15 sec)
Equivalence Check: 18:10 CPU min, 0.373 GByte
Circuit complexity
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 5: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/5.jpg)
Logic design problemsand the others
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 6: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/6.jpg)
“ Decision diagrams arethe state-of-the-art
data structure in VLSI CAD for representation and manipulation
of Discrete functions “
W H Y ?
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 7: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/7.jpg)
Binary Decision Trees.• A BDT is a rooted, directed tree that
consists of two types of nodes, terminal nodes and nonterminal nodes.– Each nonterminal node v
• is labeled by a variable var(v) • and has two successors :
– low(v) corresponding to the case where the variable v is assigned 0
– and high(v) corresponding to the case where v is assigned 1.
– Each terminal node v • is labeled by value(v) which is either 0 or 1.
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 8: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/8.jpg)
Graphical representation
1
32
0 1
0 1
10
10
index(v) = 2
vnon-terminal
terminalvalue(u)
u
high(v)
low(v)
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 9: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/9.jpg)
Truth Table Decision Tree
– Node represents decision– Follow blue line for value 0– Follow red line for value 1– Function value determined by terminal value.
00001111
00110011
01010101
00010101
x1 x2 x3 f x1
x3
x2
x3 x3x3
10
x2
110 0 0 0
0 1
1010
0 1 0 1 0 1 0 1
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 10: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/10.jpg)
1) Merge equivalent terminals
a a
0 0
x3
0 1
x3
x2
0 1
x3
0 1
x3
x2
x1
x3 x3
x2
x3
0 1
x3
x2
x1
a
Reduction rulesSymposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 11: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/11.jpg)
y
x
z
x
2) Merge isomorphic nodes
x3 x3
x2
x3
0 1
x3
x2
x1
x3
x2
0 1
x3
x2
x1
y
x
z
x
y
x
z
x
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 12: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/12.jpg)
x3
x2
0 1
x3
x2
x1
3) Eliminate Redundant Tests
y
x
y
x2
0 1
x3
x1
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
ROBDD or BDD
![Page 13: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/13.jpg)
Binary Decision Diagram• A BDD is a rooted, directed acyclic graph
with two types of vertices, terminal vertices and nonterminal vertices.– Each nonterminal vertex
• is labeled by a variable var(v)• and two successors, low(v) and high(v)
– Each terminal vertex • is labeled by a either 0 or 1.
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 14: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/14.jpg)
STATE – OF – THE – ARTDATA STRUCTURE
????
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 15: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/15.jpg)
b3 b3
a3
Cout
b3
b2 b2
a2
b2 b2
a2
b3
a3
S3
b2
b1 b1
a1
b1 b1
a1
b2
a2
S2
b1
a0 a0
b1
a1
S1
b0
10
b0
a0
S0
• Functions– All outputs of 4-bit adder– Functions of data inputs
A
B
Cout
SADD
• Shared Representation– Graph with multiple roots– 31 nodes for 4-bit adder– 571 nodes for 64-bit adder Linear growth
Representing Circuit Functions
GByte28104Truth-vector
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 16: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/16.jpg)
• Logic Circuit Comparison– Do circuits realize identical function?
• Basic task of formal hardware verification• Compare new design to “known good” design
A
C
B
O1
T1
T2
ABC
O2
T3
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 17: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/17.jpg)
• Generate Complete Representation of Circuit Function– Compact, canonical form
– Functions equal if and only if representations identical– Never enumerate explicit function values– Exploit structure & regularity of circuit functions
A
C
B
O1
T1
T2
ABC
O2
T3
b
0 1
c
a
b
0 1
c
a
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 18: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/18.jpg)
Network Evaluation
Task: Represent output functions of gate network as OBDDs.
A
B
C
T1
T2
Out
Resulting GraphsA B C
T1 T2
Out
0 1
a
0 1
c
0 1
b
0 1
b
a
0 1
c
b
c
b
0 1
b
a
•A new_var ("a");•B new_var ("b");•C new_var ("c");•T1 And (A, 0, B);•T2 And (B, C);•Out Or (T1, T2);
Generating OBDD from NetworkSymposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 19: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/19.jpg)
• Verification– Combinational equivalence (UCB, Fujitsu, Synopsys,
…)– FSM equivalence (Bull, UCB, MCC, Siemens,
Colorado, Torino, …)– Symbolic Simulation (CMU, Utah)– Symbolic Model Checking (CMU, Bull, Motorola, … )
• Synthesis– Don’t care set representation (UCB, Fujitsu, …)– State minimization (UCB)– Sum-of-Products minimization (UCB, Synopsys, NTT)
• Test– False path identification (TI)
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 20: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/20.jpg)
• Systems Represented as Finite State Machines– Sequential circuits– Communication protocols– Synchronization programs
• Analysis Tasks– State reachability– State machine comparison– Temporal logic model checking
• Traditional Methods Impractical for Large Machines– Polynomial in number of states– Number of states exponential in number of state variables.– Example: single 32-bit register has 4,294,967,296 states!
Finite State System AnalysisSymposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 21: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/21.jpg)
Pentium bug 475 million $ loss
Verification (equivalence check)
RTL compiler
net compiler
gate
gate
synthesis cons.
compare
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 22: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/22.jpg)
How to implement Decision Diagrams ?
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 23: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/23.jpg)
• Mini
mal mem
ory •Efficient manipulation
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 24: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/24.jpg)
The basic tasks in DD programming• Determine the data structure to represent a node• Provide efficient construction of DDs from a specification• Provide efficient manipulation
“Optimal” DD does not exist –
Dependent on the underlying application one should be favored
There are a different types of DDs
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 25: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/25.jpg)
DDs based packages
- standard part of many VLSI CAD systems - efficient implementation of one or a few strongly related DD types for some particular class of discrete functions (BDD, KDD, …)
Existing packages:• Rudell’s package (Synopsys)• David Long’s package (Carnegie Mellon University) in SMV, VIS, SIS.• CUDD (University of Colorado)• PUMA (University of Freiburg)• BEMIITA, etc.
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 26: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/26.jpg)
Basic principles in DD programming
Shared DDs Unique table Strong canonicity Attributed edges Computed table Memory management and dynamic reordering
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 27: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/27.jpg)
Node representationNode representationstruct DdNode{ DdHalfWord index; - index of variable assigned to the node DdHalfWord ref; - counter of references DdNode *next; - pointer to the following node in the
Unique table union { CUDD_VALUE_TYPE value; - for terminal nodes
DdChildren kids; - for non-terminal nodes } type}
struct DdChildren { struct DdNode *T; - pointer to the THEN successor struct DdNode *E; - pointer to the ELSE successor}
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 28: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/28.jpg)
vector:: mapping : variables to levels and vice-versa
Shared DDs-representation of multioutput functions-system of functions-functions shared the same nodes-reduction in space
b3 b3
a3
Cout
b3
b2 b2
a2
b2 b2
a2
b3
a3
S3
b2
b1 b1
a1
b1 b1
a1
b2
a2
S2
b1
a0 a0
b1
a1
S1
b0
10
b0
a0
S0
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 29: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/29.jpg)
Strong canonicity
-DDs are a canonical representation-One DD corresponds to the only one function and -One function can be represented by only one DD-Conditions:
- DD is ordered and reduced - There is no isomorphic nodes
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 30: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/30.jpg)
Unique table
-all nodes are stored in table called “Unique table”-Unique table is “hash” based table-Two approaches:
- unique table- each variable separate subtable
To do:-Choose the good “key” and hash function-Choose the right size of hash table -Influence to the number of “hits”-Depends on the application-Fine tuning of the package performance
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 31: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/31.jpg)
Decision: store the KEY into the node structure or not?
-reduce storage memory
-avoid repeated calculation of the node KEY
Before the generation of the new node we should tryto find the same node in the Unique table.-return existing node-generate a new node and insert it into Unique table
Key = v + _HASH_KEY(G) + _HASH_KEY(H) + _HASH_KEY(I) + _HASH_KEY(J) + _HASH_KEY(K)
PUMA
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 32: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/32.jpg)
Compute table-Avoid repeated calculation-All results are stored in table called “Compute table”-Compute table is “hash” based table
-Two approaches:- compute subtables for each operation separately- unique compute table- generic approach (only one operation)
-Arguments: - operation
- arguments of operation- result
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 33: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/33.jpg)
Before calculation try to find the same operation with the same arguments:- return the existing result- perform the operation and store result into compute table
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 34: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/34.jpg)
Attributed edges
-complemented edge-EVBDD (efficient representation of multipliers)
Complemented edges- denotes complemented functions- complexity for the operation negation is O(1)- dot at the edge in graph representation- the last bit in pointer to the node:
- 0 – denotes noncomplemented function- 1 – denotes complemented function
- Reduction in memory up to 20%
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 35: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/35.jpg)
Equivalent Pairs
x
xx
x
xx
xx
Limitation: Position of dots is not arbitrary
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 36: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/36.jpg)
Memory management
- limited memory- garbage collection- performed:
- automatically (free space less than 20%)- manually
- Reference counter used in garbage collection-There are: living nodes (ref. Count >0 ) and dead nodes (ref count. = 0 )- Garbage collection operation removes the dead nodes out of the unique table
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 37: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/37.jpg)
Good Ordering Bad Ordering
Linear Growth
0
b3
a3
b2
a2
1
b1
a1
Exponential Growth
a3 a3
a2
b1 b1
a3
b2
b1
0
b3
b2
1
b1
a3
a2
a1
)()()( 332211 bababa
Dynamic reordering- DDs are very sensitive to the variable ordering
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 38: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/38.jpg)
Finding the good variable ordering- very hard problem-A lot of different methods:
-exact methods (exponential complexity)-heuristic methods-statistical methods-evolution algorithm based methods-dynamic variable ordering method-Sifting method-Lower-bound sifting method-Etc.- Choose one of the above methods depends on the functions, application, computer resources, etc…- apply automatically or manually
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 39: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/39.jpg)
Dynamic Variable Reordering
– Richard Rudell, Synopsys• Periodically Attempt to Improve Ordering for
All BDDs– Part of garbage collection– Move each variable through ordering to find its best location
• Has Proved Very Successful– Time consuming but effective– Especially for sequential circuit analysis
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 40: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/40.jpg)
a3
b2 b2
a3
a2
a3
b1
b2
0
b3
b1
1
b2
a3
a2
a1
a3
b2
b3
b2
a3
a2
a3
b2
0
b1
b3
1
b2
a3
a2
a1
a2
a3
b1
b2
0
b3
b2
a3
1
b1
a2
a1
a3
b2
0
b3
b2
a3
a2
1
b1
a1
a3 a3
a2
b1 b1
a3
b2
b1
0
b3
b2
1
b1
a3
a2
a1
• • •a3
b2
0
b3
b2
a3
a2
1
a1
b1
BestChoices
Dynamic Reordering By Sifting
– Choose candidate variable– Try all positions in variable ordering
• Repeatedly swap with adjacent variable– Move to best position found
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 41: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/41.jpg)
b1 b1
b2b2 b2b2
e f g h
i jb1 b1
b2
b1
b2
b1
e f
g h i j
Swapping Adjacent Variables
• Localized Effect– Add / delete / alter only nodes labeled by
swapping variables– Do not change any incoming pointers
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 42: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/42.jpg)
DDs manipulations
• Building of DDs• Performing binary operation over two DDs• Performing transform over DDs
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 43: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/43.jpg)
Boolean Operations on BDDs
u v
f g<op>
Case 1: u and v are terminals. Then resulting graph is a single terminal w:
value(w) = value(u) <op> value(v)
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 44: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/44.jpg)
0
f1
<op>
Case 2: u and v are non-terminals and index(u) = index(v) = i
i
f2 g1
i
g2
01 1
0
f1 <op> g1
i 1
f2 <op> g2
Get theserecursively
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 45: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/45.jpg)
0
f1
<op>
Case 3: u is a non-terminal, index(u) = i v is either a terminal or index(v) = j > i
i
f2 g1
j
g2
01 1
0
f1 <op> g
i 1
f2 <op> g
j > i
or x
x = 0 or 1
APPLY( )
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 46: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/46.jpg)
Pseudocode for Apply Operationfunction Apply( F, G )
if ( AlreadyComputed( F, G ) ) return result;
else if ( F=={0,1} && G=={0,1} ) return oper( F, G );
else if ( Var( F ) == Var( G ) )
u = CreateNode( Var(F), Apply(Fx’,Gx’), Apply(Fx,Gx));
else if ( Var( F ) < Var( G ) )
u = CreateNode( Var(F) , Apply(Fx’,G ), Apply(Fx,G ));
else /* if ( Var( F ) > Var( G ) ) */
u = CreateNode( Var(G) , Apply(F,Gx’ ), Apply(F,Gx ));
InsertComputed( F,G,u );
return u;
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 47: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/47.jpg)
Example: F=ac+bc+d G=ac’+d F+G = ?
a
d
c
b
10
a
c
d
10
+
A1
A2
A6
A3
B1
B5
B2
A4 A5 B3 B4
A1,B1
A2,B2
A6,B2
A3,B2
A4,B3 A5,B4
A6,B5
A5,B2 A3,B4
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 48: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/48.jpg)
A1,B1
A2,B2
A6,B2
A3,B2
A4,B3 A5,B4
A6,B5
A5,B2 A3,B4
a
d
c
b
10
c
1 1
a
d
c
b
10reduction
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 49: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/49.jpg)
Improvement:
APPLY procedure if-then-else operator ITE
Definition: ITE is a binary operator defined by
where F,G,H are arbitrary switching functions
HFGFHGFite ,,
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 50: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/50.jpg)
I T E r e a l i z a t i o n
)H,G,F(iteZ ,
v - t h e t o p v a r i a b l e o f F , G , H .
vv ZvZvZ
vv HFGFvHFGFv
vvvvvvvv HFGFvHFGFv
vvvvvv H,G,Fite,H,G,Fite,vite
vvvvvv HGFiteHGFitev ,,,,,,
T e r m i n a l c a s e s :
FFiteFGiteGFite 0,1,,,0,,1 .
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 51: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/51.jpg)
Realization of arbitrary binary operations over BDDs by ITE operator
T a b l e N a m e E x p r e s s i o n E q u i v a l e n t f o r m0 0 0 0 0 0 00 0 0 1 A N D ( F , G ) GF ),G,F(ite 00 0 1 0 F > G GF ),G,F(ite 00 0 1 1 F F F0 1 0 0 F < G GF )G,,F(ite 00 1 0 1 G G G0 1 1 0 X O R ( F , G ) GF )G,G,F(ite0 1 1 1 O R ( F , G ) GF )G,,F(ite 11 0 0 0 N O R ( F , G ) GF )G,,F(ite 01 0 0 1 X N O R ( F , G ) GF )G,G,F(ite1 0 1 0 N O T ( G ) G ),,G(ite 101 0 1 1 F G GF )G,,F(ite 11 1 0 0 N O T ( F ) F ),,F(ite 101 1 0 1 F G GF ),G,F(ite 11 1 1 0 N A N D ( F , G ) GF ),G,F(ite 11 1 1 1 1 1 1
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 52: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/52.jpg)
Generation of MDDs
Similar as generation of BDDs. CASE operator instead ITE operator
Definition: CASE for q-valued functions is as an operator of q+1 argument as
or in form:
where
iFGG,,G,G,FCASE iq for 110 ,
1
0
110 ,,,,q
i
ii
q GFJGGGFCASE
iFiF
FJ i 01
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 53: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/53.jpg)
C A S E r e a l i z a t i o n
110 qG,,G,G,FCASEZ
110110
110
11111111
0000
,,,,,,,,,,
,,,,,,
q
vvvvq
vvvv
qvvvv
qqqqGGGFCASEGGGFCASE
GGGFCASEvCASEZ
w h e r e
jvFFjv a n d jvGG ii
v j .
T e r m i n a l c a s e s :
FqFCASE
FGGqCASE
GFGCASEGGFCASE qq
1,,1,0, ,,,,1
,,,,1,,,,010
1011
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 54: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/54.jpg)
A n e w i n t e r p r e t a t i o n o f I T E a n d C A S E
C o n n e c t i o n b e t w e e n r o w s o f t h e o p e r a t i o n t a b l e a n da r g u m e n t s i n I T E a n d C A S E
R e a l i s a t i o n o f a r b i t r a r y b i n a r y o p e r a t i o n so v e r B D D s b y I T E
O P 0 10 v 0 , 0 v 0 , 1
1 v 1 , 0 v 1 , 1
0,01,00,11,1 ,,,,,,, vvbitevvbiteaitebaOP .
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 55: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/55.jpg)
E x a m p l e : I T E
A N D o p e r a t i o n O R o p e r a t i o nA N D 0 1 O R 0 1
0 0 0 0 0 11 0 1 1 1 1
0,,0,0,1,,0,0,,0,1,,, baitebiteaitebitebiteaitebaAND
baitebiteaitebitebiteaitebaOR ,1,0,1,,1,0,1,,1,1,,, .
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 56: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/56.jpg)
R e a l i s a t i o n o f a r b i t r a r y b i n a r y o p e r a t i o n so v e r M D D s b y C A S E
T a b l e : D e f i n i t i o n o f o p e r a t i o n q O P .q O P 0 1 q - 1
0 v 0 , 0 v 0 , 1 v 0 , q - 1
1 v 1 , 0 v 1 , 1 v 1 , q - 1
q - 1 v q - 1 , 0 v q - 1 , 1 v q - 1 , q - 1
1,11,10,1
1,11,10,1
1,01,00,0
,,,,
,,,,,,
,,,,,,(,
qqqq
q
q
vvvbCASE
vvvbCASE
vvvbCASEaCASEbaqOP
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 57: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/57.jpg)
E x a m p l e : C A S E
L e t 3q
3 - A N D 0 1 2 3 - O R 0 1 20 0 0 0 0 0 1 21 0 1 1 1 1 1 22 0 1 2 2 2 2 2
3 - A N D a n d 3 - O R b y C A S E
3 - A N D ( a , b ) = ))2,1,0,(),1,1,0,(,0,( bCAS EbCAS EaCAS E
3 - O R ( a , b ) = ))2,2,2,(),2,1,1,(),2,1,0,(,( bCA S EbCA S EbCA S EaCA S E
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 58: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/58.jpg)
Direct DDs generation
• Function represented by cubes or analytical• Generate DD for each cube• Add contribution of each cube
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 59: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/59.jpg)
F=[0000222200001000] (1X 2) , (30 1)
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 60: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/60.jpg)
Transform over DDs
Calculation of T over BDDs is done by performingoperations defined by rows of the basic operatormatrices Ti(1).
BDD for f BDD for g=T(f)
ITE operators in each node
and cross-point
-Reed-Muller, Walsh, …
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 61: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/61.jpg)
Symbolic Manipulation with OBDDs
• Strategy– Represent data as set of OBDDs
• Identical variable orderings
– Express solution method as sequence of symbolic operations
– Implement each operation by OBDD manipulation
• Algorithmic Properties– Arguments are OBDDs with identical variable
orderings.– Result is OBDD with same ordering.
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 62: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/62.jpg)
Sample Function ClassesFunction Class Best Worst Ordering SensitivityALU (Add/Sub) linear exponential HighSymmetric linear quadratic NoneMultiplication exponential exponential Low
• General Experience– Many tasks have reasonable OBDD (or other DDs)
representations– Algorithms remain practical for up to 500,000
nodes– Heuristic ordering methods generally satisfactory
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 63: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/63.jpg)
•••
•••
Lower Bound for Multiplication
– Bryant, 1991• Integer Multiplier Circuit
– n-bit input words A and B– 2n-bit output word P
• Boolean function– Middle bit (n-1) of product
• Complexity– Exponential OBDD for all
possible variable orderings
Multn
•••
•••
a0
an-1
b0
bn-1
p0
pn-1
pn
p2n-1
Actual NumbersActual Numbers 40,563,945 BDD nodes to
represent all outputs of 16-bit multiplier
Grows 2.86x per bit of word size
IntractableFunction
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 64: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/64.jpg)
Universal DD package At Faculty of electronic engineering Nis (version 1.0)
Features:
• MDD generation for function represented by truth vector or cubes:• Generation of the truth-vector of MV function from its DD.• Spectrum generation from STDD.• Symbolic showing of DD.• Arbitrary operation over two MDDs• Arbitrary transform over MDD.• Some operation over STDD.
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 65: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/65.jpg)
Conclusions
“What do you think about DDs ?”
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004
![Page 66: Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004](https://reader035.vdocuments.site/reader035/viewer/2022081604/56814c02550346895db8ff49/html5/thumbnails/66.jpg)
DDs
Logic design problemsand the others
Symposium on Innovation of Computer Science Curriculum in Higher Education Athens 2004Athens 2004