Tues, 6th Oct 2015, 18:05 Re: Practice Test 2011, floating point problem

A student writes: > On the Fall semester exam #1 for 2011, question 1-e, it states that the > number 01001001 is exactly equal to 3 and 1/8ths. I understand that 11.001 > = 3 1/8. and that if we normalize that it becomes 1.1001 x 2^1. Therefore, > there seems to be an excess of three in the exponent bits, as it is equal > to 4. However, I don't understand what the purpose of having an excess code > is, nor do I know why the fraction bits add up to 9. It's a little > confusing to me and I'm not exactly super well off in the class, so I would > be very grateful for your help. > > Thank you. > <<name withheld to protect the student whois not super well off in the class>> First, you made the correct first step: Normalizing the number to 1.1001 x 2^1. You want to end up with 01001001, which I will break into: 0 100 1001. The leading 0 is the sign bit, which is positive. The bits 100 reflects that if you add the exponent (1) to the excess (3), you get 4, which is 100. The *reason* for using an excess code I think I will leave for 460N. It is another one of those items that you really do not have to learn this semester to build your foundation. The actual excess is the unsigned value expressed as 011...1 in the number of exponent bits. In this case there are three bits of exponent, so the excess is 011, which is 3. Finally the bits 1001 are the fraction bits you get if you remove the 1 to the left of the binary point. We don't bother storing it because we know it is a 1 and there is no point wasting a bit of storage to store something we know its value. Hope this helps. Good luck tomorrow. Yale Patt