Sei sulla pagina 1di 42

Lecture – 04 to 06

Computer Fundamentals
16 Computer Systems Engineering – First Semester

By: Engr. Ali Asghar Manjotho, Lecturer, CSE-MUET


Contents
• Number System Overview
• Decimal Number System
• Binary Number System
• Octal Number System
• Hexadecimal Number System
• Number System Conversion
• Conversion from Decimal to Binary Number System
• Conversion from Binary to Decimal Number System
• Conversion from Decimal to Octal Number System
• Conversion from Octal to Decimal Number System
• Conversion from Decimal to Hexadecimal Number System

Ali Asghar Manjotho, Lecturer CSE-MUET 2


Contents

• Conversion from Hexadecimal to Decimal Number System


• Conversion from Octal to Binary Number System
• Conversion from Binary to Octal Number System
• Conversion from Hexadecimal to Binary Number System
• Conversion from Binary to Hexadecimal Number System

Ali Asghar Manjotho, Lecturer CSE-MUET 3


Number System Overview
Number System is:
• The way of representing numbers.
• Way of counting.

Some common number systems:


• Decimal Number System
• Binary Number System
• Octal Number System
• Hexadecimal Number System
Ali Asghar Manjotho, Lecturer CSE-MUET 4
Decimal Number System

• Deci = 10
• Base / Radix = 10
• Digits = 0 1 2 3 4 5 6 7 8 9

0123456789
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29 30

Ali Asghar Manjotho, Lecturer CSE-MUET 5


Binary Number System

• Bi = 2
• Base / Radix = 2
• Digits = 0 & 1

01
10 11
100 101 110 111
1000 1001 1010 1011 1100 1101 1110 1111

Ali Asghar Manjotho, Lecturer CSE-MUET 6


Octal Number System

• Octate = 8
• Base / Radix = 8
• Digits = 0 1 2 3 4 5 6 7

01234567
10 11 12 13 14 15 16 17
20 21 22 23 24 25 26 27
30 31 32 33 34 35 36 37

Ali Asghar Manjotho, Lecturer CSE-MUET 7


Hexadecimal Number System

• Hexa = 6 & Deci = 10


• Base / Radix = 16
• Digits = 0 1 2 3 4 5 6 7 8 9 A B C D E F

0123456789ABCDEF
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F

Ali Asghar Manjotho, Lecturer CSE-MUET 8


Conversion from Decimal to Binary
Number System

Ali Asghar Manjotho, Lecturer CSE-MUET 9


Conversion from Decimal to Binary Number System

Example 01 : 𝟕𝟖 𝟏𝟎 = ( ? )𝟐
Method 01:
2 78
2 39 ― 0
2 19 ― 1
2 9 ― 1
2 4 ― 1
2 2 ― 0
1 ― 0

𝟕𝟖 𝟏𝟎 = (𝟏𝟎𝟎𝟏𝟏𝟏𝟎)𝟐

Ali Asghar Manjotho, Lecturer CSE-MUET 10


Conversion from Decimal to Binary Number System

Example 01 : 𝟕𝟖 𝟏𝟎 = (? )𝟐
78
Method 02: -64
14
-8
64 32 16 8 4 2 1
6
1 0 0 1 1 1 0 -4
2
-2
0

𝟕𝟖 𝟏𝟎 = (𝟏𝟎𝟎𝟏𝟏𝟏𝟎)𝟐

Ali Asghar Manjotho, Lecturer CSE-MUET 11


Conversion from Decimal to Binary Number System

Example 02 : 𝟏𝟓𝟐 𝟏𝟎 = (? )𝟐
Method 01:
2 152
2 76 ― 0
2 38 ― 0
2 19 ― 0
2 9 ― 1
2 4 ― 1
2 2 ― 0
1 ― 0
𝟏𝟓𝟐 𝟏𝟎 = (𝟏𝟎𝟎𝟏𝟏𝟎𝟎𝟎)𝟐

Ali Asghar Manjotho, Lecturer CSE-MUET 12


Conversion from Decimal to Binary Number System

Example 02 : 𝟏𝟓𝟐 𝟏𝟎 = (? )𝟐
Method 02:
152
-128
24
128 64 32 16 8 4 2 1 -16
1 0 0 1 1 0 0 0 8
-8
0

𝟏𝟓𝟐 𝟏𝟎 = (𝟏𝟎𝟎𝟏𝟏𝟎𝟎𝟎)𝟐

Ali Asghar Manjotho, Lecturer CSE-MUET 13


Conversion from Binary to Decimal
Number System

Ali Asghar Manjotho, Lecturer CSE-MUET 14


