SlideShare a Scribd company logo
9
Most read
11
Most read
16
Most read
In the name ofAllah who is most beneficial and most merciful
Rules
•You can ask question after completion of topics.
•Your questions should be according to topic.
•Any misbehave during presentation would lead you to
some serious actions like asked to leave the class room.
Topic Outline
• What is Pipelining?
• Types of Pipelining.
• What is Data Hazard?
• Types of Data Hazard.
• Solutions for Data Hazards.
Pipelining
• A technique used in advanced microprocessors where
the microprocessor begins executing a second
instruction before the first has been completed.
• That is, several instructions are in the pipeline
simultaneously, each at a different processing stage.
Types of Pipelining
CONTROL
HAZARD
DATA
HAZARD
STRUCTURE
HAZARD
Pipelining
• A situation that prevent the starting next instruction in the next cycle
• They reduce speedup of pipeline execution
• Hazards can always be resolved by waiting
HAZARD
• Attempt to use item before it is ready
• Instruction depends on result of prior instruction still in the pipeline
DATA HAZARD
@
@
Any Questions???
Types of Data Hazard
RAW WAR WAW
DATA
HAZARD
RAW(Read AfterWrite)
• It is also known asTRUE DEPENDENCY .
• An instruction modifies a register or memory location
• Succeeding instruction reads data in that location
• Hazard if read takes place before write complete
Write After Read (RAW)
• It is also known as Anti dependency
• An instruction reads a register or memory location
• Succeeding instruction writes to location
• Hazard if write completes before read takes place
Write AfterWrite (RAW)
•Two instructions both write to same location
•Hazard if writes take place in reverse of order intended
sequence
Any Questions???
Problem with Data Hazard
Problem
• All the instructions after the ADD use the result of the ADD instruction (in R1).The ADD
instruction writes the value of R1 in theWB stage .
• SUB instruction reads the value during ID stage (IDsub).This problem is called a data hazard
Two instruction with add and Sub using three register
$sO(in addition) and $t2(in subtraction) =Destination Register
$tO , $t1 and $t3 are Read /Write Register
While $sO is read/write register in Subtraction instruction
Data hazard occur at this stage
Solution of Data Hazard
Solution
Data Hazards – Forwarding
• Key idea: connect new value directly to next stage
• Still read s0, but ignore in favor of new result
Forwarding-Data HazardA instruction goes into four
state
Let two instruction
Add $sO, $tO , $t1
Sub $t2, $sO ,$t3
How to avoid data hazard?
$sO
register
If we use this path as shown by
arrow then we left the $sO
register for instruction SUB
Solution
• Usually solved by data or register forwarding (bypassing or short-circuiting).
This is based on the fact that the data selected is not really used in ID but in
the next stage: ALU.
• Forwarding works as follows: ALU result from EX/MEM buffer is always fed
back to the ALU input keys. If the forwarding hardware detects that its
source operand has a new value, the logic selects the newer result rather
than the value read from the register file.
Any Question???

More Related Content

PPT
Pipeline hazards in computer Architecture ppt
PPT
Pipelining in computer architecture
PPT
Control Memory
PPTX
memory system notes.pptx
PPT
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
PPTX
Chapter 02 instructions language of the computer
PPTX
instruction format and addressing modes
PPTX
Basic Processing Unit
Pipeline hazards in computer Architecture ppt
Pipelining in computer architecture
Control Memory
memory system notes.pptx
Chapter 3 INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 02 instructions language of the computer
instruction format and addressing modes
Basic Processing Unit

What's hot (20)

PPTX
PPT
Data transfer and manipulation
PPTX
Chapter 03 arithmetic for computers
PPTX
Bus aribration
PPTX
What is Gray Code?
PPTX
Pipelining powerpoint presentation
PPTX
Asynchronous data transfer
PPTX
Operating system critical section
PPTX
Stack organization
PPTX
Computer organization and architecture
PPTX
Synchronization hardware
PPTX
Huffman Coding Algorithm Presentation
PPT
Modes Of Transfer in Input/Output Organization
PPT
1.1 binary tree
PPTX
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
PPTX
Addressing modes
PPTX
Asynchronous Data Transfer.pptx
PPTX
Input Output Organization
PPTX
PCI BUS
PPT
Registers
Data transfer and manipulation
Chapter 03 arithmetic for computers
Bus aribration
What is Gray Code?
Pipelining powerpoint presentation
Asynchronous data transfer
Operating system critical section
Stack organization
Computer organization and architecture
Synchronization hardware
Huffman Coding Algorithm Presentation
Modes Of Transfer in Input/Output Organization
1.1 binary tree
Modes of transfer - Computer Organization & Architecture - Nithiyapriya Pasav...
Addressing modes
Asynchronous Data Transfer.pptx
Input Output Organization
PCI BUS
Registers
Ad

Similar to Data Hazard and Solution for Data Hazard (20)

