Homework Assignment #9 – Extra Credit [15 pts]


You are expected to do your own work on all homework assignments. (See the statement of Academic Dishonesty on the Syllabus.)

Check the Syllabus for the late assignment policy for this course.

How to turn in?

Assignments need to be turned in via Laulima. Check the Syllabus for the late assignment policy for the course.

What to turn in?

You should turn in single plain text file named README.txt with your answers to the assignment’s questions. Your file must be readable “as is” and points will be removed if the report is not readable.

How to denote different bases?

Note: When writing binary numbers, add a space between every group of four digits for readability. Also, add zero padding ("0001 1010b" instead of "1 1010b"). Points will be deducted for answers that are difficult to read.

Exercise #1: Conversions [5pts]

For each of the following numbers, convert the number into the two other bases among decimal, hex, binary. For example, given the number 0xFF, you should give the conversions into decimal and binary. Because it’s very easy to look up a number converter online, it’s important that you show your work for each conversion.

  1. 0xC91
  2. 0x8CE
  3. 1010 0101 1011 0110b
  4. 256d
  5. 0111 0011b

Exercise #2: Arithmetic [4pts]

Give the result of each of the operations below. Show your work by showing carries.

  1. 0xFEDCBA0123456789 + 0x0987654321FEDCBA
  2. 1110 1010 1001 1111b + 1110 0100 1100 0101b
  3. 0xFEDCBA0123456789 - 0x0987654321FEDCBA
  4. 1110 1010 1001 1111b - 1110 0100 1100 0101b

Exercise #4: Memory sizes [3pts]

Provide explanations/justification for your answers.

  1. How many bytes are there in 1 KiB?
  2. How many bytes are there in 1KB?
  3. How many 4MiB chunks in a 256GiB file?

Exercise #5: Eggs [2pts]

Provide explanations/justification for your answers.

  1. I have a basket with x eggs in it, and a bunch of 7-egg boxes to fill. How many boxes do I need to store all the eggs?
  2. I have a basket with x eggs in it, and a bunch of 7-egg boxes. I fill boxes one after another. The last box is not full and contains z < 7 eggs. What is z.

Exercise #6: Addressing [1pts]

  1. How many bits are required to address a 4 GiB address space?