Web hosting servers - 4.1 POSITIONAL NUMBER SYSTEMS 187 99999 99999 in

4.1 POSITIONAL NUMBER SYSTEMS 187 99999 99999 in this notation; in other words, no explicit sign is attached to the number, and calculation is done modulo lOlo. The number -12345 67890 would appear as 8765432110 (3) in ten s complement notation. It is conventional to regard any number whose leading digit is 5, 6, 7, 8, or 9 as a negative value in this notation, although with respect to addition and subtraction there is no harm in regarding (3) as the number f87654 32110 if it is convenient to do so. Note that there is no problem of minus zero in such a system. The major difference between signed magnitude and ten s complement nota- tions in practice is that shifting right does not divide the magnitude by ten; for example, the number -11 = . . .99989, shifted right one, gives . .99998 = -2 (assuming that a shift t,o the right inserts 9 as the leading digit when the num- ber shifted is negative). In general, z shifted right one digit in ten s complement notation will give Lz/lO], whether z is positive or negative. A possible disadvantage of the ten s complement system is the fact that it is not symmetric about zero; the largest negative number representable in p digits is 500.. . 0, and it is not the negative of any p-digit positive number. Thus it is possible that changing LX to –z will cause overflow. (See exercises 7 and 31 for a discussion of radix-complement notation with infinite precision.) Another notation that has been used since the earliest days of high-speed computers is called nines complement representation. In this case the number -12345 67890 would appear as 87654 32109. (4 Each digit of a negative number (-Z) is equal to 9 minus the corresponding digit of 5. It is not difficult to see that the nines complement notation for a negative number is always one less than the corresponding ten s complement notation. Addition and subtraction are done modulo lOlo -1, which means that a carry off the left end is to be added at the right end. (Cf. Section 3.2.1.1.) Again there is a potential problem with minus zero, since 99999 99999 and 00000 00000 denote the same value. The ideas just explained for radix 10 arithmetic apply in a similar way to radix 2 arithmetic, where we have signed magnitude, two s complement, and ones complement notations. The MIX computer, as used in the examples of this chapter, deals only with signed-magnitude arithmetic; however, alternative procedures for complement notations are discussed in the accompanying text when it is important to do so. Most computer manuals tell us that the machine s circuitry assumes that the radix point is situated in a particular place within each computer word. This advice should usually be disregarded. It is better to learn the rules concerning where the radix point will appear in the result of an instruction if we assume that it lies in a certain place beforehand. For example, in the case of MIX we could regard our operands either as integers with the radix point at the extreme

Leave a Reply