COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
HOME    >    GCSE    >   CAMBRIDGE EXAMINATIONS    >    BINARY ADDITION AND OVERFLOW
NEXT PAGE  > 
BINARY SHIFTS
Picture

DATA REPRESENTATION - 1.1.4 | BINARY ADDITION AND OVERFLOW

Topics from the Cambridge IGCSE (9-1) Computer Science 0984 syllabus 2023 - 2025.
OBJECTIVES
​1.1.4 (a) Add two positive 8-bit binary integers

(b) Understand the concept of overflow and why it occurs in binary addition
  • LEARN
  • TERMINOLOGY
  • QUESTIONS
  • FLASHCARDS
  • WORKBOOK
<
>
Picture

we’re going to learn about binary addition and the concept of overflow in computing. Let’s start with the basics. Part 1: Understanding Binary Addition First, what is binary? Binary is a number system that only uses two digits: 0 and 1. Computers rely on binary because these two values can represent “off” and “on” in electronic circuits. Just like we add numbers in the decimal system, we can add numbers in binary. But binary has a unique set of rules. Let’s look at how binary addition works by following some simple steps. Rule #1: When we add 0 plus 0, the result is 0. Rule #2: When we add 0 plus 1 or 1 plus 0, the result is 1. Rule #3: When we add 1 plus 1, the result is 1 0 in binary, which is like saying “2” in decimal. But here, we write down 0 and carry 1 over to the next column. Part 2: The Concept of Overflow Now that we understand binary addition, let’s talk about overflow. In computing, binary values are often stored in fixed spaces, like 8-bit registers. This means we can only store binary numbers up to 8 digits long. In an 8-bit system, the highest value we can represent is 1 1 1 1 1 1 1 1, which is 255 in decimal. But what happens if we try to add two numbers, and the result goes beyond 255? That’s where overflow comes in. For example, if you add 1 1 1 1 1 1 1 1 (which is 255) and 1, the sum is 1 0 0 0 0 0 0 0 0 in binary, which requires 9 bits. Since an 8-bit system can only store up to 1 1 1 1 1 1 1 1, the extra bit overflows because there’s no space to store it in an 8-bit register. When this overflow happens, the computer either throws an error or cuts off the extra bit, which can lead to incorrect calculations. Overflow errors are a reminder that we have a fixed limit in binary storage, and going over this limit leads to data loss or errors. So, to recap: Binary addition follows its own rules, just like addition in other number systems. When we exceed the storage limit, like with 8 bits, we get an overflow error. And that’s binary addition and overflow in a nutshell! Thanks for listening, and I hope this helps you understand these fundamental concepts in computing.

Read Aloud
■
SECTION 1 | BINARY ADDITION
It is simple to just convert a Binary representation to Denary, add the Denary values then convert back to Binary, however Binary addition is also easy if you follow the rules below:
  • Zero plus Zero = 0
  • Zero plus One = 1
  • One plus One = 0 and carry a 1
  • Three Ones = 1 plus carry a 1​
Picture
Number 1 = 11
Number 2 = 6
Answer = 18​

Starting from the right(least significant bit) of the binary
  • 1 + 1 = 0 and carry 1 (shown in red in the 2s column)
  • 1 + 1 + 1 = 1 and carry 1 (shown in red in the 4s column)
  • 1 + 1 =  0 and carry 1 (shown in red in the 8s column)
  • 1 + 1 =  0 and carry 1 (shown in red in the 16s column)
  • 1 + 0 = 1
  • Answer 1 0 0 1 0 which is 18
Additional Example with Explanation

Let’s try a slightly larger binary addition example.
Example: Add 1111 (15 in decimal) and 1001 (9 in decimal).
1: Write the numbers aligned by column:

    1111
+ 1001 

2: 
Starting from the rightmost column:
1 + 1 = 0 → Write 0 and carry 1.

3: Next column:

1 + 0 + 1 (carried) = 0 → Write 0 and carry 1.

4: Next column:

1 + 0 + 1 (carried) = 0 → Write 0 and carry 1.

5: Leftmost column:

1 + 1 + 1 (carried) = 1 → Write 1 and carry 1 to the next column.
The result is 11000.

