Pipelining Types and Stalling

Last Updated : 11 Nov, 2025

Pipelining is a fundamental technique used in computer architecture to improve the throughput of instruction execution by overlapping the execution phases of multiple instructions. The effectiveness of a pipeline depends significantly on how the pipeline stages are organized and timed. There are two primary types of pipelines based on stage timing: 

Uniform Delay Pipeline

In this type of pipeline, all the stages will take the same time to complete an operation. In a uniform delay pipeline, Cycle Time (Tp) = Stage Delay If buffers are included between the stages, then Cycle Time (Tp) = Stage Delay + Buffer Delay.

Non-Uniform Delay Pipeline

In this type of pipeline, different stages take different times to complete an operation. In this type of pipeline, Cycle Time (Tp) = Maximum(Stage Delay) For example, if there are 4 stages with delays of 1 ns, 2 ns, 3 ns, and 4 ns, then Tp = Maximum(1 ns, 2 ns, 3 ns, 4 ns) = 4 ns If buffers are included between the stages, Tp = Maximum(Stage delay + Buffer delay)

Example: Consider a 4-segment pipeline with stage delays (2 ns, 8 ns, 3 ns, 10 ns). Find the time taken to execute 100 tasks in the above pipeline. Solution: As the above pipeline is a non-linear pipeline, Tp = max(2, 8, 3, 10) = 10 ns. We know that ETpipeline = (k + n – 1) Tp = (4 + 100 – 1) 10 ns = 1030 ns. NOTE: MIPS = Million instructions per second

Performance of Pipeline with Stalls

performance
  • => S = Average Execution Timenon-pipeline / Average Execution Timepipeline
  • => S = CPInon-pipeline * Cycle Timenon-pipeline / CPIpipeline * Cycle Timepipeline
  • => S = CPInon-pipeline * Clock frequency pipeline / CPIpipeline * Clock frequencynon-pipeline

Ideal CPI of the pipelined processor is '1'. But due to stalls, it becomes greater than '1'. =>

  • S = CPInon-pipeline * Cycle Timenon-pipeline / (1 + Number of stalls per Instruction) * Cycle Timepipeline
  • As Cycle Timenon-pipeline = Cycle Timepipeline,
cpi

Problems  in Instruction Pipelining

  • Time Variation: Not all stages take the same amount of time. This means that the speed gain of a pipeline will be determined by its slowest page. This problem is particularly acute in instruction processing, since different instructions have different operand requirements and sometimes vastly different processing time.
  • Data Hazards: When several instructions are in parallel execution, a problem arises if they reference the same data. We must ensure that a later instruction  does not attempt to access data source than a proceeding instruction, If they will lead to incorrect results.
  • Branching: In order to fetch the "next" instruction may not Know which one is required. If the present instruction is a conditional branch, the next instruction may not be known until the current one is processed.
  • Interrupts: Interrupts insert unplanned " extra" instructions into the instruction stream. The interrupt must take effect between instructions, that is when one instruction has completed and the next has not yet began.
Comment

Explore