Skip to main content

GATE CSE 2020CO & Architecture › Control Unit & MicroprogrammingVerified

GATE CSE 2020 PYQ: Consider the following data path diagram. Consider an instruction: R 0 ← R 1 + R 2 R0 \leftarrow R1 +R2 R 0…

Consider the following data path diagram.                  

GATE CSE 2020 Control Unit & Microprogramming diagram: Consider the following data path diagram. Consider an instru

Consider an instruction: R0←R1+R2R0 \leftarrow R1 +R2. The following steps are used to execute it over the given data path. Assume that PC is incremented appropriately. The subscripts rr and ww indicate read and write operations, respectively.

  1. R2r, TEMP1r,ALUadd, TEMP2wR2_{r},\text{ TEMP1}_{r},ALU_{\text{add}}, \text{ TEMP2}_{w}
  2. R1r, TEMP1wR1_{r},\text{ TEMP1}_{w}
  3. PCr, MARw, MEMrPC_{r}, \text{ MAR}_{w}, \text{ MEM}_{r}
  4.  TEMP2r, R0w\text{ TEMP2}_{r}, \text{ R0}_{w}
  5.  MDRr, IRw\text{ MDR}_{r}, \text{ IR}_{w}

Which one of the following is the correct order of execution of the above steps?

  1. A
    2,1,4,5,3
  2. B
    1,2,4,3,5
  3. C
    3,5,2,1,4
    Correct answer
  4. D
    3,5,1,2,4

Answer

(C) 3 , 5 , 2 , 1 , 4 3,5,2,1,4 3 , 5 , 2 , 1 , 4

Approach

Separate the micro-operations into (i) the mandatory instruction-fetch phase and (ii) the execution phase, then order the execution steps by the data-dependence chain TEMP1 and TEMP2 impose. Fetch must precede execution, and within execution a register must be written before it can be read.

Instruction fetch (PC -> MAR -> memory, then MDR -> IR) must come first, giving steps 3 then 5. In the execution phase, R1 must be latched into TEMP1 (2) before the ALU can use it together with R2 to produce TEMP2 (1), and the final result is moved TEMP2 -> R0 (4). Hence 3, 5, 2, 1, 4, which is option C.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.