IEEE 754 single precision FPS (1 Viewer)

JigglyJims

New Member
Joined
Mar 18, 2009
Messages
12
Gender
Male
HSC
2009
hey guys,

I really need some help, apparently this can be in our trial exam, and our teacher hasn't taught it to us, aka, he can't teach it to us.

Here is the question:

The following sequence of hexadecimal digits is found at a specific address in memory:
C1 D1 00 00
This memory address contains the value of a floating point variable represented using standard IEEE single precision FPS Format.
Determine the decimal value of this variable. Show all working.

If someone could help us out with how to do this, + working, that would be great.

Cheers.
 

lolrofllol

Member
Joined
Feb 29, 2008
Messages
127
Gender
Male
HSC
2009
hey guys,

I really need some help, apparently this can be in our trial exam, and our teacher hasn't taught it to us, aka, he can't teach it to us.

Here is the question:

The following sequence of hexadecimal digits is found at a specific address in memory:
C1 D1 00 00
This memory address contains the value of a floating point variable represented using standard IEEE single precision FPS Format.
Determine the decimal value of this variable. Show all working.

If someone could help us out with how to do this, + working, that would be great.

Cheers.

First convert the hexadecimal digits into binary nibbles (groups of four)

C = 1100 (12)
1 = 0001
D = 1101 (13)
1 = 0001
0 = 0000
0 = 0000
0 = 0000
0 = 0000

write out the binary string in floating point format (single precision 32 bit)
1 bit sign bit, 8 bit exponent, 23 bit mantissa

1 10000011 10100010000000000000000

from now, you convert into decimal as you normally would with floating point numbers, using this formula:

(2^exponent - 127) * mantissa

2^10000011 - 01111111
2^131 - 127
2^4
16

16 * mantissa
16 * 1.1010001...
16 * (1 + 1/2 + 1/8 + 1/128) I can't do this without a calculator -_-
16 * 1.6328125

26.125 (base 10) is the number

BUT REMEMBER - the sign bit was 1

-26.125 is the final answer

(I hope this helps and I hope it's right, sorry for late reply you've already done trials)
 

JigglyJims

New Member
Joined
Mar 18, 2009
Messages
12
Gender
Male
HSC
2009
That's alright, cheers mate, that helps tonnes, I'm in the process of working out how to do the after decimal conversion without a callculator...

Thanks for the Help
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top