Nios II Custom Instruction User Guide

ID 683242
Date 4/27/2020
Document Table of Contents
Give Feedback

5.2. IEEE 754 Format

The figure below shows the fields in an IEEE 754 32-bit single-precision value. The table below provides a description of the fields. Normal single-precision floating point numbers have the value (-1) S * 1.FRAC * 2 EXP -127 .
Figure 20. Single-Precision Format
Table 9.  Single-Precision Field Descriptions
Mnemonic Name Description
FRAC Fraction Specifies the fractional portion (right of the binary point) of the mantissa. The integer value (left of the binary point) is always assumed to be 1 for normal values so it is omitted. This omitted value is called the hidden bit. The mantissa ranges from ≥1.0 to <2.0.
EXP Biased Exponent Contains the exponent biased by the value 127. The biased exponent value 0x0 is reserved for zero and subnormal values. The biased exponent value 0xff is reserved for infinity and NaN. The biased exponent ranges from 1 to 0xfe for normal numbers (-126 to 127 when the bias is subtracted out).
S Sign Specifies the sign. 1 = negative, 0 = positive. Normal values, zero, infinity, and subnormals are all signed. NaN has no sign, so the S field is ignored.
The IEEE 754 standard provides the following special values:
  • Zero (EXP=0, FRAC=0)
  • Subnormal (EXP=0, FRAC≠0)
  • Infinity (EXP=255, FRAC=0)
  • NaN (EXP=255, FRAC≠0)
Note: Zero, subnormal, and infinity are signed as specified by the S field. NaN has no sign so the S field is ignored.