Computer Organization, Homework 3

Due Tuesday 11/4.

The assignment may be handed in at the start of class on Wednesday 11/5 without penalty. To submit before Wednesday, you may slide your paper under my office door. Do not leave papers in my mail box.

This assignment may not be submitted online. If I determine a way for you to verify that an uploaded file is not corrupt, I will re-enable online submission.

Hand in the assignment at the start of class.

  1. What is the Micro Assembly Language (MAL) instruction for each of these hex microinstructions?
    1. 948248027
    2. 7897F2148
  2. What is the hex microinstruction for each of these Micro Assembly Language (MAL) instructions? You must make up suitable addressed for ADDR1, ADDR2, and ADDR3.
    1. MAR = SP = SP + 1; wr; fetch; goto(ADDR1)
    2. H = MBRU OR H << 8; goto (MBR OR 0x111)
  3. Explain how it is possible that the goto(MBR) in instruction 2 has the MBR from the fetch in instruction 1, but that MDR in instruction 4 is not the value from the read in instruction 3.
    INST1: PC = PC + 1; fetch
    INST2: PC = PC + 1; fetch; goto(MBR)
    INST3: MAR = SP - 1; rd
    INST4: H = MDR
  4. What would be the byte code for the instruction:
    GOTO  -118 
  5. The PC and the MAR both hold addresses. There is a difference between how these addresses are used in their respective caches. Explain the difference.
  6. Translate the following statement into IJVM symbolic instructions (like IADD, BIPUSH, etc). Use reasonable values for I, J, and K. Assume that  the offset of CALCULATE in the constant pool is 0x1234. Since we are not implementing object oriented calls, assume that this (the pointer to the current object) is 0 (NULL).
    K = CALCULATE(I, J);
        
    
  7. IJVM versus JVM
    1. In the IJVM, the first instruction for  LDC_W is at address 0x13 in the ROM. Why can't the remaining instructions for LDC_W be at addresses 0x14, 0x15, and 0x16 in our IJVM?
    2. Assuming that the full JVM has 256 op codes, what would be the best address for the address of Main1 in the ROM? Explain your answer.
  8. Write the microcode for an IFGT instruction in Mic-1. It pops the top operand from the stack and branches if the top operand is greater than zero. Remember that the ALU sets the condition codes during every instruction. Be sure that your jump addresses are consistent within IFGT and within the remaining microinstructions.
  9. Implement DLOAD in Mic-1. It is just like ILOAD except that it pushes two consecutive local variables onto the stack.
  10. There are four improvements from MIC-1 to MIC-2: a) 3 bus architecture,  b) instruction fetch unit handles the PC, c) access to 16-bit operands and d) 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: sequences of instructions are grouped into one instruction; some instructions are removed, some instructions are modified. For the MIC-1 INVOKEVIRTUAL command, indicate which instructions are removed, which are grouped, and which are modified. For each, indicate which of the three improvements allowed the alteration. If they are grouped, indicate which instructions are grouped together.

Course Objectives met by this Homework

1. Be exposed to the hierarchy of virtual machines in a computer system
3. Master the design of memory, ALU, control unit, and design of microprogram
5. Be familiar with instruction set architecture, interrupts, and traps