1 5.5 A Multicycle Implementation A single memory unit is used for both instructions and data. There is a single ALU, rather than an ALU and two adders.

Slides:



Advertisements
Similar presentations
1 Chapter Five The Processor: Datapath and Control.
Advertisements

Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 14 - Multi-Cycle.
The Processor Data Path & Control Chapter 5 Part 2 - Multi-Clock Cycle Design N. Guydosh 2/29/04.
Chapter 5 The Processor: Datapath and Control Basic MIPS Architecture Homework 2 due October 28 th. Project Designs due October 28 th. Project Reports.
EECE476 Lecture 9: Multi-cycle CPU Datapath Chapter 5: Section 5.5 The University of British ColumbiaEECE 476© 2005 Guy Lemieux.
CSE378 Multicycle impl,.1 Drawbacks of single cycle implementation All instructions take the same time although –some instructions are longer than others;
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
©UCB CS 161Computer Architecture Chapter 5 Lecture 11 Instructor: L.N. Bhuyan Adapted from notes by Dave Patterson (http.cs.berkeley.edu/~patterson)
Preparation for Midterm Binary Data Storage (integer, char, float pt) and Operations, Logic, Flip Flops, Switch Debouncing, Timing, Synchronous / Asynchronous.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Advanced Computer Architecture 5MD00 / 5Z033 MIPS Design data path and control Henk Corporaal TUEindhoven 2007.
331 W10.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 10 Building a Multi-Cycle Datapath [Adapted from Dave Patterson’s.
CSE431 L05 Basic MIPS Architecture.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 05: Basic MIPS Architecture Review Mary Jane Irwin.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
CSE331 W10&11.1Irwin Fall 2007 PSU CSE 331 Computer Organization and Design Fall 2007 Week 10 & 11 Section 1: Mary Jane Irwin (
Computer Architecture Chapter 5 Fall 2005 Department of Computer Science Kent State University.
Datapath and Control: MultiCycle Implementation. Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and.
EE204 L12-Single Cycle DP PerformanceHina Anwar Khan EE204 Computer Architecture Single Cycle Data path Performance.
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
Computer Organization Lecture Set – 05.2 Chapter 5 Huei-Yung Lin.
1 CS/COE0447 Computer Organization & Assembly Language Multi-Cycle Execution.
C HAPTER 5 T HE PROCESSOR : D ATAPATH AND C ONTROL M ULTICYCLE D ESIGN.
Multicycle Implementation
LECTURE 6 Multi-Cycle Datapath and Control. SINGLE-CYCLE IMPLEMENTATION As we’ve seen, single-cycle implementation, although easy to implement, could.
ECE-C355 Computer Structures Winter 2008 The MIPS Datapath Slides have been adapted from Prof. Mary Jane Irwin ( )
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Fall 2015, Sep ELEC / Lecture 5 1 ELEC / Computer Architecture and Design Fall 2015 Datapath and Control (Chapter.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 10: Control Design
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3 In-Class Exercises.
Design a MIPS Processor (II)
Multi-Cycle Datapath and Control
Chapter 5: A Multi-Cycle CPU.
CS161 – Design and Architecture of Computer Systems
IT 251 Computer Organization and Architecture
Systems Architecture I
Multi-Cycle CPU.
Extensions to the Multicycle CPU
Single Cycle Processor
D.4 Finite State Diagram for the Multi-cycle processor
Multi-Cycle CPU.
CS/COE0447 Computer Organization & Assembly Language
Multiple Cycle Implementation of MIPS-Lite CPU
CSCE 212 Chapter 5 The Processor: Datapath and Control
Chapter Five The Processor: Datapath and Control
Multicycle Approach Break up the instructions into steps
The Multicycle Implementation
CS/COE0447 Computer Organization & Assembly Language
Chapter Five The Processor: Datapath and Control
Drawbacks of single cycle implementation
The Multicycle Implementation
Systems Architecture I
Vishwani D. Agrawal James J. Danaher Professor
Multicycle Approach We will be reusing functional units
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Processor: Multi-Cycle Datapath & Control
Multicycle Design.
CS/COE0447 Computer Organization & Assembly Language
Multi-Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Chapter Four The Processor: Datapath and Control
Control Unit for Multiple Cycle Implementation
5.5 A Multicycle Implementation
Processor Design Datapath and Design.
Systems Architecture I
Control Unit for Multiple Cycle Implementation
FloorPlan for Multicycle MIPS
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

1 5.5 A Multicycle Implementation A single memory unit is used for both instructions and data. There is a single ALU, rather than an ALU and two adders. One or more registers are added after every major functional unit.

2 Continue Replacing the three ALUs of the single-cycle by a single ALU means that the single ALU must accommodate all the inputs that used to go to the three different ALUs.

3 Continue Control signals: The programmer-visible state units (PC, Memory, Register file) and IR  write Memory  Read ALU control: same as single cycle Multiplexor single/two control lines

4 Continue Three possible sources for the PC: 1.PC+4 2.ALUOut : address of the beq 3.Address for jump ( j ) PC write control signal: PCWrite : PC+4 and jump PCWriteCond : beq

5 Continue

6 Breaking the Instruction Execution into Clock Cycles IR <= Memory[PC]; MemRead IRWrite IorD = PC <= PC + 4; ALUSrcA = 0 ALUSrcB = 01 ALUOp = 00 (for add) PCSource = 00 PCWrite The increment of the PC and instruction memory access can occur in parallel, how? 1. Instruction fetch step IR <= Memory[PC]; PC <= PC + 4;

7 Breaking the Instruction Execution into Clock Cycles 2.Instruction decode and register fetch step –Actions that are either applicable to all instructions –Or are not harmful A <= Reg[IR[25:21]]; B <= Reg[IR[20:16]]; ALUOut <= PC + (sign-extend(IR[15-0] << 2 );

8 A <= Reg[IR[25:21]]; B <= Reg[IR[20:16]]; Since A and B are overwritten on every cycle  Done ALUOut <= PC + (sign- extend(IR[15-0]<<2); This requires: ALUSrcA  0 ALUSrcB  11 ALUOp  00 (for add) branch target address will be stored in ALUOut. The register file access and computation of branch target occur in parallel. 2. Instruction decode and register fetch step A <= Reg[IR[25:21]]; B <= Reg[IR[20:16]]; ALUOut <= PC + (sign-extend(IR[15-0] << 2 );

9 Breaking the Instruction Execution into Clock Cycles 3.Execution, memory address computation, or branch completion Memory reference: ALUOut <= A + sign-extend(IR[15:0]); Arithmetic-logical instruction: ALUOut <= A op B; Branch: if (A == B) PC <= ALUOut; Jump: PC <= { PC[31:28], (IR[25:0], 2’b00) };

10 Memory reference: ALUOut <= A + sign-extend(IR[15:0]); ALUSrcA = 1 && ALUSrcB = 10 ALUOp = 00 Arithmetic-logical instruction: ALUOut <= A op B; ALUSrcA = 1 && ALUSrcB = 00 ALUOp = 10 Branch: if (A == B) PC <= ALUOut; ALUSrcA = 1 && ALUSrcB = 00 ALUOp = 01 (for subtraction) PCSource = 01 PCWriteCond Jump: PC <= { PC[31:28], (IR[25:0],2’b00) }; PCSource = 10 PCWrite 3. Execution, memory address computation, or branch completion

11 Breaking the Instruction Execution into Clock Cycles 4.Memory access or R-type instruction completion step Memory reference: MDR <= Memory [ALUOut];MemRead or IorD=1 Memory [ALUOut] <= B;MemWrite Arithmetic-logical instruction (R-type): Reg[IR[15:11]] <= ALUOut;RegDst=1 RegWrite MemtoReg=0 5.Memory read completion step Load: Reg[IR[20:16]] <= MDR; MemtoReg=1 RegWrite RegDst=0

12 Breaking the Instruction Execution into Clock Cycles

13 Defining the Control Two different techniques to design the control: –Finite state machine –Microprogramming Example: CPI in a Multicycle CPU Using the SPECINT2000 instruction mix, which is: 25% load, 10% store, 11% branches, 2% jumps, and 52% ALU. What is the CPI, assuming that each state in the multicycle CPU requires 1 clock cycle? Answer: The number of clock cycles for each instruction class is the following:  Load: 5  Stores: 4  ALU instruction: 4  Branches: 3  Jumps: 3

14 Example Continue The CPI is given by the following: is simply the instruction frequency for the instruction class i. We can therefore substitute to obtain: CPI = 0.25      3 = 4.12 This CPI is better than the worst-case CPI of 5.0 when all instructions take the same number of clock cycles.

15 Defining the Control (Continue)

16 Defining the Control (Continue) The complete finite state machine control

17 Defining the Control (Continue) Finite state machine controllers are typically implemented using a block of combinational logic and a register to hold the current state.

Exceptions Exceptions Interrupts Type of eventFrom where?MIPS terminology I/O device requestExternalInterrupt Invoke the operating system from user programInternalException Arithmetic overflowInternalException Using an undefined instructionInternalException Hardware malfunctionEitherException or interrupt

19 How Exception Are Handled To communicate the reason for an exception: 1.a status register ( called the Cause register) 2.vectored interrupts Exception typeException vector address (in hex) Undefined instructionC hex Arithmetic overflowC hex

20 How Control Checks for Exception Assume two possible exceptions:  Undefined instruction  Arithmetic overflow

21 Continue The multicycle datapath with the addition needed to implement exceptions

22 Continue The finite state machine with the additions to handle exception detection