Lecture 5 - Number System Conversions
Lecture 5 - Number System Conversions
Higher Diploma in
Information Technology –
Year 01, Semester 01
Computing Fundamentals
2371 → ?
2371/8 →3
296/8 →0 237110 = 45038
Collect
37/8 → 5
4/8 →4
0
SLIIT City Uni (Pvt) Ltd. © 2024
Decimal to Hexadecimal
Decimal numbers are converted from decimal into
hexadecimal form in exactly the same way as the above.
However, in this case the remainder lies in the decimal
range 0 to 15, corresponding to the hexadecimal range
0 to F.
Example : 946 → ?
946/16 → 2
94610 = 3B216
59/16 → 11 (B) Collect
3/16 → 3
0
SLIIT City Uni (Pvt) Ltd. © 2024
Exercise
Convert the following numbers into binary, octal
and hexadecimal
Binary Octal Hexa
68 1000100 104 44
135 10000111 207 87
10101112 = 8710
101101112 = 2678
• 14 1110 E
• 15 1111 F
SLIIT City Uni (Pvt) Ltd. © 2024
Octal to Decimal
Method 1: Expansion method
Expand the definition by multiplying each Octal digit with its
positional value. Add the multiplied values together
45038
83 82 81 80
(512) (64) (8) (1)
4 5 0 3
= 4x512 + 5x64 + 0x8 + 3x1
= 2371
45038 = 237110
SLIIT City Uni (Pvt) Ltd. © 2024
Octal to Decimal
Method 2:
We take the left-most digit,
Multiply it by eight and
Add it to the digit on its right.
Then multiply this subtotal by eight and add it
to the next digit on its right.
The process ends when the left-most digit has
been added to the subtotal.
SLIIT City Uni (Pvt) Ltd. © 2024
Octal to Decimal : Method 2
64378 = 335910
Method 2:
The method is identical
to the procedures for
binary and octal except
that 16 is used as a
multiplier.
1AC16 = 42810
245.75
11.1012
110.10112
0.8125 → ?
0.8125 x 2 = 1.625 → 1
0.625 x 2 = 1.25 → 1 0.1101
0.25 x 2 = 0.5 → 0
0.5 x 2 = 1.0 → 1
0 Collect
0.812510= 0.11012
0.7 → ?
0.7 x 2 = 1.4 → 1
0.4 x 2 = 0.8 → 0
0.8 x 2 = 1.6 → 1 0.1011001100110...
0.6 x 2 = 1.2 → 1
0.2 x 2 = 0.4 → 0
0.4 x 2 = 0.8
… SLIIT City Uni (Pvt) Ltd. © 2024
Converting between Octal / Hexadecimal
Fractions Decimal Fractions
We can convert between octal or hexadecimal
fractions and decimal.
We have to change is the base (i.e. 2 to 8 or 2 to
16).