This Unit is designed to bring students up to speed on number systems other than base 10. Your instructor for AP Computer Science A will test you on the material assigned for summer work during the first month of school. You are encouraged to work on these materials either alone or with a partner and to use the Internet or any other resources you wish to complete them.
Introduction to Binary Numbers
All your life you have counted using the base 10 system. Ever wonder why? Well, it is because you have 10 fingers and 10 toes. If humans had fewer (or more) digits on their hands and feet, no doubt we would have quite a different number system than we do today.
Let us review how we count. Starting with zero, we count up to 9. Once we exceed 9, our next number is 10 which is essentially going back to 1 but shifting one place to the left to denote progression.
So a number like 23 can be written as:
(2 x 101) + (3 x 100) = 2310
Notice the subscript 10 on the right of the number. This can be used to denote the base of the number system we are using. We usually do not bother writing this subscript when we write our numbers because all humans use base 10 so there is no need.
But while the base 10 system works well for us humans, computers do not like to count this way. A computer only understands one thing - either the light is on or it is not on. Every computer in the world is only capable of understanding this one basic concept. Everything that the computer does is based on a sequence of these on-and-off light patterns.
Now, let us take a look at the number 3. In our base 10 system we simply write 3 which can also be written as:
3 x 100 = 3 or (3)10
But if we wanted to describe this number to a computer, here is how we would teach it to count to three using base 2 which is also known as binary:
02 - zero
12 - one
102 - two
112 - three
Notice that 112 is equal to 310. The reason that the numbers 2 and 3 do not exist in the binary system is that only 0 and 1 exist. So for the base 10 system we have the ten numbers 0 through 9. Likewise, in the base 2 system (binary), we have only the two numbers 0 and 1.
Given that you have spent your entire life counting in base 10, it is going to take some time to get your brain used to the idea that we can count using other number systems. But understanding this difference is key to making sense of how computers see the world.
So how would we change the base 10 number 2210 to binary? And how would we take a binary number such as 10012 and change it to base 10?
To find out how, check out this video:
Ok, so based on that short tutorial, can you figure out how to write the number 19 in binary?
Next, can you figure out how to convert the binary number 1001 to base ten?
If you were able to figure out the answers to these two problems were (10011)2 and 9, you are ready to finish this lesson by answering the questions below.
1 pointIf I multiplied the binary numbers 1112 and 1012, what would be the binary product?
1 pointWhich of the following decimal numbers is equal to the binary number 0b11?
1 pointWhat is the binary equivalent of the decimal number 123?
1 pointWhich of the following decimal numbers is equivalent to the binary number 101101102?
1 pointWhich of the following decimal numbers is equivalent to 02?
1 pointHow much is 11102 - 10112? (It is ok if you cannot subtract in binary directly. It has been too many years of base 10 for you. Just convert everything to decimal and then convert back to binary).