+ Post New Thread

Results 1 to 8 of 8

- 3rd July 2009, 17:22 #1

- Join Date
- Jan 2000
- Posts
- 94
- Helped
- 0 / 0
- Points
- 2,722
- Level
- 12

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

- 3rd July 2009, 17:22

- 3rd July 2009, 18:35 #2

- Join Date
- Apr 2009
- Location
- New Jersey, USA
- Posts
- 671
- Helped
- 170 / 170
- Points
- 7,016
- Level
- 19

## float32 hex

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

- 3rd July 2009, 18:35

- 3rd July 2009, 20:36 #3

- Join Date
- Mar 2005
- Location
- USA
- Posts
- 1,326
- Helped
- 278 / 278
- Points
- 11,626
- Level
- 25

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

- 3rd July 2009, 20:36

- 3rd July 2009, 23:49 #4

- Join Date
- Jan 2008
- Location
- Bochum, Germany
- Posts
- 37,548
- Helped
- 11508 / 11508
- Points
- 219,217
- Level
- 100

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

- 3rd July 2009, 23:53 #5

- Join Date
- Mar 2005
- Location
- USA
- Posts
- 1,326
- Helped
- 278 / 278
- Points
- 11,626
- Level
- 25

## what is float32

Fvm,

Thanks for the Smiley Face tip!

Regards,

Kral

- 3rd July 2009, 23:53

- 6th July 2009, 11:03 #6

- Join Date
- Jan 2000
- Posts
- 94
- Helped
- 0 / 0
- Points
- 2,722
- Level
- 12

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

- 6th July 2009, 18:23 #7

- Join Date
- Mar 2005
- Location
- USA
- Posts
- 1,326
- Helped
- 278 / 278
- Points
- 11,626
- Level
- 25

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

- 7th July 2009, 08:46 #8

- Join Date
- Jan 2000
- Posts
- 94
- Helped
- 0 / 0
- Points
- 2,722
- Level
- 12

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

+ Post New Thread

Please login