0% found this document useful (0 votes)
34 views50 pages

IT - 7 Number Systems Conversions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views50 pages

IT - 7 Number Systems Conversions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 50

Lecture 02

Welcome to this course on

Introduction to IT

Lecturer: Baitullah Malakhil


1
Outline

 What is number system?


 Decimal number system
 Binary number system
 Octal number system
 Hexadecimal number system
 Conversions

2
Number System

 A set of values used to represent different quantities is known


as number system
 The total number of symbols or digits in any number system is
called base or radix of that number system.
 We would like to talk about these four number systems:
(1) Decimal Number System
(2) Binary Number System
(3) Octal Number System
(4) Hexadecimal Number System

3
Decimal Number System

 The most popular and commonly used number system is the


Decimal Number System.
 It supports all the mathematical and accounting concepts in the
world.
 This number system is also called Natural Number System
because it is natural to humans.
 Human beings use their ten fingers for counting numbers and
the same is true with decimal system.
 It is composed of ten symbols or digits and hence the system
is known as decimal system (deci means ten).
 The base or radix of decimal number system is 10
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
4
Binary Number System

 Binary Number System consists of two digits or symbols as


the name implies (bi means two).
 As the total number of digits or symbols in the system is two,
therefore the base or radix of the binary system is 2.
 The digits or symbols of binary system are as follows:
[0,1]
 This number system is natural to electronic machines or
devices as their mechanism based on the off or on switching
of the circuits.
 Therefore, 0 represents the OFF and 1 represents the ON state
of the circuit.

5
Octal Number System

 Octal Number System as the name implies, (octal means


eight) constitutes of eight symbols or digits.
 The base or radix of octal number system is 8.
 The eight symbols of the octal system are as follows:
[0, 1, 2, 3, 4, 5, 6,7]
 Octal was used extensively in early mainframe computer
systems.
 But has become less popular in favor of binary and
hexadecimal today.

6
Hexadecimal Number System

 Hexa means six and Deci means ten, so sum is sixteen.


 The hexadecimal number system has 16 symbols or digits.
 So the base or radix of this system is 16.
 This number system uses numerical values from 0-9 and
alphabets from A-F.
 Alphabets from A to F represents the quantity of decimal
numbers from 10 to 15.
 The hexadecimal number system digits are as follows:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E,F]

7
Number Notation

 Which number system does the number 23456 belongs to ??


 Which number system does the number 101010 belongs to??
 (101010)16
 (101010)8
 (101010)10
 (101010)2
 (23456)10
 (23456)16
 (23456)8 8
Number System Table

9
Conversions

 Every type of data (Pictures, Videos, PDF, Docs, Audio ..etc.)


is converted into binary number data before it is stored or
processed by digital machines.
 Since computer uses binary notation and binary codes.
 Therefore, arithmetic in other systems are converted to binary
numbers and processed accordingly.
 The results are then converted back to the required number
system.
 Now we are going through different conversions to understand
this procedure.
 The possible conversions from one system to anther can be
done by twelve different methods.
10
Conversions

1. Decimal System to Binary System


2. Decimal System to Octal System
3. Decimal System to Hexadecimal System
4. Binary System to Decimal System
5. Octal System to Decimal System
6. Hexadecimal System to Decimal System
7. Binary System to Octal System
8. Octal System to Binary System
9. Binary System to Hexadecimal System
10.Hexadecimal System to Binary System
11.Octal System to Hexadecimal System
12.Hexadecimal System to Octal System
11
Case A: D-to-B Conversion

 Method:
1. Divide decimal number by 2 (base of binary number).
2. Repeat this method until quotient is less than 2.
3. Bottom to top sequence of remainders will be the
required binary number.

12
Case A: D-to-B Conversion

 Example No. 1: (14)10= (?)2


Let x be the required binary number:
(14)10 = (x)2

Divide 14 by 2, we get

2 14 x = 1110
2 7 0 (14)10 = (1110)2
2 3 1
1 1

13
Case A: D-to-B Conversion

 Other Examples:

 Example No. 2: (43)10 = (?)2

 Example No. 3: (164)10 = (?)2

 Example No. 4: (333)10 = (?)2

 Example No. 5: (4096)10= (?)2

 Example No. 6: (2309)10= (?)2


14
Case A: D-to-O Conversion

 Method:
1. Divide decimal number by 8 (base of octal number).
2. Repeat this method until quotient is less than 8.
3. Bottom to top sequence of remainders will be the required
octal number.

15
Case A: D-to-O Conversion

 Example 01:
 Example No. 1: (19)10 = (?)8

Let x be the required octal number


(19)10 = (x)8
Divide 19 by 8, we get

8 19
2 3

