Chapter 1 Numbering Systems
Chapter 1 Numbering Systems
Course: CSC103
Numbering Systems
1. Numbering Bases
- Base 2: binary base, where the digits are 0, 1
- Base 8: octal base, where the digits are 0, 1, 2, 3, 4, 5, 6, 7
- Base 10: decimal base, where the digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- Base 16: hexadecimal base, where the digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Base 8 Base 2
0 000
1 001
2 010
3 011 Table 1
4 100
5 101
6 110
7 111
➢ A hexadecimal digit has a perfect correspondence to a 4-bit binary value number (16 = 24 )
Base 16 Base 2
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111 Table 2
8 1000
9 1001
A(10) 1010
B(11) 1011
C(12) 1100
D(13) 1101
E(14) 1110
F(15) 1111
➢ Binary(2) → Hexadecimal(16)
Separate the binary number in groups of 4 digits each starting from the right side. Complete the most left
group by zeros (in its left side) if it contains less than 4 digits. Convert each group of 4 digits into its
corresponding hexadecimal digit (according to the table 2).
Example
(10110010011011)2 = (0010 1100 1001 1011)2 = (2𝐶9𝐵)16
(𝐴)𝑏 = (∑ 𝑎𝑖 𝑏 𝑖 )10
𝑖=0
Example 1: Binary(2) → Decimal(10)
(011101)2 = ((1 × 20 ) + (0 × 21 ) + (1 × 22 ) + (1 × 23 ) + (1 × 24 ) + (0 × 25 ))
10
=( 1 + 0 + 4 + 8 + 16 + 0 )10
= (29)10
➢ Decimal(10) → Binary(2)
- Successive divisions of the quotient by 2
- Stop when the quotient becomes 0
- Copy the reminders starting from the last division
Example
(756)10 = (? )2
756 = 378 × 2 + 𝟎
378 = 189 × 2 + 𝟎
189 = 94 × 2 + 𝟏
94 = 47 × 2 + 𝟎
47 = 23 × 2 + 𝟏
23 = 11 × 2 + 𝟏
11 = 5 × 2 + 𝟏
5= 2×2+𝟏
2= 1×2+𝟎
1= 𝟎×2+𝟏
(756)10 = (1011110100)2
➢ More Conversions
• Octal (8) → Hexadecimal (16)
Convert the octal number to binary and then from binary to hexadecimal.
Example:
(705)8 = (? )16
(705)8 = (111 000 101)2
(705)8 = (1 1100 0101)2
(705)8 = (0001 1100 0101)2
(705)8 = (1𝐶5)16
➢ Addition
1 + 1 = 0 and reminder 1
1+0=1
0+1=1
0+0=0
Example 1
1 0 1 1 0
+
0 1 1 1 1
= 10 0 1 0 1
Example 2
0 1 1 1 0 1
+
0 1 0 0 0 1
= 1 0 1 1 1 0
➢ Multiplication
1×1=1
1×0=0
0×1=0
0×0=0
Example
1 0 1
×
0 1 1
1 0 1
1 0 1
0 0 0
= 0 1 1 1 1
4. Exercises
A. Convert the following numbers to the indicated base (show your steps)
a. (0111001)2 = (? )10
b. (𝐹𝐸30)16 = (? )10
c. (1764)8 = (? )2
d. (0111001)2 = (? )8
e. (3908)10 = (? )16
B. Find the binary sum and product of the following two binary numbers:
0111001 and 011