Module 5 · Adding With Light Switches

How do you add in binary?

Lesson 5.1 · One Plus One Is Ten

Jenny · Sarah · Mark

There is no 2.

Jenny writes 1 + 1 on the cardboard and asks for the answer in binary.

Sarah says 2. Jenny says there’s no 2 in binary, only 1 and 0. Mark thinks this is a trick.

Rob says it’s exactly what happens when you add 9 + 1 in regular numbers: you run out of digits and carry.

The short answer

Column by column with four simple facts, carrying whenever two 1s meet. It’s school arithmetic with two digits instead of ten, which is exactly why switches can do it.

Try it yourself

Add these in binary. Remember, there’s no digit 2.

0 + 1 = ?

What you just did has a name

Binary addition

Binary addition works column by column, right to left, like the adding you learned in school.

Each column has only four cases: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 0 with a 1 carried to the next column. That’s it.

Four cases, and every one of them has a yes-or-no answer a gate can give.

A few more things

Same carrying you know

In regular numbers, 9 + 1 runs out of digits, so you write 0 and carry 1. In binary you run out at 1 + 1. Same move, sooner.

The carry adds a third input

Once there’s a carry coming in, a column might add three 1s. That makes 11: write 1, carry 1. Still only on and off.

Subtraction is adding in disguise

Computers usually subtract by adding a specially flipped version of the number. That way the same circuit does both.

Go deeper

The longer version, if you want it.

Why it’s easy for a machine

Adding in decimal means memorizing a hundred facts: every pair of digits from 0 + 0 to 9 + 9. Binary has four. A machine that only has to know four facts, and can check them with a couple of gates, is easy to build and very hard to get wrong.

That simplicity is another big reason computers use binary, on top of switches being easy to read as on or off. It’s that two makes every step so simple a switch can do it.

Quick check

In one column, 1 + 1 gives what?

Let’s take it slower

Think of a car’s odometer where each wheel only has 0 and 1 on it. Roll the last wheel from 0 to 1, fine. Roll it again and it flips back to 0 and kicks the next wheel up one. That kick is the carry. Binary addition is that odometer, rolling over constantly.

More examples

1

2 + 1

10 + 01. Right column: 0 + 1 = 1. Left column: 1 + 0 = 1. Answer 11, which is three.

2

3 + 3

11 + 11. Right: 1 + 1 = 0, carry 1. Left: 1 + 1 + carry = 11, so write 1, carry 1. Answer 110, which is six.

Back to the question

So how do you add in binary?

Show the answer

Column by column with four simple facts, carrying whenever two 1s meet. It’s school arithmetic with two digits instead of ten, which is exactly why switches can do it.

One last question

Sarah adds 10 + 10 in binary (that’s 2 + 2). What should she get?

Talk Card

Talk Card · 5.1

Binary addition has only four facts. The only tricky one is 1 + 1, which is 0 with a 1 carried, exactly like 9 + 1 in regular numbers.

How Computers Work · pettigrewlab.com/learn

Next lesson