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 26–30 of 53
Consider the following processors (ns stands for nanoseconds). Assume that the pipeline registers have zero latency.
P1: Four-stage pipeline with stage latencies 1 ns, 2 ns, 2 ns, 1 ns.
P2: Four-stage pipeline with stage latencies 1 ns, 1.5 ns, 1.5 ns, 1.5 ns.
P3: Five-stage pipeline with stage latencies 0.5 ns, 1 ns, 1 ns, 0.6 ns, 1 ns.
P4: Five-stage pipeline with stage latencies 0.5 ns, 0.5 ns, 1 ns, 1 ns, 1.1 ns.
Which processor has the highest peak clock frequency?
P1: Four-stage pipeline with stage latencies 1 ns, 2 ns, 2 ns, 1 ns.
P2: Four-stage pipeline with stage latencies 1 ns, 1.5 ns, 1.5 ns, 1.5 ns.
P3: Five-stage pipeline with stage latencies 0.5 ns, 1 ns, 1 ns, 0.6 ns, 1 ns.
P4: Five-stage pipeline with stage latencies 0.5 ns, 0.5 ns, 1 ns, 1 ns, 1.1 ns.
Which processor has the highest peak clock frequency?
Answer: (C)
The clock period is set by the slowest stage, so it equals the largest stage latency.
- P1: 2 ns 0.5 GHz
- P2: 1.5 ns 0.67 GHz
- P3: 1 ns 1 GHz
- P4: 1.1 ns 0.91 GHz
Answer: P3
- P1: 2 ns 0.5 GHz
- P2: 1.5 ns 0.67 GHz
- P3: 1 ns 1 GHz
- P4: 1.1 ns 0.91 GHz
Answer: P3
An instruction pipeline has five stages, namely, instruction fetch (IF), instruction decode and register fetch (ID/RF), instruction execution (Ex), memory access (MEM), and register write back (WB) with stage latencies 1 ns, 2.2 ns, 2 ns, 1 ns, and 0.75 ns, respectively (ns stands for nanoseconds). To gain in terms of frequency, the designers have decided to split the ID/RF stage into three stages (ID, RF1, RF2) each of latency 2.2/3 ns. Also, the Ex stage is split into two stages (Ex1, Ex2) each of latency 1 ns. The new design has a total of eight pipeline stages. A program has 20% branch instructions which execute in the Ex stage and produce the next instruction pointer at the end of the Ex stage in the old design and at the end of the Ex2 stage in the new design. The IF stage stalls after fetching a branch instruction until the next instruction pointer is computed. All instructions other than the branch instruction have an average CPI of one in both the designs. The execution times of this program on the old and the new design are P and Q nanoseconds, respectively. The value of P/Q is __________
Answer: 1.5 to 1.6
Let the program have instructions. Then and the same for , so cancels in .
Old design: the clock is the slowest stage, 2.2 ns. A branch gives its next pointer at the end of EX, which is stage 3, so IF stalls for 2 cycles.
CPI = 0.8 1 + 0.2 3 = 1.4, so ns.
New design: the clock is 1 ns. A branch gives its next pointer at the end of Ex2, which is stage 6 (IF, ID, RF1, RF2, Ex1, Ex2), so IF stalls for 5 cycles.
CPI = 0.8 1 + 0.2 6 = 2, so ns.
Answer: 1.54
Old design: the clock is the slowest stage, 2.2 ns. A branch gives its next pointer at the end of EX, which is stage 3, so IF stalls for 2 cycles.
CPI = 0.8 1 + 0.2 3 = 1.4, so ns.
New design: the clock is 1 ns. A branch gives its next pointer at the end of Ex2, which is stage 6 (IF, ID, RF1, RF2, Ex1, Ex2), so IF stalls for 5 cycles.
CPI = 0.8 1 + 0.2 6 = 2, so ns.
Answer: 1.54
Consider an instruction pipeline with five stages without any branch prediction: Fetch Instruction
(FI), Decode Instruction (DI), Fetch Operand (FO), Execute Instruction (EI) and Write Operand
(WO). The stage delays for FI, DI, FO, EI and WO are 5 ns, 7 ns, 10 ns, 8 ns and 6 ns, respectively. There are intermediate storage buffers after each stage and the delay of each buffer is 1 ns. A program consisting of 12 instructions I1, I2, I3,..., I12 is executed in this pipelined processor. Instruction I4 is the only branch instruction and its branch target is I9. If the branch is taken during the execution of this program, the time (in ns) needed to complete the program is
Answer: (B)
The clock period is the slowest stage plus the buffer delay: 10 + 1 = 11 ns.
I1, I2, I3 and I4 enter FI in cycles 1, 2, 3 and 4. So I4 is in FI in cycle 4, DI in 5, FO in 6 and EI in 7. The branch is known at the end of EI, cycle 7.
Instructions I5 to I8 are not run. The target I9 is fetched in cycle 8.
I9 goes through FI, DI, FO, EI and WO in cycles 8 to 12, which is 4 cycles after its fetch cycle. I10, I11 and I12 then finish one cycle after each other, in cycles 13, 14 and 15. So the last cycle is 8 + 4 + 3 = 15.
Total time = 15 11 = 165 ns
Answer: (B)
I1, I2, I3 and I4 enter FI in cycles 1, 2, 3 and 4. So I4 is in FI in cycle 4, DI in 5, FO in 6 and EI in 7. The branch is known at the end of EI, cycle 7.
Instructions I5 to I8 are not run. The target I9 is fetched in cycle 8.
I9 goes through FI, DI, FO, EI and WO in cycles 8 to 12, which is 4 cycles after its fetch cycle. I10, I11 and I12 then finish one cycle after each other, in cycles 13, 14 and 15. So the last cycle is 8 + 4 + 3 = 15.
Total time = 15 11 = 165 ns
Answer: (B)
Register renaming is done in pipelined processors
Answer: (C)
In register renaming, each new use of a register name gets a fresh physical register. This removes WAR and WAW hazards, which are false dependency hazards.
Answer: to handle certain kinds of hazards
Answer: to handle certain kinds of hazards
Consider an instruction pipeline with four stages (S1, S2, S3 and S4) each with combinational circuit only. The pipeline registers are required between each stage and at the end of the last stage. Delays for the stages and for the pipeline registers are as given in the figure.
What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline implementation?
What is the approximate speed up of the pipeline in steady state under ideal conditions when compared to the corresponding non-pipeline implementation?
Answer: (B)
Non-pipelined: there are no pipeline registers, so one instruction takes the sum of the stage delays: 5 + 6 + 11 + 8 = 30 ns.
Pipelined: every stage must fit in one clock, and each stage is followed by a register. So the clock period is the slowest stage plus the register delay: 11 + 1 = 12 ns. One instruction takes 4 12 = 48 ns from start to end, but in steady state one instruction is completed every 12 ns.
Speed-up =
Answer: (B)
Pipelined: every stage must fit in one clock, and each stage is followed by a register. So the clock period is the slowest stage plus the register delay: 11 + 1 = 12 ns. One instruction takes 4 12 = 48 ns from start to end, but in steady state one instruction is completed every 12 ns.
Speed-up =
Answer: (B)
Keep practising