SlideShare una empresa de Scribd logo
1 de 39
Descargar para leer sin conexión
Chapter 06: Instruction Pipelining and
         Parallel Processing


               Lesson 1:
          Instruction Pipeline
Objective

• Learn Instruction pipelining and processing in
a pipelined processor
• Learn how a designer implements pipeline
• Learn what are cycle time, pipeline latency and
throughput




          Schaum’s Outline of Theory and Problems of Computer Architecture       2
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Early Computers




  Schaum’s Outline of Theory and Problems of Computer Architecture       3
Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Early Computers

• Executed instructions in a very
  straightforward fashion
• Five steps sequentially in the processor to
  execute an instruction




         Schaum’s Outline of Theory and Problems of Computer Architecture       4
       Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Five steps in Straightforward Execution
(i) Fetch an instruction from memory
(ii) Decode it to determine what the instruction is
(iii) Read the instruction’s inputs from registers at the
   register file
(iv) Performed the computations required by the
   instruction
(v) Wrote the result back into the registers at the register
   file



           Schaum’s Outline of Theory and Problems of Computer Architecture       5
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instruction Fetch

   IR                     PC
                                        Address
          Processor                                                      Memory

                                            Data




• Fetch an instruction from memory: Steps 1a and 1b) Processor
requests instruction from memory using address in PC (or IP)
register
Memory using data bus returns the instruction to IR register

              Schaum’s Outline of Theory and Problems of Computer Architecture       6
            Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instruction decoding, read operands and execution

    IR        ID              PC
                                            Address
           Processor                                                    Memory

                                             Data

 • Decode it to determine what the instruction is in Step 2)
 Processor decodes instruction and places at ID register


 Read Operands and Execute Steps 3and 4) Read the instruction’s
 inputs from registers at the register file and Processor executes
 instruction at execution unit

               Schaum’s Outline of Theory and Problems of Computer Architecture       7
             Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Result Write back and PC update for the next

                         PC
                                        Address
                                                                         Memory
         Processor
                                            Data




• Write the result back into the registers at the register file and PC
updates Steps 5a and 5b) Result of instruction written back for
register or memory and PC updates for next instruction


              Schaum’s Outline of Theory and Problems of Computer Architecture       8
            Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instruction Execution Approach in Early
              Computers

• Instructions at the processor instruction set
  that accessed memory slightly different
• But each instruction completely finished
  before the execution of next one began




          Schaum’s Outline of Theory and Problems of Computer Architecture       9
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Problem
• Different Hardware (circuits) needed to
  perform each of the five steps (instruction
  fetch, instruction decode, register read,
  instruction execution, and register write back)
• Most of the hardware (most part of the
  processor circuits) idle at any given moment




          Schaum’s Outline of Theory and Problems of Computer Architecture       10
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Remaining Steps Hardware Waiting

• Most part of the processor circuits waiting for
  the other parts of the processor to complete that
  part of executing an instruction




           Schaum’s Outline of Theory and Problems of Computer Architecture       11
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Analogy

• In many ways, this is similar to baking several
  loaves of bread cakes
• Making the batter for one cake loaf (step 1)
• Baking the cake loaf (step 2)
• Cooling of the cake (step 3)
• Repeating the entire three step process for next
  cake



           Schaum’s Outline of Theory and Problems of Computer Architecture       12
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
New Computers




  Schaum’s Outline of Theory and Problems of Computer Architecture       13
Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
New Computers
• Hardware (circuits) needed to perform each of
  the five steps (instruction fetch, instruction
  decode, register read, instruction execution,
  and register write back) utilized simultaneously
  for 5 instructions
• Most of the hardware not idle at any given
  moment




          Schaum’s Outline of Theory and Problems of Computer Architecture       14
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Remaining steps hardware does not wait

• No wait of the most part of the processor
  circuits for the other parts of the processor to
  complete that part of executing an instruction




           Schaum’s Outline of Theory and Problems of Computer Architecture       15
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Baking Analogy

• While each of the three steps of baking each loaf
  cake of bread has to be done in order and takes a
  set amount of time, one person could bake
  several cakes loaves of bread much faster




          Schaum’s Outline of Theory and Problems of Computer Architecture       16
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Baking Analogy

