Logic gates: computers made of switches
Explore AND, OR, NOT, XOR and NAND gates on screen, solve the mystery gate, then build real AND and OR gates with foil switches, a battery and an LED.
- Computational thinking
- Hands-on
- Critical thinking
🧰 You will need
- 1 × Battery holder for 2 × AA
- 2 × AA battery (1.5V)
- 1 × LED (5mm, any colour)
- 5 × Crocodile-clip wire
- 1 × Kitchen aluminium foil
- 2 × Metal paper clip
- 1 × Piece of thin card (cereal box)
- 1 × Sticky tape
🔌 IF, AND and OR… made from wires
In the rules lesson you wrote IF A AND B. But how does a computer chip actually do AND? It uses logic gates: tiny electronic switches that turn on or off depending on their inputs. A phone chip has billions of them. You can build the simplest ones yourself with a battery, an LED and two home-made switches.
🎮 Try it on the screen
Choose a gate and flip switches A and B. Watch the bulb and the truth table. Then try the Mystery gate: test the switches like an engineer to find out which gate is hiding.
| A | B | Out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
ON only if A AND B are both on. Like two switches in series.
🛠️ Build AND and OR gates
Make two switches: fold strips of foil over two pieces of card, or clip a paper clip to a wire so it can touch a foil pad. Pressing a switch joins the circuit; letting go breaks it.
AND gate (switches in series):
- Battery + → switch A → switch B → LED long leg. LED short leg → battery −.
- Press A only. Press B only. Press both. The LED lights only when A AND B are pressed.
OR gate (switches in parallel):
- Connect switch A and switch B side by side: both start at battery +, and both end at the LED’s long leg. LED short leg → battery −.
- Now the LED lights if A OR B (or both) is pressed.
LED doesn’t light at all? Turn it round: LEDs only work one way. Write the truth table for each circuit: 4 rows, A, B and LED.
💡 What happened?
- AND = switches in series: the electricity must pass through both, so both must be closed.
- OR = switches in parallel: the electricity can take either path.
- In a real chip, the “switches” are transistors, flipped by electricity instead of fingers, so one gate can switch the next one. Join enough gates together and you can add numbers, store memory, and run any program.
Did it work?