Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Number Systems

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

Digital Design

Number System

M. Morris Mano
Edition 5

Amjad Ali
NUMBER SYSTEM
Decimal number system is employed in everyday arithmetic to represent numbers by
string of digits.
Each digit of string has an associated value of an integer depending on its position
in the string.

For Example

The decimal number 724.5 (actually a string) is represented:

7 hundreds plus 2 tens plus 4 units plus 5


tenths :
(implied by position of the digits in a string)
NUMBER SYSTEM
In general, a number in base r with
n digits to the left of the radix point
and m digits to the right of the radix
point
is represented by a string of coefficients:

An-1 An-2 ….. A1 A0 . A -1 A -2 …. A –(m-1) A –m

and is computed as to convert into decimal:

An-1 rn-1 + An-2 rn-2 + ….. A1 r1 + A0 r0 + A-1 r -1 + A-2 r -2 + …. + A–(m-1) r –(m-1) + A-m r -m
NUMBER SYSTEM
A number in base r (as a string of coefficients)
An-1 An-2 ….. A1 A0 . A -1 A -2 …. A –(m-1) A –m
Decimal Conversion
An-1 rn-1 + An-2 rn-2 + ….. A1 r1 + A0 r0 + A-1 r -1 + A-2 r -2 + …. + A–(m-1) r –(m-1) + A-m r -m

Base 10 Number
The string for decimal number (base 10) (n=3) : 3 digits to the left of radix point
8 6 9 . 5 (m=1) : 1 digits to the right of radix point
A2 A1 A0 . A-1 (r = 10) : base 10
is computed as:
= 8 x 102 + 6 x 101 + 9 x 100 + 5 x 10-1
= (8 6 9.5)10 In decimal number system (base r =10) contains r digits i.e.,
each coefficient Ai is one of the digits 0,1,2, …, 9.
NUMBER SYSTEM
A number in base r (as a string of coefficients)
An-1 An-2 ….. A1 A0 . A -1 A -2 …. A –(m-1) A –m
Decimal Conversion
An-1 rn-1 + An-2 rn-2 + ….. A1 r1 + A0 r0 + A-1 r -1 + A-2 r -2 + …. + A–(m-1) r –(m-1) + A-m r -m

Base 2 Number : Binary Number System


The string for base 2 number
(1 1 0 1 0)2 = ( ? )10
1 1 0 1 0
A4 A3 A2 A1 A0
is computed as: (n=5)
= 1 x 24 + 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20 (m=0)
(r = 2) : base 2
= 16 + 8 + 0 + 2 + 0
In binary number system (base r =2) contains r digits i.e.,
= (26)2
each coefficient Ai is one of the digits 0, 1.
NUMBER SYSTEM
A number in base r (as a string of coefficients)
An-1 An-2 ….. A1 A0 . A -1 A -2 …. A –(m-1) A –m
Decimal Conversion
An-1 rn-1 + An-2 rn-2 + ….. A1 r1 + A0 r0 + A-1 r -1 + A-2 r -2 + …. + A–(m-1) r –(m-1) + A-m r -m

Base 2 Number : Binary Number System (1 1 0 1 0 1 . 1 1)2 = ( ? )10


The string for base 2 number
(n=6) : 6 digits to the left of radix point
1 1 0 1 0 1(m=2)
. 1 : 21 digits to the right of radix point
A5 A4 A3 A2 A1 A0 . A-1 A-2
(r = 2) : base 2
is computed as:
= 1 x 25 + 1 x 24 + 0 x 23 + 1 x 22 + 0 x 21 + 1 x 20 + 1 x 2-1 + 1 x 2-2
= 32 + 16 + 0 + 4 + 0 + 1 + 0.5 + 0.25
= (53.75)2
NUMBER SYSTEM
A number in base r (as a string of coefficients)
An-1 An-2 ….. A1 A0 . A -1 A -2 …. A –(m-1) A –m
Decimal Conversion
An-1 rn-1 + An-2 rn-2 + ….. A1 r1 + A0 r0 + A-1 r -1 + A-2 r -2 + …. + A–(m-1) r –(m-1) + A-m r -m