Conversion from Binary to Decimal Number System

Example 03 : 𝟏𝟎𝟎𝟏𝟏𝟏𝟎 𝟐 = (? )𝟏𝟎


Method 01:

𝟏 × 𝟐𝟔 + 𝟎 × 𝟐𝟓 + 𝟎 × 𝟐𝟒 + 𝟏 × 𝟐𝟑 + 𝟏 × 𝟐𝟐 + 𝟏 × 𝟐𝟏 + 𝟎 × 𝟐𝟎

⇒ 𝟔𝟒 + 𝟎 + 𝟎 + 𝟖 + 𝟒 + 𝟐 + 𝟎 = 𝟕𝟖

𝟏𝟎𝟎𝟏𝟏𝟏𝟎 𝟐 = (𝟕𝟖)𝟏𝟎

Ali Asghar Manjotho, Lecturer CSE-MUET 15


Conversion from Binary to Decimal Number System

Example 03 : 𝟏𝟎𝟎𝟏𝟏𝟏𝟎 𝟐 = (? )𝟏𝟎


Method 02:

64
8
64 32 16 8 4 2 1 4
1 0 0 1 1 1 0 2
78

𝟏𝟎𝟎𝟏𝟏𝟏𝟎 𝟐 = (𝟕𝟖)𝟏𝟎

Ali Asghar Manjotho, Lecturer CSE-MUET 16


Conversion from Binary to Decimal Number System

Example 04 : 𝟏𝟎𝟎𝟏𝟏𝟎𝟎𝟎 𝟐 = (? )𝟏𝟎


Method 01:

𝟏 × 𝟐𝟕 + 𝟎 × 𝟐𝟔 + 𝟎 × 𝟐𝟓 + 𝟏 × 𝟐𝟒 + 𝟏 × 𝟐𝟑 + 𝟎 × 𝟐𝟐 + 𝟎 × 𝟐𝟏 + 𝟎 × 𝟐𝟎

⇒ 𝟏𝟐𝟖 + 𝟎 + 𝟎 + 𝟏𝟔 + 𝟖 + 𝟎 + 𝟎 + 𝟎

𝟏𝟎𝟎𝟏𝟏𝟎𝟎𝟎 𝟐 = (𝟏𝟓𝟐)𝟏𝟎

Ali Asghar Manjotho, Lecturer CSE-MUET 17


Conversion from Binary to Decimal Number System

Example 04 : 𝟏𝟎𝟎𝟏𝟏𝟎𝟎𝟎 𝟐 = (? )𝟏𝟎


Method 02:

128
128 64 32 16 8 4 2 1 16
8
1 0 0 1 1 0 0 0
152

𝟏𝟎𝟎𝟏𝟏𝟎𝟎𝟎 𝟐 = (𝟏𝟓𝟐)𝟏𝟎

Ali Asghar Manjotho, Lecturer CSE-MUET 18


Conversion from Decimal to Octal Number
System

Ali Asghar Manjotho, Lecturer CSE-MUET 19


Conversion from Decimal to Octal Number System

Example 05 : 𝟕𝟖𝟗 𝟏𝟎 = (? )𝟖

8 789
8 98 ―5
8 12 ―2
1 ―4

𝟕𝟖𝟗 𝟏𝟎 = (𝟏𝟒𝟐𝟓)𝟖

Ali Asghar Manjotho, Lecturer CSE-MUET 20


Conversion from Decimal to Octal Number System

Example 06 : 𝟏𝟎𝟖𝟔 𝟏𝟎 = (? )𝟖

8 1086
8 135 ―6
8 16 ―7
2 ―0

𝟏𝟎𝟖𝟔 𝟏𝟎 = (𝟐𝟎𝟕𝟔)𝟖

Ali Asghar Manjotho, Lecturer CSE-MUET 21


Conversion from Octal to Decimal Number
System

Ali Asghar Manjotho, Lecturer CSE-MUET 22


Conversion from Octal to Decimal Number System

Example 07 : 𝟏𝟒𝟐𝟓 𝟖 = (? )𝟏𝟎

𝟏 × 𝟖𝟑 + 𝟒 × 𝟖𝟐 + 𝟐 × 𝟖𝟏 + 𝟓 × 𝟖𝟎

⇒ 𝟓𝟏𝟐 + 𝟐𝟓𝟔 + 𝟏𝟔 + 𝟓 = 789

𝟏𝟒𝟐𝟓 𝟖 = (𝟕𝟖𝟗)𝟏𝟎

Ali Asghar Manjotho, Lecturer CSE-MUET 23


Conversion from Octal to Decimal Number System

