# PS2s - Department of Electrical and Computer Engineering...

This preview shows pages 1–3. Sign up to view the full content.

Department of Electrical and Computer Engineering McGill University ECSE-322 Computer Engineering Fall 2010 Problem Set 2 - Solutions 1. Floating point representation: (a) Show the IEEE-754 binary representation of the number –0.75 (i.e.- ¾ in base 10) using the single precision format. Solution: For IEEE, bit 31 is the sign but, bits 30-23 are the exponent bits and are stored in excess-127, and the rest are for the mantissa using hidden bit normalization. -0.75 = -3/4 = -3 * 2 -2 = -1.5 *2 -1 The resultant representation is: 10111111010000000000000000000000, where the sign=-1, the exponent=-1 and the mantissa=1.5 (b) What floating point number (in IEEE-754 format) is represented by the following: 00110000001000000000000000000000 Solution: 00110000001000000000000000000000 = -1 0 x 2 (96-127) x (1 + 2 -2 ) = 5.820766x10 -10 (c) Represent 0.125 16 5 and -0.125 x 16 -5 in USASI. Solution: Recall that, for USASI, bit 0 = sign bit bits 1-7 = exponent bits stored in excess-64 bits 8-31 mantissa bits (six hexadecimal digits normalized fraction)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
The exponent 5 in excess 64 is equal to 69 (1000101) The mantissa 0.125 is 1/8 = 2/16 = 2*16 -1 , thus 0.2 in hexadecimal (hence 0100 …) The exponent –5 in excess 64 is equal to 59. Thus resulting representation follows: 0.125 x 16 5 is represented as 0 1000101 0010 0000 0000 0000 0000 0000 -0.125 x 16 -5 is represented as 1 0111011 0010 0000 0000 0000 0000 0000 (d) Identify how infinity, not a number, and 0 are represented in IEEE-754 and USASI. Solution: IEEE-754: Infinity: all exponent values are =1, all mantissa values are = 0. NaN : all exponent values are = 1, mantissa = non zero 0: all bits are = 0 USASI: Cannot represent infinity or NAN 0: Mantissa bits are 0 2. Determine the maximum relative error and minimum and maximum values of a real number
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/22/2010 for the course ECSE ECSE 322 taught by Professor Lowther during the Winter '04 term at McGill.

### Page1 / 5

PS2s - Department of Electrical and Computer Engineering...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online