Floating-Point Representation: Precision and Range

Floating-Point Representation stores a numerical value using a sign, a limited collection of significant digits, and a scale factor. You encounter it when a processor stores measurements, simulation results, or other values spanning many magnitudes. Its central tradeoff is that a fixed number of bits provides a wide range of values while leaving gaps between exactly representable numbers.

From a value to fields

A nonzero normal binary value has the form


x=(−1)sm 2e,1≤m<2.x=(-1)^s m\,2^e,\qquad 1\le m<2.


The significand, mm, contains the significant binary digits. The sign bit ss is zero for positive values and one for negative values. The exponent ee scales the significand by a power of two. Moving the binary point changes the exponent while preserving the value.


For example, 101.12=1.0112×22101.1_2=1.011_2\times2^2. The normalized form places exactly one nonzero binary digit before the point. Since that digit is always one, a normal binary format can leave it unstored.


The IEEE 754 binary32 format uses one sign bit, eight exponent bits, and 23 fraction bits. Let EE be the unsigned integer stored in the exponent field, and let FF be the unsigned integer stored in the fraction field. For a normal value,


x=(−1)s(1+F223)2E−127,1≤E≤254.x=(-1)^s\left(1+\frac{F}{2^{23}}\right)2^{E-127},\qquad 1\le E\le254.


The exponent bias is 127: encoding adds 127 to ee, and decoding subtracts 127 from EE. The fraction field supplies the digits after the implicit leading one. Consequently, normal binary32 values have 24 significant binary bits, even though only 23 fraction bits are stored.



Precision, spacing, and rounding

Precision describes how many significant digits the format retains; range describes how large or small its values can be. Increasing the exponent does not create more significant digits. It increases the scale of the existing digits.


For a binary format with pp significant bits, consecutive positive normal values within [2e,2e+1)[2^e,2^{e+1}) have spacing


Δ=2e−(p−1).\Delta=2^{e-(p-1)}.


Thus, spacing doubles when the exponent increases by one. A format can distinguish small changes near zero that it cannot distinguish at a much larger magnitude.


A schematic binary32 field layout appears above a number line showing unequal spacing in a three-bit precision format.


Example: In an illustrative format with three significant binary bits, the representable values between one and two are spaced by 2−2=0.252^{-2}=0.25. The exact value 1.341.34 rounds to 1.251.25 under round-to-nearest because its distances to 1.251.25 and 1.51.5 are 0.090.09 and 0.160.16.


With round-to-nearest, ties-to-even, an exact midpoint goes to the candidate whose last retained binary bit is zero. For example, 1.3751.375 lies halfway between 1.0121.01_2 and 1.1021.10_2, so it rounds to 1.102=1.51.10_2=1.5 in that illustrative format.



Reserved encodings and small values

The normal-value formula applies only when the stored exponent is between 1 and 254. The remaining exponent patterns have separate meanings.


Stored exponent EE

Fraction integer FF

Interpretation

1–254

Any allowed value

Normal finite value

0

0

Positive or negative zero, according to ss

0

Nonzero

Subnormal finite value

255

0

Positive or negative infinity, according to ss

255

Nonzero

Not-a-Number, abbreviated NaN


Subnormal values use


x=(−1)sF2232−126.x=(-1)^s\frac{F}{2^{23}}2^{-126}.


They fill the gap between zero and the smallest positive normal value, 2−1262^{-126}, with constant spacing 2−1492^{-149}. They do not retain the full relative precision available to normal values. Infinity represents an unbounded result in situations such as overflow under round-to-nearest; NaN represents results such as the invalid operation zero divided by zero.

What to remember

  • Decode the exponent category before inserting an implicit leading bit.
  • Normal binary32 values have 24 significant bits and exponent bias 127.
  • Larger normal magnitudes have larger absolute gaps between stored values.
  • Rounding selects a representable value; it does not make every real value exactly representable.

Example: Encoding a Sensor Voltage

