ALU Control Truth Table


The following table shows part of the ALU control truth table. There are 16 (24) different encodings for the ALUctl. The table only shows some of the encodings because the datapath introduced so far is only able to handle few instructions.

The input of the ALU control is the 6-bit opcode of an instruction or the 6-bit funct field of an R-type instruction. All R-type instructions use the opcode “000000” and the funct parameter contains the necessary control codes to differentiate the different instructions.


The output of an ALU control is a 4-bit encoding. Note that the 4-bit encoding here is different from the one in the textbook. Other binary encodings are also possible. The idea is to choose a binary encoding that will minimize the logic. Few comments about the table include:
Input Output 4-bit
Encoding
Op6 funct6 ALUctl
R-type add ADD 0000
R-type sub SUB 0010
R-type and AND 0100
R-type or OR 0101
R-type xor XOR 0110
R-type slt SLT 1010
addi x ADD 0000
slti x SLT 1010
andi x AND 0100
ori x OR 0101
xori x XOR 0110
lw x ADD 0000
sw x ADD 0000
beq x SUB 0010
bne x SUB 0010
j x x x



      Q: What did the mother ghost say to the baby ghost?    
      A: “Don’t spook until you’re spooken to!”