3

If I wanted to convert a number Ex. 32.24x10^5 to IEEE 754 standard BY HAND how would I do it?

2
  • This a programming related Q&A site and not HAND related. Commented Sep 30, 2010 at 6:43
  • 1
    There's a nice java applet here which visually demonstrates how IEEE 754 floats work. Commented Sep 30, 2010 at 6:47

2 Answers 2

6

First, read and familiarize yourself with some information about the format. Then convert the whole number to binary. Then determine the exponent (power of two of course) to normalize the mantissa. Then encode the mantissa in the appropriate bits and the exponent in the appropriate bits.

32.24E5 = 3224000 = 1100010011000111000000b = 1.100010011000111000000b E 21 (that's 2^21) = 1.100010011000111000000b E 10101b 

So now, encode the two values into the exponent portion and the mantissa portion (keep in mind that the leading one in the mantissa isn't included, it's assumed to be one always (depending on the format, hence the familiarize step)).

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks! I finally got understand now. Would the process be the same for a negative exponent?
Yes, but if I'm not mistaken, a negative exponent is represented with two's compliment.
Exponents -- positive or negative -- are represented in "biased" form, not two's complement.
1

The following links should be helpful in figuring it out:

http://en.wikipedia.org/wiki/Floating-point_number

http://www.h-schmidt.net/FloatApplet/IEEE754.html

You could also google for comp.sci university lectures because students often have to do something like that when they learn basics of computing etc.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.