We will see that sign magnitude encoding is used with

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ., set the bit with negative weight but clear all others) having integer value ÌÅ Ò Û ¾Û ½. The greatest ÈÛ ¾ Û ½ value is given by bit vector ¼½ ¡ ¡ ¡ ½ , having integer value ÌÅ Ü Û ¾ ½. Again, one ¼¾ Û Û ½ Û ½ can see that ¾Ì Û is a bijection ¾Ì Û ¼ ½ ¾ ¾ ½ , associating a unique integer in the representable range for each bit pattern. Figure 2.9 shows the bit patterns and numeric values for several “interesting” numbers for different word sizes. The first three give the ranges of representable integers. A few points are worth highlighting. First, the two’s complement range is asymmetric: ÌÅ Ò Û ÌÅ Ü Û · ½, that is, there is no positive counterpart to ÌÅ Ò Û . As we shall see, this leads to some peculiar properties of two’s complement arithmetic and can 2.2. INTEGER REPRESENTATIONS 43 be the source of subtle program bugs. Second, the maximum unsigned value is nearly twice the maximum two’s complement value: ÍÅ Ü Û ¾ÌÅ Ü Û · ½. This follows from the fact that two’s complement notation reserves half of the bit patterns to represent negati...
View Full Document

Ask a homework question - tutors are online