• By making the batter for the second loaf
  cake while first loaf cake is baking
• Making the batter for the third cake loaf
  while the second loaf cake is baking
• First loaf cake cooling
• Continuing this process with each loaf cake
  so that there are three loaves of bread
  cakes in progress at any time

          Schaum’s Outline of Theory and Problems of Computer Architecture       17
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Baking Analogy

• Each loaf of bread would take the same amount
  of time but the number of loaves for cakes made
  in a given amount of time would increase (by
  about three)




           Schaum’s Outline of Theory and Problems of Computer Architecture       18
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instruction Pipeline




  Schaum’s Outline of Theory and Problems of Computer Architecture       19
Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instruction Pipeline

• A technique for overlapping the execution of
  several instructions to reduce the execution
  time of a set of instructions




         Schaum’s Outline of Theory and Problems of Computer Architecture       20
       Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Exemplary processors using Instruction
              Pipeline

• 80x86
• Pentium
• ARM




        Schaum’s Outline of Theory and Problems of Computer Architecture       21
      Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instruction Execution Time and Execution
        Time of Set of Instructions
• Similar to the baking analogy, each instruction
  takes the same amount of time to execute in a
  pipelined processor as it would in an unpipelined
  processor (longer, actually, because pipelining
  adds hardware to the processor), but overlapping
  instruction execution increases the rate at which
  instructions can be executed




           Schaum’s Outline of Theory and Problems of Computer Architecture       22
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Computer performance in terms of Latency
            and throughput
• Latency— the amount of time that a single
  operation takes to execute
• Throughput — the rate at which operations get
  executed (generally expressed as
  operations/second or operations/cycle)




          Schaum’s Outline of Theory and Problems of Computer Architecture       23
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Throughput and Latency in an unpipelined
              processor
• Throughput = 1/latency, since each operation
  executes by itself




          Schaum’s Outline of Theory and Problems of Computer Architecture       24
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Computer performance in Pipelined
             Processor
• Throughput > 1/latency, since instruction
  execution is overlapped
• The latency of a pipelined processor is still
  important, however, as it determines how
  often dependent instructions may be
  executed



          Schaum’s Outline of Theory and Problems of Computer Architecture       25
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instruction Pipeline Implementation




     Schaum’s Outline of Theory and Problems of Computer Architecture       26
   Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instruction Pipeline

• To implement pipelining, a designer s divides
  a processor's datapath into sections (stages),
  and places pipeline latches (also called
  buffers) between each section (stage)




          Schaum’s Outline of Theory and Problems of Computer Architecture       27
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Unpipelined processor




  Schaum’s Outline of Theory and Problems of Computer Architecture       28
Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Pipelined five stages processor




   Schaum’s Outline of Theory and Problems of Computer Architecture       29
 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Unpipelined Processor

 Fetch an            Decode an
                                              Read Inputs
instruction          instruction

                                      Perform
                                                                  Write Outputs
                                    Computations

               Single Clock Cycle of period = T




           Schaum’s Outline of Theory and Problems of Computer Architecture       30
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Five Stage Pipelined Processor


 Fetch an                  Decode an
                                                          Read Inputs
instruction                instruction

                          Perform
                                                           Write Outputs
                        Computations

     Five Clock Cycles of each of period T' > = T÷ 5



                  Latch


           Schaum’s Outline of Theory and Problems of Computer Architecture       31
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Pipeline latches (buffers)

• The latches read their inputs at the start of each
  cycle
• Copy them to their outputs, which then remain
  constant throughout the rest of the cycle
• Datapath breaking into several sections
  (stages)
• Each stage latency = one clock cycle, since an
  instruction cannot pass through a pipeline latch
  (buffer) until the start of the next cycle

          Schaum’s Outline of Theory and Problems of Computer Architecture       32
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Amount of Datapath

• Stage of the pipeline─ the amount of the
  datapath that a signal travels through in one
  cycle
• Pipeline that takes n cycles in an n-stage
  pipeline
