======== START LECTURE #14 ========

Now we need the main control.

So 9 bits.

The following figure shows where these occur.

They all are determined by the opcode

The MIPS instruction set is fairly regular. Most fields we need are always in the same place in the instruction.

MemRead: Memory delivers the value stored at the specified addr
MemWrite: Memory stores the specified value at the specified addr
ALUSrc: Second ALU operand comes from (reg-file / sign-ext-immediate)
RegDst: Number of reg to write comes from the (rt / rd) field
RegWrite: Reg-file stores the specified value in the specified register
PCSrc: New PC is Old PC+4 / Branch target
MemtoReg: Value written in reg-file comes from (alu / mem)

We have seen the wiring before (and have a hardcopy to handout).

We are interested in four opcodes.

Do a stage play

The following figures illustrate the play.

We start with R-type instructions

Next we show lw

The following truth table shows the settings for the control lines for each opcode. This is drawn differently since the labels of what should be the columns are long (e.g. RegWrite) and it is easier to have long labels for rows.

SignalR-typelwswbeq
Op50110
Op40000
Op30010
Op20001
Op10110
Op00110
RegDst10XX
ALUSrc0110
MemtoReg01XX
RegWrite1100
MemRead0100
MemWrite0010
Branch0001
ALUOp11000
ALUOp0001

Now it is straightforward but tedious to get the logic equations

When drawn in pla style the circuit is