Kramizo
Log inSign up free
HomeCIE IGCSE Computer ScienceData representation: binary arithmetic including addition and overflow
CIE · IGCSE · Computer Science · Revision Notes

Data representation: binary arithmetic including addition and overflow

2,064 words · Last updated May 2026

Ready to practise? Test yourself on Data representation: binary arithmetic including addition and overflow with instantly-marked questions.
Practice now →

What you'll learn

Binary arithmetic forms a fundamental part of how computers process and store numerical data. This revision guide covers binary addition and overflow detection, both essential topics in the CIE IGCSE Computer Science specification. You'll learn to perform binary addition accurately, recognize when overflow occurs, and understand why this matters in real computing systems.

Key terms and definitions

Binary — A base-2 number system using only two digits (0 and 1) to represent all values, directly corresponding to the on/off states of electronic circuits in computers.

Bit — A single binary digit, the smallest unit of data in computing, which can hold either a 0 or 1.

Byte — A group of 8 bits, commonly used as the basic addressable unit of memory in computer systems.

Overflow — An error condition that occurs when an arithmetic operation produces a result too large to be stored in the allocated number of bits.

Carry — A digit that must be transferred to the next column to the left during addition when the sum in the current column exceeds the base value.

Most Significant Bit (MSB) — The leftmost bit in a binary number, representing the largest place value in the number.

Least Significant Bit (LSB) — The rightmost bit in a binary number, representing the smallest place value (the ones column).

Register — A small, fast storage location within the CPU used to hold data temporarily during arithmetic and logical operations.

Core concepts

Binary number system fundamentals

The binary number system works identically to the decimal system you're familiar with, but uses powers of 2 instead of powers of 10. Each position in a binary number represents an increasing power of 2, starting from 2⁰ on the right.

Place values in an 8-bit binary number:

2⁷ 2⁶ 2⁵ 2⁴ 2⁰
128 64 32 16 8 4 2 1

For example, the binary number 10110101 converts to decimal as:

  • (1×128) + (0×64) + (1×32) + (1×16) + (0×8) + (1×4) + (0×2) + (1×1) = 181

Understanding place values is crucial because binary addition follows the same column-based approach as decimal addition, with each column representing a specific power of 2.

Binary addition rules

Binary addition follows four simple rules based on adding pairs of bits:

  1. 0 + 0 = 0 (no carry)
  2. 0 + 1 = 1 (no carry)
  3. 1 + 0 = 1 (no carry)
  4. 1 + 1 = 10 (write 0, carry 1)

When three bits need adding in a column (two original bits plus a carry from the previous column):

  1. 1 + 1 + 1 = 11 (write 1, carry 1)

The process mirrors decimal addition: work from right to left, adding each column and carrying values to the next column when necessary.

Example: Adding two 4-bit numbers

    1 1 1     (carries)
    1 0 1 1   (11 in decimal)
  + 0 1 1 0   (6 in decimal)
  ---------
  1 0 0 0 1   (17 in decimal)

Step-by-step breakdown:

  1. Rightmost column (LSB): 1 + 0 = 1, no carry
  2. Second column: 1 + 1 = 0, carry 1
  3. Third column: 0 + 1 + 1 (carry) = 0, carry 1
  4. Leftmost column (MSB): 1 + 0 + 1 (carry) = 0, carry 1
  5. New column: carry 1 becomes the MSB

Always ensure you show your working in exams, particularly any carry digits above the calculation.

Fixed-bit representation and its limitations

In real computer systems, numbers are stored using a fixed number of bits determined by the register size or memory allocation. Common sizes include 4-bit, 8-bit, 16-bit, 32-bit, and 64-bit representations.

This fixed allocation creates boundaries:

  • 4 bits can represent 0 to 15 (2⁴ - 1)
  • 8 bits can represent 0 to 255 (2⁸ - 1)
  • 16 bits can represent 0 to 65,535 (2¹⁶ - 1)

