Admissions Academic Programs Student Information AQIP/Mission/Foundation/Other Helpful Links Student Support Kern Center Lifelong Learning Student Portal/Catalog Information
Academics
Academic Program information Distance Learning Class information Faculty Portal Cooperative Education/Coop Jobs information TechPrep Program information

  

 

Session Seven

Welcome to the seventh section of MTH140, Number bases.  In this session you will learn about converting hexadecimal numbers from one base to another.

Begin this session by watching the video tape.  If you have purchased a textbook, follow along in your book. If you are using the Internet version, follow along on the webpage. If you have any difficulties, contact your instructor.  After the explanation of converting hexadecimal numbers to other bases, turn off the video player and try to work the practice problems.  Once you have worked the problems, check your answers in the answer key listed in the back of your book or click on the Answer Key button to the left.

Section Seven

Converting Hexadecimal Numbers To Other Bases

Sometimes, we may want to know the value of a hexadecimal number in another number system. When hexadecimal numbers were first introduced, we said that the number 1016 is the same as the decimal number sixteen. Since the number sixteen represents the same value in the decimal system, we could say that 1016 = 1610. (We do not usually write the base on any decimal number since it is understood.) We also know from the discussion in Section 5 that the number sixteen can be represented by five digits in the binary system as 100002. We need to have some system of converting numbers from one number system to another. These facts may be useful.

7.1 ~ Converting Hexadecimal to Decimal

We have shown how to write a hexadecimal number in expanded notation. It is a simple process to convert a hexadecimal number in expanded notation to decimal notation merely by evaluating the powers of sixteen.

The number F6816 is in standard hexadecimal notation. If we looked at the number F6816 and wrote it in a different way, we might put the information in a table such as the one shown in Table 1 ~ 7.1.

Table 1 ~ 7.1

Digit

Power of Sixteen

=

Value

8

160 or 1 =

816

6

161 or 16 =

6016

F

162 or 256 =

F0016

Total Value F6816

Notice that we could use those powers of sixteen to rewrite our problem. If we wrote the number F6816 without using the chart, it could be written as 8 x 1 + 6 x 16 + F x 256 or as 8 x 1 + 6 x 16 + 15 x 256. Evaluating that expression following the order of operations yields 8 + 96 + 3840 or a value of 3944. This means that the hexadecimal number F6816 is the same as the decimal number 3944.

We may want to count in base sixteen. We could put the information in a table to show the first twenty numbers in the hexadecimal system. These numbers would correspond to the first twenty numbers in the decimal system.

Table 2 ~ 7.1

Hexadecimal Number Decimal Number
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
A 10
B 11
C 12
D 13
E 14
F 15
10 16
11 17
12 18
13 19
14 20

It would be quite time-consuming to make a chart for all of the decimal values that correspond to a given hexadecimal number. Students may memorize some of the values merely because the values are encountered quite often. It is not necessary to memorize the table, however, since converting the hexadecimal number to expanded notation and then evaluating the number can be done quite easily.

Example: Convert C27D16 to a decimal number.

Solution: First, identify the value of each digit. The first digit on the right, the digit D is in the units or the sixteen to the zero power place; the next digit 7, is in the sixteen to the first power place; the next digit 2, is in the sixteen to the second power place; the final digit C is in the sixteen to the third power place.

Table 3 ~ 7.1

 

Digit x Power of Sixteen = Value
D x

160 or 1 =

D16

7 x

161 or 16 =

7016

2 x

162 or 256 =

20016

C x

163 or 4096 =

C00016

Total Value C27D16

 

If we wrote the number without using the chart, the number would be:

D x 160 + 7 x 161 + 2 x 162 + C x 163

or D x 1 + 7 x 16 + 2 x 256 + C x 4096

or 13 x 1 + 7 x 16 + 2 x 256 + 12 x 4096

Following the order of operations, this becomes 13 + 112 + 512 + 49152 which equals 49789. This means that C27D16 is the same as the decimal number 49789.

 

7.1 ~ Practice Problems

Directions: Turn off your VCR.  Convert the following hexadecimal numbers to decimal numbers.  When you have finished working the problems, check your answers in the Answer Key.  Turn your VCR back on to view the solutions.

  1. 93B16
  2. 1716
  3. C16
  4. FFF16
  5. 13CD016

7.1~ Homework Problems

Directions: Turn off your VCR.  Convert the following hexadecimal numbers to decimal numbers.  When you have finished working the problems, check your answers in the Answer Key.  If you have any questions, contact your instructor.

  1. B5216
  2. 9A01416
  3. 100DF3116
  4. 3E616
  5. 7C16
  6. 73B16
  7. A000406C16
  8. 7416
  9. 30C45716
  10. 71E05216

 

