0% found this document useful (0 votes)
132 views

13.3 Floating-Point Numbers, Representation and Manipulation

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

13.3 Floating-Point Numbers, Representation and Manipulation

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Computer Science 9618

Topical Past Papers


Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation


May/June 2015.P31/P32

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.

Bit 0 of byte 1 acts as a flag:

• the initial value is zero


• when the reading has been processed it is set to 1

Byte 2 contains the temperature reading (two’s complement integer).

(i) Interpret the data in byte 1 shown below:

[2]

Page 1 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation

(ii) The system receives a temperature reading of –5 degrees from sensor 6.

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:

• 8 bits for the mantissa, followed by


• 8 bits for the exponent

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

(a)(i) A real number is stored as the following two bytes:

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

13.3 Floating-Point Numbers, Representation and Manipulation


(iii) Normalise the floating-point number in part (a)(i).

[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

13.3 Floating-Point Numbers, Representation and Manipulation


OUTPUT X
ENDFOR

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

0.0 0.1 0.2 0.2999999 0.3999999 ……

Explain why this output has occurred. [3]

Page 4 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation


Oct/Nov 2015.P32

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

• 8 bits for the mantissa, followed by


• 4 bits for the exponent

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

(a)(i) A real number is stored as the following 12-bit binary pattern:

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]

The number of bits available to represent a real number is increased to 16.

(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]

(c) A student enters the following expression into an interpreter:

OUTPUT (0.1 + 0.2)

The student is surprised to see the following output:

0.3000000000000001

Explain why this output has occurred. [3]


Page 5 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation

Oct/Nov 2016.P31/P33

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

• 12 bits for the mantissa


• 4 bits for the exponent
• two’s complement form for both mantissa and exponent

