Hai,
If we consider an 8-bit system,(just for example), a signed number can represent values ranging from -127 to 0 to +127. In hex,+127 is 0x7F(0b0111 1111) and -127 is 0xFF(0b1111 1111). If the Msb bit is 1,the number is negative and positive otherwise.
So, if we need to subtract 12 (0x0C) from 5 (0x05),
0000 0101-
0000 1100
-------------
1111 1001 (0xF9.ie, -7 in decimal)
Here, we cannot subtract 12 from 5. So, we cannot borrow a 1 from the nearest position (during subtraction of 4th bit). If we assumes to borrow a 1, then the subtraction will be normal.
But it is better to consider 2's complement for subtraction.
1's complement of 0x0C (0000 1100) is 0xF3 (1111 0011).
2's complement of a number is obtained by adding a 1 to it's 1's complement.
So,2's complement of 0x0C is 0xF4 (1111 0100)
Always take the 2's complement of the subtrahend and add it to the minuend. If the result has a carry, discard it. If the result doesn't have a carry, take the 2's complement of the result and the final result will be negative.
0000 0101+
1111 0100
-------------
1111 1001 (0xF9)
Here, there is no carry. So,take the 2's complement. i.e, 0x07 (0000 0111) and the answer is -7.
Check this also,
http://fullchipdesign.com/2scomex.htm