Further binary addition
We are going to add some more binary numbers together. As before, we will use bytes for our numbers and display the answer as a byte. Remember:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10 (two in denary)
1 + 1 + 1 = 11 (three in denary)
1 + 1 + 1 + 1 = 100 (four in denary)
1 + 1 + 1 + 1 + 1 = 101 (five in denary)
Example 1
Add 15 + 7 + 7 using binary.
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Denary |
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 15 |
0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 7 |
0 | 0 | 0 | 01 | 01,1 | 10 | 11 | 1 | 7 |
0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 29 |
We always start on the right hand side of the numbers, with the units.
In the 1s column, 1 + 1 + 1 = 11 so we write down 1 and carry 1 into the next column.
In the 2s column, 1 + 1 + 1 + 1 = 100 - what do we do here? We, write down a 0 in the 2s column, we carry a 0 to the 4s column, and we carry a 1 to the 8s column.
In the 4s column, 1 + 1 + 1 + 0 = 11 so we write down 1 and carry 1 into the next column.
In the 8s column, 1 + 0 + 0 + 1 + 1 = 11 so we write down 1 and carry 1 into the next column.
In the 16s column, 0 + 0 + 0 + 1 = 1 so we write down 1.
The 32, 64 and 128 columns are all 0.
Our final answer is 0001 1101
It's always a good idea to check your answer. 0001 1101 = (0 * 128) + (0 * 64) + (0 * 32) + (1 * 16) + (1 * 8) + (1 * 4) + (0 * 2) + (1 * 1)
= 16 + 8 + 4 + 1 = 29, which is the correct answer.
Example 2
Add 15 + 15 + 15 using binary.
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Denary |
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 15 |
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 15 |
0 | 0 | 01 | 00 | 11,1 | 10 | 11 | 1 | 15 |
0 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 45 |
We always start on the right hand side of the numbers, with the units.
In the 1s column, 1 + 1 + 1 = 11 so we write down 1 and carry 1 into the next column.
In the 2s column, 1 + 1 + 1 + 1 = 100 so we write down a 0 in the 2s column, we carry a 0 to the 4s column, and we carry a 1 to the 8s column.
In the 4s column, 1 + 1 + 1 + 0 = 11 so we write down 1 and carry 1 into the next column.
In the 8s column, 1 + 1 + 1 + 1 + 1 = 101 so we write down 1 and carry 0 into the 16s column and carry a 1 into the 32s column.
In the 16s column, 0 + 0 + 0 + 0 = 0 so we write down 0.
In the 32s column, 0 + 0 + 0 + 1 = 1 so we write down 1.
The 64 and 128 columns are both 0.
Our final answer is 0010 1101
It's always a good idea to check your answer. 0010 1101 = (0 * 128) + (0 * 64) + (1 * 32) + (0 * 16) + (1 * 8) + (1 * 4) + (0 * 2) + (1 * 1)
= 32 + 8 + 4 + 1 = 45, which is the correct answer.
Example 3
Add 7 + 7 + 15 + 3 + 5 using binary.
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Denary |
0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 7 |
0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 7 |
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 15 |
0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 3 |
0 | 0 | 01 | 01, 1 | 01, 0 | 11, 0 | 00 | 1 | 5 |
0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 37 |
We always start on the right hand side of the numbers, with the units.
In the 1s column, 1 + 1 + 1 +1 + 1 = 101 so we write down a 1 in the 1s column, we carry a 0 to the 2s column, and we carry a 1 to the 4s column.
In the 2s column, 1 + 1 + 1 + 1 + 0 + 0 = 100 so we write down a 0 in the 2s column, we carry a 0 to the 4s column, and we carry a 1 to the 8s column.
In the 4s column, 1 + 1 + 1 + 0 + 1 + 1 + 0 = 101 so we write down a 1 in the 4s column, we carry a 0 to the 8s column, and we carry a 1 to the 16s column.
In the 8s column, 0 + 0 + 1 + 0 + 0 + 1 + 0 = 10 so we write down 0 and carry 1 into the 16s column.
In the 16s column, 0 + 0 + 0 + 0 + 0 + 1 + 1 = 10 so we write down 0 and carry 1 into the 32s column.
In the 32s column, 0 + 0 + 0 + 0 + 0 + 1 = 1 so we write down 1.
The 64 and 128 columns are both 0.
Our final answer is 0010 0101
It's always a good idea to check your answer. 0010 1101 = (0 * 128) + (0 * 64) + (1 * 32) + (0 * 16) + (0 * 8) + (1 * 4) + (0 * 2) + (1 * 1)
= 32 + 4 + 1 = 37, which is the correct answer.
In the following questions, convert the numbers into binary and then add them up in binary. Lay out your work in exactly the same way as above. When you have got your answer, don't forget to check it!
Q1. 3 + 3 + 3
Q2. 7 + 3 + 2
Q3. 5 + 13 + 4
Q4. 9 + 8 + 24
Q5. 15 + 15 + 7
Q6. 5 + 5 + 5 + 5
Q7. 13 + 5 + 15 + 7
Q8. 7 + 7 + 7 + 7 + 7
Q9. 31 + 15 + 31 + 15 + 7
Q10. 127 + 63 + 31 + 15 + 7
Extension task
Set problems for your neighbour. See if they can do them. Think carefully about the numbers you select and you will be able to make the additions harder!