Homework 1, due Sep. 15

30 Aug 2011

Answer all questions in a text file (except for those asking for a different type of file) and email to jal2016@email.vccs.edu with subject "CSC 110 hw1".

Make sure to attach the text file with your answers, along with any other files that you're asked to create; alternatively, create a zip file containing all the files you want to submit, and email that.

  1. What are the decimal and binary equivalents of the following hexadecimal numbers?

    • 0xFF
    • 0x80
    • 0x101
  2. Write a truth table for the following expressions. Give a plain English description of what each expression means (some descriptions will be simpler than others).

    • (A & B) | (B & C) | (A & C)
    • (X & Y) | (!X & Y)
    • (P & Q) | (P & R)
    • P & (Q | R)
  3. If 10 + 30 = 100, what base are we working in?

  4. Write down the binary multiplication table for the numbers 0 through 4.

  5. How is the expression x & (x - 1) related to x? Hint: think in binary, and try examples until you see a pattern. You can assume x > 1.

  6. Pick two file formats (other than those we've discussed in detail already), and research them. Answer the following questions:

    • Does the file format start with a pre-defined header?
    • Does the file format use any kind of data compression scheme?
    • Name two different types of information that the file holds, and in what part of the file. For example, Windows bitmap files (in the version we examined) hold size information near the front of the file, and color information in the main (usually largest) part of the file.
    • What are the goals of the file format?

    Some possible examples: mp3, Microsoft Office formats, OpenOffice formats, JPEG, PNG, GIF, zip, gzip. Try to pick one you actually use, and one more obscure type. This Wikipedia article has a list of just about anything you could think of.

  7. Simple steganography: create a bitmap image that, when you view the underlying data, somehow displays a short message. For example, it says "Hello", or "Obviously you're not a golfer" when you view it as a text file. Hint: choose colors in a way that will insert ascii characters. Special prize if you can encode your entire homework assignment in a picture.