Skip to content

About

Python GUI for generating truth tables using SymPy, saves output to CSV

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Logic_Truth_Table_Generator

Python GUI for generating truth tables using SymPy, saves output to CSV

🧮 Logic Truth Table Generator (with GUI)

This Python project generates truth tables for user-defined logic expressions using a simple GUI built with tkinter and the sympy library.


🚀 Features

  • Accepts any user-defined logical expression (e.g., A & B | ~C, A ^ B, etc.)
  • Lets the user specify the number of input variables.
  • Automatically generates the complete truth table.
  • Easy-to-use Graphical Interface (GUI).
  • Supports standard logic gates like:
    • AND (&)
    • OR (|)
    • NOT (~)
    • XOR (^)
    • NAND (~(A & B))
    • NOR (~(A | B))
    • XNOR (~(A ^ B))

🧠 How It Works

  1. Enter the number of input variables (e.g., 2 or 3).
  2. Enter a logical expression (e.g., A & ~B | C).
  3. Click "Generate Truth Table" to view the output.

The backend uses the Sympy library for parsing and evaluating Boolean expressions symbolically, ensuring high accuracy even for complex logic circuits.


🖥️ Tech Stack

  • Language: Python 3.x
  • Libraries Used:
    • tkinter (GUI)
    • sympy (logic evaluation)
    • itertools (truth table generation)

⚙️ Setup Instructions

  1. Clone this repository:
    git clone https://github.com/sukanyap1/Logic_Truth_Table_Generator.git
    
  2. Navigate to the folder:

cd Logic_Truth_Table_Generator

  1. Install dependencies:

pip install sympy

  1. Run the program:

python logic_gui.py

About

Python GUI for generating truth tables using SymPy, saves output to CSV

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages