-
Member level 5
Achievements:
float32
Hi everybody,
i have min 0 and max 20
The value 0,1 is what in hex?
How is the way of calculation?
Dos excel support this?
Thanks
BR
Vauxdvihl
-
Banned
float32 hex
Hexadecimal notation doesn't support fractional numbers - only whole numbers.
-
Advanced Member level 4
Achievements:
dec2hex excel
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!!
-
Advanced Member level 5
Achievements:
Awards:
excel dec2hex install
Either avoid smiley character combinations in your post, e.g. inserting a space between "8" and ")", or select "Disable Smilies in this post".
-
Advanced Member level 4
Achievements:
what is float32
Fvm,
Thanks for the Smiley Face tip!
Regards,
Kral
-
Member level 5
Achievements:
float32 to hex
The ranges 0 -20 must not be considered?
Thanks
Added after 2 hours 45 minutes:
It is very strange, because your result does not match with
http://www.h-schmidt.net/FloatApplet/IEEE754.html
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
I am lost, what is right?
Thanks
-
Advanced Member level 4
Achievements:
float32 ieee
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:
.
http://people.rit.edu/jdweme/labview...Conversion.pdf
-
Member level 5
Achievements:
how to convert decimal to ieee 754 hexadecimal
I need it for a µC Star12 from Freescale XET device
Thanks
BR
Sascha
I was not aware that there are different standards of converting a number