# 5.5  Rebiasing Exponents

A common task performed by floating-point units is the conversion of an encoding from one format to another, which generally requires the rebiasing of the exponent field. If is the value of an exponent field of width , then the actual exponent of the encoded number is . The result of rebiasing this value for a field of width is given by the following definition.

Definition 5.5.1   (rebias-expo) For all , , and ,

-

When the target exponent field is wider than that of the source, rebiasing is always possible.

(rebias-up) Let and with . If is an -bit vector, then

-

PROOF: First suppose that . Then by Lemmas 2.2.5 and 2.3.17,

and

-

On the other hand, by Definition 2.4.1 and Lemma 2.4.18,

Now suppose . Then

-

and by Definition 2.4.1 and Lemma 2.4.19,

Corollary 5.5.2   (bvecp-rebias-up) Let and with . If is an -bit vector, then - is an -bit vector.

Now suppose that is an -bit biased exponent to be rebiased to fit into a smaller -bit field. In order for this to be possible,

-

must be an -bit vector, i.e.,

or equivalently,

(rebias-down) Let and with . If is an -bit vector and

then

-

PROOF: The hypothesis implies that is an -bit vector, and hence, by Lemmas 2.2.5, 2.3.17, and 2.2.22,

Suppose first that . Then , for otherwise and . Thus, and
 -

Now suppose . Then , for otherwise, by Lemma 2.2.1, and

Therefore,

and
 -

Corollary 5.5.4   (bvecp-rebias-down) Let and with . If is an -bit vector and

then - is an -bit vector.

David Russinoff 2017-08-01