Base 8 Number : Octal Number System


The string for base 8 number
1 2 7 . 4 (1 2 7 . 4)8 = ( ? )10
A2 A1 A0 . A-1
is computed as:
= 1 x 82 + 2 x 81 + 7 x 80 + 4 x 8-1
= 64 + 16 + 7 + 0.5
= (8 7.5)10 In octal number system (base r =8) contains r digits i.e., each
coefficient Ai is one of the digits 0,1,2, …, 7.
NUMBER SYSTEM
A number in base r (as a string of coefficients)
An-1 An-2 ….. A1 A0 . A -1 A -2 …. A –(m-1) A –m
Decimal Conversion
An-1 rn-1 + An-2 rn-2 + ….. A1 r1 + A0 r0 + A-1 r -1 + A-2 r -2 + …. + A–(m-1) r –(m-1) + A-m r -m

Base 16 Number : Hexadecimal Number System


The string for base 16 number
B 6 5 F (B 6 5 F)16 = ( ? )10
A3 A2 A1 A0
is computed as: B = 11
= 11 x 163 + 6 x 162 + 5 x 161 + 15 x 160 F = 15
= 45056 + 1536 + 80 + 15
= (46687)10 In base 16 number system contains r digits i.e., each coefficient
Ai is one of the digits 0,1,2, …, 9, A , B , C , D , E , F.
NUMBER SYSTEM
A number in base r (as a string of coefficients)
An-1 An-2 ….. A1 A0 . A -1 A -2 …. A –(m-1) A –m
Decimal Conversion
An-1 rn-1 + An-2 rn-2 + ….. A1 r1 + A0 r0 + A-1 r -1 + A-2 r -2 + …. + A–(m-1) r –(m-1) + A-m r -m

Base 5 Number
The string for base 5 number
3 1 2 . 4 (3 1 2 . 4)5 = ( ? )10
A2 A1 A0 . A-1
is computed as:
= 3 x 52 + 1 x 51 + 2 x 50 + 4 x 5-1
= 75 + 5 + 2 + 0.8
In base 5 number system contains r digits i.e.,
= (82.8)10
each coefficient Ai is one of the digits 0,1, 2, 3, 4
Decimal to Other Base Number Conversion
Decimal to Binary Number Conversion Two Step Procedure
1. Decimal Integers to Binary
2. Decimal Fractions to Binary
Convert (41.6875)10 into Binary Number System

1. Decimal Integer to Binary 1. Decimal fraction to Binary


(41)10 = ( ? )2 (0.6875)10 = ( ? )2
Remainder Integer
41 / 2 = 20 + 1 = 1 Least Significant 0.6875 x 2 = 1.3750 = 1 Most Significant
20 / 2 = 10 + 0 = 0 0.3750 x 2 = 0.7500 = 0
10 / 2 = 5 + 0 = 0 0.7500 x 2 = 1.5000 = 1
5/2=2 +1 = 1 0.5000 x 2 = 1.0000 = 1 Least Significant
2/2=1 +0 = 0
1/2=0 +1 = 1 Most Significant (0.6875)10 = ( .1 0 1 1)2
(41)10 = (1 0 1 0 0 1)2 (41.6875)10 = (1 0 1 0 0 1 . 1 0 1 1)2
Decimal to Other Base Number Conversion
Decimal to Binary Number Conversion Two Step Procedure
1. Decimal Integers to Binary
2. Decimal Fractions to Binary
Convert (32.587)10 into Binary Number System

1. Decimal Integer to Binary 1. Decimal fraction to Binary


(32)10 = ( ? )2 (0.587)10 = ( ? )2
Remainder Integer
32 / 2 = 16 + 0 = 0 Least Significant 0.587 x 2 = 1.174 = 1 Most Significant
16 / 2 = 8 + 0 = 0 0.174 x 2 = 0.348 = 0
8/2= 4+0 = 0 0.348 x 2 = 0.696 = 0
4/2= 2+0 = 0 0.696 x 2 = 1.392 = 1 Least Significant
2/2= 1+0 = 0 …….….
1/2= 0+1 = 1 Most Significant (0.587)10 = ( .1 0 0 1….)2
(32)10 = (1 0 0 0 0 0)2 (32.587)10 = (1 0 0 0 0 0 . 1 0 0 1…)2
Decimal to Other Base Number Conversion
Decimal to Octal Number Conversion Two Step Procedure
1. Decimal Integers to Binary
2. Decimal Fractions to Binary
Convert (296.587)10 into Octal Number System

1. Decimal Integer to Binary 1. Decimal fraction to Binary


(296)10 = ( ? )8 (0.587)10 = ( ? )8
Remainder Integer
296 / 8 = 37 + 0 = 0 Least Significant 0.587 x 8 = 4.696 = 4 Most Significant
37 / 8 = 4 + 5 = 5 0.696 x 8 = 5.568 = 5
4/8= 0+4 = 4 Most Significant 0.568 x 8 = 4.544 = 4
0.544 x 8 = 4.352 = 4 Least Significant
(296)10 = (4 5 0)8 …….….
(0.587)10 = ( . 4 5 4 4…)8
(296.587)10 = ( 4 5 0 . 4 5 4 4…)8
Other Base Number to Other Base Number Conversion
Binary to Octal Number Conversion

Convert (10110001101011.11110000011)2 into Octal Number System

(10110001101011.11110000011)2 = ( ? )8 Grouping of 3

(10 110 001 101 011 . 111 100 000 11 ) 2 = ( ? )8

(010 110 001 101 011 . 111 100 000 110 )2 = ( 2 6 1 5 3 . 7 4 0 6 )8


2 6 1 5 3 7 4 0 6

add extra 0
Other Base Number to Other Base Number Conversion
Binary to Octal Number Conversion

Convert (10110001101011.11110000011)2 into Octal Number System

(10110001101011.11110000011)2 = ( ? )8

(10 110 001 101 011 . 111 100 000 11 ) 2 = ( ? )8

(010 110 001 101 011 . 111 100 000 110 )2 = ( 2 6 1 5 3 . 7 4 0 6 )8


2 6 1 5 3 7 4 0 6
Other Base Number to Other Base Number Conversion
Binary to Hexadecimal Number Conversion

Convert (10110001101011.11110000011)2 into Hexadecimal Number System

(10110001101011.11110000011)2 = ( ? )16

(10 1100 0110 1011 . 1111 0000 011 )2 = ( ? )16

(0010 1100 0110 1011 . 1111 0000 0110 )2 = ( 2 C 6 B . F 0 6 )


16
2 C 6 B F 0 6
Other Base Number to Other Base Number Conversion
Octal to Hexadecimal Number Conversion

Convert (2 6 1 5 3 . 7 4 0 6)8 into Hexadecimal Number System

(2 6 1 5 3 . 7 4 0 6)8 = ( 010 110 001 101 011 . 111 100 000 110 )2

(2 6 1 5 3 . 7 4 0 6)8 = ( 010 110 001 101 011 . 111 100 000 110 )2

(2 6 1 5 3 . 7 4 0 6)8 = ( 0010 1100 0110 1011 . 1111 0000 0110 )2


2 C 6 B F 0 6

= ( 2 C 6 B . F 0 6 )16
Other Base Number to Other Base Number Conversion
Hexadecimal to Octal Number Conversion

Convert (2 C 6 B . F 0 6)16 int Octal Number System


discard
(2 C 6 B . F 0 6)16 = ( 0010 1100 0110 1011 . 1111 0000 0110 )2

(2 C 6 B . F 0 6)16 = ( 0010 1100 0110 1011 . 1111 0000 0110 )2

(2 C 6 B . F 0 6)16 = ( 010 110 001 101 011 . 111 100 000 110 )2
2 6 1 5 3 7 4 0 6

= ( 2 6 1 5 3 . 7 4 0 6 )8

You might also like