抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

十进制数

二进制数

image-20230314144636643

image-20230314144717706

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 nn bits, count up to 2n12^n-1.

The weighting structure, Most Significant Bit, Least Significant Bit.

十进制转二进制

image-20230314144800156

最低有效位和最高有效位。

image-20230314144834852

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.

二进制算数

image-20230420161456965

二进制数的反码和补码

改变二进制数的每一位以得到 反码

image-20230314144923459

反码+1就可以得到 补码

image-20230314145007439

带符号数

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-20230314145144220

反码形式

负数是相应正数的反码。

![image-20230420161833603](C:\Users\Steven Meng\AppData\Roaming\Typora\typora-user-images\image-20230420161833603.png)

补码形式

负数是其相应正数的补码。

image-20230314145321511

image-20230314145510735

image-20230314145523961

image-20230314145540092

Summary

![image-20230420162339217](C:\Users\Steven Meng\AppData\Roaming\Typora\typora-user-images\image-20230420162339217.png)

计算减法:

000011001111011100001100-11110111

先转为正数:

00001100+(00001000+1)=0001010100001100+(00001000+1)=00010101

带符号数的算术运算

Arithmetic Operations

二进制数的数值范围取决于数的位数 (n)(n)

image-20230314150007774

image-20230420162925573

十六进制数

八进制数

二-十进制编码(BCD)

image-20230318155939533

例如,将 5(0101)5(0101)5(0101)5(0101) 加起来,产生 10(1010)10(1010),但是我们只需要取个位数,就加上 6(0110)6(0110),变成 0(0000)0(0000),不进位。

![image-20230420163055647](C:\Users\Steven Meng\AppData\Roaming\Typora\typora-user-images\image-20230420163055647.png)

数字编码

*Digital codes: BCD (invalid code, +), Gray, ASCII, parity bit, CRC.

image-20230314150158071

Bin-To-Gray: k(k>>1)k\oplus (k>>1).

错误监测码

Parity Bit, CRC

image-20230314150452354

![image-20230420163131046](C:\Users\Steven Meng\AppData\Roaming\Typora\typora-user-images\image-20230420163131046.png)

评论