CS 111

Fall 2016

Introduction to Computer Science

HW09: Data representation

Due: Friday, 10/28 at 14:20 on paper

This is a solo assignment, to be done on paper, and due at the beginning of lecture.

Reading

At the beginning of the quarter, we discussed that computers store everything using zeros and ones. In this assignment, you will read about a few standard ways of encoding numbers and text using zeros and ones. Use the following links as resources to answer the questions below.

A note on how to read: I find myself reading Wikipedia articles for technical concepts a lot. It is useful to develop techniques for reading (Wikipedia) articles efficiently. On one extreme, you may read every single word from beginning to end. On the other extreme, you may search for exactly what you need (e.g., for the homework) and move on. Neither of these methods will be the most efficient way of learning the material. Try to find the right balance. This will come with practice, especially if you are mindful.

Answer the following questions

  1. For each of the following positive binary integers, what are the decimal (base ten) and hexadecimal (base sixteen) equivalents?

    • 10011
    • 10010011
    • 1
  2. Add the binary numbers 10110 to 1011. Show your work (in particular, show where you get carries, and where you don't). You can check your work by translating the numbers into decimal, but I want to see you do the usual gradeschool addition algorithm in base 2 instead of base ten.

  3. The number 1.398 is equal to 1 + 3/10 + 9/100 + 8/1000. If we move to binary, and use a "binary point" instead of a decimal point, what will the following numbers equal? That is, what are the base ten equivalents of the following binary numbers?

    • 0.11
    • 101.101
  4. When you multiply a decimal number by 10, you shift the decimal point to the right one place. How can you shift a binary point to the right?
  5. Rewrite the following base-ten numbers as 16-bit two's complement integers: -1, 255, -255, and 1500.
  6. What does the bit pattern 01000110 represent if you interpret it as an 8-bit two's complement integer? What if you interpret it as a character using ASCII?
  7. Some questions about Unicode.

    • What is the Unicode value for the lower-case beta in the Greek alphabet?
    • What character is represented by the Unicode code point 0x2663? (That's hexadecimal 2663, also known as decimal 9827.)
    • Name two languages that you have never heard of before whose alphabets are included in Unicode.
    • What is Tengwar? What is its status with respect to Unicode?