When performing arithmetic operations, the result must fit within the allocated number of bits. If it doesn't, overflow occurs.

Key principle: The number of bits is finite, so there's a maximum value that can be represented. Exceeding this maximum during calculations causes overflow.

Understanding overflow

Overflow occurs when an arithmetic operation produces a result that exceeds the maximum value representable with the available bits. This is a critical concept because overflow can cause serious errors in computer systems if not detected and handled properly.

Identifying overflow in binary addition:

Overflow happens when:

  1. The addition of two numbers produces a carry out of the most significant bit (MSB)
  2. This carry cannot be stored because there are no more bits available

8-bit overflow example:

    1 1 1 1 1 1 1 1   (carries)
    1 1 0 0 1 1 0 1   (205 in decimal)
  + 0 1 1 1 0 1 1 0   (118 in decimal)
  -----------------
  1 0 1 0 0 0 0 1 1   (overflow occurs!)

The correct answer should be 323 in decimal, which requires 9 bits (101000011 in binary). However, with only 8 bits available, the leftmost carry is lost, leaving 01000011 (67 in decimal) — completely incorrect.

Real-world consequences of overflow:

  • Financial software could calculate incorrect totals
  • Games could show negative health when adding large positive values
  • Industrial control systems could malfunction dangerously
  • The famous Ariane 5 rocket failure in 1996 was partly caused by overflow

Detecting overflow

You must be able to identify when overflow has occurred in exam questions. There are two main approaches:

Method 1: Check for carry out of the MSB

If a carry is generated from the leftmost column but cannot be accommodated within the fixed bit width, overflow has occurred.

Method 2: Verify the result

Convert both operands and the result to decimal, then check if the sum is correct. If the result is smaller than expected or obviously wrong, overflow has occurred.

Practical detection in exam answers:

When asked to identify overflow, you should:

  1. Complete the binary addition with carries shown
  2. State whether overflow has occurred (yes/no)
  3. Justify your answer by referencing the carry out of the MSB or by comparing decimal equivalents

Preventing and handling overflow

While detection is the focus at IGCSE level, understanding basic prevention strategies helps reinforce your conceptual understanding:

Prevention methods:

  • Use more bits: Allocate 16 or 32 bits instead of 8 bits to increase the range
  • Range checking: Verify values before performing operations
  • Error flags: CPUs set overflow flags in status registers to alert programs
  • Software validation: Programs can check for overflow and handle errors appropriately

Modern programming languages and computer systems include built-in overflow detection mechanisms. Understanding overflow at the binary level helps you appreciate why these safeguards matter.

Worked examples

Example 1: Basic 8-bit addition without overflow

Question: Add the following 8-bit binary numbers and state whether overflow occurs: 01001101 and 00110010

Solution:

    1 1 1 1          (carries)
    0 1 0 0 1 1 0 1  (77 in decimal)
  + 0 0 1 1 0 0 1 0  (50 in decimal)
  -----------------
    0 1 1 1 1 1 1 1  (127 in decimal)

Step-by-step working:

  • Column 1 (LSB): 1 + 0 = 1
  • Column 2: 0 + 1 = 1
  • Column 3: 1 + 0 = 1
  • Column 4: 1 + 0 = 1
  • Column 5: 0 + 1 = 1
  • Column 6: 0 + 1 = 1
  • Column 7: 1 + 0 = 1
  • Column 8 (MSB): 0 + 0 = 0

Overflow? No overflow has occurred because no carry was generated out of the MSB position. The result (127) fits within 8 bits.

Marks awarded: 3 marks — 1 for correct carries, 1 for correct result, 1 for correct overflow identification


Example 2: 8-bit addition with overflow

Question: Perform binary addition on 11010110 and 10110101. Show all working and explain whether overflow has occurred. [4 marks]

Solution:

  1 1 1 1 1 1 1 1 1  (carries)
    1 1 0 1 0 1 1 0  (214 in decimal)
  + 1 0 1 1 0 1 0 1  (181 in decimal)
  -----------------
  1 0 1 0 0 0 1 0 1 1

