SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
Hazards in Pipeline
Prepared by : Ms. Snehalata Agasti
CSE department
Hazards
 Hazards means problem occurs in instruction pipeline (or) if two or more
microoperations occurred at same time than hazards occurs.
 It is of three types.
-Data hazards
-Control hazards
-Structural hazards
e.g. multiple instructions wants to access single ALU or memory. These are
called stall in pipeline.
➢ Hazards can be avoided by using operand forwarding, renaming , branch
prediction technique or by introducing some stall cycles.
Structural hazards
 Structural hazards occurs when more than one instructions in pipeline and
they need same resource.
 It is also known as resource hazards.
 This problem can be solved by increasing the resources.
F D W
F D W
F D W
t0 t1 t2
I1
I2
I3
Both micro
operations need
memory
operations
Control hazards
 When branch instruction is executed and some wrong predictions happened
then some instructions brought into pipelining can be discarded, that is
called control hazards/branch hazards. E.g.
100: goto lb:
101: Instruction1;
102: Instruction2;
103: Instruction3;
104lb:
Instruction4;
 By using branch predictions or by increasing latency , control hazards can be
avoided.
Instruction1 and
Instruction2 is
loaded in pipeline
Wrong
prediction
Data hazards
 When data dependency is present in instructions that is called data hazards.
Data is modified in different stages.
 It is of three types
-RAW
-WAR
-WAW
 E.g. instruction-1: C=A+B;
instruction-2: E=C+D
 Data hazards can be avoided by using Operand forwarding.
RAW(Read After Write)
 RAW data hazards occurs when our required result is not found after the
execution of instructions.
 E.g I1 -: R2  R7 + R5
I2 -: R4  R2 + R3
 Instrution-2 should be executed after the complete execution of instruction-
1. If R2 in I2 is read before writing operation performed in I1 then RAW data
hazards can be occurred.
WAR(Wite After Read)
 WAR data hazards occurs when our awaited result is not found after the
execution of instructions.
 E.g I1 -: R2  R7 + R5
I2 -: R5  R2 + R3
 Instrution-2 should be executed after the complete execution of instruction-
1. If R5 in I2 is stored before reading operation performed in I1 then WAR
conflict can be occurred.
WAW(Write After Write)
 WAR data hazards occurs when our proper result is not found after the
complete execution of instructions.
 E.g I1 -: R4  R1 + R5
I2 -: R4  R1 + R3
 Instrution-2 should be executed after the complete execution of instruction-
1. If R4 in I2 is stored before writing operation performed in I1 then WAW data
hazards can be occurred.
Hazards in pipeline

Contenu connexe

Tendances

Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
Fraboni Ec
 
Superscalar & superpipeline processor
Superscalar & superpipeline processorSuperscalar & superpipeline processor
Superscalar & superpipeline processor
Muhammad Ishaq
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
Anuj Modi
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
Haris456
 

Tendances (20)

Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Pipelining
PipeliningPipelining
Pipelining
 
ADDRESSING MODES
ADDRESSING MODESADDRESSING MODES
ADDRESSING MODES
 
DMA operation
DMA operationDMA operation
DMA operation
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Superscalar & superpipeline processor
Superscalar & superpipeline processorSuperscalar & superpipeline processor
Superscalar & superpipeline processor
 
pipelining
pipeliningpipelining
pipelining
 
Branch prediction
Branch predictionBranch prediction
Branch prediction
 
Pipelining and vector processing
Pipelining and vector processingPipelining and vector processing
Pipelining and vector processing
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
pipelining
pipeliningpipelining
pipelining
 
Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Pipelining powerpoint presentation
Pipelining powerpoint presentationPipelining powerpoint presentation
Pipelining powerpoint presentation
 
pipelining
pipeliningpipelining
pipelining
 
Hazards Computer Architecture
Hazards Computer ArchitectureHazards Computer Architecture
Hazards Computer Architecture
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
 

Similaire à Hazards in pipeline

Pipeline and data hazard
Pipeline and data hazardPipeline and data hazard
Pipeline and data hazard
Waed Shagareen
 
