šŸš€   Pipeline Processing

Interactive Learning Module

šŸ“‹ What is Pipelining?

Pipelining is a computing technique that utilizes parallel processing principles to improve execution speed by transforming a sequential process into sub-operations.
⚔ Decomposition
Sequential process broken into smaller sub-operations
šŸŽÆ Dedicated Segments
Each sub-operation executed in special dedicated segment
šŸ”„ Parallel Processing
Multiple computations progress simultaneously in distinct segments

šŸ—ļø Pipeline Structure

Four Segment Pipeline

Stage with Registers

Segments (S) process data • Registers (R) synchronized by clock

šŸ“‹ Pipeline Execution Diagram

Four-Segment Pipeline Processing Six Tasks

Segment
Clock 1
Clock 2
Clock 3
Clock 4
Clock 5
Clock 6
Clock 7
Clock 8
Clock 9
Clock 10
1
T₁
Tā‚‚
Tā‚ƒ
Tā‚„
Tā‚…
T₆
2
T₁
Tā‚‚
Tā‚ƒ
Tā‚„
Tā‚…
T₆
3
T₁
Tā‚‚
Tā‚ƒ
Tā‚„
Tā‚…
T₆
4
T₁
Tā‚‚
Tā‚ƒ
Tā‚„
Tā‚…
T₆
Task T₁
Task Tā‚‚
Task Tā‚ƒ
Task Tā‚„
Task Tā‚…
Task T₆

Pipeline Characteristics:

  • Clock 1: T₁ starts in segment 1
  • Clock 2: T₁ moves to segment 2, Tā‚‚ starts in segment 1
  • Clock 3: T₁ moves to segment 3, Tā‚‚ to segment 2, Tā‚ƒ starts in segment 1
  • Clock 4: T₁ completes (exits segment 4), pipeline continues filling
  • Clock 5 onwards: Pipeline is full - one task completes every clock cycle
  • Total time: 9 clock cycles to complete all 6 tasks
  • Throughput: 1 task per clock cycle (after pipeline fills at clock 4)

🧮 Arithmetic Pipeline Example

Computing Aįµ¢ Ɨ Bįµ¢ + Cįµ¢ for i = 1, 2, 3, ..., 7

Stage 1

Input

R1 ← Aįµ¢
R2 ← Bįµ¢

Stage 2

Multiply

R3 ← R1 Ɨ R2
R4 ← Cįµ¢

Stage 3

Add

R5 ← R3 + R4

Output

Result

Aįµ¢ Ɨ Bįµ¢ + Cįµ¢

Stage with Registers
Clock Pulse Segment 1 (Input) Segment 2 (Multiply) Segment 3 (Add)
1 A₁, B₁ — —
2 Aā‚‚, Bā‚‚ A₁ Ɨ B₁, C₁ —
3 Aā‚ƒ, Bā‚ƒ Aā‚‚ Ɨ Bā‚‚, Cā‚‚ A₁ Ɨ B₁ + C₁ āœ“
4 Aā‚„, Bā‚„ Aā‚ƒ Ɨ Bā‚ƒ, Cā‚ƒ Aā‚‚ Ɨ Bā‚‚ + Cā‚‚
5 Aā‚…, Bā‚… Aā‚„ Ɨ Bā‚„, Cā‚„ Aā‚ƒ Ɨ Bā‚ƒ + Cā‚ƒ
6 A₆, B₆ Aā‚… Ɨ Bā‚…, Cā‚… Aā‚„ Ɨ Bā‚„ + Cā‚„
7 A₇, B₇ A₆ Ɨ B₆, C₆ Aā‚… Ɨ Bā‚… + Cā‚…
8 — A₇ Ɨ B₇, C₇ A₆ Ɨ B₆ + C₆
9 — — A₇ Ɨ B₇ + C₇ āœ“

⚔ Speed Up Calculation

S = n Ɨ tā‚™ / [(k + n - 1) Ɨ tā‚š]

Where:

  • S = Speed Up factor
  • k = Number of segments in pipeline
  • n = Number of tasks
  • tā‚š = Clock cycle time (pipeline)
  • tā‚™ = Time per task (non-pipeline)

🧮 Interactive Speed Up Calculator

šŸ“Š Key Insights:
  • When n ≫ k-1, Speed Up ā‰ˆ tā‚™ / tā‚š
  • If tā‚™ = k Ɨ tā‚š, then Maximum Speed Up = k; where k is the number of segment in pipeline
  • First task completes in k Ɨ tā‚š time
  • After pipeline fills, one result per clock cycle

šŸ¢ Pipeline Organization Types

1ļøāƒ£ Arithmetic Pipeline
Specialized for arithmetic operations like multiplication, division, floating-point operations
2ļøāƒ£ Instruction Pipeline
Handles instruction fetch, decode, execute, and write-back stages
Start Learning Arithmetic Pipelining