SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Hafiz Hamza AshrafHafiz Hamza Ashraf
hafizhamza313@gmail.comhafizhamza313@gmail.com
PipeliningPipelining
CharacterizeCharacterize PipelinesPipelines
1)1) Hardware or software implementation – pipelining can be implemented inHardware or software implementation – pipelining can be implemented in
either software or hardware.either software or hardware.
2)2) Large or Small Scale – Stations in a pipeline can range from simplistic toLarge or Small Scale – Stations in a pipeline can range from simplistic to
powerful, and a pipeline can range in length from short to long.powerful, and a pipeline can range in length from short to long.
3)3) Synchronous or asynchronous flow – A synchronous pipeline operatesSynchronous or asynchronous flow – A synchronous pipeline operates
like an assembly line: at a given time, each station is processing somelike an assembly line: at a given time, each station is processing some
amount of information. A asynchronous pipeline, allow a station toamount of information. A asynchronous pipeline, allow a station to
forward information at any time.forward information at any time.
4)4) Buffered or unbuffered flow – One stage of pipeline sends data directly toBuffered or unbuffered flow – One stage of pipeline sends data directly to
another one or a buffer is place between each pairs of stages.another one or a buffer is place between each pairs of stages.
5)5) Finite Chunks or Continuous Bit Streams – The digital information thatFinite Chunks or Continuous Bit Streams – The digital information that
passes though a pipeline can consist of a sequence or small data itemspasses though a pipeline can consist of a sequence or small data items
or an arbitrarily long bit stream.or an arbitrarily long bit stream.
6)6) Automatic Data Feed Or Manual Data Feed – Some implementations ofAutomatic Data Feed Or Manual Data Feed – Some implementations of
pipelines use a separate mechanism to move information, and otherpipelines use a separate mechanism to move information, and other
implementations require each stage to participate in moving information.implementations require each stage to participate in moving information.
What is PipeliningWhat is Pipelining
ïź A technique used in advanced microprocessors whereA technique used in advanced microprocessors where
the microprocessor begins executing a secondthe microprocessor begins executing a second
instruction before the first has been completed.instruction before the first has been completed.
- A Pipeline is a series of stages, where some work isA Pipeline is a series of stages, where some work is
done at each stage. The work is not finished until it hasdone at each stage. The work is not finished until it has
passed through all stages.passed through all stages.
ïź With pipelining, the computer architecture allows theWith pipelining, the computer architecture allows the
next instructions to be fetched while the processor isnext instructions to be fetched while the processor is
performing arithmetic operations, holding them in aperforming arithmetic operations, holding them in a
buffer close to the processor until each instructionbuffer close to the processor until each instruction
operation can performed.operation can performed.
How Pipelines WorksHow Pipelines Works
ïź The pipeline is divided into segments andThe pipeline is divided into segments and
each segment can execute it operationeach segment can execute it operation
concurrently with the other segments.concurrently with the other segments.
Once a segment completes an operations,Once a segment completes an operations,
it passes the result to the next segment init passes the result to the next segment in
the pipeline and fetches the nextthe pipeline and fetches the next
operations from the preceding segment.operations from the preceding segment.
ExampleExample
Instructions FetchInstructions Fetch
ïź The instruction Fetch (IF) stage is responsible forThe instruction Fetch (IF) stage is responsible for
obtaining the requested instruction from memory. Theobtaining the requested instruction from memory. The
instruction and the program counter (which isinstruction and the program counter (which is
incremented to the next instruction) are stored in theincremented to the next instruction) are stored in the
IF/ID pipeline register as temporary storage so that mayIF/ID pipeline register as temporary storage so that may
be used in the next stage at the start of the next clockbe used in the next stage at the start of the next clock
cycle.cycle.
Instruction DecodeInstruction Decode
ïź The Instruction Decode (ID) stage is responsible forThe Instruction Decode (ID) stage is responsible for
decoding the instruction and sending out the variousdecoding the instruction and sending out the various
control lines to the other parts of the processor. Thecontrol lines to the other parts of the processor. The
instruction is sent to the control unit where it is decodedinstruction is sent to the control unit where it is decoded
and the registers are fetched from the register file.and the registers are fetched from the register file.
ExecutionExecution
ïź The Execution (EX) stage is where any calculations areThe Execution (EX) stage is where any calculations are
performed. The main component in this stage is theperformed. The main component in this stage is the
ALU. The ALU is made up of arithmetic, logic andALU. The ALU is made up of arithmetic, logic and
capabilities.capabilities.
Memory and IOMemory and IO
ïź The Memory and IO (MEM) stage is responsible forThe Memory and IO (MEM) stage is responsible for
storing and loading values to and from memory. It alsostoring and loading values to and from memory. It also
responsible for input or output from the processor. If theresponsible for input or output from the processor. If the
current instruction is not of Memory or IO type than thecurrent instruction is not of Memory or IO type than the
result from the ALU is passed through to the write backresult from the ALU is passed through to the write back
stage.stage.
Write BackWrite Back
ïź The Write Back (WB) stage is responsibleThe Write Back (WB) stage is responsible
for writing the result of a calculation,for writing the result of a calculation,
memory access or input into the registermemory access or input into the register
file.file.
Operation TimingsOperation Timings
ïź Estimated timings for each ofEstimated timings for each of
the stages:the stages:
InstructionInstruction
FetchFetch
2ns2ns
InstructionInstruction
DecodeDecode
1ns1ns
ExecutionExecution 2ns2ns
MemoryMemory
and IOand IO
2ns2ns
Write BackWrite Back 1ns1ns
Advantages/DisadvantagesAdvantages/Disadvantages
Advantages:Advantages:
ïź More efficient use of processorMore efficient use of processor
ïź Quicker time of execution of large number ofQuicker time of execution of large number of
instructionsinstructions
Disadvantages:Disadvantages:
ïź Pipelining involves adding hardware to the chipPipelining involves adding hardware to the chip
ïź Inability to continuously run the pipelineInability to continuously run the pipeline
at full speed because of pipeline hazardsat full speed because of pipeline hazards
which disrupt the smooth execution of thewhich disrupt the smooth execution of the
pipeline.pipeline.
Pipeline HazardsPipeline Hazards
ïź Data Hazards – an instruction uses the result of theData Hazards – an instruction uses the result of the
previous instruction. A hazard occurs exactly when anprevious instruction. A hazard occurs exactly when an
instruction tries to read a register in its ID stage that aninstruction tries to read a register in its ID stage that an
earlier instruction intends to write in its WB stage.earlier instruction intends to write in its WB stage.
ïź Control Hazards – the location of an instruction dependsControl Hazards – the location of an instruction depends
on previous instructionon previous instruction
ïź Structural Hazards – two instructions need to access theStructural Hazards – two instructions need to access the
same resourcesame resource
Data HazardsData Hazards
StallingStalling
ïź Stalling involves halting the flow of instructions until theStalling involves halting the flow of instructions until the
required result is ready to be used. However stallingrequired result is ready to be used. However stalling
wastes processor time by doing nothing while waitingwastes processor time by doing nothing while waiting
for the result.for the result.
Type of PipeliningType of Pipelining
ïź Software PipeliningSoftware Pipelining
1) Can Handle Complex Instructions1) Can Handle Complex Instructions
2) Allows programs to be reused2) Allows programs to be reused
ïź Hardware PipeliningHardware Pipelining
1) Help designer manage complexity – a1) Help designer manage complexity – a
complex task can be divided into smaller,complex task can be divided into smaller,
more manageable pieces.more manageable pieces.
2) Hardware pipelining offers higher2) Hardware pipelining offers higher
performanceperformance
Type of Hardware PipelinesType of Hardware Pipelines
ïź Instruction Pipeline -Instruction Pipeline - AnAn instruction pipelineinstruction pipeline is veryis very
similar to a manufacturing assembly line.similar to a manufacturing assembly line.
1st stage receives some parts, performs its assembly task,1st stage receives some parts, performs its assembly task,
and passes the results to the second stage;and passes the results to the second stage;
2nd stage takes the partially assembled product from the2nd stage takes the partially assembled product from the
first stage, performs its task, and passes its work to thefirst stage, performs its task, and passes its work to the
third stage;third stage;
3rd stage does its work, passing the results to the last3rd stage does its work, passing the results to the last
stage, which completes the task and outputs its results.stage, which completes the task and outputs its results.
ïź Data Pipeline – data pipeline is designed to pass dataData Pipeline – data pipeline is designed to pass data
from stage to stage.from stage to stage.
Instruction Pipelines ConflictInstruction Pipelines Conflict
ïź It divided into two categories.It divided into two categories.
ïź Data ConflictsData Conflicts
ïź Branch ConflictsBranch Conflicts
ïź When the current instruction changes a register that theWhen the current instruction changes a register that the
next one needed, data conflicts happens.next one needed, data conflicts happens.
ïź When the current instruction make a jump, branchWhen the current instruction make a jump, branch
conflicts happens.conflicts happens.
ReferencesReferences
ïź http://www.cs.sjsu.edu/~lee/cs147/fall2003http://www.cs.sjsu.edu/~lee/cs147/fall2003
/23147L25Pipelining.ppt/23147L25Pipelining.ppt
ïź http://murray.newcastle.edu.au/users/studhttp://murray.newcastle.edu.au/users/stud
ents/1999/c9311421/pipe.html#s5ents/1999/c9311421/pipe.html#s5
ïź You can comment or mail for any questionYou can comment or mail for any question
at:at:
ïź hafizhamza313@gmail.comhafizhamza313@gmail.com
ïź www.drhamza.webs.comwww.drhamza.webs.com
ThanksThanks

