December 1998
LD201: LOGIC DESIGN

QUESTION 2

Total Marks: 20 Marks

Click here to access other questions

SUGGESTED SOLUTIONS
Solutions and allocated marks are indicated in green.
Return to Question 2

 

(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
  • sign modulus requires a separate substraction circuit (or more complex arithmetic process) one mark for either point
  • one's complement may require a second addition due to end-carry (or more complex arithmetic process) one mark for either point

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
  • begins 10: that is, it is a negative number for which the first bit to the right of the sign bit is 0 (1 mark).
  • begins 01: that is, it is a positive number for which the first bit to the right of the sign bit is 1 (1 mark).

 

(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
   = - 0.001010001 * 21
  
= - 0.0010100012
   = - (1/4 + 1/16 + 1/256)
   = - 81/256
   = - 0.31640625

one mark for correct complementation, one mark for scaling mantissa by exponent, one mark for conversion to decimal.