7.2 ~ Converting Hexadecimal to Binary to Octal

 Turn on your VCR and continue with this section.  If you have purchased a textbook, follow along in your book. If you are using the Internet version, follow along on the webpage. If you have any difficulties, contact your instructor.  After the explanation of converting a hexadecimal number to binary or octal, turn off the video player and try to work the practice problems.  Once you have worked the problems, check your answers in the answer key listed in the back of your book or click on the Answer Key links at the end of every section.

Suppose we have a hexadecimal number and we want to determine its binary equivalent. First, we must think about the relationship between a hexadecimal number and a binary number. One way of thinking about this is to make a table that counts or lists the first twenty values in both systems just like we did when we compared the binary number system to the hexadecimal number system in Section 5 and when we compared the hexadecimal number system to the decimal number system earlier in Section 7.

Table 1 ~ 7.2

 

Hexadecimal Number Binary Number
1 001
2 010
3 011
4 100
5 101
6 110
7 111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
10 10000
11 10001
12 10010
13 10011
14 10100

Notice that the hexadecimal number 10 is the same as the binary number 10000 (both are equivalent to the decimal value 16.) The largest single digit in the hexadecimal system is F. Looking at Table 7.2.1, we see that the hexadecimal number F can be written as 1111 in the binary system. It takes four digits in the binary system to represent the largest digit in the hexadecimal system. It makes sense then to replace each digit in a hexadecimal number by a group of four digits in the binary system in order to convert the hexadecimal number to a binary number. Recall that we did just the opposite to convert a binary number to a hexadecimal number - we collected the digits in a binary number into groups of four to convert the binary number to a hexadecimal number. If we can convert an hexadecimal number to binary, we can certainly convert to octal form. We have already converted a binary number to an octal number in Section 5.2 by collecting the digits in the binary number into groups of three. We will use that same process here as we take a hexadecimal number and first convert it to a binary number and then convert the binary number to an octal number. It may be useful to think about the relationship between an octal number and a hexadecimal number. One way of thinking about this is to make a table that counts or lists the first twenty values in both systems just like we have to compare the octal number system and the decimal and then the binary number systems.

Table 2 ~ 7.2

Octal Number Hexadecimal Number 1 1 2 2 3 3 4 4 5 5 6 6 7 7 10 8 11 9 12 A 13 B 14 C 15 D 16 E 17 F 20 10 21 11 22 12 23 13 24 14

 

Example 1: Convert the hexadecimal number 1EA16 to a binary number and then convert the binary number to an octal number.

Solution: To begin, take each digit in the hexadecimal number and from Table 7.2.1 find the four digit binary number that represents the given hexadecimal digit.

A16 in the units place in the hexadecimal system is the same as 10102 in the binary system.

E16 in the sixteen to the first power place in the hexadecimal system is the same as 11102 in the binary system.

116 in the sixteen to the second power place in the hexadecimal system is the same as 00012 in the binary system.

Copying down the groups of four binary digits first for the one, then for the E, and finally for the A gives us the binary number. This means that the hexadecimal number 1EA16 is the same as the binary number 0001111010102. Notice the 0001 in place of the one, the 1110 in place of the E, and the 1010 in place of the A. Of course, it is convention to omit any zeros at the front (left side) of the number. Following convention, we would write 1111010102. In order to make sure this is the correct conversion, we could convert both the binary number and the hexadecimal number to their decimal equivalent and see if the results are the same. (In this case 1EA16 is A x 160 + E x 161 + 1 x 162 or 10 x 1 + 14 x 16 + 1 x 256 or 490 and 1111010102 is 1 x 2 + 1 x 23 + 1 x 25 + 1 x 26 + 1 x 27 + 1 x 28 or 2 + 8 + 32 + 64 + 128 + 256 or 490.)

Now we will convert the binary number 1111010102 to an octal number. First of all, group the binary numbers into groups of three digits starting from the right hand side. This means that there will be three groups since there are nine digits. (Recall: if the number of digits is not divisible by three, add zeros on the left hand side to make a number of digits divisible by three for the groupings.)

0102 in the binary system is the same as 28 in the units place in the octal system (refer back to Table 5.2.1 for the conversion).

1012 in the binary system is the same as 58 in the eights place in the octal system.

1112 in the binary system is the same as 78 in the eight to the second power place in the octal system.

