• edited by
39,649 views
78 78 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$

15 Answers

Best answer
132 132 votes
  • $\text{MAR} \leftarrow  \text{PC}\qquad \to1$ cycle
  • $S \leftarrow \text{PC}$ (Since these two actions are independent they can be done in same cycle)
  • $\text{MDR} \leftarrow \text{M[MAR]}\qquad \to 2^{nd}$ cycle (System BUS)
  • $\text{Rn} \leftarrow S +1$ $(\text{ALU}$ Is free and the two actions are independent.) (Internal BUS)
  • $\text{PC} \leftarrow \text{MDR}\qquad \to 3$rd cycle

Therefore $3$ cycles needed.

A rough sketch:

Correct Answer: B

• edited by
11 11 votes

Rn <= Pc+1

Pc<= M[Pc]

The sequence of instruction take place 

 

I Cycle : PC out  , Sin , MARin (MAR can be loaded with PCout

II Cycle: S out  , ALUincrement  , Rn in

III Cycle: MDRout  ,   PCin  (MDRout can be performed once MARin has been performed)   therefore 3 cycle required

 
6 6 votes

$T_0$ : $ MAR \leftarrow$ PC (via system bus)since MAR connected through System bus  

          $ S \leftarrow PC$ ( via internal nus)

$T_1$ : $ MDR \leftarrow M[MAR]$ {  Operation on system bus (address bus)}

$\\ R_N  \leftarrow S+1  \text{  Operation on internal bus }$  {can also be done with 3rd cycle}

$T_2$ : $PC \leftarrow MDR$ ( via system bus)

Note: MAR and MDR are Connected through System bus cannot done in One Cycle.

6 6 votes

Hi Guys,

Although many people have provided correct answer but It seems people want to see complete picture so just adding this answer.

So Answer is B part.

In above explanation $S$ is a temporary ALU register. Notice data to and from memory comes and goes via MDR that too via separate BUS.

If provided information is not correct then please notify.

5 5 votes

1)PCout ,MARin,Rin

2)MDRout ,PCin

2 cycles to read

so total 3  cycles

• edited by
5 5 votes

In this question PC and GPR are carried out in the ALU.

So, PC and GPR performing write operation.

"call Rn, sub” - here subroutine call is performing , which is a memory read operation

And each memory read operation takes 2 clock cycle.

Then operation is performed in ALU.

$1)PC_{out},MAR_{in},Read,IncPC$

$2)WMFC$

$3)R_{2out},R_{3out},SelectA,SUB,R_{1in},END$

First two are FETCH cycle and 3rd one executing SUB instruction,i.e. EXECUTE cycle

Total 3 clock cycle

• edited by
Answer:
Position:
Show:

Related questions

67 67 votes
7 answers 7 answers
39.5k
39.5k views
Kathleen asked Sep 22, 2014
39,538 views
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 increm...
197 197 votes
9 answers 9 answers
78.1k
78.1k views
Kathleen asked Sep 22, 2014
78,050 views
A $5$ stage pipelined CPU has the following sequence of stages:IF – instruction fetch from instruction memoryRD – Instruction decode and register readEX – Execute: ALU op...
71 71 votes
11 answers 11 answers
33.7k
33.7k views
Kathleen asked Sep 14, 2014
33,660 views
Consider the following data path of a simple non-pipelined CPU. The registers $A, B$, $A_{1},A_{2}, \textsf{MDR},$ the $\textsf{bus}$ and the $\textsf{ALU}$ are $8$-$bit$...
32 32 votes
3 answers 3 answers
15.4k
15.4k views
gatecse asked Sep 21, 2014
15,378 views
Let $f(x)$ be the continuous probability density function of a random variable $x$, the probability that $a < x \leq b$, is :$f(b-a)$$f(b) - f(a)$$\int\limits_a^b f(x) dx...