flat assembler
Message board for the users of flat assembler.

 Index > Main > Floating point representation
Author
 Thread
playworld

Joined: 27 Dec 2006
Posts: 4
playworld 27 Dec 2006, 08:48
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...

2) how 1.11....1(23 1's) = (2-2 exp(-23)) ?
27 Dec 2006, 08:48
zhak

Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 27 Dec 2006, 12:31
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
27 Dec 2006, 12:31
playworld

Joined: 27 Dec 2006
Posts: 4
playworld 27 Dec 2006, 13:33
thanks zhak.
27 Dec 2006, 13:33
m

Joined: 28 Dec 2006
Posts: 304
Location: in
m 28 Dec 2006, 08:59
Hey read Intel Docs and you'll have to never ask such trivial questions.
28 Dec 2006, 08:59
zhak

Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 28 Dec 2006, 09:45
m, even well organized documentation is not always clear, especially for newbies.
28 Dec 2006, 09:45
Jack

Joined: 16 Feb 2005
Posts: 21
Jack 29 Dec 2006, 00:41
29 Dec 2006, 00:41
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum

Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.