1  1998 Morgan Kaufmann Publishers CH5 Datapath review.

Slides:



Advertisements
Similar presentations
Adding the Jump Instruction
Advertisements

1 Datapath and Control (Multicycle datapath) CDA 3101 Discussion Section 11.
CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
Multicycle Datapath & Control Andreas Klappenecker CPSC321 Computer Architecture.
1  1998 Morgan Kaufmann Publishers We will be reusing functional units –ALU used to compute address and to increment PC –Memory used for instruction and.
1 Chapter Five The Processor: Datapath and Control.
1  1998 Morgan Kaufmann Publishers & Ing-Jer Huang Chapter Five last upate: 6/11/2015.
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
PCPC addr instr INSTR MEM R1 R2 WR W Data R Data 1 R Data 2 ALU DATA MEM ALU CTRL rs rt op +4 shift 2 zero BRANCH CTRL muxmux sign extend immed 1632 ADDADD.
L14 – Control & Execution 1 Comp 411 – Fall /04/09 Control & Execution Finite State Machines for Control MIPS Execution.
VHDL Development for ELEC7770 VLSI Project Chris Erickson Graduate Student Department of Electrical and Computer Engineering Auburn University, Auburn,
CSE378 Multicycle impl,.1 Drawbacks of single cycle implementation All instructions take the same time although –some instructions are longer than others;
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.
10/26/2004Comp 120 Fall October Only 11 to go! Questions? Today Exam Review and Instruction Execution.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
1  1998 Morgan Kaufmann Publishers & Ing-Jer Huang Chapter Five last upate: 6/24/2015.
10/18/2005Comp 120 Fall October Questions? Instruction Execution.
L15 – Control & Execution 1 Comp 411 – Spring /25/08 Control & Execution Finite State Machines for Control MIPS Execution.
331 W10.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 10 Building a Multi-Cycle Datapath [Adapted from Dave Patterson’s.
CPU Architecture Why not single cycle? Why not single cycle? Hardware complexity Hardware complexity Why not pipelined? Why not pipelined? Time constraints.
1 The Processor: Datapath and Control We will design a microprocessor that includes a subset of the MIPS instruction set: –Memory access: load/store word.
Class 9.1 Computer Architecture - HUJI Computer Architecture Class 9 Microprogramming.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Multi-Cycle Processor.
The Multicycle Processor CPSC 321 Andreas Klappenecker.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
EECS 322: Computer Architecture
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
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.
1  2004 Morgan Kaufmann Publishers Chapter Five.
Multicycle Implementation
LECTURE 6 Multi-Cycle Datapath and Control. SINGLE-CYCLE IMPLEMENTATION As we’ve seen, single-cycle implementation, although easy to implement, could.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
Multicycle datapath.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
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.
Multi-Cycle Datapath and Control
CS161 – Design and Architecture of Computer Systems
/ Computer Architecture and Design
Systems Architecture I
Five Execution Steps Instruction Fetch
MIPS Instructions.
CS/COE0447 Computer Organization & Assembly Language
Multiple Cycle Implementation of MIPS-Lite CPU
CS/COE0447 Computer Organization & Assembly Language
CSCE 212 Chapter 5 The Processor: Datapath and Control
Multicycle Approach Break up the instructions into steps
The Multicycle Implementation
CS/COE0447 Computer Organization & Assembly Language
The Multicycle Implementation
Systems Architecture I
Multicycle Approach We will be reusing functional units
MIPS Microarchitecture Multicycle Processor
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.
Review Fig 4.15 page 320 / Fig page 322
Chapter Four The Processor: Datapath and Control
5.5 A Multicycle Implementation
Processor Design Datapath and Design.
Drawbacks of single cycle implementation
Drawbacks of single cycle implementation
Systems Architecture I
CS161 – Design and Architecture of Computer Systems
Presentation transcript:

1  1998 Morgan Kaufmann Publishers CH5 Datapath review

2  1998 Morgan Kaufmann Publishers The single cycle datapath of an add instruction 100 add rd, rs, rt 0rsrtrd0 rs rt 0X20 rd

3  1998 Morgan Kaufmann Publishers The single cycle datapath of load instruction 104 lw $rt, $rs, offset 0x23rsrtOffset rs rt Offset

4  1998 Morgan Kaufmann Publishers The multi cycle datapath of add instruction add rd, rs, rt 0rsrtrd00X20

5  1998 Morgan Kaufmann Publishers Step 1 taken to execute add instruction Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR

6  1998 Morgan Kaufmann Publishers Step 1 taken to execute add instruction

7  1998 Morgan Kaufmann Publishers The multi cycle datapath of add instruction (cycle 1) add rd, rs, rt 0rsrtrd00X20

8  1998 Morgan Kaufmann Publishers Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) % Speculative Computing Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR Step 2 taken to execute add instruction

