COMS 361 Computer Organization

Slides:



Advertisements
Similar presentations
361 datapath Computer Architecture Lecture 8: Designing a Single Cycle Datapath.
Advertisements

The Processor: Datapath & Control
CS61C L26 Single Cycle CPU Datapath II (1) Garcia © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C : Machine.
Savio Chau Single Cycle Controller Design Last Time: Discussed the Designing of a Single Cycle Datapath Control Datapath Memory Processor (CPU) Input Output.
Processor II CPSC 321 Andreas Klappenecker. Midterm 1 Tuesday, October 5 Thursday, October 7 Advantage: less material Disadvantage: less preparation time.
EECC250 - Shaaban #1 lec #22 Winter The Von-Neumann Computer Model Partitioning of the computing engine into components: –Central Processing.
ECE 232 L13. Control.1 ©UCB, DAP’ 97 ECE 232 Hardware Organization and Design Lecture 13 Control Design
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
CS 61C L17 Control (1) A Carle, Summer 2006 © UCB inst.eecs.berkeley.edu/~cs61c/su06 CS61C : Machine Structures Lecture #17: CPU Design II – Control
CS61C L26 CPU Design : Designing a Single-Cycle CPU II (1) Garcia, Fall 2006 © UCB Lecturer SOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 25 CPU design (of a single-cycle CPU) Intel is prototyping circuits that.
CS 61C L16 Datapath (1) A Carle, Summer 2004 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #16 – Datapath Andy.
ECE 232 L12.Datapath.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 12 Datapath.
The Processor: Datapath & Control. Implementing Instructions Simplified instruction set memory-reference instructions: lw, sw arithmetic-logical instructions:
CS3350B Computer Architecture Winter 2015 Lecture 5.6: Single-Cycle CPU: Datapath Control (Part 1) Marc Moreno Maza [Adapted.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
EEM 486: Computer Architecture Designing Single Cycle Control.
EEM 486: Computer Architecture Designing a Single Cycle Datapath.
CS2100 Computer Organisation The Processor: Datapath (AY2015/6) Semester 1.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
CPE 442 single-cycle datapath.1 Intro. To Computer Architecture CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath.
W.S Computer System Design Lecture 4 Wannarat Suntiamorntut.
CS3350B Computer Architecture Winter 2015 Lecture 5.7: Single-Cycle CPU: Datapath Control (Part 2) Marc Moreno Maza [Adapted.
By Wannarat Computer System Design Lecture 4 Wannarat Suntiamorntut.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
Csci 136 Computer Architecture II –Single-Cycle Datapath Xiuzhen Cheng
EEM 486: Computer Architecture Lecture 3 Designing Single Cycle Control.
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Single-Cycle CPU Datapath & Control Part 2 Instructors: Krste Asanovic & Vladimir Stojanovic.
Single Cycle Controller Design
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Access the Instruction from Memory
CS 230: Computer Organization and Assembly Language
Single-Cycle Datapath and Control
Computer Architecture
IT 251 Computer Organization and Architecture
(Chapter 5: Hennessy and Patterson) Winter Quarter 1998 Chris Myers
Computer Organization Fall 2017 Chapter 4A: The Processor, Part A
Processor (I).
MIPS processor continued
CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath Start: X:40.
CPU Organization (Design)
Single Cycle CPU Design
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
Instructors: Randy H. Katz David A. Patterson
The Single Cycle Datapath
Topic 5: Processor Architecture Implementation Methodology
CS152 Computer Architecture and Engineering Lecture 8 Designing a Single Cycle Datapath Start: X:40.
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
Access the Instruction from Memory
Computer Architecture Processor: Datapath
Prof. Giancarlo Succi, Ph.D., P.Eng.
MIPS processor continued
Instructors: Randy H. Katz David A. Patterson
CS/COE0447 Computer Organization & Assembly Language
The Processor: Datapath & Control.
What You Will Learn In Next Few Sets of Lectures
Designing a Single-Cycle Processor
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

COMS 361 Computer Organization Title: MIPS Datapath Date: 12/02/2004 Lecture Number: 26

Announcements

Review MIPS implementation Subset of the MIPS instruction set

Outline MIPS implementation Subset of the MIPS instruction set Data flow Control

The Processor All MIPS instructions use the ALU after reading the registers Why? Memory-reference? Effective address must be computed Arithmetic? Operation execution Control flow? Comparison

The Processor Instruction completion differs among classes after using the ALU Memory-reference Access memory write data for a store read data for a load Arithmetic Write the ALU data into a register Control flow May need to modify the address in the PC

The Processor Design steps completed Next step: 1) Analyze instruction set => datapath requirements 2) Select set of datapath components and establish clocking methodology Next step: 3) Assemble datapath meeting the requirements

Implementation Details Abstract / Simplified / High-Level View

Fetch Instruction Functional Unit Fetch the Instruction: mem[PC] Update the program counter: Sequential Code: PC <- PC + 4 Branch and Jump: PC <- “some other address” PC Adder Sum 4 Instruction address memory 32