x = 23
(19)10 = (23)8 16
Case A: D-to-O Conversion

 Other Examples:

 Example No. 2: (125)10 = (?)8

 Example No. 3: (332)10 = (?)8

 Example No. 4: (2473)10= (?)8

 Example No. 5: (11570)10= (?)8

 Example No. 6: (2309)10= (?)8


17
Case A: D-to-H Conversion

 Method:
1. Divide decimal number by 16 (base of octal number).
2. Repeat this method until quotient is less than 16.
3. Replace the numbers from [10-15] by letters [A-F].
4. Bottom to top sequence of remainders will be the required
octal number.

18
Case A: D-to-H Conversion

 Example 01:
 Example No. 1: (44)10 = (?)16

Let x be the required octal number


(44)10 = (x)16
Divide 44 by 16, we get

16 44
2 12 C

x = 2C
(44)10 = (2C)16 19
Case A: D-to-O Conversion

 Other Examples:

 Example No. 2: (125)10 = (?)16

 Example No. 3: (332)10 = (?)16

 Example No. 4: (2473)10= (?)16

 Example No. 5: (11570)10= (?)16

 Example No. 6: (2309)10= (?)16


20
Case B: B-to-D Conversion

 Method:
1. Write binary number in power of 2 (base of binary number)
2. Index the numbers from right to left starting with zero.
3. Calculate the powers, this will give the number in decimal

21
Case B: B-to-D Conversion

 Example No. 1: (11011)2 = (?)10

Let x be the required decimal number


(11011)2 = (x)10
Write 11011 in power of 2, we get
= 1 * 24 + 1 * 23 + 0 * 22 + 1 * 21 + 1 * 20
= 1 * 16 + 1 * 8 + 0 * 4 + 1 * 2 + 1 * 1
= 16 + 8 + 0 + 2 + 1
= 27

(11011)2 = (27)10

22
Case B: B-to-D Conversion

 Other Examples:

 Example No. 2: (11000)2= (?)10

 Example No. 3: (100011)2= (?)10

 Example No. 4: (111001)2= (?)10

 Example No. 5: (1011010)2= (?)10

 Example No. 6: (10000111)2= (?)10


23
Case B: B-to-O Conversion

 Method:
1. Break binary number into groups of three bits each, starting
from the right most bit towards left.
2. If the left most group contains less than three bits, then add
zeros to the left, so that a group of three bit can be formed.
3. Write octal number against each group of three bits from
table.

24
Case B: B-to-O Conversion

 Example No. 1: (111001)2 = (?)8

Let x be the required octal number


(111001)2 = (x)8
Break 111001 into group of three bits and write octal
digit against each group, we get

111 001

7 1
(111001)2 = (71)8

25
Case B: B-to-O Conversion

 Other Examples:

 Example No. 2: (11000)2= (?)8

 Example No. 3: (100011)2= (?)8

 Example No. 4: (111001)2= (?)8

 Example No. 5: (1011010)2= (?)8

 Example No. 6: (10000111)2= (?)8


26
Case B: B-to-H Conversion

 Method:
1. Break binary number into groups of FOUR bits each,
starting from the right most bit towards left.
2. If the left most group contains less than four bits, then add
zeros to the left, so that a group of four bit can be formed.
3. Write Hexadecimal number against each group of four bits
from table.

27
Case B: B-to-H Conversion

 Example No. 1: (111001)2 = (?)16

Let x be the required hexadecimal number


(111001)2 = (x)16
Break 111001 into group of Four bits and write
hexadecimal digit against each group, we get

0011 1001

3 9
(111001)2 = (39)16

28
Case B: B-to-H Conversion

 Other Examples:

 Example No. 2: (11000)2= (?)16

 Example No. 3: (100011)2= (?)16

 Example No. 4: (111001)2= (?)16

 Example No. 5: (1011010)2= (?)16

 Example No. 6: (10000111)2= (?)16


29
Case C: O-to-D Conversion

 Method:
1. Write octal number in power of 8 (base of octal number).
2. Index the octal digits from right to left starting with zero.
3. Calculate the powers, this will give the number in decimal.

30
Case C: O-to-D Conversion

 Example No. 1: (1234)8= (?)10

Let x be the required decimal number


(1234)8 = (x)10
Write 1234 in power of 8, we get
= 1 * 83 + 2 * 82 + 3 * 81 + 4 * 80
= 1 * 512 + 2 * 64 + 3 * 8 + 4 * 1
= 512 + 128 + 24 + 4
= 668

(1234)8 = (668)10

31
Case C: O-to-D Conversion

 Other Examples:

 Example No. 2: (230023)8= (?)10

 Example No. 2: (7766)8= (?)10

 Example No. 2: (23523)8= (?)10

 Example No. 2: (100100)8= (?)10

 Example No. 2: (6060)8= (?)10


32
Case C: O-to-B Conversion

 Method:
1. Write three bits against each octal digit from table.
2. Join these binary digits and that will be the equivalent of
octal number.