• Each cycle period now about one-fifth of
  unpipelined case period


            Schaum’s Outline of Theory and Problems of Computer Architecture       33
          Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Pipeline five stages
• Stage 1─ the fetch instruction block and its
  associated pipeline latch (buffer)
• Stage 2─ the decode instruction block and
  its pipeline latch (buffer)
• Stages 3, 4, and 5─ the subsequent blocks
  of the pipeline




          Schaum’s Outline of Theory and Problems of Computer Architecture       34
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Architecture Designer's Differences

• Computer architects differ on whether a
  pipeline latch (buffer) is the last part of stage
  or the first part of the next stage, so an
  alternate division of the pipeline into stages
  would be to count the fetch instruction block
  as stage 1, the first pipeline latch (buffer) and
  the decode instruction block as stage 2, and so
  on



          Schaum’s Outline of Theory and Problems of Computer Architecture       35
        Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Instructions in the pipeline stages




     Schaum’s Outline of Theory and Problems of Computer Architecture       36
   Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
Summary




  Schaum’s Outline of Theory and Problems of Computer Architecture       37
Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
We learnt

•   Instruction pipelining
•   A designer implementation of pipeline
•   Processing in pipelined processor
•   Cycle time
•   Pipeline latency
•   Throughput


           Schaum’s Outline of Theory and Problems of Computer Architecture       38
         Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
End of Lesson 1
Instruction Pipeline

Más contenido relacionado

La actualidad más candente

Pipeline Mechanism
Pipeline MechanismPipeline Mechanism
Pipeline Mechanism
Ashik Iqbal
 
Instruction pipeline
Instruction pipelineInstruction pipeline
Instruction pipeline
ajay_a
 
Chapter 04 the processor
Chapter 04   the processorChapter 04   the processor
Chapter 04 the processor
Bảo Hoang
 
INSTRUCTION PIPELINING
INSTRUCTION PIPELININGINSTRUCTION PIPELINING
INSTRUCTION PIPELINING
rubysistec
 

La actualidad más candente (20)

Instruction pipelining
Instruction pipeliningInstruction pipelining
Instruction pipelining
 
Pipelining In computer
Pipelining In computer Pipelining In computer
Pipelining In computer
 
Chapter6 pipelining
Chapter6  pipeliningChapter6  pipelining
Chapter6 pipelining
 
Pipeline Mechanism
Pipeline MechanismPipeline Mechanism
Pipeline Mechanism
 
Design a pipeline
Design a pipelineDesign a pipeline
Design a pipeline
 
Instruction pipeline
Instruction pipelineInstruction pipeline
Instruction pipeline
 
Pipelining
PipeliningPipelining
Pipelining
 
Lec18 pipeline
Lec18 pipelineLec18 pipeline
Lec18 pipeline
 
Loop parallelization & pipelining
Loop parallelization & pipeliningLoop parallelization & pipelining
Loop parallelization & pipelining
 
Concept of Pipelining
Concept of PipeliningConcept of Pipelining
Concept of Pipelining
 
Pipeline processing - Computer Architecture
Pipeline processing - Computer Architecture Pipeline processing - Computer Architecture
Pipeline processing - Computer Architecture
 
Pipelining, processors, risc and cisc
Pipelining, processors, risc and ciscPipelining, processors, risc and cisc
Pipelining, processors, risc and cisc
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
3 Pipelining
3 Pipelining3 Pipelining
3 Pipelining
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 
Chapter 04 the processor
Chapter 04   the processorChapter 04   the processor
Chapter 04 the processor
 
pipelining
pipeliningpipelining
pipelining
 
Pipelining
PipeliningPipelining
Pipelining
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 
INSTRUCTION PIPELINING
INSTRUCTION PIPELININGINSTRUCTION PIPELINING
INSTRUCTION PIPELINING
 

Similar a Comp archch06l01pipeline

Gearman - Northeast PHP 2012
Gearman - Northeast PHP 2012Gearman - Northeast PHP 2012
Gearman - Northeast PHP 2012
Mike Willbanks
 
Performance Tuning by Dijesh P
Performance Tuning by Dijesh PPerformance Tuning by Dijesh P
Performance Tuning by Dijesh P
PlusOrMinusZero
 
