4.2.2 Example 1

The representation of -5.625 as a single precision floating point number.

The sign bit is 1 because the value being represented is negative.

The binary representation of 5.625 is 1012 plus .1012. This means the unnormalized representation is 101.1012 20.

A floating point number is normalized when the value to the left of the binary point of the mantissa is exactly one. We can normalize a value by shifting the binary point and adjusting the exponent at the same time. Let us define ls(x,n) be the left shift function, it left shifts the binary representation of value x by n bits.

Then, m 2e = ls(m,1) 2e1 = rs(m,1) 2e+1.

Knowing this, 101.1012 20 = 1.011012 22 after two right shift operations. Remember, however, that only the digits to the right of the binary point are represented. The exponent is also represented using a biased format. The bias of a single precision floating point number is 127, as a result, 127 + 2 = 129 should be represented as the exponent bit pattern.

As a result, the representation of -5.625 is illustrated in table 2.





signexponent mantissa



1 129 = 10000001201101000000000000000000




Table 2: Representation of -5.625 as a single precision floating point number.