Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Vauxdvihl,
Multiply 0,1 By 2^32 in decimal. The result is 429496729.6
.
Round the result to an integer. The result is 429496730.
.
Convert the integer result to Hex. The result is 1999999A.
.
The result is the base 32 representation of the fraction with the MSB having a weighting of 0,5.
.
Excel has a function "DEC2HEX" That converts decimal to hex. So you would do the multiplication and rounding in Excel, and then use "=DEC2HEX(429496730,8) to get the final result.
.
You must install the Excel Analysis Tool Pack in order to get the function "DEC2HEX" in Excel:
.
On the Tools menu, click Add-Ins.
In the Add-Ins available list, select the Analysis ToolPak box, and then click OK.
If necessary, follow the instructions in the setup program.
Regards,
Kral
Added after 2 minutes:
I'm not sure how the smiley face got into the reply. It should read =DEC2HEX(429496730,8)
Added after 2 minutes:
It got in there again! the characters after the comma should be 8). Can anybody help me on this?
Added after 2 minutes:
One more try! The characters after the comma should be the numeral 8 followed by a right parentesis. Help!!
It is very strange, because your result does not match with
**broken link removed**
Enter value 0,1 and you receive another value then you provided one.
Also a kollege is sending me this information:
mit 32bit ist bei
Min: 0 und
Max: 20.0
eine Auflösung von: 0,000000004656612873077392578125 möglich (0 bis 4294967295).
Das bedeutet 20 entspricht 4294967295 = 11111111111111111111111111111111 = FFFFFFFFhex.
Das bedeutet 0 entspricht 0 = 00000000000000000000000000000000 = 00000000hex.
Das bedeutet 0,1 entspricht 21474836 = 1010001111010111000010100 = 147AE14hex
Vauxdvihl,
The algorithm I gave is strictly for converting a decimal fraction to a hex representation. If you want to convert to IEEE-754 you must do the additional work of incorporating the "invisible" leading 1, the sign and the exponent.
Regards,
Kral
Added after 26 minutes:
For an example of the conversion process, see the article at:
.
**broken link removed**
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.