Page 74 - Engineering Digital Design
P. 74

2.6 SIGNED BINARY NUMBERS                                            45



                  EXAMPLE 2.14

                                            -0 10 = 1 0000000 25M
                    Although the sign-magnitude system is used in computers, it has two drawbacks. There
                  is no unique zero, as indicated by the previous examples, and addition and subtraction
                  calculations require time-consuming decisions regarding operation and sign, for example,
                  (—7) minus (—4). Even so, the sign-magnitude representation is commonly used in floating-
                 point number systems as discussed in Section 2.8.


                  2.6.2  Radix Complement Representation
                                                                                        n
                  The radix complement N rc of an n-digit number N r is obtained by subtracting N r from r ,
                  that is,
                                                     n
                                               N rC = r  -N r
                                                                                     (2.12)
                                                  = N r + \ LSD
                  where

                                      N r = Digit complementation in radix r

                  This operation is equivalent to that of replacing each digit a, in N r by (r — 1) — a, and
                  adding 1 to the LSD of the result as indicated by Algorithm 2.5. The digit complements
                 N r for three commonly used number systems are given in Table 2.6. Notice that the digit
                  complement of a binary is formed simply by replacing the 1's with O's and O's with 1's
                  required by 2" — N 2 — 1 = W 2 as discussed in Subsection 2.6.3. The range of representable
                                             ]
                                1
                  numbers is —(r"" ) through +(r"~  — 1).
                    Application of Eq. (2.12) or Algorithm 2.5 to the binary and decimal number systems
                  requires that for 2's complement representation NIC = N^ + ILSB and for 10's complement
                  N[Q C = N\Q + I LSD, where A^ and N\Q are the binary and decimal digit complements
                  given in Table 2.6.


                                      Table 2.6 Digit complements for three
                                         commonly used number systems
                                                  Complement (N r)

                                  Digit    Binary   Decimal    Hexadecimal
                                    0        1         9           F
                                    1        0        8            E
                                    2                  7           D
                                    3                  6           C
                                    4                  5           B
                                    5                  4           A
                                    6                  3           9
                                    7                  2           8
                                    8                  1           7
   69   70   71   72   73   74   75   76   77   78   79