Professional Documents
Culture Documents
Binary Decision Diagrams
Binary Decision Diagrams
CHANDAN T J
Binary Decision Diagrams (BDDs) are symbolic/graph representation of Boolean functions. With BDDs, functions can be constructed, manipulated, and compared. Since Boolean functions can also represent mathematical domains as sets and relations and many problems in digital systems can be expressed as a sequence boolean functions, a wide variety of problems can be solved using BDDs.
Terminologies
Nodes with children are parent nodes. A directed edge refers to the link from the parent to the child. The root node of a tree is the node with no parents. There is at most one root node in a rooted tree. A leaf node (terminal node) has no children. Siblings are nodes that share the same parent node. A node p is an ancestor of a node q if it exists on the path from q to the root. The node q is then termed a descendant of p.
Binary tree
binary tree is a tree data structure in which each node has at most two child nodes, usually distinguished as "left(0/1)" and "right(1/0)". Binary trees are used to implement binary search trees.
Truth Table
It needs 2^N bit of memory to represent a Boolean function having N-bit input variables.
Binary Trees
Binary Decision Diagrams
Boolean Circuit
F X Y Z
Arriving at BDDs
An If-then-else Normal Form (INF) is a Boolean expression built entirely from the if-then-else operator and the constants 0 and 1 such that all tests are performed only on variables.
Y = x
Example
Consider the Boolean expression t = (x1 y1) ^ (x2 y2).
An INF of t by selecting in the order of variables x1, y1, x2, y2 and by performing Shannon expansions, we get the expressions t = x1 t1; t0 t0 = y1 0; t00 t1 = y1 t11; 0 t00 = x2 t001; t000 t11 = x2 t111; t110 t000 = y2 0; 1 t001 = y2 1; 0 t110 = y2 0; 1 t111 = y2 1; 0
Binary Tree x1
0 0 y1 1 x2
1 0 x2 y1 1
x2 0 1 1 0 y2 y2 y2 y2 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 0
x2 1 0 1 0 y2 y2 y2 y2 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 1
If all identical nodes are shared and all redundant tests are eliminated, the OBDD is said to be reduced (an ROBDD).
1-edge
F(X=1)
Redundant node
X
Y
F F
X Z
Redundant node
A node whose both edges point to the same function. Redundant node is simply replaced by a reference to its subnode.
x2 0 1
0 1 1 1
y2
Binary Tree x1
0 0 y1 1 x2
1 0 x2 y1 1
x2 0 1 1 0 y2 y2 y2 y2 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 0
x2 1 0 1 0 y2 y2 y2 y2 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 1
Decision Tree
0 0 x2 0 1 y2 y2 0 1 0 1 1 0 0 1 y1 1 x1 1 0 x2 y1 1
Decision Tree
0 0 x2 0 1 y2 y2 0 1 0 1 1 0 0 1 y1 1 x1 1 0 y1 1 x2 1 0 y2 y2 0 1 0 1 1 0 0 1
BDD
If we substitute all equal sub-expressions we end up with what is known as a binary decision diagram (a BDD). It is no longer a tree of Boolean expressions but a directed acyclic graph (DAG).
Decision Tree
0 0 x2 0 1 y2 y2 0 1 0 1 1 0 0 1 y1 1 x1 1 0 y1 1 x2 1 0 y2 y2 0 1 0 1 1 0 0 1
BDD 0 0 x2 0 1 y2 y2 0 1 0 1 1 0 0 1 y1 1 x1 1 1 0 y1
Examples
Truth Table
X 0 0 0 0 1 1 1 1 Y 0 0 1 1 0 0 1 1 Z 0 1 0 1 0 1 0 1 F 0 0 1 0 1 1 0 0
Boolean Circuit
F X Y Z
Examples
0 0 0 0 z 1 0 y 1 z x 1 0 z 0 1 y 1 1 1 z 1 0 0 0
0 1
1 0
0 0 0 y 1 z
1 0 1 y 1 0
0 1
1 0
Examples