For any given positive integer , the -bit signed integer format is the mapping of the set of integers in the range to the set of bit vectors of width defined by
With respect to this mapping, the most significant bit of the encoding of ,
The integer represented by a given encoding is computed by the following function, as affirmed by Lemma 2.5.1 below:
PROOF: If , then by Lemma 2.2.5, and by Lemma 2.3.9. Thus,
An -bit integer encoding is converted to an -bit encoding, where , by sign extension:
The next result establishes that an integer encoding and any sign extension of it represent the same integer value.
PROOF: First suppose . Then and by Lemma 2.3.23, . By Lemma 2.2.5,
PROOF: Let , , and .
Case 1: .
In this case, .
Suppose . If , then and
On the other hand, suppose . If , then and
Suppose . Let . Then
David Russinoff 2017-08-01