PPT
Pipelining & All Hazards Solution
PDF
Pipeline and data hazard
PPT
High Performance Computer Architecture
PDF
Hazards in pipeline
PPTX
pipelining and hazards occure in assembly language.
PPT
module2.ppt
PPTX
Pipelining Hazards important points .pptx
PPTX
Data Hazards and its Handling Methods.pptx
PPT
hazard new.ppt
PPT
Pipelinig hazardous
PPTX
Hazard.pptx
PPTX
Data Hazards Computer Architecture and processor
PPTX
Data Hazards Pipeline MC and Architecture
PPT
Presentation copy
PPT
Ct213 processor design_pipelinehazard
PPTX
Assembly p1
PPT
PipelineHazards _
PPTX
Pipeline hazards | Structural Hazard, Data Hazard & Control Hazard
PPTX
4. Pipeline Hazards.pptx
PPT
L12-Forwarding.ppt
Pipelining & All Hazards Solution
Pipeline and data hazard
High Performance Computer Architecture
Hazards in pipeline
pipelining and hazards occure in assembly language.
module2.ppt
Pipelining Hazards important points .pptx
Data Hazards and its Handling Methods.pptx
hazard new.ppt
Pipelinig hazardous
Hazard.pptx
Data Hazards Computer Architecture and processor
Data Hazards Pipeline MC and Architecture
Presentation copy
Ct213 processor design_pipelinehazard
Assembly p1
PipelineHazards _
Pipeline hazards | Structural Hazard, Data Hazard & Control Hazard
4. Pipeline Hazards.pptx
L12-Forwarding.ppt
Ad

More from COMSATS Institute of Information Technology (10)

PPTX
Virtual memory, allocaton of frame & trashing
PPTX
Virtual memory ,Allocaton of frame & Trashing
DOCX
Network cables-Imdad Hussain
DOCX
COMUNICATION NETWORK NETWORK TOPOLOGY NETWORK CABLES NETWORK DEVICES
DOCX
DOCX
Amdahl`s law -Processor performance
DOC
Sequnce diagram for ONLINE EXAMINATION SYSTEM
DOCX
DHCP Server Guaidlines using CISCO PACKET TRACER
Virtual memory, allocaton of frame & trashing
Virtual memory ,Allocaton of frame & Trashing
Network cables-Imdad Hussain
COMUNICATION NETWORK NETWORK TOPOLOGY NETWORK CABLES NETWORK DEVICES
Amdahl`s law -Processor performance
Sequnce diagram for ONLINE EXAMINATION SYSTEM
DHCP Server Guaidlines using CISCO PACKET TRACER

Recently uploaded (20)

PDF
Insiders guide to clinical Medicine.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Cell Structure & Organelles in detailed.
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Pharma ospi slides which help in ospi learning
Insiders guide to clinical Medicine.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPH.pptx obstetrics and gynecology in nursing
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
O7-L3 Supply Chain Operations - ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
102 student loan defaulters named and shamed – Is someone you know on the list?
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Cell Structure & Organelles in detailed.
VCE English Exam - Section C Student Revision Booklet
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Microbial disease of the cardiovascular and lymphatic systems
Pharma ospi slides which help in ospi learning

Data Hazard and Solution for Data Hazard

  • 1. In the name ofAllah who is most beneficial and most merciful
  • 2. Rules •You can ask question after completion of topics. •Your questions should be according to topic. •Any misbehave during presentation would lead you to some serious actions like asked to leave the class room.
  • 3. Topic Outline • What is Pipelining? • Types of Pipelining. • What is Data Hazard? • Types of Data Hazard. • Solutions for Data Hazards.
  • 4. Pipelining • A technique used in advanced microprocessors where the microprocessor begins executing a second instruction before the first has been completed. • That is, several instructions are in the pipeline simultaneously, each at a different processing stage.
  • 6. • A situation that prevent the starting next instruction in the next cycle • They reduce speedup of pipeline execution • Hazards can always be resolved by waiting HAZARD
  • 7. • Attempt to use item before it is ready • Instruction depends on result of prior instruction still in the pipeline DATA HAZARD @ @
  • 9. Types of Data Hazard RAW WAR WAW DATA HAZARD
  • 10. RAW(Read AfterWrite) • It is also known asTRUE DEPENDENCY . • An instruction modifies a register or memory location • Succeeding instruction reads data in that location • Hazard if read takes place before write complete
  • 11. Write After Read (RAW) • It is also known as Anti dependency • An instruction reads a register or memory location • Succeeding instruction writes to location • Hazard if write completes before read takes place
  • 12. Write AfterWrite (RAW) •Two instructions both write to same location •Hazard if writes take place in reverse of order intended sequence
  • 14. Problem with Data Hazard Problem
  • 15. • All the instructions after the ADD use the result of the ADD instruction (in R1).The ADD instruction writes the value of R1 in theWB stage . • SUB instruction reads the value during ID stage (IDsub).This problem is called a data hazard
  • 16. Two instruction with add and Sub using three register $sO(in addition) and $t2(in subtraction) =Destination Register $tO , $t1 and $t3 are Read /Write Register While $sO is read/write register in Subtraction instruction Data hazard occur at this stage
  • 17. Solution of Data Hazard Solution
  • 18. Data Hazards – Forwarding • Key idea: connect new value directly to next stage • Still read s0, but ignore in favor of new result
  • 19. Forwarding-Data HazardA instruction goes into four state Let two instruction Add $sO, $tO , $t1 Sub $t2, $sO ,$t3 How to avoid data hazard? $sO register If we use this path as shown by arrow then we left the $sO register for instruction SUB
  • 20. Solution • Usually solved by data or register forwarding (bypassing or short-circuiting). This is based on the fact that the data selected is not really used in ID but in the next stage: ALU. • Forwarding works as follows: ALU result from EX/MEM buffer is always fed back to the ALU input keys. If the forwarding hardware detects that its source operand has a new value, the logic selects the newer result rather than the value read from the register file.