one's Complement表示按位取反;
two's Complement表示按位取反后再加1
1的补码可以认为只有一步操作的补码,按位取反
2的补码可以认为有两步操作的补码,,按位取反后,再在最低位加1。
To get 1’s complement of a binary number, simply invert the given number.
To get 2’s complement of a binary number, simply invert the given number and add 1 to the least significant bit (LSB) of given result.
Tags:
补码 Complement
补码 Complement