Level:
Correct: 0
Incorrect: 0
Marks: 0/0
Exam Practice
Course:
Topics:
OCR GCSE Computer Science (Paper 1) Smart practice A mixed round aimed at your weak spots
Unit 1
Systems architecture
Unit 2
Memory and storage
Unit 3
Computer networks, connections and protocols
Unit 4
Network security
Unit 5
Systems software
Unit 6
Ethical, legal, cultural and environmental impacts of digital technology
Avg
score:
–
Topics
done:
0/34

Binary addition and overflow errors

Practise 25 exam-style questions on Binary addition and overflow errors for OCR GCSE Computer Science (Paper 1). Write your answer as you would in the exam and get it marked in seconds against the mark scheme, point by point, with the Study Helper on hand if you get stuck.

  • 25 questions
  • 1–6 marks each
  • Instant marking
  • No sign-up needed
20 questions, marked as you go

Sample questions with model answers

Here are 4 of the questions in this topic, each with a model answer, an explanation of why it earns the marks and the mark scheme an examiner would use.

Question 1

1 mark

What is the result of the 8-bit binary addition 10101010 + 01010101?

Choose your answer.

  • 100000000
  • 11111110
  • 11111111
  • 00000000

Model answer

11111111

Explanation

In every column one number has a 1 and the other has a 0, so each column gives 1 with no carry. The result is 11111111 = 255, which is the largest 8-bit number but still fits, so there is no overflow.

Mark scheme
  1. 1 mark

    11111111

    Every column is 1 + 0 or 0 + 1, so there are no carries: 170 + 85 = 255. 100000000 and 00000000 wrongly assume a carry / overflow. If more than one option is given, 0 marks.

Question 2

2 marks

Explain why adding two 8-bit binary numbers that both have 1 as their most significant bit will always cause an overflow error.

Model answer

The most significant bit of an 8-bit number has place value 128, so both numbers are at least 128. Their total must be at least 128 + 128 = 256, which is more than 255, the largest number 8 bits can hold. In the 128 column, 1 + 1 always makes 0 carry 1, so there is always a carry out into a 9th bit.

Explanation

Overflow happens when the result is greater than 255. Two numbers of 128 or more always add up to 256 or more, whatever their other bits are. This gives a quick test: if both most significant bits are 1, the addition will overflow.

Mark scheme
  1. 1 mark

    a most significant bit of 1 means each number is at least 128 // the most significant bit has place value 128

  2. 1 mark

    so the total is at least 256, which is more than 255 / needs 9 bits // 1 + 1 in the left-most (128) column always gives a carry out into a 9th bit

Question 3

3 marks

The diagram shows two 8-bit binary numbers to be added. The result row has an extra box on the left for a 9th bit.

Add the two numbers using binary addition. You must show your working: type the carries as well as the result. Write down the 9-bit result and state whether an overflow error would occur if the result had to be stored in an 8-bit register. Give a reason for your answer.

Three 8-bit registers, each drawn as a row of 8 boxes, with the place values 128, 64, 32, 16, 8, 4, 2, 1 above the columns. Row 1: 10110110. Row 2, with a plus sign in front of it: 01100101. Row 3, the result row, below a line drawn under the numbers being added: all 8 boxes blank; an extra box to the left of the register, labelled "9th bit", holds nothing (blank).

Model answer

10110110
+ 01100101
Carries: 1 into the 8, 64 and 128 columns and 1 out into the 9th bit (carry row 111001000)
Result: 100011011
An overflow error would occur, because the result needs 9 bits: 182 + 101 = 283, which is greater than 255, the largest number 8 bits can hold.

Explanation

From the right: 0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 0 carry 1, 0 + 0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 0 carry 1, 0 + 1 + 1 = 0 carry 1, and 1 + 0 + 1 = 0 carry 1 into the 9th bit. An 8-bit register would keep only 00011011 (27), so the stored result would be wrong. A carry out of the most significant column always means overflow.

Mark scheme
  1. 1 mark

    working: correct carries - a carry of 1 into each of the 8, 64 and 128 columns and into the 9th bit (as a carry row over the 9th bit and the columns 128 to 1: 111001000)

    Carries may be typed above or below the sum, as a row lined up with the columns, or described column by column. Do not award the working mark for converting to denary and back. An answer with no carries shown cannot get this mark, but can get the other marks.

  2. 1 mark

    100011011

    Accept the 8-bit result 00011011 with a carry of 1 out of the left-most column. A correct answer with no working (no carries shown) loses only the working mark (MS1): it scores this mark and can still score MS3.

  3. 1 mark

    overflow occurs because the result needs 9 bits // because 283 is greater than 255 // because there is a carry out of the most significant bit

    'Yes' with no reason does not score.

Question 4

4 marks

A shop's loyalty card system stores a customer's points as an 8-bit unsigned binary number. A customer has 10010110 points and earns another 01011010 points. The diagram shows the addition, with an extra box on the left of the result row for a 9th bit.

Add the two numbers using binary addition. You must show your working: type the carries as well as the result. Write down the result and explain whether an overflow error has occurred.

Three 8-bit registers, each drawn as a row of 8 boxes, with the place values 128, 64, 32, 16, 8, 4, 2, 1 above the columns. Row 1 (labelled "Points"): 10010110. Row 2 (labelled "Earned"), with a plus sign in front of it: 01011010. Row 3 (labelled "Result"), the result row, below a line drawn under the numbers being added: all 8 boxes blank; an extra box to the left of the register, labelled "9th bit", holds nothing (blank).

Model answer

10010110
+ 01011010
Carries: 00111100 (a 1 carried into the 4, 8, 16 and 32 columns)
Result: 11110000
No overflow error has occurred. There is no carry out of the 128 column, so the 9th bit is 0. In denary, 150 + 90 = 240, which is less than 255, so it fits in 8 bits.

Explanation

From the right: 0 + 0 = 0, 1 + 1 = 0 carry 1, 1 + 0 + 1 = 0 carry 1, 0 + 1 + 1 = 0 carry 1, 1 + 1 + 1 = 1 carry 1, 0 + 0 + 1 = 1, 0 + 1 = 1, 1 + 0 = 1. Having a box for a 9th bit does not mean overflow has happened - check whether anything is actually carried into it.

Mark scheme
  1. 1 mark

    working: correct carries - a carry of 1 into each of the 4, 8, 16 and 32 columns (as a carry row over the columns 128 to 1: 00111100)

    Carries may be typed above or below the sum, as a row lined up with the columns, or described column by column. Do not award the working mark for converting to denary and back. An answer with no carries shown cannot get this mark, but can get the other marks.

  2. 1 mark

    11110000

    Accept 011110000 (9 bits with 0 as the 9th bit).

  3. 1 mark

    no overflow error has occurred

  4. 1 mark

    ...because there is no carry out of the most significant bit / the 9th bit is 0 // because the total (150 + 90 = 240) is not more than 255 / fits in 8 bits

Ready to try the rest? Every answer you write is marked against the mark scheme, so you can see exactly where the marks are.

Study Helper Hints first, answers after you try

Stuck on this one? Ask for a hint and I’ll point you in the right direction, without giving the answer away. Once you’ve checked your answer, I’ll show you how the marks are awarded.