0
26kviews
Microinstructions to execute an instruction MOV [R1], R2.
1 Answer
0
1.8kviews

instruction MOV [R1], R2:

  • The MIR in the following figure shows the micro-instruction that performs "MOV R1, (R2)" - move data in R1 to memory location whose address is given in R2. The figure shows the steps/events/things that will happen in the datapath when this micro-instruction is executed: enter image description here

Again, study the bits in the MIR very carefully first. I will now guide you through the execution.... The datapath is going to do the same things again as the previous example. However, because values of the different controlling bits are different, different things will happen !

  • Phase 1: The "next" micro instruction is loaded into the MIR and the MIR sends out control signals immediately. The control signals that is important in phase 1 are the A and B fields, which select the registers 0001 (R1) and 0010 (R2)

  • Phase 2: A- and B-latches are updated and captures the values of R1 and R2 and keep these values for the remainder of the CPU cycle.

  • Phase 3: during phase 3, the ALU and Shifter gets time to do the computation - in this example, the ALU will output the first input (= R1) and the Shifter will not shift, so that the result R1 is produced on the C-bus Simultaneously, the MAR is updated with the value of the B-latch (= R2) because the MAR bit in the micro-instruction is 1 and allow the phase 3 clock to trigger update to the MAR.

  • Phase 4: in phase 4, the result on the C-bus (= R1) is written to the destination. The destination in this example is the MBR and not any register - you can tell this from the fact that the MBR bit of the micro-instruction is 1 (update MBR) and the ENC bit is 0 (do not update any register).

  • In summary: R1 is copied into MBR and R2 is copied into MAR.

Please log in to add an answer.