Convering Decimal Hexadecimal an
2017-04-26 本文已影响0人
坠入莱茵河
Decimal | Binary | Hexadecimal |
---|---|---|
167 | ① | ② |
62 | ③ | ④ |
188 | ⑤ | ⑥ |
⑦ | 00110111 | ⑧ |
⑨ | 10001000 | a |
b | 11110011 | c |
16进制的转换是以值 X 除以16 所得的商再除以16 再不断的重复 知道余数为0
每次的余数即为16进制的位数
例
186 = 16 X 11 + 10 A
11 = 16 X 0 + 11 B
186的16进制即为 0 x BA
①
167 = 2 X 83 + 1
83 = 2 X 41 + 1
41 = 2 X 20 + 1
20 = 2 X 10 + 0
10 = 2 X 5 + 0
5 = 2 X 2 + 1
2 = 2 X 1 + 0
1 = 2 X 0 + 1
① = 10100111
②
0111 = 7
1010 = A
② = 0XA7
④
62 = 16 X 3 + 14 D
3 = 16 X 0 + 3 3
④ = 0X3D
③
D = 1110
3 = 0011
③ = 0X111110
⑥
188 = 16 X 11 + 12 C
11 = 16 X 0 + 11 B
⑥ = 0XBC
⑤
B = 1011
C = 1100
⑤ = 10111100
⑧
0011 = 3
0111 = 7
⑧ = 0X37
⑦
3 X 16 + 7 = 48 + 7 = 55
⑦ = 55
a
1000 = 8
1000 = 8
a = 0X88
⑨
⑨ = 8 * 16 + 8 = 128 + 8 = 136
b
1111 = F
0011 = 3
b = 0XF3
c
c = 16 * 16 + 3 = 259