Skip to content
Official PYQ · 2005

GATE CS 2005 Q79 — Machine Instructions and Addressing Modes

Explain with AI

Consider the following data path of a CPU.\text{CPU}.

The ALU,\text{ALU}, the bus and all the registers in the data path are of identical size. All operations including incrementation of the PC\text{PC} and the GPRs\text{GPRs} are to be carried out in the ALU.\text{ALU}. Two clock cycles are needed for memory read operation – the first one for loading address in the MAR\text{MAR} and the next one for loading data from the memory bus into the MDR.\text{MDR}.

The instruction ‘‘add R0, R1”``\text{add R0, R1}” has the register transfer interpretation R0⇐R0 + R1.\text{R0} \Leftarrow \text{R0 + R1}. The minimum number of clock cycles needed for execution cycle of this instruction is:

Choose one option
View worked solution

Answer: B

To execute the instruction add R0, R1 (which performs R0⇐R0+R1R0 \Leftarrow R0 + R1) in a single-bus architecture, we must handle the limitation that only one value can be placed on the shared bus at any given time. The ALU requires two inputs simultaneously to perform an addition.

The execution cycle proceeds as follows:

  1. Cycle 1: Transfer the first operand from register R0R0 to the temporary register YY via the bus.
    Control signals: R0out,Yin\text{Control signals: } R0_{out}, Y_{in}
  2. Cycle 2: Place the second operand R1R1 on the bus, instruct the ALU to perform the addition (Y+busY + \text{bus}), and store the result in the temporary output register ZZ.
    Control signals: R1out,Add,Zin\text{Control signals: } R1_{out}, \text{Add}, Z_{in}
  3. Cycle 3: Transfer the result from register ZZ back to the destination register R0R0 via the bus.
    Control signals: Zout,R0in\text{Control signals: } Z_{out}, R0_{in}

Thus, a minimum of 3 clock cycles are required for the execution phase of this instruction.

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

Published
Report a correction
Keep exploringMore Machine Instructions and Addressing Modes questions