computer science lab#2
CS1150 Introduction to Computer Science
Lab #2 – Exploring Number Systems, 25 points
Objective:
To understand and convert between number systems.
Instructions:
Make sure to do the Activities as outlined in the LabCH02.pdf file. The activity is actually a tutorial that will help you to solve the problems in the exercises. It is expected that you will complete the Activities before you begin the exercises.
When you are finished, save and rename the completed document as “firstname_lastname_lab2.docx”. Then, submit the saved document to Pilot.
Exercise: Converting Numbers (25 points)
1) Convert the binary number 10101101 to decimal manually, showing all steps. The first step has been done for you (working right to left).
1 * 20 = 1
2) Convert the binary number 10101101 to Hexadecimal and Octal manually, showing all steps.
3) Using the “Number systems” applet, type 10101101 into the Base X text area. Verify your answer above. Take a screenshot, and paste it below this line:
4) One way to convert a decimal number to binary is to repeatedly divide the number by 2, writing down the remainder at each step. (See p. 43-45 of your ebook for an example that does this using hexadecimal, or base 16, instead of binary.) To see how to do this in binary, type a number, such as 49, into the Base 10 text area of the “Number Systems” applet and press Convert. The steps are shown in the little pink window that pops up.
To learn how to do this yourself, convert the decimal number 97 to binary using this method of repeated division, just like the applet did. Show your work here, and use the “Number systems” applet to check your result:
5) Type 67 into the Base 10 text area and press Convert. Take a screenshot, and paste it below this line:
6) Use the “Number systems” applet to convert the number 139 from base 5 to decimal.
Type 139 into the Base X text area, select Base 5 from the choices in the pull-down menu, and click Convert. Explain what's happening. Take a screenshot and write why 1395 equals whatever the applet shows you. (Review p. 36-37 of the ebook for an explanation.)
Paste screenshot below this line:
Write explanation below this line:
7) Add the two binary numbers together by hand, showing all carries. Show your work below. The first addition and carry has been done for you in red.
0 ← Carries
1 1 1 0 1 0 1 0
+ 0 1 0 0 1 1 1 0
0
8) Now type the numbers 01001110and 11101010 into the Binary column of the “Binary addition” applet. Click on Add and verify your answer with the applet’s result. Take a screenshot, and paste it below this line:
9) Finally, what are the limits of the “Binary addition” applet? What are the largest numbers it can add? What is the largest result it can produce? Experiment, and record your answers below, in both binary and decimal values.
Largest numbers it can add (decimal representation):
Largest numbers it can add (binary representation):
Largest result it can produce (decimal representation):
Largest result it can produce (binary representation):
Rubric (25 pts possible):
|
Exercise |
Points |
|
Question 1 |
3 |
|
Question 2 |
3 |
|
Question 3 |
3 |
|
Question 4 |
3 |
|
Question 5 |
3 |
|
Question 6 |
3 |
|
Question 7 |
3 |
|
Question 8 |
2 |
|
Question 9 |
2 |
|
Total |
25 |
1