levo

Processors: Structure, Performance and Types

Pipelining

  • 1 thing to know
  • Component 01

Overview

Recall questions on pipelining in a processor, throughput once the pipeline is full, counting clock cycles with and without pipelining, jumps and branch prediction, data dependencies that stall a pipeline, and why RISC pipelines well.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Process

Once a three-stage pipeline is full, how many instructions complete per clock cycle, and what exactly has improved?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is pipelining in a processor?

    Model answer

    Overlapping the stages of the cycle so that they happen at the same time on different instructions. While one instruction is being executed, the next is being decoded and the one after that is being fetched. Separate hardware handles each stage, so all of them can be busy during the same clock cycle instead of two thirds of the processor standing idle.

  2. 2

    Once a three-stage pipeline is full, how many instructions complete per clock cycle, and what exactly has improved?

    Model answer

    One instruction completes per cycle, rather than one every three, so throughput is roughly tripled without the clock speed changing at all. What has not improved is latency: any individual instruction still takes three stages to pass through the pipeline. Pipelining increases how many instructions finish per second, not how quickly any one of them finishes.

  3. 3

    A three-stage pipeline runs 6 instructions, each stage taking one clock cycle. How many cycles are needed, and how many would be needed without pipelining?

    Model answer

    Without pipelining, each instruction occupies the processor for all three stages, so 6 times 3 is 18 cycles. With pipelining, 3 cycles fill the pipeline and then one instruction completes every cycle thereafter, giving 3 plus 5, which is 8 cycles. The saving grows with the number of instructions, because the cost of filling the pipeline is paid only once.

  4. 4

    What happens to the pipeline when the program reaches a jump?

    Model answer

    The instructions already fetched and decoded are the ones physically following the jump in memory, but the jump means those are not the instructions that should run next. They must be discarded, which is called flushing the pipeline, and the pipeline must be refilled from the target address. For the next few cycles no instruction completes, so the cycles spent fetching and decoding the wrong instructions are wasted. Code that branches frequently therefore erodes much of the benefit of pipelining.

  5. 5

    How do processors reduce the cost of branches?

    Model answer

    By branch prediction: the processor guesses which way the branch will go, usually from the history of that branch, since for instance the branch at the end of a loop is taken on nearly every iteration. It then speculatively fetches and decodes from the predicted address. If the guess is right the pipeline never stalls; if it is wrong the speculative work is thrown away and the pipeline flushed, so the penalty is paid only on mispredictions.

  6. 6

    Other than branches, what else stalls a pipeline?

    Model answer

    A data dependency, where an instruction needs a result the previous instruction has not yet produced, so it must wait and a gap appears in the pipeline. Resource contention, where two stages need the same piece of hardware at the same time. A cache miss, which delays a fetch and holds up everything behind it. And an interrupt, which requires the current state to be saved and the pipeline to be emptied before the service routine runs.

Other ways to work this

The same content, four other ways.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

The 3-step method, run for you

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

Processors: Structure, Performance and Types
Input, Output and Storage
Systems Software
Applications Generation

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

If it matches, the search .
succeedsfailsrestarts

Blank Blitz makes facts automatic

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

A0 + 0 gives 0.
B0 + 1 gives 1.
C1 + 1 gives 0 carry 1.

Build It gets the exam shape right

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

A global variable means a variable reachable from anywhere in the program.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Processors: Structure, Performance and Types, on a schedule.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.