This preview shows page 1. Sign up to view the full content.
Unformatted text preview: this analysis we can deﬁne the two’s complement negation operation -tÛ for Ü in the range ¾¾ ½ Ü ¾Û ½ as: -Û Ü
t ´ Ü
¾ Û ½ Ü Ü ¾ ¾ Û Û ½ ½ (2.13) Practice Problem 2.19:
We can represent a bit pattern of length Û with a single hex digit. For a two’s complement interpretation of these digits, ﬁll in the following table to determine the additive inverses of the digits shown.
Ü Hex 0 3 8 A F Decimal -t Decimal Ü Hex What do you observe about the bit patterns generated by two’s complement and unsigned (Problem 2.17) negation. 2.3. INTEGER ARITHMETIC 61 A well-known technique for performing two’s complement negation at the bit level is to complement the bits and then increment the result. In C, this can be written as ˜x + 1. To justify the correctness of this technique, observe that for any single bit Ü , we have ˜Ü ½ Ü . Let Ü be a bit vector of length Û and Ü ¾Ì Û ´Üµ be the two’s complement number it represents. By Equation 2.2, the complemented bit vector ˜Ü has numeric value ¾Ì Û ´˜Üµ Ü
View Full Document
- Spring '10
- The American