Computer Science, asked by officialshaan10, 3 months ago

Subtract 13(10) from 35(10) using 2’s complement method.​

Answers

Answered by anjumohit85
20

Answer:

(i) At first, 2’s complement of the subtrahend is found.

(ii) Then it is added to the minuend.

(iii) If the final carry over of the sum is 1, it is dropped and the result is positive.

(iv) If there is no carry over, the two’s complement of the sum will be the result and it is negative.

Answered by varshamittal029
3

Concept:

When subtracting two numbers in binary, add the second number's (2's complement + 1) to the first number. The binary addition of a negative value is binary subtraction.

Given:

Given numbers are 13_{(10}) and 35_{(10}).

Find:

Subtract 13_{(10}) from 35_{(10}) using 2’s complement method.​

Solution:

Let A be 13_{(10}) and B be 35_{(10}).

Binary representation of 13_{(10})=(001101)_{2}

Binary representation of 35_{(10})=(100011)_{2}

Steps to find B-A:

Step 1: Find 1's complement of A. 1's complement is obtained by inverting all of its binary digits, i.e. replacing 1s with 0s and 0s with 1s.

1's complement of A =(110010)_{2}

Step 2: 2’s complement of A = (1’s complement of A + 1)

2’s complement of A =(110010)_{2}+1

   1 1 0 0 1 0\\

         +1

=110011

2’s complement of A =(110011)_{2}.

Step 3: Now, for B+(-A), add this 2’s complement of A to B.

     100011

  +110011

=1010110

Ignore the leftmost overflow carry bit (1 in this case).

Hence the result is =(010110)_{2}.

Similar questions