MIPS Instruction Execution Steps


The same principles of pipelining can apply to MIPS processors where we pipeline instruction execution. MIPS instructions classically take five steps:
  1. Fetch instruction from memory.

  2. Read registers while decoding the instruction. The regular format of MIPS instructions allows reading and decoding to occur simultaneously.

  3. Execute the operation or calculate an address.

  4. Access an operand in data memory.

  5. Write the result into a register.
For example, the table shows the total time for each instruction calculated from the time for each component. This calculation assumes that the multiplexors, control unit, PC accesses, and sign extension unit have no delay.

Instruction class Instruction fetch Register read ALU operation Data access Register write Total time
Load word (lw) 200 ps 100 ps 200 ps 200 ps 100 ps 800 ps
Store word (sw) 200 ps 100 ps 200 ps 200 ps 700 ps
R-format (add, sub, AND, OR, slt) 200 ps 100 ps 200 ps 100 ps 600 ps
Branch (beq) 200 ps 100 ps 200 ps 500 ps

The operation times for the major functional units in this table are The discussion only focuses on eight instructions: load word (lw), store word (sw), add (add), subtract (sub), AND (and), OR (or), set less than (slt), and branch on equal (beq).




      “Before I can live with other folks I’ve got to live with myself.    
      The one thing that doesn’t abide by majority rule is a person’s conscience.”    
      ― Harper Lee, To Kill a Mockingbird