Ok, so here's the problem: 11100111 - 110011111
I am aware of the fact that we have to use 2's complement method for gaining the right answer but when I do use it by changing 110011111 to 001100000 and then add it to 11100111, I get (1)01001000. However, the answer to this problem is -10111000 [yes, that's a negative].
I am really very confused as to how we can possibly get a negative result using the 2's complement method for the above problem. I searched stack overflow but no post seemed to answer this query of mine. Thanks, in advance for helping me out!
Any binary number with the first bit being 1 is negative if its a signed number, so since you have (1)0111000 it is a negative value. It seems you are confusing signed and unsigned numbers.
You are also incorrectly doing two's compliment, you should first subtract the binary number from the other normally then add 1 to it. This is an example from wikipedia