Build AND, OR, NOT, NAND, NOR, XOR and XNOR logic circuits interactively. Toggle inputs A and B and watch the output and truth table update in real time. Use this tool to practise Boolean logic for AQA (8525/7517), OCR (J277/H446) and Cambridge IGCSE (0478) Computer Science exams.
Select gate
Output is 1 only when ALL inputs are 1
Inputs
Gate diagram
Truth table — AND
| A | B | Output | Active |
|---|---|---|---|
| 0 | 0 | 0 | ← now |
| 0 | 1 | 0 | |
| 1 | 0 | 0 | |
| 1 | 1 | 1 |
You are required to know these truth tables for all three exam boards. NAND and NOR are called "universal gates" because any logic circuit can be built from them alone.
| A | B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| A | B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
| A | Out |
|---|---|
| 0 | 1 |
| 1 | 0 |
| A | B | Out |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
| A | B | Out |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
| A | B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Exam questions may ask you to draw a circuit from a Boolean expression like A AND (B OR NOT C). Work right to left: identify the final gate, then work backwards through the expression. Always label inputs and the output.
For a circuit with 3 inputs, you need 8 rows (2³). Start with the rightmost column cycling 0,1,0,1,... — the next column doubles: 0,0,1,1,0,0,1,1 — and so on. Fill in intermediate wire values as separate columns to avoid mistakes.
Remember: NAND = NOT-AND (invert the AND output), NOR = NOT-OR. A universal gate question asks you to implement AND, OR or NOT using only NAND gates (or only NOR). NOT from NAND: connect both inputs together.
At A Level, you may need to simplify Boolean expressions using De Morgan's laws: NOT(A AND B) = NOT A OR NOT B; NOT(A OR B) = NOT A AND NOT B. These are also the mathematical definitions of NAND and NOR.
Logic gates are the fundamental building blocks of digital circuits. They take one or two binary inputs (0 or 1) and produce a single binary output according to Boolean logic rules. The gates you need for GCSE are: AND, OR, NOT, NAND, NOR and XOR. They are used to build processors, memory and all digital systems.
A NAND gate outputs 1 in every case except when both inputs are 1. A NOR gate outputs 1 only when both inputs are 0. Both are called "universal gates" because any other gate can be built entirely from NAND or NOR alone.
Yes. AQA, OCR and Cambridge all require students to draw and interpret logic gate symbols using the standard British (BS) symbols used in this simulator. You may be asked to complete truth tables or draw circuits from Boolean expressions.
A truth table lists all possible combinations of inputs and shows the resulting output. For two inputs (A, B) there are 4 rows. For three inputs there are 8 rows (2³). Always work through the rows systematically — start with A=0,B=0 and increment in binary.