Continue to Site

Welcome to EDAboard.com

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.

HOw to convert float32 to hex?

Status
Not open for further replies.

Vauxdvihl

Member level 5
Joined
Dec 31, 1999
Messages
94
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
611
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
 

float32 hex

Hexadecimal notation doesn't support fractional numbers - only whole numbers.
 

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!!
 

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".
 

what is float32

Fvm,
Thanks for the Smiley Face tip!
Regards,
Kral
 

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
**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

I am lost, what is right?
Thanks
 

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:
.
**broken link removed**
 

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
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top