Skip to content

Adith1207/BDD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ BDD – Boolean Logic Function Synthesizer

This project implements a Binary Decision Diagram (BDD) – an efficient data structure to represent and synthesize Boolean logic functions from a truth table.


πŸ“Š Problem Overview

Consider the following Truth Table:

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
  • The function f depends on inputs x1, x2, and x3.
  • Using a BDD, we can efficiently represent and synthesize this function into a Boolean algebra expression.

πŸ’‘ Features

  • Load truth table data from a .csv file.
  • Generate Sum of Products (SOP) or Product of Sums (POS) Boolean expressions.
  • Clear, human-readable Boolean algebra output.

⚑ Example Output

βœ… SOP Expression

x3'x2' + x3x2' + x3x2 + x2 + x1

βœ… POS Expression

( x3 + x2 ) . ( x3 + x2' ) . x1'


πŸš€ How to Run Locally

  1. Clone the repository

    git clone https://github.com/karthik-saiharsh/BDD.git
  2. Navigate to the project directory

    cd Binary_Decision_Diagram
  3. Create your Python file (in the same directory)

    touch main.py
  4. Import and use the BDD Synthesizer

    from BDD import *
    
    bdd = BinaryDecisionDiagram()
    bdd.generateExpressionFromCSV("truthTable.csv", isSOP=False)  # Set isSOP=True for SOP output

πŸ“š Sample truthTable.csv Format

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

🀝 Contributors

Contributor Role
Adith Core functionality implementation and usability improvements
Karthik Saiharsh Original project creation and foundational architecture

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages