Pipelining: Its Natural!

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "Pipelining: Its Natural!"

Transcription

1 Pipelining: Its Natural! Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer takes 30 minutes, Dryer takes 40 minutes, Folder takes 20 minutes T a s k O r d e r 6 P Time Pipelining doesn t help latency of single task, it helps throughput of entire workload Pipeline rate limited by slowest pipeline stage ultiple tasks operating simultaneously Potential speedup = Number pipe stages nbalanced lengths of pipe stages reduces speedup Time to fill pipeline and time to drain it reduces speedup (1) Computer Pipelines IPS desirable features: all instructions same length, registers located in same place in instruction format, operands only in loads or stores We will first review a nonpipelined IPS architecture Review you should know about: multiplexors, register files, AL s arithmetic Vs logical shifts program counter (PC), status word (PS) and instruction register (IR), emory ress registers (AR) and data registers (DR) combinational Vs sequential circuits (2) Page 1

2 Implementing the IPS architecture Arithmetic/logic instructions 1) fetch instruction 2) read registers 3) compute (use AL) 4) write to register emory instructions 1) fetch instruction 2) read registers 3) compute ress (use AL) 4) write/read to/from ) write to register (for load) Branch instructions 1) fetch instruction 2) read registers 3) compute branch ress (use AL) 4) evaluate branch condition ) update the PC (condition satisfied) Increment the PC (3) fetch IR em[pc] NPC PC Add N P C ress (cache) Data out PC (cache) IR ress Data in data (cache) Data out (4) Page 2

3 Register read To decoder (control) 4 Add N P C 6 Read ress 1 Read ress 2 Write ress Write data Register file Read data 1 Read data 2 PC IR Register file A B A Regs[IR 610 ] B Regs[IR 111 ] Imm (IR 16 ) 48 ## IR Sign extend 64 Imm () se AL and evaluate branch condition 4 Add N P C Zero? cond PC IR Register file A B = AL AL out 16 Sign extend 64 Imm (the multiplexors settings and AL function depend on the opcode) (6) Page 3

4 Page 4 (7) se Add PC 4 N P C IR Register file A B Sign extend 16 Imm AL AL out cond Zero? data LD 64 (8) Write to register Add PC 4 N P C IR Register file A B Sign extend 16 Imm AL AL out cond Zero? data LD 64

5 The control signals PC L2 4 Add L3 N P C IR 16 L4 Register file Sign extend 64 A B Imm Zero? 2 1 AL OP cond AL out L1 data L LD 3 (9) The control signals 1, 2, 3 = select multiplexor input (one bit each) L1 L2 L3 L4 L OP =0 =1 = set if the instruction is a branch (one bit) = loads the PC (one bit) = read the instruction (one bit) = read/write register (two bits) 00 = noop, 01 = read, 10 = write = read/write the data (two bits) 00 = noop, 01 = read, 10 = write = AL control (?? Bits) 00 = noop, 11 =, 10 = others (10) Page

6 Pipelining IPS IF/ID ID/E E/E E/WB 4 Add Zero? PC Register file AL data 16 Sign extend 64 (11) IF/ID ID/E E/E E/WB 4 Add Zero? PC Register file AL data 16 Sign extend 64 (12) Page 6

7 Visualizing pipelining CC1 CC2 CC3 CC4 CC CC6 Clock cycles I Reg D Reg I Reg D Reg I Reg D Reg order I Reg D Reg Pipelining puts itional demands on bandwidth, (13) Visualizing pipelining CC1 CC2 CC3 CC4 CC CC6 Clock cycles lw sw I Reg Alu em WB I Reg Alu em WB I Reg Alu em WB I Reg Alu em WB lw lw sw lw sw lw Clock cycles sw sw lw (14) Page 7

8 Limits to pipelining: Hazards prevent next instruction from executing during its designated clock cycle Structural hazards: HW cannot support a combination of instructions Data hazards: depends on result of prior instruction still in the pipeline Control hazards: Pipelining of branches & other instructions stall the pipeline until the hazard bubbles in the pipeline (1) Structural Hazards (assuming a single ) CC1 CC2 CC3 CC4 CC CC6 Clock cycles Load I Reg D Reg I Reg D Reg I Reg D Reg I Reg D Reg (16) Page 8

9 Structural Hazards (assuming a single ) CC1 CC2 CC3 CC4 CC CC6 Clock cycles Load I Reg D Reg I Reg D Reg I Reg D Reg I Reg D Reg (17) Structural hazard in register file CC1 CC2 CC3 CC4 CC CC6 Clock cycles Load I Reg D Reg I Reg D Reg I Reg D Reg I Reg D Reg (18) Page 9

10 Speed p Equation for Pipelining CPI pipelined = Ideal CPI + stall cycles per instruction Speedup = CPI unpipelined CPI pipelined x Clock Cycle unpipelined Clock Cycle pipelined Example: achine A: pipelined (with some depth) and dual ported achine B: pipelined (same depth as A), but single ported, and a 10 times faster clock rate Ideal CPI = 1 for both, and loads are 40% of instructions executed Speedp A = Pipeline Depth Speedp B = (Pipeline Depth/14) x 10 = 07 x Pipeline Depth Speedp A / Speedp B = 133 (19) Registertoregister data Hazards Add R1, R2, R3 I Reg D Reg Dependence: produces R1 consumed by following instructions Sub R4, R1, R4 I Reg D Reg And R, R1, R I Reg D Reg Add R6, R1, R6 I Reg D Reg Add R7, R1, R7 I Reg D Reg (20) Page 10

11 Three types of Data Dependence Instr i is later in the pipeline than Instr j j depends on i for operand R 1 Read After Write (RAW) Instr j tries to read operand before Instr i writes it 2 Write After Read (WAR) Instr j tries to write operand before Instr i reads it Gets wrong operand Can t happen in IPS stage pipeline (why?) 3 Write After Write (WAW) Instr j tries to write operand before Instr i writes it Leaves wrong result Can t happen in IPS stage pipeline (why?) Will see WAR and WAW in later more complicated pipes (21) Forwarding to Avoid Data Hazard I Add R1, R2, R3 Reg D Reg Sub R4, R1, R4 I Reg D Reg And R, R1, R I Reg D Reg Add R6, R1, R6 I Reg D Reg Add R7, R1, R7 I Reg D Reg (22) Page 11

12 HW Change for Forwarding IF/ID ID/E E/E E/WB PC Register file AL data (23) Forwarding Control Forwarding Paths s t t d t d d A u x u x 0 0 AL data B ID/E E/E E/WB (2) Page 12

13 Detection & Activation for Forwarding Control Src Type Detection Condition Input Action Priority RR E/Erd == ID/Ers ux A 1 1 RR E/Erd == ID/Ert ux B 1 1 RR E/WBrd == ID/Ers ux A 2 2 RR E/WBrd == ID/Ert ux B 2 2 Imm E/Ert == ID/Ers ux A 1 1 Imm E/Ert == ID/Ert ux B 1 1 Imm E/WBrt == ID/Ers ux A 2 2 Imm E/WBrt == ID/Ert ux B 2 2 Ld E/WBrt == ID/Ers ux A 3 2 Ld E/WBrt == ID/Ers ux B 3 2 Src Type = Producer instruction opcode type Action = ux setting; if no match, then ux selection is 0 Priority = Which detection condition takes precedence (note, multiple can match) (26) Data Hazard Even with Forwarding lw r1, 0(r2) I Reg D Reg sub r4,r1,r6 I Reg D Reg and r6,r1,r7 I Reg D Reg or r8,r1,r9 I Reg D Reg Cannot travel back in time Need to stall (interlock) the pipe if: The instruction in ID/E is a lw The instruction in IF/ID uses register Rs1 and/or Rs2 Rd for the instruction in ID/E = Rs1 or Rs2 How can we interlock (stall) the pipeline? (27) Page 13

14 Interlock on Loadse Detect a load followed by a dependent use Src Type Dst Type Condition Ld RegisterRegister ID/Ert == IF/IDrs Ld RegisterRegister ID/Ert == IF/IDrt Ld Immediate ID/Ert == IF/IDrs Insert the bubble on detection Disable write (no updates): PC, ID/IF register Clear the ID/E register (inserting a nop) (28) Software Scheduling to Avoid Load Hazards Try producing fast code for a = b + c; d = e f; assuming a, b, c, d,e, and f in Slow code: LW LW ADD SW LW LW SB SW d,rd Rb,b Rc,c Ra,Rb,Rc a,ra Re,e Rf,f Rd,Re,Rf Fast code: LW Rb,b LW Rc,c LW Re,e ADD Ra,Rb,Rc LW Rf,f SW a,ra SB Rd,Re,Rf SW d,rd (29) Page 14

15 Control Hazard on Branches IF/ID ID/E E/E E/WB 4 Add Zero? PC Register file AL data 16 Sign extend 64 (30) Control Hazard on Branches I Reg Alu em WB beqz beqz sw beqz sub sw beqz Clock cycles sub sw sub sw beqz sub sw sub (31) Page 1

16 Branch Stall Impact If CPI = 1, 10% branch, Stall 3 cycles => new CPI = 13 Two part solution: 1 Determine branch taken or not sooner, AND 2 Compute taken branch ress earlier IPS branch tests if two registers are equal IPS solution ove Zero test to ID/E stage Adder to calculate branch target ress in ID/E stage 1 clock cycle penalty for branch versus 3 (32) Early determination of Branch condition and target IF/ID ID/E E/E E/WB 4 Add Add Zero? PC Register file = AL data 16 Sign extend 32 (33) Page 16

17 Four Branch Hazard Alternatives #1: Stall until branch direction is clear #2: Predict Branch Not Taken Execute successor instructions in sequence Squash instructions in pipeline if branch actually taken (how?) Advantage of late pipeline state update 47% IPS branches not taken on average PC+4 already calculated, so use it to get next instruction #3: Predict Branch Taken 3% IPS branches taken on average But haven t calculated branch target ress in IPS» IPS still incurs 1 cycle branch penalty» Other machines: branch target known before outcome (34) Four Branch Hazard Alternatives #4: Delayed Branch Define branch to take place AFTER a following instruction branch instruction sequential successor 1 sequential successor 2 sequential successor n branch target if taken Branch delay of length n 1 slot delay allows proper decision and branch target ress in stage pipeline Delay Slot (DSI) IPS uses this (3) Page 17

18 Example of DSI top:!lw!lw!!r1,0(r2)!!r3,4(r2)!!!r1,r1,r3!!sw!r1,0(r2)!!i!r2,r2,4!!i!r,r,1!!bne!r,r0,top!!delay slot instruction!!!!! (36) Example of DSI top:!lw!lw!r1,0(r2)!!r3,4(r2)!!!r1,r1,r3!!sw!r1,0(r2)!!i!r2,r2,4!!i!r,r,1!!bne!r,r0,top!!nop!!!!! Dependence chain (37) Page 18

19 Example of DSI top:!lw!lw!!r1,0(r2)!!r3,4(r2)!!!r1,r1,r3!!sw!r1,0(r2)!!i!r2,r2,4!!i!r,r,1!!bne!r,r0,top!!nop!!!!! Dependence chain (38) Example of DSI top:!lw!lw!!r1,0(r2)!!r3,4(r2)!!!r1,r1,r3!!sw!r1,0(r2)!!i!r2,r2,4!!i!r,r,1!!bne!r,r0,top!!nop!!!!! Dependence chain (39) Page 19

20 Example of DSI top:!lw!lw!!!r1,0(r2)!!r3,4(r2)!!!r1,r1,r3!!sw!r1,0(r2)!!i!r,r,1!!bne!r,r0,top!!i!r2,r2,4!!!!! Dependence chain (40) Example of DSI top:!lw!lw!!r1,0(r2)!!r3,4(r2)!!!r1,r1,r3!!sw!r1,0(r2)!!i!r2,r2,4!!bne!r2,r0,top!!nop!!!!! Can we move the i? (41) Page 20

21 Where do we get instructions to fill branch delay slot? Before branch instruction From the target ress: should repeat instruction for correctness From fall through: correct if R7 is dead after the branch (42) ulticycle pipelines Ex Int IF ID FP mult FP mult FP FP FP mult em WB Div Assume 4stage, pipelined, FP 7stage, pipelined, FP multiply 2 stage, nonpipelined divide unit Latency of an instruction, I, in a pipeline, P, is the number of bubbles that has to exist in P if the instruction following I wants to use the result of I (44) Page 21

22 Hazards: Two divide instructions will stall the pipe (structural hazards) ay have more than one register write in one cycle (why?) increase number of ports, or stall the pipeline (interlock) ay have WAW hazard (why?) Outoforder completion causes problems with exceptions, The long pipes causes more RAW hazards (why?) To deal with structural Hazards: Stall a conflicting instruction at the ID stage se a shift register to keep track of the utilization of a stage that may suffer from structural hazard (ex Input ports of registers) Stall a conflicting instruction when entering the em stage may give priority to longer instructions to reduce RAW hazards (4) Examples LD F4, 0(R2) uld F0, F4, F6 IF ID IF E ID E WB E WB AddD F2, F0, F8 SD F2, 0(R2) IF ID IF A1 ID A2 E A3 A4 E WB E Stall due to RAW hazards instruction LD F0,F4,F6 IF ID em WB IF ID E em WB IF ID E em WB AddD F2,F4,F6 IF ID A1 A2 A3 A4 em WB IF ID E em WB IF ID E em WB LD F2, 0(R2) IF ID Ex em WB Structural hazards (46) Page 22

23 To deal with WAW: WAW occurs only if a useless instruction is executed If there is a use in between the writes, then a RAW will stall the pipe (if no forwarding is used in this case forwarding is not possible) ay detect hazard and hold the second instruction, ay detect hazard and prevent the first instruction from writing ay detect hazard and replace the first instruction with a noop Can all hazards be detected at the ID stage? To maintain precise exceptions: ay ignore the problem, or buffer the results and enforce the order of writes, or let the trap handling routine enforce the preciseness (software approach), or delay the issue (stall the pipe) to enforce inorder completion (47) set design and pipelining Variable instruction length and execution time leads to imbalance among stages, complicate hazard detection and precise exceptions Caches have similar effects (imbalance pipes) may freeze the entire pipeline on a cache miss Complex ressing modes may change register values may require multiple access self modifying instructions causes pipeline problems Implicitly set condition codes complicates pipeline control hazards (48) Page 23

24 The IPS R bit instruction set (IPS3 ISA) Decomposes access into stages (superpipelining) ses a deeper pipeline IF first half of instruction fetch IS second half of instruction fetch RF instruction decode and register fetch (and check cache tag) E execution: effective ress calculation, AL operation, branch target computation, branch condition evaluation DF first half of data fetch DS second half of data fetch TC check cache tag (to determine if it is a hit) WB write back (49) Forwarding from output is required to instructions that are 3 or 4 cycles later (sooner instructions have to stall) (0) Page 24

25 The IPS R4000 pipeline Branch delay is 3 cycles The architecture supports a singlecycle delayed branch The floatingpoint pipeline: Three units: er ( stages), divider(36 nonpipelined stages) and multiplier (9 stages) Eight hardware units are shared among stages A ( mantissa), D (divide), E(exception test), and N (first and second stages of multiplier), R (rounding), S (shift), (unpack) (1) Page 2

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1 Pipeline Hazards Structure hazard Data hazard Pipeline hazard: the major hurdle A hazard is a condition that prevents an instruction in the pipe from executing its next scheduled pipe stage Taxonomy of

More information

Lecture: Pipelining Extensions. Topics: control hazards, multi-cycle instructions, pipelining equations

Lecture: Pipelining Extensions. Topics: control hazards, multi-cycle instructions, pipelining equations Lecture: Pipelining Extensions Topics: control hazards, multi-cycle instructions, pipelining equations 1 Problem 6 Show the instruction occupying each stage in each cycle (with bypassing) if I1 is R1+R2

More information

WAR: Write After Read