9  1998 Morgan Kaufmann Publishers Step 2 taken to execute add instruction

10  1998 Morgan Kaufmann Publishers The multi cycle datapath of add instruction (cycle 2) add rd, rs, rt 0rsrtrd00X20 rs rt ALUOut = PC + (sign-extend(IR[15-0]<<2)) (Speculative Computing)

11  1998 Morgan Kaufmann Publishers Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR Step 3 taken to execute add instruction

12  1998 Morgan Kaufmann Publishers Step 3 taken to execute add instruction

13  1998 Morgan Kaufmann Publishers The multi cycle datapath of add instruction (cycle 3) add rd, rs, rt 0rsrtrd00X20 ALUOut = A op B

14  1998 Morgan Kaufmann Publishers Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR Step 4 taken to execute add instruction

15  1998 Morgan Kaufmann Publishers Step 4 taken to execute add instruction

16  1998 Morgan Kaufmann Publishers The multi cycle datapath of add instruction (cycle 4) add rd, rs, rt 0rsrtrd00X20

17  1998 Morgan Kaufmann Publishers The multi cycle datapath of lw instruction 0x23rsrtOffset lw rt, offset(rs)

18  1998 Morgan Kaufmann Publishers Step 1 taken to execute lw instruction Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR

19  1998 Morgan Kaufmann Publishers lw rt, offset(rs) 0x23rsrtOffset The multi cycle datapath of lw instruction (cycle 1)

20  1998 Morgan Kaufmann Publishers Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR Step 2 taken to execute lw instruction

21  1998 Morgan Kaufmann Publishers The multi cycle datapath of lw instruction (cycle 2) rs rt ALUOut = PC + (sign-extend(IR[15-0]<<2)) (Speculative Computing) lw rt, offset(rs) 0x23rsrtOffset

22  1998 Morgan Kaufmann Publishers Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR Step 3 taken to execute lw instruction

23  1998 Morgan Kaufmann Publishers The multi cycle datapath of lw instruction (cycle 3) lw rt, offset(rs) 0x23rsrtOffset ALUOut = A + sign-extend (IR[15-0])

24  1998 Morgan Kaufmann Publishers Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR Step 4 taken to execute lw instruction

25  1998 Morgan Kaufmann Publishers The multi cycle datapath of lw instruction (cycle 4) lw rt, offset(rs) 0x23rsrtOffset

26  1998 Morgan Kaufmann Publishers Step name Action for R- type instructions Action for memory- reference instructions Action for branches Action for jumps Instruction fetch IR = Memory[PC] PC = PC + 4 Instruction decode/register fetch A = Reg [IR[25-21]] B = Reg [IR[20-16]] ALUOut = PC + (sign-extend(IR[15-0]<<2)) Execution, address computation, branch/jump computation ALUOut = A op B ALUOut= A + sign-extend (IR[15-0]) If(A==B) then PC = ALUOut PC=PC[31-28] || (IR[25-0]<<2) Memory access or R-type completion Reg[IR[15-11]] = ALUout Load : MDR = Memory[ALUout] or Store : Memory[ALUout] = B Memory read completion Load : Reg [IR[20-16]] = MDR Step 5 taken to execute lw instruction

27  1998 Morgan Kaufmann Publishers The multi cycle datapath of lw instruction (cycle 5) lw rt, offset(rs) 0x23rsrtOffset

28  1998 Morgan Kaufmann Publishers Exceptions (overflow)

29  1998 Morgan Kaufmann Publishers The multi cycle datapath of add instruction with overflow (cycle 3) add rd, rs, rt 0rsrtrd00X20 pcsource = 11

30  1998 Morgan Kaufmann Publishers The multi cycle datapath of add instruction with overflow (cycle 4) add rd, rs, rt 0rsrtrd00X20 pcsource = 11 Cause = 1 EPC = PC (=PC old +4) – 4 PC = C0000…

31  1998 Morgan Kaufmann Publishers Exceptions (undefined instruction)

32  1998 Morgan Kaufmann Publishers The multi cycle datapath of undefined instruction (cycle 2) undef rd, rs, rt 0x16rsrtrd00x10 pcsource = 11 ?