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.
- Simulates logic gates (AND, OR, NOT, etc.)
- Evaluates custom truth tables
- Command-line interaction
- C (standard library)
- GCC (for compilation)
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 BNOT AA AND (B OR C)
Hereβs a sample run showing the truth table generation:
git clone https://github.com/Asaf-Alber/logic_simulator.git
cd logic_simulator
gcc -o simulator logic_simulator.c
./simulator Make sure you have MinGW installed.
Then open Command Prompt in the project folder and run:
gcc -o simulator logic_sim.c simulator.exe
