Adding in Binary
You already know how to add numbers in denary (base 10). You start from the rightmost column and work your way left, carrying over when a column adds up to 10 or more. Binary addition works in exactly the same way — but because binary only has two digits (0 and 1), you carry whenever a column adds up to 2 or more.
Think of it this way: in denary, when you add 7 + 5, you get 12. You write down the 2 and carry the 1. In binary, when you add 1 + 1, you get 10 (which is “two” in binary). You write down the 0 and carry the 1. That is the entire foundation of binary addition.
Here are the five rules you need to memorise:
| Addition | Result | What You Write | What You Carry |
|---|---|---|---|
| 0 + 0 | 0 | 0 | Nothing |
| 0 + 1 | 1 | 1 | Nothing |
| 1 + 0 | 1 | 1 | Nothing |
| 1 + 1 | 10 | 0 | 1 |
| 1 + 1 + 1 | 11 | 1 | 1 |
The last two rules are the ones students most often forget. Let us break them down:
- 1 + 1 = 10: One plus one equals two. In binary, two is written as 10. So you write 0 in the current column and carry 1 to the next column on the left.
- 1 + 1 + 1 = 11: This happens when you have two 1s in a column plus a carry from the previous column. One plus one plus one equals three. In binary, three is written as 11. So you write 1 in the current column and carry 1 to the next column.
Worked Examples
Let us work through three examples step by step. For each one, we add from right to left, just like denary addition, and we always show the carry row above.
Example 1: 01101011 + 00110101
First, let us confirm the denary values: 01101011 = 64 + 32 + 8 + 2 + 1 = 107, and 00110101 = 32 + 16 + 4 + 1 = 53. We expect the answer to be 107 + 53 = 160.
Carry: 1 1 1 1 1 1
0 1 1 0 1 0 1 1 (107)
+ 0 0 1 1 0 1 0 1 ( 53)
-----------------
1 0 1 0 0 0 0 0 (160)
Column-by-column working (right to left):
- Column 1 (ones): 1 + 1 = 10. Write 0, carry 1.
- Column 2 (twos): 1 + 0 + carry 1 = 10. Write 0, carry 1.
- Column 3 (fours): 0 + 1 + carry 1 = 10. Write 0, carry 1.
- Column 4 (eights): 1 + 0 + carry 1 = 10. Write 0, carry 1.
- Column 5 (sixteens): 0 + 1 + carry 1 = 10. Write 0, carry 1.
- Column 6 (thirty-twos): 1 + 1 + carry 1 = 11. Write 1, carry 1. Wait — actually 1 + 1 = 10, plus carry 1 = 11. So we write 1 and carry 1.
- Column 7 (sixty-fours): 1 + 0 + carry 1 = 10. Write 0, carry 1.
- Column 8 (one-twenty-eights): 0 + 0 + carry 1 = 1. Write 1. No carry.
Result: 10100000. Check: 128 + 32 = 160. Correct!
Example 2: 00101100 + 01001110
Denary check: 00101100 = 32 + 8 + 4 = 44, and 01001110 = 64 + 8 + 4 + 2 = 78. Expected answer: 44 + 78 = 122.
Carry: 1 1 1
0 0 1 0 1 1 0 0 ( 44)
+ 0 1 0 0 1 1 1 0 ( 78)
-----------------
0 1 1 1 1 0 1 0 (122)
Column-by-column working (right to left):
- Column 1: 0 + 0 = 0. Write 0.
- Column 2: 0 + 1 = 1. Write 1.
- Column 3: 1 + 1 = 10. Write 0, carry 1.
- Column 4: 0 + 0 + carry 1 = 1. Write 1.
- Column 5: 1 + 1 = 10. Write 0 — wait, let us be careful. Actually column 5 is the 16s column: 1 + 0 = 1. Write 1. No carry.
Let us redo this more carefully:
- Column 1 (1s): 0 + 0 = 0. Write 0.
- Column 2 (2s): 0 + 1 = 1. Write 1.
- Column 3 (4s): 1 + 1 = 10. Write 0, carry 1.
- Column 4 (8s): 1 + 1 + carry 1 = 11. Write 1, carry 1.
- Column 5 (16s): 0 + 0 + carry 1 = 1. Write 1.
- Column 6 (32s): 1 + 0 = 1. Write 1.
- Column 7 (64s): 0 + 1 = 1. Write 1.
- Column 8 (128s): 0 + 0 = 0. Write 0.
Result: 01111010. Check: 64 + 32 + 16 + 8 + 2 = 122. Correct!
Example 3: 11001000 + 01100101 (Overflow!)
Denary check: 11001000 = 128 + 64 + 8 = 200, and 01100101 = 64 + 32 + 4 + 1 = 101. Expected answer: 200 + 101 = 301.
But wait — the maximum value an 8-bit unsigned binary number can hold is 11111111 = 255. The number 301 is bigger than 255, so it cannot fit in 8 bits. Let us see what happens:
Carry: 1 1 1
1 1 0 0 1 0 0 0 (200)
+ 0 1 1 0 0 1 0 1 (101)
-----------------
1 0 0 1 0 1 1 0 1 (301 — needs 9 bits!)
But we only have 8 bits, so the 9th bit is LOST:
0 0 1 0 1 1 0 1 = 45 (WRONG!)
This is an OVERFLOW ERROR.
The true answer is 100101101 in binary, which is a 9-bit number. Since our system only has 8 bits, the leftmost bit (the 1 in the 256s column) is discarded. The computer stores 00101101, which equals just 45 — a completely incorrect answer. This is called an overflow error.
Overflow Errors
An overflow error occurs when the result of a calculation is too large to be stored in the number of bits available. It is one of the most important concepts in binary arithmetic, and exam boards love to test it.
Why Does Overflow Happen?
Every computer system allocates a fixed number of bits to store each number. With 8 bits (one byte), the largest unsigned integer you can represent is:
1 1 1 1 1 1 1 1
128+64+32+16+8+4+2+1 = 255
Maximum value with n bits = 2^n - 1
For 8 bits: 2^8 - 1 = 256 - 1 = 255
If a binary addition produces a result greater than 255 (for 8-bit), the answer requires a 9th bit. But there is no 9th bit available — so that extra bit is simply lost. The remaining 8 bits give an incorrect, smaller number.
How to Spot Overflow
You can detect overflow in two ways:
- The denary check: Convert both numbers to denary. If their sum exceeds 255 (for 8-bit), there will be overflow.
- The carry-out check: If there is a carry out of the most significant bit (the leftmost column) — meaning a 9th bit is generated — overflow has occurred.
What Happens When Overflow Occurs?
- The 9th bit (the carry out of the MSB) is discarded
- The stored answer is incorrect — it “wraps around” to a small number
- The computer may raise an overflow flag or error, but some languages silently ignore it
- This can lead to serious, dangerous bugs in software
Real-World Consequences of Overflow
Ariane 5 Rocket (1996): The European Space Agency’s Ariane 5 rocket exploded just 37 seconds after launch. The cause? A 64-bit floating-point number (representing horizontal velocity) was converted to a 16-bit signed integer. The velocity value was too large for 16 bits, causing an overflow error. The guidance system received garbage data, the rocket veered off course, and the self-destruct mechanism was triggered. The rocket and its four satellites — worth over $370 million — were destroyed.
Boeing 787 Dreamliner (2015): The US Federal Aviation Administration issued a safety directive after discovering that a counter in the Boeing 787’s generator control units would overflow after exactly 248 days (231 hundredths of a second) of continuous operation. If all four generators were powered on simultaneously and left running for 248 days, the overflow could cause them to shut down simultaneously, resulting in a total loss of electrical power mid-flight. The fix was simple: restart the generators before the counter overflowed.
Interactive Exercise 1: Binary Addition Practice
Add the two 8-bit binary numbers below. Type your answer as an 8-bit binary number (e.g. 01100100).
Interactive Exercise 2: Overflow Detector
Add the two 8-bit binary numbers below. Enter the 8-bit result and decide whether an overflow error occurs.
Does overflow occur?
Test Yourself
Click on each question to reveal the answer. Try to work it out on paper first — remember to show your carry row!
Answer:
Carry: 1 1 1 1 1
0 0 0 1 1 0 1 0 ( 26)
+ 0 0 0 0 1 1 1 1 ( 15)
-----------------
0 0 1 0 1 0 0 1 ( 41)
26 + 15 = 41. The result 00101001 = 32 + 8 + 1 = 41. Correct, no overflow.
Answer:
Carry:
0 1 0 1 0 1 0 1 ( 85)
+ 0 0 1 0 1 0 1 0 ( 42)
-----------------
0 1 1 1 1 1 1 1 (127)
85 + 42 = 127. Result: 01111111 = 127. No overflow (127 ≤ 255). Notice that no carries were needed at all — no column had two 1s!
Answer:
Carry: 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 (255)
+ 0 0 0 0 0 0 0 1 ( 1)
-----------------
1 0 0 0 0 0 0 0 0 (256 — needs 9 bits!)
255 + 1 = 256. This exceeds 255, so an overflow error occurs. The 9th bit is lost, leaving 00000000 = 0. The answer wraps around from the maximum value back to zero!
Answer:
Carry: 1 1 1 1 1 1
1 0 1 1 0 1 0 0 (180)
+ 0 1 0 0 1 0 1 1 ( 75)
-----------------
1 1 1 1 1 1 1 1 (255)
180 + 75 = 255. Result: 11111111 = 255. No overflow! This is the largest possible 8-bit value. One more and it would overflow.
Answer: 200 + 200 = 400. Since 400 > 255, an overflow error occurs. In binary: 200 = 11001000, and 200 + 200 = 110010000 (9 bits). The 9th bit is lost, leaving 10010000 = 144. So the computer stores 144 instead of the correct answer of 400. Alternatively: 400 − 256 = 144 (the value “wraps around”).
Answer:
- Denary check: Convert both numbers to denary and add them. If the sum exceeds 255, overflow has occurred.
- Carry-out check: Perform the binary addition. If a carry is generated out of the most significant bit (i.e., a 9th bit is produced), overflow has occurred.
Both methods are equally valid in an exam. The denary check is often quicker if you are already comfortable converting.
Answer: The Ariane 5 rocket exploded in 1996 because a 64-bit floating-point number (representing horizontal velocity) was converted to a 16-bit signed integer. The velocity value was too large for 16 bits, causing an overflow error. This fed incorrect data to the guidance system, causing the rocket to veer off course and self-destruct. The accident destroyed over $370 million worth of equipment. This shows that overflow errors are not just theoretical exam questions — they can have catastrophic real-world consequences. Programmers must always consider the range of values their variables might hold and choose data types with enough bits to store them safely.
Key Vocabulary
Make sure you know all of these terms for your exam:
| Term | Definition |
|---|---|
| Binary Addition | The process of adding two binary numbers together column by column, from right to left, following the rules of base-2 arithmetic (where 1 + 1 = 10). |
| Carry | A digit that is transferred to the next column on the left when the sum of a column equals or exceeds the base value. In binary, a carry of 1 occurs whenever a column totals 2 or 3. |
| Overflow Error | An error that occurs when the result of a calculation is too large to be represented in the available number of bits. The extra bit(s) are lost, producing an incorrect result. |
| Most Significant Bit (MSB) | The leftmost bit in a binary number. It has the highest place value (e.g. 128 in an 8-bit number). A carry out of the MSB indicates overflow in unsigned addition. |
| Least Significant Bit (LSB) | The rightmost bit in a binary number. It has the lowest place value (1). Binary addition always starts from the LSB and works leftward. |
Exam Tips
Past Paper Questions
Try these exam-style questions, then click to reveal the mark scheme answer.
Calculate the result of adding the two 8-bit binary numbers: 00101101 + 01001011. Show your working. [2] marks
Mark scheme:
- Correct working showing carry bits (1)
- Answer: 01111000 (1)
Explain what is meant by an overflow error in binary addition. [2] marks
Mark scheme:
- An overflow error occurs when the result of a calculation is too large to be stored/represented (1)
- in the available number of bits / e.g. adding two 8-bit numbers produces a 9-bit result (1)
Add the binary numbers 11011010 and 01101001. State whether an overflow error has occurred. [3] marks
Mark scheme:
- Correct working (1)
- Result: 01000011 with a carry out (1)
- Overflow has occurred because the result requires more than 8 bits / the carry bit is lost (1)
Why Binary Addition Matters
Binary addition is not just an exam topic — it is the most fundamental operation that every computer performs. Every single calculation your computer, phone, or games console carries out is ultimately built on binary addition.
- Subtraction is performed using addition (by adding the two’s complement of a number).
- Multiplication is performed using repeated addition and binary shifts.
- Division is performed using repeated subtraction (which is itself addition).
Inside the CPU, the component that performs binary addition is called the Arithmetic Logic Unit (ALU). It contains millions of logic gates wired together to add binary numbers at incredible speed — billions of additions per second. Understanding binary addition gives you insight into how computers actually think at the lowest level.
And overflow errors? They are not ancient history. They still cause real bugs today in games (integer overflow exploits), financial systems (incorrect calculations), and embedded systems (sensor data errors). Understanding overflow means you can write safer, more robust software.
Video Resources
Further Reading
- 101 Computing — Binary Additions — Interactive practice with binary addition, including step-by-step animations
- BBC Bitesize — Edexcel GCSE Computer Science — Comprehensive coverage of binary arithmetic with exam-style questions
- GCSE Topic 2: Data Representation — Full specification coverage including binary addition and overflow