Module 2 - Theory
Assignment 2.03

 

Objectives: After studying the Module 1 Game Skills 2 Chip, you will be able to:

  1. Distinguish between features of the decimal number system and the binary number system.
  2. Define the following terms: bit, byte, and place value.
  3. Convert a number from the binary number system to the decimal number system.
  4. Convert a number from the decimal number system to the binary number system using the successive division method.

YOUR LESSON

Introduction

Throughout history, people have faced the problem of communicating over long distances. One way to communicate with a person who is far away is to travel to where that person is. Another way is to write a letter and to have someone else do the traveling.

Signal flags, smoke signals, and flashing lights have also been used to communicate over distance; however, none of these methods provide rapid and reliable communication. The computer has added another dimension to the communication problem. Not only do people need to be able to communicate with a computer, but computers need to be able to communicate with each other. How is this accomplished?

Regardless of a computer's size, cost, or speed--and regardless of the operating system or program it is running--a computer can ultimately do only one thing: detect whether an electrical signal is "on" or "off." That's it! Every computer program, regardless of the programming language, is a sequence of instructions (an algorithm) that is converted to a sequence of on/off signals. Since there are only two possibilities for a signal--on or off--instructions can be represented in the binary number system. All computer communication is done in binary code, so for you to understand how a computer works, you need to understand a little bit about the binary number system.

By the way, do you remember the fatal flaw in Charles Babbage's two machines? He had planned to use the decimal number system, the one we use for counting and doing arithmetic. Using the binary number system is what makes today's computers possible.


A Little "Bit" of Theory

Computers operate by detecting whether an electrical signal is "on" or "off." Transistors inside your computer act as on/off switches to create the binary code your computer uses to process data and to communicate. The information we feed into a computer turns into electronic pulses.

The pulses are the only language that computers understand. Because the transistor can only be "on" or "off," those two situations can be represented by the binary numbers 1 and 0. (You probably already know that "bi" means two.) Each electronic pulse is either "on" or "off." "On" is equal to 1 and "off" is equal to 0. The 0 and 1 in the binary number system are referred to as binary digits, or BITs. A computer uses these two choices to process all the information we give it.

A BIT...either a 0 or a 1...is the smallest unit of data that a computer can handle. For convenience, and some technical reasons as well, when eight BITS are grouped together they are called a byte. Each byte represents a letter, number, or symbol on the keyboard as well some other special characters.
QB Character: A binary code is assigned to every character on the keyboard. A is 01000001.

We make words using 26 letters of the alphabet. Computers make words using bytes. Remember, a byte is a group of eight electronic signals that represents one piece of information. Inside a computer, electronic pulses move through the circuit boards to the computer chips. In each chip, there are millions of very small "switches" lined up in sets. When an electronic pulse reaches the switches, they are turned off or left on in a specific order. Each letter, number, punctuation mark, and special character has its own pattern of "ons" and "offs" (1s and 0s).

We humans use the decimal number system (base 10) to count with the ten numbers...0, 1, 2, 3, 4, 5, 6, 7, 8, and 9...also called decimal digits. With these ten symbols, you can count forever.

When you see a number like 542 in the decimal number system, how do you know what it is? That may seem like an odd question because you know that it is five hundred and forty-two. The reason it is five hundred and forty-two is because each position in the number has a specific place value. The "5" is in the hundreds position, the "4" is in the tens position, and the "2" is in the ones position. So, you really have 5 x 100 plus 4 x 10 plus 2 x 1 = 542.

Notice that the place values are powers of 10. For example, the third position is 100, or 10 to the second power (10^2). The second position is 10, or 10 to the first power (10^1). The first position is 1, or 10 to the zero power (10^0). Remember the carat symbol (^) from the Order of Operations? It is used to represent raising a number to a power. Let's put all of this information together and look at the following example.

We can rewrite 542 as follows: 5 * 10^2 + 4 * 10^1 + 2 * 10^0
This is equivalent to: 5 * 100 + 4 * 10 + 2 * 1
Which equals: 500 + 40 + 2
Or (drum roll please!): 542

Place value is the key!

Computers use the binary number system (base 2) to count with only two numbers...0 and 1. With just these two symbols, you can still count forever...it just looks different. Because we don't normally use base 2, it is helpful to know how to convert between the binary number system and the decimal number system. Remember, the key concept in both number systems is place value.


Converting from Binary to Decimal

Did you say 10111011110110100101001110111011?

Here is a typical binary number: 0101. You would say this as zero-one-zero-one base 2. How would you say the number at the top of this section? That's quite a mouthful! Binary numbers are definitely meant for computers, not humans. Yet, we need to know what zero-one-zero-one base 2 represents and the easiest way to do it is to convert from a binary number to a decimal number. To do that, all you need to know is the place value of each binary digit.

