Number Systems
Topics
Decimal
Binary
Conversion between decimal and binary
Other bases
Decimal
Or base-10 number
Usually used in normal life.
Each place has 10 posible numbers (0, 1, 2, ..., 9).
The weight of n-th place is
10^{n-1}
1
0
n
−
1
Example
231 = 2\cdot10^2 + 3\cdot10^1 + 1\cdot10^0
2
3
1
=
2
⋅
1
0
2
+
3
⋅
1
0
1
+
1
⋅
1
0
0
= 2\cdot100 + 3\cdot10 + 1\cdot1
=
2
⋅
1
0
0
+
3
⋅
1
0
+
1
⋅
1
= 200 + 30 + 1
=
2
0
0
+
3
0
+
1
binary
Or base-2 number
Usually used in digtal sytems (including digital computer).
Each place has 2 posible numbers (0 and 1).
The weight of n-th place is
2^{n-1}
2
n
−
1
Example
1101_2 = 1\cdot2^3 + 1\cdot2^2 + 0\cdot2^1 + 1\cdot2^0
1
1
0
1
2
=
1
⋅
2
3
+
1
⋅
2
2
+
0
⋅
2
1
+
1
⋅
2
0
= 1\cdot8 + 1\cdot4 + 0\cdot2 + 1\cdot1
=
1
⋅
8
+
1
⋅
4
+
0
⋅
2
+
1
⋅
1
= 8 + 4 + 0 + 1
=
8
+
4
+
0
+
1
The Conversion
Decimal to binary
101100101_2
1
0
1
1
0
0
1
0
1
2
The conversion
Binary to decimal
1101_2 = 1\cdot2^3 + 1\cdot2^2 + 0\cdot2^1 + 1\cdot2^0
1
1
0
1
2
=
1
⋅
2
3
+
1
⋅
2
2
+
0
⋅
2
1
+
1
⋅
2
0
= 1\cdot8 + 1\cdot4 + 0\cdot2 + 1\cdot1
=
1
⋅
8
+
1
⋅
4
+
0
⋅
2
+
1
⋅
1
= 8 + 4 + 0 + 1
=
8
+
4
+
0
+
1
= 13
=
1
3
Other bases
octal
Or base-8 number
Used represent base-2 number for short.
Each place has 8 posible numbers (0, 1, 2, ..., 7).
The weight of n-th place is
8^{n-1}
8
n
−
1
using octal to represent the binary
hexadecimal
Or base-16 number
Used represent base-2 number for short (shorter than octal).
Each place has 10 posible numbers (0, 1, 2, ..., 9) and 6 possible alphabets (A, B, C, ..., F)
The weight of n-th place is
16^{n-1}
1
6
n
−
1
using hexadecimal to represent binary
thanks
for your
Attention
Made with Slides.com