Past-paper question · 2015 October-November · Paper 31 · Q1(c)

Question 1(c) 2015 · October-November · Paper 31 · 3 marks

Original past-paper question for 1(C)
Original past-paper question for 1(C)
Original past-paper question for 1(C)
Original past-paper question for 1(C)
Reveal official mark-scheme answer Official mark-scheme answer for 1(C)

Official answer for Question 1

Part (c)

Part (c)

Any point 1 mark

✓
0.1 cannot be represented exactly in binary
✓
0.1 represented here by a value just less than 0.1
✓
the loop keeps adding this approximate value to counter
✓
until all accumulated small differences become significant enough to be seen
✓
[max 3]

Mark scheme 9608_w15_ms_31.pdf →

Show text version of question

Question 1

Part (c)

Question 1

In a particular computer system, real numbers are stored using floating-point representation with:

  • 8 bits for the mantissa, followed by
  • 8 bits for the exponent

Two’s complement form is used for both mantissa and exponent.

Part (c)

A student writes a program to output numbers using the following code:

X 0.0 FOR i 0 TO 1000 X X + 0.1 OUTPUT X ENDFOR

The student is surprised to see that the program outputs the following sequence:

Explain why this output has occurred.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...............................................................................................................................................[3]

Question 4

Topic relevance

Why this question appears here

98% assigned-topic match · Data representation › Floating-point representation and manipulation

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 9608_w15_qp_31.pdf

Keep practising this topic