flat assembler
Message board for the users of flat assembler.

Index > Main > Floating point representation

Author
Thread Post new topic Reply to topic
playworld



Joined: 27 Dec 2006
Posts: 4
playworld
Iam learning floating point representation.I have two doubts, plz help,

1)0 10010011 10100010000000000000000 = 1.1010001 * 2 exp 20 = 1.638125 * 2 exp 23

Here 1010001 is mantissa part and 20 is exponent part , so 1.1010001 * 2 exp 20 but how this is equal to 1.638125 * 2 exp 23 . And also we need in decimal but 1.638125 * 2 exp 23 instead 1.638125 * 10 exp 23 .
How i interpreted is
1.1010001 * 2 exp 20 = 11010001 * 2 exp 13 = 209 * 2 exp 13 or 209 * 10 exp 13?
iam confused... Question


2) how 1.11....1(23 1's) = (2-2 exp(-23)) ?
Post 27 Dec 2006, 08:48
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
you have the fp number: 0 10010011 10100010000000000000000

it is 00 00 D1 49 in memory...

here we have a single-precision value. as you figured out, the exponent is:
10010011b = 147-(biasing constant which is 127) = 20.
10100010000000000000000 - is a real part of the number, so to convert it to decimal you do:
1*(2^-1)+0+1*2(^-3)+0+0+0+1*2(^-7) = 0.5+0.125+0.0078125 = 0.6328125.
so, you've got your number: 1.6328125 * 2^20 = 1712128
Post 27 Dec 2006, 12:31
View user's profile Send private message Reply with quote
playworld



Joined: 27 Dec 2006
Posts: 4
playworld
thanks zhak.
Post 27 Dec 2006, 13:33
View user's profile Send private message Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
Hey read Intel Docs and you'll have to never ask such trivial questions.
Post 28 Dec 2006, 08:59
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 490
Location: Belarus
zhak
m, even well organized documentation is not always clear, especially for newbies.
Post 28 Dec 2006, 09:45
View user's profile Send private message Reply with quote
Jack



Joined: 16 Feb 2005
Posts: 21
Jack
Post 29 Dec 2006, 00:41
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.