i tried 9 D + (-10 D)
9= 0000 1001
10= 0000 1010
Reverse 10 = 1111 0101 and add 1 become 1111 0110
after that add up 9 D + (-10 D) == 0000 1001 + 1111 0110 but the answer is equal to 1111 1111 whch is 255 in decimal but the answer should be -1 right? anything goes wrong?
Thank you very much.
In two's complement representation for binary numbers, the number 1111 1111 represents -1. You missinterpreted the result as a "normal" binary number.
In two's complement, binary numbers of $2^n$ bits represent values ranging from $-2^{n-1}$ to $2^{n-1}-1$.