Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views

Number System Conversion Examples

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Number System Conversion Examples

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Digital Circuits and Logic Design

Notes Unit and Number

The terms that you learned in the decimal and binary sections are also used with the octal system.

The unit remains a single object, and the number is still a symbol used to represent one or more
units.

Base (Radix)

As with the other systems, the radix, or base, is the number of symbols used in the system. The
octal system uses eight symbols—0 through 7. The base, or radix, is indicated by the subscript 8.

Positional Notation

The octal number system is a positional notation number system. Just as the decimal system
uses powers of 10 and the binary system uses powers of 2, the octal system uses power of 8 to
determine the value of a number’s position. The following bar graph shows the positions and
the power of the base:

Remember that the power, or exponent, indicates the number of times the base is multiplied by
itself. The value of this multiplication is expressed in base 10 as shown below:

83 = 8 × 8 × 8, or 51210
82 = 8 × 8, or 6410
81 = 810
80 = 110
1
8–1 = , or .12510
8
1 1
8–2 = , or , or .01562510
8´8 64
1 1
8–3 = , or , or .001953110
8´8´8 512
All numbers to the left of the radix point are whole numbers, and those to the right are fractional
numbers.
About 1672, Gottfried Wilhelm von Leibniz (German) perfected a machine
that could perform all the basic operations (add, subtract, multiply, divide),
as well as extract the square root. Modern electronic digital computers still
use von Leibniz’s principles.

1.5 Conversion from One Number System to Another

Numbers expressed in decimal number system are much more meaningful to us than are numbers
expressed in any other number system. This is because we have been using decimal numbers in
our day-to-day life, right from childhood; however, we can represent any number in one number
system in any other number system. Because the input and final output values are to be in decimal,
computer professionals are often required to convert number in other systems to decimal and
vice versa. Many methods can be used to convert numbers from one base to another. A method
of converting from another base to decimal, and a method of converting from decimal to another
base are described here:

1.5.1 Converting from Another Base to Decimal


The following steps are used to convert a number in any other base to a base 10 (decimal) number:

Step 1: Determine the column (positional) value of each digit (this depends on the position of the
digit and the base of the number system).

8 LOVELY PROFESSIONAL UNIVERSITY


Unit 1: Number Systems

Step 2: Multiply the obtained column values (in Step 1) by the digits in the corresponding columns. Notes

Step 3: Sum up the products calculated in Step 2. The total is the equivalent value in decimal.

110012 = ?10

Solution:

Step 1: Determine column values

Column Number Column (From Right)


20 = 1
1 21 = 2
2 22 = 4
3 23 = 8
4 24=16

Step 2: Multiply the column values by the corresponding column digits

16 8 4 2 1
*1 *1 *0 *0 *1

16 8 0 0 1

Step 3: Sum up the products

    16+8+0+0+1=25

   Hence, 110012=2510

47068=? 10

Solution:

Step 1: Determine column values

Column Number Column


(From Right)
1 80 = 1
2 81 = 8
3 82 = 64
4 83 = 512

Step 2: Multiply the column values by the corressponding column digits

512 64 8 1
*4 *7 *0 *6
2048 448 0 6

Step 3: Sum up the products

2048 + 448 + 0 + 6 = 2502

Hence, 47068 = 250210

LOVELY PROFESSIONAL UNIVERSITY 9


Digital Circuits and Logic Design

Notes

1AC16 = ? 10

Solution:

1AC16 = 1*162 + A *161 + C*160

= 1*256 + 10*16 + 12*1

= 256 + 160 + 12

= 42810

40527=?10

Solution:

40527 = 4*73 + 0*72 + 5*71 + 2*70

= 4*343 + 0*49 + 5*7 + 2*1

= 1372 + 0 + 35 + 2

140910

40526 = ?10

Solution:

40526 = 4*63 + 0*62 + 5*61 + 2*60

= 4*216 + 0*36 + 5*6 + 2*1

= 864 + 0 + 30 + 2

= 89610

Solution:

110014 = 1*44 + 1*43 + 0*42 + 1*41 + l*40

= 1 *256 + 1*64 + 0*16 + 0*4 + l*l

= 256 + 64 + 0 + 0 + 1

= 32110

1AC13 = ?10

Solution:

lAC13 = 1*132 + A*131 + C*130

= 1*169 + 10 *13 + 12*1

= 31110

10 LOVELY PROFESSIONAL UNIVERSITY


Unit 1: Number Systems

Notes
1.5.2 Converting from Decimal to Another Base (Division-Remainder
   Technique)
The following steps are used to convert a base 10 (decimal) number to a number in another base

Step 1: Divide the decimal number by the value of the new base.

Step 2: Record the remainder from Step 1 as the rightmost digit (least significant digit) of the
new base number.

Step 3: Divide the quotient of the previous division by the new base.

Step 4: Record the remainder from Step 3 as the next digit (to the left) of the new base number.
Repeat Steps 3 and 4, recording remainders from right to left, until the quotient becomes
zero in Step 3.

Note that the last remainder, thus obtained, will be the most significant digit of the new base
number.

2510

Solution:

Steps 1: 25/2 = 12 and remainder 1

Steps 2: 12/2 = 6 and remainder 0

Steps 3: 6/2 = 3 and remainder 0

Steps 4: 3/2 = 1 and remainder 1

Steps 5: 1/2 = 0 and remainder 1

The remainders are now arranged in the reverse order, making the first remainder the least
significant digit (LSD) and the last remainder the most significant digit (MSD).

