Build Logic Gate Circuits — Step by Step
Logic gates are the building blocks of all digital electronics. This guided simulation walks you through the three fundamental gates — AND, OR, and NOT — step by step, using interactive truth tables and real simulations. Start from zero and finish understanding how all digital circuits work.
Logic Level Overview
Step-by-Step Guide
A NOT gate (inverter) has one input and one output. If input is HIGH, output is LOW. If input is LOW, output is HIGH. It flips the logic level.
Truth table: Input 0 → Output 1 | Input 1 → Output 0
In the simulator, click the input switch. The output LED should turn on when input is off, and off when input is on.
▶ Simulate NOT Gate (CMOS)An AND gate has two (or more) inputs. Output is HIGH only when ALL inputs are HIGH simultaneously.
Think of it as: two switches in series — both must be closed for current to flow.
Try all four input combinations in the simulator and verify the truth table:
- A=0, B=0 → Output = 0
- A=0, B=1 → Output = 0
- A=1, B=0 → Output = 0
- A=1, B=1 → Output = 1 ✓ (only this one)
An OR gate outputs HIGH when ANY input is HIGH. Output is LOW only when ALL inputs are LOW.
Think of it as: two switches in parallel — either one being closed allows current to flow.
- A=0, B=0 → Output = 0
- A=0, B=1 → Output = 1 ✓
- A=1, B=0 → Output = 1 ✓
- A=1, B=1 → Output = 1 ✓
XOR (Exclusive OR) outputs HIGH when inputs are DIFFERENT. When both inputs are the same (both HIGH or both LOW), output is LOW.
XOR is used in binary arithmetic — adding two 1-bit numbers. 0+0=0, 0+1=1, 1+0=1, 1+1=0 (with carry). This is exactly the XOR truth table!
▶ Simulate XOR Gate ▶ Half Adder (XOR + AND)NAND gates are "universal" — you can build any other gate from them alone. This was crucial in early IC manufacturing: one gate type could implement any logic.
- NOT from NAND: Tie both NAND inputs together → acts as NOT
- AND from NAND: NAND gate → NOT gate (NAND with tied inputs)
- OR from NAND: Invert both inputs, then NAND them (De Morgan's theorem)