December
1998 QUESTION 2 Total Marks: 20 Marks |
Click here to access other
questions
SUGGESTED SOLUTIONS
|
(a) | In the context of floating point numbers, what is meant by normalisation? Why is this process necessary? | [3] |
Normalisation is the
process of rescaling a floating point number so that the magnitude of the mantissa is
greater than or equal to 0.12 , but strictly less than 1.02
. one mark, giving the numerical condition as an inequality would suffice. It is necessary to avoid multiple representations of the same number (1 mark) and to maintain as many significant bits as possible in the mantissa (1 mark) one mark for each of these two points
|
||
(b) | Explain carefully why 2's complement format is used in preference to the older formats of sign-modulus and 1's complement. | [2] |
2's complement format is
used in preference because
if the candidate states that arithmetic is simpler in 2's complement than in either of 1's complement or sign modulus, then they should receive both marks.
|
||
(c) | 2's complement numbers can be multiplied by powers of 2 using the operation of arithmetic shift left. Explain the two circumstances in which this operation can cause an overflow to occur. | [2] |
arithmetic shift left
when the number in question
|
||
(d) | Can the corresponding arithmetic shift right operation ever cause an overflow? | [1] |
The arithmetic shift
right operation can never cause an overflow, because divides the number by two - the
magnitude is reduced. one mark for a suitable explanation: no explanation = no mark
|
||
(e) | (i) Show how the hexadecimal number -1.4416 can be written in normalised floating point format, with a 10-bit mantissa and a 4-bit exponent. | [4] |
-1.AA16 = - 0001.1010 10102 = - 0.110101010 * 21 = 1 001010110 * 0 001 one mark for correct conversion to binary, one mark for rescaling for normal form, one mark for correct mantissa, and one mark for correct exponent.
|
||
(ii) Show how the octal number 1.2628 can be written in the same normalised floating point format, with a 10-but mantissa and a 4-bit exponent. | [4] | |
1.2628 = 001 . 010 110 0102 = 0.1010110010 * 21 = 0 101011001 * 0 001 one mark for correct conversion to binary, one mark for rescaling for normal form, one mark for correct mantissa, and one mark for correct exponent.
|
||
(iii) Working in the same floating point format,
perform floating point addition to calculate the sum -1.AA16 + 1.2628 = ... Convert your answer to decimal format |
[4] | |
1001010110 + 0101011001 ______________ = 1110101111 one mark for correct binary addition 1110101111 * 21 one mark for correct complementation, one mark for scaling mantissa by exponent, one mark for conversion to decimal. |