Fetch Instruction Functional Unit Fetch the Instruction: mem[PC] Update the program counter: Sequential Code: PC <- PC + 4 Branch and Jump: PC <- “some other address” PC Adder Sum 4 Instruction address memory 32

Arithmetic Instructions addU rd, rs, rt R[rd] <- R[rs] + R[rt] ALUoperation Control logic after decoding the instruction Instructs the ALU as to the proper operation for the instruction RegWrite Asserted to store result in a register

Arithmetic Instructions op rs rt rd shamt funct 6 11 16 21 26 31 6 bits 5 bits Read register number 1 RegWrite Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A B ALU Result

Or Immediate ori rt, rs, imm16 R[rt] <- R[rs] || ZeroExt[imm16] Destination register can be either rt or rd Select the correct instruction field for destination register address 11 op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits rd? immediate 16 15 31 16 bits 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Or Immediate How does the datapath for an R-type instruction change when Add a register to an immediate value R[rt] <- R[rs] || ZeroExt[imm16] A input to the ALU Read Data 1 from the register file Incorporate zero extension unit Add zero extended 16-bit immediate operand B input of ALU Read Data 2 Zero extended 16-bit immediate operand

Or Immediate I-type instruction datapath Added ALUsrc control signal Read register number 1 RegWrite Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result ALUsrc MUX zero extend 16 Imm B

R- and I-type Instructions R-type and some I-type instructions datapath Added RegDst control signal Read register number 1 RegWrite Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result RegDst MUX ALUsrc zero extend 16 Imm B

Load Word Instruction lw rt, rs, imm16 R[rt] <- Mem[R[rs] + SignExt[imm16]] Compute effective address of the word to load Contents of rs added to a sign extended 16-bit immediate value Write the word to register rt 11 op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits rd

Load Word Instruction Same hardware for performing arithmetic and logical operations on an immediate operand Added a more general bit extender Read register number 1 RegWrite Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result ALUsrc MUX zero- sign extend 16 Imm B

Load Word Instruction Read a word from memory given the address on the Result line Read register number 1 RegWrite Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result ALUsrc MUX zero-sign extend 16 Imm Data Out Data In Write Enable Addr Data Memory MemWrite B

Load Word Instruction Word read from memory must be saved in register rt ALU result is connected to the Write Data line of the register file Read register number 1 RegWrite Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result ALUsrc MUX zero-sign extend 16 Imm Data Out Data In Write Enable Addr Data Memory MemWrite B

Load Word Instruction Add a multiplexor to select one of two outputs The ALU and the Data Memory Read register number 1 RegWr Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result ALUsrc MUX zero-sign extend 16 Imm Data Out Data In Write Enable Addr Data Memory MemWr MemToReg B

Store Word Instruction sw rt, rs, imm16 Mem[ R[rs] + SignExt[imm16] ]<- R[rt] Compute effective address of the word to store Contents of rs added to a sign extended 16-bit immediate value Read the word in register rt op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits

Store Word Instruction Same hardware for performing Arithmetic and logical operations on an immediate operand Load word effective address computation Read register number 1 RegWr Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result ALUsrc MUX zero-sign extend 16 Imm B

Store Word Instruction Read a word from register rt and store at the given address on the Result line Connect read register 2 line of the register file to the Data In line of the data memory Read register number 1 RegWr Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result ALUsrc MUX zero-sign extend 16 Imm Data Out Data In Write Enable Addr Data Memory MemWr MemToReg B

The Branch Instruction op rs rt immediate 16 21 26 31 6 bits 16 bits 5 bits beq rs, rt, imm16 Equal <- R[rs] == R[rt] Calculate the branch condition if (COND eq 0) Calculate address of next instruction PC <- PC + 4 + (Shift left 2 bits(SignExt(imm16) x 4 )) else PC <- PC + 4 Next instruction logic from before

The Branch Instruction beq rs, rt, imm16 Equal <- R[rs] == R[rt] Calculate the branch condition PC Instruction Address Instruction Instruction Memory Next Address Logic

The Branch Instruction beq rs, rt, imm16 Two inputs for the PC PC = PC + 4 and PC = PC + 4 + ( SignExt(imm16) x 4 ) PC Adder Sum Instruction Address 4 Instruction Instruction Memory PCSrc MUX 32 zero-sign extend 16 Imm Shift left 2 New control signal

All together

4 MUX Instruction Memory ALU MUX Data Memory Shift left 2 PC Adder Sum 4 Instruction Address Instruction Instruction Memory PCSrc MUX 32 zero-sign extend 16 Imm Shift left 2 Read register number 1 RegWr Clk number 2 Write register data Read data 1 data 2 5 32 Rs Rt Rd ALUoperation A ALU Result ALUsrc MUX zero-sign extend 16 Imm Data Out Data In Write Enable Addr Data Memory MemWr MemToReg B

Data Path 4 MUX Instruction Memory Shift left 2 zero-sign extend PCSrc Adder Sum 4 Instruction Address Instruction Instruction Memory PCSrc MUX 32 zero-sign extend 16 Imm Shift left 2