2

I thought 0 is 0000 0000 0000 in bits and the bitwise not 0 would be 1111 1111 1111 which would be a really big number rather than -1. Even if the first digit is sign digit, then it should be a really negative number rather -1. Can someone explain for me?

Sheryl
  • 29
  • 1

1 Answers1

0

Because 11111....111 is -1. 10000....00 is the smallest negative number. Such is the binary representation of negative numbers. It's "inverted".

See more on this link: http://www.swarthmore.edu/NatSci/echeeve1/Ref/BinaryMath/NumSys.html#signint

Alex
  • 14,338
  • 5
  • 41
  • 59