Weitere Àhnliche Inhalte

Was ist angesagt?

Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
Wayne Jones Jnr
 

Was ist angesagt? (20)

Operating system 32 logical versus physical address
Operating system 32 logical versus physical addressOperating system 32 logical versus physical address
Operating system 32 logical versus physical address
 
Vx works RTOS
Vx works RTOSVx works RTOS
Vx works RTOS
 
Chpt7
Chpt7Chpt7
Chpt7
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
 
Evolution of os
Evolution of osEvolution of os
Evolution of os
 
Pipelining slides
Pipelining slides Pipelining slides
Pipelining slides
 
Interrupts
InterruptsInterrupts
Interrupts
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
Application Layer
Application Layer Application Layer
Application Layer
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Pipelining and ILP (Instruction Level Parallelism)
Pipelining and ILP (Instruction Level Parallelism) Pipelining and ILP (Instruction Level Parallelism)
Pipelining and ILP (Instruction Level Parallelism)
 
Chapter 2 - Operating System Structures
Chapter 2 - Operating System StructuresChapter 2 - Operating System Structures
Chapter 2 - Operating System Structures
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
 
4 threads
4 threads4 threads
4 threads
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Superscalar Processor
Superscalar ProcessorSuperscalar Processor
Superscalar Processor
 
Superscalar processor
Superscalar processorSuperscalar processor
Superscalar processor
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Interrupts and types of interrupts
Interrupts and types of interruptsInterrupts and types of interrupts
Interrupts and types of interrupts
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 

