1, positive number of the original code, complement, anti-code are its own; 2, negative (binary) of the original code, complement, anti-code formula:
Anti-code = The original code (except the sign bit) every bit of the reverse
complement = anti-code + 1
anti-code = complement-1
Shift code = complement Symbol bit counter
Purpose: inverse code: To solve the problem of negative addition operation, the subtraction operation is converted to addition operation, thus simplifying the operation rules; complement: solve the negative addition operation plus or minus 0 problem, make up the anti-code deficiencies. Anti-code and complement are to solve the problem of negative numbers, and positive, so, whether it is a positive integer or positive decimal, the original code, anti-code, complement are all the same. The original code, anti-code, and complement are symbolic fixed-point number representation method, the
shift code commonly used to compare the size, the floating-point code is generally used to move the code to express, the code can be used to simplify floating-point numbers multiplication method operation. Assuming that the bit width of the data is 8 bits, the original code is the highest level for the sign bit, the other 7 bits is the data bit, so the range is ( -127~-0,0~127) the expression range of the inverse code is also ( -127~-0,0~127) complement the provision of 0 means 128 this number, so the complement of the expression range is: ( -128~0~127)
Note:-128 is a special number, (-128) does not correspond to the original code and anti-code, ( -128) = (10000000)
found a more in-depth, explained very good blog:/http Www.cnblogs.com/zhangziqiu/archive/2011/03/30/ComputerCode.html
The code of the original code back code complement shift