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.

**Remark**: Review answers for Midterm.

**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 ofdon't care

bits.

Some simplifications we can take advantage of.

opcode | ALUOp | operation | funct | ALU action | ALU cntl |
---|---|---|---|---|---|

LW | 00 | load word | xxxxxx | add | 0010 |

SW | 00 | store word | xxxxxx | add | 0010 |

BEQ | 01 | branch equal | xxxxxx | subtract | 0110 |

R-type | 10 | add | 100000 | add | 0010 |

R-type | 10 | subtract | 100010 | subtract | 0110 |

R-type | 10 | AND | 100100 | and | 0000 |

R-type | 10 | OR | 100101 | or | 0001 |

R-type | 10 | SLT | 101010 | set on less than | 0111 |

- We will not be doing NOR so
- We have only 8 MIPS instructions that use the ALU as shown in the table on the right.
- 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
- 01 = X1
- 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