data_representation
data_representation
1 In a particular computer system, real numbers are stored using floating-point representation with:
Mantissa Exponent
0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
(ii) Explain why the floating-point number in part (a)(i) is not normalised.
...........................................................................................................................................
.......................................................................................................................................[2]
Mantissa Exponent
[2]
(b) (i) Write the largest positive number that can be written as a normalised floating-point
number in this format.
Mantissa Exponent
[2]
(ii) Write the smallest positive number that can be written as a normalised floating-point
number in this format.
Mantissa Exponent
[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
OUTPUT X
ENDFOR
The student is surprised to see that the program outputs the following sequence:
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
1 In a particular computer system, real numbers are stored using floating-point representation with:
(a) (i) A real number is stored as the following 12-bit binary pattern:
0 1 1 0 1 0 0 0 0 0 1 1
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[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
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
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.
Mantissa Exponent
•
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(b) Calculate the floating-point representation of − 2.5 in this system. Show your working.
Mantissa Exponent
•
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(c) Find the denary value for the following binary floating-point number. Show your working.
Mantissa Exponent
0
•0 1 1 0 0 0 0 0 0 0 0 0 0 1 1
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(d) (i) State whether the floating-point number given in part (c) is normalised or not normalised.
...................................................................................................................................... [1]
...........................................................................................................................................
...................................................................................................................................... [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.
1 ...............................................................................................................................................
...................................................................................................................................................
2 ...............................................................................................................................................
.............................................................................................................................................. [2]
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.
Mantissa Exponent
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(b) Calculate the floating-point representation of –3.5 in this system. Show your working.
Mantissa Exponent
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(c) Find the denary value for the following binary floating-point number. Show your working.
Mantissa Exponent
0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
(d) (i) State whether the floating-point number given in part (c) is normalised or not normalised.
...................................................................................................................................... [1]
...........................................................................................................................................
...................................................................................................................................... [1]
(e) Give the binary two’s complement pattern for the negative number with the largest magnitude.
Mantissa Exponent
[2]
2 (a) A computer system stores real numbers using floating‑point representation. The floating‑point
numbers have:
Mantissa Exponent
0 0 1 1 1 0 0 0 0 1 1 1
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Answer ..............................................................................................................................
[3]
(ii) State how you know the floating‑point number in part (a)(i) is not normalised.
...........................................................................................................................................
.......................................................................................................................................[1]
Mantissa Exponent
[2]
(b) (i) Write the largest positive number that this system can represent as a normalised
floating‑point number in this format.
Mantissa Exponent
[2]
(ii) Write the smallest positive number that can be stored as a normalised floating‑point
number in this format.
Mantissa Exponent
[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:
.......................................................................................................................................[1]
.......................................................................................................................................[1]
X = 0.1
Y = 0.2
Z = 0.3
OUTPUT (X + Y + Z)
0.6000000000000001
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
1 (a) A computer system uses floating-point representation to store real numbers. The floating-point
numbers have:
(i) Calculate the denary value of the following floating-point number. It is not in normalised
form.
Mantissa Exponent
0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Answer ..............................................................................................................................
[3]
(ii) Convert the denary number + 7.5 into a normalised floating-point number.
Mantissa Exponent
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
(iii) Convert the denary number − 7.5 into a normalised floating-point number.
Mantissa Exponent
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
Mantissa Exponent
0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
...........................................................................................................................................
.......................................................................................................................................[1]
(ii) State what will happen if a positive number is added to this number.
...........................................................................................................................................
.......................................................................................................................................[1]
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.
Mantissa Exponent
1 0 0 1 0 1 1 1 0 0 1 1 0 1 1 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Mantissa Exponent
[3]
(c) (i) Write the largest positive number that can be stored as a normalised floating-point
number using this format.
Mantissa Exponent
[2]
(ii) Write the smallest non-zero positive number that can be stored as a normalised
floating-point number using this format.
Mantissa Exponent
[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]
1 (a) A computer stores real numbers using floating-point representation. The floating-point
numbers have:
The mantissa and exponent are both stored in two’s complement format.
Mantissa Exponent
0 0 1 1 0 1 1 1 0 1 0 1
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Answer ..............................................................................................................................
[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.
Mantissa Exponent
[2]
(b) (i) Convert the denary number +11.625 into a normalised floating-point number.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Mantissa Exponent
[3]
(ii) Convert the denary number −11.625 into a normalised floating-point number.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Mantissa Exponent
[3]
OUTPUT(0.2 * 0.4)
The student is surprised to see that the interpreter outputs the following:
0.08000000000000002
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
Packet switching is not always the most appropriate method of transferring data.
............................................................................................................................................. [1]
(b) Give an example of a situation where the method you identified in part (a) is more appropriate.
Example ....................................................................................................................................
...................................................................................................................................................
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
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:
Mantissa Exponent
0 1 0 1 0 0 1 0 0 0 1 0
Calculate the denary value for this binary number. Show your working.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(ii) Calculate the normalised binary number for −3.75. Show your working.
Mantissa Exponent
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[3]
(b) The number of bits available to represent a real number is increased to 16.
...................................................................................................................................................
............................................................................................................................................. [1]
(c) State why some binary representations can lead to rounding errors.
...................................................................................................................................................
............................................................................................................................................. [1]
(d) Complete the following descriptions by inserting the two missing terms.
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
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.
Most Least
significant bit significant bit
0 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1
..................................................................................................................................... [1]
..................................................................................................................................... [1]
(iii) State whether the number stored is positive or negative. Justify your choice.
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(iv) Convert the binary floating-point number in part (a) into denary. Show your working.
Working .............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
(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.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
BLANK PAGE
BLANK PAGE