You have seen in the decimal number system that the place value of a digit is determined by where it stands in relation to the other digits in a number. To convert from binary to decimal , you need to know the place values of the binary number system. Shortly you will have practice worksheets for doing these conversions, but let's look at the example illustrated in the following table first.

This table shows how to convert the binary number 0101 to its decimal equivalent.

Notice that the binary number 0101 is inserted in the third row of the table.


Powers of 2
2^3
2^2
2^1
2^0
Binary Place Value
8
4
2
1
Binary Number
0
1
0
1
Decimal Equivalent
0
4
0
1

Directly above, in row 2, you see the place value of the first four digits in the binary number system. From right to left they are 1, 2, 4, and 8. The place values are increasing by powers of 2, as shown in the first row.

Pay attention because here is the key! If you multiply the binary place value times the binary number beneath it, you get the decimal equivalent. Then if you add the decimal equivalents up (0 + 4 + 0 + 1), you get the decimal number that the binary number 0101 is equal to: 5. Pretty amazing! And you thought it would be difficult.

The main thing that students always forget is that any number to the zero power is always 1. So in the binary number system, 2^0 = 1.


QB Character: Check Your Understanding.
In the binary number 1001, what is the place value of the 1 on the "left" side of the number?

1
2
4
8


OK, that's the theory behind how you convert from binary to decimal. Now it's time for a "bit" of practice so you can see just how easy it is. Download the following pdf file, display it in Acrobat Reader, and then print it out. The worksheet takes you through this process step-by-step. Study the examples and do the practice examples. A key is provided on the worksheet so you can check your own work. When you are finished, come back to this lesson.

Download this worksheet now: Binary to Decimal Conversion

Welcome back. How did you do? If you still have questions about the process, e-mail your instructor and ask for help. Once you have mastered the binary to decimal conversion process, you can move on to the next section of this lesson.


Converting from Decimal to Binary

If you understand the key concept of place value and you have a technique, converting from binary to decimal is easy.

Now, how about going from decimal to binary. There are two different techniques you can use to convert from decimal to binary: the chart method or the successive division method.

The chart method is essentially the reverse of what you just did on the worksheets.

The successive division method will be illustrated here and you will have another worksheet for practice. The principle behind the successive division method is a simple one; however, it is best explained through the illustration shown below in which the decimal number 21 will be converted to its binary equivalent.

 

Explanation Show Your Work
Start with the highest binary place value that is less than or equal to 21. In this case, it is 2^4, or 16. Dividing 21 by 16 gives a 1 with a remainder of 5. 21 / 16 = 1 with remainder of 5
The remainder, 5 cannot be divided by the next highest binary place value of 2^3, or 8. So, record a 0 and 5 is still the remainder. 5 / 8 = 0 with remainder still 5
The remainder, 5 can be divided by the next highest binary place value of 2^2, or 4. So, record a 1 and the new remainder is 1. 5 / 4 = 1 with remainder of 1
The remainder, 1 cannot be divided by the next highest binary place value of 2^1, or 2. So, record a 0 and the remainder is still 1. 1 / 2 = 0 with remainder still 1
Finally, the remainder, 1 can be divided by the final binary place value of 2^0, or 1. So record a 1 and the number is converted. 1 / 1 = 1 with no remainder left
The final step is to start at the top and write down all the 1s and 0s to get the binary number. Eureka! And you thought this would be hard. 10101


YOUR ASSIGNMENT

OK, now you also know the theory behind how to convert from decimal to binary. Now it's time for a "bit" more practice so you can see just how easy it is. Download the following pdf file, display it in Acrobat Reader, and then print it out. The worksheet takes you through this successive division method step-by-step. Study the examples and do the practice examples. A key is provided on the worksheet so you can check your own work. When you are finished, come back to this lesson.

Welcome back. How did you do? If you still have questions about the process, e-mail your instructor and ask for help. Once you have mastered the decimal to binary and the binary to decimal conversion process, you are ready for a Quiz. On the Quiz, you will have to show your work for both types of conversions, so look back at the worksheets and review how to show your work. When you are ready, go to Assignment 02.03 and take the Quiz.


A Quick Review

Before you move on to the next assignment, please make sure that you can do the following:

  1. Distinguish between features of the decimal number system and the binary number system.
  2. Define the following terms: bit, byte, and place value.
  3. Convert a number from the binary number system to the decimal number system.
  4. Convert a number from the decimal number system to the binary number system using the successive division method.

If you know how to how to convert binary to decimal and decimal to binary, you will have a greater understanding of the way that humans communicate with computers and computers communicate with each other..


theory button When you are ready to take a quiz on converting between the binary number system and the decimal number system, go to Assignment 02.03 - Theory Button in the Quizzes area. Once you have completed the quiz, please move on to the next assignment.

previousnext