# two's complement question

This is a discussion on two's complement question within the C Programming forums, part of the General Programming Boards category; I'm learning about binary and two's complement. I cannot replicate the result from the following problem with my current knowledge ...

1. ## two's complement question

I'm learning about binary and two's complement.

I cannot replicate the result from the following problem with my current knowledge of two's complement - subtraction:

"subtracting -5 from 15 is really adding 5 to 15, but this is hidden by the two's complement representation:"

Code:
``` 11110 000   (borrow)
0000 1111  (15)
− 1111 1011  (−5)
===========
0001 0100  (20)```
The question is: in the last 4 bits (left nibble), how can you borrow from 0 if it's 0? The example above seems to be borrowing from the next colum where the top bits are all 0's. Can someone explain how this is happening?

2. It's the same way you borrow in base 10. If you have 48 - 55, then you'll have nothing to borrow from in the tens place. So you just add a 1 making 48 become 148.