First time here? Checkout the FAQ!
+9 votes

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

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

Rn <= PC + 1;

PC <= 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
asked in CO & Architecture by Veteran (87.3k points)   | 1.5k views
What is S and T here?
Can u explain how 3 cycles??

Before looking at explanation first think --->

  • First check given architecture carefully.(means check various component and their functionality )
  • What are all micro-instruction required.
  • How many of them could be done in parallel. 

I think keeping these things in mind proper answer could be obtained.

6 Answers

+18 votes
Best answer

$MAR$ $\leftarrow $ $PC$ ..... $1$ cycle
$S$ $\leftarrow $ $PC$ (Since these two actions are independent they can be done in same cycle)
$MDR$ $\leftarrow $ $M[MAR]$ ..... $2$nd cycle (System BUS)
$RN$ $\leftarrow $ $S +1$     (ALU Is free and the two actions are independent.) (Internal BUS)
$PC$ $\leftarrow $ $MDR$ ----- $3$rd cycle

Therefore $3$ cycles needed.

A rough sketch:

answered by Boss (7.1k points)  
selected by
In the second cycle S + 1 will be calculated but the result of increment can't be stored in the RN in the same cycle along with MDR <- M[MAR] as this will bring two different data on the bus in the same clock cycle.
can someone elaborate?? i am unable to understand this concept.
Even I think so. So it should be 4 cycles. I m unable to understand 3 cycles as answer
@sushmita, Why 4 cycles ?

Tell me what will happen if i enable $\text{PC}_{out} \text{, MAR}_{in} \text{, and S}_{in}$ ?

Enabling  $\text{PC}_{out}$ means content of  $\text{PC}$ is available on Dta Bus, now at the same time if i enable $\text{ MAR}_{in} \text{, and S}_{in}$ that means content of $PC$ will be loaded into  $\text{MAR}$ and  $\text{S}$.

Yes we can load PC value (or any register value) to many registers in ONE cycle.

$T_0$ : $ MAR \leftarrow PC \\ S \leftarrow PC$

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

\\ R_N  \leftarrow S+1  \text{  Operation on internal bus }$

$T_2$ : $PC \leftarrow MDR$
Thanx sachin. That was my doubt. i was confused about the 2 buses.
how to  know whether the question assumes different buses?
Welcome :)
Question does not assume anything, it is ALWAYS the case that system bus and internal buse needed everywhere.
System Bus: To let interact the CPU with external components. eg- Memory, I/O.
Internal Bus: To let interact the CPU with internal components. eg- Register file, ALU.
When do we load 1 in to temporary register to add it with PC?will it not take any extra cycle ,loading an immediate data?Or we are assuming it is already loaded ?

It is mentioned that  increment operation ALU is used ,but still we need to load 1 into T,when are we loading that 1 into T ?As T is connected to bus so it must come via bus.

Please someone clear this doubt
+3 votes

1)PCout ,MARin,Rin

2)MDRout ,PCin

2 cycles to read

so total 3  cycles

answered by Veteran (32.4k points)  
edited by
can you explain your answer i am not able to understand any of the answers.
+3 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

answered by Veteran (15.2k points)  
why we need to store PC value in MAR and Sin??and can we transfer PC content to Sin and MAR in same clock cycle?

Obviously we can store in same clock because once the content of PC is on bus both the registers MAR and S can activate their load input to take the data on the bus.
+2 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.

Next operation will be

Rn <= PC + 1;

PC <= M[PC];

i.e. PC is incremented which requires no clock cycle.

Next PC value will be that memory location and according to the question it is a write operation. It is the 3rd step of Fetch cycle. So, it requires 1 clock cycle.

Total 3 clock cycle



answered by Veteran (58.5k points)  
No. Here we have an indirect memory access M[PC]. So, PC content must be moved to MAR and then memory read needs to be done and read content moved to PC. See the answer by Pooja, other stuffs like also happen but these are the important ones to get answer here.
In this question us memory bus separate from the data bus shown in the diagram?
@Arjun Sir

Pc increment is done by Add instruction or is it other instruction which increments PC by 1.If it is a add instruction then we need to load data into  i.e 1 in T register also.And if it is INC instruction then it always increment by one.But word length can be more than one?I understand that ALU will not consume any extra cycle but the way we have loaded PC into S register,the same way why havent we loaded 1 into T register?
@Arjun sir what does this line means PC is incremented during the fetch cycle of the first word of the instruction..? And why aren't we considering for second word of this instruction in our execution cycle..?I am bit confused please clear the question to me..thanks in advance sir
+1 vote
1 cycle: Pc out->S in, MAR in,

2 cycle: S out => ALU increment

3 cycle:  MBR out => Pc in

so it must be 3 cycle
answered by Boss (9.3k points)  
+1 vote

$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.

answered by Veteran (49.3k points)  
When doe we load 1 in to register for adding it to PC.As they have said ALU will do increment so ALU will take data from S and T register,when will we load 1 into T?

Related questions

Top Users Sep 2017
  1. Habibkhan

    7166 Points

  2. Warrior

    2640 Points

  3. Arjun

    2574 Points

  4. rishu_darkshadow

    2520 Points

  5. A_i_$_h

    2280 Points

  6. nikunj

    1980 Points

  7. manu00x

    1846 Points

  8. makhdoom ghaya

    1770 Points

  9. Bikram

    1744 Points

  10. SiddharthMahapatra

    1718 Points

26,144 questions
33,727 answers
31,116 users