Ähnlich wie Pipelining In computer

Pipelining 16 computers Artitacher pdf
Pipelining   16 computers Artitacher  pdfPipelining   16 computers Artitacher  pdf
Pipelining 16 computers Artitacher pdf
MadhuGupta99385
 
A survey of paradigms for building and
A survey of paradigms for building andA survey of paradigms for building and
A survey of paradigms for building and
cseij
 
Pipelining of Processors Computer Architecture
Pipelining of  Processors Computer ArchitecturePipelining of  Processors Computer Architecture
Pipelining of Processors Computer Architecture
Haris456
 
Pipelining understandingPipelining is running multiple stages of .pdf
Pipelining understandingPipelining is running multiple stages of .pdfPipelining understandingPipelining is running multiple stages of .pdf
Pipelining understandingPipelining is running multiple stages of .pdf
arasanlethers
 

Ähnlich wie Pipelining In computer (20)

Unit 3
Unit 3Unit 3
Unit 3
 
Pipeline & Nonpipeline Processor
Pipeline & Nonpipeline ProcessorPipeline & Nonpipeline Processor
Pipeline & Nonpipeline Processor
 
pipelining
pipeliningpipelining
pipelining
 
Assembly p1
Assembly p1Assembly p1
Assembly p1
 
Pipelining , structural hazards
Pipelining , structural hazardsPipelining , structural hazards
Pipelining , structural hazards
 