Lecture for the day three in jj3 ppt.pdf
Lecture for the day three in jj3 ppt.pdfLecture for the day three in jj3 ppt.pdf
Lecture for the day three in jj3 ppt.pdf
AhmedWasiu
 
Feasibility Study On Computer Capabilities In The Ccbc
Feasibility Study On Computer Capabilities In The CcbcFeasibility Study On Computer Capabilities In The Ccbc
Feasibility Study On Computer Capabilities In The Ccbc
Irvin Engle
 

Similar a Comp archch06l01pipeline (20)

Programed I/O Modul..
Programed I/O Modul..Programed I/O Modul..
Programed I/O Modul..
 
Ch05
Ch05Ch05
Ch05
 
Gearman - Northeast PHP 2012
Gearman - Northeast PHP 2012Gearman - Northeast PHP 2012
Gearman - Northeast PHP 2012
 
Running your IBM i Availability in the Cloud
Running your IBM i Availability in the CloudRunning your IBM i Availability in the Cloud
Running your IBM i Availability in the Cloud
 
Reducing boot time in embedded Linux
Reducing boot time in embedded LinuxReducing boot time in embedded Linux
Reducing boot time in embedded Linux
 
Study material for machenicql engenering student
Study material for machenicql engenering studentStudy material for machenicql engenering student
Study material for machenicql engenering student
 
Basics of micro controllers for biginners
Basics of  micro controllers for biginnersBasics of  micro controllers for biginners
Basics of micro controllers for biginners
 
Performance Tuning by Dijesh P
Performance Tuning by Dijesh PPerformance Tuning by Dijesh P
Performance Tuning by Dijesh P
 
Machine language program execution 1.1.2.pptx
Machine language program execution 1.1.2.pptxMachine language program execution 1.1.2.pptx
Machine language program execution 1.1.2.pptx
 
OS.pptx
OS.pptxOS.pptx
OS.pptx
 
L-2 (Computer Performance).ppt
L-2 (Computer Performance).pptL-2 (Computer Performance).ppt
L-2 (Computer Performance).ppt
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014
 
Computer System Architecture Lecture Note 6: hardware performance
Computer System Architecture Lecture Note 6: hardware performanceComputer System Architecture Lecture Note 6: hardware performance
Computer System Architecture Lecture Note 6: hardware performance
 
Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure
Better Practices when Using Terraform to Manage Oracle Cloud InfrastructureBetter Practices when Using Terraform to Manage Oracle Cloud Infrastructure
Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure
 
Embedded systems introduction
Embedded systems introductionEmbedded systems introduction
Embedded systems introduction
 
Rapid Prototyping (Mechanical)
Rapid Prototyping (Mechanical)Rapid Prototyping (Mechanical)
Rapid Prototyping (Mechanical)
 
Lecture for the day three in jj3 ppt.pdf
Lecture for the day three in jj3 ppt.pdfLecture for the day three in jj3 ppt.pdf
Lecture for the day three in jj3 ppt.pdf
 
What’s eating python performance
What’s eating python performanceWhat’s eating python performance
What’s eating python performance
 
Feasibility Study On Computer Capabilities In The Ccbc
Feasibility Study On Computer Capabilities In The CcbcFeasibility Study On Computer Capabilities In The Ccbc
Feasibility Study On Computer Capabilities In The Ccbc
 
Peddle the Pedal to the Metal
Peddle the Pedal to the MetalPeddle the Pedal to the Metal
Peddle the Pedal to the Metal
 

