Binary Math for Beginners

In everyday life, we are used to the decimal system — we have ten digits from 0 to 9. If we add 5 and 6, we get 11: there is no longer room for a single-digit answer, so we carry the one to the next place (the tens).

The computer does exactly the same thing, but it only has two digits: 0 and 1. Addition in binary looks very simple: 0 + 0 = 0, 1 + 0 = 1. But 1 + 1 equals 2, and the computer has no digit "2"! So a place overflow occurs: two is written as 10 — a 0 goes into the current place and the one carries over to the next, just like we carry tens in column addition.

Understanding this simple overflow principle is the key to teaching silicon chips to truly count. If you want to refresh how numbers are built from individual ones and zeros, take a look at the article "0 and 1: Machine Language".

Place values

Every position in a binary number has its own weight — a power of two. For an 8-bit number, the weights look like this:

Place76543210
Power2⁷2⁶2⁵2⁴2⁰
Weight1286432168421

A number is the sum of the weights of the places where the bit is 1. For example, 113 is 64 + 32 + 16 + 1, so in binary it is written as 01110001. And 29 is 16 + 8 + 4 + 1, that is 00011101.

How to count in binary

Addition starts from the least significant, rightmost place. The only rule to remember: 1 + 1 = 0 and a carry of one to the next place. Binary "10" is decimal two, so it works out to "write 0, carry 1".

Let's take a simple example — add 3 and 5. Three is 0011, five is 0101:

  0011
+ 0101
------
  1000

We add bit by bit from right to left: 1 + 1 = 0 carry 1; 1 + 0 + 1 (carry) = 0 carry 1; 0 + 1 + 1 (carry) = 0 carry 1; 0 + 0 + 1 (carry) = 1. We get 1000 — that's 8.

A cascade of adders in a processor works the same way: each bit is added separately, and the carry passes to the left neighbor. Which gates build this "column"? The article "Anatomy of an Adder" explains it.

weight 8 weight 4 weight 2 weight 1 1 A 1 0 1 0 B + 0 0 1 1 1 1 0 1
Column addition works in any number system: 1010 + 0011 = 1101 (10 + 3 = 13); carries go into the next place

Bigger example: 113 + 29

Now a more serious pair: 113 (01110001) and 29 (00011101). Let's add them in a column and write out every column — the input bits, the incoming carry, and the result:

PlaceABIncoming carrySumCarry out
011001
100110
201010
310010
411001
510101
610101
700110

Now gather the sum from top to bottom: 10001110. Convert it back to decimal: 128 + 8 + 4 + 2 = 142. It checks out!

Notice the carry chain: it ripples from the least significant place toward the most significant one, like a wave — from bit 0 into bit 1, then onward from bit 4 to bit 7. That is exactly how a real cascade of adders counts.

Overflow

The maximum 8-bit number is 255, when all places are filled with ones. What happens if the result doesn't fit? For example, 200 + 100 = 300, which is more than 255. The most significant carry goes "over the edge", beyond the eighth place — and eight bits are no longer enough. That is overflow.

Processors track overflow separately: on the topmost adder, a carry "over the edge" signals that the result is too large for the bus. In the game, level 1.8 checks your 8-bit adder ADDER8 exactly this way.

Common mistakes

1. Adding from left to right. Addition always starts from the least significant, rightmost place — as in school column addition.

2. Forgetting the carry. 1 + 1 = 0, but the one always moves to the next place; without it the sum will be too small.

3. Confusing place weights. The most significant place of an 8-bit number weighs 128, not 256. 256 is the weight of a ninth place, which eight bits simply don't have.

Practice converting numbers in the number base converter — binary, decimal and hexadecimal, both ways.

Test yourself

What is 101 + 10 in binary?

111 — that is 7 in decimal (5 + 2 = 7). Each place adds up separately: 1+0=1, 0+1=1, 1+0=1 — no carries were needed.

What does the digit 1 mean in a place with weight 4?

That the four is included: a 1 in this place adds 4 to the value of the whole number.

Why does 1 + 1 equal 10 in binary?

Because a single place can hold only one unit: two overflow it, so we write 0 and carry 1 into the next place.

Summary

1. Binary has only two digits — 0 and 1 — and a place overflow becomes a carry into the next place.

2. Each place has a weight, a power of two: for 8 bits these are 128, 64, 32, 16, 8, 4, 2, 1.

3. A number is the sum of the weights of its one bits: 113 = 01110001, 29 = 00011101.

4. Addition goes from right to left, and 1 + 1 gives 0 plus a carry of 1: 3 + 5 = 0011 + 0101 = 1000 = 8.

5. The carry ripples through the places like a wave: 113 + 29 = 142 = 10001110.

6. Overflow is when the result doesn't fit into 8 bits — that is, 256 or more.

In levels 1.6–1.8 you will go from the half adder (1.6) through the full adder (1.7) to the 8-bit adder ADDER8 (1.8) — and for the first time in the game you will build a circuit that does column addition on its own, following the rules from this article.

Try it in the simulator →