Feb 17, 2010

cs-64 COMPUTER ORGANIZATION

(b)    Perform the following arithmetic operations using binary Signed     2’s complement notation. (Please note that all the numbers     given in this question are in decimal notation). Use only 8 bit     representation. Indicate the overflow, if any.    (1 Mark)      
   
    (i)    +35 – 75
    (ii)    –35 – 93
    (iii)    +35 – (–93)
    (iv)    +35 – 24
ANS:
      i) +35 – 75 = (+35) +(–75)
               +35 in 8 bit binary =  0 0100011
               –75 in 8 bit binary =  1 0110101 ( 2's complement of 75)
-------------------------------------------------
               –40 in 8 bit binary =  1 1011000 ( 2,s complement of 40)
     ii) –35 –93 = (–35) + (–93)

        –35  =   1 1011101 (2'  complement of 35)
        –93  =   1 0100011 (2'  complement of 93)

     –128  =  11 0000000 (2'  complement of 128)
     iii) +35 - (-93) = +35 +93
               +35 = 0 0100011
           –(–93) = 0 1011101
------------------------------
              128  =  1 0000000 

    iv) +35 – 24 = +35 + (–24)
          +35 = 0 0100011
          –24 = 1 1101000 ( 2's complement of 24)
-----------------------------
        +11 = 10 0001011 ( 1 is excluded or is left)

2 comments:

  1. Solve the following expression by using 1's complement

    (i) 110(Base2) - 010(Base2)
    (ii) 1010(Base2) - 1000(Base2)

    ReplyDelete
  2. Convert The Value -40 and 52 to 8-Bit digit in form of:

    (i) Sign and Magnitude
    (ii) 1's Complement
    (iii) 2's Complement

    ReplyDelete