LN2-numberRep_ans

LN2-numberRep_ans - FIT1001: RevisionLN02_ans 1. Consider...

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: FIT1001: RevisionLN02_ans 1. Consider the number 10011110 a. Convert it to hexadecimal notation Just bit pattern: 1001 1110 = 1001 1110 = 9E b. Assuming 2’s complement notation, convert it to decimal notation. 10011110 flip & add 1 to make it positive 01100010 = 26+25+22= 64+32+4 = 98 -9810 = 01100001 + 1 c. What is the highest number you can represent in 8 bits 2s complement? What is the lowest? Highest: 2k-1-1= 27-1=127 Lowest: -2k-1= -27= -128 2. Convert -370.75 from decimal notation to 16-bit floating point representation. Assume 8 bits for the mantissa and 7 bits for the exponent. Show all working. 370 = 101110010 0.75 = 0.5 + 0.25 = 2-1+2-2 = 0.11 Alternative: keep multiplying by 2 until no decimal fractions, convert to binary, and move to the right by the number of multiplications done, e.g., 0.75x2 1.5x2 3 Represent 3 in binary = 11 Move to the right twice: 0.11 370.75 =101110010.11 1.0111001011 x 28 Mantissa (drop leading 1): 01110010 (note that last 2 bits are removed, which causes loss of precision) Sign: 1 Exponent (excess-k) – we have 7 bits for the exponent: K= 27-1-1 = 63 represent 8 63+8 = 71 1000111 Result: 1 1000111 01110010 1. What is the highest exponent you can represent? What is the lowest? Highest: 2k-1= 27-1=64 Lowest: -(2k-1-1) = -(27-1-1)= -63 Page 1 of 1 ...
View Full Document

This note was uploaded on 08/15/2010 for the course FIT 1001 taught by Professor Egerton during the Three '10 term at Monash.

Ask a homework question - tutors are online