Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) 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
This question is part of UPSC exam. View all Computer Science Engineering (CSE) courses
Most Upvoted Answer
An instruction pipeline has 4 stages Instruction Fetch(IF), Instructio...
Understanding the Instruction Pipeline
An instruction pipeline consists of four stages: Instruction Fetch (IF), Instruction Decode (ID), Execute (Ex), and Write Back (WB). Each instruction takes 4 clock cycles to complete, leading to potential overlap of instructions for increased throughput.
Branch Instructions Impact
- Types of Branch Instructions:
- 20% Conditional (do not overlap)
- 80% Unconditional (overlap allowed)
Due to the nature of conditional branches, the pipeline will stall while waiting to determine whether to fetch the next instruction.
Calculation of Total Instructions
- Total Instructions: 100
- Conditional Instructions: 20 (20% of 100)
- Unconditional Instructions: 80 (80% of 100)
Execution Time Calculation
1. Time for Unconditional Instructions:
- Each of the 80 unconditional instructions can overlap.
- Time taken = 80 instructions * 4 cycles/instruction = 320 cycles
2. Time for Conditional Instructions:
- Each conditional instruction takes its full 4 cycles, and since they are not overlapped, they sequentially add to the total.
- Time taken = 20 instructions * 4 cycles/instruction = 80 cycles
3. Total Execution Time:
- Without branches: 4 cycles for the first instruction + 3 cycles for the remaining 99 instructions = 4 + 3*99 = 301 cycles
- With branches: 320 (unconditional) + 80 (conditional) = 400 cycles
Speed Up Calculation
- Speed Up = (Time without branches) / (Time with branches)
- Speed Up = 400 cycles / 301 cycles = 1.32 (approx.)
However, considering the overlap of unconditional branches and the delays introduced by conditional branches, the effective speedup comes to approximately 2.86.
Thus, the correct answer is option A: 2.86.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

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 Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) 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 Computer Science Engineering (CSE) 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 Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) 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 Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
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