Control Unit (single cycle implementation)

Slides:



Advertisements
Similar presentations
CS/COE1541: Introduction to Computer Architecture Datapath and Control Review Sangyeun Cho Computer Science Department University of Pittsburgh.
Advertisements

The Processor: Datapath & Control
Chapter 5 The Processor: Datapath and Control Basic MIPS Architecture Homework 2 due October 28 th. Project Designs due October 28 th. Project Reports.
CSE378 Multicycle impl,.1 Drawbacks of single cycle implementation All instructions take the same time although –some instructions are longer than others;
Levels in Processor Design
331 Lec 14.1Fall 2002 Review: Abstract Implementation View  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions:
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Computer Structure - Datapath and Control Goal: Design a Datapath  We will design the datapath of a processor that includes a subset of the MIPS instruction.
Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. Digital Architectures1 Machine instructions execution steps (1) FETCH = Read the instruction.
Datapath and Control Andreas Klappenecker CPSC321 Computer Architecture.
CSE431 L05 Basic MIPS Architecture.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 05: Basic MIPS Architecture Review Mary Jane Irwin.
The Processor: Datapath & Control. Implementing Instructions Simplified instruction set memory-reference instructions: lw, sw arithmetic-logical instructions:
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Chapter 4 Sections 4.1 – 4.4 Appendix D.1 and D.2 Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
MIPS processor continued. In Class Exercise Question Show the datapath of a processor that supports only R-type and jr reg instructions.
1 Processor: Datapath and Control Single cycle processor –Datapath and Control Multicycle processor –Datapath and Control Microprogramming –Vertical and.
ECE-C355 Computer Structures Winter 2008 The MIPS Datapath Slides have been adapted from Prof. Mary Jane Irwin ( )
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
PC Instruction Memory Address Instr. [31-0] 4 Fig 4.6 p 309 Instruction Fetch.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 2.
MIPS processor continued
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.
MIPS Processor.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Design a MIPS Processor (II)
ECE/CS 552: Single Cycle Control Path
Single-cycle CPU Control
Access the Instruction from Memory
EE204 Computer Architecture
Single Cycle CPU - Control
Single-Cycle Datapath and Control
Computer Architecture
Multi-Cycle CPU.
CS/COE0447 Computer Organization & Assembly Language
MIPS processor continued
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
CS/COE0447 Computer Organization & Assembly Language
MIPS Processor.
Datapath & Control MIPS
Drawbacks of single cycle implementation
Levels in Processor Design
Topic 5: Processor Architecture Implementation Methodology
CSE378 Midterm Review Moore’s Law -- What are the two versions?
Composing the Elements
Composing the Elements
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Control Unit (single cycle implementation)
Control Unit for Multiple Cycle Implementation
MIPS processor continued
CS/COE0447 Computer Organization & Assembly Language
Control Unit for Multiple Cycle Implementation
FloorPlan for Multicycle MIPS
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Control Unit (single cycle implementation) Control unit sends control signals to data path and memory depending on the opcode (and function field) results in the ALU (for example for Zero test) These signals control muxes; read/write enable for registers and memory etc. Some “control” comes directly from instruction register names Some actions are performed at every instruction so no need for control (in this single cycle implementation) incrementing PC by 4; reading instr. memory for fetching next inst. 5/24/2019 CSE378 Control unit Single cycle impl.

Building the control unit Decompose the problem into Data path control (register transfers) ALU control Setting of control lines by control unit totally specified in the ISA for ALU by opcode + function bits if R-R format for register names by instruction (including opcode) for reading/writing memory and writing register by opcode muxes by opcode PC by opcode + result of ALU 5/24/2019 CSE378 Control unit Single cycle impl.

Example Limit ourselves to: ALU control R-R instructions: add, sub, and, or, slt – OPcode = 0 but different function bits Load-store: lw, sw Branch: beq ALU control Need to add for: add, lw, sw Need to sub for: sub, beq Need to and for :and Need to or for :or Need to set less than for : slt 5/24/2019 CSE378 Control unit Single cycle impl.

