Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

GATE | GATE CS 2021 | Set 2 | Question 63

  • Last Updated : 23 May, 2021

Consider a pipelined processor with 5 stages, Instruction Fetch(IF), Instruction Decode(ID), Execute (EX), Memory Access (MEM), and Write Back (WB). Each stage of the pipeline, except the EX stage, takes one cycle. Assume that the ID stage merely decodes the instruction and the register read is performed in the EX stage. The EX stage takes one cycle for ADD instruction and the register read is performed in the EX stage, The EX stage takes one cycle for ADD instruction and two cycles for MUL instruction. Ignore pipeline register latencies.

Consider the following sequence of 8 instructions:

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

ADD, MUL, ADD, MUL, ADD, MUL, ADD, MUL 

Assume that every MUL instruction is data-dependent on the ADD instruction just before it and every ADD instruction (except the first ADD) is data-dependent on the MUL instruction just before it. The speedup defined as follows.



Speedup = (Execution time without operand forwarding) / (Execution time with operand forwarding)

The Speedup achieved in executing the given instruction sequence on the pipelined processor (rounded to 2 decimal places) is _____________ .
(A) 1.875
(B) 1.5625
(C) 2
(D) 1.667


Answer: (A)

Explanation: The timing diagrams for the without operand forwarding and with operand forwarding are given
below:

Without operand forwarding :

Time taken without Operand Forwarding = 30

With Operand Forwarding :

Time taken with Operand Forwarding = 16

Therefore,

Speedup = 30 /16 = 1.875


Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :