An IEEE 754 single precision floating-point number is composed of the following three fields:
- 1-bit sign
- 2.8-bit biased exponent
- 3.23-bit fraction (a.k.a. mantissa or significand)
The fields are stored in a 32 bit word as defined in the following figure:
Figure 1. IEEE 754 Single Precision Format
The value of a floating-point number v in MicroBlaze has the following interpretation:
- If exponent = 255 and fraction <> 0, then v = NaN, regardless of the sign bit
- If exponent = 255 and fraction = 0, then v = (-1) sign * ∞
- If 0 < exponent < 255, then v = (-1) sign * 2( exponent -127) * (1.fraction)
- If exponent = 0 and fraction <> 0, then v = (-1) sign * 2-126 * (0.fraction)
- If exponent = 0 and fraction = 0, then v = (-1) sign * 0
For practical purposes only 3 and 5 are useful, while the others all represent either an error or numbers that can no longer be represented with full precision in a 32 bit format.