Adding binary numbers, and overflow Cambridge IGCSE Computer Science (9–1) revision

Not started

Learn it

In plain words

Binary numbers are added in columns from the right, just like denary, but you carry whenever a column reaches 2.

A register has a fixed number of bits. If the answer is too big to fit, the extra bit has nowhere to go. That is an overflow error.

4 things to know

  1. The four rules: 0 + 0 = 0. 0 + 1 = 1. 1 + 1 = 0 carry 1. 1 + 1 + 1 = 1 carry 1.
  2. Work from the right-hand column to the left, writing each carry above the next column.
  3. An 8-bit register can hold nothing larger than 255. If the sum is more than 255 it needs a ninth bit, and an overflow error occurs.
  4. Every computer has a limit like this, for example 16 bits. An overflow error happens whenever a result is outside the limit.

Worked example

Add the 8-bit binary numbers 01101011 and 00111010.

  1. From the right: 1 + 0 = 1. 1 + 1 = 0 carry 1. 0 + 0 + 1 = 1. 1 + 1 = 0 carry 1.
  2. Carrying on: 0 + 1 + 1 = 0 carry 1. 1 + 1 + 1 = 1 carry 1. 1 + 0 + 1 = 0 carry 1. 0 + 0 + 1 = 1.
  3. The answer is 10100101.
  4. Check in denary: 107 + 58 = 165, and 10100101 = 128 + 32 + 4 + 1 = 165.

Tips and tricks

  • Show the carries. They earn the working mark even if a later column goes wrong.
  • Check your answer by converting all three numbers to denary. It takes a few seconds.
  • To explain overflow, give both halves: the result is greater than 255, and so it cannot be stored in 8 bits.
5 questions, about 2 minutes.

It lands in your notebook with its questions as flashcards.

Adding binary numbers, and overflow: 5 questions and answers

These are the quiz’s questions. Do the quiz first, then come back here for the ones that got you.

  1. In binary, what is 1 + 1?
    • 1
    • 2
    • 10 (the answer)
    • 11

    There is no digit 2 in binary. Write 0 and carry 1.

  2. In binary, what is 1 + 1 + 1?
    • 10
    • 11 (the answer)
    • 100
    • 111

    That is 3 in denary, which is 11: write 1 and carry 1.

  3. What is 00110101 + 00011011?
    • 00101110
    • 01001110
    • 01010000 (the answer)
    • 01010010

    53 + 27 = 80, and 80 = 64 + 16.

  4. When does an overflow error occur in an 8-bit register?
    • when the answer is 0
    • when two numbers are equal
    • when the result is greater than 255 (the answer)
    • when a number is odd

    A result above 255 needs a ninth bit, and there is nowhere to put it.

  5. Which of these 8-bit additions causes an overflow error?
    • 01111111 + 00000001
    • 00001111 + 00001111
    • 01000000 + 01000000
    • 10000001 + 10000000 (the answer)

    129 + 128 = 257, which is more than 255. The others give 128, 30 and 128.

Still stuck on this one?Ask in the Papermunch Discord, or help someone else who is. Discord is for ages 13 and up.Join the server

Things you can type

Or go straight to

Or browse a shelf