SlideShare a Scribd company logo
Dynamic Branch
Prediction
1-BIT PREDICTION
Dynamic Branch Prediction(1-bit Prediction)
Dynamic Branch Prediction; the prediction changes while program
behavior changes.
It differs from Static Branch Prediction through gather level. The
prediction is gathered before the program execution at SBP but it is gathered
at run-time at DBP.
1-bit Prediction; is the simplest way to prediction. Once you
misprediction, then it is changed at next time.
2-bit Prediction is used as better solution.
Dynamic Branch Prediction(1-bit Prediction)
BT BNT
not taken
taken
taken not taken
1-bit Prediction Scheme;
Dynamic Branch Prediction(1-bit Prediction)
 Let’s evaluate below example;
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
Assume that Initial State is
Branch Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT
1
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our inital state is BT and
branch is taken at for
loop so we can decade
next prediction state is
Branch Taken. We
decade this prediction
through graph at right. If
your state is BT and
result is taken, the
prediction for is
statement is BT
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BN
1 0
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BT
and branch is not taken
at if condition so we can
decade next prediction
state is Branch Not
Taken. According to
graph at right, if our
state is Branch Taken
and state is not taken,
our prediction is Branch
Not Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT
1 0 0
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BNT
and branch is taken at
for loop so we can
decade next prediction
state is Branch Taken.
According to graph at
right, if our state is
Branch Not Taken and
state is taken, our
prediction is Branch
Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT BNT
1 0 0 0
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BT
and branch is not taken
at if condition so we can
decade next prediction
state is Branch Not
Taken. According to
graph at right, if our
state is Branch Taken
and state is not taken,
our prediction is Branch
Not Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT BNT BT
1 0 0 0 0
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BNT
and branch is taken at
for loop so we can
decade next prediction
state is Branch Taken.
According to graph at
right, if our state is
Branch Not Taken and
state is taken, our
prediction is Branch
Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT BNT BT BNT
1 0 0 0 0 0
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BT
and branch is not taken
at if condition so we can
decade next prediction
state is Branch Not
Taken. According to
graph at right, if our
state is Branch Taken
and state is not taken,
our prediction is Branch
Not Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT BNT BT BNT BT
1 0 0 0 0 0 0
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BNT
and branch is taken at
for loop so we can
decade next prediction
state is Branch Taken.
According to graph at
right, if our state is
Branch Not Taken and
state is taken, our
prediction is Branch
Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT BNT BT BNT BT BT
1 0 0 0 0 0 0 1
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BT
and branch is taken at if
condition so we can
decade next prediction
state is Branch Taken.
According to graph at
right, if our state is
Branch Taken and state
is taken, our prediction is
Branch Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT BNT BT BNT BT BT BT
1 0 0 0 0 0 0 1 1
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BT
and branch is taken at if
condition so we can
decade next prediction
state is Branch Taken.
According to graph at
right, if our state is
Branch Taken and state
is taken, our prediction is
Branch Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT BNT BT BNT BT BT BT BNT
1 0 0 0 0 0 0 1 1 0
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
BT BNT
not taken
taken
taken not taken
Our current state is BT
and branch is not taken
at if condition so we can
decade next prediction
state is Branch Not
Taken. According to
graph at right, if our
state is Branch Taken
and state is not taken,
our prediction is Branch
Not Taken
Dynamic Branch Prediction(1-bit Prediction)
For
i=0
If For
i=1
If For
i=2
If For
i=3
If For
i=4
If For
i=5
Result BT BNT BT BNT BT BN
T
BT BT BT BNT BNT
Prediction BT BT BNT BT BNT BT BNT BT BT BT BNT
1 0 0 0 0 0 0 1 1 0 1
…
int a = 3;
int i = 0;
for(i =0;i<5;i++){
if(i == a)
a=0;
}
…
At the end;
Our 4 predictions are
correct!

More Related Content

Recently uploaded

An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Zener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and ApplicationsZener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and Applications
Shiny Christobel
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
CVCSOfficial
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
2. protection of river banks and bed erosion protection works.ppt
2. protection of river banks and bed erosion protection works.ppt2. protection of river banks and bed erosion protection works.ppt
2. protection of river banks and bed erosion protection works.ppt
abdatawakjira
 
5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
AlvianRamadhani5
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
sachin chaurasia
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
ijaia
 
Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...
cannyengineerings
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
Addu25809
 

Recently uploaded (20)

An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Zener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and ApplicationsZener Diode and its V-I Characteristics and Applications
Zener Diode and its V-I Characteristics and Applications
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
2. protection of river banks and bed erosion protection works.ppt
2. protection of river banks and bed erosion protection works.ppt2. protection of river banks and bed erosion protection works.ppt
2. protection of river banks and bed erosion protection works.ppt
 
5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...
 
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENTNATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
NATURAL DEEP EUTECTIC SOLVENTS AS ANTI-FREEZING AGENT
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Dynamic Branch Prediction - 1 Bit Predicition

  • 2. Dynamic Branch Prediction(1-bit Prediction) Dynamic Branch Prediction; the prediction changes while program behavior changes. It differs from Static Branch Prediction through gather level. The prediction is gathered before the program execution at SBP but it is gathered at run-time at DBP. 1-bit Prediction; is the simplest way to prediction. Once you misprediction, then it is changed at next time. 2-bit Prediction is used as better solution.
  • 3. Dynamic Branch Prediction(1-bit Prediction) BT BNT not taken taken taken not taken 1-bit Prediction Scheme;
  • 4. Dynamic Branch Prediction(1-bit Prediction)  Let’s evaluate below example; … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … Assume that Initial State is Branch Taken
  • 5. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT 1 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our inital state is BT and branch is taken at for loop so we can decade next prediction state is Branch Taken. We decade this prediction through graph at right. If your state is BT and result is taken, the prediction for is statement is BT
  • 6. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BN 1 0 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BT and branch is not taken at if condition so we can decade next prediction state is Branch Not Taken. According to graph at right, if our state is Branch Taken and state is not taken, our prediction is Branch Not Taken
  • 7. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT 1 0 0 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BNT and branch is taken at for loop so we can decade next prediction state is Branch Taken. According to graph at right, if our state is Branch Not Taken and state is taken, our prediction is Branch Taken
  • 8. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT BNT 1 0 0 0 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BT and branch is not taken at if condition so we can decade next prediction state is Branch Not Taken. According to graph at right, if our state is Branch Taken and state is not taken, our prediction is Branch Not Taken
  • 9. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT BNT BT 1 0 0 0 0 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BNT and branch is taken at for loop so we can decade next prediction state is Branch Taken. According to graph at right, if our state is Branch Not Taken and state is taken, our prediction is Branch Taken
  • 10. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT BNT BT BNT 1 0 0 0 0 0 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BT and branch is not taken at if condition so we can decade next prediction state is Branch Not Taken. According to graph at right, if our state is Branch Taken and state is not taken, our prediction is Branch Not Taken
  • 11. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT BNT BT BNT BT 1 0 0 0 0 0 0 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BNT and branch is taken at for loop so we can decade next prediction state is Branch Taken. According to graph at right, if our state is Branch Not Taken and state is taken, our prediction is Branch Taken
  • 12. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT BNT BT BNT BT BT 1 0 0 0 0 0 0 1 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BT and branch is taken at if condition so we can decade next prediction state is Branch Taken. According to graph at right, if our state is Branch Taken and state is taken, our prediction is Branch Taken
  • 13. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT BNT BT BNT BT BT BT 1 0 0 0 0 0 0 1 1 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BT and branch is taken at if condition so we can decade next prediction state is Branch Taken. According to graph at right, if our state is Branch Taken and state is taken, our prediction is Branch Taken
  • 14. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT BNT BT BNT BT BT BT BNT 1 0 0 0 0 0 0 1 1 0 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … BT BNT not taken taken taken not taken Our current state is BT and branch is not taken at if condition so we can decade next prediction state is Branch Not Taken. According to graph at right, if our state is Branch Taken and state is not taken, our prediction is Branch Not Taken
  • 15. Dynamic Branch Prediction(1-bit Prediction) For i=0 If For i=1 If For i=2 If For i=3 If For i=4 If For i=5 Result BT BNT BT BNT BT BN T BT BT BT BNT BNT Prediction BT BT BNT BT BNT BT BNT BT BT BT BNT 1 0 0 0 0 0 0 1 1 0 1 … int a = 3; int i = 0; for(i =0;i<5;i++){ if(i == a) a=0; } … At the end; Our 4 predictions are correct!