Example 08 : 𝟐𝟎𝟕𝟔 𝟖 = (? )𝟏𝟎

𝟐 × 𝟖𝟑 + 𝟎 × 𝟖𝟐 + 𝟕 × 𝟖𝟏 + 𝟔 × 𝟖𝟎

⇒ 𝟏𝟎𝟐𝟒 + 𝟎 + 𝟓𝟔 + 𝟔 = 𝟏𝟎𝟖𝟔

𝟐𝟎𝟕𝟔 𝟖 = (𝟏𝟎𝟖𝟔)𝟏𝟎

Ali Asghar Manjotho, Lecturer CSE-MUET 24


Conversion from Decimal to Hexadecimal
Number System

Ali Asghar Manjotho, Lecturer CSE-MUET 25


Conversion from Decimal to Hexadecimal Number
System
Example 09 : 𝟕𝟓𝟔 𝟏𝟎 = (? )𝟏𝟔

16 756
16 47 ―4
2 ―F

𝟕𝟓𝟔 𝟏𝟎 = (𝟐𝑭𝟒)𝟏𝟔

Ali Asghar Manjotho, Lecturer CSE-MUET 26


Conversion from Decimal to Hexadecimal Number
System
Example 10 : 𝟏𝟏𝟐𝟕𝟖 𝟏𝟎 = (? )𝟏𝟔

16 11278
16 704 ―E
16 44 ―0
2 ―C

𝟏𝟏𝟐𝟕𝟖 𝟏𝟎 = (𝟐𝑪𝟎𝑬)𝟏𝟔

Ali Asghar Manjotho, Lecturer CSE-MUET 27


Conversion from Hexadecimal to Decimal
Number System

Ali Asghar Manjotho, Lecturer CSE-MUET 28


Conversion from Hexadecimal to Decimal Number
System

Example 11 : 𝟐𝑭𝟒 𝟏𝟔 = (? )𝟏𝟎

𝟐 × 𝟏𝟔𝟐 + 𝑭 × 𝟏𝟔𝟏 + 𝟒 × 𝟏𝟔𝟎

⇒ 𝟓𝟏𝟐 + 𝟐𝟒𝟎 + 𝟒 = 756

𝟐𝑭𝟒 𝟏𝟔 = (𝟕𝟓𝟔)𝟏𝟎

Ali Asghar Manjotho, Lecturer CSE-MUET 29


Conversion from Hexadecimal to Decimal Number
System

Example 12 : 𝟐𝑪𝟎𝑬 𝟏𝟔 = (? )𝟏𝟎

𝟐 × 𝟏𝟔𝟑 + 𝑪 × 𝟏𝟔𝟐 + 𝟎 × 𝟏𝟔𝟏 + 𝑬 × 𝟏𝟔𝟎

⇒ 𝟖𝟏𝟗𝟐 + 𝟑𝟎𝟕𝟐 + 𝟎 + 𝟏𝟒 = 11278

𝟐𝑪𝟎𝑬 𝟏𝟔 = (𝟏𝟏𝟐𝟕𝟖)𝟏𝟎

Ali Asghar Manjotho, Lecturer CSE-MUET 30


Conversion from Octal to Binary Number
System

Ali Asghar Manjotho, Lecturer CSE-MUET 31


Conversion from Octal to Binary Number System

Example 13 : 𝟔𝟓𝟒𝟑 𝟖 = (? )𝟐 0 000


1 001
2 010
6 5 4 3 3 011
110 101 100 011 4 100
5 101
6 110
7 111
𝟔𝟓𝟒𝟑 𝟖 = (𝟏𝟏𝟎𝟏𝟎𝟏𝟏𝟎𝟎𝟎𝟏𝟏)𝟐

Ali Asghar Manjotho, Lecturer CSE-MUET 32


Conversion from Octal to Binary Number System

Example 14 : 𝟒𝟒𝟑𝟐𝟏𝟕 𝟖 = (? )𝟐
0 000
1 001
2 010
4 4 3 2 1 7
3 011
100 100 011 010 001 111
4 100
5 101
6 110
𝟒𝟒𝟑𝟐𝟏𝟕 𝟖 = (𝟏𝟎𝟎𝟏𝟎𝟎𝟎𝟏𝟏𝟎𝟏𝟎𝟎𝟎𝟏𝟏𝟏𝟏)𝟐 7 111

Ali Asghar Manjotho, Lecturer CSE-MUET 33


Conversion from Binary to Octal Number
System

Ali Asghar Manjotho, Lecturer CSE-MUET 34


Conversion from Binary to Octal Number System

