I'm wanting to carry out the calculation of 8 – 11 (assuming that 5 bits represents a number and also using 2s complement representation), however, I can't seem to get the correct answer. This is what I have so far;
8 in binary is 01000.
11 in binary is 01101, which we invert to get -11: 10010 and then add one => 10011.
Adding these together (8 + -11) I thought resulted in 11100, however, when converting this back to decimal I can see that this isn't the (final) answer. Does anyone know where I'm going wrong?
Best Answer
You representation of $11$ is wrong (you actually compute with $-13$), here the steps to get $8-11 = -3$
Now compute $-3$ and see that results match: