NUMBER
SYSTEMS
Learning Outcomes
1. Distinguish the various number systems.
2. Perform number system conversion.
3. Perform number system arithmetic.
4. Represent data using the different data
representation techniques.
NUMBER SYSTEMS
DECIMAL
BINARY
OCTAL
HEXADECIMAL
VALID VALUES
DECIMAL
0 1 2 3 4 5 6 7 8 9
BINARY
0 1
OCTAL
0 1 2 3 4 5 6 7
HEXADECIMAL
0 1 2 3 4 5 6 7 8 9 A B C D E F
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15
NUMBER SYSTEM
CONVERSION
WHOLE NUMBERS
WHOLE NUMBER CONVERSIONS
1) From Decimal to Other Number System
2) From Other Number System to Decimal
3) From Octal to Binary and Binary to Octal
4) From Hexadecimal to Binary and Binary to
Hexadecimal
5) From Octal to Hexadecimal and Hexadecimal to
Octal
CONVERSION
From
DECIMAL
to
ANY NUMBER SYSTEM
CONVERSION FROM DECIMAL TO
BINARY, DIVISOR IS 2
OCTAL, DIVISOR IS 8
HEXADECIMAL, DIVISOR IS 16
Steps :
Divide the decimal number by the divisor until
the quotient becomes zero (0).
The remainder should be noted down for each
division step.
Then the remainders are read in reverse order.
DECIMAL TO Division Quotient Remainder
BINARY 26
CONVERSION ------ = 13 0
2
Convert 26 to 13
binary ------ = 6 1
2
6
------ =3 0
26 = 110102 2
3
------ =1 1
2
1
------ =0 1
2
2 26 – 26 =0
2 13 – 12 =1
2 6 - 6 =0
2 3 - 2 =1
2 1 - 0 =1
2 0
26 = 110102
13 6 3 1 0
2 26 2 13 2 6 2 3 2 1
26 12 6 2 0
0 1 0 1 1
26 = 110102
DECIMAL TO OCTAL CONVERSION
Convert 426 to octal
Division Quotient Remainder
426
------ = 53 2
8
53
426 = 6528 ------ = 6 5
8
6
------ =0 6
8
26
8 26 – 24 = 2
8 3- 0=3
0
26 = 328
50
8 50 – 48 = 2
8 6- 0=6
0
50 = 628
75
8 75 – 72 = 3
8 9- 8=1
8 1 - 0=1
0
75 = 1138
DECIMAL TO HEXADECIMAL CONVERSION
Convert 348 to hexadecimal
Division Quotient Remainder
348
------ = 21 12
16
21
------ = 1 5
16
1
------ =0 1
16
348 = 15C16
50
16 50– 48 = 2
16 3 - 0 = 3
16 0
50 = 3216
75
16 75 – 64 = 11
16 4 - 0 = 4
16 0
75 = 4B16
Convert the following numbers to decimal the
specified number system:
88 (base 10) -> binary, octal, hexadecimal
CONVERSION
From
ANY NUMBER SYSTEM
to
DECIMAL
CONVERSION FROM ANY NUMBER SYSTEM TO
DECIMAL
Take note of the positional weight of the digits in the
number systems
Binary number 1 1 0 1 02
Octal number 4 2 68
Hexadecimal number 1 5 C16
Multiply each digit to be converted with its positional
weight depending on the base of the number.
CONVERSION FROM ANY BINARY SYSTEM TO
DECIMAL
Example Binary number 1 1 0 1 02
Multiply each bit with its positional weight depending
on the base (radix) of the number system
= 1 X 24 + 1 X 23 + 0 X 22 + 1 X 21 + 0 X 20
= 1 X 16 + 1 X 8 + 0 X 4 + 1 X 2 + 0X1
= 16 + 8 + 0 + 2 + 0
= 26
Hence 1 1 0 1 02 = 2610
16 8 4 2 1
1 1 1 1 02
1 0 1 1 0 12
1 X 20 = 1
0 X 21 = 0
1 X 22 = 4
1 X 23 = 8
0 X 24 = 0
1 X 25 = 32
45
32 8 4 1
1011012=
4510
CONVERSION FROM ANY OCTAL SYSTEM TO
DECIMAL
Example Octal number 6 5 28
Multiply each digit with its positional weight depending
on the base of the number system
= 6 X 82 + 5 X 81 + 2 X 80
= 6 X 64 + 5 X 8 + 2 X 1
= 384 + 40 + 2
= 426
Hence 6528 = 42610
5 58
5 58
5 X 80 = 5
5 X 81 = 40
45
3 1 18
3 1 18
1 X 80 = 1
1 X 81 = 8
3 X 82 = 192
201
CONVERSION FROM HEXADECIMAL SYSTEM TO
DECIMAL
Example Hexadecimal number 1 5 C16
Multiply each digit with its positional weight depending
on the base of the number system
= 1 X 162 + 5 X 161 + 12 X 160
= 1 X 256 + 5 X 16 + 12 X 1
= 256 + 80 + 12
= 348
Hence 1 5C16 = 34810
2 D16
2 D16
13 X 160 = 13
2 X 161 = 32
45
8 C16
8 C16
12 X 160 = 12
8 X 161 = 128
140
Convert the following numbers to decimal the
specified number system:
1) ABC (base 16)
2) 555 (base 8)
3) 11100111 (base 2)
ABC base 16 =
(10 × 16²) + (11 × 16¹) + (12 × 16⁰) =
2748 base 10
555 base 8 = (5 × 8²) + (5 × 8¹) + (5 ×
8⁰) = 365 base 10
11100111 base 2 =
(1 × 2⁷) + (1 × 2⁶) + (1 × 2⁵) + (0 × 2⁴) +
(0 × 2³) + (1 × 2²) + (1 × 2¹) + (1 × 2⁰) =
231 base 10
1.ABC (16) 2748
2.555 (8) 365
3.11100111 (2) 231
CONVERSIONS
1) From Decimal to Other Number System
2) From Other Number System to Decimal
3) From Octal to Binary and Binary to Octal
4) From Hexadecimal to Binary and Binary to
Hexadecimal
5) From Octal to Hexadecimal and Hexadecimal to
Octal
CONVERSION
From
BINARY to OCTAL
and
VICE VERSA
CONVERSION FROM BINARY TO OCTAL
In an octal number system the maximum
digit is 7, which is represented in binary as
1112
To convert binary to octal,
- Group the digits by 3s starting at the
least significant bit (LSB)
- Replace each group by the octal
equivalent
CONVERSION FROM BINARY TO OCTAL
Example 101 101 0102
- Group the digits by 3s starting at the least
significant bit (LSB)
101 101 010
- Replace each group by the octal equivalent
101 101 010
5 5 2
Hence 1011010102 = 5528
4 2 1 <- positional weight
1 1 1 = 7
0 1 0 = 2
1 0 1 = 5
111 7
3 Bit
110 6
Equivalent
of each
101 5
Octal 100 4
Number 011 3
010 2
001 1
000 0
CONVERSION FROM OCTAL TO BINARY
- Each octal digit is converted into a 3-
bit-equivalent binary number
- Combine all the digits to get the final
binary equivalent
Example 5528
5 5 2
101 101 010
Therefore : 5528 = 1011010102
CONVERSION FROM BINARY TO OCTAL
1) 11011101100112
2) 1001110110012
3) 10011101101012
CONVERSION FROM OCTAL TO BINARY
1) 70028
2) 6418
3) 1018
CONVERSION
From
BINARY to HEXADECIMAL
and
VICE VERSA
CONVERSION FROM BINARY TO
HEXADECIMAL
In a hexadecimal number system the
maximum digit is 15, which is represented
in binary as 11112
To convert binary to hexadecimal,
- Group the digits by 4s starting at the
least significant bit (LSB)
- Replace each group by the hexadecimal
equivalent
CONVERSION FROM BINARY TO
HEXADECIMAL
Example 1 0110 10102
- Group the digits by 4s starting at the least
significant bit (LSB)
0001 0110 1010
- Replace each group by the hexadecimal
equivalent
0001 0110 1010
1 6 A
Hence 1011010102 = 16A16
8 4 2 1 <- positional weight
1 1 1 1 = F (15)
4 Bit Equivalent of each
Hexadecimal Number
1111 F (15) 1001 9
1110 E 1000 8
1101 D 0110 7
1100 C 0110 6
1011 B 0101 5
1010 A 0100 4
0011 3
0010 2
0001 1
0000 0
CONVERSION FROM HEXADECIMAL TO
BINARY
- Each hexadecimal digit is converted into
a 4-bit-equivalent binary number
- Combine all the digits to get the final
binary equivalent
Example 16A16
1 6 A
0001 0110 1010
Therefore : 16A16 = 1011010102
CONVERSION FROM BINARY TO
HEXADECIMAL
1) 11011101100112
2) 1001110110012
3) 10011101101012
CONVERSION FROM HEXADECIMAL TO BINARY
1) ACE16
2) 64116
3) CAB16
BEAD(16)
1 011 111 101 101
137455
137255
CONVERSION
From
OCTAL to HEXADECIMAL
and
VICE VERSA
CONVERSION FROM OCTAL TO
HEXADECIMAL
- Convert the octal number to its binary
equivalent
- Form groups of 4 bits starting from LSB
- Write the equivalent hexadecimal for
each group of 4 bits
CONVERSION FROM OCTAL TO
HEXADECIMAL
Example : 5528
- Convert the octal number to its binary
equivalent
5 5 2
101 101 010
- Form groups of 4 bits starting from LSB
1 0110 1010 → 0001 0110 1010
- Write the equivalent hexadecimal for each
group of 4 bits
0001 0110 1010
1 6 A
Therefore : 5528 = 16A16
CONVERSION FROM HEXADECIMAL TO
OCTAL
- Convert the hexadecimal number to its
binary equivalent
- Form groups of 3 bits starting from LSB
- Write the equivalent octal for each
group of 3 bits
CONVERSION FROM HEXADECIMAL TO
OCTAL
Example : 16C16
- Convert the hexadecimal number to its binary
equivalent
1 6 C
0001 0110 1100
- Form groups of 3 bits starting from LSB
101 101 100 → 101 101 100
- Write the equivalent octal for each group of 3
bits
101 101 100
5 5 4
Therefore : 16C16 = 5548
CONVERSIONS
1) From Decimal to Other Number System
2) From Other Number System to Decimal
3) From Octal to Binary and Binary to Octal
4) From Hexadecimal to Binary and Binary to
Hexadecimal
5) From Octal to Hexadecimal and Hexadecimal to
Octal
References:
Digital Principles and Logic Design
A. Saba & N. Manna