Controlling ALU Instructions


This slide shows how the datapath controlling the R- and I- type ALU instruction execution. The R-type instruction format and example are listed again as follows:

   add  $t1, $t2, $t3
   # $t1 = $t2 + $t3
   #  rd =  rs +  rt

The following figure shows how to control R-type ALU instructions. The active part of datapath is shown in green.

For R-type ALU instructions, RegDst is ‘1’ to select rd on RW and ALUSrc is ‘0’ to select BusB as the second ALU input.

The I-type instruction format and example are listed again as follows:

   addi  $10, $8, 9
   # $10 = $8 + 9
   #  rt = rs + imm16

The following figure shows how to control I-type ALU instructions.

For I-type ALU instructions, RegDst is ‘0’ to select rt on RW and ALUSrc is ‘1’ to select extended immediate as the second ALU input.




      “There is a wisdom of the head, and... there is a wisdom of the heart.”    
      ― Charles Dickens, Hard Times