[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [fpu] '/' operator
on 9/3/00 19:19, Jamil Khatib at jamilkhatib75@yahoo.com wrote:
>
...
> but what about this exponent equations:
>
> E1 = e1 - 127
> E2 = e2 - 127
> E1 - E2 = (e1 - 127 )- (e2 - 127)
> E1 - E2 = e1 - 127 - e2 + 127
> = e1 - e2
> Please correct me if I am wrong
No, no, no, the default equation for the exponent is:
exp_result = expa - expb + 127;
However, there are a lot of exceptions. Read a good book.
>> 2) Why do you add 3 bits at the beginning of the
>> exponents ?
>> 3) Why do you add 8 bits at the end of both
>> fractions ?
>
> I am doing the conversion to the extended format which
> is 32 bit for fraction and 11 bit for exp
That is wrong. There is no need to convert to extended format.
>> 4) The reason you think that the '/' operator does
>> not work
>> is because you do not understand how to recover
>> precision. That
>> is done by shifting opa 23 bits to the left.
>
> Could you explaine more because I thought when I added
> the 8 bit to the right I am doing shift to the left!!
Yes, I understand that, but it's still wrong. You want to
add 23 bit to opa, and none to opb.
>> 5) You do not handle de-normalized numbers at all.
>>
>
> How did you get this conclusion?
Looking at your code.
rudi