144k views
11 votes
-(-13) P binary using signed. 2's complement representation

Perform the arithmetic operations (+42) + (-13) and (-42)
negative .
Consider the balloon​

1 Answer

8 votes

Answer:

00011101

00011101

Step-by-step explanation:

Given the following arithmetic operations

a) (+42) + (-13)

b) (-42) - (-13)

From (a):

We need to convert +42 into binary, so we get = 00101010

Now for +13, when it is converted into binary, we get = 00001101

But, here, the 13 is negative. So, here is what we will do, we will have to take the two compliment of the binary. After doing that, we get = 111110011

+ 42 → 00101010

- 13 → 1 1 1 10011

+29 000 11101

Thus, the arithmetic operation after we use 2's complement is 00011101

b)

Here both 42 and 13 are negative. Using two complement representation

-42 is first converted to binary as 00101010, Then → 11010101 + 1 = 11010110

-13 is converted to binary as 00001101 → 11110010 = 11110011

In between, a negative sign exists, so we take another 2's complement.

i.e.

11110011 → 00001100 + 1 = 00001101

- 42 → 1 1 01 0110

+13 → 00001 101

-29 1 1 1 00011

since there is no carry, we take two's complements for the result as:

1 1 1 00011 →00011100 + 1 = 00011101

User James Mitchell
by
6.7k points