Comp archch06l01pipeline

  • 1. Chapter 06: Instruction Pipelining and Parallel Processing Lesson 1: Instruction Pipeline
  • 2. Objective • Learn Instruction pipelining and processing in a pipelined processor • Learn how a designer implements pipeline • Learn what are cycle time, pipeline latency and throughput Schaum’s Outline of Theory and Problems of Computer Architecture 2 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 3. Early Computers Schaum’s Outline of Theory and Problems of Computer Architecture 3 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 4. Early Computers • Executed instructions in a very straightforward fashion • Five steps sequentially in the processor to execute an instruction Schaum’s Outline of Theory and Problems of Computer Architecture 4 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 5. Five steps in Straightforward Execution (i) Fetch an instruction from memory (ii) Decode it to determine what the instruction is (iii) Read the instruction’s inputs from registers at the register file (iv) Performed the computations required by the instruction (v) Wrote the result back into the registers at the register file Schaum’s Outline of Theory and Problems of Computer Architecture 5 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 6. Instruction Fetch IR PC Address Processor Memory Data • Fetch an instruction from memory: Steps 1a and 1b) Processor requests instruction from memory using address in PC (or IP) register Memory using data bus returns the instruction to IR register Schaum’s Outline of Theory and Problems of Computer Architecture 6 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 7. Instruction decoding, read operands and execution IR ID PC Address Processor Memory Data • Decode it to determine what the instruction is in Step 2) Processor decodes instruction and places at ID register Read Operands and Execute Steps 3and 4) Read the instruction’s inputs from registers at the register file and Processor executes instruction at execution unit Schaum’s Outline of Theory and Problems of Computer Architecture 7 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 8. Result Write back and PC update for the next PC Address Memory Processor Data • Write the result back into the registers at the register file and PC updates Steps 5a and 5b) Result of instruction written back for register or memory and PC updates for next instruction Schaum’s Outline of Theory and Problems of Computer Architecture 8 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 9. Instruction Execution Approach in Early Computers • Instructions at the processor instruction set that accessed memory slightly different • But each instruction completely finished before the execution of next one began Schaum’s Outline of Theory and Problems of Computer Architecture 9 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 10. Problem • Different Hardware (circuits) needed to perform each of the five steps (instruction fetch, instruction decode, register read, instruction execution, and register write back) • Most of the hardware (most part of the processor circuits) idle at any given moment Schaum’s Outline of Theory and Problems of Computer Architecture 10 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 11. Remaining Steps Hardware Waiting • Most part of the processor circuits waiting for the other parts of the processor to complete that part of executing an instruction Schaum’s Outline of Theory and Problems of Computer Architecture 11 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 12. Analogy • In many ways, this is similar to baking several loaves of bread cakes • Making the batter for one cake loaf (step 1) • Baking the cake loaf (step 2) • Cooling of the cake (step 3) • Repeating the entire three step process for next cake Schaum’s Outline of Theory and Problems of Computer Architecture 12 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 13. New Computers Schaum’s Outline of Theory and Problems of Computer Architecture 13 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 14. New Computers • Hardware (circuits) needed to perform each of the five steps (instruction fetch, instruction decode, register read, instruction execution, and register write back) utilized simultaneously for 5 instructions • Most of the hardware not idle at any given moment Schaum’s Outline of Theory and Problems of Computer Architecture 14 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 15. Remaining steps hardware does not wait • No wait of the most part of the processor circuits for the other parts of the processor to complete that part of executing an instruction Schaum’s Outline of Theory and Problems of Computer Architecture 15 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 16. Baking Analogy • While each of the three steps of baking each loaf cake of bread has to be done in order and takes a set amount of time, one person could bake several cakes loaves of bread much faster Schaum’s Outline of Theory and Problems of Computer Architecture 16 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 17. Baking Analogy • By making the batter for the second loaf cake while first loaf cake is baking • Making the batter for the third cake loaf while the second loaf cake is baking • First loaf cake cooling • Continuing this process with each loaf cake so that there are three loaves of bread cakes in progress at any time Schaum’s Outline of Theory and Problems of Computer Architecture 17 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 18. Baking Analogy • Each loaf of bread would take the same amount of time but the number of loaves for cakes made in a given amount of time would increase (by about three) Schaum’s Outline of Theory and Problems of Computer Architecture 18 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 19. Instruction Pipeline Schaum’s Outline of Theory and Problems of Computer Architecture 19 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 20. Instruction Pipeline • A technique for overlapping the execution of several instructions to reduce the execution time of a set of instructions Schaum’s Outline of Theory and Problems of Computer Architecture 20 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 21. Exemplary processors using Instruction Pipeline • 80x86 • Pentium • ARM Schaum’s Outline of Theory and Problems of Computer Architecture 21 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 22. Instruction Execution Time and Execution Time of Set of Instructions • Similar to the baking analogy, each instruction takes the same amount of time to execute in a pipelined processor as it would in an unpipelined processor (longer, actually, because pipelining adds hardware to the processor), but overlapping instruction execution increases the rate at which instructions can be executed Schaum’s Outline of Theory and Problems of Computer Architecture 22 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 23. Computer performance in terms of Latency and throughput • Latency— the amount of time that a single operation takes to execute • Throughput — the rate at which operations get executed (generally expressed as operations/second or operations/cycle) Schaum’s Outline of Theory and Problems of Computer Architecture 23 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 24. Throughput and Latency in an unpipelined processor • Throughput = 1/latency, since each operation executes by itself Schaum’s Outline of Theory and Problems of Computer Architecture 24 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 25. Computer performance in Pipelined Processor • Throughput > 1/latency, since instruction execution is overlapped • The latency of a pipelined processor is still important, however, as it determines how often dependent instructions may be executed Schaum’s Outline of Theory and Problems of Computer Architecture 25 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 26. Instruction Pipeline Implementation Schaum’s Outline of Theory and Problems of Computer Architecture 26 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 27. Instruction Pipeline • To implement pipelining, a designer s divides a processor's datapath into sections (stages), and places pipeline latches (also called buffers) between each section (stage) Schaum’s Outline of Theory and Problems of Computer Architecture 27 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 28. Unpipelined processor Schaum’s Outline of Theory and Problems of Computer Architecture 28 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 29. Pipelined five stages processor Schaum’s Outline of Theory and Problems of Computer Architecture 29 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 30. Unpipelined Processor Fetch an Decode an Read Inputs instruction instruction Perform Write Outputs Computations Single Clock Cycle of period = T Schaum’s Outline of Theory and Problems of Computer Architecture 30 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 31. Five Stage Pipelined Processor Fetch an Decode an Read Inputs instruction instruction Perform Write Outputs Computations Five Clock Cycles of each of period T' > = T÷ 5 Latch Schaum’s Outline of Theory and Problems of Computer Architecture 31 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 32. Pipeline latches (buffers) • The latches read their inputs at the start of each cycle • Copy them to their outputs, which then remain constant throughout the rest of the cycle • Datapath breaking into several sections (stages) • Each stage latency = one clock cycle, since an instruction cannot pass through a pipeline latch (buffer) until the start of the next cycle Schaum’s Outline of Theory and Problems of Computer Architecture 32 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 33. Amount of Datapath • Stage of the pipeline─ the amount of the datapath that a signal travels through in one cycle • Pipeline that takes n cycles in an n-stage pipeline • Each cycle period now about one-fifth of unpipelined case period Schaum’s Outline of Theory and Problems of Computer Architecture 33 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 34. Pipeline five stages • Stage 1─ the fetch instruction block and its associated pipeline latch (buffer) • Stage 2─ the decode instruction block and its pipeline latch (buffer) • Stages 3, 4, and 5─ the subsequent blocks of the pipeline Schaum’s Outline of Theory and Problems of Computer Architecture 34 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 35. Architecture Designer's Differences • Computer architects differ on whether a pipeline latch (buffer) is the last part of stage or the first part of the next stage, so an alternate division of the pipeline into stages would be to count the fetch instruction block as stage 1, the first pipeline latch (buffer) and the decode instruction block as stage 2, and so on Schaum’s Outline of Theory and Problems of Computer Architecture 35 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 36. Instructions in the pipeline stages Schaum’s Outline of Theory and Problems of Computer Architecture 36 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 37. Summary Schaum’s Outline of Theory and Problems of Computer Architecture 37 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 38. We learnt • Instruction pipelining • A designer implementation of pipeline • Processing in pipelined processor • Cycle time • Pipeline latency • Throughput Schaum’s Outline of Theory and Problems of Computer Architecture 38 Copyright © The McGraw-Hill Companies Inc. Indian Special Edition 2009
  • 39. End of Lesson 1 Instruction Pipeline