1.

Why subtraction in binary is always 2's complement

Answer»

First of all subject is comp science not math

It's done so that addition doesn't need to have any special logic for dealing with negative NUMBERS. 

Say you have two numbers, 2 and -1. In your "intuitive" way of representing numbers, they would be 0010 and 1001, respectively (I'm sticking to 4 bits for size). In the two's complement way, they are 0010 and 1111. Now, let's say I want to add them.

Two's complement addition is very simple. You add numbers NORMALLY and any carry bit at the end is discarded. So they're added as follows:

0010+ 1111=10001= 0001 (discard the carry)

0001 is 1, which is the expected result of "2+(-1)" to be.


hope that helps you do MARK BRAINLIEST




Discussion

No Comment Found

Related InterviewSolutions