Perform the arithmetic operation (+42)+(-13) and (-42)-(-13) in binary using the signed -2’s-complement representation for negative numbers.

This answer is restricted. Please login to view the answer of this question.

Login Now

(i) Solution:

42 = 101010

13 = 001101

For 13,

1’s complement = 110010

2’s complement = 110010 + 1 = 110011

∴ -13 = 110011 (using signed -2’s complement representation)

So, (+42) + (-13) =

    1 0 1 0 1 0
+   1 1 0 0 1 1
----------------
  1 0 1 1 1 0 1

First 1 is discarded so,

(+42) + (-13) = = 011101

(ii) Solution:

42 = 0101010

1’s complement = 1010101

2’s complement = 1010110

So, -42 = 1010110 (using signed 2’s complement representation)

-13 = 1110011

So, (-42) – (-13) =

  1 0 1 0 1 1 0
- 1 1 1 0 0 1 1
------------
  1 1 0 0 0 1 1
So, (-42) - (-13) = 1100011

 

 

If you found any type of error on the answer then please mention on the comment or report an answer or submit your new answer.
Leave your Answer:

Click here to submit your answer.

Discussion
0 Comments
  Loading . . .