Page 15 - DCAP104_EXPOSURE_TO_COMPUTER_DISCPLINES
P. 15

Exposure to Computer Disciplines



                   Notes         Arithmetic Addition: The complexity of arithmetic addition is dependent on the representation,
                                 which have been followed. Let us discuss this with the help of following example.
                                                   Add 25 and - 30 in binary using 7 bit register in

                                        Solution   signed magnitude representation.
                                                   signed 1’s complement
                                                   signed 2’s complement.
                                                   Solution: 25 or +25 is
                                                   0 01 1001
                                                   - 30 in signed magnitude representation is:
                                                   +30 is 0 01 1 1 lo,
                                                   therefore - 30 is 1 01 11 I0

                                 To do the arithmetic addition with one negative number we have to check tlie magnitude of the
                                 numbers. The number having smaller magnitude is then subtracted from tlie bigger number
                                 and the sign of bigger number is selected. The implementation of such a scheme in digital
                                 hardware will require a long sequence of control decisions as well as circuits that will add,
                                 compare and subtract numbers. Is there a better alternative than this scheme? Let us first try
                                 the signed 2’s complement.
                                 –30 in signed 2’s complement notation will be:

                                 +30 is 0011110
                                 –30 is 1100010 (2’ complement of 30 including sign bit)

                                 +25 is 0011001
                                 –25 is 1100111

                                 Addition



































        8                                 LOVELY PROFESSIONAL UNIVERSITY
   10   11   12   13   14   15   16   17   18   19   20