Fall 2001, Computer Organization, Assignment 3
Section 02: Due Wednesday 11/7 at the start of class
Section 01: Due Thursday 11/8 at the start of class
Type all the answers. Hand in a printout. Upload the assignment via the web:
Submitting Homework
Online.
-
(2 points) What is the Micro Assembly Language (MAL) instruction for this
hex microinstruction?
4914C0C40
-
(2 points) What is the hex microinstruction for this Micro Assembly Language
(MAL) instruction?
MDR=MBR+H; wr; goto(0x105)
-
(2) In Mic-1, assume that it takes 1 nsec to set up MIR, 1 nsec to gate a
register onto the B bus, 3 nsec to run the ALU and shifter, 1 nsec for the
results to propagate back to the registers, and the clock is high for 2 nsec.
-
Can this machine run at 50 MHz? Explain your answer.
-
Can this machine run at 200 MHz? Explain your answer.
-
(1) How long does a 100 MHz Mic-1 take to execute the Java statement
i = j + k - 3
Give your answer in nanoseconds.
-
(2) Suppose there were an additional condition code for overflow as a signed number: V; and an additional
JAM bit: JAMV. What would be the microcode for the instruction IADD_IFGTS offset,
IADD If Greater Than Signed. The instruction will perform an IADD and then will branch if the result of this operation is greater than zero as a signed number. You will need to
consider the three condition codes V, N, and Z.
-
(2) The full JVM has a special opcode for loading the fourth local variable:
ILOAD_4. It is equivalent to ILOAD 4(load the fourth local onto the stack,
not the iload4 statement from the microcode). However, it is only 1 byte
long, with no index following it (in other words, the 4 isn't stored in the
machine code anywhere). How could this be implemented in Mic-1? Try to do
it in 5 or less instructions. You may not make any assumptions about the
op code for ILOAD_4.
-
Consider the following high level language code
-
(4) Translate it into IJVM symbolic instructions (like IADD, BIPUSH, etc).
All variables in main are local on the stack, you may assume that they were allocated
when main was called.
Use IRETURN to indicate when the main program terminates.
-
(2) Translate the IJVM into hex, byte code.
main {
int total = 0;
int count;
int answer;
for (count = 0; count < 10; count++) {
answer = calculate(count, 10);
if (answer > 0) {
total += answer;
}
}
return 0;
}
-
(1) The IJVM INVOKEVIRTUAL instruction needs to know how many local variables
it has. Why?
-
(2 points) Write the microcode for a WIDE BIPUSH instruction. Instead of pushing
a byte, it will push 2 bytes treated as a 16-bit word.