Practice
Questions for the multicycle implementation:
Andreas Moshovos
Spring 2007
Explain whether and
how the datapath and the control need to change to support the following
instructions:
1. Implement
a load indirect (LDIND) instruction. Use opcode 0001 and fields R1 and R2
similar to the existing LOAD. LDIND R1 ((R2)) does the following:
R1
= MEM[MEM[R2]]
PC
= PC + 1
2.
Implement a “Jump and Link” (JAL) instruction. JAL takes a single argument
which is a 4-bit signed immediate. Its format is similar to the branch
instructions. JAL uses the 1110 opcode.
It’s function is:
K1
= PC + 1
PC
= PC + 1 + Sign-Extended(Imm4)