Computer Architecture

Slides:



Advertisements
Similar presentations
Machine cycle.
Advertisements

CS/COE1541: Introduction to Computer Architecture Datapath and Control Review Sangyeun Cho Computer Science Department University of Pittsburgh.
Adding the Jump Instruction
1 Chapter Five The Processor: Datapath and Control.
CS-447– Computer Architecture Lecture 12 Multiple Cycle Datapath
The Processor: Datapath & Control
VHDL Development for ELEC7770 VLSI Project Chris Erickson Graduate Student Department of Electrical and Computer Engineering Auburn University, Auburn,
Chapter 5 The Processor: Datapath and Control Basic MIPS Architecture Homework 2 due October 28 th. Project Designs due October 28 th. Project Reports.
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.
CSCE 212 Chapter 5 The Processor: Datapath and Control Instructor: Jason D. Bakos.
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 ( )
1 The Processor: Datapath and Control We will design a microprocessor that includes a subset of the MIPS instruction set: –Memory access: load/store word.
The Processor Data Path & Control Chapter 5 Part 4 – Exception Handling N. Guydosh 3/1/04+
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Multi-Cycle Processor.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
The Processor: Datapath and Control. Outline Goals in processor implementation Brief review of sequential logic design Pieces of the processor implementation.
Computer Architecture Chapter 5 Fall 2005 Department of Computer Science Kent State University.
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
Exam 2 Review Two’s Complement Arithmetic Ripple carry ALU logic and performance Look-ahead techniques Basic multiplication and division ( non- restoring)
Multicycle Implementation
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.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 16 - Multi-Cycle.
CDA 3101 Spring 2016 Introduction to Computer Organization Microprogramming and Exceptions 08 March 2016.
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)
Multi-Cycle Datapath and Control
CS161 – Design and Architecture of Computer Systems
Exceptions Another form of control hazard Could be caused by…
Basic Processor Structure/design
Computer Architecture
Control & Execution Finite State Machines for Control MIPS Execution.
Chapter 5 The Processor: Datapath and Control
Introduction CPU performance factors
Systems Architecture I
Extensions to the Multicycle CPU
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Multi-Cycle CPU.
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for Single-Cycle Instruction Execution
Multiple Cycle Implementation of MIPS-Lite CPU
Control & Execution Finite State Machines for Control MIPS Execution.
Pipelining: Advanced ILP
CSCE 212 Chapter 5 The Processor: Datapath and Control
Processor: Finite State Machine & Microprogramming
MIPS Single and Multi Cycle Data Paths Mite 2
A Multiple Clock Cycle Instruction Implementation
Morgan Kaufmann Publishers The Processor
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
Systems Architecture I
Vishwani D. Agrawal James J. Danaher Professor
Guest Lecturer TA: Shreyas Chand
Topic 5: Processor Architecture
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
Processor: Multi-Cycle Datapath & Control
Review Fig 4.15 page 320 / Fig page 322
Chapter Four The Processor: Datapath and Control
Datapath and Control Exceptions
Systems Architecture I
COMS 361 Computer Organization
Processor: Datapath and Control
Presentation transcript:

Computer Architecture Multi-cycle Implementation

Outline Disadvantages of the Single-cycle implementation Long cycle time, too long for all instructions except for the slowest (lw instruction) Inefficient hardware utilization with unnecessarily duplicated resources Multi-cycle implementation Partition execution into small steps Process each step in one cycle Different numbers of cycles for different instructions Example R-format instruction (4 cycles): (1) Instruction fetch (2) Instruction decode/register fetch (3) ALU operation (4) Register write Load instruction (5 cycles): (1) Instruction fetch (2) Instruction decode/register fetch (3) address computation (4) memory read (5) Register write

Multiple-cycle Concept Reduce resource requirements by using the same resource for different purposes during different cycles Single memory unit for instructions and data Single ALU Use temporary registers to store intermediate results during execution Instruction register (IR), A register, B register, ALUOut register, Memory data register (MDR) Partition criteria: at most one of the following operations Memory access Register file access ALU operation

Multiple-cycle Datapath PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Overview of Multi-cycle Execution

Instruction Fetch Step

Instruction Fetch Step PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Instruction Decode/Register Fetch Step

Instruction Decode/Register Fetch Step PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

R-format Execution Step

R-format Execution Step PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

R-format Completion Step

R-format Completion Step PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Load/Store Address Computation Step

Load/Store Address Computation Step PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Load Memory Access Step

Load Memory Access Step PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Load Completion Step

Load Completion Step A B PC Address MemData memory Read data 1 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Store Memory Access Step

Store Memory Access Step PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Branch Completion Step

Branch Completion Step PC Address MemData memory Read data 1 Read data 2 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Jump Completion Step

Jump Completion Step A B PC Address MemData memory Read data 1 Registers 0MUX1 Write data ALU Zero result Write data Shift left 2 M U X 1 2 3 A B Memory Data Register Instruction [31-26] [25-21] [20-16] [15-0] register Sign extend ALUOut Read register1 register2 4 [15-11] 16 32 26 28 PC[31-28] Jump address[31-0] Instruction[25-0]

Summary of Multi-cycle Steps

CPI of the Multi-cycle Implementation Number of clock cycles Loads : 5 Stores : 4 R-format instructions : 4 Branches : 3 Jumps : 3 Instruction mix 22% loads, 11% stores, 49% R-format instructions, 16% branches, and 2% jumps CPI = 0.22 x 5 + 0.11 x 4 + 0.49 x 4 + 0.16 x 3 + 0.02 x 3 = 4.04

Multiple-cycle Implementation (with control signals added)

Finite State Machine Finite state machine There are a finite set of possible machine states The machine has two functions next state function dependent on current state and input values output function dependent on current state and input values Two kinds of state machines Moore machine has output based only on current state Mealy machine has output based on current state and input values We use a Moore machine Current state Next-state function Output Next state Inputs Outputs Clock

High-Level Control Flow Common 2-clock sequence to fetch/decode any instruction Separate sequence of 1 to 3 clocks to execute specific types of instruction

Finite State Machine Diagram P C W r i t e S o u c = 1 A L U B O p n d R g D s M m I a f h / J l E x y - b k ( ' ) Q 4 9 8 6 2 7 5 3

Finite State Machine Controller

PLA Implementation AND Plane Outputs and next state are calculated by sum of products of inputs and current state Columns in AND plane form products one column per unique product term Rows in OR plane form sum Programmed by placing transistors at intersection of row and column according to logic function When the inputs are fully decoded (2N columns), a PLA is logically equivalent to a ROM Optimization can be automated OR Plane

Exceptions and Interrupts Exception: an unexpected event from within the processor that traps into an operating system service routine Arithmetic overflow Undefined instruction System call Interrupt: an event that comes from outside of the processor that also traps into an operating system service routine I/O device request (I/O completion) Handling of exceptions and interrupts in MIPS Saves PC (the address of the offending instruction) in EPC (exception program counter) Records the reason for the exception or interrupt in the CAUSE register Jumps to the operating system service routine rfe (return from exception) instruction restores the PC from EPC

Pipelined implementation Summary Disadvantages of the Single-cycle implementation Long cycle time, too long for all instructions except for the slowest Inefficient hardware utilization with unnecessarily duplicated resources Multiple-cycle implementation Partition execution into small steps of comparable duration Process each step in one cycle Three general forms of control implementation Random logic PLA Microcode Clock cycle time CPI Single-cycle implementation Multi-cycle Pipelined implementation (next class)