Professional Documents
Culture Documents
ROBDD's
ordered
Reduced:
Example
root
node
c + bd b
_
_
f = ab + ac + bcd
c+d
c
d
b
collision
chain
hash value
of key
.
.
.
v
0
f_
v
1
fv
ROBDD
Ordered BDD OBDD Input variables are ordered -
ordered
order = a,c,b
c
not
ordered
a
c
b
c
0
b
0
a f
0
1
c 1
0
Notes:
_
b f a =b
0 1
1
Implementation
Variables are totally ordered: If v w then v occurs
"higher" up in the ROBDD call it BDD from now on.
De nition 1 Top variable of a function f is a variable
associated with its root node.
Example: f = ab + abc + abc. Order is a; b; c.
fa = b fa = b
a
b is top variable of f
f
reduced
b
0
b
0
1 0
v
0
mux
h
1
g
ITE Operator
itef; g; h = fg + fh
ite operator can implement any two variable logic function. There are 16 such2functions corresponding to all
subsets of vertices of B : fg; fg; fg; fg
Table
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Subset
0
ANDf; g
f g
f
f g
g
XORf; g
ORf; g
NORf; g
XNORf; g
NOT g
f g
NOT f
f g
NANDf; g
1
Expression
0
fg
fg
f
fg
g
f g
f +g
f +g
f g
g
f +g
f
f +g
fg
1
Equivalent Form
0
itef; g; 0
itef; g; 0
f
itef; 0; g
g
itef; g; g
itef; 1; g
itef; 0; g
itef; g; g
iteg; 0; 1
itef; 1; g
itef; 0; 1
itef; g; 1
itef; g; 1
1
8
hash value
of key
.
.
.
2 ...
fn
sharing of
cofactors
Example
F
a
1
1
0
b
1
1
G
a
B
0
0
0
1
C
c
1 0 0
1
0
H
b
1
1
I
a
D
d
1 0
1
1
C
b
1
1
0
0
D
F,G,H,I,J,B,C,D
are pointers
I =
=
=
=
=
=
=
Check:
iteF; G; H
a; iteFa; Ga; Ha; iteFa; Ga; Ha
a; ite1; C; H ; iteB; 0; H
a; C; b; iteBb; 0b; Hb; iteBb ; 0b; Hb
a; C; b; ite1; 0; 1; ite0; 0; D
a; C; b; 0; D
a; C; J
F = a+b
G = ac
H = b+d
Computed Table
Keep a record of F; G; H triplets already computed
by the ite operator in a hash-based cache "cache"
table. This means that the collision chain is not used
if collision, old entry thrown away.
unique
table
index
then
else
index
then
else
index
then
else
data
next
index
then
else
data
next
BDD nodes
cache
table
index
then
else
index
then
else
data
next
collision chain
Better Implementation
cache
table
unique
table and
BDD dag
ite(F,G,H)
(F,G,H)
index
then
else
next
index
then
else
next
index
then
else
next
index
then
else
data
next
collision chain
Here the BDD nodes and the collision chain are merged.
On average, only 4 pointers per BDD node.
13
_
G
two different
dags
14
iteF; F; G
iteF; G; F
iteF; G; F
iteF; F; G
=
=
=
=
To resolve equivalences:
iteF; 1; G
iteF; 0; G
iteF; G; 0
iteF; G; 1
iteF; G; G
iteF; 1; G
iteF; G; 0
iteF; G; 1
iteF; 0; G
iteG; 1; F
iteG; 0; F
iteG; F; 0
iteG; F; 1
iteG; F; F
Triples:
Tautology Checking
Tautology returns 0,1, or NC not constant.
ITE constantF; G; H f
if trivial case f
return result 0,1, or NC;
g else if cache table has entry for F; G; H f
return result;
g else f
let v be the top variable of F; G; H ;
R ITE constantFv ; Gv ; Hv ;
if R = NC f
insert cache tablefF; G; H g,NC;
return NC;
g
E ITE constantFv ; Gv ; Hv ;
if E = NC or R 6= E f
insert cache tablefF; G; H g,NC;
return NC;
insert cache tablefF; G; H g; E ;
return E ;
g
g
Note, that in computing ITE constant, we set up a
temporary cache-table for storing results of the ITE constant
operator. When done, we can throw away this table if
we like.
16
Compose
Compose is an important operation for building the
BDD of a circuit.
composeF; v; G : F v; x ! F Gx; x
Means substitute v = Gx.
compose F; v; G f in F replace v with G
iftop varF v return F ;
because F does not depend on v
iftop varF = v return ITEG; F1; F0;
R composeF1; v; G;
E composeF0; v; G;
return ITEtop varF ,R; E ;
note that we call ITE on this rather than
g
returning top varF ,R; E
Notes:
1. F1 is the 1-child of F , F0 the 0-child
2. G; R; E are not functions of v
3. if top var of F is v, then iteG; R; E does the replacement of v by G.
17
P = {0,1,2,3,4}
v
2 3 4
4
0
1 2
ZBDD:
1
0
0
19
Canonicity
Theorem 2 Minato ZBDD's are canonical given a
variable ordering and the support set.
Example:
x
3
x
1
0
BDD
ZBDD if
support is
x1 , x2
ZBDD if
support is
x1 , x2 , x
3
x
3
x
1
2
1
0
BDD
ZBDD if
support is
x1 , x2 , x
3
20