33
Case C: O-to-B Conversion

 Example No. 1: (54)8 = (?)2

Let x be the required binary number


(54)8 = (x)2
Write against each octal digit its equivalent three bits from
table, we get

5 4

101 100
(54)8 = (101100)2

34
Case C: O-to-B Conversion

 Other Examples:

 Example No. 2: (230023)8= (?)2

 Example No. 2: (7766)8= (?)2

 Example No. 2: (23523)8= (?)2

 Example No. 2: (100100)8= (?)2

 Example No. 2: (6060)8= (?)2


35
Case C: O-to-H Conversion

 Method:
1. Write three binary digits against each octal digit from table.
2. Join these binary digits and that will be the equivalent of
octal number.
3. Group the binary digits into groups of four.
4. If any group has less than 4 digits, then add zeros to the left
and make sure every group has 4 binary digits.
5. Write a Hexadecimal digits against each group from the
table.

36
Case C: O-to-H Conversion

 Example No. 1: (5402)8 = (?)16


Let x be the required hexadecimal number
(5402)8 = (x)16
Write against each octal digit its equivalent three binary
digits from table, we get
5 4 0 2
101 100 000 010
(5402)8 = (101100000010)2
1011 0000 0010
B 0 2

(5402)8= (B02)16
37
Case C: O-to-H Conversion

 Other Examples:

 Example No. 2: (230023)8= (?)16

 Example No. 2: (7766)8= (?)16

 Example No. 2: (23523)8= (?)16

 Example No. 2: (100100)8= (?)16

 Example No. 2: (6060)8= (?)16


38
Case D: H-to-D Conversion

 Method:
1. Write hexadecimal number in power of 16 (base of
hexadecimal system).
2. Index the hexadecimal digits from right to left starting with
zero.
3. Replace the digits [A-F] with decimal numbers from table
[10-15]
4. Calculate the powers, this will give the number in decimal.

39
Case D: H-to-D Conversion

 Example No. 1: (A234)16= (?)10

Let x be the required decimal number


(A234)16 = (x)10
Write A234 in power of 16, we get
= A * 163 + 2 * 162 + 3 * 161 + 4 * 160
= 10 * 4096 + 2 * 256 + 3 * 16 + 4 * 1
= 40960 + 512 + 64 + 4
=

(A234)16 = (41540)10

40
Case D: H-to-D Conversion

 Other Examples:

 Example No. 2: (BBC)16= (?)10

 Example No. 2: (B89)16= (?)10

 Example No. 2: (12FF)16= (?)10

 Example No. 2: (56E2)16= (?)10

 Example No. 2: (121212)16= (?)10


41
Case D: H-to-B Conversion

 Method:
1. Write a group of Four bits against each hexadecimal digit
from table.
2. Join these binary digits and that will be the equivalent of
hexadecimal number

42
Case D: H-to-D Conversion

 Example No. 1: (A234)16= (?)2

Let x be the required binary number


(A234)16 = (x)2
Write four binary digits again each of A234 hexadecimal
digits:
A 2 3 4
1010 0010 0011 0100

(A234)16 = (1010001000110100)2

43
Case D: H-to-D Conversion

 Other Examples:

 Example No. 2: (BBC)16= (?)2

 Example No. 2: (B89)16= (?)2

 Example No. 2: (12FF)16= (?)2

 Example No. 2: (56E2)16= (?)2

 Example No. 2: (121212)16= (?)2


44
Case D: H-to-O Conversion

 Method:
1. Write FOUR binary digits against each hexadecimal digit
from table.
2. Join these binary digits and that will be the equivalent
binary of the hexadecimal number.
3. Group the binary digits into groups of THREE.
4. If any group has less than 3 digits, then add zeros to the left
and make sure every group has 3 binary digits.
5. Write a octal digits against each group from the table.

45
Case D: H-to-O Conversion

 Example No. 1: (A402)16 = (?)8


Let x be the required Octal number
(A402)16 = (x)8
Write against each hexadecimal digit its equivalent 4 binary
digits from table, we get
A 4 0 2
1010 0100 0000 0010
(A402)16 = (1010010000000010)2
001 010 010 000 000 010
1 2 2 0 0 2

(A402)16= (122002)8
46
Case D: H-to-O Conversion

 Other Examples:

 Example No. 2: (BBC)16= (?)8

 Example No. 2: (B89)16= (?)8

 Example No. 2: (12FF)16= (?)8

 Example No. 2: (56E2)16= (?)8

 Example No. 2: (121212)16= (?)8


47
Exercise
Decimal Binary Octal Hexadecimal
1234500
987345
300300
100101110111
1110100011
10010001000
1231234
767676
564564
77777
AB345
2DC45
EF99888
FFFFFF
48
References

 Digital Logic and Computer Design by M. Morris Mano

49
End of the Chapter

50

You might also like