Computer Hope

Software => Computer programming => Topic started by: stevthym on March 26, 2012, 06:48:35 AM

Title: IEEE short real floating point format
Post by: stevthym on March 26, 2012, 06:48:35 AM
Hi!

I have a decimal number (e.g 6433) and would like to see the process of converting this to IEEE short real floating point format!

Any help is appreciated ;)
Title: Re: IEEE short real floating point format
Post by: Allan on March 26, 2012, 06:51:19 AM
Sorry, we don't help with homework.
Title: Re: IEEE short real floating point format
Post by: Ironman on April 07, 2012, 11:25:51 PM
The rules for converting a decimal number into floating point are as follows:

A. Convert the absolute value of the number to binary, perhaps with a fractional part after the binary point. This can be done by converting the integral and fractional parts separately. The integral part is converted with the techniques examined previously. The fractional part can be converted by multiplication. This is basically the inverse of the division method: we repeatedly multiply by 2, and harvest each one bit as it appears left of the decimal.
   
B. Append × 20 to the end of the binary number (which does not change its value).

C. Normalize the number. Move the binary point so that it is one bit from the left. Adjust the exponent of two so that the value does not change.

D. Place the mantissa into the mantissa field of the number. Omit the leading one, and fill with zeros on the right.
   
E. Add the bias to the exponent of two, and place it in the exponent field. The bias is 2k−1 − 1, where k is the number of bits in the exponent field. For the eight-bit format, k = 3, so the bias is 23−1 − 1 = 3. For IEEE 32-bit, k = 8, so the bias is 28−1 − 1 = 127.

F. Set the sign bit, 1 for negative, 0 for positive, according to the sign of the original number.

Read this for more info:
http://en.wikipedia.org/wiki/Decimal_floating_point

And you can Google a bunch of convertors that you can use.
Title: Re: IEEE short real floating point format
Post by: Geek-9pm on April 08, 2012, 02:05:01 AM
The IEEE 754 is not the ultimate floating point format. But it is called a standard and has been adjusted and modified.
http://en.wikipedia.org/wiki/IEEE_754-2008
If using Intel based systems, one should read this:
http://www.intel.com/standards/floatingpoint.pdf
Read it! Impress your teacher!
The link below is only for Math Majors.
What Every Computer Scientist Should Know About Floating-Point Arithmetic (http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html)
The best way to convert a number to floating pewit is with a computer.
Tell your teacher I said that.