# 一、十进制与二进制

19进一是二十，无法以1X来表示，所以得用20来表示。
99进一是一百，无法用9X来表示，所以得用100来表示。

# 二、二进制转换为十进制

``````0 = 0 * 10^0；
1 = 1 * 10^0；
2 = 2 * 10^0；
3 = 3 * 10^0；
10 = 1 * 10^1 + 0 * 10^0
11 = 1 * 10^1 + 1 * 10^0
12 = 1 * 10^1 + 2 * 10^0
13 = 1 * 10^1 + 3 * 10^0
20 = 2 * 10^1 + 0 * 10^0
21 = 2 * 10^1 + 1 * 10^0
22 = 2 * 10^1 + 2 * 10^0
23 = 2 * 10^1 + 3 * 10^0
30 = 3 * 10^1 + 0 * 10^0
31 = 3 * 10^1 + 1 * 10^0
99 = 9 * 10^1 + 9 * 10^0
100 = 1 * 10^2 + 0 * 10^1 + 0 * 10^0
123 = 1 * 10^2 + 2 * 10^1 + 3 * 10^0
``````

``````32078 = 3 * 10^4 + 2 * 10^3 + 0 * 10^2 + 7 * 10^1 + 8 * 10^0
``````

0 0 * 2^0 = 0
1 1 * 2^0 = 1
10 1 * 2^1 + 0 * 2^0 = 2
11 1 * 2^1 + 1 * 2^0 = 3
100 1 * 2^2 + 0 * 2^1 + 0 * 2^0 = 4
101 1 * 2^2 + 0 * 2^1 + 1 * 2^0 = 5
110 1 * 2^2 + 1 * 2^1 + 1 * 0^0 = 6
111 1 * 2^2 + 1 * 2^1 + 1 * 2^0 = 7
1000 1 * 2^3 + 0 * 2^2 + 0 * 2^1 + 0 * 2^0 = 8
1001 1 * 2^3 + 0 * 2^2 + 0 * 2^1 + 1 * 2^0 = 9
1010 1 * 2^3 + 0 * 2^2 +1 * 2^1 + 0 * 2^0 = 10
1011 1 * 2^3 + 0 * 2^2 + 1 * 2^1 + 1 * 2^0 = 11
1100 1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 0 * 2^0 = 12
1101 1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0 = 13
1110 1 * 2^3 + 1 * 2^2 + 1 * 2^1 + 0 * 2^0 = 14
1111 1 * 2^3 + 1 * 2^2 + 1 * 2^1 + 1 * 2^0 = 15
10000 1 * 2^4 + 0 * 2^3 + 0 * 2^2 + 0 * 2^1 + 0 * 2^0 = 16

（1）计算并牢记2 ^ 0, 2 ^ 1, 2 ^ 2, 2 ^ 3, 2 ^ 4, 2 ^ 5, 2 ^ 6, 2 ^ 7, 2 ^ 8, 2 ^ 9, 2 ^ 10
（2）求二进制11011, 101010, 11111111对应的十进制数

# 三、十进制正整数转换为二进制

``````13 / 2 = 6,余数为1
6 / 2 = 3，余数为0
3 / 2 = 1，余数为1
1 / 2 = 0，余数为1

``````

``````1024 / 2 = 512，余数为0
512 / 2 = 256，余数为0
256 / 2 = 128，余数为0
128 / 2 = 64，余数为0
64 / 2 = 32，余数为0
32 / 2 = 16，余数为0
16 / 2 = 8，余数为0
8 / 2 = 4，余数为0
4 / 2 = 2，余数为0
2 / 2 = 1，余数为0
1 / 2 = 0，余数为1

``````

``````255 / 2 = 127, 余数为1
127 / 2 = 63，余数为1
63 / 2 = 31，余数为1
31 / 2 = 15，余数为1
15 / 2 = 7，余数为1
7 / 2 = 3，余数为1
3 / 2 = 1，余数为1
1 / 2 = 0，余数为1

``````

qrcode_for_kidscode_258.jpg