Perform the following operations by converting the operands

Perform the following operations by converting the operands to 2\'s complement binary numbers and then doing the addition or subtraction shown. Please show all work in binary, operating on 16-bit numbers. Please follow the format in the given example: 3 + 12

Solution

(a)

13 will be represented in normal binary form but to perform the subtraction 13-2 it will be treated as 13+(-2)

where 2\'s complement of 2 will be added to binary 13.

For finding 2\'s complement of two first we will complement the binary equivalent of 2 and then add 1 to it, as

-2=NOT(0000 0000 0000 0010)+1=1111 1111 1111 1101+1=1111 1111 1111 1110

Now performing 13+(-2) as

0000 0000 0000 1101(13)

+ 1111 1111 1111 1110(-2)

----------------------------------------

0000 0000 0000 1011 (11)

The decimal value of the result is 11

(b) Similarly here after finding 2\'s complement of 6 we\'ll add them as 5+(-6), i.e.

0000 0000 0000 0101(5)

+ 1111 1111 1111 1010(-6)

--------------------------------------

1111 1111 1111 1111(-1)

The decimal value of the result is -1

(c)-7-(-7) can be written as -7+(-(-7))=-7+7

1111 1111 1111 1001(-7)

+ 0000 0000 0000 0111(7)

-----------------------------------------

0000 0000 0000 0000(0)

The decimal value of the result is 0.

 Perform the following operations by converting the operands to 2\'s complement binary numbers and then doing the addition or subtraction shown. Please show all

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site