CS 282 Winter 2003

Assignment 1

1/29/2003

Due date: 2/5/2003 12:30 PM

  1. (10 points) Assume that an instruction fetch, single operand load, or storage of a result takes 7 time units to complete. Instruction decode, operation execution, and program counter update each take 1 time unit to complete. How long does it take to execute the following code sequence?

mul   A, B, C

div    D, E, F

add   X, A, B

  1. (5 points) Explain briefly the process of translation from a high level language to machine language. Where and how do a compiler and an assembler fit into this process?
  2. (3 points) Convert the following numbers into decimal system:
    1. 1110 11002
    2. 0xABF16
    3. 012678
  3. (10 points) Convert 104410  into
    1. Octal system and
    2. Hexadecimal system,

using Subtraction of Powers method. Please show the steps involved.

  1. (6 points)  Problem 3.12 in textbook, page 81, chapter 3
  2. (1 point) Convert 8A716 into octal system, using the ‘Powers of Two’ special conversion technique (That is, notice that both the bases 16 and 8 are powers of two and use the technique we discussed in class.)