# 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 stored using the following floating point formats: (a) IEEE 754 (single precision), (b) USASI.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern