Français

Blog · · The Wire & Gate team

Logic gates explained to a 10-year-old

A computer can only do one thing: switch on or switch off. Yet with three little rules, AND, OR and NOT, it ends up doing sums, running games and showing pictures. Here is how to explain it to a 10-year-old, with a lamp and two switches.

The animated circuit from our home page: when A and B are both 1, the AND gate lights the lamp.

First, 0 and 1

Start with a lamp. It has two states and no more: off or on. Engineers write 0 for off and 1 for on. A switch works the same way: 0 when it is down, 1 when it is up. Everything that happens inside a computer, a games console or a phone comes down to vast numbers of tiny “0 or 1” signals changing very quickly.

A logic gate is a very small machine that takes in 0s and 1s and gives back a 0 or a 1, following one rule. That is all. It does not think and it never makes a mistake: it applies its rule, always the same one. For a child, you can describe it as a very obedient guard who knows only one instruction.

The AND gate: you need both

The first rule is AND. The lamp comes on only if the first switch AND the second switch are up. One is not enough. An example from home: “you can go out to play if you have finished your homework AND tidied your room”. Homework done, room in a mess: no going out. Room tidy, homework not done: no going out either. You need both.

You can write every possibility in a small table. With two switches there are only four: 0 and 0, 0 and 1, 1 and 0, 1 and 1. For the AND gate, only one row lights the lamp: the last one. This table is called a truth table, and children enjoy filling it in once they realise that it makes it impossible to forget a case.

The OR gate: one is enough

Second rule: OR. The lamp comes on as soon as at least one switch is up. A doorbell with two buttons, one at the front and one at the back, works like this: whichever button you press, it rings. And if two people press at the same time, it rings too.

This is where children, and plenty of adults, go wrong. In everyday speech, “cheese or pudding” often means “one or the other, not both”. The OR gate accepts both. In its table, three rows out of four light the lamp: only the 0 and 0 row leaves it off. The “one or the other, but not both” rule exists too: it is another gate, XOR, best kept for later.

The NOT gate: the opposite

Third rule, and the simplest: NOT. It has a single input and does the opposite. Give it 1 and it gives back 0; give it 0 and it gives back 1. A night light that comes on when it is NOT daytime is the idea. Children get it straight away, and it is often their favourite gate: it looks as if it is being disobedient.

And that makes a computer?

Yes, by connecting gates one after another: the output of one gate becomes the input of the next. With a few gates you can already build a voting machine: three judges, and the decision passes if at least two say yes. With a few more, you can add two numbers written in 0s and 1s. A computer chip is the same idea repeated billions of times, with gates made of tiny transistors.

There is no need to say everything on day one. What matters is that the child feels the machine is not magic: it follows rules they can understand, and even predict.

Let them play rather than listen

The best approach is still to let the child try. On our site, the AND gate and OR gate pages each come with a small circuit to play: tap a box to place a gate, flip the switches, and the lamp lights up when every row of the table turns green. Each page ends with four questions with instant feedback, and the score stays on the device. There is no account to create and no advertising.

The 10 free circuits on our home page start with exactly these three gates: AND, then OR, then NOT. For a 10-year-old, we suggest sitting next to them for the first few minutes and asking, before each flip of a switch, what they think will happen.

More from the blog

All articles