retagged by
3,130 views
5 votes
5 votes
I have a doubt regarding the implementation of BSA instruction.

I read that BSA instruction can be implemented as :-

T4:-    m[AR] <-- PC;   AR<--AR+1

T5:-    PC<--AR; SC<--0

Here T4 and T5 are 4th and 5th clock cycles respectively. AR is address register and SC is sequence counter.

My doubt is how can both m[AR]<--PC and AR<--AR+1 execute together at one clock cycle (T4) ? . Incrementing AR can happen before and that can cause changes to the position where PC is written. So they should happen at different clock cycles right so that they can execute in proper order?
retagged by

3 Answers

1 votes
1 votes

m[AR] <-- PC - This is a memory write operation, and its not positive edge triggered.   ie, it could be performed at any time. The time required to execute it will depend on the memory write time, and it will be less than 1 clock cycle. So it will get finished before that clock cycle(T4).

AR<--AR+1 - This is an increment operation in AR register, and all register operations (load, increment etc) are positive edge triggered. So, it will get executed only at the end of that clock cycle (T4)

As a result both could be done in T4 itself without any problem

0 votes
0 votes

since all micro operations are +ve edge triggered, at the beginning of 4th clock cycle addr from AR is given to memory , READ control signal of memory and INR control signal of AR gets active. But the actual increment takes place at next clock transition.

0 votes
0 votes
After T3 we have realized that it is Memory Reference and at T2 PC = PC + 1;
At T4 that is BSA has been executed and AR register contain the memory location just above the subroutine.

so m[AR] <-- PC; you saving the return address to the memory. (which is the PC of T2 state).
and then incrementing the AR = AR + 1 ( because to fetch the memory you need AR ) as you move next consecutive memory location to execute the subroutine by setting PC = AR in the T5.

Hope this help.

Related questions

0 votes
0 votes
1 answer
3
Na462 asked Nov 7, 2018
556 views
0 votes
0 votes
1 answer
4
srestha asked Jun 10, 2018
499 views
What is meaning of offset in Branch instruction? Is this offset same as conditional instruction offset?What is meaning of offset in virtual address? Where is actual diffe...