Multiple Cycle Data Path

Similar documents
Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón

Processor: Multi- Cycle Datapath & Control

CSE 2021 COMPUTER ORGANIZATION

CPE 335. Basic MIPS Architecture Part II

CSE 2021 COMPUTER ORGANIZATION

Processor (multi-cycle)

RISC Design: Multi-Cycle Implementation

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

Computer Science 141 Computing Hardware

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction

LECTURE 6. Multi-Cycle Datapath and Control

Systems Architecture I

The Processor: Datapath & Control

EECE 417 Computer Systems Architecture

Chapter 5: The Processor: Datapath and Control

RISC Processor Design

ECE369. Chapter 5 ECE369

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

Topic #6. Processor Design

Multicycle Approach. Designing MIPS Processor

CC 311- Computer Architecture. The Processor - Control

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August

Lets Build a Processor

RISC Architecture: Multi-Cycle Implementation

Multicycle conclusion

Points available Your marks Total 100

Design of the MIPS Processor

ENE 334 Microprocessors

RISC Architecture: Multi-Cycle Implementation

CSE 2021: Computer Organization Fall 2010 Solution to Assignment # 3: Multicycle Implementation

Design of the MIPS Processor (contd)

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Data Paths and Microprogramming

Alternative to single cycle. Drawbacks of single cycle implementation. Multiple cycle implementation. Instruction fetch

Computer Architecture Chapter 5. Fall 2005 Department of Computer Science Kent State University

Note- E~ S. \3 \S U\e. ~ ~s ~. 4. \\ o~ (fw' \i<.t. (~e., 3\0)

ALUOut. Registers A. I + D Memory IR. combinatorial block. combinatorial block. combinatorial block MDR

ECE 313 Computer Organization EXAM 2 November 9, 2001

Chapter 5 Solutions: For More Practice

Major CPU Design Steps

LECTURE 5. Single-Cycle Datapath and Control

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W10-M

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours.

Processor (I) - datapath & control. Hwansoo Han

Mapping Control to Hardware

CENG 3420 Lecture 06: Datapath

Using a Hardware Description Language to Design and Simulate a Processor 5.8

Chapter 4 The Processor (Part 2)

CPE 335 Computer Organization. Basic MIPS Architecture Part I

Single Cycle Data Path

Single vs. Multi-cycle Implementation

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

Systems Architecture

COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

Lecture 5: The Processor

Digital Design & Computer Architecture (E85) D. Money Harris Fall 2007

Introduction to Pipelined Datapath

Review: Abstract Implementation View

ECE468 Computer Organization and Architecture. Designing a Multiple Cycle Controller

Control Unit for Multiple Cycle Implementation

Processor Implementation in VHDL. University of Ulster at Jordanstown University of Applied Sciences, Augsburg

Chapter 4. The Processor. Computer Architecture and IC Design Lab

CSE 141 Computer Architecture Spring Lectures 11 Exceptions and Introduction to Pipelining. Announcements

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

COMP303 - Computer Architecture Lecture 10. Multi-Cycle Design & Exceptions

ECS 154B Computer Architecture II Spring 2009

The overall datapath for RT, lw,sw beq instrucution

Microprogramming. Microprogramming

CS232 Final Exam May 5, 2001

Midterm. Sticker winners: if you got >= 50 / 67

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

Initial Representation Finite State Diagram. Logic Representation Logic Equations

THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination

comp 180 Lecture 25 Outline of Lecture The ALU Control Operation & Design The Datapath Control Operation & Design HKUST 1 Computer Science

CSEN 601: Computer System Architecture Summer 2014

Laboratory 5 Processor Datapath

CSSE232 Computer Architecture I. Mul5cycle Datapath

Microprogrammed Control Approach

CSE 2021 Computer Organization. Hugh Chesser, CSEB 1012U W9-W

Processor Design Pipelined Processor (II) Hung-Wei Tseng

ECE 313 Computer Organization Name SOLUTION EXAM 2 November 3, Floating Point 20 Points

COMP303 Computer Architecture Lecture 9. Single Cycle Control

The MIPS Processor Datapath

Final Project: MIPS-like Microprocessor

ECE232: Hardware Organization and Design

Initial Representation Finite State Diagram Microprogram. Sequencing Control Explicit Next State Microprogram counter

Inf2C - Computer Systems Lecture Processor Design Single Cycle

Design of Digital Circuits Lecture 13: Multi-Cycle Microarch. Prof. Onur Mutlu ETH Zurich Spring April 2017

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Control & Execution. Finite State Machines for Control. MIPS Execution. Comp 411. L14 Control & Execution 1

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

ECE 313 Computer Organization FINAL EXAM December 11, Multicycle Processor Design 30 Points

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

The Processor: Datapath & Control

Fundamentals of Computer Systems

Transcription:

Multiple Cycle Data Path CS 365 Lecture 7 Prof. Yih Huang CS365 1 Multicycle Approach Break up the instructions into steps, each step takes a cycle balance the amount of work to be done restrict each cycle to use only one major functional unit At the end of a cycle store values for use in later cycles introduce additional internal registers CS365 2 1

Multicycle Datapath and Control PCWriteCond PCSource PC 0 M u x 1 Address Write data Memory MemData [31-26] [25 21] [20 16] [15 0] register [15 0] Memory data register PCWrite IorD MemRead MemWrite MemtoReg IRWrite [15 11] Outputs Control Op [5 0] 0 M u x 1 0 M u x 1 Op SrcB Read register 1 Read Read register 2 data 1 Registers Write Read register data 2 16 SrcA RegWrite RegDst [25 0] 26 28 Shift Write data 32 Sign extend Shift left 2 A B 4 0 M u x 1 0 1 M u 2 x 3 control left 2 PC [31-28] Zero result Jump address [31-0] Out 0 M 1 u x 2 [5 0] CS365 3 Highlights in the New Datapath and data memory merged. An Register (IR) is introduced to store the current instruction. A Memory Data Register (MDR) is introduced to store data read from memory. New registers, simply called A and B, store the output of register read port 1 and 2. A new register, out, stores the output of. PC-only adders removed. CS365 4 2

New Control Signals IorD: Determine the input to the memory address port 0: PC (for instruction fetches) 1: output (for data accesses) RegDst: select rt or rd as the destination register Write signals for IR, MDR, A, B, PC, and out. CS365 5 srca: determines the first operand to 0: PC 1: A srcb (2 bits): determines the first operand to 00: B 01: 4 10: Sign-extended immediate 11: shifted immediate CS365 6 3

Five Execution Steps Fetch Decode and Register Fetch Execution, Memory Address Computation, or Branch Completion Memory Access or R-type instruction completion Write back INSTRUCTIONS TAKE FROM 3-5 CYCLES! CS365 7 Actions Step 1: Fetch IR = Memory[PC]; PC = PC + 4; Can we figure out the values of the control signals? Parallel or sequential actions? CS365 8 4

Step 2: Decode and Register Fetch Read registers rs and rt in case we need them Compute the branch address in case the instruction is a branch Actions A = Reg[IR[25-21]]; B = Reg[IR[20-16]]; Out = PC + Offset CS365 9 Step 3: instruction dependent is performing one of three functions, based on instruction type Memory Reference: Out = A + sign-extend(ir[15-0]); R-type: Out = A op B; Branch: if (A==B) PC = Out; CS365 10 5

Step 4: R-type or memory-access or or MDR = Memory[Out]; Memory[Out] = B; Reg[IR[15-11]] = Out; (lw) (sw) (R type) Step5: Write-back Reg[IR[20-16]]= MDR; CS365 11 Summary Step name fetch decode/register fetch Action for R-type instructions Action for memory-reference Action for instructions branches IR = Memory[PC] PC = PC + 4 A = Reg [IR[25-21]] B = Reg [IR[20-16]] Out = PC + (sign-extend (IR[15-0]) << 2) Action for jumps Execution, address Out = A op B Out = A + sign-extend if (A ==B) then PC = PC [31-28] II computation, branch/ (IR[15-0]) PC = Out (IR[25-0]<<2) jump completion Memory access or R-type Reg [IR[15-11]] = Load: MDR = Memory[Out] completion Out or Store: Memory [Out] = B Memory read completion Load: Reg[IR[20-16]] = MDR CS365 12 6

Control Signals for ADD Op PCsrc srcb srca IorD RegDst PCWrite outwr BWrite AWrite MDRWr IRWrite Mem2Reg MemWrite MemRead RegWrite Sub, and, or, slt are similar CS365 13 Control Signals for LW Op PCsrc srcb srca IorD RegDst PCWrite outwr BWrite AWrite MDRWr IRWrite Mem2Reg MemWrite MemRead RegWrite CS365 14 7

8 Control Signals for SW PCsrc srcb srca IorD RegDst PCWrite outwr BWrite AWrite MDRWr IRWrite Mem2Reg MemWrite MemRead RegWrite Op CS365 15 PCsrc srcb srca IorD RegDst PCWrite outwr BWrite AWrite MDRWr IRWrite Mem2Reg MemWrite MemRead RegWrite Op CS365 16

Control Signals for BEQ Op outwr BWrite AWrite MDRWr IRWrite Mem2Reg MemWrite MemRead RegWrite RegDst PCWrite srca IorD srcb PCsrc CS365 17 Review: finite state machines Finite state machines: a set of states and next state function (determined by current state and the input) output function (determined by current state and possibly input) CS365 18 9

FSM Implementation State Register Next State Function (Combinational Circuit) Input Output Function (Combinational Circuit) Output CS365 19 Review: finite state machines Example: A fake security device consists of three lights lined up in a row, controlled by the outputs Left, Middle, and Right, which, if asserted, indicate that a light should be on. Only one light is on at a time, and the light moves from left to right and then from right to left, thus scaring away thieves who believe that the device is monitoring their activity. The rate of the eye s movement is controlled by the clock speed (which should not be too great) and that there are essentially no inputs. CS365 20 10

Solution State Transition diagram Next/output functions Implementation CS365 21 FSM-based Control Unit 3-bit state register keeps track of the current instruction step. FSM Inputs: opcode (IR[31:26]), funct (IR[5:0]), Zero (that is rs==rt) Outputs: all control signals CS365 22 11

State Transition Diagram 1 2 3 4 5 CS365 23 FSM Control NS 0 NS 1 NS 2 S 0 S 1 S 2 Next State Function opcode funct zero 6 6 Output Function 3 2 2 op srca srcb IR-Write CS365 24 12

The Output Function CS365 25 13