Other FacilityICCP MasterHistorianDatabaseSCADA.docx
Other FacilityICCP MasterHistorianDatabaseSCADA.docxOther FacilityICCP MasterHistorianDatabaseSCADA.docx
Other FacilityICCP MasterHistorianDatabaseSCADA.docx
gerardkortney
 
pipehhhhhhhhhhhhhbbbbbbbbblinehazards.ppt
pipehhhhhhhhhhhhhbbbbbbbbblinehazards.pptpipehhhhhhhhhhhhhbbbbbbbbblinehazards.ppt
pipehhhhhhhhhhhhhbbbbbbbbblinehazards.ppt
AkkiDongre
 

Similaire à Hazards in pipeline (20)

High Performance Computer Architecture
High Performance Computer ArchitectureHigh Performance Computer Architecture
High Performance Computer Architecture
 
Hazard.pptx
Hazard.pptxHazard.pptx
Hazard.pptx
 
module2.ppt
module2.pptmodule2.ppt
module2.ppt
 
Pipeline and data hazard
Pipeline and data hazardPipeline and data hazard
Pipeline and data hazard
 
pipelining and hazards occure in assembly language.
pipelining and hazards occure in assembly language.pipelining and hazards occure in assembly language.
pipelining and hazards occure in assembly language.
 
Pipelinig hazardous
Pipelinig hazardousPipelinig hazardous
Pipelinig hazardous
 
hazard new.ppt
hazard new.ppthazard new.ppt
hazard new.ppt
 
Unit 2 contd. and( unit 3 voice over ppt)
Unit 2 contd. and( unit 3   voice over ppt)Unit 2 contd. and( unit 3   voice over ppt)
Unit 2 contd. and( unit 3 voice over ppt)
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 
Assembly p1
Assembly p1Assembly p1
Assembly p1
 
Dependencies
DependenciesDependencies
Dependencies
 
Computer Architecture and Organization
Computer Architecture and OrganizationComputer Architecture and Organization
Computer Architecture and Organization
 
CALecture3Module1.ppt
CALecture3Module1.pptCALecture3Module1.ppt
CALecture3Module1.ppt
 
Other FacilityICCP MasterHistorianDatabaseSCADA.docx
Other FacilityICCP MasterHistorianDatabaseSCADA.docxOther FacilityICCP MasterHistorianDatabaseSCADA.docx
Other FacilityICCP MasterHistorianDatabaseSCADA.docx
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler Techniques
 
Pipeline hazards in computer Architecture ppt
Pipeline hazards in computer Architecture pptPipeline hazards in computer Architecture ppt
Pipeline hazards in computer Architecture ppt
 
CA UNIT III.pptx
CA UNIT III.pptxCA UNIT III.pptx
CA UNIT III.pptx
 
Core pipelining
Core pipelining Core pipelining
Core pipelining
 
pipehhhhhhhhhhhhhbbbbbbbbblinehazards.ppt
pipehhhhhhhhhhhhhbbbbbbbbblinehazards.pptpipehhhhhhhhhhhhhbbbbbbbbblinehazards.ppt
pipehhhhhhhhhhhhhbbbbbbbbblinehazards.ppt
 
print.pptx
print.pptxprint.pptx
print.pptx
 

Plus de SnehalataAgasti (7)

Cache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniquesCache replacement policies,cache miss,writingtechniques
Cache replacement policies,cache miss,writingtechniques
 
Associative memory and set associative memory mapping
Associative memory and set associative memory mappingAssociative memory and set associative memory mapping
Associative memory and set associative memory mapping
 
Memory mapping
Memory mappingMemory mapping
Memory mapping
 
Memory organisation
Memory organisationMemory organisation
Memory organisation
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
 
BOOTH Algorithm for Multiplication
BOOTH Algorithm for MultiplicationBOOTH Algorithm for Multiplication
BOOTH Algorithm for Multiplication
 
Division algorithm
Division algorithmDivision algorithm
Division algorithm
 

Dernier

ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Teachers record management system project report..pdf
Teachers record management system project report..pdfTeachers record management system project report..pdf
Teachers record management system project report..pdf
Kamal Acharya
 

Dernier (20)

