Number Systems (15)
(a) Represent the integer -5010 in 8 bits in each of the
following three formats:
sign-modulus, ones complement, and twos complement. [3]
sign-modulus
1011 0010
ones complement 1100 1101
twos complement 1100 1110
(one mark each)
(b) This question concerns a 12-bit floating-point number format,
consisting of an
8-bit mantissa followed by a 4-bit exponent, both in twos complement.
(i) What values (in decimal) are represented by the 12-bit patterns
AC716
and 62616? [4]
AC716
= 1.010 1100 | 01112
= (- 128 + 32 + 8 + 4)/128 × 27
= - 84/128 × 128
= - 84
62616
= 0.110 0010 | 01102
= (64 + 32 + 2)/128 × 26
= 98/128 × 64
= 49
(For each value, 1 mark for working and 1 mark for correct
answer.)
(ii) Add these two numbers in binary (show your working), and express
the
result in decimal. [4]
The number
with the smaller exponent, that is, the second number,
should be rescaled to 0.011 0001 | 0111. Now the mantissae add to
1010 1100
0011 0001
1101 1101
and we have
1.101 1101 | 01112
= (- 128 + 64 + 16 + 8 + 4 + 1)/128 × 27
= - 35/128 × 128
= - 35
(1 mark for rescaling, 1 mark for adding the mantissae correctly,
1
mark for interpreting the resulting bit pattern correctly, and 1 mark
for converting that to decimal.)
(iii) Explain the purpose of normalisation, and normalise your
answer to part
(ii). [2]
Normalising maximises the precision available
to represent a
number (1 mark). In this case, the result should be normalised to
1.011 1010 | 01102 (1 mark).
(iv) Express in hexadecimal and in decimal the smallest negative value,
that
is the negative value closest to zero, that can be expressed in this
floating-point format. [2]
The minimum value is C0816 (1
mark), which is
0.5 × 2 -8 = 2 -9= 1/512
(1 mark for any of these).
|