Branch Prediction Techniques: Static and Dynamic Approaches, Slides of Advanced Computer Architecture

This presentation covers the fundamentals of branch prediction, a CPU optimization technique used to guess the outcome of conditional operations and prepare for the most likely result. three types of branches - forward, backward, and unconditional - and two prediction methods: static and dynamic. Static prediction schemes, such as forward and backward conditional branches, use a static predictor that looks for the offset of the conditional branch and predicts based on that. Dynamic prediction schemes, like the Branch History Table (BHT) and Two-Level Adaptive Branch Predictor, utilize hardware-based mechanisms to make more accurate predictions based on the run-time behavior of branches.

Typology: Slides

2019/2020

Uploaded on 03/24/2020

saniksha-murria
saniksha-murria 🇮🇳

3 documents

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
A PRESENATION ON
BRANCH PREDICTIONS
(PART-1)
A PRESENATION ON
BRANCH PREDICTIONS
(PART-1)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Branch Prediction Techniques: Static and Dynamic Approaches and more Slides Advanced Computer Architecture in PDF only on Docsity!

A PRESENATION ON

BRANCH PREDICTIONS

(PART-1)

A PRESENATION ON

BRANCH PREDICTIONS

(PART-1)

Submitted by:

Saniksha Murria

MCA 6

th

Sem

Submitted by:

Saniksha Murria

MCA 6

th

Sem

4

  • (^) Branch prediction is a technique used in CPU design that attempts to guess the outcome of a conditional operation and prepare for the most likely result.
  • (^) A digital circuit that performs this operation is known as a branch predictor.
  • (^) Branch prediction breaks instructions down into predicates, similar to predicate logic. A CPU using branch prediction only executes statements if a predicate is true.
  • (^) Branch prediction is used to speed execution of instructions on processors that use pipelining.
  • (^) Branch prediction predicts two problems: i. Direction Predicting ii. Calculating the Target Address

Branch prediction is essentially an

optimization (minimization) problem where

the emphasis is on to achieve lowest

possible miss rate, low power consumption

and low complexity with minimum

resources.

5

Static Branch Prediction ⊳ (^) Static Branch Prediction predicts always the same direction for the same branch during the whole program execution. ⊳ (^) It comprises hardware- fixed prediction and Dynamic Branch Prediction ⊳ (^) Dynamic Branch Prediction: the hardware influences the prediction while execution proceeds. ⊳ (^) Prediction is decided on the computation history of the program. 7

Schemes of Branch Prediction Schemes of Branch Prediction

Static Branch Prediction

Techniques

Static Branch Prediction

Techniques

Forward Conditional Branches ⊳ (^) based on a run-time condition, the PC (Program Counter) is changed to point to an address forward in the instruction stream. ⊳ (^) A static predictor looks for the offset of the conditional branch and predicts to take Backward Conditional Branches ⊳ (^) based on a run-time condition, the PC (Program Counter) is changed to point to an address backward in the instruction stream. ⊳ (^) A static predictor looks for the offset of the conditional branch and predicts to take 8

Some of the proposed dynamic branch prediction mechanisms include: ⊳ (^) Uses a Branch History Table (BHT), a table of usually two-bit saturating counters which is indexed by a portion of the branch address (low bits of address). ⊳ (^) (First proposed mid 1980s) – Two-Level Adaptive Branch Predictor. ⊳ To reduce the stall cycles resulting from correctly predicted taken branches to zero cycles, a Branch Target Buffer (BTB) that includes the addresses of conditional branches that were taken along with their targets is added to the fetch stage. 10 Dynamic Branch Prediction Mechanisms Dynamic Branch Prediction Mechanisms

Branch History Table (BHT) Branch History Table (BHT) Also known as One Level Bit Branch Predictor 11

Branch History TableBranch History Table 13

Two Level Bit Predictor Two Level Bit Predictor

(First proposed mid 1980s)

Two Level Bit Predictor Two Level Bit Predictor 16

Branch Target

Buffer

Branch Target

Buffer

Also known as BTB

Branch Target

Buffer

Branch Target

Buffer

19

20 Thanks! Thanks!

Any questions?