Lecture 1.2 - Number System
Lecture 1.2 - Number System
EE-221
By Dr. Mir Yasir Umair
Associate Professor, MCS, NUST
Number Systems and Codes
• Decimal Number System
• Binary Number System
• Hexadecimal Number System
• Octal Number System
NUMBER SYSTEM
• DECIMAL Base 10
• BINARY Base 2
• OCTAL Base 8
• HEXADECIMAL Base16
Lec 1
Decimal Number System
• Ten unique numbers 0,1..9
• Combination of digits
• Positional Number System
• 275 = 2 x 102 + 7 x 101 + 5 x 100
o Base or Radix 10
o Weight 1, 10, 100, 1000 ….
Representing Fractions
• Fractions can be represented in decimal number system in a manner
= 3 x 102 + 8 x 101 + 2 x 100 + 9 x 10-1
+ 1 x 10-2
= 300 + 80 + 2 + 0.9 + 0.01
= 382.91
(26.75)10
=2x101 + 6x100 + 7x10-1 + 5x10-2
=2x10 + 6x1+ 7/10 + 5/100
=20+6+0.7+0.05
=26+0.75
=26.75
Lec 1
BINARY NUMBER SYSTEM
• Decimal system > Base 10 ( deci means 10)
Lec 1
Converting Binary to
Decimal
• Easy, just multiply digit by power of 2
• Just like a decimal number is represented
• Example follows
Lec 1
BINARY NUMBER SYSTEM
• Each Cofficient x power of 2
• Example : 110
• Don’t learn it by
heart.
1 0 0 1 1 1 0 0
128 + 0 + 0 + 16 + 8 + 4 + 0 + 0 = 156
Lec 1
SUMMARY of BINARY NUMBER
SYSTEM
• Each digit represents a power of 2
• Coefficient have two possible values 0 and 1
• Strings of binary digits (“bits”)
o n bits can store numbers from 0 to 2n -1
o n bits can store 2n distinct combinations of 1’s and 0’s
• Each coefficient aj is multiplied by 2j
• Example: 3 011 3
4 100 4
(127.4)8= 1 X 82 +2 X 81 +7 X 80 + 4 X 8-1
5 101 5
64+16+7+.5= (87.5)10
6 110 6
7 111 7
8 1000 -
9 1001 -