939 views
1 votes
1 votes

Consider the following sequence of instructions 

 

Add #20,R0,R1 

Mul #3,R2,R3 

And #$3A,R2,R4 

Add R0, R2, R5 

 

In all instructions, the destination operand is given last. Initially, registers R0 and R2 contain 2000 and 50, respectively. These instructions are executed in a computer that has a four-stage pipeline(Fetch, Decode, Execute and Write Back).  Assume that the first instruction is fetched in clock cycle 1, and that instruction fetch(other stages also) requires only one clock cycle. Number of cycles required to complete the given sequence of instructions are_____

1 Answer

Best answer
2 votes
2 votes
There is no WAW, RAW and WAR dependency in given sequence of instructions , hence there will be no stall due to data hazard .

So number of cycles required = number of stages (k) + number of instructions (n) -1

                                               = 4 + 4-1

                                               = 7
selected by

Related questions

1 votes
1 votes
1 answer
1
0 votes
0 votes
1 answer
2
LRU asked Oct 23, 2021
2,823 views
Suppose that we are considering an enhancement that runs 10 times faster than the original machine but is usable only 40% of the time. What is the overall speedup gained ...
1 votes
1 votes
1 answer
3