Every calculation a processor makes comes down to tiny circuits called logic gates. Each gate takes binary inputs and gives a single binary output by a fixed rule. Learn the six symbols, the six rules and the truth table for each.
A logic gate takes one or more binary inputs (0 or 1) and produces one binary output. NOT has one input and inverts it. AND gives 1 only if both inputs are 1; OR gives 1 if at least one input is 1; XOR (also written EOR) gives 1 if exactly one input is 1. NAND and NOR are AND and OR with the output inverted, which the small circle on their symbols shows. A truth table lists the output for every possible combination of inputs.
Pick a gate in the lab and click its input switches. The output lamp lights for 1. Then click each row of the truth table to check every combination.
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
| A | B | A AND B | A OR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Draw the shapes carefully: an AND gate has a straight back, an OR gate a curved back. A NOT gate needs its circle; a triangle on its own is not a NOT gate.
NAND means NOT AND and NOR means NOT OR. Work out AND or OR first, then flip every answer. The small circle at the output of the symbol is the inversion.
| A | B | A AND B | A NAND B | A OR B | A NOR B |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 0 | 1 | 0 |
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Which gate gives an output of 1 only when both of its inputs are 0?
In the lab, an XOR gate has both input switches on. What does the output show?
What does the small circle on the output of a NAND gate symbol show?
Which gate symbol has a flat back and a semicircular front, with no circle?
XOR (exclusive OR, also written EOR) is like OR, except that it gives 0 when both inputs are 1. Its symbol is the OR shape with an extra curved line behind it. Use the lab to compare OR and XOR row by row.
| A | B | A OR B | A XOR B |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 |
Learn the six output columns by heart in the order 00, 01, 10, 11: AND 0001, OR 0111, NAND 1110, NOR 1000, XOR 0110. Mixing up OR and XOR in the last row is the most common slip.
Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.
For inputs (A, B) in the order 00, 01, 10, 11, which output column belongs to a NAND gate?
A gate has two inputs. Its output is 1 when the inputs are different and 0 when they are the same. Which gate is it?
Which logic gate has only one input?
An OR gate has inputs A = 1 and B = 1. A NOR gate is given the same inputs. What are the two outputs?
This skill is now recorded on your profile. Keep the chain going.