Page 76 - Engineering Digital Design
P. 76

2.6 SIGNED BINARY NUMBERS                                            47


                                     Table 2.7 Examples of eight-bit 2's and 1 's
                                    complement representations (MSB = sign bit)
                                 Decimal           2's              1's
                                  Value        Complement       Complement
                                  -128          10000000
                                  -127          10000001          10000000
                                   -31          11100001          11100000
                                   -16          11110000          11101111
                                   -15          11110001          11110000
                                   _3           11111101          11111100
                                   -0           00000000          11111111
                                   +o           00000000          00000000
                                   +3           00000011         00000011
                                   + 15         00001111         00001111
                                   + 16         00010000         00010000
                                   +31          00011111         00011111
                                  + 127         01111111         01111111
                                  + 128


                  a decimal value of

                                                       4
                                        7
                                                6
                                                                        2
                          (Af 2 c)io = -1 x 2  + 1 x 2  + 1 x 2  + 1 x 2' + 1 x 2~  + 1 x 2~  3
                                = -128 + 64 + 16 + 2 + 0.25 + 0.125
                                = -45.625i 0.
                 But the same result could have easily been obtained by negation of A^c followed by the
                 use of positional weighting to obtain the decimal value. Negation is the reapplication of
                 Eq. (2.12) or Algorithms 2.5 or 2.6 to any 2's complement number A^c to obtain its true
                 value. Thus, from the forgoing example the negation of NIC is given by

                                       Akc)2C= 00101101.101
                                             = 32 + 8 + 5 + 0.5 + 0.125

                                             = 45.625 10,

                 which is known to be a negative number, —45.625i 0.
                    Negative BCD numbers are commonly represented in 10's complement notation with
                 consideration of how BCD is formed from binary. As an example, — 59.24io = 40.76io is
                 represented in BCD 10's complement (BCD,IOC) by

                            -0101 1001.0010 0100) BCD = 0100 0000.0111 0110) BCD,ioc,

                 where application of Eq. (2.12), or Algorithm 2.5 or 2.6, has been applied in radix 10 fol-
                 lowed by the BCD representation as in Subsections 2.4.1. Alternatively, the sign-magnitude
                 (SM) representation of a negative BCD number simply requires the addition of a sign bit
   71   72   73   74   75   76   77   78   79   80   81