This means that the binary number 1111010102 is the same as the octal number 7528. In order to make sure this is the case, we could convert both the binary number and the octal number to their decimal equivalent and see if the results are the same. (In this case 7528 is the same as 2 x 80 + 5 x 81 + 7 x 82 which is the same as 2 x 1 + 5 x 8 + 7 x 64 or 2 + 40 + 448 which equals 490. We have already seen that the binary number 1111010102 is 490.)

Thus the hexadecimal number 1EA16 = 1111010102 =7528.

Example 2: Convert the hexadecimal number 201C16 to a binary number and then covert the binary number to an octal number.

Solution: To begin, take each digit in the hexadecimal number and from Table 7.2.1 find the four digit binary number that represents that hexadecimal digit.

C16 in the units place in the hexadecimal system is the same as 11002 in the binary system.

116 in the sixteens place in the hexadecimal system is the same as 00012 in the binary system.

016 in the 162 place in the hexadecimal system is the same as 00002 in the binary system.

216 in the 163 place in the hexadecimal system is the same as 00102 in the binary system.

Copying down the groups of four binary digits first for the two, then for the zero, next for the one, and finally for the C gives us the binary number. This means that the hexadecimal number 201C16 is the same as the binary number 00100000000111002. Notice the 0001 in place of the two, the 0000 in place of the zero, the 0001 in place of the one, and the 1100 in place of the C. As is customary in mathematics, leading zeros on the left of a number are typically not written down which mean that our number should look like 100000000111002. In order to make sure is the correct conversion, we could convert both the binary number and the hexadecimal number to their decimal equivalent and see if the results are the same. (In this case 201C16 is C + 1 x 16 + 0 x 256 + 2 x 4096 or 12 + 16 + 8192 or 8220 and 100000000111002 is 1 x 22 + 1 x 23 + 1 x 24 + 1 x 213 or 4 + 8 + 16 + 8192 which equals 8220.)

Now we will convert the binary number 100000000111002 to an octal number. First of all, group the binary numbers into groups of three digits starting from the right hand side. This means that there will be five groups since there are fourteen digits. (Recall: if the number of digits is not divisible by three, add zeros on the left hand side to make a number of digits divisible by three for the groupings. This means our number looks like 0100000000111002.)

1002 in the binary system is the same as 48 in the units place in the octal system (refer back to Table 5.2.1 for the conversion).

0112 in the binary system is the same as 38 in the eights place in the octal system.

0002 in the binary system is the same as 08 in the eight to the second power place in the octal system.

0002 in the binary system is the same as 08 in the eight to the third power place in the octal system.

0102 in the binary system is the same as 28 in the eight to the fourth power place in the octal system.

This means that the binary number 100000000111002 is the same as the octal number 200348. In order to make sure this is the case, we could convert both the binary number and the octal number to their decimal equivalent and see if the results are the same. (In this case 200348 is the same as 4 x 80 + 3 x 81 + 2 x 84 which is the same as 4 x 1 + 3 x 8 + 2 x 4096 or 4 + 24 + 8192 which equals 8220. We have already seen that the binary number 100000000111002 is 8220.)

Thus the octal number 201C16 = 100000000111002 = 200348.

7.2 ~ Practice Problems

Directions: Turn off your VCR.  Convert the following hexadecimal numbers to binary numbers and then to octal numbers.  Check your answers in the Answer Key.  Turn the VCR back on to view the solutions to the practice problems.

  1. A716
  2. C8116
  3. 35216
  4. E16
  5. 38B716

7.2 ~ Homework Problems

Directions: Turn off your VCR.  Convert the following hexadecimal numbers to binary numbers and then to octal numbers.  Check your answers in the Answer Key.  If you have any questions, contact your instructor.

  1. 1E816
  2. 2C4216
  3. 179A16
  4. B6416
  5. D716
  6. 737516
  7. B16
  8. 70F216
  9. 98E16
  10. D0A16

  This concludes Section Seven

 

Updated January 2004

  Access IMail
  Session One
  Session Two
  Session Three
  Session Four
  Session Five
  Session Six
  Session Eight
  Session Nine

HOME Terra Homepage CONTACT US Terra Building Hours/Contact phone numbers and offices/email contacts CAMPUS DIRECTORY Names and email contacts at Terra MAPS
Area Maps SITE SEARCH Academic Quality Improvement Program AQIP  AQIP
Terra Community College
2830 Napoleon Road   Fremont, Ohio   43420-9670
Telephone: 419.334.8400 or 1.866.AT TERRA (866.288.3772)
Accredited by the Higher Learning Commission of the North Central Association of Colleges and Schools