| x1 | x2 | x3 | f |
|---|---|---|---|
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
1 |
- f is a function of x1, x2, and x3.
- BDD or Binary Decision Diagram is an efficient Data structure to store and manage such boolean functions and truth tables.
- The truth table can be passed into the program as a csv file.
- THe program can synthesize a boolean algebra function for the truth table and output it in either SOP(sum of products) or POS(product of sums) form
x3'x2' + x3x2' + x3x2 + x2 + x1
( x3 + x2 ) . ( x3 + x2' ) . x1'
Clone the repo
git clone https://github.com/karthik-saiharsh/BDD.gitGo to the project directory
cd BDDCreate a python file (preferable in the same directory)
touch main.pyImport BDD Class into the newly created Python file
from BDD import *Create a BDD Class and call the generateExpressionFromCSV method
BDD = BinaryDecisionDiagram()
BDD.generateExpressionFromCSV("truthTable.csv", isSOP=False)