Why Binary Addition is Important
​Binary addition is fundamental in computer systems because it’s the basis for arithmetic operations in digital circuits. Understanding binary addition helps you grasp how computers process data at the most basic level.
CHECK YOUR KNOWLEDGE

What is the result of adding the binary numbers 1011 and 1101?

A) 10010
B) 11100
C) 10100
D) 11000
EXPLAINATION
​Binary Addition Question
​When adding the binary numbers 1011 (which is 11 in decimal) and 1101 (13 in decimal), the result is 10010 in binary. Here’s a breakdown of the addition:
  1. Start from the rightmost bit:
    • 1 + 1 equals 10 in binary, so we write 0 and carry over 1.
  2. Moving to the next column:
    • 0 + 1 + 1 (including the carry) equals 10 again, so we write 0 and carry over another 1.
  3. Next column:
    • 1 + 0 + 1 (including the carry) equals 10, so again we write 0 and carry over 1.
  4. Leftmost column:
    • 1 + 1 equals 10, so we write 0 and carry over 1 to the next column.
  5. The final result, with the extra 1 in the next column, is 10010.
So, 1011 + 1101 in binary is 10010.

SECTION 2 | OVERFLOW

Overflow in binary addition occurs when the result of adding two binary numbers exceeds the maximum value that can be represented by the number of bits allocated for the calculation. When this happens, the result cannot be represented accurately within the available bits, and the most significant bit (MSB) of the result is lost or "overflows" beyond the maximum value that can be represented.

To understand this concept, consider adding two 8-bit binary numbers, 11111111 and 00000001. The sum of these two numbers is 1,00000000, but since only 8 bits are allocated for the result, the most significant bit of the sum is lost, resulting in a final answer of 00000000. In this case, overflow has occurred because the sum of the two numbers exceeds the maximum value that can be represented by 8 bits.

Overflow can have serious consequences in computer systems and can lead to incorrect results or unexpected behavior. To avoid overflow, it is important to ensure that the number of bits allocated for binary calculations is sufficient to represent the expected range of values accurately. If overflow does occur, appropriate error handling mechanisms should be in place to alert the user or take corrective action.

What happens when adding two 8-bit binary numbers results in a value greater than 255?

A) The result is stored as-is in the 8-bit register.
B) The extra bits are ignored, and only the first 8 bits are stored.
C) An overflow error occurs because the result exceeds the 8-bit limit.
D) The result is automatically converted to hexadecimal format.
EXPLANATION
Overflow Question
In an 8-bit binary system, the largest number that can be represented is 11111111, which is 255 in decimal. When you add two 8-bit numbers and the result exceeds this limit, an overflow error occurs because there isn’t enough space to store the additional bits.
​
For example, if you add 11111111 (255) and 1, the result is 100000000 in binary, which requires 9 bits. Since an 8-bit system can only store up to 11111111, the extra bit overflows and cannot be stored in the register. This overflow condition signals an error, as the 8-bit limit is exceeded.
.
Binary | A base-2 number system used in computing, consisting of only two digits: 0 and 1. It’s the fundamental language of computers.
Bit | The smallest unit of data in computing, represented as either 0 or 1. Bits are the building blocks of binary numbers.
Binary Addition | The process of adding binary numbers. Follows specific rules, such as 1 + 1 = 10 in binary, where the result is 0 and a carry of 1.
Carry | In binary addition, a carry occurs when two 1s are added together. The result is 0 in the current place value, with 1 carried over to the next higher place.
8-bit Register | A fixed storage space in a computer’s memory that holds 8 bits, allowing binary numbers up to 8 digits long.
Overflow | An error that occurs when the result of a binary addition exceeds the storage limit of a register. In an 8-bit register, overflow happens if the sum exceeds 255.
Decimal | A base-10 number system commonly used in everyday life. It includes the digits 0–9 and serves as a familiar reference point when learning binary.
Base | The foundation of a number system that indicates how many unique digits are used. Binary is base-2, decimal is base-10, and hexadecimal is base-16.
Register | A small, fast storage location within a computer’s CPU used to store binary data temporarily.
Place Value | In binary, each position represents a power of 2, with the rightmost place being 2^0, the next being 2^1, and so on.
Overflow Error | A specific type of error caused when an arithmetic operation results in a value too large to be represented within the available number of bits.
Carry Bit | A bit that is carried to the next column in binary addition, similar to carrying over in decimal addition.
Bit Limit |The maximum number of bits that can be used in a particular operation or storage, such as an 8-bit limit in many systems.
Picture
Use a pen and paper and for each of the questions below work out the correct answer and show your working out.
1: What is the result of adding the binary numbers 11010110 and 00101111?

