MIPS Processor.

Slides:



Advertisements
Similar presentations
MIPS processor continued. Review Different parts in the processor should be connected appropriately to be able to carry out the functions. Connections.
Advertisements

331 W08.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 8: Datapath Design [Adapted from Dave Patterson’s UCB CS152.
The Processor: Datapath & Control
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
Processor II CPSC 321 Andreas Klappenecker. Midterm 1 Tuesday, October 5 Thursday, October 7 Advantage: less material Disadvantage: less preparation time.
Levels in Processor Design
Fall 2007 MIPS Datapath (Single Cycle and Multi-Cycle)
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.
Computer ArchitectureFall 2007 © October 3rd, 2007 Majd F. Sakr CS-447– Computer Architecture.
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.
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.
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.
Processor I CPSC 321 Andreas Klappenecker. Midterm 1 Thursday, October 7, during the regular class time Covers all material up to that point History MIPS.
S. Barua – CPSC 440 CHAPTER 5 THE PROCESSOR: DATAPATH AND CONTROL Goals – Understand how the various.
The Processor Andreas Klappenecker CPSC321 Computer Architecture.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Fall EE 333 Lillevik 333f06-l7 University of Portland School of Engineering Computer Organization Lecture 7 ALU design MIPS data path.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Chapter 4 CSF 2009 The processor: Building the datapath.
Processor: Datapath and Control
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
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 17: The Processor - Overview Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
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.
D ATA P ATH OF A PROCESSOR (MIPS) Module 1.1 : Elements of computer system UNIT 1.
Computer Architecture Lecture 9 MIPS ALU and Data Paths Ralph Grishman Oct NYU.
CPU Overview Computer Organization II 1 February 2009 © McQuain & Ribbens Introduction CPU performance factors – Instruction count n Determined.
February 22, 2016©2003 Craig Zilles (derived from slides by Howard Huang) 1 A single-cycle MIPS processor  As previously discussed, an instruction set.
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.
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.
Gary MarsdenSlide 1University of Cape Town Computer Architecture – Introduction Andrew Hutchinson & Gary Marsden (me) ( ) September 2003.
MIPS processor continued. Review Different parts in the processor should be connected appropriately to be able to carry out the functions. Connections.
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:
Single-Cycle Datapath and Control
Morgan Kaufmann Publishers
MIPS Processor.
CS/COE0447 Computer Organization & Assembly Language
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
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
MIPS processor continued
Rocky K. C. Chang 6 November 2017
Composing the Elements
Composing the Elements
The Processor Lecture 3.2: Building a Datapath with Control
The Processor Lecture 3.1: Introduction & Logic Design Conventions
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
CS/COE0447 Computer Organization & Assembly Language
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:

MIPS Processor

Registers in MIPS In MIPS, there are 32 Registers. We need read up to two registers, and write to up to one register. Think registers as D flip-flops. Each register has 32 Dffs. The control signals are: readReg1, readReg2: 5 bits. Used to specify which reg to read. writeReg: 5-bits. Used to specify which reg to write. Data: if write, what data should be written into the reg. RegWrite: whether to write or not.

This is for read.

To write to a register The data is connected to every register. Use RegWrite, generate a ``LOAD’’ signal for the register you want to write to. Every register has a LOAD signal. If that signal is `1’, new data will be set. Only the target register’s LOAD signal is `1’.

RAM

A RAM Example RAM. Control signals: address: If write, which location to write to. If read, which location to read from. Chip select: whether to use this chip or not. Output enable: whether to enable output (output some voltage or in high-impedence state) Write enable: whether to read or write. Din: if write, what data should be written into the location specified by address. Assume that there is a RAM with only 2 address lines and two bit data lines. How many bits can it hold? 11/8/2007 10:04:17 AM week11-5.ppt

The processor We now know all the parts in the processor. ALU PC Register file Also RAM How to put them together? How to make them execute an instruction as we need?

ALU

The execution of an instruction First we need to fetch the instruction at the address given by the current PC from instruction memory Then we need to decode the instruction Based on the instruction, we need to do accordingly For sequential instructions, we then go the next instruction by increasing the PC. For jump and branch instructions, PC will be changed

Basic MIPS Implementation We will focus on design of a basic MIPS processor that includes a subset of the core MIPS instruction set The arithmetic-logic instructions add, sub, and, or, and slt The memory-reference instructions load word and store word The instructions branch equal and jump 11/18/2007 7:39:36 PM week13-1.ppt

MIPS Implementation Overview For every instruction, the first two steps are identical Fetch the instruction from the memory according to the value of the program counter Read one or two registers (using fields of instructions to select the registers) For load word, we need to read only one register Most other instructions (except jump) require we read two registers After the two steps, the actions required depend on the instructions However, the actions are similar 11/18/2007 7:39:36 PM week13-1.ppt

Instruction Fetch and PC Increment Since for every instruction, the first step is to fetch the instruction from memory In addition, for most instructions, the next instruction will be at PC + 4 11/18/2007 7:39:38 PM week13-1.ppt

R-type Instructions Also called arithmetic-logical instructions Including add, sub, and, or, and slt Each one reads from two registers, performs an arithmetic or logical operation on the registers, and then write the result to a register 11/18/2007 7:39:38 PM week13-1.ppt

R-type Instructions Suppose the instruction is add $t0, $t1, $t2, what are the read reg1, read reg2, and write reg? What is the value of RegWrite? How to control the ALU to do add? 11/15/2007 5:02:08 PM week-13-3.ppt

Datapath only for R-type instructions

Datapath only for R-type instructions (Answer)

Data Transfer Instructions Load word and store word instructions have the following general form lw $rt, offset_value($rs) opcode (6 bits) rs (5 bits) rt (5 bits) offset (16 bits) sw $rt, offset_value($rs) They need to compute a memory address by adding the base register to the sign-extended 16-bit offset () 11/15/2007 5:02:10 PM week-13-3.ppt

Load For instruction load $t0, 16($t1), what should the control signal be? RegWrite = 1 ALUOp = add code

Data path Do both lw and sw, and ask for student participation

Data path only for lw (answer)

Data path only for sw (answer)

Branch Instruction Beq has three operands, two registers that are compared for equality and a 16-bit offset used to compute the branch-target address beq $rs, $rt, offset opcode (6 bits) rs (5 bits) rt (5 bits) offset (16 bits) Note that the 16-bit offset is given in terms of instructions, not bytes and is relative to PC + 4 11/18/2007 7:39:42 PM week13-1.ppt

Designing a processor only for beq Are these enough? How many adders do we need? How to do the selection?

Designing a processor only for beq

Designing a processor only for beq (answer) 11/18/2007 7:39:43 PM week13-1.ppt