So there's a course I'm watching online and it operates binary subtraction this way:
asking y-x, where:
y=0111 (or decimal 7)
x=0010 (or decimal 2)
And instead of using a 2's complement to change the subtrahend (x). The person in the course invert the minuend (y) and add it to the subtrahend (x). And at the end invert the result.
So that:
0111 -> 1000
1000 + 0010 = 1010
1010 -> 0101
Which is actually correct. So I was wondering how does this work ?
2's complement is also called n-1 complement because:
The mentioned computation can thus be restated as: