The concept of pipelining is most effective in improving performance if the…

2012

The concept of pipelining is most effective in improving performance if the tasks being performed in different stages:

Answer: B. require about the same amount of timeConceptIn a k-stage pipeline every stage is driven by one common clock, so a single clock period must be long enough for the slowest stage: Tclk = max(τ1, τ2,…

  1. A.

    require different amount of time

  2. B.

    require about the same amount of time

  3. C.

    require different amount of time with time difference between any two tasks being same

  4. D.

    require different amount of time with time difference between any two tasks being different

Attempted by 44 students.

Show answer & explanation

Correct answer: B

Concept

In a k-stage pipeline every stage is driven by one common clock, so a single clock period must be long enough for the slowest stage: Tclk = max(τ1, τ2, …, τk). Throughput is 1/Tclk, so it is fixed by the largest stage delay alone and not by the other stages.

The work per task is the sum Στ = τ1 + … + τk. Because Στ ≤ k · max(τi), the limiting speedup of a k-stage pipeline is capped at k, and that cap is approached only when the stage delays are all equal.

Application

  1. Write the per-task work of the unpipelined machine: it must run every stage in turn, taking Στ = τ1 + … + τk for one task.

  2. Clock the k stages together: each stage must finish inside one period, so Tclk = max(τi), the slowest stage delay.

  3. Fill and drain the pipeline for n tasks: the first task needs k periods and each later task adds one, giving a total of (k + n − 1) · Tclk.

  4. Form the speedup over the unpipelined machine: S = n · Στ / [(k + n − 1) · Tclk], which tends to Στ / max(τi) as n grows large.

  5. Bound that limiting ratio: Στ ≤ k · max(τi), so the limiting speedup is at most k, with equality exactly when every τi equals max(τi) — that is, when the stage tasks take about the same amount of time. For any finite n the fill-and-drain factor n / (k + n − 1) keeps the actual S strictly below that limit, whatever the split.

Cross-check

Four-stage splits of the same total work Στ = 8 ns, compared by their limiting speedup Στ / Tclk:

Stage delays (ns)

Clock period (ns)

Limiting speedup

2, 2, 2, 2 (equal)

2

8 / 2 = 4.00 = k

0.5, 1.5, 2.5, 3.5 (constant gap of 1)

3.5

8 / 3.5 ≈ 2.29

1, 2, 4, 1 (varying gaps)

4

8 / 4 = 2.00

5, 1, 1, 1 (one dominant stage)

5

8 / 5 = 1.60

Contrast

  • "require about the same amount of time": Στ = k · τ and Tclk = τ, so Στ / Tclk = k, the largest limiting speedup a k-stage pipeline can reach.

  • "require different amount of time": Στ < k · max(τi), so the ratio falls below k; the shortfall is exactly the idle slack left in the faster stages every cycle.

  • "require different amount of time with time difference between any two tasks being same": an evenly spaced set such as 0.5, 1.5, 2.5, 3.5 ns is still unequal, giving 8 / 3.5 ≈ 2.29 < 4 — a regular gap does not remove the slack.

  • "require different amount of time with time difference between any two tasks being different": irregular delays such as 5, 1, 1, 1 ns give 8 / 5 = 1.60 < 4; the largest stage still sets the clock.

Pipelining therefore approaches its full k-fold benefit only when the stage tasks require about the same amount of time.

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…