J-type

JALR (I-Format)
I'm sorry for putting JALR here. Actually JALR is I-type.

JALR rd, rs1, immReg[rd] <- PC + 4; PC <- Reg[rs1] + imm;
Write
PC + 4to Reg[rd] (return address)Sets PC = Reg[rs1] + offset
Don't need to multiply the immediate by 2.
Adding JALR to datapath
JALR to datapath
JAL

JAL rd, immReg[rd] <- PC + 4; PC <- PC + imm;
Write
PC + 4to Reg[rd] (return address)Sets PC = PC + offset
Adding JAL to datapath
JAL to datapathLast updated