INFO I101 Lab 3: Representing Information

Date open: Mon 2014 Jan 27
Date due: Mon 2014 Feb 3
20 points

Revised 2014 Jan 29

Part 1

Prerequisite: Chapter 7

  1. How many distinct symbols or values can be written
    1. using 5 bits?
    2. using 26 bits?
  2. Converting binary number representations to decimal.

    Example: Convert 1000 0101 to decimal. This is one number consisting of 8 bits, but it is written in two groups of 4 with a space between for readability.

    Binary place values        128  64  32  16   8   4   2   1
    Bits of binary number        1   0   0   0   0   1   0   1
    Add to get decimal value   128                 + 4     + 1 = 133

    Two more examples (in a slightly more verbose format) are shown in Tables 7.5 and 7.6. You must show your work, either as in the example above or as in Tables 7.5 and 7.6.

    1. Convert 0110 1100

    2. Convert 0001 1001

  3. Convert from binary to hexadecimal: 0001 0100 1101 1111

  4. Using Figure 7.3 or another ASCII table, decode the message:

    0100 1000 0110 1001 0110 0111 0110 1000 0011 1010 0011 0011 0011 0010
    0010 1100 0101 0011 0110 1110 0110 1111 0111 0111 0010 0001

Part 2

Prerequisite: Chapters 7–8

  1. Add in binary:

    1. 0101 + 0010
    2. (with carry) 0101 + 0101
  2. We will write a pixel as (R, G, B) where R is the amount of red, G is the amount of green, and B is the amount of blue. For example, the pixel (10, 20, 30) contains 10 units of red, 20 of green, and 30 of blue. Note that we are using decimal numbers here.

    Brighten the pixel (128, 96, 100) by adding 16 to each subpixel. You, too, may use decimal numbers and decimal arithmetic for this.

  3. Remove half of the red from the pixel (196, 200, 100). That is, write a pixel which is like the one given, but with 50% of the red in the original.

  4. Suppose you want to record a sound so that frequencies up to 16,000 hertz will be accurately reproduced when it is played back. Use the Nyquist rule to determine the minimum sampling rate for digitizing the sound wave.

  5. A certain image is 500 pixels wide and 300 pixels high.
    1. Assuming 24 bits to represent each pixel, what is the uncompressed storage size of the image in bytes (octets)?
    2. How many kilobytes (KB) is that?