Uploaded by mondhersadki2019

7339eb 3fa2d6231c324b348e3adfc719f8644e

advertisement
Introduction to Bases
1. Base 10 (Decimal): {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}:
•
In the decimal system (base 10), we use ten different digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
•
We start counting from 0 and continue until we reach 9. After 9, we don't have any more
unique digits, so we write 10. We then continue counting from 11, 12, 13, and so on, up
to 19.
•
After 19, we increment to 20, then 21, and we continue counting until we reach 99. After
99 comes 100, signifying one hundred.
2. Base 8 (Octal): {0, 1, 2, 3, 4, 5, 6, 7}:
•
In the octal system (base 8), we use eight different digits: 0, 1, 2, 3, 4, 5, 6, and 7.
•
Counting in octal starts from 0 and continues until we reach 7. After 7, we don't have any
more unique digits, so we write 10. We then continue counting with 11, 12, 13, and so
on, up to 17.
•
After 17, we increment to 20, then 21, and we continue counting until we reach 77. After
77 comes 100 in octal.
3. Base 2 (Binary): {0, 1}:
•
In the binary system (base 2), we use only two digits: 0 and 1.
•
Counting in binary starts from 0 and continues until we reach 1. After 1, we don't have
any more unique digits, so we write 10. We then continue counting with 11, 100, 101,
and so on.
•
After 111 in binary, we increment to 1000, then 1001, and we continue counting until we
reach 1111. After 1111 comes 10000 in binary.
4. Base 16 (Hexadecimal): {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}:
•
In the hexadecimal system (base 16), we use sixteen different digits: 0-9 and A-F (where
A represents 10, B represents 11, and so on up to F representing 15).
•
Counting in hexadecimal starts from 0 and continues until we reach F (which is 15 in
decimal). After F, we write 10. We then continue with 11, 12, and so forth, up to 1F.
•
After 1F, we increment to 20, then 21, and we continue counting until we reach FF. After
FF comes 100 in hexadecimal.
Base 10
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Base 2
0
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
10000
10001
10010
10011
10100
Base 8
0
1
2
3
4
5
6
7
10
11
12
13
14
15
16
17
20
21
22
23
24
Base 16
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
10
11
12
13
14
1- Conversion from Any Base to Decimal (X→10)
(1001)
(𝟐)
=?
𝟏𝟎
(1𝟎𝟎𝟏)
𝟎
𝟏
𝟐
𝟑
=
1

2
+
0

2
+
0

2
+
1

2
3 2 1 0 (𝟐)
=
1 + 0
+
0 + 8
= 9
2- Conversion from Decimal Base to Any Base (10→X)
Example: Conversion of a decimal number 167 to binary
3- Conversion from Any Base to Any Base (X→Y)
To convert a number from base X to base Y, where both bases X and Y
are different from 10, you can follow these steps:
1. Convert the number from Base X to Base 10
2. Convert the resulted number from Base 10 to Base Y
Base 16 to Base 2 ➔ 4 positions
Base 8 to Base 2 ➔ 3 positions
4- Conversion from Hexadecimal to Binary (16→2)
To convert a hexadecimal number to binary, you need to
break down each hexadecimal digit into its 4-bit binary
equivalent.
A5C(𝟏𝟔) ➔ A-5-C ➔ 1010 0101 1100(𝟐)
1001011100(𝟐) ➔ 0010-0101-1100➔ 25C(𝟏𝟔)
5- Conversion from Octal to Binary (8→2)
To convert an octal number to binary, you need to break
down each octal digit into its 3-bit binary equivalent.
51(𝟖) ➔ 5-1 ➔ 101 001(𝟐)
11 001(𝟐) ➔ 011-001 ➔ 31(𝟖)
Operations (Addition, subtraction, division, multiplication)
Download