Pipeline Processor · Computer Organization and Architecture
53 questions · asked in 25 of 27 years (2000–2026)
MCQ 29 · MSQ 2 · NAT 221-mark 23 · 2-mark 30
2000Questions per year2026
Questions 11–15 of 53
A processor operating at 2 GHz has a standard 5-stage RISC instruction pipeline having a base CPI (cycles per instruction) of one without any pipeline hazards. For a given program P that has 30% branch instructions, control hazards incur 2 cycles stall for every branch. A new version of the processor operating at same clock frequency has an additional branch predictor unit (BPU) that completely eliminates stalls for correctly predicted branches. There is neither any savings nor any additional stalls for wrong predictions. There are no structural hazards and data hazards for and . If the BPU has a prediction accuracy of 80%, the speed up (rounded off to two decimal places) obtained by over in executing P is
Answer: 1.42 to 1.45
Find the CPI of each processor and compare them:
- : CPI
- : stalls happen only for the 20% of branches that are predicted wrongly: CPI
The clock is the same for both, so the speedup
Answer: 1.43
- : CPI
- : stalls happen only for the 20% of branches that are predicted wrongly: CPI
The clock is the same for both, so the speedup
Answer: 1.43
A five-stage pipeline has stage delays of 150, 120, 150, 160 and 140 nanoseconds. The registers that are used between the pipeline stages have a delay of 5 nanoseconds each.
The total time to execute 100 independent instructions on this pipeline, assuming there are no pipeline stalls, is _______ nanoseconds.
The total time to execute 100 independent instructions on this pipeline, assuming there are no pipeline stalls, is _______ nanoseconds.
Answer: 17160
The clock cycle is the slowest stage plus the register delay. This gives 160 + 5 = 165 ns.
The number of cycles for 100 instructions on 5 stages is 5 + 100 1 = 104.
Total time = 104 165 = 17160 ns
Answer: 17160
The number of cycles for 100 instructions on 5 stages is 5 + 100 1 = 104.
Total time = 104 165 = 17160 ns
Answer: 17160
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 two cycles for MUL instruction. Ignore pipeline register latencies.
Consider the following sequence of 8 instructions:
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.
The Speedup achieved in executing the given instruction sequence on the pipelined processor (rounded to 2 decimal places) is _____________
Consider the following sequence of 8 instructions:
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.
The Speedup achieved in executing the given instruction sequence on the pipelined processor (rounded to 2 decimal places) is _____________
Answer: 1.87 to 1.88
Each instruction depends on the one before it. ADD needs 1 cycle in EX and MUL needs 2. IF and ID are cycles 1 and 2, so the first EX is in cycle 3.
With forwarding: a result goes straight from one EX stage to the next, so the EX stages run back to back with no wait. EX takes 4 (1 + 2) = 12 cycles, from cycle 3 to cycle 14. The last MUL then does MEM in cycle 15 and WB in cycle 16. Time = 16 cycles.
Without forwarding: an instruction reads its registers in EX, so its EX can start only after the instruction it depends on has finished WB.
- ADD: EX 3, MEM 4, WB 5.
- Next MUL: EX 6 to 7, MEM 8, WB 9.
- Next ADD: EX 10, MEM 11, WB 12, and so on.
After the first two cycles (IF, ID), each ADD takes 3 cycles (EX, MEM, WB) and each MUL takes 4 cycles (2 EX, MEM, WB), one after the other. Time = 2 + 4 (3 + 4) = 30 cycles.
Speedup =
Answer: 1.88
With forwarding: a result goes straight from one EX stage to the next, so the EX stages run back to back with no wait. EX takes 4 (1 + 2) = 12 cycles, from cycle 3 to cycle 14. The last MUL then does MEM in cycle 15 and WB in cycle 16. Time = 16 cycles.
Without forwarding: an instruction reads its registers in EX, so its EX can start only after the instruction it depends on has finished WB.
- ADD: EX 3, MEM 4, WB 5.
- Next MUL: EX 6 to 7, MEM 8, WB 9.
- Next ADD: EX 10, MEM 11, WB 12, and so on.
After the first two cycles (IF, ID), each ADD takes 3 cycles (EX, MEM, WB) and each MUL takes 4 cycles (2 EX, MEM, WB), one after the other. Time = 2 + 4 (3 + 4) = 30 cycles.
Speedup =
Answer: 1.88
Consider a non-pipelined processor operating at 2.5 GHz. It takes 5 clock cycles to complete an instruction. You are going to make a 5-stage pipeline out of this processor. Overheads associated with pipelining force you to operate the pipelined processor at 2 GHz. In a given program, assume that 30% are memory instructions, 60% are ALU instructions and the rest are branch instructions. 5% of the memory instructions cause stalls of 50 clock cycles each due to cache misses and 50% of the branch instructions cause stalls of 2 cycles each. Assume that there are no stalls associated with the execution of ALU instructions. For this program, the speedup achieved by the pipelined processor over the non-pipelined processor (round off to 2 decimal places) is________.
Answer: 2.15 to 2.18
Non-pipelined: One instruction takes 5 cycles. At 2.5 GHz one cycle is 0.4 ns, so each instruction takes 2 ns.
Pipelined: CPI is 1 plus the stall cycles, so CPI = . At 2 GHz one cycle is 0.5 ns, so each instruction takes 0.925 ns.
Speedup = 2 / 0.925 2.16
Answer: 2.16
Pipelined: CPI is 1 plus the stall cycles, so CPI = . At 2 GHz one cycle is 0.5 ns, so each instruction takes 0.925 ns.
Speedup = 2 / 0.925 2.16
Answer: 2.16
The instruction pipeline of a RISC processor has the following stages: Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Perform Operation (PO) and Writeback (WB). The IF, ID, OF and WB stages take 1 clock cycle each for every instruction. Consider a sequence of 100 instructions. In the PO stage, 40 instructions take 3 clock cycles each, 35 instructions take 2 clock cycles each, and the remaining 25 instructions take 1 clock cycle each. Assume that there are no data hazards and no control hazards.
The number of clock cycles required for completion of execution of the sequence of instructions is ______.
The number of clock cycles required for completion of execution of the sequence of instructions is ______.
Answer: 219
PO is the slowest stage, so the instructions pass through it one after another with no gap.
Total time in PO = 40 3 + 35 2 + 25 1 = 215 cycles.
The first PO is preceded by 3 cycles (IF, ID, OF), and the last PO is followed by 1 cycle (WB). So 3 + 215 + 1 = 219
Answer: 219
Total time in PO = 40 3 + 35 2 + 25 1 = 215 cycles.
The first PO is preceded by 3 cycles (IF, ID, OF), and the last PO is followed by 1 cycle (WB). So 3 + 215 + 1 = 219
Answer: 219
Keep practising