13.3 Floating-Point Numbers, Representation and Manipulation
13.3 Floating-Point Numbers, Representation and Manipulation
5 A gardener grows vegetables in a greenhouse. For the vegetables to grow well, the temperature needs to
always be within a particular range.
The gardener is not sure about the actual temperatures in the greenhouse during the growing season. The
gardener installs some equipment. This records the temperature every hour during the growing season.
(c) The equipment records temperatures in the greenhouse. It does this for seven locations.
Each recording is stored as two successive bytes. The format is shown below:
The location is indicated by the setting of one of the seven bits in byte 1. For example, location 4 is indicated
by setting bit 4.
[2]
Page 1 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
Complete the boxes below to show the two bytes for this recording. The reading has not yet been processed.
[2]
Oct/Nov 2015.P31/P33
1 In a particular computer system, real numbers are stored using floating-point representation with:
Calculate the denary value of this number. Show your working. [3]
(ii) Explain why the floating-point number in part (a)(i) is not normalised. [2]
Page 2 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
[2]
(b)(i) Write the largest positive number that can be written as a normalised floating-point number in this
format.
[2]
(ii) Write the smallest positive number that can be written as a normalised floating-point number in this
format.
[2]
(iii) If a positive number is added to the number in part (b)(i) explain what will happen. [2]
(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
Page 3 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
The student is surprised to see that the program outputs the following sequence:
Page 4 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
1 In a particular computer system, real numbers are stored using floating-point representation with:
Calculate the denary value of this number. Show your working. [3]
(ii) Give the normalised binary pattern for +3.5. Show your working. [3]
(iii) Give the normalised binary pattern for –3.5. Show your working. [3]
(b)(i) If the system were to use the extra 4 bits for the mantissa, state what the effect would be on the
numbers that can be represented. [1]
(ii) If the system were to use the extra 4 bits for the exponent instead, state what the effect would be on the
numbers that can be represented. [1]
0.3000000000000001
Oct/Nov 2016.P31/P33
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) Calculate the floating-point representation of + 2.5 in this system. Show your working.
[3]
(b) Calculate the floating-point representation of − 2.5 in this system. Show your working.
[3]
(c) Find the denary value for the following binary floating-point number. Show your working.
[3]
Page 6 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(d)(i) State whether the floating-point number given in part (c) is normalised or not normalised. [1]
(e) The system changes so that it now allocates 8 bits to both the mantissa and the exponent.
State two effects this has on the numbers that can be represented. [2]
Oct/Nov 2016.P32
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) Calculate the floating point representation of + 3.5 in this system. Show your working.
[3]
(b) Calculate the floating-point representation of –3.5 in this system. Show your working.
[3]
(c) Find the denary value for the following binary floating-point number. Show your working.
Page 7 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
[3]
(d)(i) State whether the floating-point number given in part (c) is normalised or not normalised. [1]
(e) Give the binary two’s complement pattern for the negative number with the largest magnitude.
[2]
May/June 2018.P31/P33
1 In a computer system, real numbers are stored using normalised floating-point representation with:
(a) Find the denary value for the following binary floating-point number.
Page 8 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(b) Calculate the normalised floating-point representation of 5.25 in this system. Show your working.
[3]
(c) The size of the mantissa is decreased and the size of the exponent is increased.
State how this affects the range and precision of the numbers that the computer system can represent. [2]
May/June 2018.P32
3 In a computer system, real numbers are stored using normalised-floating point representation with:
(a) Calculate the normalised floating-point representation of + 21.75 in this system. Show your working.
[3]
Page 9 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(b) Find the denary value for the following binary floating-point number.
Oct/Nov 2018.P31/P33
2 (a) A computer system stores real numbers using floating-point representation. The floating-point numbers
have:
(ii) State how you know the floating-point number in part (a)(i) is not normalised. [1]
[2]
Page 10 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
[2]
(ii) Write the smallest positive number that can be stored as a normalised floating-point number in this
format.
[2]
(c) The number of bits available to represent a real number is increased to 16.
State the effect this has on the numbers that can be represented, if the additional four bits are used in the:
X = 0.1
Y = 0.2
Z = 0.3
OUTPUT (X + Y + Z)
0.6000000000000001
Oct/Nov 2018.P32
Page 11 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(i) Calculate the denary value of the following floating-point number. It is not in normalised form.
(ii) Convert the denary number +7.5 into a normalised floating-point number.
[3]
(iii) Convert the denary number -7.5 into a normalised floating-point number.
[3]
Page 12 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(ii) State what will happen if a positive number is added to this number. [1]
May/June 2019.P31/P33
1 In a computer system, real numbers are stored using normalised floating-point representation with:
(a) Calculate the denary value for the following binary floating-point number.
[3]
Page 13 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
[3]
(c)(i) Write the largest positive number that can be stored as a normalised floating-point number using this
format.
[2]
(ii) Write the smallest non-zero positive number that can be stored as a normalised floating-point number
using this format.
[2]
(d) The developer of a new programming language decides that all real numbers will now be stored using 20-
bit normalised floating-point representation. She must decide how many bits to use for the mantissa and
how many bits for the exponent.
Explain the trade-off between using either a large number of bits for the mantissa, or a large number of bits
for the exponent.
[3]
May/June 2019.P32
1 (a) A computer stores real numbers using floating-point representation. The floating-point numbers have:
Page 14 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
The mantissa and exponent are both stored in two’s complement format.
[3]
(ii) State why the floating-point number in part (a)(i) is not normalised. [1]
(iii) Give the floating-point number in part (a)(i) in normalised two’s complement format.
[2]
(b)(i) Convert the denary number +11.625 into a normalised floating-point number.
[3]
(ii) Convert the denary number -11.625 into a normalised floating-point number.
Page 15 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
[3]
OUTPUT(0.2 * 0.4)
The student is surprised to see that the interpreter outputs the following:
0.08000000000000002
Oct/Nov 2019.P31/P33
Two’s complement form is used for both the mantissa and the exponent.
Calculate the denary value for this binary number. Show your working. [3]
Page 16 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(ii) Calculate the normalised binary number for −3.75. Show your working.
[3]
(b) The number of bits available to represent a real number is increased to 16.
State the effect of increasing the size of the exponent by 4 bits. [1]
(c) State why some binary representations can lead to rounding errors. [1]
(d) Complete the following descriptions by inserting the two missing terms.
................................................ can occur in the exponent of a floating-point number, when the exponent has
become too large to be represented using the number of bits available. A calculation results in a number so
small that it cannot be represented by the number of bits available. This is called ................................................
.
[2]
Oct/Nov 2019.P32
8 (a) The following 16-bit binary pattern represents a floating-point number stored in two’s complement form.
The twelve most significant bits are used for the mantissa and the four least significant bits are used for the
exponent.
Page 17 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(iii) State whether the number stored is positive or negative. Justify your choice. [2]
(iv) Convert the binary floating-point number in part (a) into denary. Show your working. [3]
(b) The number of bits used for the exponent is increased to eight, and the number of bits used for the
mantissa is decreased to eight.
May/June 2020.P31/P32/P33
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) Calculate the normalised floating-point representation of +192.5 in this system. Show your working.
[3]
(b) Calculate the normalised floating-point representation of –192.5 in this system. Show your working.
[3]
Page 18 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(c) The floating-point representation has changed. There are now 12 bits for the mantissa and 4 bits for the
exponent as shown.
Oct/Nov 2020.P31/P33
1 In a particular computer system, real numbers are stored using floating-point representation with:
Calculate the denary value for the floating-point number. Show your working.
[3]
[2]
Page 19 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
Oct/Nov 2020.P32
1 In a particular computer system, real numbers are stored using floating-point representation, with:
(a) Calculate the denary value for the following floating-point number. Show your working.
[3]
(b) A new operating system has been installed that has changed the way the floating-point numbers are
used. The order of the exponent and the mantissa are reversed.
(i) Calculate the new denary value for the following floating-point number that has the same bit pattern as
the number in part (a). Show your working.
[3]
(ii) Identify two problems that can occur due to the change in the representation of the floating-point
number. [2]
Page 20 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
May/June 2021.P31/P33
1 In a particular computer system, two real numbers, A and B, are stored using floating-point representation
with:
(a)(i) Identify whether each number is positive or negative. Justify your answer. [2]
(ii) Convert the binary values of the mantissa and the exponent for each number to their separate denary
values. [4]
(iii) Calculate the denary value of each floating-point number using your values from part (a)(ii). [2]
(b) State which number, A or B, is stored in normalised floating-point form. Justify your answer. [3]
Page 21 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
1 In a computer system, two real numbers, A and B, are stored using floating-point representation with:
(a)(i) Convert the binary values of the mantissa and the exponent for each number to their separate denary
values. [4]
(ii) Calculate the denary value of each floating-point number using your values from part (a)(i). [2]
(b) State which number, A or B, is stored in normalised floating-point form. Justify your answer. [3]
1 Real numbers are stored in a computer system using floating-point representation with:
(a) Calculate the normalised floating-point representation of –7.25 in this system. Show your working.
Page 22 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
[3]
(b) Calculate the denary value of the given binary floating-point number. Show your working.
[3]
[3]
(d) The denary number 513 cannot be stored accurately as a normalised floating-point number in this
computer system.
(ii) Describe an alteration to the way floating-point numbers are stored to enable this number to be stored
accurately using the same total number of bits. [2]
Page 23 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
(i) Write the normalised floating-point representation of the following unsigned binary number using this
system.
[2]
[2]
(ii) State the consequence of storing the binary number in part (a)(i) as a floating-point number in this
system. Justify your answer. [2]
(b) Explain the reason why binary numbers are stored in normalised form. [3]
Page 24 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions
Page 25 of 25