Computer Organization, Homework 3

Due Thursday 4/16 (late 6am, 4/17)

  1. (4) What would be the byte code for the instruction:
    GOTO -300
    You must show your work for translating -300 into hex.
  2. (8) What is the hex microinstruction for the Micro Assembly Language (MAL) instruction,
    MDR = TOS = MDR - H; wr; goto (MBR OR 0x100)?
    You must show the binary equivalent of the above MAL and identify the various parts of the microinstruction, before writing the hex equivalent.
  3. (8) What is the Micro Assembly Language (MAL) instruction for the hex microinstruction 142A40897?
    You must show the binary equivalent of the above hex and identify the various parts of the microinstruction, before writing the MAL code.
  4. (8) Translate the following statement into IJVM symbolic instructions (like ILOAD, BIPUSH, ISTORE, etc). Use reasonable integer values for I, J AND K. Assume that the offset of CALCULATE in the constant pool is 0xA2B4. Since we are not implementing object oriented calls, assume that this (the pointer to the current object) is 0 (NULL). Do not make up an implementation for CALCULATE, just call the subroutine. Use the offset to the constant pool to make the call to the calculate routine.
    K = CALCULATE(I, J, 42);
  5. (20) Implement IST_ARRAY in Mic-1. It is just like ISTORE except that it has an extra byte that is the number words on the stack to store into consecutive local variables.

    IST_ARRAY varnum byte

    The instruction will store byte number of words from the stack into consecutive local variables, starting with local variable varnum.

    Use symbolic names in conditional branch statements, but supply a table that gives hex addresses for each of these labels. Be sure all the labels have consistent addresses.

  6. (15) There are three improvements from MIC-1 to MIC-2:
    1. 3 bus architecture,
    2. instruction fetch unit handles the PC and can access 16-bit operands,
    3. merging the interpreter loop.

    INVOKEVIRTUAL in MIC-1 has 22 lines of code, it has 11 lines of code in MIC-2. There are three types of changes:

    1. sequences of instructions are grouped into one instruction,
    2. some instructions are removed,
    3. some instructions are modified.

    For the MIC-1 INVOKEVIRTUAL command,

    1. indicate which instructions are unchanged, removed, grouped, or modified.
    2. indicate which of the three improvements allowed the alteration. There could be more than one per line.
    3. If they are grouped, modified or unchanged, indicate the corresponding instruction from Mic-2.

    If there is a choice between marking a statement as being grouped with others or being removed, choose grouped.

    Correction: line 5 in Mic-2 should be the same as line 12 in Mic-1. H does not needed to be updated in line 5 of Mic-2.

  7. (6 20 points) Create a table similar to the one in Figure 4-44 for the instructions below.
    R3 = R0 / R2
    R3 = R3 * R2
    R2 = R0 + R1
    R0 = R2 / R5
    R6 = R3 - R6
    R3 = R8 + R0

    You do not need to indicate the scoreboard for the registers being read and written. Use out-of-order issue and out-of-order retire, with register renaming. Assume that the secret registers are S0 through S8.
    1. Add a column that indicates the type of dependency, if there is one. If there is more than one, list them all.
      • No Dependency
      • RAW
      • WAR
      • WAW
    2. Add a column for renamed registers. List how a register was renamed, like S3 = R3.
  8. (6 points) Consider the direct-mapped cache in Figure 4-38 for the address 0xFEB43265.
    1. What would be the tag and line for this address ? Leave your answers in hex. Show your work.
    2. Suppose the number of bytes in a word were doubled to 8, that there were twice as many lines in the cache, and that there were 16 words in a line. What would be the tag and line for this address? Leave your answers in hex. Show your work.

Submitting the Assignment

You may submit a PDF, word doc, text document or write your answers and scan them (or take pictures). If you submit more than one file, please zip them first. Do not use RAR or 7-Zip.

Upload your file to me using the upload program on my class page:
Submitting Homework Online.

You must verify that your upload is correct. The online program has an option to download what was just uploaded. It is your responsiblity to be sure that the file can still be read. If I cannot read the file, it will be graded as a 0.