Skip to main content
2 of 2
added 4 characters in body; edited tags; edited title
Raphael
  • 72.9k
  • 30
  • 181
  • 393

Why do I not get the correct smallest possible value in 2's complement?

When using 2's complement with 4 bits, the largest positive int I can represent is 0111. The smallest negative one is 1000.

The smallest int should intuitively be the negative of 0111 - 1 = 0110 since we can represent one more positive than negative int.

If we invert the bits of 0110 and then add 1, however, we get 1010, which differs from 1000. What am I doing wrong?