Skip to content
Official PYQ · 2001

GATE CS 2001 Q2.13 — ALU, Data-path and Control Unit

Explain with AI

Consider the following data path of a simple non-pipelined CPU. The registers A,BA, B, A1,A2,MDR,A_{1},A_{2}, \textsf{MDR}, the bus\textsf{bus} and the ALU\textsf{ALU} are 88-bitbit wide. SP\textsf{SP} and MAR\textsf{MAR} are 1616-bitbit registers. The MUX\textsf{MUX} is of size 8×(2:1)8 \times (2:1) and the DEMUX\textsf{DEMUX} is of size 8×(1:2)8 \times (1:2). Each memory operation takes 22 CPU\textsf{CPU} clock cycles and uses MAR\textsf{MAR} (Memory Address Register) and MDR\textsf{MDR} (Memory Date Register). SP\textsf{SP} can be decremented locally.

The CPU\textsf{CPU} instruction "push r" where, r=r = AA or BB has the specification

  • M[SP]←rM[SP] ← r
  • SP←SP−1SP ← SP - 1

How many CPU\textsf{CPU} clock cycles are required to execute the "push r" instruction?

Choose one option
View worked solution

Answer: D

To execute the push r instruction, we need to perform the memory write operation M[SP]←rM[SP] \leftarrow r and decrement the stack pointer SP←SP−1SP \leftarrow SP - 1. The clock cycle distribution is as follows:

  1. Transferring SPSP to MARMAR (2 cycles): Since SPSP and MARMAR are 16-bit registers but the CPU data bus is only 8-bit wide, the transfer must occur in two 8-bit steps:
    • Cycle 1: MARH←SPHMAR_H \leftarrow SP_H
    • Cycle 2: MARL←SPLMAR_L \leftarrow SP_L
  2. Transferring data to MDRMDR (1 cycle):
    • Cycle 3: MDR←rMDR \leftarrow r (since rr and MDRMDR are 8-bit wide, this takes 1 cycle via the 8-bit bus).
  3. Memory Write & SP Decrement (2 cycles):
    • Cycles 4 and 5: The memory write operation M[MAR]←MDRM[MAR] \leftarrow MDR takes 2 CPU clock cycles.
    • In parallel, the local decrement SP←SP−1SP \leftarrow SP - 1 is performed locally, requiring 0 additional cycles.

Therefore, the total number of CPU clock cycles required is 2+1+2=52 + 1 + 2 = 5 cycles.

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

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