A) 100100100
B) 11100101
C) 11111111
D) 01000000

2: What is the result of adding the binary numbers 10011101 and 01100110?
A) 11000011
B) 00001111
C) 11111111
D) 01011011

3: What is the result of adding the binary numbers 10101010 and 01010101?
A) 11111111
B) 00000000
C) 11111110
D) 11111101

4: What is the result of adding the binary numbers 11001100 and 10101010?
A) 01100110
B) 11111111
C) 11010110
D) 10010100

5: What is the result of adding the binary numbers 1111000011100001 and 0110101001101011?
A) 10101011010011000
B) 11011110101110110
C) 10001101010001010
D) 10100100111011011
Picture
1: What is overflow in binary addition?
A) A type of error that occurs when two binary numbers are subtracted
B) A condition where the result of adding two binary numbers exceeds the maximum value that can be represented by the number of bits allocated for the calculation
C) A method of compressing digital images
D) A type of sorting algorithm

2: Which of the following can cause overflow in binary addition?
A) Adding two negative binary numbers
B) Adding two positive binary numbers
C) Subtracting two binary numbers
D) Multiplying two binary numbers

3: What happens when overflow occurs in binary addition?
A) The result is rounded up to the nearest binary number
B) The result is rounded down to the nearest binary number
C) The most significant bit of the result is lost or "overflows" beyond the maximum value that can be represented
D) The result is calculated using a different method

4: How can overflow in binary addition be mitigated?
A) By using a larger number of bits for the calculation
B) By only adding binary numbers with the same sign
C) By using a different binary arithmetic operation, such as subtraction or multiplication
D) By rounding the result up to the nearest binary number

5: Which of the following is a consequence of overflow in binary addition?
A) The result is always accurate
B) The result is incorrect and may cause unexpected behavior in a computer system
C) The result is always rounded up to the nearest binary number
D) The result is always rounded down to the nearest binary number
Picture
NEXT PAGE | BINARY SHIFTS
1.1 NUMBER SYSTEMS
   
☑ 1.1.1 WHY COMPUTERS USE BINARY
    ☑ 1.1.2 BINARY, HEX AND CONVERTIG BETWEEN NUMBER SYSTEMS
    ☑ 1.1.3 BENEFITS OF HEX
    ➩ 1.1.4 BINARY ADDITION AND OVERFLOW
    ☐ 1.1.5 BINARY SHIFTS
    ☐ 1.1.6 NEGATIVE NUMBER REPRESENTATION, TWO'S COMPLEMENT
1.2 COLOUR AND SOUND

    ☐ 1.2.1 HOW COMPUTERS REPRESENT TEX
    ☐ 1.2.2 HOW COMPUTERS REPRESENT SOUND
    ☐ 1.2.3 HOW COMPUTERS REPRESENT IMAGES
1.3 FILE SIZE AND COMPRESSION

    ☐ 1.3.1 HOW STORAGE IS MEASURED
    
☐ ​1.3.2 CALCULATING IMAGE AND SOUND FILE SIZE
   
☐ ​1.3.3 PURPOSE OF COMPRESSION
   
☐ ​1.3.4 LOSSY AND LOSSLESS COMPRESSION
 EXTRAS

    ☐ END OF TOPIC REVIEW | COMING SOON
    
☐ TOPIC 1 KEY TERMINOLOGY
    
☐ REVISION FLIP CARDS
    
☐ TOPIC 1 ANSWERS
    
☐ TOPIC 1 TEACHER RESOURCES (CIE)
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.