Tuesday, June 21, 2011

4.2 Signed and Unsigned Numbers

  • If the number that is the proper result of such operations cannot be represented by these rightmost hardware bits, overflow is said to have occurred.
  • Sign and magnitude method and two's complement representation are used to distinguish positive and negative numbers
  • Two's complement: leading 0s (MSB) mean positive and leading 1s (MSB) mean negative
  • Shortcut to negate two's complement binary number: invert every 0 to 1 and every 1 to 0, then add one to result

No comments:

Post a Comment