Name: Box: Date:

HW11

Your task it to compare the memory efficiency of four different styles of instruction sets. The architecture styles are the following:

For this assignment, you may make the following assumptions.

Each architecture should be able to run this code:

do {
  a = b - c;
  b = b - d;
} while(a != 0)

You should have designed the instruction sets and programs in your class. For this homework, you will analyze your in-class design.

  1. (20 points) Analyze the efficiency of each architecture for this piece of code. Count how many instructions are needed. Then, assuming the loop is executed once (e.g. each line of code is executed once), count how many bytes of instruction data must be transferred from memory to the processor in order to run the program. Also count how many bytes are needed to transfer any other data (e.g. for memory instructions like lw and sw). Finally, compute the total transferred and analyze your results. Show your work.

    a. Accumulator cost:

    Number of instructions Instruction bytes Other data bytes Total bytes

    b. Memory-memory cost:

    Number of instructions Instruction bytes Other data bytes Total bytes

    c. Stack cost:

    Number of instructions Instruction bytes Other data bytes Total bytes

    d. Load store cost:

    Number of instructions Instruction bytes Other data bytes Total bytes
  2. (3 points) Which architecture is the most efficient in terms of number of instructions?

  3. (3 points) Which architecture is the most efficient in terms of total bytes transferred?

  4. (4 points) Which architecture is better and why?