edited by
24,250 views
55 votes
55 votes

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

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

The instruction "call Rn, sub” is a two word instruction. Assuming that $\text{PC}$ is incremented during the fetch cycle of the first word of the instruction, its register transfer interpretation is

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

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

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

  1. $2$
  2. $3$
  3. $4$
  4. $5$
edited by

12 Answers

1 votes
1 votes
My interpretation:

call Rn - word1
Sub-  word2 (sub routine address)

After fetching word1 PC in incremented. So PC points to word 2. (already completed in fetch cycle)
We need to store the return address that means address of instruction after call. Means, We have to store PC+1 value.
Here we are storing it in Reg Rn.
Next, We need to jump to subroutine. So we are loading subroutine address (M[PC]) into PC.

No of execution cycles=3 (as told in this comments section.)
0 votes
0 votes

The answer will be 3.

Explanation :

Execution Cycle = (PC + 1(Compute), which needs 0 clock cycle, already calculated in Fetch cycle) + M[PC] (which needs 2 clock cycles) + WB (which needs 1 clock cycle, register write)

now for WB the operations are :

Rn←Res(PC+1)

PC←M[PC] 

both of these instructions can be done parellely since none of them are dependent.

reshown by
Answer:

Related questions

47 votes
47 votes
6 answers
9