2

Given a binary decision diagram, how do I convert it into a truth table? What is the exact algorithm for it ? I have been trying this for a long time. Here is an example which one can follow:

enter image description here

Source: Wikipedia.

(The dotted edges represent 0; solid edges, 1.)

kjhughes
  • 106,133
  • 27
  • 181
  • 240
Palash Ahuja
  • 522
  • 1
  • 5
  • 15
  • maybe turn a full path decision into a bitmap and fill the value into a pre-allocated table? – Jason Hu Mar 11 '15 at 17:26
  • Please elaborate ... – Palash Ahuja Mar 11 '15 at 17:33
  • i don't quite understand what you are trying to do, and i think the others don't too. maybe you can offer a precise example, what's the input, what's the output, and what's the data format. after that, i can try to answer your question. – Jason Hu Mar 11 '15 at 18:00
  • 1
    If your BDD looks like that (no "skipped" variables), it's completely trivial (just trace all the paths). If you do have "skipped" variables (dont-cares), you have to be careful with them, especially when going to a sink. – harold Mar 11 '15 at 19:48

1 Answers1

3

Beginning at the root node, traverse tree in depth-first manner.

For each leaf node reached, record an entry in truth table as follows:

  • x1 is 0 if you descended the dashed edge from node x1; 1 otherwise.
  • x2 is 0 if you descended the dashed edge from node x2; 1 otherwise.
  • x3 is 0 if you descended the dashed edge from node x3; 1 otherwise.
  • f is value of the leaf node.
kjhughes
  • 106,133
  • 27
  • 181
  • 240