# 5.3  Denormals and Zeroes

An exponent field of 0 is used to encode numerical values that lie below the normal range. If the exponent and significand fields of an encoding are both 0, then the encoded value itself is 0 and the encoding is said to be a zero. If the exponent field is 0 and the significand field is not, then the encoding is either denormal or pseudo-denormal:

Definition 5.3.1   (zerp, denormp, pseudop) Let be an encoding for a format with .

(a) If , then is a zero encoding for F.

(b) If and either is implicit or , then is a denormal encoding for F.

(c) If is explicit and , then is a pseudo-denormal encoding for F.

Note that a zero can have either sign:

Definition 5.3.2   (zencode) Let be a format and let . Then

There are two differences between the decoding formulas for denormal and normal encodings:

1. For a denormal encoding for an implicit format, the integer bit is taken to be 0 rather than 1.

2. The power of 2 represented by the zero exponent field of a denormal or pseudo-denormal encoding is rather than .

Definition 5.3.3   (ddecode) If is an encoding for a format with , then

We also define a general decoding function:

Definition 5.3.4   (decode) Let be an encoding for a format . If , then

(sgn-ddecode, expo-ddecode, sig-ddecode) Let be a denormal encoding for a format and let .

(a) .

(b) .

(c) .

PROOF: (a) is trivial; (b) and (c) follow from Lemmas 4.1.13 and 4.1.14

The class of numbers that are representable as denormal encodings is recognized by the following predicate.

Definition 5.3.5   (drepp) Let be a format and let . Then is representable as a denormal in iff the following conditions hold:

(a) ;

(b) ;

(c) is -exact.

If a number is so representable, then its encoding is constructed as follows.

Definition 5.3.6   (dencode) If is representable as a denormal in , then

where

Next, we examine the relationship between the decoding and encoding functions.

(drepp-ddecode, dencode-ddecode) If is a denormal encoding for a format , then is representable as a denormal in and

PROOF: Let , , , and . Since ,

and by Lemma 4.1.3,

which is equivalent to Definition 5.3.5(b). In order to prove (c), we must show, according to Definition 4.2.1, that

But

This establishes that is representable as a denormal.

Now by Definition 5.3.3,
Therefore, by Definitions 5.3.1, 5.3.6, and 5.1.4 and Lemmas 2.4.9 and 2.2.5,

(denormp-dencode, ddecode-dencode) If be representable as a denormal in , then is a denormal encoding for andand

PROOF: Let , , , and . By Lemma 2.4.1, is a -bit vector and by Lemma 2.4.7,

and

Since is -exact,

and since ,

by Lemma 4.1.8, which implies

Finally, according to Definition 5.3.3,

The smallest positive denormal is computed by the following function:

Definition 5.3.7   (spd) For any format , .

(positive-spd, drepp-spd, spd-smallest)
For any format ,

(a) ;

(b) is representable as a denormal in ;

(c) If is representable as a denormal in , then .

PROOF: Let , , and . It is clear that is positive. To show that is -exact, we need only observe that

Finally, since

holds and moreover, is the smallest positive that satisfies

Every number with a denormal representation is a multiple of the smallest positive denormal.

(spd-mult) If and let be a format, then is representable as a denormal in iff for some , .

PROOF: Let and . For , let . Then and

We shall show, by induction on , that is representable as a denormal for . First note that for all such ,

Suppose that is representable as a denormal for some , . Then is -exact, and by Lemma 4.2.16, so is . But since , it follows from Lemma 4.2.5 that is also -exact. Since

, i.e., , and hence, is representable as a denormal.

Now suppose that is representable as a denormal. Let . Clearly, , and . It follows from Lemma 4.2.17 that , and consequently, is -exact. Thus, by Lemma 4.2.16,

David Russinoff 2017-08-01