WAR: Write After Read WAR: Write After Read write-after-read (WAR) = artificial (name) dependence add R1, R2, R3 sub R2, R4, R1 or R1, R6, R3 problem: add could use wrong value for R2 can t happen in vanilla pipeline (reads

More information

Pipeline Hazards. Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by Arvind and Krste Asanovic

Pipeline Hazards. Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by Arvind and Krste Asanovic 1 Pipeline Hazards Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by and Krste Asanovic 6.823 L6-2 Technology Assumptions A small amount of very fast memory

More information

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern: Pipelining HW Q. Can a MIPS SW instruction executing in a simple 5-stage pipelined implementation have a data dependency hazard of any type resulting in a nop bubble? If so, show an example; if not, prove

More information

Solution: start more than one instruction in the same clock cycle CPI < 1 (or IPC > 1, Instructions per Cycle) Two approaches:

Solution: start more than one instruction in the same clock cycle CPI < 1 (or IPC > 1, Instructions per Cycle) Two approaches: Multiple-Issue Processors Pipelining can achieve CPI close to 1 Mechanisms for handling hazards Static or dynamic scheduling Static or dynamic branch handling Increase in transistor counts (Moore s Law):

More information

More on Pipelining and Pipelines in Real Machines CS 333 Fall 2006 Main Ideas Data Hazards RAW WAR WAW More pipeline stall reduction techniques Branch prediction» static» dynamic bimodal branch prediction

More information

CS352H: Computer Systems Architecture

CS352H: Computer Systems Architecture CS352H: Computer Systems Architecture Topic 9: MIPS Pipeline - Hazards October 1, 2009 University of Texas at Austin CS352H - Computer Systems Architecture Fall 2009 Don Fussell Data Hazards in ALU Instructions

More information

Ch 5: Designing a Single Cycle Datapath

Ch 5: Designing a Single Cycle Datapath Ch 5: Designing a Single Cycle path Computer Systems Architecture CS 365 The Big Picture: Where are We Now? The Five Classic Components of a Computer Processor Control Memory path Input Output Today s

More information

How to improve (decrease) CPI

How to improve (decrease) CPI How to improve (decrease) CPI Recall: CPI = Ideal CPI + CPI contributed by stalls Ideal CPI =1 for single issue machine even with multiple execution units Ideal CPI will be less than 1 if we have several

More information

INSTRUCTION LEVEL PARALLELISM PART VII: REORDER BUFFER

INSTRUCTION LEVEL PARALLELISM PART VII: REORDER BUFFER Course on: Advanced Computer Architectures INSTRUCTION LEVEL PARALLELISM PART VII: REORDER BUFFER Prof. Cristina Silvano Politecnico di Milano cristina.silvano@polimi.it Prof. Silvano, Politecnico di Milano

More information

Giving credit where credit is due

Giving credit where credit is due CSCE 230J Computer Organization Processor Architecture VI: Wrap-Up Dr. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csce230j Giving credit where credit is due ost of slides for

More information

Reduced Instruction Set Computer vs Complex Instruction Set Computers

Reduced Instruction Set Computer vs Complex Instruction Set Computers RISC vs CISC Reduced Instruction Set Computer vs Complex Instruction Set Computers for a given benchmark the performance of a particular computer: P = 1 I C 1 S where P = time to execute I = number of

More information

Solutions. Solution 4.1. 4.1.1 The values of the signals are as follows:

Solutions. Solution 4.1. 4.1.1 The values of the signals are as follows: 4 Solutions Solution 4.1 4.1.1 The values of the signals are as follows: RegWrite MemRead ALUMux MemWrite ALUOp RegMux Branch a. 1 0 0 (Reg) 0 Add 1 (ALU) 0 b. 1 1 1 (Imm) 0 Add 1 (Mem) 0 ALUMux is the

More information

A Brief Review of Processor Architecture. Why are Modern Processors so Complicated? Basic Structure

A Brief Review of Processor Architecture. Why are Modern Processors so Complicated? Basic Structure A Brief Review of Processor Architecture Why are Modern Processors so Complicated? Basic Structure CPU PC IR Regs ALU Memory Fetch PC -> Mem addr [addr] > IR PC ++ Decode Select regs Execute Perform op

More information

Central Processing Unit (CPU)

Central Processing Unit (CPU) Central Processing Unit (CPU) CPU is the heart and brain It interprets and executes machine level instructions Controls data transfer from/to Main Memory (MM) and CPU Detects any errors In the following

More information

PROBLEMS #20,R0,R1 #$3A,R2,R4

PROBLEMS #20,R0,R1 #$3A,R2,R4 506 CHAPTER 8 PIPELINING (Corrisponde al cap. 11 - Introduzione al pipelining) PROBLEMS 8.1 Consider the following sequence of instructions Mul And #20,R0,R1 #3,R2,R3 #$3A,R2,R4 R0,R2,R5 In all instructions,

More information

Pipelining Review and Its Limitations

Pipelining Review and Its Limitations Pipelining Review and Its Limitations Yuri Baida yuri.baida@gmail.com yuriy.v.baida@intel.com October 16, 2010 Moscow Institute of Physics and Technology Agenda Review Instruction set architecture Basic

More information

EE282 Computer Architecture and Organization Midterm Exam February 13, 2001. (Total Time = 120 minutes, Total Points = 100)

EE282 Computer Architecture and Organization Midterm Exam February 13, 2001. (Total Time = 120 minutes, Total Points = 100) EE282 Computer Architecture and Organization Midterm Exam February 13, 2001 (Total Time = 120 minutes, Total Points = 100) Name: (please print) Wolfe - Solution In recognition of and in the spirit of the

More information

Advanced Pipelining Techniques

Advanced Pipelining Techniques Advanced Pipelining Techniques 1. Dynamic Scheduling 2. Loop Unrolling 3. Software Pipelining 4. Dynamic Branch Prediction Units 5. Register Renaming 6. Superscalar Processors 7. VLIW (Very Large Instruction

More information

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995 UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering EEC180B Lab 7: MISP Processor Design Spring 1995 Objective: In this lab, you will complete the design of the MISP processor,

More information

Computer Architecture

Computer Architecture Computer Architecture Having studied numbers, combinational and sequential logic, and assembly language programming, we begin the study of the overall computer system. The term computer architecture is

More information

The Von Neumann Model. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell

The Von Neumann Model. University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell The Von Neumann Model University of Texas at Austin CS310H - Computer Organization Spring 2010 Don Fussell The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic

More information

CPU Performance Equation

CPU Performance Equation CPU Performance Equation C T I T ime for task = C T I =Average # Cycles per instruction =Time per cycle =Instructions per task Pipelining e.g. 3-5 pipeline steps (ARM, SA, R3000) Attempt to get C down

More information

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek Instruction Set Architecture or How to talk to computers if you aren t in Star Trek The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture

More information

Design of Pipelined MIPS Processor. Sept. 24 & 26, 1997

Design of Pipelined MIPS Processor. Sept. 24 & 26, 1997 Design of Pipelined MIPS Processor Sept. 24 & 26, 1997 Topics Instruction processing Principles of pipelining Inserting pipe registers Data Hazards Control Hazards Exceptions MIPS architecture subset R-type

More information

CS:APP Chapter 4 Computer Architecture. Wrap-Up. William J. Taffe Plymouth State University. using the slides of

CS:APP Chapter 4 Computer Architecture. Wrap-Up. William J. Taffe Plymouth State University. using the slides of CS:APP Chapter 4 Computer Architecture Wrap-Up William J. Taffe Plymouth State University using the slides of Randal E. Bryant Carnegie Mellon University Overview Wrap-Up of PIPE Design Performance analysis

More information

Instruction Set Architectures

Instruction Set Architectures Instruction Set Architectures Early trend was to add more and more instructions to new CPUs to do elaborate operations (CISC) VAX architecture had an instruction to multiply polynomials! RISC philosophy

More information

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2 Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of

More information

Exercises for EITF20 Computer Architecture HT1 2010

Exercises for EITF20 Computer Architecture HT1 2010 Exercises for EITF20 Computer Architecture HT1 2010 Anders Ardö Department of Electrical and Information Technology, EIT Lund University December 4, 2013 1 Contents 1 Performance 3 2 ISA 7 3 Pipelining

More information

PROBLEMS. which was discussed in Section 1.6.3.

PROBLEMS. which was discussed in Section 1.6.3. 22 CHAPTER 1 BASIC STRUCTURE OF COMPUTERS (Corrisponde al cap. 1 - Introduzione al calcolatore) PROBLEMS 1.1 List the steps needed to execute the machine instruction LOCA,R0 in terms of transfers between

More information

Execution Cycle. Pipelining. IF and ID Stages. Simple MIPS Instruction Formats

Execution Cycle. Pipelining. IF and ID Stages. Simple MIPS Instruction Formats Execution Cycle Pipelining CSE 410, Spring 2005 Computer Systems http://www.cs.washington.edu/410 1. Instruction Fetch 2. Instruction Decode 3. Execute 4. Memory 5. Write Back IF and ID Stages 1. Instruction

More information

Computer Organization and Architecture

Computer Organization and Architecture Computer Organization and Architecture Chapter 14 Instruction Level Parallelism and Superscalar Processors What does Superscalar mean? Common instructions (arithmetic, load/store, conditional branch) can

More information

Data Dependences. A data dependence occurs whenever one instruction needs a value produced by another.

Data Dependences. A data dependence occurs whenever one instruction needs a value produced by another. Data Hazards 1 Hazards: Key Points Hazards cause imperfect pipelining They prevent us from achieving CPI = 1 They are generally causes by counter flow data pennces in the pipeline Three kinds Structural

More information

Computer organization

Computer organization Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs

More information

Course on Advanced Computer Architectures

Course on Advanced Computer Architectures Course on Advanced Computer Architectures Surname (Cognome) Name (Nome) POLIMI ID Number Signature (Firma) SOLUTION Politecnico di Milano, September 3rd, 2015 Prof. C. Silvano EX1A ( 2 points) EX1B ( 2

More information

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu. Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.tw Review Computers in mid 50 s Hardware was expensive

More information

(Refer Slide Time: 00:01:16 min)

(Refer Slide Time: 00:01:16 min) Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control

More information

Let s put together a Manual Processor

Let s put together a Manual Processor Lecture 14 Let s put together a Manual Processor Hardware Lecture 14 Slide 1 The processor Inside every computer there is at least one processor which can take an instruction, some operands and produce

More information

CS521 CSE IITG 11/23/2012

CS521 CSE IITG 11/23/2012 CS521 CSE TG 11/23/2012 A Sahu 1 Degree of overlap Serial, Overlapped, d, Super pipelined/superscalar Depth Shallow, Deep Structure Linear, Non linear Scheduling of operations Static, Dynamic A Sahu slide

More information

CSE 30321 Computer Architecture I Fall 2009 Final Exam December 18, 2009

CSE 30321 Computer Architecture I Fall 2009 Final Exam December 18, 2009 CSE 30321 Computer Architecture I Fall 2009 Final Exam December 18, 2009 Test Guidelines: 1. Place your name on EACH page of the test in the space provided. 2. every question in the space provided. If

More information

Computer Organization and Components

Computer Organization and Components Computer Organization and Components IS5, fall 25 Lecture : Pipelined Processors ssociate Professor, KTH Royal Institute of Technology ssistant Research ngineer, University of California, Berkeley Slides

More information

Static Scheduling. option #1: dynamic scheduling (by the hardware) option #2: static scheduling (by the compiler) ECE 252 / CPS 220 Lecture Notes

Static Scheduling. option #1: dynamic scheduling (by the hardware) option #2: static scheduling (by the compiler) ECE 252 / CPS 220 Lecture Notes basic pipeline: single, in-order issue first extension: multiple issue (superscalar) second extension: scheduling instructions for more ILP option #1: dynamic scheduling (by the hardware) option #2: static

More information

CPU Organisation and Operation

CPU Organisation and Operation CPU Organisation and Operation The Fetch-Execute Cycle The operation of the CPU 1 is usually described in terms of the Fetch-Execute cycle. 2 Fetch-Execute Cycle Fetch the Instruction Increment the Program

More information

VLIW Processors. VLIW Processors

VLIW Processors. VLIW Processors 1 VLIW Processors VLIW ( very long instruction word ) processors instructions are scheduled by the compiler a fixed number of operations are formatted as one big instruction (called a bundle) usually LIW

More information

Computer Architecture TDTS10

Computer Architecture TDTS10 why parallelism? Performance gain from increasing clock frequency is no longer an option. Outline Computer Architecture TDTS10 Superscalar Processors Very Long Instruction Word Processors Parallel computers

More information

Spring 2011 Prof. Hyesoon Kim

Spring 2011 Prof. Hyesoon Kim Spring 2011 Prof. Hyesoon Kim MIPS Architecture MIPS (Microprocessor without interlocked pipeline stages) MIPS Computer Systems Inc. Developed from Stanford MIPS architecture usages 1990 s R2000, R3000,

More information

The University of Nottingham

The University of Nottingham The University of Nottingham School of Computer Science A Level 1 Module, Autumn Semester 2007-2008 Computer Systems Architecture (G51CSA) Time Allowed: TWO Hours Candidates must NOT start writing their

More information

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s) Addressing The problem Objectives:- When & Where do we encounter Data? The concept of addressing data' in computations The implications for our machine design(s) Introducing the stack-machine concept Slide

More information

Giving credit where credit is due

Giving credit where credit is due JP 284H oundations of Computer Systems Processor Architecture VI: rap-up Giving credit where credit is due ost of slides for this lecture are based on slides created by r. Bryant, Carnegie ellon University.

More information

Instruction Set Design

Instruction Set Design Instruction Set Design Instruction Set Architecture: to what purpose? ISA provides the level of abstraction between the software and the hardware One of the most important abstraction in CS It s narrow,

More information

Review: MIPS Addressing Modes/Instruction Formats

Review: MIPS Addressing Modes/Instruction Formats Review: Addressing Modes Addressing mode Example Meaning Register Add R4,R3 R4 R4+R3 Immediate Add R4,#3 R4 R4+3 Displacement Add R4,1(R1) R4 R4+Mem[1+R1] Register indirect Add R4,(R1) R4 R4+Mem[R1] Indexed

More information

Instruction Set Architecture

Instruction Set Architecture Instruction Set Architecture Consider x := y+z. (x, y, z are memory variables) 1-address instructions 2-address instructions LOAD y (r :=y) ADD y,z (y := y+z) ADD z (r:=r+z) MOVE x,y (x := y) STORE x (x:=r)

More information

EE361: Digital Computer Organization Course Syllabus

EE361: Digital Computer Organization Course Syllabus EE361: Digital Computer Organization Course Syllabus Dr. Mohammad H. Awedh Spring 2014 Course Objectives Simply, a computer is a set of components (Processor, Memory and Storage, Input/Output Devices)

More information

#5. Show and the AND function can be constructed from two NAND gates.

#5. Show and the AND function can be constructed from two NAND gates. Study Questions for Digital Logic, Processors and Caches G22.0201 Fall 2009 ANSWERS Digital Logic Read: Sections 3.1 3.3 in the textbook. Handwritten digital lecture notes on the course web page. Study

More information

Administration. Instruction scheduling. Modern processors. Examples. Simplified architecture model. CS 412 Introduction to Compilers

Administration. Instruction scheduling. Modern processors. Examples. Simplified architecture model. CS 412 Introduction to Compilers CS 4 Introduction to Compilers ndrew Myers Cornell University dministration Prelim tomorrow evening No class Wednesday P due in days Optional reading: Muchnick 7 Lecture : Instruction scheduling pr 0 Modern

More information

Chapter 5 Instructor's Manual

Chapter 5 Instructor's Manual The Essentials of Computer Organization and Architecture Linda Null and Julia Lobur Jones and Bartlett Publishers, 2003 Chapter 5 Instructor's Manual Chapter Objectives Chapter 5, A Closer Look at Instruction

More information

Using Graphics and Animation to Visualize Instruction Pipelining and its Hazards

Using Graphics and Animation to Visualize Instruction Pipelining and its Hazards Using Graphics and Animation to Visualize Instruction Pipelining and its Hazards Per Stenström, Håkan Nilsson, and Jonas Skeppstedt Department of Computer Engineering, Lund University P.O. Box 118, S-221

More information

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Chapter 2 Basic Structure of Computers Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Functional Units Basic Operational Concepts Bus Structures Software

More information

LSN 2 Computer Processors

LSN 2 Computer Processors LSN 2 Computer Processors Department of Engineering Technology LSN 2 Computer Processors Microprocessors Design Instruction set Processor organization Processor performance Bandwidth Clock speed LSN 2

More information

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language 198:211 Computer Architecture Topics: Processor Design Where are we now? C-Programming A real computer language Data Representation Everything goes down to bits and bytes Machine representation Language

More information

This Unit: Code Scheduling. CIS 371 Computer Organization and Design. Pipelining Review. Readings. ! Pipelining and superscalar review

This Unit: Code Scheduling. CIS 371 Computer Organization and Design. Pipelining Review. Readings. ! Pipelining and superscalar review This Unit: Code Scheduling CIS 371 Computer Organization and Design App App App System software Mem CPU I/O! Pipelining and superscalar review! Code scheduling! To reduce pipeline stalls! To increase ILP

More information

150127-Microprocessor & Assembly Language

150127-Microprocessor & Assembly Language Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an

More information

Multicore and Parallel Processing

Multicore and Parallel Processing Multicore and Parallel Processing Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University P & H Chapter 4.10 11, 7.1 6 Administrivia FlameWar Games Night Next Friday, April 27 th 5pm

More information

Instruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010

Instruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010 Instruction Set Architecture Micro-architecture Datapath & Control CIT 595 Spring 2010 ISA =Programmer-visible components & operations Memory organization Address space -- how may locations can be addressed?

More information

Introduction to Cloud Computing

Introduction to Cloud Computing Introduction to Cloud Computing Parallel Processing I 15 319, spring 2010 7 th Lecture, Feb 2 nd Majd F. Sakr Lecture Motivation Concurrency and why? Different flavors of parallel computing Get the basic

More information

Introduction to RISC Processor. ni logic Pvt. Ltd., Pune

Introduction to RISC Processor. ni logic Pvt. Ltd., Pune Introduction to RISC Processor ni logic Pvt. Ltd., Pune AGENDA What is RISC & its History What is meant by RISC Architecture of MIPS-R4000 Processor Difference Between RISC and CISC Pros and Cons of RISC

More information

StrongARM** SA-110 Microprocessor Instruction Timing

StrongARM** SA-110 Microprocessor Instruction Timing StrongARM** SA-110 Microprocessor Instruction Timing Application Note September 1998 Order Number: 278194-001 Information in this document is provided in connection with Intel products. No license, express

More information

Introducción. Diseño de sistemas digitales.1

Introducción. Diseño de sistemas digitales.1 Introducción Adapted from: Mary Jane Irwin ( www.cse.psu.edu/~mji ) www.cse.psu.edu/~cg431 [Original from Computer Organization and Design, Patterson & Hennessy, 2005, UCB] Diseño de sistemas digitales.1

More information

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

A s we saw in Chapter 4, a CPU contains three main sections: the register section, 6 CPU Design A s we saw in Chapter 4, a CPU contains three main sections: the register section, the arithmetic/logic unit (ALU), and the control unit. These sections work together to perform the sequences

More information

A Flexible Simulator of Pipelined Processors

A Flexible Simulator of Pipelined Processors A Flexible Simulator of Pipelined Processors Ben Juurlink Koen Bertels Bei Li Computer Engineering Laboratory Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology

More information

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM 1 The ARM architecture processors popular in Mobile phone systems 2 ARM Features ARM has 32-bit architecture but supports 16 bit

More information

MICROPROCESSOR AND MICROCOMPUTER BASICS

MICROPROCESSOR AND MICROCOMPUTER BASICS Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit

More information

PART B QUESTIONS AND ANSWERS UNIT I

PART B QUESTIONS AND ANSWERS UNIT I PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1 MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

More information

The Memory Hierarchy & Cache Review of Memory Hierarchy & Cache Basics (from 550):

The Memory Hierarchy & Cache Review of Memory Hierarchy & Cache Basics (from 550): Review From 550 The Memory Hierarchy & Cache Review of Memory Hierarchy & Cache Basics (from 550): Motivation for The Memory Hierarchy: CPU/Memory Performance Gap The Principle Of Locality Cache Basics:

More information

An Introduction to the ARM 7 Architecture

An Introduction to the ARM 7 Architecture An Introduction to the ARM 7 Architecture Trevor Martin CEng, MIEE Technical Director This article gives an overview of the ARM 7 architecture and a description of its major features for a developer new

More information

EC 362 Problem Set #2

EC 362 Problem Set #2 EC 362 Problem Set #2 1) Using Single Precision IEEE 754, what is FF28 0000? 2) Suppose the fraction enhanced of a processor is 40% and the speedup of the enhancement was tenfold. What is the overall speedup?

More information

CHAPTER 7: The CPU and Memory

CHAPTER 7: The CPU and Memory CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides

More information

OC By Arsene Fansi T. POLIMI 2008 1

OC By Arsene Fansi T. POLIMI 2008 1 IBM POWER 6 MICROPROCESSOR OC By Arsene Fansi T. POLIMI 2008 1 WHAT S IBM POWER 6 MICROPOCESSOR The IBM POWER6 microprocessor powers the new IBM i-series* and p-series* systems. It s based on IBM POWER5

More information

BEAGLEBONE BLACK ARCHITECTURE MADELEINE DAIGNEAU MICHELLE ADVENA

BEAGLEBONE BLACK ARCHITECTURE MADELEINE DAIGNEAU MICHELLE ADVENA BEAGLEBONE BLACK ARCHITECTURE MADELEINE DAIGNEAU MICHELLE ADVENA AGENDA INTRO TO BEAGLEBONE BLACK HARDWARE & SPECS CORTEX-A8 ARMV7 PROCESSOR PROS & CONS VS RASPBERRY PI WHEN TO USE BEAGLEBONE BLACK Single

More information

Central Processing Unit

Central Processing Unit Chapter 4 Central Processing Unit 1. CPU organization and operation flowchart 1.1. General concepts The primary function of the Central Processing Unit is to execute sequences of instructions representing

More information

COMPUTER ORGANIZATION ARCHITECTURES FOR EMBEDDED COMPUTING

COMPUTER ORGANIZATION ARCHITECTURES FOR EMBEDDED COMPUTING COMPUTER ORGANIZATION ARCHITECTURES FOR EMBEDDED COMPUTING 2013/2014 1 st Semester Sample Exam January 2014 Duration: 2h00 - No extra material allowed. This includes notes, scratch paper, calculator, etc.

More information

Week 1 out-of-class notes, discussions and sample problems

Week 1 out-of-class notes, discussions and sample problems Week 1 out-of-class notes, discussions and sample problems Although we will primarily concentrate on RISC processors as found in some desktop/laptop computers, here we take a look at the varying types

More information

Model Answers HW2 - Chapter #3

Model Answers HW2 - Chapter #3 Model Answers HW2 - Chapter #3 1. The hypothetical machine of figure 3.4 also has two I/O instructions: 0011= Load AC fro I/O 0111= Store AC to I/O In these cases the 12-bit address identifies a particular

More information

A Lab Course on Computer Architecture

A Lab Course on Computer Architecture A Lab Course on Computer Architecture Pedro López José Duato Depto. de Informática de Sistemas y Computadores Facultad de Informática Universidad Politécnica de Valencia Camino de Vera s/n, 46071 - Valencia,

More information

Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX

Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX Overview CISC Developments Over Twenty Years Classic CISC design: Digital VAX VAXÕs RISC successor: PRISM/Alpha IntelÕs ubiquitous 80x86 architecture Ð 8086 through the Pentium Pro (P6) RJS 2/3/97 Philosophy

More information

Embedded Systems Design with Platform FPGAs

Embedded Systems Design with Platform FPGAs Embedded Systems Design with Platform FPGAs Principles & Practices Ron Sass and Andrew G. Schmidt http://www.rcs.uncc.edu/ rsass University of North Carolina at Charlotte Spring 2011 Embedded Systems Design

More information

Module: Software Instruction Scheduling Part I

Module: Software Instruction Scheduling Part I Module: Software Instruction Scheduling Part I Sudhakar Yalamanchili, Georgia Institute of Technology Reading for this Module Loop Unrolling and Instruction Scheduling Section 2.2 Dependence Analysis Section

More information

BASIC COMPUTER ORGANIZATION AND DESIGN

BASIC COMPUTER ORGANIZATION AND DESIGN 1 BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference Instructions Input-Output and Interrupt Complete

More information

Chapter 4. Arithmetic for Computers

Chapter 4. Arithmetic for Computers Chapter 4 Arithmetic for Computers Arithmetic Where we've been: Performance (seconds, cycles, instructions) What's up ahead: Implementing the Architecture operation a b 32 32 ALU 32 result 2 Constructing

More information

08 - Address Generator Unit (AGU)

08 - Address Generator Unit (AGU) September 30, 2013 Todays lecture Memory subsystem Address Generator Unit (AGU) Memory subsystem Applications may need from kilobytes to gigabytes of memory Having large amounts of memory on-chip is expensive

More information

CPU Organization and Assembly Language

CPU Organization and Assembly Language COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:

More information

The Microarchitecture of Superscalar Processors

The Microarchitecture of Superscalar Processors The Microarchitecture of Superscalar Processors James E. Smith Department of Electrical and Computer Engineering 1415 Johnson Drive Madison, WI 53706 ph: (608)-265-5737 fax:(608)-262-1267 email: jes@ece.wisc.edu

More information

Bindel, Spring 2010 Applications of Parallel Computers (CS 5220) Week 1: Wednesday, Jan 27

Bindel, Spring 2010 Applications of Parallel Computers (CS 5220) Week 1: Wednesday, Jan 27 Logistics Week 1: Wednesday, Jan 27 Because of overcrowding, we will be changing to a new room on Monday (Snee 1120). Accounts on the class cluster (crocus.csuglab.cornell.edu) will be available next week.

More information

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,

More information

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA) Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture : Microprogrammed Control Microprogramming The control unit is responsible for initiating the sequence of microoperations that comprise instructions.

More information

UNIT III CONTROL UNIT DESIGN

UNIT III CONTROL UNIT DESIGN UNIT III CONTROL UNIT DESIGN INTRODUCTION CONTROL TRANSFER FETCH CYCLE INSTRUCTION INTERPRETATION AND EXECUTION HARDWIRED CONTROL MICROPROGRAMMED CONTROL Slides Courtesy of Carl Hamacher, Computer Organization,

More information