(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

13.3 Floating-Point Numbers, Representation and Manipulation

(d)(i) State whether the floating-point number given in part (c) is normalised or not normalised. [1]

(ii) Justify your answer given in part (d)(i). [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:

• 8 bits for the mantissa


• 8 bits for the exponent
• two’s complement form for both mantissa and exponent

(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

13.3 Floating-Point Numbers, Representation and Manipulation

[3]

(d)(i) State whether the floating-point number given in part (c) is normalised or not normalised. [1]

(ii) Justify your answer given in part (d)(i). [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:

• 12 bits for the mantissa


• 4 bits for the exponent
• Two’s complement form for both mantissa and exponent.

(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

13.3 Floating-Point Numbers, Representation and Manipulation

Show your working. [3]

(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:

• 8 bits for the mantissa


• 4 bits for the exponent
• two’s complement form for both mantissa and exponent.

(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

13.3 Floating-Point Numbers, Representation and Manipulation

(b) Find the denary value for the following binary floating-point number.

Show your working. [3]

Oct/Nov 2018.P31/P33

2 (a) A computer system stores real numbers using floating-point representation. The floating-point numbers
have:

• eight bits for the mantissa


• four bits for the exponent.

The mantissa and exponent are both in two’s complement form.

(i) Calculate the denary value of the following floating-point number.

Show your working. [3]

(ii) State how you know the floating-point number in part (a)(i) is not normalised. [1]

(iii) Normalise the floating-point number in part (a)(i).

[2]

Page 10 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation


(b)(i) Write the largest positive number that this system can represent as a normalised floating-point
number in this format.

[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:

(i) mantissa [1]

(ii) exponent [1]

(d) A student enters the following code into an interpreter.

X = 0.1
Y = 0.2
Z = 0.3
OUTPUT (X + Y + Z)

The student is surprised to see the output:

0.6000000000000001

Explain why this is output. [3]

Oct/Nov 2018.P32

Page 11 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation


1 (a) A computer system uses floating-point representation to store real numbers. The floating-point numbers
have:

• 8 bits for the mantissa


• 8 bits for the exponent

The mantissa and exponent are both in two’s complement form.

(i) Calculate the denary value of the following floating-point number. It is not in normalised form.

Show your working. [3]

(ii) Convert the denary number +7.5 into a normalised floating-point number.

Show your working.

[3]

(iii) Convert the denary number -7.5 into a normalised floating-point number.

Show your working.

[3]

Page 12 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation

(b) A normalised floating-point number is shown.

(i) State the significance of this binary number. [1]

(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:

• twelve bits for the mantissa


• four bits for the exponent.

The mantissa and exponent are both in two’s complement form.

(a) Calculate the denary value for the following binary floating-point number.

Show your working.

[3]

(b) Calculate the normalised floating-point representation of +1.5625 in this system.

Show your working.

Page 13 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation

[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

13.3 Floating-Point Numbers, Representation and Manipulation


• eight bits for the mantissa
• four bits for the exponent.

The mantissa and exponent are both stored in two’s complement format.

(i) Calculate the denary value of the following floating-point number.

Show your working.

[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.

Show your working.

[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

13.3 Floating-Point Numbers, Representation and Manipulation


Show your working.

[3]

(c) A student enters the following into an interpreter:

OUTPUT(0.2 * 0.4)

The student is surprised to see that the interpreter outputs the following:

0.08000000000000002

Explain why the interpreter outputs this value. [3]

Oct/Nov 2019.P31/P33

1 Real numbers are stored using floating-point representation in a computer system.

This representation uses:

• 8 bits for the mantissa, followed by


• 4 bits for the exponent.

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

(a)(i) A real number is stored as a 12-bit normalised binary number as follows:

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

13.3 Floating-Point Numbers, Representation and Manipulation

(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

13.3 Floating-Point Numbers, Representation and Manipulation


(i) Identify the binary value of the exponent. [1]

(ii) Identify the binary value of the mantissa. [1]

(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.

State the effects of this change. [2]

May/June 2020.P31/P32/P33

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

• 10 bits for the mantissa


• 6 bits for the exponent
• two’s complement form for both mantissa and exponent.

(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

13.3 Floating-Point Numbers, Representation and Manipulation

(c) The floating-point representation has changed. There are now 12 bits for the mantissa and 4 bits for the
exponent as shown.

Explain why +192.5 cannot be accurately represented in this format. [3]

Oct/Nov 2020.P31/P33

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

• 12 bits for the mantissa


• 4 bits for the exponent
• two’s complement form for both mantissa and exponent.

(a) The following floating-point number stored is not normalised.

Calculate the denary value for the floating-point number. Show your working.

[3]

(b)(i) Normalise the floating-point number given in part (a).

Write your answer in the following boxes.

[2]

Page 19 of 25
Computer Science 9618
Topical Past Papers
Paper 3 - Questions

13.3 Floating-Point Numbers, Representation and Manipulation


(ii) Describe one problem that can occur when floating-point numbers are not normalised. [2]

Oct/Nov 2020.P32

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

• 12 bits for the mantissa


• 4 bits for the exponent
• two’s complement form for both mantissa and exponent.

(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

13.3 Floating-Point Numbers, Representation and Manipulation

May/June 2021.P31/P33

1 In a particular computer system, two real numbers, A and B, are stored using floating-point representation
with:

• 12 bits for the mantissa


• 4 bits for the exponent
• two’s complement form for both mantissa and exponent.

(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

13.3 Floating-Point Numbers, Representation and Manipulation


May/June 2021.P32

1 In a computer system, two real numbers, A and B, are stored using floating-point representation with:

• 12 bits for the mantissa


• 4 bits for the exponent
• two’s complement form for both mantissa and exponent.

(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]

May/June 2021.P31/P32/P33 (9618)

1 Real numbers are stored in a computer system using floating-point representation with:

• 10 bits for the mantissa


• 6 bits for the exponent
• Two’s complement form for both the mantissa and the exponent.

(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

13.3 Floating-Point Numbers, Representation and Manipulation

[3]

(b) Calculate the denary value of the given binary floating-point number. Show your working.

[3]

(c) The given binary floating-point number is not normalised.

Normalise the floating-point number. Show your working.

[3]

(d) The denary number 513 cannot be stored accurately as a normalised floating-point number in this
computer system.

(i) Explain the reason for this. [3]

(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

13.3 Floating-Point Numbers, Representation and Manipulation

Oct/Nov 2021.P31/P32/P33 (9618)

1 (a) Numbers are stored in a computer using floating-point representation with:

• 12 bits for the mantissa


• 4 bits for the exponent
• two’s complement form for both the mantissa and exponent.

(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

13.3 Floating-Point Numbers, Representation and Manipulation

Page 25 of 25

You might also like