Skip to content

CLI-based logic gate simulator in C that parses expressions and generates truth tables.

License

Notifications You must be signed in to change notification settings

Asaf-Alber/logic_simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logic Simulator

🧩 Description

A simple digital logic simulator written in C. This project simulates the behavior of basic digital logic circuits using truth tables and gate configurations.

Great for understanding how logical gates interact and for learning C through low-level logic implementation.


πŸš€ Features

  • Simulates logic gates (AND, OR, NOT, etc.)
  • Evaluates custom truth tables
  • Command-line interaction

πŸ›  Technologies Used

  • C (standard library)
  • GCC (for compilation)

πŸ“Œ Usage

Here’s an example session running the logic simulator:

Enter expression: A AND B
Enter number of inputs: 2
Enter input values:
A = 1, B = 0
Result: 0

Try entering different expressions like:

  • A OR B
  • NOT A
  • A AND (B OR C)

πŸ–Ό Demo

Here’s a sample run showing the truth table generation:

Logic Simulator Demo


πŸ”§ Installation

git clone https://github.com/Asaf-Alber/logic_simulator.git
cd logic_simulator
gcc -o simulator logic_simulator.c
./simulator 

πŸ’‘ Note for Windows Users:

Make sure you have MinGW installed.
Then open Command Prompt in the project folder and run:

gcc -o simulator logic_sim.c simulator.exe

About

CLI-based logic gate simulator in C that parses expressions and generates truth tables.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages