MIPS Datapath

The datapath consists of all units that hold or operate on data within a processor. In MIPS the datapath includes the register file, the ALU, and memory. While there is only one memory, MIPS has separate caches for data and instructions, and they are part of the datapath.

We are going to look at the three types of MIPS instructions and see what the datapath looks like. The instructions are:

All instructions include the following steps:

  1. send the PC to memory and fetch the instruction
  2. read one or two registers, specified by Rs and Rt in the instruction; some read one register, some read two

After these steps, each of the types above are handled differently.

We are going to look at the hardware components used for each of these, and then see how they fit together.

The Register File

 

register file

Instruction Fetch

 

datapath for instruction fetch

Executing R-type Instructions

 

datapath for r-type

The format of an R-type instruction is op Rd, Rs, Rt, such as or $t2, $t4, $t5.

Executing Load and Store Instructions

 

datapath for load/store

The format of a load/store instruction is op Rt, offset(Rs), such as lw $t2, 8($t5).

Executing Branch Instructions

 

datapath for load/store

The format of a branch instruction is op Rs, Rt, label, such as beq $t2, $t4, loop. Recall that the label is translated into an offset which specifies the number of statements between the branch and the branch target.

A Single Datapath

These separate paths are combined into one single datapath that handles all instructions, and also includes the instruction fetch. To combine them we need to add some multiplexers. Recall that a multiplexer is a circuit that has multiple data inputs and one output. It uses control inputs to choose which data input will be the output. It can be thought of as a selector, choosing one of a set of inputs. There are a few places where we need multiplexers in our datapath:

 

MIPS datapath


The images in this handout are taken from "Computer Organization and Design" by Patterson and Hennessy.



Email Me | Office Hours | My Home Page | Department Home | MCC Home Page