GATE Exam  >  GATE Questions  >  An instruction pipeline has 4 stages Instruct... Start Learning for Free
An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.
  • a)
    2.86
  • b)
    3.21
  • c)
    1.65
  • d)
    2.57
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
An instruction pipeline has 4 stages Instruction Fetch(IF), Instructio...
Suppose each stage takes 1 s. 20 conditional – 20*3 s (Cycles per instruction for conditional instructions is 3 as branch is known at the third stage) 80 unconditional – 80 s (Cycles per instruction for unconditional is 1) So total time taken with pipeline = 20*3 + 80 = 140 s Time taken without pipeline = 4 * 100 (Cycle per instruction for all is 4) Speed up = 400 / 140 = 2.86
View all questions of this test
Most Upvoted Answer
An instruction pipeline has 4 stages Instruction Fetch(IF), Instructio...
Given Information:
- An instruction pipeline has 4 stages: Instruction Fetch (IF), Instruction Decode (ID), Execute instruction (Ex), Write Back (WB).
- All instructions take 4 clock cycles to complete all stages.
- Branch instructions are not overlapped, meaning the instructions after a branch are not fetched until the branch is known.
- The branch is known in the execute phase.
- 20% of the instructions are conditional and 80% are unconditional.
- We need to calculate the speedup for 100 instructions.

Explanation:
To calculate the speedup, we need to compare the execution time with and without the pipeline.

Execution Time without Pipeline:
Without the pipeline, each instruction would take 4 clock cycles to complete. Since there are 100 instructions, the total execution time would be 4 * 100 = 400 clock cycles.

Execution Time with Pipeline:
With the pipeline, each instruction can overlap with the next instruction, except for branch instructions. Since 80% of the instructions are unconditional, they can be overlapped.

For the remaining 20% of conditional branch instructions, the instructions after the branch cannot be fetched until the branch is known in the execute phase. This introduces a delay in the pipeline.

The total number of branches in 100 instructions would be 20% of 100 = 20 branches.

Calculating the Delay:
The branch instructions introduce a delay of 3 clock cycles because the branch is known in the execute phase, and each instruction takes 4 clock cycles. Therefore, the total delay caused by branch instructions would be 20 * 3 = 60 clock cycles.

Calculating the Execution Time:
For the 80% of unconditional instructions, each instruction takes 4 clock cycles and can be overlapped. So, the number of clock cycles required for 80 instructions would be 80 * 4 = 320 clock cycles.

Adding the delay caused by branch instructions, we get a total of 320 + 60 = 380 clock cycles.

Calculating the Speedup:
The speedup is calculated by dividing the execution time without the pipeline by the execution time with the pipeline.

Speedup = Execution Time without Pipeline / Execution Time with Pipeline

Speedup = 400 / 380 = 1.0526 (rounded to 2 decimal places) ≈ 2.86

Conclusion:
Therefore, the speedup for 100 instructions in the given instruction pipeline is approximately 2.86.
Explore Courses for GATE exam

Similar GATE Doubts

An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer?
Question Description
An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer?.
Solutions for An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer?, a detailed solution for An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer? has been provided alongside types of An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice An instruction pipeline has 4 stages Instruction Fetch(IF), Instruction Decode(ID), Execute instruction (Ex), Write Back(WB). All instructions take all stages and takes 4 clock cycles. Branch instructions are not overlapped, i.e. the instructions after the branch are not fetched till branch is known. Branch is known in the execute phase. Suppose 20 % instructions are conditional and 80 % unconditional. Calculate speed up for 100 instructions (upto 2 decimal place). Ignore the case that the branch may not be taken.a)2.86b)3.21c)1.65d)2.57Correct answer is option 'A'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev