Computer Architecture

Start Lecture #17



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
ALUOp00001

If drawn the normal way the table would look like this.

Op5Op4Op3Op2Op1Op0 RegDstALUSrcMemtoRegRegWriteMemReadMemWrite BranchALUOp1ALUOp0


000000 100100010
100011 011110000
101011 X1X001000
000100 X0X000101

control

Now it is straightforward to get the logic equations. The circuit, drawn in PLA style (2-levels of logic) is shown on the right.

Homework: In a previous homework, you modified the datapath to support addi and a variant of lw. Determine the control needed for these instructions.
5.15, 5.16

Homework (part of 5.13): Can we eliminate MemtoReg and use MemRead instead?

Homework: Can any other control signals be eliminated?

Implementing a J-type instruction, unconditional jump

Recall the jump instruction.

    opcode  addr
    31-26   25-0
  

Addr is a word address; the bottom 2 bits of the PC are always 0; and the top 4 bits of the PC are unchanged (AFTER incrementing by 4).

This is quite easy to add and smells like a good final exam question.

What's Wrong

Some instructions are likely slower than others and we must set the clock cycle time long enough for the slowest. The disparity between the cycle times needed for different instructions is quite significant when one considers implementing more difficult instructions, like divide and floating point ops. Actually, if we considered cache misses, which result in references to external DRAM, the cycle time ratios exceed 100.

Possible solutions

Even Faster (we are not covering this).