A laboratory data-acquisition system stores voltage readings using IEEE 754 binary32. One exact input is −13.25 V-13.25\ \text{V}. Binary32 uses one sign bit, eight exponent bits with bias 127, and 23 fraction bits. Assume round-to-nearest, ties-to-even.


a) Write the numerical voltage in normalized binary form.


First separate the negative sign from the magnitude. The integer part is 13=8+4+113=8+4+1, and the fractional part is 0.25=2−20.25=2^{-2}. The binary magnitude is therefore ________ with base two understood.


Normalization places one nonzero binary digit before the binary point and adjusts the exponent to preserve the value. Moving the point three places left gives the actual exponent ________.


−13.25 V=−1101.012 V=−1.101012×23 V.-13.25\ \text{V}=-1101.01_2\ \text{V}=-1.10101_2\times2^3\ \text{V}.


The normalized form is −1.101012×23 V-1.10101_2\times2^3\ \text{V}. Its significand magnitude lies between one and two, which checks the normalization.


b) Give the sign, exponent, and fraction fields in binary, and determine whether storage changes the voltage.


The negative voltage requires s=1s=1. Add the bias to the actual exponent; the stored exponent's decimal value is ________.


E=e+127=3+127=130=100000102.E=e+127=3+127=130=10000010_2.


For a normal value, the leading one is implicit. Copy only the bits after the binary point, 1010110101, into the fraction field and append zeros until the field contains 23 bits.


The fields are sign: 11; exponent: 10000010210000010_2; fraction: 10101000000000000000000210101000000000000000000_2.


Check the encoded magnitude by decoding its nonzero fraction places:


x=−(1+2−1+2−3+2−5)23 V=−(1.65625)(8) V=−13.25 V.x=-\left(1+2^{-1}+2^{-3}+2^{-5}\right)2^3\ \text{V} =-\left(1.65625\right)(8)\ \text{V} =-13.25\ \text{V}.


The finite expansion fits within the available fraction field. The stored voltage is exactly −13.25 V-13.25\ \text{V}, with zero representation error for this input.


c) Find the spacing between neighboring stored voltages near this reading and the largest absolute error from rounding an exact voltage in this neighborhood. Give both results in microvolts to three significant figures.


The magnitude lies between 232^3 and 242^4, so use e=3e=3. Normal binary32 includes the implicit leading one and therefore has ________ significant binary bits. The spacing exponent is 3−(24−1)=3-(24-1)= ________.


Δ=23−(24−1) V=2−20 V=0.95367431640625 μV.\Delta=2^{3-(24-1)}\ \text{V}=2^{-20}\ \text{V} =0.95367431640625\ \mu\text{V}.


The spacing magnitude is the same for the corresponding negative values. Under round-to-nearest, an exact value between two adjacent stored voltages is at most half their separation from the chosen result. This local bound assumes rounding to the nearest representable value.


∣error∣max⁡=Δ2=2−21 V=0.476837158203125 μV.|\text{error}|_{\max}=\frac{\Delta}{2}=2^{-21}\ \text{V} =0.476837158203125\ \mu\text{V}.


The spacing is 0.954 μV0.954\ \mu\text{V}, and the largest absolute rounding error in this neighborhood is 0.477 μV0.477\ \mu\text{V}, both to three significant figures. The particular input in this example has zero error because it is itself representable.

A processor stores a normal IEEE 754 binary32 value using one sign bit, eight exponent bits, and 23 fraction bits. Which statement correctly describes its significand precision?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A voltage sensor transmits an IEEE 754 binary32 reading with sign bit s=1s=1, exponent field 10000010210000010_2, and fraction field 01010100000000000000000201010100000000000000000_2. What voltage does this encoding represent? Answer in volts, to three decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A diagnostic tool reports the unsigned decimal values of the exponent and fraction fields from five IEEE 754 binary32 words. Complete the classification column using exactly one of these labels for each row: zero, subnormal, normal, infinity, or NaN. Classify the encoding without calculating its numerical magnitude; the sign does not change these categories.

WordSign bitExponent field EFraction field FClassification
Sensor A100
Sensor B009
Sensor C12550
Sensor D02557
Sensor E01270

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice