- There are three methods for the representation of the signed number of the computer: the original code, the inverse code and the complement 8-bit original code and the inverse code can represent the number range is -127~127 8-bit complement can represent the number of the range is -128~ 127 so since the range is -128~127, it must be expressed in the complement. 10000000-11111111 means 128 to-1, 00000000-01111111 means 0-127 complement 1111 1111 is converted to the original code is 1000 0001, that is, 1. Complement is a method of binary representation of negative numbers
- Introduced the concept of complement. The complement of negative numbers is to add one to the inverse code, and the positive number of the original code is the same. In the complement (-128) instead of (-0), so the complement of the expression range is: ( -128~0~127) a total of 256.
- Note:(-128) does not correspond to the original code and the inverse code, (-128) = (10000000)
- The so-called original code is the binary fixed-point notation, that is, the highest bit is the sign bit, "0" is positive, "1" is negative, the remaining bits represent the size of the value.
- The inverse code notation stipulates that the inverse code of a positive number is the same as its original code, and the inverse of a negative number is a bitwise negation of its original code, except for the sign bit.
- The complement notation stipulates that the complement of positive numbers is the same as the original code, and that the complement of negative numbers is added to the minus 1 of the inverse code.
Eight-bit binary number why is the range ( -128~~+127) understood