Logic Gate Simulator
Explore all six logic gates (AND, OR, NOT, XOR, NAND, NOR) with interactive inputs, truth tables, and compound expression building. Matches AQA A Level CS (7517) specification §4.6.4.
📖 Learn Step-by-StepSelect a gate to see its symbol, truth table, and test it with interactive inputs.
A AND B
AND gate
Output is 1 only when ALL inputs are 1.
→
Q0
Truth Table
| A | B | Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Logic Gate Practice Questions
Q1
0/1 markAn AND gate has inputs A=1 and B=0. What is the output?
Q2
0/1 markA NAND gate has inputs A=1 and B=1. What is the output?
Q3
0/1 markHow many rows are in a truth table for a circuit with 3 inputs?
Q4
0/2 marksA circuit implements Q = NOT(A OR B). When A=0 and B=0, what is Q?
Q5
0/1 markA XOR gate has inputs A=1 and B=1. What is the output?
Quick reference — logic gate summary
| Gate | Symbol | Inputs | Output = 1 when… |
|---|---|---|---|
| AND | ∧ | 2 | All inputs are 1 |
| OR | ∨ | 2 | Any input is 1 |
| NOT | ¬ | 1 | Input is 0 (inverts) |
| XOR | ⊕ | 2 | Inputs are different |
| NAND | ↑ | 2 | NOT all inputs are 1 |
| NOR | ↓ | 2 | All inputs are 0 |