Skip to content
Official PYQ · 2005

GATE CS 2005 Q80 — ALU, Data-path and Control Unit

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 "call Rn, sub” is a two word instruction. Assuming that PC\text{PC} is incremented during the fetch cycle of the first word of the instruction, its register transfer interpretation is

Rn←PC+1\text{Rn} \leftarrow \text{PC} + 1;

PC←M[PC]\text{PC} \leftarrow \text{M[PC]};

The minimum number of CPU clock cycles needed during the execution cycle of this instruction is:

Choose one option
View worked solution

Answer: B

At the start of the execution cycle, the first word of the instruction has already been fetched, and the PC\text{PC} has been incremented to point to the second word (which contains the address sub).

To execute the instruction, we need to perform two operations:

  1. Rn←PC+1\text{Rn} \leftarrow \text{PC} + 1
  2. PC←M[PC]\text{PC} \leftarrow \text{M[PC]}

This can be achieved in the minimum number of clock cycles as follows:

  • Cycle 1: Load the address of the second word into the MAR\text{MAR} to initiate the memory read.
    MAR←PC\text{MAR} \leftarrow \text{PC} (This uses the internal CPU bus to transfer the value of PC\text{PC} to MAR\text{MAR}. Memory read starts.)
  • Cycle 2: Complete the memory read and simultaneously perform the register increment.
    MDR←M[MAR]andRn←PC+1\text{MDR} \leftarrow \text{M[MAR]}\quad \text{and} \quad \text{Rn} \leftarrow \text{PC} + 1 (The memory read uses the external memory bus to load MDR\text{MDR}. Since the internal CPU bus is free, PC\text{PC} is placed on it, incremented by the ALU\text{ALU}, and the result is stored in Rn\text{Rn}.)
  • Cycle 3: Update the PC\text{PC} with the target address loaded into MDR\text{MDR}.
    PC←MDR\text{PC} \leftarrow \text{MDR} (This transfers the target address from MDR\text{MDR} to PC\text{PC} via the internal CPU bus.)

Thus, the minimum number of CPU clock cycles needed during the execution cycle is 3.

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

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