cs1150labtwo_1421891644

advertisement
CS 1150 Exploring Number Systems Lab (total
points:30)
Last updated: 11/23/2015, timestamp 1422039294
What To Turn In: first_last_Exploring_Number_Systems_lab.doc
[example: indiana_jones_number_systems_lab.doc]
Simply rename this file, the one you are reading right now.
Checklist: these items are critical. They are worth points.
●
●
●
●
●
●
●
●
●
6 points: style, readability, etc.
3 points: Problem 1
3 points: Problem 2
3 points: Problem 3
3 points: Problem 4
3 points: Problem 5
3 points: Problem 6
3 points: Problem 7
3 points: Problem 8
Do the Tutorial “Activities” (Optional, no points)
Before you proceed with the exercises for actual points, download the file Lab02.pdf. Then find
do the “part 1” and “part 2” activities.
(Screenshot of what you should see.)
(do both part 1 and part 2)
These are intended to teach you how to use the applet for this lab.
DO NOT BOTHER WITH THE “EXERCISES” IN LAB02.PDF!
Do the exercises in THIS document instead!
Exercise 1: Converting Numbers (30 points)
1) (3 points) Convert the binary number 10110111 to decimal manually, showing all steps.
2) (3 points) Using the “Number systems” applet, type 10110111 into the Base X text area.
Verify your answer above. Take a screenshot, and put it below this line:
3) (3 points) 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 of your textbook 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 77 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:
4) (3 points). Type 49 into the Base 10 text area and press Convert. Take a screenshot, and
put it below this line:
5) (3 points) Use the “Number systems” applet to convert the number 123 from base 5 to
decimal.
Type 123 into the Base X text area, select Base 5 from the choices in the pull-down menu, and
click Convert. Does this make sense to you? Why? Take a screenshot and write on the paper
why 1235 equals whatever the applet shows you. (Review p. 36 of the textbook for an
explanation.)
Screenshot goes below this line:
Explanation goes below this line:
6) (3 points) Add the two binary numbers together by hand, showing all carries. Either scan your
work, or reproduce it in this document.:
101010011
+
000111010
Add the numbers below this line. Either scan your work and copy it here, or use some
other solution such as MS Paint, or just typing characters directly:
7)(3 points) Now type the numbers 101010011 and 000111010 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 put it below this line:
8) (3 points) 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):
Download