Single Precision - 2024.2 English

MicroBlaze Processor Reference Guide (UG984)

Document ID
UG984
Release Date
2024-11-27
Version
2024.2 English

An IEEE 754 single precision floating-point number is composed of the following three fields:

  1. 1-bit sign
  2. 2.8-bit biased exponent
  3. 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:

  1. If exponent = 255 and fraction <> 0, then v = NaN, regardless of the sign bit
  2. If exponent = 255 and fraction = 0, then v = (-1) sign * ∞
  3. If 0 < exponent < 255, then v = (-1) sign * 2( exponent -127) * (1.fraction)
  4. If exponent = 0 and fraction <> 0, then v = (-1) sign * 2-126 * (0.fraction)
  5. 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.