Pipelining 16 computers Artitacher pdf
Pipelining   16 computers Artitacher  pdfPipelining   16 computers Artitacher  pdf
Pipelining 16 computers Artitacher pdf
 
Pipelining of Processors
Pipelining of ProcessorsPipelining of Processors
Pipelining of Processors
 
A survey of paradigms for building and
A survey of paradigms for building andA survey of paradigms for building and
A survey of paradigms for building and
 
Pipelining of Processors Computer Architecture
Pipelining of  Processors Computer ArchitecturePipelining of  Processors Computer Architecture
Pipelining of Processors Computer Architecture
 
Pipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan ChowdhuryPipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan Chowdhury
 
Pipelining
PipeliningPipelining
Pipelining
 
Pipelining understandingPipelining is running multiple stages of .pdf
Pipelining understandingPipelining is running multiple stages of .pdfPipelining understandingPipelining is running multiple stages of .pdf
Pipelining understandingPipelining is running multiple stages of .pdf
 
Active Network Node in Silicon-Based L3 Gigabit Routing Switch
Active Network Node in Silicon-Based L3 Gigabit Routing SwitchActive Network Node in Silicon-Based L3 Gigabit Routing Switch
Active Network Node in Silicon-Based L3 Gigabit Routing Switch
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
 
Design pipeline architecture for various stage pipelines
Design pipeline architecture for various stage pipelinesDesign pipeline architecture for various stage pipelines
Design pipeline architecture for various stage pipelines
 
Presentation on risc pipeline
Presentation on risc pipelinePresentation on risc pipeline
Presentation on risc pipeline
 
Computer arithmetic in computer architecture
Computer arithmetic in computer architectureComputer arithmetic in computer architecture
Computer arithmetic in computer architecture
 
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksKernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
 
AFFECT OF PARALLEL COMPUTING ON MULTICORE PROCESSORS
AFFECT OF PARALLEL COMPUTING ON MULTICORE PROCESSORSAFFECT OF PARALLEL COMPUTING ON MULTICORE PROCESSORS
AFFECT OF PARALLEL COMPUTING ON MULTICORE PROCESSORS
 
Affect of parallel computing on multicore processors
Affect of parallel computing on multicore processorsAffect of parallel computing on multicore processors
Affect of parallel computing on multicore processors
 

Mehr von Talesun Solar USA Ltd.

Mehr von Talesun Solar USA Ltd. (13)

What is http?
What is http?What is http?
What is http?
 
Inner Join In Ms Access
Inner Join In Ms AccessInner Join In Ms Access
Inner Join In Ms Access
 
History of Database
History  of DatabaseHistory  of Database
History of Database
 
How to delect data with the help of
How to delect data with the help ofHow to delect data with the help of
How to delect data with the help of
 
Sale management
Sale managementSale management
Sale management
 
E commerce
E commerceE commerce
E commerce
 
Entity relationship diagram
Entity relationship diagramEntity relationship diagram
Entity relationship diagram
 
Wi fi
Wi fiWi fi
Wi fi
 
Vehicular ad hoc network
Vehicular ad hoc networkVehicular ad hoc network
Vehicular ad hoc network
 
Satellite network
Satellite networkSatellite network
Satellite network
 
Password
PasswordPassword
Password
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Bluetooth
BluetoothBluetooth
Bluetooth
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

