|
|
![]() |
|
| |||||||||||||||||||||||||
Notice that numbers in the value column are all powers of two. If we wrote the number 101 without using the chart, it would be written as 1 x 1 + 0 x 2 + 1 x 4 . Evaluating that expression following the order of operations yields 1 + 0 + 4 or a value of 5. This means that the binary number 1012 is the same as the decimal number 5.
We may want to count in base two. We could put the information in a table to show the first twenty numbers in the binary system. These numbers would correspond to the first twenty numbers in the decimal system.
Table 2 ~ 5.1
It would be quite time-consuming to make a chart for all of the decimal values that correspond to a binary number. Students may memorize some of the values merely because some values are encountered quite often. It is not necessary to memorize the table, however, since converting the binary number to expanded notation and then evaluating the number can be done quite easily.
Example: Convert 110012 to a decimal number.
Solution: First, identify the value of each digit. The first digit on the right, the digit 1 is in the units or the two to the zero power place; the next digit 0, is in the twos or two to the first power place; the next digit 0, is in the fours or two to the second power place; the next digit 1 is in the eights or two to the third power place; the final digit 1 is in the sixteens or two to the fourth power place.Table 5.1.3
If we wrote the number without using the chart, the number would be
1 x 20 + 0 x 21 + 0 x 22 + 1 x 23 + 1 x 24
or 1 x 1 + 0 x 2 + 0 x 4 + 1 x 8 + 1 x 16
Following the order of operations, this becomes 1 + 0 + 0 + 8 + 16 which equals 25. This means that 110012 is the same as the decimal number 25.
5.1 ~ Practice Problems
Directions: Turn off your VCR. Convert the following binary numbers to decimal numbers. When you have finished working the problems, check your answers in the back of the book or click here to view the Answer Key. Turn on your VCR to view the solutions to the practice problems worked out on the board by the teacher.
5.1 ~ Homework Problems
Directions: Turn off your VCR. Convert the following binary numbers to decimal numbers. Keep your work in a notebook to be turned into your instructor at the conclusion of the course. When you have completed the problems, check your answers in the back of the book or by clicking the ANSWER KEY button found on the left hand side of your screen. You may also access the Answer Key by clicking here. If you have any questions, contact your instructor.
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 binary numbers to octal numbers, 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.
5.2 ~ Converting Binary to Octal
Suppose we have a binary number and we want to determine its octal equivalent. First, we must think about the relationship between a binary number and an octal 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 decimal number system.
Table 1 ~ 5.2
Notice that the binary number 1000 is the same as the octal number 10 (which is the decimal value 8.) The largest single digit in the octal system is 7. Looking at Table 5.2.1, we see that the octal number 7 can be written as 111 in the binary system. It takes three digits in the binary system to represent the largest digit in the octal system. It makes sense then to group the digits in a binary number into groups of three to convert the binary number to an octal number.
Example 1: Convert the binary number 1100012 to an octal number.
Solution: First of all group the binary numbers into groups of three starting from the right hand side. This means that there will be two groups since there are six digits. (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.)
0012 in the binary system is the same as 18 in the units place in the octal system.
1102 in the binary system is the same as 68 in the eights place in the octal system.
This means that the binary number 1100012 is the same as the octal number 618. In order to make sure this is the case, we could convert both of the binary number and the octal number to their decimal equivalent and see if the results are the same. (In this case 618 is 1 + 6 x 8 or 49 and 1100012 is 1 + 1 x 24 + 1 x 25 or 1 + 16 + 32 or 49.)
Example 2: Convert the binary number 111001012 to an octal number.
Solution: First of all group the binary numbers into groups of three starting from the right hand side. Since there are eight digits in the binary number and we want to have groupings of three digits, add a zero to the left hand side of the number to obtain the number 0111001012 which does not change the value of the number.
Now there are three groups of three digits since there are nine digits. The first grouping on the right is 1012 in the binary system which is the same as 58 in the units place in the octal system. (We can determine this either by looking at the chart or by evaluating 1 x 20 + 0 x 21 + 1 x 22 which equals 5.)
The second grouping from the right is 1002 in the binary system which is the same as 48 in the eights place in the octal system. (We can determine this value either by looking at the chart or by evaluating 0 x 20 + 0 x 21 + 1 x 22 which equals 4.)
The third and final grouping from the right is 0112 in the binary system which is the same as 38 in the eight to the second power place in the octal system. (We can determine this value either by looking at the chart or by evaluating 1 x 20 + 1 x 21 + 0 x 22 which equals 3.)
This means that the binary number 111001012 is the same as the octal number 3458. In order to make sure this is the case, we could convert both of the binary number and the octal number to their decimal equivalent and see if the results are the same. In this case 3458 is the same as 5 x 80 + 4 x 81 + 3 x 82 or 5 + 32 + 192 which equals 229. The binary number 111001012 is 1 x 20 + 0 x 21 + 1 x 22 + 0 x 23 + 0 x 24 + 1 x 25 + 1 x 26 + 1 x 27 which is the same as 1 + 0 + 4 + 0 + 0 + 32 + 64 + 128 or 229.)
Larger binary numbers can be treated in a similar fashion. Remember when converting a binary number to an octal number, group the binary numbers into sets of three digits (counting from the right). If the total number of digits is not divisible by three, add zeros on the left hand side of the number to make to total number of digits divisible by three. Then convert each set of digits to an octal number. Write these digits in the proper order and the result will be the octal equivalent to the given binary number.
5.2 ~ Practice Problems
Directions: Turn off your VCR. Convert the following binary numbers to octal numbers. When you have completed the problems, check your answers in the back of your book or click here to view the Answer Key. Turn on your VCR to see the solutions to the practice problems worked on the board by a teacher.
5.2 ~ Homework Problems
Directions: Turn off your VCR. Convert the following binary numbers to octal numbers. Keep your work in a notebook to be turned into your instructor at the conclusion of the course. When you have finished working the problems, check your answers in the back of the book or click here to view the Answer Key. If you have any questions, contact your instructor.
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 binary numbers to hexadecimal numbers, 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.
5.3 ~ Converting Binary to Hexadecimal
Suppose we have a binary number and we want to determine its hexadecimal equivalent. First, we must think about the relationship between a binary 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 did when we compared the binary number system to the decimal number system.
Table 1 ~ 5.3
| Binary Number | Hexadecimal Number |
| 001 | 1 |
| 010 | 2 |
| 011 | 3 |
| 100 | 4 |
| 101 | 5 |
| 110 | 6 |
| 111 | 7 |
| 1000 | 8 |
| 1001 | 9 |
| 1010 | A |
| 1011 | B |
| 1100 | C |
| 1101 | D |
| 1110 | E |
| 1111 | F |
| 10000 | 10 |
| 10001 | 11 |
| 10010 | 12 |
| 10011 | 13 |
| 10100 | 14 |
Notice that the binary number 10000 is the same as the hexadecimal number 10 (which is the decimal value 16.) The largest single digit in the hexadecimal system is F. Looking at Table 5.3.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 group the digits in a binary number into groups of four to convert a binary number to a hexadecimal number.
Example 1: Convert the binary number 111001012 to a hexadecimal number.
Solution: First of all group the binary numbers into groups of four starting from the right hand side. This means that there will be two groups since there are eight digits. (If the number of digits is not divisible by four, add zeros on the left hand side to make a number of digits divisible by four for the groupings.)
01012 in the binary system is the same as 516 in the units place in the hexadecimal system.
11102 in the binary system is the same as E16 in the sixteens place in the hexadecimal system.
This means that the binary number 111001012 is the same as the hexadecimal number E516. In order to make sure this is the case, we could convert both of the binary number and the hexadecimal number to their decimal equivalent and see if the results are the same. (In this case E516 is the same as 5 x 160 + E x 161 which is the same as 5 x 1 + 14 x 16 or 5 + 224 which equals 229. The binary number 111001012 is 1 x 20 + 0 x 21 + 1 x 22 + 0 x 23 + 0 x 24 + 1 x 25 + 1 x 26 + 1 x 27 which is the same as 1 + 0 + 4 + 0 + 0 + 32 + 64 + 128 or 229.)
Example 2: Convert the binary number 11101011012 to a hexadecimal number.
Solution: First of all group the binary numbers into groups of four starting from the right hand side. Since there are only ten digits in the given number, it is necessary to add two zeros to the left hand side of the number to make a total of twelve digits. Once we do this we will have three groups of four digits.
11012 in the binary system is the same as D16 in the units place in the hexadecimal system.
10102 in the binary system is the same as A16 in the sixteens place in the hexadecimal system.
00112 in the binary system is the same as 316 in the sixteen to the second power place in the hexadecimal system.
This means that the binary number 11101011012 is the same as the hexadecimal number 3AD16. In order to make sure this is the case, we could convert both of the binary number and the hexadecimal number to their decimal equivalent and see if the results are the same. (In this case 3AD16 is the same as D x 160 + A x 161 + 3 x 162 which is the same as 13 x 1 + 10 x 16 + 3 x 256 or 13 + 160 + 768 which equals 941. The binary number 11101011012 is 1 x 20 + 0 x 21 + 1 x 22 + 1 x 23 + 0 x 24 + 1 x 25 + 0 x 26 + 1 x 27 + 1 x 28 + 1 x 29 which is the same as 1 + 0 + 4 + 8 + 0 + 32 + 0 + 128 + 256 + 512 or 941.)
Larger binary numbers can be treated in a similar fashion. Remember when converting a binary number to a hexadecimal number, group the binary numbers into sets of four digits (counting from the right). If the total number of digits is not divisible by four, add zeros on the left hand side of the number to make to total number of digits divisible by four. Then convert each set of digits to a hexadecimal number. Write these digits in the proper order and the result will be the hexadecimal equivalent to the given binary number.
5.3 ~ Practice Problems
Directions: Turn off your VCR. Convert the following binary numbers to hexadecimal numbers. When you have completed the problems, check your answers in the Answer Key. Turn on the VCR to view the solutions to the practice problems worked out on the board by a teacher.
5.3 ~ Homework Problems
Directions: Turn off your VCR. Convert the following binary numbers to hexadecimal numbers. Keep your work in a notebook to be turned into your instructor at the conclusion of the course. When you have finished working the problems, check your answers in the back of your book or click here to view the Answer Key. If you have any questions, contact your instructor.
This concludes Section Five
Updated January 2004
|
|||||||||||||||||||||
|
|