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).



First things first:


  1. Do the following Exercises from Chapter 1 (pp 51-54):
    Exercises 1.2 - 1.8 and 1.15 - 1.20.
     
  2. 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.
     
  3. 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)

     

  4. Answer the following (you only need a couple digits of accuracy, so round off as appropriate):
    1. About how long should it take to download one CD worth of music over a typical 56 kbps modem?
    2. 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!)
    3. 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...
       
  5. [Bonus / Optional]  Two's Complement:
    1. 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
    2. 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!