# Computer Architecture

Start Lecture #15

Remark: Typo in lecture #13. There are four (not three) ALU control lines; we will use only three since we are not doing NOR.

##### Controlling the ALU Given the Summary

Remark: This material is (in the 3e) in Appendix C, section C.2.

How many entries do we have now in the truth table?

• Instead of a 6-bit opcode we have a 2-bit summary.
• We still have a 6-bit function (funct) field (needed for R-type).
• So now we have 8 inputs (2+6) and 4 outputs.
• 256 rows, 12 columns; 3K entries.
• Certainly easy for automation ... but we will be clever.
Specifically, we will make great use of don't care bits.

Some simplifications we can take advantage of.
opcodeALUOpoperationfunctALU actionALU cntl
BEQ01branch equalxxxxxxsubtract0110
R-type10subtract100010subtract0110
R-type10AND100100and0000
R-type10OR100101or0001
R-type10SLT101010set on less than0111

• We will not be doing NOR so
1. We have only 8 MIPS instructions that use the ALU as shown in the table on the right.
2. The left bit of ALU cntl (Anegate) is not used
• The first two rows of the table above are the same. We only need one.
• When funct is used, its two HOBs are 10 so are don't care inputs.
• ALUOp=11 impossible and hence
1. 01 = X1
2. 10 = 1X

Applying these simplifications yields

```    ALUOp | Funct        ||  Bnegate:OP
1 0   | 5 4 3 2 1 0  ||  B OP
------+--------------++------------
0 0   | x x x x x x  ||  0 10
x 1   | x x x x x x  ||  1 10
1 x   | x x 0 0 0 0  ||  0 10
1 x   | x x 0 0 1 0  ||  1 10
1 x   | x x 0 1 0 0  ||  0 00
1 x   | x x 0 1 0 1  ||  0 01
1 x   | x x 1 0 1 0  ||  1 11
```