Vous êtes sur la page 1sur 4

Binary decision diagrams (BDDs)

Compact representation of a logic function ROBDDs (reduced ordered BDDs) are a canonical representation: equivalence of ROBDDs implies that the functions are identical Example: f = abc + bd + cd
T = then edge, E = else edge Same variable ordering on each path: a b c d (Ordered BDD)

b
T E E E

b
T E

c
T
Material taken mostly from G. Hachtel and F. Somenzi, Logic Synthesis and Verification Algorithms, Kluwer Academic Publishers, Boston, MA, 1996.

c
T 0

d
T 1 E

Effect of variable ordering


Size of diagram varies with variable ordering
adbc bcad

a
T E T

b
T E E

d
T

d
T E T

c a
E

b
T E E E

b
T E

c
T 1

c
T 0

T 1

d
E 0

Relation to the Shannon expansion


Each node is basically a Shannon expansion
f = a fa + a fa f

a
fa
T T E

fa

b
E E E

b
T E

c
T 1

c
T 0

d
T E

Building a BDD from a Shannon expansion


f = abc + bd + cd

b
T fb = ac + cd E

c
T fbc = a E fbc = d fb = d

( and so on )

BDD as a compact truth table


Truth table: complete ordered binary tree Reduce this by combining isomorphic parts and removing redundant nodes (T,E point to same node) to get ROBDD T b E redundant T

c c
T E E T T

c
T E

c
T E

d
redundant T

a
T

E 1

T 0

E T

d
T E T 1

d
E 0 T 1

d
E 0 T 1

d
E 0

a
T 1 0 E 1

a
TE 0

isomorphic isomorphic

BDD shown earlier for the ordering bcad

Multioutput BDDs
(Notation: solid line = Then edge; dashed line = Else edge) Example: F1 = b+c, F2 = a+ b+c
Separate BDDs Combined Multioutput BDD

F1 b c

F2 a b c

F2 a b c
0 1

F1

0 1 0

Compactness of BDDs
BDDs are successful at compactly representing many common functions
XOR is an example of a function with a large SOP/POS representation, but a very compact BDD

Worst case: O(2n) nodes


Functions that require this many nodes do exist

Can use multilevel techniques to represent BDDs more compactly (partitioned ROBDDs)

Operations on BDDs
Given BDDs for functions f and g, can use Shannon expansion to see how operations are performed
Assume variables v1, v2 vn f <op> g = v1 (f <op> g)v1 + v1 (f <op> g)v1 = v1 (fv1 <op> gv1) + v1 (fv1 <op> gv1) Can now do this recursively Pictorially: v
T
1

(BDD for fv1 <op> gv1)

(BDD for fv1 <op> gv1)

Identify identical subtrees as we come up the recursion tree using a hashing function

Vous aimerez peut-être aussi