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

data_representation

The document consists of a series of questions related to floating-point representation in computer systems, focusing on calculations, normalizations, and the effects of changing bit allocations for mantissa and exponent. It includes tasks such as calculating denary values, normalizing numbers, and explaining phenomena related to floating-point arithmetic. The questions are structured to assess understanding of binary representation, two's complement, and the implications of floating-point formats.

Uploaded by

levi makokha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

data_representation

The document consists of a series of questions related to floating-point representation in computer systems, focusing on calculations, normalizations, and the effects of changing bit allocations for mantissa and exponent. It includes tasks such as calculating denary values, normalizing numbers, and explaining phenomena related to floating-point arithmetic. The questions are structured to assess understanding of binary representation, two's complement, and the implications of floating-point formats.

Uploaded by

levi makokha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

QUESTION 1.

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:

Mantissa Exponent

0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 1

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]

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

Mantissa Exponent

[2]

© UCLES 2015 9608/31/O/N/15


3

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

0.0 0.1 0.2 0.2999999 0.3999999 ……

Explain why this output has occurred.

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

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

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

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

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

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

© UCLES 2015 9608/31/O/N/15 [Turn over


QUESTION 2. 2

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:

0 1 1 0 1 0 0 0 0 0 1 1

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]

© UCLES 2015 9608/32/O/N/15


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]

© UCLES 2015 9608/32/O/N/15 [Turn over


QUESTION 3. 2

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.

Mantissa Exponent


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

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

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

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

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

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

(b) Calculate the floating-point representation of − 2.5 in this system. Show your working.

Mantissa Exponent


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

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

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

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

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

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

© UCLES 2016 9608/31/O/N/16


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]

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

1 ...............................................................................................................................................

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

2 ...............................................................................................................................................

.............................................................................................................................................. [2]

© UCLES 2016 9608/31/O/N/16 [Turn over


QUESTION 4. 2

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.

Mantissa Exponent

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

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

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

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

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

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

(b) Calculate the floating-point representation of –3.5 in this system. Show your working.

Mantissa Exponent

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

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

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

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

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

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

© UCLES 2016 9608/32/O/N/16


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]

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

Mantissa Exponent

[2]

© UCLES 2016 9608/32/O/N/16 [Turn over


QUESTION 5. 4

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.

Mantissa Exponent

0 0 1 1 1 0 0 0 0 1 1 1

Show your working.

Working .............................................................................................................................

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

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

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

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

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

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]

© UCLES 2018 9608/31/O/N/18


5

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

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

© UCLES 2018 9608/31/O/N/18 [Turn over


QUESTION 6. 2

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.

Mantissa Exponent

0 0 1 0 1 0 1 0 0 0 0 0 0 1 0 1

Show your working.

Working .............................................................................................................................

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

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

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

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

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

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

Show your working.

Mantissa Exponent

Working .............................................................................................................................

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

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

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

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

© UCLES 2018 9608/32/O/N/18


3

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

Show your working.

Mantissa Exponent

Working .............................................................................................................................

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

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

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

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

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

Mantissa Exponent

0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1

(i) State the significance of this binary number.

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

.......................................................................................................................................[1]

(ii) State what will happen if a positive number is added to this number.

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

.......................................................................................................................................[1]

© UCLES 2018 9608/32/O/N/18 [Turn over


QUESTION 7. 2

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.

Mantissa Exponent

1 0 0 1 0 1 1 1 0 0 1 1 0 1 1 1

Working .....................................................................................................................................

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

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

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

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

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

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

Show your working.

Working .....................................................................................................................................

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

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

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

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

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

Mantissa Exponent

[3]

© UCLES 2019 9608/31/M/J/19


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]

© UCLES 2019 9608/31/M/J/19 [Turn over


QUESTION 8. 2

1 (a) A computer 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 stored in two’s complement format.

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

Show your working.

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]

© UCLES 2019 9608/32/M/J/19


3

(b) (i) Convert the denary number +11.625 into a normalised floating-point number.

Show your working.

Working .............................................................................................................................

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

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

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

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

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

Mantissa Exponent

[3]

(ii) Convert the denary number −11.625 into a normalised floating-point number.

Show your working.

Working .............................................................................................................................

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

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

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

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

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

Mantissa Exponent

[3]

© UCLES 2019 9608/32/M/J/19 [Turn over


4

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

2 Packet switching can be used to transmit data across the Internet.

Packet switching is not always the most appropriate method of transferring data.

(a) Name an alternative method of transferring data across the Internet.

............................................................................................................................................. [1]

(b) Give an example of a situation where the method you identified in part (a) is more appropriate.

Justify your choice.

Example ....................................................................................................................................

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

Justification ...............................................................................................................................

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

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

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

© UCLES 2019 9608/32/M/J/19


QUESTION 9. 2

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:

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

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

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

Denary value .....................................................................................................................


[3]

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

State the effect of increasing the size of the exponent by 4 bits.

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

............................................................................................................................................. [1]

© UCLES 2019 9608/31/O/N/19


3

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

© UCLES 2019 9608/31/O/N/19 [Turn over


QUESTION 10. 12

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

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

Positive or negative ...........................................................................................................

Justification .......................................................................................................................

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

...........................................................................................................................................
[2]

(iv) Convert the binary floating-point number in part (a) into denary. Show your working.

Working .............................................................................................................................

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

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

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

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

Denary value .....................................................................................................................


[3]

© UCLES 2019 9608/32/O/N/19


13

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

© UCLES 2019 9608/32/O/N/19


14

BLANK PAGE

© UCLES 2019 9608/32/O/N/19


15

BLANK PAGE

© UCLES 2019 9608/32/O/N/19

You might also like