Week 4 AOS: Pipelining

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:33 PM on 1/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

14 Terms

1
New cards

What is the basic idea behind instruction pipelining?

Pipelining divides the instruction cycle into distinct stages. Each stage processes a different instruction simultaneously, like an assembly line. This increases throughput.

2
New cards

What are the five stages of the instruction cycle?

  • Instruction Fetch (IF)

  • Instruction Decode / Register Fetch (ID/RF)

  • Execute / Address Generation (EX/AG)

  • Memory Access (MEM)

  • Write Back (WB)

3
New cards

What are the characteristics of an ideal pipeline?

  • Repetition of identical operations

  • Repetition of independent operations

  • Uniformly partitionable sub-operations

  • Minimal hardware cost increase

  • Even latency across stages

4
New cards

How does pipelining affect bandwidth?

Bandwidth ≈ Number of stages / Total latency
Example:

  • 1 stage → BW ≈ 1/T

  • 2 stages → BW ≈ 2/T

  • 3 stages → BW ≈ 3/T

5
New cards

What is the formula for throughput in pipelining with register delay?

  • Nonpipelined: BW = 1 / (T + S)

  • k-stage pipeline: BW = 1 / (T/k + S)
    Where S = register delay

6
New cards

How does pipelining affect hardware cost?

  • Nonpipelined: Cost = G + R

  • k-stage pipeline: Cost = G + Rk
    Where G = gate cost, R = register cost

7
New cards

Why is a real instruction pipeline not ideal?

  • Instructions differ → not all need same stages

  • Stages have different latencies

  • Instructions are interdependent → causes stalls

  • Clock must control all stages uniformly

8
New cards

What are key issues in pipeline design?

  • Balancing work across stages

  • Handling stalls

  • Managing resource contention

  • Resolving instruction dependencies

  • Dealing with long-latency operations

9
New cards

What are the two main types of instruction dependences?

  • Data dependence

  • Control dependence
    Also called hazards.
    Resource contention is a type of resource dependence.

10
New cards

What are the three types of data dependences?

  • Flow dependence (RAW) – Read after Write

  • Anti dependence (WAR) – Write after Read

  • Output dependence (WAW) – Write after Write

11
New cards

Which data dependences cause pipeline stalls?

  • Flow dependence (RAW) must always be obeyed

  • Anti and output dependences are name-based and arise due to limited registers

12
New cards

What are five ways to handle flow dependences?

  • Detect and wait

  • Detect and forward/bypass

  • Eliminate in software

  • Predict and execute speculatively

  • Use fine-grained multithreading

13
New cards

What is data forwarding in pipelining?

Also called data bypassing. It forwards the result to the dependent instruction as soon as it’s available, avoiding stalls.

14
New cards

What is stalling and when is it needed?

Stalling delays instruction execution to resolve hazards. Used when forwarding is not possible due to pipeline design or latency.