Number systems
Consider a decimal number: 7654.32
Short hand for: 7 * 103 + 6*102 + 5* 101 + 4*100 + 3*10^{-1 }+ 2*10^{-2}
Likewise binary number: 1011.011
In full: 1*23 + 0*22 + 1* 21 + 1*20 + 0* 2^{-1} + 1* 2^{-2 }+ 1*2^{-3}
In general the number: x2 x1 x0 . x-1 x-2 x-3
In base B is equal to: x_{2 } B^{2} + x_{1} B^{1} + x_{0 } B^{0} + x_{-1} B^{-1} + x_{-2 } B^{-2} + x_{-3} B^{-3}
Conversion table.
Decimal (Base 10)
Binary (Base 2)
Octal (Base 8)
Hexadecimal (Base 16)
0
0000
00
1
0001
01
2
0010
02
3
0011
03
4
0100
04
5
0101
05
6
0110
06
7
0111
07
8
1000
10
9
1001
11
1010
12
A
1011
13
B
1100
14
C
1101
15
D
1110
16
E
1111
17
F
Convert decimal to binary by repeated division by two.
e.g. 2510 in binary?
25
2 =
remainder 1
remainder 0
Read remainders from bottom up.
Convert decimals less than one to binary by repeated multiplication by two.
e.g. 0.62510 in binary?
0.625
1.25
whole number 1
0.25
0.5
whole number 0
1.0
Read whole numbers from top down.
Therefore 25.62510 = 11001.1012