Consider the following data path of a simple non-pipelined CPU. The registers , the and the are - wide. and are - registers. The is of size and the is of size . Each memory operation takes clock cycles and uses (Memory Address Register) and (Memory Date Register). can be decremented locally.

The instruction "push r" where, or has the specification
How many clock cycles are required to execute the "push r" instruction?
View worked solution
Answer: D
To execute the push r instruction, we need to perform the memory write operation and decrement the stack pointer . The clock cycle distribution is as follows:
- Transferring to (2 cycles): Since and 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:
- Cycle 2:
- Transferring data to (1 cycle):
- Cycle 3: (since and are 8-bit wide, this takes 1 cycle via the 8-bit bus).
- Memory Write & SP Decrement (2 cycles):
- Cycles 4 and 5: The memory write operation takes 2 CPU clock cycles.
- In parallel, the local decrement is performed locally, requiring 0 additional cycles.
Therefore, the total number of CPU clock cycles required is cycles.
Free practice · Your answers on this page are not saved.
