Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Architecture Metrics Reference
  • Workload Taxonomy for Architects
  • Architecture Glossary
  • Computer Architecture Cheatsheet
  • Pipeline Fundamentals14
    • Pipeline Throughput
    • Branch Prediction and Fetch
      • Predictor Structures
      • MPKI and Recovery Math
      • Fetch and Recovery Pipeline
      • Tuning, Cost and Interviews
    • Out-of-Order Superscalar Execution
  • Memory Hierarchy15
  • NoC and Interconnect Architecture6
  • Coherency and Memory Ordering9
  • Performance Analysis9
  • Accelerator Architectures6
  • SoC Architecture Tradeoffs9
  • Architecture Interview Prep14
Loading lesson

‹Pipeline Fundamentals
  1. Topics
  2. Computer Architecture
  3. Pipeline Fundamentals
  4. Branch Prediction and Fetch

Computer Architecture · All levels

Branch Prediction and Fetch

How predictors feed fetch, what mispredicts cost in CPI, and how to debug them.

  • 4topics
  • 4lessons

Fetch stays full only when prediction guesses both direction and target correctly. This topic covers predictor structures, MPKI and recovery math, fetch timing, and debug.

Question

Answered by

Wrong guess costs

Taken or not taken

Direction tables (bimodal, gshare)

Flush of wrong-path work

Where to if taken

BTB target, return stack, indirect predictor

Redirect delay plus refill

Was it worth it

MPKI and recovery math

CPI added per thousand instructions

Lesson

What it covers

Predictor structures

Direction tables, BTB targets and the return stack, with a runnable model.

MPKI and recovery math

MPKI, accuracy and penalty tied to CPI with hand-checkable numbers.

Fetch and recovery pipeline

Lookup latency, flush depth and refill, and flat IPC despite better accuracy.

Tuning, cost and interviews

Branch-type debug, storage cost math, ROI, and interview drills.

Check yourself A program executes 1M instructions with 40K mispredicts at 10 cycles each. What CPI is added?

MPKI is 40 and CPI added is 40 x 10 / 1000 = 0.40. The lesson on MPKI math shows each step.

Interview

Say it in one breath: direction tables guess taken or not, the BTB and return stack guess where, MPKI times penalty gives CPI, and fetch bandwidth plus recovery depth decide whether accuracy turns into IPC.

PreviousNext: Predictor Structures

Up next

Up nextPredictor Structures

Sign in to save progress

Practice this lessonReport an error

See also

  • Pipeline Throughput
  • Out-of-Order Superscalar Execution