E-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are presentE-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are present
 
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
RM&IPR M5 notes.pdfResearch Methodolgy & Intellectual Property Rights Series 5
 
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
 
Circuit Breaker arc phenomenon.pdf engineering
Circuit Breaker arc phenomenon.pdf engineeringCircuit Breaker arc phenomenon.pdf engineering
Circuit Breaker arc phenomenon.pdf engineering
 
ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdf
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
 
Multivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptxMultivibrator and its types defination and usges.pptx
Multivibrator and its types defination and usges.pptx
 
Artificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian ReasoningArtificial Intelligence Bayesian Reasoning
Artificial Intelligence Bayesian Reasoning
 
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdfONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
ONLINE VEHICLE RENTAL SYSTEM PROJECT REPORT.pdf
 
Lesson no16 application of Induction Generator in Wind.ppsx
Lesson no16 application of Induction Generator in Wind.ppsxLesson no16 application of Induction Generator in Wind.ppsx
Lesson no16 application of Induction Generator in Wind.ppsx
 
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWINGBRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
BRAKING SYSTEM IN INDIAN RAILWAY AutoCAD DRAWING
 
Quiz application system project report..pdf
Quiz application system project report..pdfQuiz application system project report..pdf
Quiz application system project report..pdf
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfRESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
 
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...Software Engineering - Modelling Concepts + Class Modelling + Building the An...
Software Engineering - Modelling Concepts + Class Modelling + Building the An...
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 
Teachers record management system project report..pdf
Teachers record management system project report..pdfTeachers record management system project report..pdf
Teachers record management system project report..pdf
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 

Hazards in pipeline

  • 1. Hazards in Pipeline Prepared by : Ms. Snehalata Agasti CSE department
  • 2. Hazards  Hazards means problem occurs in instruction pipeline (or) if two or more microoperations occurred at same time than hazards occurs.  It is of three types. -Data hazards -Control hazards -Structural hazards e.g. multiple instructions wants to access single ALU or memory. These are called stall in pipeline. ➢ Hazards can be avoided by using operand forwarding, renaming , branch prediction technique or by introducing some stall cycles.
  • 3. Structural hazards  Structural hazards occurs when more than one instructions in pipeline and they need same resource.  It is also known as resource hazards.  This problem can be solved by increasing the resources. F D W F D W F D W t0 t1 t2 I1 I2 I3 Both micro operations need memory operations
  • 4. Control hazards  When branch instruction is executed and some wrong predictions happened then some instructions brought into pipelining can be discarded, that is called control hazards/branch hazards. E.g. 100: goto lb: 101: Instruction1; 102: Instruction2; 103: Instruction3; 104lb: Instruction4;  By using branch predictions or by increasing latency , control hazards can be avoided. Instruction1 and Instruction2 is loaded in pipeline Wrong prediction
  • 5. Data hazards  When data dependency is present in instructions that is called data hazards. Data is modified in different stages.  It is of three types -RAW -WAR -WAW  E.g. instruction-1: C=A+B; instruction-2: E=C+D  Data hazards can be avoided by using Operand forwarding.
  • 6. RAW(Read After Write)  RAW data hazards occurs when our required result is not found after the execution of instructions.  E.g I1 -: R2  R7 + R5 I2 -: R4  R2 + R3  Instrution-2 should be executed after the complete execution of instruction- 1. If R2 in I2 is read before writing operation performed in I1 then RAW data hazards can be occurred.
  • 7. WAR(Wite After Read)  WAR data hazards occurs when our awaited result is not found after the execution of instructions.  E.g I1 -: R2  R7 + R5 I2 -: R5  R2 + R3  Instrution-2 should be executed after the complete execution of instruction- 1. If R5 in I2 is stored before reading operation performed in I1 then WAR conflict can be occurred.
  • 8. WAW(Write After Write)  WAR data hazards occurs when our proper result is not found after the complete execution of instructions.  E.g I1 -: R4  R1 + R5 I2 -: R4  R1 + R3  Instrution-2 should be executed after the complete execution of instruction- 1. If R4 in I2 is stored before writing operation performed in I1 then WAW data hazards can be occurred.