---
title: "Pipeline and performance gain"
subject: "Computer Organization and Architecture"
chapter: 4
key: "semester_5/computer_organization_and_architecture:pipeline-performance"
source: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/pipeline-performance
site: BCT Engineering
---

# Pipeline and performance gain

Computer Organization and Architecture · Chapter 4: Pipeline & Vector Processing

- Asked in: 2074 Chaitra, 2+6 marks
- Video: [Pipeline Performance](https://www.youtube.com/watch?v=apz1qL7jDeQ) — Semesters Simplified
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_organization_and_architecture/pipeline-performance
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_organization_and_architecture/chapter-4

## Question

What is pipeline? How is the performance of a computer increased using pipelining? Explain with example.

## Short answer

Pipelining divides instruction execution into k stages that process different tasks simultaneously. For n tasks, speedup S = n*k / (k + n - 1), approaching k for large n; example: k=4, tp=20ns, n=100 yields speedup 3.88.

## Answer

#### Pipeline
A pipeline is a technique in which a process is divided into stages (segments) that operate at the same time on different data, with the output of one segment feeding the next. It works like an assembly line, so several instructions are in different stages of execution at once.

#### How performance increases
For n tasks, k segments and clock time tp:
- Without pipeline: T_np = n · k · tp
- With pipeline: T_p = (k + n - 1) · tp
- **Speedup S = n·k / (k + n - 1)**. When n is large, S → k.
- Throughput = n / ((k + n - 1) tp), which approaches one task per clock.

Example: 4 segments, tp = 20 ns, n = 100 instructions.
- T_np = 100 × 4 × 20 = 8000 ns
- T_p = (4 + 100 - 1) × 20 = 103 × 20 = 2060 ns
- S = 8000 / 2060 = 3.88

So pipelining gives almost k times as much work per unit time without needing k separate processors, although hazards (data, control, structural) reduce the real gain.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which best describes a pipeline?
   A. A process divided into stages operating at the same time on different data, like an assembly line
   B. Several processors running the same program on identical data
   C. A method that executes one instruction fully before starting the next
   D. A memory that stores instructions in a queue only
   Answer: A. A pipeline divides work into segments with the output of one feeding the next, so several tasks are in different stages at once. (Key point: Definition of pipeline)

2. Time for n tasks with a k-segment pipeline of clock tp is:
   A. n·k·tp
   B. (k + n - 1)·tp
   C. (k - n + 1)·tp
   D. n·tp
   Answer: B. The first task takes k clocks and the remaining n - 1 tasks finish one clock apart. (Key point: Pipelined time)

3. What does speedup tend to as n becomes very large?
   A. 1
   B. n
   C. k
   D. k·n
   Answer: C. S = n·k/(k + n - 1) approaches k when n is large. (Key point: Speedup limit)

4. For k = 4, tp = 20 ns, n = 100, what is the speedup?
   A. 3.88
   B. 4.88
   C. 2.06
   D. 0.26
   Answer: A. 8000 ns / 2060 ns = 3.88. (Key point: Numerical example)

## Related in Computer Organization and Architecture

- [Vector processing and pipelining performance](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Avector-pipeline-performance) — Computer Organization and Architecture, chapter 4, asked 2×
- [How arithmetic pipeline increases performance](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aarith-pipeline-performance) — Computer Organization and Architecture, chapter 4
- [Parallel processing and pipelining](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Aparallel-processing) — Computer Organization and Architecture, chapter 4
- [Data dependency problem in pipelining](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Adata-dependency) — Computer Organization and Architecture, chapter 4
- [Pipeline hazards and solutions](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Apipeline-hazards) — Computer Organization and Architecture, chapter 4, asked 5×
- [Four-segment instruction pipeline and space-time diagram](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_organization_and_architecture%3Afour-segment-pipeline) — Computer Organization and Architecture, chapter 4, asked 5×

## Related in other subjects

- [Pipelining and multi-stage pipeline](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Apipelining-stages) — Embedded System, chapter 2, asked 3×
- [2D viewing pipeline with matrices](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aviewing-pipeline-2d-matrices) — Computer Graphics, chapter 3, asked 5×
- [3D viewing pipeline](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aviewing-pipeline-3d) — Computer Graphics, chapter 4, asked 5×
- [Short note: 2D viewing pipeline](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ashort-note-2d-viewing-pipeline) — Computer Graphics, chapter 3, asked 2×
