Using this diagram, I am looking at this instruction to determine what control lines are necessary.
ld x5, 40(x9)
x5 = 0x000000ff
x9 = 0x00000fff
I am curious what control lines (RegWrite, MemRead, MemWrite, MemtoReg, Branch, Zero, ALUSrc) are asserted or set to 1 in order for this instruction to run, and why I understand the parts of the load double instruction to be ld RT, Disp(RA) - but what is required for execution and why? Thank you - resources on these things (that make sense to me) are extremely limited on the internet.
Its a LOAD
instruction in which the memory address to be read is calculated by adding 40
to the contents of the register x9
, the result is then stored in register x5
.
RegDst
and RegWrite
40
to the contents of x5
. Set ALUSrc
to 1 to select 40
as one of the source.MemRead
as its a memory read. Also set MemtoReg
to 1 so that mux will get the data from Memory rather than ALU.