二进制数
Binary/Decimal/Hexadecimal/Octal Number System A weighted number in which the weight of each digit is a power of 2/10/16/8.
Binary: with bits, count up to .
The weighting structure, Most Significant Bit, Least Significant Bit.
十进制转二进制
最低有效位和最高有效位。
X-to-decimal conversion; Decimal-to-X conversion.
Use the sum-of-weights formula.
Repeated division-by-X (for integers), repeated multiplication-by-X (for fractions), sum-of-weights.
带符号数
Signed numbers. Sign-magnitude, 1’s complement, 2’s complement, and their conversion to decimal; floating-point numbers.
Sign-magnitude system 二进制符号数的最左边就是符号位,它指出这个数是正数还是负数。右边代表这个数的大小(magnitude)
![image-20230420161724170](C:\Users\Steven Meng\AppData\Roaming\Typora\typora-user-images\image-20230420161724170.png)
符号位 0 表示正数,符号位 1 表示负数。
反码形式
负数是相应正数的反码。
![image-20230420161833603](C:\Users\Steven Meng\AppData\Roaming\Typora\typora-user-images\image-20230420161833603.png)
补码形式
负数是其相应正数的补码。
Summary
![image-20230420162339217](C:\Users\Steven Meng\AppData\Roaming\Typora\typora-user-images\image-20230420162339217.png)
计算减法:
先转为正数: