Number System
M. Morris Mano
Edition 5
Digital Design
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
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
m digits to the right of the radix
point
n digits to the left of the radix point
and
is represented by a string of coefficients:
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)
8 6 9 . 5
= 8 x 102
+ 6 x 101
+ 9 x 100
= (8 6 9.5)10
(n=3) : 3 digits to the left of radix point
(m=1) : 1 digits to the right of radix point
(r = 10) : base 10
A2 A1 A0 . A-1
5 x 10-1
+
is computed as:
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
The string for base 2 number
1 1 0 1 0
= 1 x 24
+ 1 x 23
+ 0 x 22
+ 1 x 21
+ 0 x 20
= (26)2
(n=5)
(m=0)
(r = 2) : base 2
A4 A3 A2 A1 A0
is computed as:
= 16 + 8 + 0 + 2 + 0
: Binary Number System
(1 1 0 1 0)2 = ( ? )10
In binary number system (base r =2) contains r digits i.e.,
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
The string for base 2 number
1 1 0 1 0 1 . 1 1
= 1 x 25
+ 1 x 24
+ 0 x 23
+ 1 x 22
+ 0 x 21
+ 1 x 20
= 32 + 16 + 0 + 4 + 0 + 1
(n=6) : 6 digits to the left of radix point
(m=2) : 2 digits to the right of radix point
(r = 2) : base 2
A5 A4 A3 A2 A1 A0 . A-1 A-2
1 x 2-1
+ 1 x 2-2
+
is computed as:
= (53.75)2
+ 0.5 + 0.25
Base 2 Number : Binary Number System (1 1 0 1 0 1 . 1 1)2 = ( ? )10
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
The string for base 8 number
1 2 7 . 4
= 1 x 82
+ 2 x 81
+ 7 x 80
= (8 7.5)10
A2 A1 A0 . A-1
4 x 8-1
+
is computed as:
Base 8 Number : Octal Number System
= 64 + 16 + 7 + 0.5
(1 2 7 . 4)8 = ( ? )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
The string for base 16 number
B 6 5 F
= 11 x 163
+ 6 x 162
+ 5 x 161
+ 15 x 160
= (46687)10
A3 A2 A1 A0
is computed as:
Base 16 Number : Hexadecimal Number System
= 45056 + 1536 + 80 + 15
(B 6 5 F)16 = ( ? )10
B = 11
F = 15
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
The string for base 5 number
3 1 2 . 4
= 3 x 52
+ 1 x 51
+ 2 x 50
= (82.8)10
A2 A1 A0 . A-1
is computed as:
Base 5 Number
= 75 + 5 + 2
(3 1 2 . 4)5 = ( ? )10
In base 5 number system contains r digits i.e.,
each coefficient Ai is one of the digits 0,1, 2, 3, 4
4 x 5-1
+
0.8
+
Decimal to Binary Number Conversion
Convert (41.6875)10 into Binary Number System
Two Step Procedure
1. Decimal Integers to Binary
2. Decimal Fractions to Binary
Decimal to Other Base Number Conversion
1. Decimal Integer to Binary
(41)10 = ( ? )2
41 / 2 = 20 + 1
Most Significant
Least Significant
= 1
Remainder
20 / 2 = 10 + 0 = 0
10 / 2 = 5 + 0 = 0
5 / 2 = 2 + 1 = 1
2 / 2 = 1 + 0 = 0
1 / 2 = 0 + 1 = 1
(41)10 = (1 0 1 0 0 1)2
1. Decimal fraction to Binary
(0.6875)10 = ( ? )2
0.6875 x 2 = 1.3750
Integer
Most Significant
= 1
0.3750 x 2 = 0.7500 = 0
0.7500 x 2 = 1.5000 = 1
0.5000 x 2 = 1.0000 = 1 Least Significant
(0.6875)10 = ( .1 0 1 1)2
(41.6875)10 = (1 0 1 0 0 1 . 1 0 1 1)2
Decimal to Binary Number Conversion
Convert (32.587)10 into Binary Number System
Two Step Procedure
1. Decimal Integers to Binary
2. Decimal Fractions to Binary
Decimal to Other Base Number Conversion
1. Decimal Integer to Binary
(32)10 = ( ? )2
32 / 2 = 16 + 0
Most Significant
Least Significant
= 0
Remainder
16 / 2 = 8 + 0 = 0
8 / 2 = 4 + 0 = 0
4 / 2 = 2 + 0 = 0
2 / 2 = 1 + 0 = 0
1 / 2 = 0 + 1 = 1
(32)10 = (1 0 0 0 0 0)2
1. Decimal fraction to Binary
(0.587)10 = ( ? )2
0.587 x 2 = 1.174
Integer
Most Significant
= 1
0.174 x 2 = 0.348 = 0
0.348 x 2 = 0.696 = 0
0.696 x 2 = 1.392 = 1 Least Significant
(0.587)10 = ( .1 0 0 1….)2
(32.587)10 = (1 0 0 0 0 0 . 1 0 0 1…)2
…….….
Decimal to Octal Number Conversion
Convert (296.587)10 into Octal Number System
Two Step Procedure
1. Decimal Integers to Binary
2. Decimal Fractions to Binary
Decimal to Other Base Number Conversion
1. Decimal Integer to Binary
(296)10 = ( ? )8
296 / 8 = 37 + 0
Most Significant
Least Significant
= 0
Remainder
37 / 8 = 4 + 5 = 5
4 / 8 = 0 + 4 = 4
(296)10 = (4 5 0)8
1. Decimal fraction to Binary
(0.587)10 = ( ? )8
0.587 x 8 = 4.696
Integer
Most Significant
= 4
0.696 x 8 = 5.568 = 5
0.568 x 8 = 4.544 = 4
0.544 x 8 = 4.352 = 4 Least Significant
(0.587)10 = ( . 4 5 4 4…)8
(296.587)10 = ( 4 5 0 . 4 5 4 4…)8
…….….
Binary to Octal Number Conversion
Convert (10110001101011.11110000011)2 into Octal Number System
Other Base Number to Other Base Number Conversion
(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
= ( 2 6 1 5 3 . 7 4 0 6 )8
Grouping of 3
add extra 0
Binary to Octal Number Conversion
Convert (10110001101011.11110000011)2 into Octal Number System
Other Base Number to Other Base Number Conversion
(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
= ( 2 6 1 5 3 . 7 4 0 6 )8
Binary to Hexadecimal Number Conversion
Convert (10110001101011.11110000011)2 into Hexadecimal Number System
Other Base Number to Other Base Number Conversion
(10110001101011.11110000011)2 = ( ? )16
(10 1100 0110 1011 . 1111 0000 011 )2 = ( ? )16
2 C 6 B F 0 6
= ( 2 C 6 B . F 0 6 )16
(0010 1100 0110 1011 . 1111 0000 0110 )2
Octal to Hexadecimal Number Conversion
Convert (2 6 1 5 3 . 7 4 0 6)8 into Hexadecimal Number System
Other Base Number to Other Base Number Conversion
(2 6 1 5 3 . 7 4 0 6)8
2 C 6 B F 0 6
= ( 2 C 6 B . F 0 6 )16
(2 6 1 5 3 . 7 4 0 6)8 = ( 0010 1100 0110 1011 . 1111 0000 0110 )2
(2 6 1 5 3 . 7 4 0 6)8 = ( 010 110 001 101 011 . 111 100 000 110 )2
= ( 010 110 001 101 011 . 111 100 000 110 )2
Hexadecimal to Octal Number Conversion
Convert (2 C 6 B . F 0 6)16 int Octal Number System
Other Base Number to Other Base Number Conversion
(2 C 6 B . F 0 6)16
2 6 1 5 7 4 0
= ( 2 6 1 5 3 . 7 4 0 6 )8
(2 C 6 B . F 0 6)16 = ( 010 110 001 101 011 . 111 100 000 110 )2
(2 C 6 B . F 0 6)16 = ( 0010 1100 0110 1011 . 1111 0000 0110 )2
= ( 0010 1100 0110 1011 . 1111 0000 0110 )2
3 6
discard

Number systems conversion and solution with exercise

  • 1.
    Number System M. MorrisMano Edition 5 Digital Design
  • 2.
    NUMBER SYSTEM Decimal numbersystem 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)
  • 3.
    NUMBER SYSTEM In general,a number in base r with 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 m digits to the right of the radix point n digits to the left of the radix point and is represented by a string of coefficients:
  • 4.
    NUMBER SYSTEM A numberin 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) 8 6 9 . 5 = 8 x 102 + 6 x 101 + 9 x 100 = (8 6 9.5)10 (n=3) : 3 digits to the left of radix point (m=1) : 1 digits to the right of radix point (r = 10) : base 10 A2 A1 A0 . A-1 5 x 10-1 + is computed as: In decimal number system (base r =10) contains r digits i.e., each coefficient Ai is one of the digits 0,1,2, …, 9.
  • 5.
    NUMBER SYSTEM A numberin 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 The string for base 2 number 1 1 0 1 0 = 1 x 24 + 1 x 23 + 0 x 22 + 1 x 21 + 0 x 20 = (26)2 (n=5) (m=0) (r = 2) : base 2 A4 A3 A2 A1 A0 is computed as: = 16 + 8 + 0 + 2 + 0 : Binary Number System (1 1 0 1 0)2 = ( ? )10 In binary number system (base r =2) contains r digits i.e., each coefficient Ai is one of the digits 0, 1.
  • 6.
    NUMBER SYSTEM A numberin 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 The string for base 2 number 1 1 0 1 0 1 . 1 1 = 1 x 25 + 1 x 24 + 0 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = 32 + 16 + 0 + 4 + 0 + 1 (n=6) : 6 digits to the left of radix point (m=2) : 2 digits to the right of radix point (r = 2) : base 2 A5 A4 A3 A2 A1 A0 . A-1 A-2 1 x 2-1 + 1 x 2-2 + is computed as: = (53.75)2 + 0.5 + 0.25 Base 2 Number : Binary Number System (1 1 0 1 0 1 . 1 1)2 = ( ? )10
  • 7.
    NUMBER SYSTEM A numberin 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 The string for base 8 number 1 2 7 . 4 = 1 x 82 + 2 x 81 + 7 x 80 = (8 7.5)10 A2 A1 A0 . A-1 4 x 8-1 + is computed as: Base 8 Number : Octal Number System = 64 + 16 + 7 + 0.5 (1 2 7 . 4)8 = ( ? )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.
  • 8.
    NUMBER SYSTEM A numberin 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 The string for base 16 number B 6 5 F = 11 x 163 + 6 x 162 + 5 x 161 + 15 x 160 = (46687)10 A3 A2 A1 A0 is computed as: Base 16 Number : Hexadecimal Number System = 45056 + 1536 + 80 + 15 (B 6 5 F)16 = ( ? )10 B = 11 F = 15 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.
  • 9.
    NUMBER SYSTEM A numberin 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 The string for base 5 number 3 1 2 . 4 = 3 x 52 + 1 x 51 + 2 x 50 = (82.8)10 A2 A1 A0 . A-1 is computed as: Base 5 Number = 75 + 5 + 2 (3 1 2 . 4)5 = ( ? )10 In base 5 number system contains r digits i.e., each coefficient Ai is one of the digits 0,1, 2, 3, 4 4 x 5-1 + 0.8 +
  • 10.
    Decimal to BinaryNumber Conversion Convert (41.6875)10 into Binary Number System Two Step Procedure 1. Decimal Integers to Binary 2. Decimal Fractions to Binary Decimal to Other Base Number Conversion 1. Decimal Integer to Binary (41)10 = ( ? )2 41 / 2 = 20 + 1 Most Significant Least Significant = 1 Remainder 20 / 2 = 10 + 0 = 0 10 / 2 = 5 + 0 = 0 5 / 2 = 2 + 1 = 1 2 / 2 = 1 + 0 = 0 1 / 2 = 0 + 1 = 1 (41)10 = (1 0 1 0 0 1)2 1. Decimal fraction to Binary (0.6875)10 = ( ? )2 0.6875 x 2 = 1.3750 Integer Most Significant = 1 0.3750 x 2 = 0.7500 = 0 0.7500 x 2 = 1.5000 = 1 0.5000 x 2 = 1.0000 = 1 Least Significant (0.6875)10 = ( .1 0 1 1)2 (41.6875)10 = (1 0 1 0 0 1 . 1 0 1 1)2
  • 11.
    Decimal to BinaryNumber Conversion Convert (32.587)10 into Binary Number System Two Step Procedure 1. Decimal Integers to Binary 2. Decimal Fractions to Binary Decimal to Other Base Number Conversion 1. Decimal Integer to Binary (32)10 = ( ? )2 32 / 2 = 16 + 0 Most Significant Least Significant = 0 Remainder 16 / 2 = 8 + 0 = 0 8 / 2 = 4 + 0 = 0 4 / 2 = 2 + 0 = 0 2 / 2 = 1 + 0 = 0 1 / 2 = 0 + 1 = 1 (32)10 = (1 0 0 0 0 0)2 1. Decimal fraction to Binary (0.587)10 = ( ? )2 0.587 x 2 = 1.174 Integer Most Significant = 1 0.174 x 2 = 0.348 = 0 0.348 x 2 = 0.696 = 0 0.696 x 2 = 1.392 = 1 Least Significant (0.587)10 = ( .1 0 0 1….)2 (32.587)10 = (1 0 0 0 0 0 . 1 0 0 1…)2 …….….
  • 12.
    Decimal to OctalNumber Conversion Convert (296.587)10 into Octal Number System Two Step Procedure 1. Decimal Integers to Binary 2. Decimal Fractions to Binary Decimal to Other Base Number Conversion 1. Decimal Integer to Binary (296)10 = ( ? )8 296 / 8 = 37 + 0 Most Significant Least Significant = 0 Remainder 37 / 8 = 4 + 5 = 5 4 / 8 = 0 + 4 = 4 (296)10 = (4 5 0)8 1. Decimal fraction to Binary (0.587)10 = ( ? )8 0.587 x 8 = 4.696 Integer Most Significant = 4 0.696 x 8 = 5.568 = 5 0.568 x 8 = 4.544 = 4 0.544 x 8 = 4.352 = 4 Least Significant (0.587)10 = ( . 4 5 4 4…)8 (296.587)10 = ( 4 5 0 . 4 5 4 4…)8 …….….
  • 13.
    Binary to OctalNumber Conversion Convert (10110001101011.11110000011)2 into Octal Number System Other Base Number to Other Base Number Conversion (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 = ( 2 6 1 5 3 . 7 4 0 6 )8 Grouping of 3 add extra 0
  • 14.
    Binary to OctalNumber Conversion Convert (10110001101011.11110000011)2 into Octal Number System Other Base Number to Other Base Number Conversion (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 = ( 2 6 1 5 3 . 7 4 0 6 )8
  • 15.
    Binary to HexadecimalNumber Conversion Convert (10110001101011.11110000011)2 into Hexadecimal Number System Other Base Number to Other Base Number Conversion (10110001101011.11110000011)2 = ( ? )16 (10 1100 0110 1011 . 1111 0000 011 )2 = ( ? )16 2 C 6 B F 0 6 = ( 2 C 6 B . F 0 6 )16 (0010 1100 0110 1011 . 1111 0000 0110 )2
  • 16.
    Octal to HexadecimalNumber Conversion Convert (2 6 1 5 3 . 7 4 0 6)8 into Hexadecimal Number System Other Base Number to Other Base Number Conversion (2 6 1 5 3 . 7 4 0 6)8 2 C 6 B F 0 6 = ( 2 C 6 B . F 0 6 )16 (2 6 1 5 3 . 7 4 0 6)8 = ( 0010 1100 0110 1011 . 1111 0000 0110 )2 (2 6 1 5 3 . 7 4 0 6)8 = ( 010 110 001 101 011 . 111 100 000 110 )2 = ( 010 110 001 101 011 . 111 100 000 110 )2
  • 17.
    Hexadecimal to OctalNumber Conversion Convert (2 C 6 B . F 0 6)16 int Octal Number System Other Base Number to Other Base Number Conversion (2 C 6 B . F 0 6)16 2 6 1 5 7 4 0 = ( 2 6 1 5 3 . 7 4 0 6 )8 (2 C 6 B . F 0 6)16 = ( 010 110 001 101 011 . 111 100 000 110 )2 (2 C 6 B . F 0 6)16 = ( 0010 1100 0110 1011 . 1111 0000 0110 )2 = ( 0010 1100 0110 1011 . 1111 0000 0110 )2 3 6 discard