Skip to content
Official PYQ · 2020

GATE CS 2020 Q4 — ALU, Data-path and Control Unit

Explain with AI

Consider the following data path diagram.                  

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?

Choose one option
View worked solution

Answer: C

To execute the instruction R0←R1+R2R0 \leftarrow R1 + R2, the processor must perform the instruction cycle phases in the following sequence:

  1. Instruction Fetch (IF):
    • First, the address in the Program Counter (PCPC) is transferred to the Memory Address Register (MARMAR), and a memory read operation is initiated:
      Step 3: PCr, MARw, MEMrPC_{r}, \text{ MAR}_{w}, \text{ MEM}_{r}
    • Once the instruction is fetched from memory into the Memory Data Register (MDRMDR), it is loaded into the Instruction Register (IRIR):
      Step 5:  MDRr, IRw\text{ MDR}_{r}, \text{ IR}_{w}
  2. Instruction Decode & Execution:
    • In a standard single-bus data path, the ALU cannot receive two operands directly from the bus simultaneously. Thus, one operand (R1R1) is first read and stored in a temporary register (TEMP1\text{TEMP1}):
      Step 2: R1r, TEMP1wR1_{r}, \text{ TEMP1}_{w}
    • Next, the second operand (R2R2) is placed on the bus, the value in TEMP1\text{TEMP1} is read, both are added by the ALU, and the result is stored in TEMP2\text{TEMP2}:
      Step 1: R2r, TEMP1r,ALUadd, TEMP2wR2_{r}, \text{ TEMP1}_{r}, ALU_{\text{add}}, \text{ TEMP2}_{w}
    • Finally, the result stored in TEMP2\text{TEMP2} is written back to the destination register R0R0:
      Step 4:  TEMP2r, R0w\text{ TEMP2}_{r}, \text{ R0}_{w}

Combining these steps in order gives: 3→5→2→1→43 \rightarrow 5 \rightarrow 2 \rightarrow 1 \rightarrow 4.

Therefore, the correct option is C.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore ALU, Data-path and Control Unit questions