Example 15 : 𝟏𝟏𝟎𝟏𝟏𝟎𝟏𝟏𝟏𝟎𝟏𝟎𝟏𝟏𝟏𝟎𝟎𝟏 𝟐 = (? )𝟖
0 000
1 001
2 010
6 6 7 2 7 1
3 011
110 110 111 010 111 001
4 100
5 101
6 110
𝟏𝟏𝟎𝟏𝟏𝟎𝟏𝟏𝟏𝟎𝟏𝟎𝟏𝟏𝟏𝟎𝟎𝟏 𝟐 = (𝟔𝟔𝟕𝟐𝟕𝟏)𝟖 7 111

Ali Asghar Manjotho, Lecturer CSE-MUET 35


Conversion from Binary to Octal Number System

Example 16 : 𝟏𝟏𝟏𝟎𝟏𝟎𝟎𝟎𝟏𝟏𝟎𝟏𝟎𝟏𝟎𝟏 𝟐 = (? )𝟖
0 000
1 001
2 010
1 6 4 3 2 5
3 011
001 110 100 011 010 101
4 100
5 101
6 110
𝟏𝟏𝟏𝟎𝟏𝟎𝟎𝟎𝟏𝟏𝟎𝟏𝟎𝟏𝟎𝟏 𝟐 = (𝟏𝟔𝟒𝟑𝟐𝟓)𝟖 7 111

Ali Asghar Manjotho, Lecturer CSE-MUET 36


Conversion from Hexadecimal to Binary
Number System

Ali Asghar Manjotho, Lecturer CSE-MUET 37


Conversion from Hexadecimal to Binary Number
System
0 0000
1 0001
Example 17 : 𝟏𝑨𝑭𝟐 𝟏𝟔 = (? )𝟐 2 0010
3 0011
4 0100
5 0101
1 A F 2 6 0110
7 0111
0001 1010 1111 0010 8 1000
9 1001
A 1010
B 1011
C 1100
𝟏𝑨𝑭𝟐 𝟏𝟔 = (𝟎𝟎𝟎𝟏𝟏𝟎𝟏𝟎𝟏𝟏𝟏𝟏𝟎𝟎𝟏𝟎)𝟐 D 1101
E 1110
F 1111

Ali Asghar Manjotho, Lecturer CSE-MUET 38


Conversion from Hexadecimal to Binary Number
System
0 0000
1 0001
Example 18 : 𝟕𝟗𝑭𝑭𝑪 𝟏𝟔 = (? )𝟐 2 0010
3 0011
4 0100
5 0101
7 9 F F C 6 0110
7 0111
0111 1001 1111 1111 1100 8 1000
9 1001
A 1010
B 1011
C 1100
𝟕𝟗𝑭𝑭𝑪 𝟏𝟔 = (𝟎𝟏𝟏𝟏𝟏𝟎𝟎𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟎𝟎)𝟐 D 1101
E 1110
F 1111

Ali Asghar Manjotho, Lecturer CSE-MUET 39


Conversion from Binary to Hexadecimal
Number System

Ali Asghar Manjotho, Lecturer CSE-MUET 40


Conversion from Binary to Hexadecimal Number
System
0 0000
1 0001
Example 19 : 𝟎𝟏𝟏𝟏𝟏𝟎𝟎𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟎𝟎 𝟐 = (? )𝟏𝟔 2 0010
3 0011
4 0100
5 0101
7 9 F F C
6 0110
7 0111
0111 1001 1111 1111 1100 8 1000
9 1001
A 1010
B 1011
C 1100
𝟎𝟏𝟏𝟏𝟏𝟎𝟎𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟎𝟎 𝟐 = (𝟕𝟗𝑭𝑭𝑪)𝟏𝟔 D 1101
E 1110
F 1111

Ali Asghar Manjotho, Lecturer CSE-MUET 41


Conversion from Binary to Hexadecimal Number
System
0 0000
1 0001
Example 20 : 𝟏𝟏𝟎𝟏𝟎𝟏𝟏𝟏𝟏𝟎𝟎𝟏𝟎 𝟐 = (? )𝟏𝟔 2 0010
3 0011
4 0100
5 0101
1 A F 2 6 0110
7 0111
0001 1010 1111 0010
8 1000
9 1001
A 1010
B 1011
C 1100
𝟏𝟏𝟎𝟏𝟎𝟏𝟏𝟏𝟏𝟎𝟎𝟏𝟎 𝟐 = (𝟏𝑨𝑭𝟐)𝟏𝟔 D 1101
E 1110
F 1111

Ali Asghar Manjotho, Lecturer CSE-MUET 42

Potrebbero piacerti anche