Control Unit for Multiple Cycle Implementation

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

CSE 2021 COMPUTER ORGANIZATION

Processor: Multi- Cycle Datapath & Control

LECTURE 6. Multi-Cycle Datapath and Control

Points available Your marks Total 100

CC 311- Computer Architecture. The Processor - Control

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

CPE 335. Basic MIPS Architecture Part II

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

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

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

CSE 2021 COMPUTER ORGANIZATION

RISC Processor Design

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

Chapter 5 Solutions: For More Practice

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

RISC Architecture: Multi-Cycle Implementation

RISC Architecture: Multi-Cycle Implementation

ENE 334 Microprocessors

Mapping Control to Hardware

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

ECE369. Chapter 5 ECE369

Single vs. Multi-cycle Implementation

Major CPU Design Steps

Initial Representation Finite State Diagram. Logic Representation Logic Equations

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

Topic #6. Processor Design

Systems Architecture I

Multicycle Approach. Designing MIPS Processor

EE457. Note: Parts of the solutions are extracted from the solutions manual accompanying the text book.

EECE 417 Computer Systems Architecture

Chapter 5: The Processor: Datapath and Control

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

Final Project: MIPS-like Microprocessor

EE457 Lab 4 Part 4 Seven Questions From Previous Midterm Exams and Final Exams ee457_lab4_part4.fm 10/6/04

Lets Build a Processor

Multiple Cycle Data Path

Chapter 4 The Processor (Part 2)

RISC Design: Multi-Cycle Implementation

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

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

Microprogramming. Microprogramming

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

The Processor: Datapath & Control

Implementing the Control. Simple Questions

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

Announcements. This week: no lab, no quiz, just midterm

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

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

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

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

ECE 3056: Architecture, Concurrency and Energy of Computation. Single and Multi-Cycle Datapaths: Practice Problems

Processor (multi-cycle)

Processor (I) - datapath & control. Hwansoo Han

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

Week 6: Processor Components

Lecture 2: MIPS Processor Example

Design of the MIPS Processor (contd)

Beyond Pipelining. CP-226: Computer Architecture. Lecture 23 (19 April 2013) CADSL

Lecture 5: The Processor

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

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

Example Sketch a stick diagram for a CMOS gate computing Y = (A + B + C) D (see Figure 1.18) and estimate the cell width and height.

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

Design of the MIPS Processor

Multicycle conclusion

Lab 8: Multicycle Processor (Part 1) 0.0

Very short answer questions. You must use 10 or fewer words. "True" and "False" are considered very short answers.

CS232 Final Exam May 5, 2001

Computer Science 141 Computing Hardware

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

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

LECTURE 5. Single-Cycle Datapath and Control

Microprogrammed Control Approach

CMOS VLSI Design. MIPS Processor Example. Outline

IMPLEMENTATION MICROPROCCESSOR MIPS IN VHDL LAZARIDIS DIMITRIS.

CSEN 601: Computer System Architecture Summer 2014

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

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

Digital Design and Computer Architecture

Introduction to CMOS VLSI Design Lecture 2: MIPS Processor Example

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

Lecture 9: Microcontrolled Multi-Cycle Implementations. Who Am I?

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

Digital Integrated Circuits Lecture 2: MIPS Processor Example

ECE Exam I - Solutions February 19 th, :00 pm 4:25pm

Introduction to CMOS VLSI Design (E158) Lab 4: Controller Design

MIPS Architecture. Fibonacci (C) Fibonacci (Assembly) Another Example: MIPS. Example: subset of MIPS processor architecture

Computer Organization & Design The Hardware/Software Interface Chapter 5 The processor : Datapath and control

ECE 313 Computer Organization EXAM 2 November 9, 2001

Pipelining. Pipeline performance

Quick Verilog. Levels of Design Modeling

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

ECE Exam I February 19 th, :00 pm 4:25pm

CS152 Computer Architecture and Engineering Lecture 13: Microprogramming and Exceptions. Review of a Multiple Cycle Implementation

Digital Design and Computer Architecture Harris and Harris

CS232 Final Exam May 5, 2001

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

CS152 Computer Architecture and Engineering. Lecture 8 Multicycle Design and Microcode John Lazzaro (

Transcription:

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) 4/29/2003 CSE378 Control unit for mult. cycle 1

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 4/29/2003 CSE378 Control unit for mult. cycle 2

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) 4/29/2003 CSE378 Control unit for mult. cycle 3

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 4/29/2003 CSE378 Control unit for mult. cycle 4

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) 4/29/2003 CSE378 Control unit for mult. cycle 5

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) 4/29/2003 CSE378 Control unit for mult. cycle 6

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) 4/29/2003 CSE378 Control unit for mult. cycle 7

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

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 write the result register 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 4/29/2003 CSE378 Control unit for mult. cycle 9

State transitions from State 1 State 0 State 1 Start Opcode Mem op. Opcode R-R. Opcode branch. Opcode jump. State 2 4/29/2003 CSE378 Control unit for mult. cycle 10

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 4/29/2003 CSE378 Control unit for mult. cycle 11

State 2: Memory address computation ALUSrcA =1 ALUSrcB = 10 ALUop = 00 State 2 Opcode load Opcode store State 3 State 5 4/29/2003 CSE378 Control unit for mult. cycle 12

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) 4/29/2003 CSE378 Control unit for mult. cycle 13

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 4/29/2003 CSE378 Control unit for mult. cycle 14

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) 4/29/2003 CSE378 Control unit for mult. cycle 15

Hardwired diagram PAL Output To data path Input Opcode + function bits State Reg 4/29/2003 CSE378 Control unit for mult. cycle 16