任意进制转十进制
e.g. (253)Base 6 -> (?)Base 10
= 2*6^2+5*6^1+3*6^0
=105
(136)Base 6 -> (?)Base 10
= 1*7^2 + 3*7^1 + 6*7^0
= 76
十进制转任意进制
e.g (76)Base 10 -> (?)Base 7
76/7 = 10······6
10/7 = 1······3
∴ (76)Base 10 -> (136)Base 7
(123)Base 10 -> (?)Base 3
123/3 = 41······0
41/3 = 13······2
13/3 = 4······1
4/3 = 1······1
∴ (123)Base 10 -> (11120)Base 3
熟练运用以上两种方法可以在任意进制间自由转换。
特殊情况直接转换(转换进制之间为倍数关系):
高倍数向低倍数转换:
e.g. (71)Base 8 -> (?)Base 2
∵ 8 = 2^3
∴就把“71”分解成(_ _ _||_ _ _)(2*3 = 6位Base 2)
7 = 1*2^2 + 1*2^1 +1*2^0
1 = 0*2^2 + 0*2^1 +1*2^0
将上述红色数字按顺序填入空格中
结果为:
(71)Base 8 -> (111001)Base 2
低倍数向高倍数转换:
e.g. (101011)Base 2 -> (?)Base 8
(*如果位数不够在最前面加0补足)
8 = 2^3
将101011划分为:
(
001||
010||
111)
1 2 7
∴ (101011)Base 2 -> (127)Base 8
e.g. (11101112)Base 2 -> (?)Base 16
16 = 2^4
将11101112划分为:
(
1110||
1112)
14 15
E F
∴ (11101112)Base 2 -> (EF)Base 16
进制英文
Base 2: Binary
Base 8: Octal
Base 16: Hexadecimal