Advanced Data Representation and File Organisation: Question 9

Syllabus 13.3

Structured A2 11 marks

A weather station stores real numbers using binary 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
  • the mantissa's binary point placed immediately to the right of its sign bit, so the mantissa represents a fraction between -1 and +1, which is then multiplied by 2 raised to the power of the exponent.

A stored reading has mantissa 0101101000 and exponent 000100.

(a) State whether this mantissa, 0101101000, is normalised, explaining how you know. [2]

(b) Convert the exponent, 000100, to its denary value. [1]

(c) Convert the mantissa, 0101101000, to its denary fraction value, showing your working. [3]

(d) Hence state the overall denary value represented by this stored floating-point number. [1]

(e) A second reading is stored with mantissa 1011010000 and exponent 111110. Convert both parts to denary and state the overall denary value this represents, showing your working. [4]

Show worked solution Hide worked solution

Worked solution

Part (a): Checking normalisation

The mantissa 0101101000 has sign bit (the first bit) 0, so it represents a positive value. A positive mantissa is normalised when the bit immediately after the sign bit is 1, the form 0.1....

The bit immediately after the sign bit here is the second bit, 1. Since this is 1, the mantissa is normalised.

[2 marks]: [1] for correctly identifying the mantissa is positive from the sign bit 0, [1] for correctly checking and confirming the following bit is 1 and concluding it is normalised.

Part (b): Converting the exponent

The exponent 000100 is 6 bits long, held in two’s complement. Its sign bit (the first bit) is 0, so it represents a positive value, read as an ordinary binary number:

000100 = 0x32 + 0x16 + 0x8 + 1x4 + 0x2 + 0x1 = 4

So the exponent’s denary value is 4.

[1 mark] for the correct value, 4.

Part (c): Converting the mantissa to a denary fraction

The mantissa’s binary point sits immediately after the sign bit, so it is interpreted as a two’s complement fraction. Labelling the bits b0 (sign) through b9:

Mantissa:  0   1    0    1    1    0     1     0    0    0
Bit:      b0  b1   b2   b3   b4   b5    b6    b7   b8   b9
Weight:   -1  2⁻¹  2⁻²  2⁻³  2⁻⁴  2⁻⁵   2⁻⁶   2⁻⁷  2⁻⁸  2⁻⁹

The value is -b0 + (b1×2⁻¹ + b2×2⁻² + b3×2⁻³ + b4×2⁻⁴ + b5×2⁻⁵ + b6×2⁻⁶ + b7×2⁻⁷ + b8×2⁻⁸ + b9×2⁻⁹). Here b0 = 0, and the nonzero fraction bits are b1 = 1, b3 = 1, b4 = 1, b6 = 1 (all others are 0):

-0 + (1x0.5) + (1x0.125) + (1x0.0625) + (1x0.015625)
= 0.5 + 0.125 + 0.0625 + 0.015625
= 0.703125

So the mantissa’s denary fraction value is 0.703125.

[3 marks]: [1] for correctly identifying the sign bit contributes 0 (mantissa positive), [1] for correctly identifying the four nonzero fraction bits and their place values (2⁻¹, 2⁻³, 2⁻⁴, 2⁻⁶), [1] for the correct final sum, 0.703125.

Part (d): Combining mantissa and exponent

The overall value represented is the mantissa’s fraction value multiplied by 2 raised to the power of the exponent:

0.703125 x 2^4 = 0.703125 x 16 = 11.25

So the stored floating-point number represents 11.25.

[1 mark] for the correct final value, 11.25.

Part (e): A second stored reading

Mantissa 1011010000: the sign bit b0 = 1, so this mantissa is negative. Its nonzero fraction bits are b2 = 1, b3 = 1, b5 = 1:

-1 + (1x0.25) + (1x0.125) + (1x0.03125)
= -1 + 0.40625
= -0.59375

Exponent 111110: the sign bit is 1, so this exponent is negative. Reading its bits by two’s complement positional weight (-32, 16, 8, 4, 2, 1):

-32 + 16 + 8 + 4 + 2 + 0 = -2

Combining: the overall value is the mantissa value multiplied by 2 raised to the power of the exponent:

-0.59375 x 2^-2 = -0.59375 x 0.25 = -0.1484375

So this second reading represents -0.1484375.

[4 marks]: [1] for the correct mantissa value, -0.59375, [1] for the correct exponent value, -2, [1] for correctly applying a negative exponent as division/multiplying by a fraction rather than a larger positive power, [1] for the correct final value, -0.1484375.

Final answers

  • (a) Normalised (sign bit 0, followed immediately by 1).
  • (b) Exponent = 4
  • (c) Mantissa value = 0.703125
  • (d) Overall value = 11.25
  • (e) Second reading: mantissa = -0.59375, exponent = -2, overall value = -0.1484375