No, it's definitely -128 (in any case, that's what you mean, given your description of negative numbers). This is only -0 for the sign / magnitude of negative numbers.
See this answer for details on the two views, plus a third that C allows, one addition, but I will copy the snippet from there to keep this answer as self-sufficient as possible.
To get a negative representation for a positive number, you:
- invert all bits, then add one for two additions.
- invert all bits for one addition.
- inverts only the sign bit for the sign / value.
This can be seen in the following table:
number | twos complement | ones complement | sign/magnitude =======|=====================|=====================|==================== 5 | 0000 0000 0000 0101 | 0000 0000 0000 0101 | 0000 0000 0000 0101 -5 | 1111 1111 1111 1011 | 1111 1111 1111 1010 | 1000 0000 0000 0101
You should know that in 8-bit two add-on numbers there are no 128, the highest value is 127.
Where the numbers go at the midpoint where the smart happens:
00000000 -> 0 00000001 -> 1 : : 01111110 -> 126 01111111 -> 127 10000000 -> -128 10000001 -> -127 : : 11111110 -> -2 11111111 -> -1
because adding a bit pattern (e.g.) of 100 and -1 with 8-bit wrap will automatically give you 99 :
100+ 0 0110 0100 1- 0 1111 1111
source share