The way to build a BDD is a parse tree for an expression representing the logical function that you are trying to build.
Ie if you want BDD for (A + B). (C + D), first you parse (A + B). (C + D) to tree:
.
/ \
+++
/ \ / \
Abcd
then create the BDD recursively - you need methods that can form the AND and OR of the two BDDS, and the base register (a single BDD variable).
This works just as well for logic (lookup as DAG parsing instead of tree).
These BDD notes explain how to implement AND and OR, as well as the hash tables necessary for efficient operation: http://bit.ly/cuClGe
source share