0% found this document useful (0 votes)
265 views

IEEE 754 Tutorial - Converting To IEEE 754 Form

The document explains the steps to convert a single-precision IEEE 754 binary number to a decimal floating-point value. It breaks the 32-bit number into three parts: the sign bit, 8-bit exponent, and 23-bit fraction. It describes how to determine the number is negative from the sign bit, calculate the exponent value and subtract the bias of 127, and convert the fraction to base 10 by multiplying each bit by a power of 2. Putting it all together into the IEEE 754 expression results in the decimal value of approximately -6.8.

Uploaded by

Subrat Dhal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
265 views

IEEE 754 Tutorial - Converting To IEEE 754 Form

The document explains the steps to convert a single-precision IEEE 754 binary number to a decimal floating-point value. It breaks the 32-bit number into three parts: the sign bit, 8-bit exponent, and 23-bit fraction. It describes how to determine the number is negative from the sign bit, calculate the exponent value and subtract the bias of 127, and convert the fraction to base 10 by multiplying each bit by a power of 2. Putting it all together into the IEEE 754 expression results in the decimal value of approximately -6.8.

Uploaded by

Subrat Dhal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

2/19/13

IEEE 754 tutorial: Converting to IEEE 754 Form

IEEE 754 Notation


Example: Converting to Float

Convert the following single-precision IEEE 754 numb er into a floating-point decimal value. 1 10000001 10110011001100110011010

1. First, put the bits in three groups. Bit 31 (the leftmost bit) show the sign of the number. Bits 23-30 (the next 8 bits) are the exponent. Bits 0-22 (on the right) give the fraction

2. Now, look at the sign bit. If this bit is a 1, the number is negative. If it is 0, the number is positive. This bit is 1, so the number is negative.

3. Get the exponent and the correct bias. The exponent is simply a positive binary number. 10000001bin = 129ten Remember that we will have to subtract a bias from this exponent to find the power of 2. Since this is a single-precision number, the bias is 127.

4. Convert the fraction string into base ten. This is the trickiest step. The binary string represents a fraction, so conversion is a little different. Binary fractions look like this: 0.1 = (1/2) = 2-1 0.01 = (1/4) = 2-2 0.001 = (1/8) = 2-3

So, for this example, we multiply each digit by the corresponding power of 2: 0.10110011001100110011010bin = 1*2-1 + 0*2-2 + 1*2-3 + 1*2-4 + 0*2-5 + 0 * 2-6 + ... 0.10110011001100110011010bin = 1/2 + 1/8 + 1/16 + ... Note that this number is just an approximation on some decimal number. There will most likely be some error. In this case, the fraction is about 0.7000000476837158.

5. This is all the information we need. We can put these numbers in the expression:
class.ece.iastate.edu/arun/CprE281_F05/ieee754/ie5.html 1/2

2/19/13

IEEE 754 tutorial: Converting to IEEE 754 Form

(-1)sign bit * (1+fraction) * 2 exponent - bias = (-1)1 * (1.7000000476837158) * 2 129-127 = -6.8 The answer is approximately -6.8. Return to index ->

class.ece.iastate.edu/arun/CprE281_F05/ieee754/ie5.html

2/2

You might also like