Hence, 2510 = 110012

1.5.3 Converting from a Base Other Than 10 to Another Base Other Than 10
The following steps are used to convert a number in a base other than 10, to number base other
than 10:

Step 1: Convert the original number to a base (decimal) number.

Step 2: Convert the decimal number obtained in step 1 to the new base number.

5456 = ? 4

Solution:

Step 1: Convert from base 6 to base 10

545 = 5*62 + 4*61 + 5*60

= 5*36 + 4*6 + 5*1

= 180 + 24 + 5

= 20910

LOVELY PROFESSIONAL UNIVERSITY 11


Digital Circuits and Logic Design

Notes Step 2: Convert 20910 to base 4

Remainder
4 209 1
52
0
13
3 1
0 3

20910 = 31014

Therefore, 5456 = 20910 = 31014

Hence, 5466 = 31014

Above example illustrates the method of converting a binary number to an octal number.

1.5.4 Short-cut Method for Binary to Octal Conversion


The following steps are used in this method:

Step 1: Divide the binary digits into groups of three (starting from the right)

Step 2: Convert each group of three binary digit to one octal digit. Since there are only 8 digits
(0 to 7) in octal number system, 3 bits (23 = 8) are sufficient to represent any octal number
in binary to decimal conversion method in this step.

1011102 = ? 8

Solution:

Step 1: Divide the binary digits into groups of 3, starting the right (LSD).

101 110

Step 2: Convert each group into one digit of octal (use binary-to-decimal conversion
method).

1012 = 1*22 + 0*21 + 1*20 1102 = 1*22 + 1*21 + 0*20

   = 4 + 0 + 1     4 + 2 + 0

  = 58    68

Hence, 1011102 = 568

Always check that analogs method is used to convert fractions while conversion
of number representations.

1.5.5 Short-cut Method for Octal to Binary Conversion


The following steps are used in this method:

Step 1: Convert each octal digit to a 3 digit binary number (the octal digits may be treated as
decimal numbers for this conversion).

Step 2: Combine all the resulting binary groups (of 3 digits each) into a single binary number.

12 LOVELY PROFESSIONAL UNIVERSITY


Unit 1: Number Systems

Notes

    5628 = ? 2

Solution:

Step 1: Convert each octal digit to 3

Binary digits

58 = 1012

68 = 1102

28-0102

Step 2: Combine the binary groups.


101 110 010
5628 =
5 6 2
Hence, 5628 = 1011100102

1.5.6 Short-cut Method for Binary to Hexadecimal Conversion


The following steps are used in this method:

Step 1: Divide the binary digits into groups of four (starting from the right).

Step 2: Convert each group of four binary digits to one hexadecimal digit. Remember that
hexadecimal digits 0 to 9 are equal to decimal digits 0 to 9 and hexadecimal digits A to F are
equal to decimal values 10 to 15. Hence, for this step, we use binary to decimal conversion
procedure and represent decimal values 10 to 15 as hexadecimal A to F.

110100112 = ? 16

Solution:

Step 1: Divide the binary digit into groups of 4, starting from the right (LSD)

1101 0011
Step 2: Convert each group of 4 binary digits to 1 hexadecimal digit.
11012 = 1*23 + 1*22 + 0*21 + 1*20 00112 = 0*23 + 0*22 + 1*21 + 1*20
   = 8 + 4 + 0 + 1    = 0 + 0 + 2 + 1
   = 1310    = 316
   = D16
Hence, 110100112 = D316

Convert the number 10010110100112 = ?16

1.5.7 Short-cut Method for Hexadecimal to Binary Conversion


The following steps are used in this method:

Step 1: Convert decimal equivalent of each hexadecimal digit to 4 binary digits.

Step 2: Combine all resulting binary groups (4 digits each) into a single binary number.

LOVELY PROFESSIONAL UNIVERSITY 13


Digital Circuits and Logic Design

Notes

    2AB16=? 2

Solution:

Step 1: Convert decimal equivalent each hexadecimal digit to 4 binary digits.

216 = 210 = 00102

A16 = 1010= 10102

B16 = 1110= 10112

Step 2: Combine the binary groups.


0010 0010 1011
2AB16 =
2 A B

Hence, 2AB16 = 0010101010112

Table 1.4 summarizes the relationship among decimal, hexadecimal, binary, and octal number
systems. Note that the maximum value for a single digit of octal (7) is equal to the maximum
value of three digits of binary. The value range of one digit of octal duplicates the value range of
three digits of binary. If we substitute octal digits for binary digits, the substitution is on a one-
to-three basis. Hence, computers that print octal numbers instead binary, while taking memory
dump, save one-third of printing space and time.

Similarly, note that the maximum value of one digit in hexadecimal is equal to the maximum
value of four digits in binary. Hence, the value range of one digit of hexadecimal is equivalent to
the value range of four digits of binary. Therefore, hexadecimal shortcut notation is a one-to-four
reduction in space and time required for memory dump.
Table 1.4: Relationship among Decimal, Hexadecimal, Binary, and Octal Number Systems

Decimal Hexadecimal Binary Octal


0 0 0 0
1 1 1 1
2 2 10 2
3 3 11 3
4 4 100 4
5 5 111 5
6 6 110 6
7 7 111 7
8 8 1000 10
9 9 1001 11
10 A 1010 12
11 B 1011 13
12 C 1100 14
13 D 1101 15
14 E 1110 16
15 F 1111 17
16 10 10000 20

14 LOVELY PROFESSIONAL UNIVERSITY

You might also like