Page 52 - Cs_withBlue_J_C11_Flipbook
P. 52

Two’s complement retains positive binary numbers in their original form (true form) and negative numbers by their
              changed notation.
              2’s complement notation has a single value for 0. So, an extra negative number can be represented compared with
              Signed Magnitude or 1’s complement notation. An ‘n’ bit number in two’s complement method can represent numbers
              in the range from -2 (n-1)  to +2 (n-1)  - 1.

              The tabular form is given below:

                                             Bit notation           Range for 2's complement numbers
                                                 4                              -8 to +7
                                                 8                            -128 to +127
                                                 16                         -32768 to +32767


                                                             Definition

                    Two’s complement representation of a binary negative number is obtained by adding 1 to its One’s complement
                    form. The representation of a binary positive number remains the same.




              Advantages of Two’s complement method:
              •  Binary addition and subtraction using signed and unsigned numbers can be done conveniently with this method.
              •  There is no ambiguity with 0. +0 in 8-bit notation is 00000000. -0 in one’s complement method is written as 11111111.
                Adding 1 to it, we get 00000000.

              Disadvantage of Two’s complement method:
              •  It is an unconventional way of representing signed integers.


                      Note: The method has been described in detail in Chapter 1 of this book.


              Example 1: Write the 8-bit representation of decimal number -35 using the following notations.
              (a) Signed Magnitude  (b) One’s Complement  (c) Two’s complement

              Answer: Binary equivalent of 35 is:

                                                      2          35
                                                      2          17           1
                                                      2           8           1

                                                      2           4           0
                                                      2           2           0
                                                      2           1           0
                                                                  0           1
              (35)  = 100011 2
                  10
              In 8-bit representation, we have to add a leading 0 in magnitude bit and 1 in sign bit as the number is negative.

                  Signed bit representation        1       0        1       0        0       0        1       1




                5050  Touchpad Computer Science-XI
   47   48   49   50   51   52   53   54   55   56   57