0370.  Show how you would subtract 35 from 76 using both one’s comlpiment and two’s compliment.

 

76 = 10011002  Or  00000000010011002 (On 16-bits)

35 =   1000112  Or  00000000001000112 (On 16-bits)

 

ONE’S Compliment:

 

-35 (in one’s compliment) would be:

 

0000000000100011

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

1111111111011100

 

Subtracting 35 from 76 (76 + -35) would yield:

 

0000000001001100 (+76)

+ 1111111111011100 (-35)

0000000000101000

 

HOWEVER, since the result is non-negative, we must add 1:

 

0000000000101000

+ 0000000000000001

  0000000000101001

 

            Check:  00000000001010012 = 25 + 23 = 32 + 8 +1 =  41 (correct)

 

TWO’S Compliment:

 

-35 (in two’s compliment) would be:

 

1111111111011100

    +              1

    1111111111011101

 

Subtracting 35 from 76 (76 + -35) would yield:

 

0000000001001100 (+76)

+ 1111111111011101 (-35)

0000000000101001

 

Check:  00000000001010012 = 25 + 23 = 32 + 8 +1 =  41 (correct)