Lesson 3 - Binary Addition
How do we do Math in Binary?
The logic gates we learned about in the previous lesson are the foundations for all computers. They are strung together to do very complicated things like mathematical operations and memory storage.
What is Computing?
Computing is the act of calculating a value of a specific mathematical operation.
For example, when we solve, 2+2 we are computing the value of the expression. When we punch 2+2 into our calculators, our calculators then run those values through a series of addition circuits that compute the value and return 4. Computers get their name because they do exactly this. Computers are a specialized series of circuits that allow us to do millions of computations at incredible speeds.
We will now get into the details of how these circuits work. But first, we must introduce how mathematical operations are performed in binary. Get ready to learn how to add in binary!
Addition Circuits
Adding numbers in binary is very similar to adding numbers in decimal (the number system that we usually use). We simply add together the ones and zeros.
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
When we run out of symbols for one digit place, we carry a one to the next digit place. Just like in our decimal number system!
Binary Carry Example
1 + 1 = 10
This may seem confusing at first but it is exactly what we do when we add numbers with our decimal number system. When we write out the numbers 0-9, we use one symbol to represent a numberical value. At the moment we write the number 10, we are now using two symbols to represent the value.
Decimal Carry Example
9 + 1 = 10
Binary is the same way, except that we have less symbols.
In our above decimal example, we computed the value of 9+1 and then we had to carry the 1 to a new decimal place.
In our earlier binary example. When we add 1+1 we must carry a one over to the new decimal place in a similar way.
Let’s look at some more examples to make it more clear.

Here we see that when we add larger numbers, we may need to carry values when we run out of symbols in multiple places. Lets verify this problem in decimal to show that our math is consistent. This is a technique commonly used in mathematics.
| Binary Number | Decimal Number |
|---|---|
| 010101 | 21 |
| 011001 | 25 |
| 101110 | 46 |
This table shows us that the number we computed using binary addition is the same as computing the number using decimal addition (a.k.a. regular addition).
Here is another way we can think of our addition:
010101 + 011001 = 101110 is the same as
21 + 25 = 46
We are simply using different number systems to represent our values.
The reason we care about adding in binary is that our circuits only have two states:
- 0 - Not conducting a signal.
- 1 - Conducting a signal.
It would be impossible to use circuits to compute addition in decimal, so we represent our numbers in binary to add them together using circuits.
Let’s look at a harder example before we move onto practice problems:
Notice that in this example, we sometimes carried a +1 onto a computation that was already 1 + 1. So we needed to figure out what 1 + 1 + 1 was in binary. We know that 1 + 1 = 10 so we can think of this computation as 1 + 10 which is precisely 11.
1 + 1 + 1 = 10 + 01 = 11
So we wrote a one into the current digit place, and we carried a one to the next decimal place. Now lets get into the practice problems!
Practice: Binary addition
- 1100 + 0101
- 10010010 + 01010101
- 0000001 + 1111111
- 1 + 1111111
- 1111 + 1111
- 10101010 + 10111101
Solutions
| # | Problem | Solution |
|---|---|---|
| 1 | 1100 + 0101 | 10001 |
| 2 | 10010010 + 01010101 | 11100111 |
| 3 | 0000001 + 1111111 | 10000000 |
| 4 | 1 + 1111111 | 10000000 (the 0's before the 1 don't make a difference!) |
| 5 | 1111 + 1111 | 11110 |
| 6 | 10101010 + 10111101 | 101100111 |
Critical Thinking
Set a moment aside to think critically about binary addition. Think about the logical gates you learned about in lesson 2 and ask yourself the question: What logical gates can we use to compute binary addition of two numbers?
In practice, binary addition is implemented in using XOR gates and AND gates to build Adder Circuits. There are two types of adder circuits.
Half Adder Circuits are circuits that add two bits together and return a two bit number. These circuits are strung together to create a Full Adder Circuit.
For our purposes, we only care about half adder circuits. The implementation of a full adder circuit will be a challenge activity.
Half Adder Diagram
In the above diagram, A and B are bits that are input into the circuit.
Within the circuit A and B’s paths are split into two. In the upper path, the two bits are XOR’ed together. This way, they only return 1 when we input 1+0 or 0+1. Otherwise, they return 0.
The lower path calculates the carry bit. The “carry bit” is where the next digit place is calculated. We use an AND gate to calculate the carry bit so that when we add together 1 and 1 the ones’ place (carry bit) will return 1. Otherwise the carry bit will be zero.
Activity 1: Addition in Minecraft
Create a Half Adder Circuit in Minecraft that calculates the sum of two 1-bit numbers. It should be able to do the following computations.
0 + 0 = 00
0 + 1 = 01
1 + 0 = 01
1 + 1 = 10
Activity 2: Bigger Numbers
Now try building a circuit that can add together two larger numbers. You will have to implement multiple carry circuits. How many bits can you add together in Minecraft?
Activity 3: Challenge Activity
Chain together Half Adder Circuits in order to create a Full Adder Circuit. You will need to research how full adder circuits work.