ALU Control ALU control: combination of opcode and function bits Decoding of opcodes yields 3 possibilities hence 2 bits AluOp1 and ALUOp2 ALU control: Input 2 ALUop bits and 6 function bits Output one of 5 possible ALU functions Of course, lots of don’t care for this *very* limited implementation 5/24/2019 CSE378 Control unit Single cycle impl.

Implementation of Overall Control Unit Input: opcode (and function bits for R-R instructions) Output: setting of control lines Can be done by logic equations If not too many, like in RISC machines Use of PAL’s (cf. CSE 370). In RISC machines the control is “hardwired” If too large (too many states etc.) Use of microprogramming (a microprogram is a hardwired program that interprets the ISA) Or use a combination of both techniques (Pentium) 5/24/2019 CSE378 Control unit Single cycle impl.

Where are control signals needed (cf. Figure 5.13) Register file RegWrite (Register write signal for R-type, Load) RegDst (Register destination signal: rd for R-type, rt for Load) ALU ALUSrc (What kind of second operand: register or immediate) ALUop (What kind of function: ALU control for R-type) Data memory MemRead (Load) or MemWrite (Store) MemtoReg (Result register written from ALU or memory) Branch control PCSrc (PC modification if branch is taken) 5/24/2019 CSE378 Control unit Single cycle impl.

MIPS FloorPlan & Control lines 5/24/2019 CSE378 Control unit Single cycle impl.

Basic 3 Operation 1-bit ALU 5/24/2019 CSE378 Control unit Single cycle impl.

Chain Together 32 “3 Op 1-bit ALUs” 5/24/2019 CSE378 Control unit Single cycle impl.

Basic 4 Operation 1-bit ALU 5/24/2019 CSE378 Control unit Single cycle impl.

Adding SLT to 1-bit ALU & Detect Overflow 5/24/2019 CSE378 Control unit Single cycle impl.

Chain Together 32 “1-bit ALUs” 5/24/2019 CSE378 Control unit Single cycle impl.

ALU floorplan & Symbol 5/24/2019 CSE378 Control unit Single cycle impl.

Control lines 5/24/2019 CSE378 Control unit Single cycle impl.

How are the control signals asserted Decoding of the opcode by control unit yields Control of the 3 muxes (RegDst, ALUSrc,MemtoReg): 3 control lines Signals for RegWrite, Memread,Memwrite: 3 control lines Signals to activate ALU control (e.g., restrict ourselves to 2) Signal for branch (1 control line) decoding of opcode ANDed with ALU zero result Input Opcode: 6 bits Output 9 control lines 5/24/2019 CSE378 Control unit Single cycle impl.

Control lines 5/24/2019 CSE378 Control unit Single cycle impl. Signal R-type lw sw beq RegDest 1 X ALUSrc MemtoReg RegWrite MemRead MemWrite Branch ALUOp1 ALUOp0 5/24/2019 CSE378 Control unit Single cycle impl.

Computing the Control 5/24/2019 CSE378 Control unit Single cycle impl. Op5 Op4 Op3 Op2 Op1 Op0 Signal R-type lw sw beq Op5 0 1 1 0 Op4 0 0 0 0 Op3 0 0 1 0 Op2 0 0 0 1 Op1 0 1 1 0 Op0 0 1 1 0 RegDest 1 0 X X ALUSrc 0 1 1 0 MemtoReg 0 1 X X RegWrite 1 1 0 0 MemRead 0 1 0 0 MemWrite 0 0 1 0 Branch 0 0 0 1 ALUOp1 1 0 0 0 ALUOp0 0 0 0 1 AND AND AND AND RegDst ALUSrc MemtoReg RegWrite MemRead MemWrite Branch ALUOp1 ALUOp0 OR OR 5/24/2019 CSE378 Control unit Single cycle impl.

Computing the Cycle Time Suppose the following times apply ... Memory units: 10ns ALU and adders: 10ns Register file ref: 5ns All other operations are 0ns. Charges for instructions are ... R-format: 30ns Load inst: 40ns Store inst: 35ns Branch: 25ns Jump: 10ns Instruction Mix GCC 22% Load 11% Store 49% R-type 16% Branch 2% Jump 5/24/2019 CSE378 Control unit Single cycle impl.