Lecture 2-3, Number System
Lecture 2-3, Number System
Number Systems
• Decimal
• Binary
• Octal
• Hexadecimal
Decimal Number System
• 10 digits = {0,1,2,3,4,5,6,7,8,9}
4 5 3 7 . 8
3 2 1 0 -1
x 10 x 10 x 10 x 10 x 10
• 2 digits = {0,1}
1 0 1 1 . 1
3 2 1 0 -1
x 2 x 2 x 2 x 2x 2
8 + 0 + 2 + 1 + .5 = (11.5) 10
Decimal Conversion
2. Sum-of-non-zero terms
A quicker method is to add the weights of non-
zero terms.
100112 =24 + 21 + 20
=16 + 2 + 1 = 19
1011.1012 =23 + 21 + 20 + 2-1 +2-3
= 8 + 2 + 1 + ½ + 1/8 = 11 + 5/8
= 11.625
Least significant Bit(LSB) and Most
significant Bit (MSB)
Decimal to Binary Conversion
• Two Methods
• Repeated Division-by-2
• Sum-of-non-zero terms
Decimal to Binary Conversion using
Repeated Division-by-2
Steps to Convert from Decimal to Binary
Write down the decimal number.
Divide the number by 2.
Write the result underneath.
Write the remainder on the right hand
side. ...
Divide the result of the division by 2 and
again write down the remainder.
Repeat the steps until you will have the
last number either 0 or 1.
Decimal to Binary Conversion Example
Examples: Decimal to Binary Conversions
Solve Yourself
(225)10 = (?)2
The Power of 2
211 = 210 * 21 = 2K
212 = 210 * 22 = 4K
Answer is (11110000110)
Example
Solve Yourself
• (2891)10 = ( ? ) 2
Decimal (Fraction) to Binary Conversion
Decimal (Fraction) to Binary
Conversion
Decimal (Fraction) to Binary Conversion
• Solve Yourself
• (225.225)10 = (?)2
Octal Number System
Decimal to Octal Conversion
Decimal to Octal Conversion
Using Repeated division by 8 Method
Decimal to Octal Conversion
Decimal (fraction) to Octal Conversion
Decimal (fraction) to Octal Conversion
Octal to Decimal Conversions
Octal to Decimal Conversions
Octal to Decimal Conversions
Solve Yourself
Binary to Octal/Octal to Binary
Conversion
Octal to Binary Conversion
Binary to Octal Conversion
Hexadecimal Number System
• The Hexadecimal number system is a base 16
number system and therefore has 16 digits and is
used primarily to represent binary strings in a
compact manner.
• Hexadecimal number system is not used by a
Digital System. The Hexadecimal number system is
for our convenience to long binary strings in a
short and concise form.
• Each Hexadecimal Number digit can represent a 4-
bit Binary Number.
Hexadecimal (or hex) is often used for addressing
Hexadecimal Number System
Decimal to Hexadecimal Conversion
Decimal to Hexadecimal Conversion
Decimal (Fraction)to Hexadecimal Conversion
Hexadecimal to Decimal Conversion
Hexadecimal to Decimal Conversion Using
Sum of Weights Method
Hexadecimal to Binary Conversion
Binary to Hexadecimal Conversion
Binary to Hexadecimal Conversion
Binary to hexa Conversion
2nd Method: convert From Hexadecimal to Decimal number
and from decimal to Octal Number
Octal to Hexadecimal Conversion 1st
Method
Octal to Hexadecimal Conversion