SlideShare une entreprise Scribd logo
1  sur  46
Chapter 4 The Processor [Adapted from  Computer Organization and Design, 4 th  Edition ,  Patterson & Hennessy, © 2008, MK] [Also adapted from  lecture slide  by Mary Jane Irwin,  www.cse.psu.edu/~mji ]
Introduction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  §4.1 Introduction
Instruction Execution ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
CPU Overview Chapter 4 — The Processor —  branch store load immediate
Multiplexers Chapter 4 — The Processor —  ,[object Object],[object Object]
Control Chapter 4 — The Processor —  (beq)
Logic Design Basics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  §4.2 Logic Design Conventions
Combinational Elements ,[object Object],[object Object],Chapter 4 — The Processor —  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],A B Y I0 I1 Y M u x S A B Y + A B Y ALU F
Sequential Elements ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  D Clk Q Clk D Q
Sequential Elements ,[object Object],[object Object],[object Object],Chapter 4 — The Processor —  D Clk Q Write Write D Q Clk
Clocking Methodology ,[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  [ Edge-triggered clocking ] Of course, the clock cycle must be long enough so that the inputs are stable
Building a Datapath ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  §4.3 Building a Datapath
Instruction Fetch Chapter 4 — The Processor —  32-bit register Increment by 4 for next instruction
R-Format Instructions ,[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  32 32 32 32 32 32 1-bit
Load/Store Instructions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Branch Instructions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Branch Instructions Chapter 4 — The Processor —  Just re-routes wires Sign-bit wire replicated Will be using it only to  implement the equal test of branches
Composing the Elements ,[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
R-Type/Load/Store Datapath Chapter 4 — The Processor —
Full Datapath Chapter 4 — The Processor —
ALU Control ,[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  §4.4 A Simple Implementation Scheme ALU control Function 0000 AND 0001 OR 0010 add 0110 subtract 0111 set-on-less-than 1100 NOR
ALU Control ,[object Object],[object Object],Chapter 4 — The Processor —  opcode ALUOp Operation funct ALU function ALU control lw 00 load word XXXXXX add 0010 sw 00 store word XXXXXX add 0010 beq 01 branch equal XXXXXX subtract 0110 R-type 10 add 100000 add 0010 subtract 100010 subtract 0110 AND 100100 AND 0000 OR 100101 OR 0001 set-on-less-than 101010 set-on-less-than 0111
The Main Control Unit ,[object Object],Chapter 4 — The Processor —  R-type Load/ Store Branch opcode always read read, except for load write for R-type and load sign-extend and add 0 rs rt rd shamt funct 31:26 5:0 25:21 20:16 15:11 10:6 35 or 43 rs rt address 31:26 25:21 20:16 15:0 4 rs rt address 31:26 25:21 20:16 15:0
Datapath With Control Chapter 4 — The Processor —
R-Type Instruction Chapter 4 — The Processor —
Load Instruction Chapter 4 — The Processor —
Branch-on-Equal Instruction Chapter 4 — The Processor —
Implementing Jumps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  Jump 2 address 31:26 25:0
Datapath With Jumps Added Chapter 4 — The Processor —
Performance Issues ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Pipelining Analogy ,[object Object],[object Object],Chapter 4 — The Processor —  §4.5 An Overview of Pipelining ,[object Object],[object Object],[object Object],[object Object]
MIPS Pipeline ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Pipeline Performance ,[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —  Instr Instr fetch Register read ALU op Memory access Register write Total time lw 200ps 100 ps 200ps 200ps 100 ps 800ps sw 200ps 100 ps 200ps 200ps 700ps R-format 200ps 100 ps 200ps 100 ps 600ps beq 200ps 100 ps 200ps 500ps
Pipeline Performance Chapter 4 — The Processor —  Single-cycle (T c = 800ps) Pipelined (T c = 200ps)
Pipeline Speedup ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Pipelining and ISA Design ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Hazards ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Structure Hazards ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Data Hazards ,[object Object],[object Object],Chapter 4 — The Processor —
Forwarding (aka Bypassing) ,[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Load-Use Data Hazard ,[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Code Scheduling to Avoid Stalls ,[object Object],[object Object],Chapter 4 — The Processor —  lw $t1, 0($t0) lw $t2 , 4($t0) add $t3, $t1,  $t2 sw $t3, 12($t0) lw $t4 , 8($t0) add $t5, $t1,  $t4 sw $t5, 16($t0) stall stall lw $t1, 0($t0) lw $t2 , 4($t0) lw $t4 , 8($t0) add $t3, $t1,  $t2 sw $t3, 12($t0) add $t5, $t1,  $t4 sw $t5, 16($t0) 11 cycles 13 cycles
Control Hazards ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
Stall on Branch ,[object Object],Chapter 4 — The Processor —
Branch Prediction ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Chapter 4 — The Processor —
MIPS with Predict Not Taken Chapter 4 — The Processor —  Prediction correct Prediction incorrect

Contenu connexe

Tendances

Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computersBảo Hoang
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)Mahesh Kumar Attri
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipeliningMazin Alwaaly
 
Chapter 4 the processor
Chapter 4 the processorChapter 4 the processor
Chapter 4 the processors9007912
 
Floating point representation
Floating point representationFloating point representation
Floating point representationmissstevenson01
 
Chapter 1 computer abstractions and technology
Chapter 1 computer abstractions and technologyChapter 1 computer abstractions and technology
Chapter 1 computer abstractions and technologyBATMUNHMUNHZAYA
 
RISC - Reduced Instruction Set Computing
RISC - Reduced Instruction Set ComputingRISC - Reduced Instruction Set Computing
RISC - Reduced Instruction Set ComputingTushar Swami
 
Instruction Set Architecture
Instruction  Set ArchitectureInstruction  Set Architecture
Instruction Set ArchitectureHaris456
 
presentation on timing diagram
presentation on timing diagrampresentation on timing diagram
presentation on timing diagramAlisha Korpal
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set ArchitectureDilum Bandara
 
Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Shehrevar Davierwala
 
Computer instructions
Computer instructionsComputer instructions
Computer instructionsAnuj Modi
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInteX Research Lab
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085techbed
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 

Tendances (20)

8086 instruction set
8086  instruction set8086  instruction set
8086 instruction set
 
Mips architecture
Mips architectureMips architecture
Mips architecture
 
Chapter 03 arithmetic for computers
Chapter 03   arithmetic for computersChapter 03   arithmetic for computers
Chapter 03 arithmetic for computers
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
 
Computer architecture pipelining
Computer architecture pipeliningComputer architecture pipelining
Computer architecture pipelining
 
Chapter 4 the processor
Chapter 4 the processorChapter 4 the processor
Chapter 4 the processor
 
Floating point representation
Floating point representationFloating point representation
Floating point representation
 
Chapter 1 computer abstractions and technology
Chapter 1 computer abstractions and technologyChapter 1 computer abstractions and technology
Chapter 1 computer abstractions and technology
 
RISC - Reduced Instruction Set Computing
RISC - Reduced Instruction Set ComputingRISC - Reduced Instruction Set Computing
RISC - Reduced Instruction Set Computing
 
Instruction Set Architecture
Instruction  Set ArchitectureInstruction  Set Architecture
Instruction Set Architecture
 
presentation on timing diagram
presentation on timing diagrampresentation on timing diagram
presentation on timing diagram
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086
 
Computer instructions
Computer instructionsComputer instructions
Computer instructions
 
slides.pdf
slides.pdfslides.pdf
slides.pdf
 
Mips
MipsMips
Mips
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer Architecture
 
Assembly Language Programming Of 8085
Assembly Language Programming Of 8085Assembly Language Programming Of 8085
Assembly Language Programming Of 8085
 
Pipelining & All Hazards Solution
Pipelining  & All Hazards SolutionPipelining  & All Hazards Solution
Pipelining & All Hazards Solution
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 

Similaire à Chapter 4 The Processor

IntroductionCPU performance factorsInstruction countDeterm.docx
IntroductionCPU performance factorsInstruction countDeterm.docxIntroductionCPU performance factorsInstruction countDeterm.docx
IntroductionCPU performance factorsInstruction countDeterm.docxnormanibarber20063
 
Pipelining of Processors Computer Architecture
Pipelining of  Processors Computer ArchitecturePipelining of  Processors Computer Architecture
Pipelining of Processors Computer ArchitectureHaris456
 
CMPN301-Pipelining_V2.pptx
CMPN301-Pipelining_V2.pptxCMPN301-Pipelining_V2.pptx
CMPN301-Pipelining_V2.pptxNadaAAmin
 
multi cycle in microprocessor 8086 sy B-tech
multi cycle  in microprocessor 8086 sy B-techmulti cycle  in microprocessor 8086 sy B-tech
multi cycle in microprocessor 8086 sy B-techRushikeshThorat24
 
Pipelining And Vector Processing
Pipelining And Vector ProcessingPipelining And Vector Processing
Pipelining And Vector ProcessingTheInnocentTuber
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazardAJAL A J
 
Unit-3 Von Neumann Architecture.ppt
Unit-3 Von Neumann Architecture.pptUnit-3 Von Neumann Architecture.ppt
Unit-3 Von Neumann Architecture.pptSatheeswaranV
 
Von neuman architecture
Von neuman architectureVon neuman architecture
Von neuman architecturessuserf06014
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverterKernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverterAnne Nicolas
 
Pipelining of Processors
Pipelining of ProcessorsPipelining of Processors
Pipelining of ProcessorsGaditek
 

Similaire à Chapter 4 The Processor (20)

Pipelining
PipeliningPipelining
Pipelining
 
IntroductionCPU performance factorsInstruction countDeterm.docx
IntroductionCPU performance factorsInstruction countDeterm.docxIntroductionCPU performance factorsInstruction countDeterm.docx
IntroductionCPU performance factorsInstruction countDeterm.docx
 
Arch 1112-6
Arch 1112-6Arch 1112-6
Arch 1112-6
 
Pipelining of Processors Computer Architecture
Pipelining of  Processors Computer ArchitecturePipelining of  Processors Computer Architecture
Pipelining of Processors Computer Architecture
 
CMPN301-Pipelining_V2.pptx
CMPN301-Pipelining_V2.pptxCMPN301-Pipelining_V2.pptx
CMPN301-Pipelining_V2.pptx
 
multi cycle in microprocessor 8086 sy B-tech
multi cycle  in microprocessor 8086 sy B-techmulti cycle  in microprocessor 8086 sy B-tech
multi cycle in microprocessor 8086 sy B-tech
 
CA UNIT III.pptx
CA UNIT III.pptxCA UNIT III.pptx
CA UNIT III.pptx
 
Pipelining And Vector Processing
Pipelining And Vector ProcessingPipelining And Vector Processing
Pipelining And Vector Processing
 
Unit 4 COA.pptx
Unit 4 COA.pptxUnit 4 COA.pptx
Unit 4 COA.pptx
 
PROCESSOR AND CONTROL UNIT
PROCESSOR AND CONTROL UNITPROCESSOR AND CONTROL UNIT
PROCESSOR AND CONTROL UNIT
 
Unit iii
Unit iiiUnit iii
Unit iii
 
ECE_374_Lec4.pdf
ECE_374_Lec4.pdfECE_374_Lec4.pdf
ECE_374_Lec4.pdf
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 
Core pipelining
Core pipelining Core pipelining
Core pipelining
 
Unit-3 Von Neumann Architecture.ppt
Unit-3 Von Neumann Architecture.pptUnit-3 Von Neumann Architecture.ppt
Unit-3 Von Neumann Architecture.ppt
 
Von neuman architecture
Von neuman architectureVon neuman architecture
Von neuman architecture
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverterKernel Recipes 2014 - NDIV: a low overhead network traffic diverter
Kernel Recipes 2014 - NDIV: a low overhead network traffic diverter
 
Pipelining of Processors
Pipelining of ProcessorsPipelining of Processors
Pipelining of Processors
 
Cpu unit
Cpu unitCpu unit
Cpu unit
 

Chapter 4 The Processor

Notes de l'éditeur

  1. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  2. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  3. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  4. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  5. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  6. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  7. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  8. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  9. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  10. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  11. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  12. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  13. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  14. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  15. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  16. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  17. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  18. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  19. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  20. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  21. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  22. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  23. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  24. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  25. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  26. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  27. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  28. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  29. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  30. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  31. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  32. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  33. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  34. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  35. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  36. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  37. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  38. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  39. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  40. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  41. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  42. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  43. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  44. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  45. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor
  46. Morgan Kaufmann Publishers 15 October 2009 Chapter 4 — The Processor