Control Unit for Multiple Cycle Implementation

Slides:



Advertisements
Similar presentations
Adding the Jump Instruction
Advertisements

1 Datapath and Control (Multicycle datapath) CDA 3101 Discussion Section 11.
Microprocessor Design Multi-cycle Datapath Nia S. Bradley Vijay.
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;
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.
Levels in Processor Design
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 ( )
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.
CMPE 421 Advanced Computer Architecture Supplementary material for Pipelining PART1.
Datapath and Control: MultiCycle Implementation. Performance of Single Cycle Machines °Assume following operation times: Memory units : 200 ps ALU and.
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.
CDA 3101 Fall 2013 Introduction to Computer Organization Multicycle Datapath 9 October 2013.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
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.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
RegDst 1: RegFile destination No. for the WR Reg. comes from rd field. 0: RegFile destination No. for the WR Reg. comes from rt field.
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 In-Class Exercises.
Design a MIPS Processor (II)
Multi-Cycle Datapath and Control
Chapter 5: A Multi-Cycle CPU.
IT 251 Computer Organization and Architecture
/ Computer Architecture and Design
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.
Basic MIPS Architecture
CS/COE0447 Computer Organization & Assembly Language
Multiple Cycle Implementation of MIPS-Lite CPU
The Multicycle Implementation
CSCI206 - Computer Organization & Programming
Processor: Datapath and Control (part 2)
A Multiple Clock Cycle Instruction Implementation
Chapter Five The Processor: Datapath and Control
Drawbacks of single cycle implementation
Levels in Processor Design
The Multicycle Implementation
Systems Architecture I
The Processor Lecture 3.2: Building a Datapath with Control
Vishwani D. Agrawal James J. Danaher Professor
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Processor: Multi-Cycle Datapath & Control
Control Unit (single cycle implementation)
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.
Drawbacks of single cycle implementation
Drawbacks of single cycle implementation
Systems Architecture I
FloorPlan for Multicycle MIPS
Control Unit (single cycle implementation)
Alternative datapath (book): Multiple Cycle Datapath
The Processor: Datapath & Control.
Presentation transcript:

Control Unit for Multiple Cycle Implementation Control is more complex than in single cycle since: Need to define control signals for each step Need to know which step we are on Two methods for designing the control unit Finite state machine and hardwired control (extension of the single cycle implementation) Microprogramming (read the book about it) 5/18/2019 CSE378 Control unit for mult. cycle

What are the control signals needed? (cf. Fig 5.32) Let’s look at control signals needed at each of 5 steps Signals needed for reading/writing memory reading/writing registers control the various muxes control the ALU 5/18/2019 CSE378 Control unit for mult. cycle

CSE378 Control unit for mult. cycle Instruction fetch Need to read memory Choose input address (mux with signal IorD) Set MemRead signal Set IRwrite signal (note that there is no write signal for MDR; Why?) Set sources for ALU Source 1: mux set to “come from PC” (signal ALUSrcA = 0) Source 2: mux set to “constant 4” (signal ALUSrcB = 01) Set ALU control to “+” (e.g., ALUop = 00) 5/18/2019 CSE378 Control unit for mult. cycle

Instruction fetch (PC increment; cf. Figure 5.33) Set the mux to store in PC as coming from ALU (signal PCsource = 01) Set PCwrite Note: this will become clearer when we look at step 3 of branch instructions 5/18/2019 CSE378 Control unit for mult. cycle

Instruction decode and read source registers Read registers in A and B No need for control signals. This will happen at every cycle. No problem since neither IR (giving names of the registers) nor the registers themselves are modified. When we need A and B as sources for the ALU, e.g., in step 3, the muxes will be set accordingly Branch target computations. Select inputs for ALU Source 1: mux set to “come from PC” (signal ALUSrcA = 0) Source 2: mux set to “come from IR, sign-extended, shifted left 2” (signal ALUSrcB = 11) Set ALU control to “+” (e.g., ALUop = 00) 5/18/2019 CSE378 Control unit for mult. cycle

CSE378 Control unit for mult. cycle Concept of “state” During steps 1 and 2, all instructions do the same thing At step 3, opcode is directing What control lines to assert (it will be different for a load, an add, a branch etc.) What will be done at subsequent steps (e.g., access memory, writing a register, fetching the next instruction) At each cycle, the control unit is put in a specific state that depends only on the previous state and the opcode (current state, opcode)  (next state) Finite state machine (cf. CSE370, CSE 322) 5/18/2019 CSE378 Control unit for mult. cycle

CSE378 Control unit for mult. cycle The first two states Since the data flow and the control signals are the same for all instructions in step 1 (instr. fetch) there is only one state associated with step 1, say state 0 And since all operations in the next step are also always the same, we will have the transition (state 0, all)  (state 1) 5/18/2019 CSE378 Control unit for mult. cycle

CSE378 Control unit for mult. cycle Customary notation Instruction decode and read source registers (state 1) Instruction fetch (state 0) Memread ALUSrcA = 0 IorD = 0 Irwrite ALUsrcB = 01 ALUop =00 Pcwrite Pcsource = 00 ALUSrcA = 0 ALUsrcB = 11 ALUop =00 No label because transition is always taken 5/18/2019 CSE378 Control unit for mult. cycle

Transitions from State 1 After the decode, the data flow depends on the type of instructions: Register-Register : Needs to compute a result and store it Load/Store: Needs to compute the address, access memory, and in the case of a load store the result Branch: test the result of the condition and, if need be, change the PC Jump: need to change the PC Immediate: Not shown in the figures. Do it as an exercise 5/18/2019 CSE378 Control unit for mult. cycle

State transitions from State 1 Start Opcode “Mem op.” Opcode “R-R.” Opcode “branch.” Opcode “jump.” State 2 5/18/2019 CSE378 Control unit for mult. cycle

State 2: Memory Address Computation Set sources for ALU Source 1: mux set to “come from A” (signal ALUSrcA = 1) Source 2: mux set to “imm. extended” (signal ALUSrcB = 10) Set ALU control to “+” (e.g., ALUop = 00) Transition from State 2 If we have a “load” transition to State 3 If we have a “store” transition to State 5 5/18/2019 CSE378 Control unit for mult. cycle

State 2: Memory address computation ALUSrcA =1 ALUSrcB = 10 ALUop = 00 State 2 Opcode “load” Opcode “store” State 3 State 5 5/18/2019 CSE378 Control unit for mult. cycle

One more example: State 5 --Store The control signals are: Set mux for address as coming from ALUout (IorD = 1) Set MemWrite Note that what has to be written has been sitting in B all that time (and was rewritten, unmodified, at every cycle). Since the instruction is completed, the transition from State 5 is always to State 0 to fetch a new instruction. (State 5, always)  (State 0) 5/18/2019 CSE378 Control unit for mult. cycle

Multiple Cycle Implementation: the whole story Data path with control lines: Figure 5.33 Control unit Finite State Machine Figure 5.42 Immediate instructions are not there 5/18/2019 CSE378 Control unit for mult. cycle

Hardwired implementation of the control unit Single cycle implementation: Input (Opcode + function bits)  Combinational circuit (PAL)  Output signals (data path) Multiple cycle implementation Need to implement the finite state machine Input (Opcode + function bits + Current State -- stable storage)  Combinational circuit (PAL)  Output signals (data path + setting next state) 5/18/2019 CSE378 Control unit for mult. cycle

CSE378 Control unit for mult. cycle Hardwired “diagram” PAL To data path Output Input State Reg Opcode + function bits 5/18/2019 CSE378 Control unit for mult. cycle