Exponent bias explained

In IEEE 754 floating-point numbers, the exponent is biased in the engineering sense of the word – the value stored is offset from the actual value by the exponent bias, also called a biased exponent.Biasing is done because exponents have to be signed values in order to be able to represent both tiny and huge values, but two's complement, the usual representation for signed values, would make comparison harder.

To solve this problem the exponent is stored as an unsigned value which is suitable for comparison, and when being interpreted it is converted into an exponent within a signed range by subtracting the bias.

By arranging the fields such that the sign bit takes the most significant bit position, the biased exponent takes the middle position, then the significand will be the least significant bits and the resulting value will be ordered properly. This is the case whether or not it is interpreted as a floating-point or integer value. The purpose of this is to enable high speed comparisons between floating-point numbers using fixed-point hardware.

If there are

e

bits in the exponent, the biasis typically set as

b=2e-1-1

.

Therefore, the possible integer values that the biased exponent can express lie in the range

[1-b,b]

.To understand this range, with

e

bits in the exponent, the possible unsigned integers lie in the range

[0,2e-1]

.However, the strings containing all zeros and all ones are reserved for special values, so the expressible integers lie in the range

[1,2e-2]

.It follows that:

(2e-2)-b=2b-b=b

.

1-b

.

When interpreting the floating-point number, the bias is subtracted to retrieve the actual exponent.

History

The floating-point format of the IBM 704 introduced the use of a biased exponent in 1954.

See also