KĂŒrzlich hochgeladen (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

Pipelining In computer

  • 1. Hafiz Hamza AshrafHafiz Hamza Ashraf hafizhamza313@gmail.comhafizhamza313@gmail.com
  • 3. CharacterizeCharacterize PipelinesPipelines 1)1) Hardware or software implementation – pipelining can be implemented inHardware or software implementation – pipelining can be implemented in either software or hardware.either software or hardware. 2)2) Large or Small Scale – Stations in a pipeline can range from simplistic toLarge or Small Scale – Stations in a pipeline can range from simplistic to powerful, and a pipeline can range in length from short to long.powerful, and a pipeline can range in length from short to long. 3)3) Synchronous or asynchronous flow – A synchronous pipeline operatesSynchronous or asynchronous flow – A synchronous pipeline operates like an assembly line: at a given time, each station is processing somelike an assembly line: at a given time, each station is processing some amount of information. A asynchronous pipeline, allow a station toamount of information. A asynchronous pipeline, allow a station to forward information at any time.forward information at any time. 4)4) Buffered or unbuffered flow – One stage of pipeline sends data directly toBuffered or unbuffered flow – One stage of pipeline sends data directly to another one or a buffer is place between each pairs of stages.another one or a buffer is place between each pairs of stages. 5)5) Finite Chunks or Continuous Bit Streams – The digital information thatFinite Chunks or Continuous Bit Streams – The digital information that passes though a pipeline can consist of a sequence or small data itemspasses though a pipeline can consist of a sequence or small data items or an arbitrarily long bit stream.or an arbitrarily long bit stream. 6)6) Automatic Data Feed Or Manual Data Feed – Some implementations ofAutomatic Data Feed Or Manual Data Feed – Some implementations of pipelines use a separate mechanism to move information, and otherpipelines use a separate mechanism to move information, and other implementations require each stage to participate in moving information.implementations require each stage to participate in moving information.
  • 4. What is PipeliningWhat is Pipelining ïź A technique used in advanced microprocessors whereA technique used in advanced microprocessors where the microprocessor begins executing a secondthe microprocessor begins executing a second instruction before the first has been completed.instruction before the first has been completed. - A Pipeline is a series of stages, where some work isA Pipeline is a series of stages, where some work is done at each stage. The work is not finished until it hasdone at each stage. The work is not finished until it has passed through all stages.passed through all stages. ïź With pipelining, the computer architecture allows theWith pipelining, the computer architecture allows the next instructions to be fetched while the processor isnext instructions to be fetched while the processor is performing arithmetic operations, holding them in aperforming arithmetic operations, holding them in a buffer close to the processor until each instructionbuffer close to the processor until each instruction operation can performed.operation can performed.
  • 5. How Pipelines WorksHow Pipelines Works ïź The pipeline is divided into segments andThe pipeline is divided into segments and each segment can execute it operationeach segment can execute it operation concurrently with the other segments.concurrently with the other segments. Once a segment completes an operations,Once a segment completes an operations, it passes the result to the next segment init passes the result to the next segment in the pipeline and fetches the nextthe pipeline and fetches the next operations from the preceding segment.operations from the preceding segment.
  • 7.
  • 8. Instructions FetchInstructions Fetch ïź The instruction Fetch (IF) stage is responsible forThe instruction Fetch (IF) stage is responsible for obtaining the requested instruction from memory. Theobtaining the requested instruction from memory. The instruction and the program counter (which isinstruction and the program counter (which is incremented to the next instruction) are stored in theincremented to the next instruction) are stored in the IF/ID pipeline register as temporary storage so that mayIF/ID pipeline register as temporary storage so that may be used in the next stage at the start of the next clockbe used in the next stage at the start of the next clock cycle.cycle.
  • 9. Instruction DecodeInstruction Decode ïź The Instruction Decode (ID) stage is responsible forThe Instruction Decode (ID) stage is responsible for decoding the instruction and sending out the variousdecoding the instruction and sending out the various control lines to the other parts of the processor. Thecontrol lines to the other parts of the processor. The instruction is sent to the control unit where it is decodedinstruction is sent to the control unit where it is decoded and the registers are fetched from the register file.and the registers are fetched from the register file.
  • 10. ExecutionExecution ïź The Execution (EX) stage is where any calculations areThe Execution (EX) stage is where any calculations are performed. The main component in this stage is theperformed. The main component in this stage is the ALU. The ALU is made up of arithmetic, logic andALU. The ALU is made up of arithmetic, logic and capabilities.capabilities.
  • 11. Memory and IOMemory and IO ïź The Memory and IO (MEM) stage is responsible forThe Memory and IO (MEM) stage is responsible for storing and loading values to and from memory. It alsostoring and loading values to and from memory. It also responsible for input or output from the processor. If theresponsible for input or output from the processor. If the current instruction is not of Memory or IO type than thecurrent instruction is not of Memory or IO type than the result from the ALU is passed through to the write backresult from the ALU is passed through to the write back stage.stage.
  • 12. Write BackWrite Back ïź The Write Back (WB) stage is responsibleThe Write Back (WB) stage is responsible for writing the result of a calculation,for writing the result of a calculation, memory access or input into the registermemory access or input into the register file.file.
  • 13. Operation TimingsOperation Timings ïź Estimated timings for each ofEstimated timings for each of the stages:the stages: InstructionInstruction FetchFetch 2ns2ns InstructionInstruction DecodeDecode 1ns1ns ExecutionExecution 2ns2ns MemoryMemory and IOand IO 2ns2ns Write BackWrite Back 1ns1ns
  • 14. Advantages/DisadvantagesAdvantages/Disadvantages Advantages:Advantages: ïź More efficient use of processorMore efficient use of processor ïź Quicker time of execution of large number ofQuicker time of execution of large number of instructionsinstructions Disadvantages:Disadvantages: ïź Pipelining involves adding hardware to the chipPipelining involves adding hardware to the chip ïź Inability to continuously run the pipelineInability to continuously run the pipeline at full speed because of pipeline hazardsat full speed because of pipeline hazards which disrupt the smooth execution of thewhich disrupt the smooth execution of the pipeline.pipeline.
  • 15. Pipeline HazardsPipeline Hazards ïź Data Hazards – an instruction uses the result of theData Hazards – an instruction uses the result of the previous instruction. A hazard occurs exactly when anprevious instruction. A hazard occurs exactly when an instruction tries to read a register in its ID stage that aninstruction tries to read a register in its ID stage that an earlier instruction intends to write in its WB stage.earlier instruction intends to write in its WB stage. ïź Control Hazards – the location of an instruction dependsControl Hazards – the location of an instruction depends on previous instructionon previous instruction ïź Structural Hazards – two instructions need to access theStructural Hazards – two instructions need to access the same resourcesame resource
  • 17. StallingStalling ïź Stalling involves halting the flow of instructions until theStalling involves halting the flow of instructions until the required result is ready to be used. However stallingrequired result is ready to be used. However stalling wastes processor time by doing nothing while waitingwastes processor time by doing nothing while waiting for the result.for the result.
  • 18.
  • 19. Type of PipeliningType of Pipelining ïź Software PipeliningSoftware Pipelining 1) Can Handle Complex Instructions1) Can Handle Complex Instructions 2) Allows programs to be reused2) Allows programs to be reused ïź Hardware PipeliningHardware Pipelining 1) Help designer manage complexity – a1) Help designer manage complexity – a complex task can be divided into smaller,complex task can be divided into smaller, more manageable pieces.more manageable pieces. 2) Hardware pipelining offers higher2) Hardware pipelining offers higher performanceperformance
  • 20. Type of Hardware PipelinesType of Hardware Pipelines ïź Instruction Pipeline -Instruction Pipeline - AnAn instruction pipelineinstruction pipeline is veryis very similar to a manufacturing assembly line.similar to a manufacturing assembly line. 1st stage receives some parts, performs its assembly task,1st stage receives some parts, performs its assembly task, and passes the results to the second stage;and passes the results to the second stage; 2nd stage takes the partially assembled product from the2nd stage takes the partially assembled product from the first stage, performs its task, and passes its work to thefirst stage, performs its task, and passes its work to the third stage;third stage; 3rd stage does its work, passing the results to the last3rd stage does its work, passing the results to the last stage, which completes the task and outputs its results.stage, which completes the task and outputs its results. ïź Data Pipeline – data pipeline is designed to pass dataData Pipeline – data pipeline is designed to pass data from stage to stage.from stage to stage.
  • 21. Instruction Pipelines ConflictInstruction Pipelines Conflict ïź It divided into two categories.It divided into two categories. ïź Data ConflictsData Conflicts ïź Branch ConflictsBranch Conflicts ïź When the current instruction changes a register that theWhen the current instruction changes a register that the next one needed, data conflicts happens.next one needed, data conflicts happens. ïź When the current instruction make a jump, branchWhen the current instruction make a jump, branch conflicts happens.conflicts happens.
  • 23. ïź You can comment or mail for any questionYou can comment or mail for any question at:at: ïź hafizhamza313@gmail.comhafizhamza313@gmail.com ïź www.drhamza.webs.comwww.drhamza.webs.com ThanksThanks