CS8, 10F, UCSB—W01: (Binary, Decimal, Hex, Octal) Total points: ? (printable PDF)

Accepted: on paper, IN LECTURE on 10/14/2010
If you are unable to do that, please turn it during Conrad's office hours ONLY, not in lecture.

Name (4 pts)______________________________   Umail address (4 pts)  _____________________

Section (2 pts) Circle one:         9am       10am       11am       noon

For each of the following questions, perform the conversion indicated:

  1. (5 pts) From binary to decimal: 0001 1010
  2. (5 pts) From decimal to binary: 56
  3. (5 pts) From binary to octal: 110 101 111
  4. (5 pts) From octal to binary: 672
  5. (5 pts) From hex to binary: AF
  6. (5 pts) From binary to hex: 1101 1000
  7. Both octal and hex are used to summarize binary—in octal, each digit stands for 3 bits, and in hex, each digit stands for 4 bits.

    1. (3 pts) Base 4 could also be used to summarize binary, though it not used very much in practice.
      If we did use it, how many bits would each digit stand for, and why?
    2. (3 pts) Base 64, on the other hand, is used in the encoding of certain kinds of email (look up "base 64" on Wikipedia if you want to know why).

      As you'd expect, base-64 has 64 different symbols. Just like in hex, we use letters of the alphabet to signify extra digits. By including both upper and lowercase letters as separate symbols we get 52 different symbols. The digits 0-9 add 10 more for a total of 62; to that we add + and / to make 64.

      How many bits would each digit in base 64 stand for? Why?
    3. (2 pts) What is a specific way that octal numbers are used in practice? (Hint: think unix commands)
    4. (2 pts) What is a specific way that hex numbers are used in practice? (There are at least two possible answers—some hints include "web" and "address").

End of W01