Lesson 2 Number Base Conversion
Lesson 2 Number Base Conversion
To convert a binary number into an octal number, you first divide the binary number into groups
of three binary digits from right side towards the left side.( NB; Add zeros incase bits are less
than three) For each group of three binary digits convert to their equivalent octal value. Then put
the values together to get the required octal number.
Example 1
Convert the binary number 1010011112 into Octal number
1010011112
101 001 111
510 110 710
5178
NB: You first divide the binary number into groups of three binary digits from right side towards
the left side. AND For each group of three binary digits convert them to their equivalent octal
value. Then put the values together to get the required octal number, Therefore the answer is
51710
Example 2
Convert the binary number 1100111110112 into octal number
1100111110112
110 011 111 011
610 310 710 310
63738
Therefore the answer is 63738
NB: Octal numbers are numbers to base 8 Where 8=23 therefore ALL octal
numbers are represented with three binary digits.
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 1
Class Exercise 9:
Convert the following Binary numbers into octal numbers
I. 11111100012
II. 10101010102
III. 1110011001112
IV. 1001001001001002
V. 1000000111111102
VI. 11012
VII. 12
VIII. 111.1012
IX. 110011.100012
X. 1010.1100112
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 2
1.10 CONVERTING OCTAL NUMBER INTO BINARY NUMBER
To convert a octal number into an binary number, convert each octal digit into its equivalent three
bits binary digits Then put the values together to get the required binary number.
Example 1
Convert the Octal number 2538 into Binary number
2538
010 101 011
0101010112
NB: You first convert each octal number into its equivalent three bits binary digits Then put the
values together to get the required binary number, Therefore the answer is 0101010112
Example 2
Convert the Octal number 5678 into Binary number.
5678
101 110 111
1011101112
NB: You first convert each octal number into its equivalent three binary digits Then put the
values together to get the required binary number, Therefore the answer is 1011101112
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 3
Class Exercise 10:
Convert the following Octal numbers into binary numbers.
I. 38
II. 548
III. 7548
IV. 2348
V. 6668
VI. 7228
VII. 76548
VIII. 4.1238
IX. 54.7658
X. 234.2348
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 4
1.11 CONVERTING BINARY NUMBER INTO HEXADECIMAL NUMBER.
To convert a binary number into Hexadecimal number, you first divide the binary number into
groups of four binary digits from right side towards the left side.(NB; Add zeros incase bits are
less than four). For each group of four binary digits convert to their equivalent hexadecimal value.
Then put the values together to get the required hexadecimal number.
Example 1
Convert the binary number 1010011112 into hexadecimal decimal number
1010011112
0001 0100 1111
116 416 F16
14F16
NB: first divide the binary number into groups of four binary digits from right side towards the
left side. For each group of four binary digits convert to their equivalent hexadecimal value. Then
put the values together to get the required hexadecimal number, Therefore the answer is 14F16
Example 2
Convert the binary number 110110111010112 into hexadecimal number
110110111010112
0011 0110 1110 1011
316 616 E16 B16
36EB16
Therefore the answer is 36EB16
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 5
Class Exercise 11:
Convert the following Binary numbers into Hexadecimal numbers
I. 11111100012
II. 10101010102
III. 1110011001112
IV. 1001001001001002
V. 1000000111111102
VI. 1011012
VII. 112
VIII. 1001101.1012
IX. 110011.100012
X. 1010.1100112
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 6
1.12 CONVERTING HEXADECIMAL NUMBER INTO BINARY NUMBER
To convert a Hexadecimal number into a binary number, convert each Hexa digit into its
equivalent four bits binary number, then put the values together to get the required binary number.
Example 1
Convert the hexadecimal number 26916 into binary number
26916
0010 0110 1001
0010011010012
NB: You convert each Hexa digit into its equivalent four binary number, Then put the values
together to get the required binary number. Therefore the answer is 0010011010012
Example 2
Convert the hexadecimal number 5F716 into binary number
5F716
0101 1111 0111
0101111101112
NB: You convert each hexa number into its equivalent four binary number, Then put the values
together to get the required binary number, Therefore the answer is 0101111101112
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 7
Class Exercise 12:
Convert the following Hexadecimal numbers into Binary numbers
I. 10116
II. 42316
III. 5A16
IV. B716
V. 1A316
VI. 32F16
VII. 22516
VIII. 9.23D16
IX. 43.A516
X. 3F9.2BC16
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 8
1.13 CONVERTING OCTAL NUMBER INTO HEXADECIMAL NUMBER
To convert an octal number into Hexadecimal number, first convert each octal number into its
equivalent three binary digits, Put the binary values together, divide the binary digits into groups
of four bits and For each group of four bits convert to their equivalent Hexa digit then put the
Hexa digits together to get the required hexadecimal number.
Example 1
Convert the octal number 2538 into hexadecimal number
2538
010 101 011
0101010112
0000 1010 1011
0 A B
AB16
Therefore the answer is AB16
Example 2
Convert the octal number 5678 into Hexadecimal number
5678
101 110 111
1011101112
0001 0111 0111
1 7 7
17716
Therefore the answer is 17716
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 9
Class Exercise 13:
Convert the following OCTAL numbers into Hexadecimal numbers
I. 38
II. 548
III. 7548
IV. 2348
V. 6668
VI. 7228
VII. 76548
VIII. 4.1238
IX. 54.7658
X. 234.2348
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 10
1.14 CONVERTING HEXADECIMAL NUMBER INTO OCTAL NUMBER
To convert Hexadecimal number into octal number, first convert each hexadecimal digit into its
equivalent four binary digits. Put the binary values together. Divide the binary digits into groups
of three bits. For each group of three bits convert to their equivalent octal digit then put the octal
digits together to get the required octal number.
Example 1
Convert the hexadecimal number 4A616 into octal number.
4A616
Example 2
Convert Hexadecimal number 9BF16 into Octal number.
9BF16
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 11
Class Exercise 14:
Convert the following Hexadecimal numbers into Octal numbers
I. 101016
II. 42316
III. 5A16
IV. B716
V. 1A316
VI. 32F16
VII. 22516
VIII. 9.23D16
IX. 43.A516
X. 3F9.2BC16
BY: MR. KEVIN NJAGI (LECTURER - MOUNT KENYA UNIVERSITY) @ SEP - DEC 2021 12