D ATA P ATH OF A PROCESSOR (MIPS) Module 1.1 : Elements of computer system UNIT 1.

Slides:



Advertisements
Similar presentations
331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
Advertisements

1 Chapter Five The Processor: Datapath and Control.
The Processor: Datapath & Control
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and 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.
Processor II CPSC 321 Andreas Klappenecker. Midterm 1 Tuesday, October 5 Thursday, October 7 Advantage: less material Disadvantage: less preparation time.
331 W9.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 9 Building a Single-Cycle Datapath [Adapted from Dave Patterson’s.
Levels in Processor Design
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
CMPUT Computer Organization and Architecture II1 CMPUT229 - Fall 2003 TopicE: Building a Data Path and a Control Path for a Microprocessor José Nelson.
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.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
CMPUT Computer Organization and Architecture II1 CMPUT329 - Fall 2003 TopicH: Building a Data Path and a Control Path for a Microprocessor José Nelson.
Chapter Five The Processor: Datapath and Control.
Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. Digital Architectures1 Machine instructions execution steps (1) FETCH = Read the instruction.
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:
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Processor: Datapath and Control
Computer Architecture Chapter 5 Fall 2005 Department of Computer Science Kent State University.
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
ECE 445 – Computer Organization
CS2100 Computer Organisation The Processor: Datapath (AY2015/6) Semester 1.
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.
CPU Overview Computer Organization II 1 February 2009 © McQuain & Ribbens Introduction CPU performance factors – Instruction count n Determined.
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.
Elements of Datapath for the fetch and increment The first element we need: a memory unit to store the instructions of a program and supply instructions.
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.
1 Chapter 5: Datapath and Control (Part 2) CS 447 Jason Bakos.
MIPS Processor.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
CS161 – Design and Architecture of Computer Systems
Single-Cycle Datapath and Control
Computer Architecture
Morgan Kaufmann Publishers
MIPS Processor.
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for Single-Cycle Instruction Execution
MIPS processor continued
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for One-cycle Instruction Execution
CSCI206 - Computer Organization & Programming
MIPS Processor.
Levels in Processor Design
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
Datapath: Instruction Store/Fetch & PC Increment
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
MIPS processor continued
Control Unit (single cycle implementation)
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

D ATA P ATH OF A PROCESSOR (MIPS) Module 1.1 : Elements of computer system UNIT 1

W HAT IS D ATA PATH ? The collection of state elements, computation elements, and interconnections that together provide a conduit for the flow and transformation of data in the processor during execution.

T YPES OF ISA IN MIPS Broadly MIPS consists of three types of ISA: – R-Type : arithmetic-logical instructions: add, sub, and, or, slt – I-type : memory-reference instructions: lw, sw – J – type : control flow instructions: beq, j

B ASIC WORKING Generic Implementation: – Use the program counter (PC) to supply instruction address. – Get the instruction from memory – Read registers – Use the instruction to decide exactly what to do

A BSTRACT V IEW OF A MIPS I MPLEMENTATION Instructions start by using PC to supply instruction address to the Instruction Memory. After the instruction is fetched, the register operands used by the instruction are specified by the instruction fields Once the register operands are fetched, they can be operated upon, by the ALU to: – Compute a memory address for Load/store instructions – Compute an arithmetic result for Arithmetic instructions, or – Compute the address of next instruction for branch instructions For Arithmetic/logical instructions, the result from ALU must be written to a register. For Load/Store operations, the ALU result is used as an address to either store a value to a register in the bank or to load from a register

Step 3Step 4 Step 1 : Instructions start by using PC to supply instruction address to the Instruction Memory. Step 2

Step 1 Step 3 Step 4 Step 2 : After the instruction is fetched, the register operands used by the instruction are specified by the instruction fields

Step 1 Step 2 Step 4 Step 3: Once the register operands are fetched, they can be operated upon, by the ALU to: – Compute a memory address for Load/store instructions – Compute an arithmetic result for Arithmetic instructions, or – Compute the address of next instruction for branch instructions

Step 1 Step 2 Step 4 : For Load/Store operations, the ALU result is used as an address to either store a value to a register in the bank or to load from a register Step 3

MIPS - S IMPLE I MPLEMENTATION Lets look at which data path elements are needed for each class of instructions We first need a place to store instructions – The instruction memory holds and supplies instructions, given an address The address of the instruction also must be kept in a state element, called the Program Counter Lastly, we need an Adder to increment the PC to the address of the next instruction

MIPS - S IMPLE I MPLEMENTATION To implement R-type instructions, we need the Register file, and the ALU. We need to read two data words from the register file and write one data word into the register file. To read, we need an input to the file that specifies the address (5 bits = 2 5 = 32-bit register). To write, we need two inputs – register number, and data value. Writes are controlled by RegWrite control signal, which must be asserted for the write to occur on clock edge. ALU control : Refer to ppt on Alu and control signals

T HE DATAPATH FOR R- TYPE Instruction

D ATAPATH COMPONENTS FOR I-T YPE L OAD /S TORE INSTRUCTIONS General form: – lw $t1, offset_value ($t2) or sw $t1, offset_value ($t2) These instructions compute a memory address by adding the base register $t2, to the 16-bit signed offset field contained in the instruction. If the instruction is a Store, the value to be stored must also be read from the register file where it resides in $t1. If the instruction is a load, the value read from memory must be written into the register file, in a specific register $t1. In any case, we will need both register file and the ALU shown in the datapath for R-type instructions. In addition, we need a unit to sign-extend the 16-bit offset field in the instruction to a 32-bit signed value; and a memory unit to read from or write to. The data memory must be written on store instructions. Hence the DM unit has both MemRead and MemWrite control signals

T HE DATAPATH FOR L OAD /S TORE 1632 Sign extend b. Sign-extension unit Instruction MemRead MemWrite Data memory Write data Read data a. Data memory unit Address The datapath for load/store does a Register access, followed by a memory address calculation, then a read/write from data memory unit and finally, a write back into the register file if the instruction is a load.

D ATAPATH FOR I-T YPE C ONTROL F LOW INSTRUCTIONS General form: – beq $t1, $t2, offset Three operands, 2 registers that are compared for equality and one 16-bit offset that computes the branch target address relative to branch instruction address. To implement beq, we must compute the branch target address by adding the sign-extended offset field of the instruction to the PC. Keep in mind (Chapter 3): – The MIPS ISA specifies that the base for branch address calculation is the address of the instruction following the branch. PC+4 (address of the next instruction) is the base for computing branch target address. – The ISA also states that the offset field is shifted left 2 bits so that it is a word offset. This shift increases the effective range of the offset field by a factor of 4. In addition to computing the branch target address, we must also determine whether the next instruction is the next one in sequence or the instruction at the branch target address – I.e, we need to see if the branch is taken, based on comparing the register contents.

D ATAPATH FOR B RANCH ALU is used to to evaluate the branch condition; The Adder is used to compute the branch target address as the sum of PC +4 and the sign-extended lower 16-bits of the instruction (the branch displacement) shifted left by 2 bits.

T HE C OMPLETE D ATAPATH Building blocks for the 3 instruction types To share a data element between two instruction classes, we need to allow multiple connections to the input of an element and have a control signal to select among inputs Use multiplexors to stitch it all together Notice the 7 control signals i.e., PCsrc, ALUsrc, ALU operation, MemWrite, MemtoReg, MemRead, RegWrite