Lecture-3-07.01.2025
Lecture-3-07.01.2025
DATAPATH-1
MIPS Instruction Encoding
Name Fields Comments
Field size 6 bits 5 bits 5 bits 5bits 5bits 6 bits All instruction =32 bit long
R Type op rs rt rd shamt funct Arithmetic instruction
I Type op rs rt Address/ immediate data Transfer, Branch, Imm
J Type op Target address Jump
◦ The only instructions that make use of this step are loads,
stores, and branches.
◦ The load and store instructions access the memory.
◦ The branch instruction updates PC depending upon the outcome of
the branch condition.
Load instruction: Branch instruction:
PC ← NPC; if (cond) PC ← ALUOut;
LMD ← Mem [ALUOut]; else PC ← NPC;
Store instruction:
PC ← NPC; Other instructions:
Mem [ALUOut] ← B; PC ← NPC;
WB: Register Write Back
◦ In this step, the result is written back into the register file.
◦ Result may come from the ALU.
◦ Result may come from the memory system (viz. a LOAD instruction).
◦ The position of the destination register in the instruction word depends on the
instruction → already known after decoding has been done.
Load Instruction:
Reg [rt] ← LMD;
Thank You