Where is my error?
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
Where is my error?

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture
Author Message
Red Dragon
Guest





Posted: Sun Nov 06, 2005 1:15 am    Post subject: Where is my error? Reply with quote

Can somebody explain to me why 1 in hexadecimal floating point is
3F800000?
My calculation is 7F800000

Here is my calculation.
1 = 1.0 x 2 power 0

Excess 127 is 1111111

Therefore floating number
in Binary is
0 111 1111 1000 000000000000.......
which is 7 F 8 00000 in Hex

Therefore 7F800000
Where is my mistake??

Thanks
Khoon.
Back to top
Red Dragon
Guest





Posted: Sun Nov 06, 2005 9:15 am    Post subject: Re: Where is my error? Reply with quote

Quote:

Your mistake is in that 127 contains 7 ones, but you wrote 8,
so your exponent is 255, or +128 after subtracting the bias.

Correct number:

0011 1111 1000 000000000...
^ ^
|exponent|

Now I see my mistake
Thank you very very much.
Regards,
Khoon.

..
Back to top
Paul Pluzhnikov
Guest





Posted: Sun Nov 06, 2005 9:15 am    Post subject: Re: Where is my error? Reply with quote

"Red Dragon" <tskhoon@streamyx.com> writes:

Quote:
0 111 1111 1000 000000000000.......
which is 7 F 8 00000 in Hex

Therefore 7F800000
Where is my mistake??

Your mistake is in that 127 contains 7 ones, but you wrote 8,
so your exponent is 255, or +128 after subtracting the bias.

Correct number:

0011 1111 1000 000000000...
^ ^
|exponent|

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB