You are on page 1of 6

Lab 6: MIPS Implementation II

In this lab we will enhance the ALU Control we started in the first task, introduce the Main
Control Unit and create a simple ALU.

We can generate the 4-bit ALU control input using a small control unit that has as inputs the
function field of the instruction and a 2-bit control field, which we call ALUOp. ALUOp indicates
whether the operation to be performed should be add (00) for loads and stores, subtract (01)
for beq, or determined by the operation encoded in the funct field (10). The output of the ALU
control unit is a 4-bit signal that directly controls the ALU by generating one of the 4-bit
combinations shown previously.
Some points to note regarding the 3-instruction formats discussed earlier (R,J,I-type)
instructions:
The main signals and their impact on the cpu function:
This figure shows a simple MIPS implementation that contains each of the main units, including the
Main Control Unit, and the ALU Control, which are the targets of our last task.

The truth table for the main control unit outputs (Signals and ALUOp):
Example (R-Type instructions datapath):
Lab Task:
Your task is to create the Main Control Unit of the cpu, and the ALU Control and a simple ALU
that suffices for the following instructions: ADDU, AND, OR, BEQ, LW, SW
Do as shown in the lab in Logisim.
Main Control Unit:

 Inputs: Inst. Opcode.


 Outputs: Signals RegWrite, MemRead, MemWrite, MemToReg, ALUOp0, ALUOp1,
ALUSrc, RegDst, Branch.
ALU Control Unit:

 Inputs: Inst. Funct. Field, ALUOp0, ALUOp1.


 Outputs: 4-bit ALU Control.

ALU: (Add, Subtract, And, Or, Nor)

 Inputs: Two 32-bit values, ALU Control.


 Output: The specified operation by ALUOp.

You might also like