With 8-bit representation, we cannot store the carry out of the MSB, leaving: 01000011

Decimal verification:

  • First number: 214
  • Second number: 181
  • Expected sum: 395
  • Actual 8-bit result: 67

Explanation: Overflow has occurred [1 mark]. A carry was generated out of the most significant bit position [1 mark], but this cannot be stored in an 8-bit register [1 mark]. The correct answer (395) requires 9 bits, but only 8 are available, resulting in an incorrect answer of 67 [1 mark].


Example 3: Multiple additions with overflow analysis

Question: A computer system uses 4-bit registers. Calculate 1011 + 0110 and state whether overflow occurs. Explain your answer. [3 marks]

Solution:

  1 1 1 1     (carries)
    1 0 1 1   (11 in decimal)
  + 0 1 1 0   (6 in decimal)
  ---------
  1 0 0 0 1

The result with 4 bits would be 0001 (the carry out of the MSB is lost).

Answer: Yes, overflow has occurred [1 mark]. The carry generated from the most significant bit cannot be stored in the 4-bit register [1 mark]. The correct answer is 17 (decimal), which requires 5 bits (10001), but only 4 bits are available, giving an incorrect result of 1 [1 mark].

Common mistakes and how to avoid them

  • Forgetting to show carries: Always write carry digits above your working, even when explaining your method. Examiners expect to see these for full marks in "show your working" questions.

  • Adding from left to right: Binary addition, like decimal addition, must be performed from right to left (LSB to MSB). Adding from the left will produce incorrect carries and wrong answers.

  • Confusing overflow with carry: A carry between columns during addition is normal. Overflow specifically refers to a carry out of the MSB that cannot be accommodated. Not every carry indicates overflow.

  • Incorrect overflow identification: Overflow only occurs when the result exceeds the maximum value for the given bit width. Check: does the final carry extend beyond the allocated bits? If working within the available bits, there's no overflow even if carries occur internally.

  • Not showing sufficient working: In exam questions worth 3-4 marks, you must show binary addition steps, carries, the final result, overflow identification, and justification. A simple yes/no answer to "does overflow occur?" will not earn full marks.

  • Misaligning binary columns: Always align binary numbers by their LSB (rightmost digit) and ensure each column is clearly vertical. Misalignment leads to addition errors and lost marks.

Exam technique for "Data representation: binary arithmetic including addition and overflow"

  • Command word "Calculate" or "Perform": Show full working including all carries above your calculation. State the final binary result clearly. If asked about overflow, you must explicitly state whether it occurs and justify your answer (typically 3-4 marks total).

  • Command word "State": A brief answer is sufficient. For "State whether overflow occurs," write "Yes, overflow has occurred" or "No overflow" with a one-sentence justification referencing the carry out of the MSB (typically 1-2 marks).

  • Command word "Explain": Provide detailed reasoning. Describe what overflow is, identify whether it occurred in the specific calculation, reference the carry from the MSB, and compare the expected decimal result with the actual result stored (typically 2-3 marks).

  • Mark allocation guide: Binary addition showing working (1-2 marks), correct result (1 mark), overflow identification (1 mark), explanation/justification (1-2 marks). A 4-mark question typically requires all elements, so budget your answer accordingly.

Quick revision summary

Binary addition follows simple rules: 0+0=0, 0+1=1, 1+1=10 (carry 1). Work from right to left, showing carries above each column. Overflow occurs when adding two numbers produces a result too large for the allocated bits, indicated by a carry out of the most significant bit that cannot be stored. Always verify by comparing the expected decimal sum with the actual binary result. In exams, show full working, identify overflow explicitly, and justify your answer with reference to carries and bit limitations for full marks.

Free for IGCSE students

Lock in Data representation: binary arithmetic including addition and overflow with real exam questions.

Free instantly-marked CIE IGCSE Computer Science practice — 45 questions a day, no card required.

Try a question →See practice bank