Computer Science 15-100 (Sections T & U), Spring 2008
Homework 1
Due: by email on Fri 18-Jan-2008 at 10:00am (no late submissions accepted).
- Be sure to include your name, your Andrew ID, and your section (T or
U) clearly on the top of your assignment.
- Email your solutions to your CA by the deadline given above.
- Show your work. Correct answers without supporting calculations
will not receive full credit.
First things first:
- Read L&L Chapter 1, Appendix B, and Appendix C.
- Study the Key Concepts on pp. 48-49 and the Self-Review Questions on pp
50-51 (do not turn these in; instead, check the answers on pp 56-58).
- Do the following Exercises from Chapter 1 (pp 51-54):
Exercises 1.2 - 1.8 and 1.15 - 1.20.
- Do the following Programming Projects from Chapter 1 (pp 54-55):
PP 1.1, 1.2 (do not submit your programs for this problem, just a list of
the errors that were generated), 1.7.
- Complete the following chart. You may wish to refer to Appendix C
(The Unicode Character Set):
| Decimal |
Binary |
Unicode Character |
| 65 |
0100 0001 |
A |
| 103 |
|
|
| |
0010 0101 |
|
| |
|
q (lower case) |
- Answer the following (you only need a couple digits of accuracy, so
round off as appropriate):
- About how long should it take to download one CD worth of music over a
typical 56 kbps modem?
- About how many bits per square inch are stored on a typical DVD disk?
(Yes, you will have to estimate the disk's area -- show your work!)
- My first modem was 110 baud -- that is, it transferred 110 bits per
second (really -- and that was on the rare occasions when the line wasn't
noisy). How long would it take that modem to download an uncompressed
1280 x 800 screenshot with a pixel depth of 16 bits? How long would it
take if it was a black-and-white (monochrome) picture? Yeah, we didn't
download pictures back then...
- [Bonus / Optional] Two's Complement:
- Express the following numbers in 8-bit 2's complement (recalling the
"trick" of flipping the bits and adding 1 to negate):
a)
-1
b) -2
c) -35
- The principal advantage of using 2's complement to represent negative
numbers is that subtraction can be performed via negation and addition (and
this was a big deal back in the days when each gate added appreciably to the
cost of a computer!). For example, to compute 80 - 35, you should
rewrite the problem as such:
80 - 35 = 80
+ (-35)
Then, express -35 in 2's complement (from above), do the addition as normal, and you
should get the correct answer (45). Do this very problem now,
converting the values into 8-bit 2's complement, and then converting the
answer back into decimal and confirming that it is, in fact, 45.
Carpe diem!