Finding all kernels

Download Report

Transcript Finding all kernels

Binary decision diagrams (BDD’s)
• Compact representation of a logic function
• ROBDD’s (reduced ordered BDD’s) are a canonical representation:
equivalence of ROBDD’s implies that the functions are identical
• Example: f = abc + b’d + c’d
a
– T = then edge, E = else edge
– Same variable ordering on
each path: a  b  c  d
(Ordered BDD)
b
T
c
b
E
T
E
E
E
d
T
Material taken mostly from
G. Hachtel and F. Somenzi,
“Logic Synthesis and Verification
Algorithms,” Kluwer Academic
Publishers, Boston, MA, 1996.
E
T
T
1
E
c
T
0
Effect of variable ordering
• Size of diagram varies with variable ordering
adbc
bcad
b
a
T
d
E
T
T
b
T
c
T
1
d
E
E
E
c
T
b
E
E
T
E
E
a
T
T
c
E
E
T
d
T
E
0
1
0
Relation to the Shannon expansion
• Each node is basically a Shannon expansion
– f = a fa + a’fa’
f
a
fa
b
T
c
fa’
E
T
b
E
T
E
E
E
d
T
T
1
E
c
T
0
Building a BDD from a Shannon expansion
f = abc + b’d + c’d
b
T
E
fb = ac + c’d
c
T
E
fbc’ = d
fbc = a
(… and so on …)
fb’ = d
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
b
c
T
d
T
a
T
1
a
E
0
T
d
E
E
T
E
1
0
1
0
isomorphic
0
isomorphic
redundant T
T
E
a
E
T
T
E
1
0
T
E
T
d
E
T
d
T
E
d
E
d
TE
1
T
c
E
c
c
E
1
0
BDD shown earlier for the ordering
bcad
Multioutput BDD’s
• (Notation: solid line = Then edge; dashed line = Else edge)
• Example: F1 = b+c, F2 = a+ b+c
Separate BDD’s
Combined Multioutput BDD
F2
F2
F1
a
a
b
F1
b
b
c
c
c
1
0
1
0
1
0
Compactness of BDD’s
• BDD’s 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 BDD’s more
compactly (“partitioned ROBDD’s”)
Operations on BDD’s
• Given BDD’s 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:
T
(BDD for fv1 <op> gv1)
v1
E
(BDD for fv1’ <op> gv1’)
– Identify identical subtrees as we come up the recursion tree using a
hashing function