The Processor: Datapath & Control. Single Cycle Implementation Details

Similar documents
Computer organization

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

Reduced Instruction Set Computer (RISC)

Let s put together a Manual Processor

(Refer Slide Time: 00:01:16 min)

Instruction Set Architecture

Review: MIPS Addressing Modes/Instruction Formats

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1

Solutions. Solution The values of the signals are as follows:

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December :59

Notes on Assembly Language

Central Processing Unit (CPU)

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language

CS352H: Computer Systems Architecture

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Design of Pipelined MIPS Processor. Sept. 24 & 26, 1997

Microprocessor & Assembly Language

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

CPU Organisation and Operation

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

Intel 8086 architecture

Instruction Set Design

Chapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC

An Introduction to the ARM 7 Architecture

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

EE282 Computer Architecture and Organization Midterm Exam February 13, (Total Time = 120 minutes, Total Points = 100)

Instruction Set Architecture (ISA)

CPU Organization and Assembly Language

Solution: start more than one instruction in the same clock cycle CPI < 1 (or IPC > 1, Instructions per Cycle) Two approaches:

EC 362 Problem Set #2

WAR: Write After Read

The 104 Duke_ACC Machine

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

LSN 2 Computer Processors

Computer Organization and Components

In the Beginning The first ISA appears on the IBM System 360 In the good old days

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

MICROPROCESSOR AND MICROCOMPUTER BASICS

Chapter 9 Computer Design Basics!

Pipeline Hazards. Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by Arvind and Krste Asanovic

Basic Computer Organization

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

A SystemC Transaction Level Model for the MIPS R3000 Processor

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Chapter 5 Instructor's Manual

EECS 427 RISC PROCESSOR

CS:APP Chapter 4 Computer Architecture. Wrap-Up. William J. Taffe Plymouth State University. using the slides of

CSE 141 Introduction to Computer Architecture Summer Session I, Lecture 1 Introduction. Pramod V. Argade June 27, 2005

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

Execution Cycle. Pipelining. IF and ID Stages. Simple MIPS Instruction Formats

Computer Organization and Architecture

Typy danych. Data types: Literals:

Giving credit where credit is due

Lecture 3 Addressing Modes, Instruction Samples, Machine Code, Instruction Execution Cycle

Summary of the MARIE Assembly Language

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

PROBLEMS. which was discussed in Section

Binary Adders: Half Adders and Full Adders

Administrative Issues

The WIMP51: A Simple Processor and Visualization Tool to Introduce Undergraduates to Computer Organization

M6800. Assembly Language Programming

THUMB Instruction Set

Introduction to MIPS Assembly Programming

Application Note 195. ARM11 performance monitor unit. Document number: ARM DAI 195B Issued: 15th February, 2008 Copyright ARM Limited 2007

Generating MIF files

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings:

Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes:

Chapter 2 Logic Gates and Introduction to Computer Architecture

Introducción. Diseño de sistemas digitales.1

1 Description of The Simpletron

Systems I: Computer Organization and Architecture

1 Classical Universal Computer 3

Translating C code to MIPS

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

Central Processing Unit

Instruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010

CHAPTER 11: Flip Flops

CHAPTER 7: The CPU and Memory

Design of Digital Circuits (SS16)

The AVR Microcontroller and C Compiler Co-Design Dr. Gaute Myklebust ATMEL Corporation ATMEL Development Center, Trondheim, Norway

BASIC COMPUTER ORGANIZATION AND DESIGN

An Overview of Stack Architecture and the PSC 1000 Microprocessor

CPU Performance Equation

MACHINE INSTRUCTIONS AND PROGRAMS

Lecture Outline. Stack machines The MIPS assembly language. Code Generation (I)

CSE 141L Computer Architecture Lab Fall Lecture 2

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis

PART B QUESTIONS AND ANSWERS UNIT I

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Administration. Instruction scheduling. Modern processors. Examples. Simplified architecture model. CS 412 Introduction to Compilers

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

8085 INSTRUCTION SET

SIM-PL: Software for teaching computer hardware at secondary schools in the Netherlands

Transcription:

The Processor: path & Control Simplified implementation of MIPS with: -reference: lw, sw arithmetic-logical: add, sub, and, or, slt control flow: beq, j Generic Implementation (Fetch + Execute): use PC register to supply instruction address read the instruction from at PC read the registers specified by instruction use instruction opcode to decide what to do All instructions (except one!) need to use an ALU after reading the registers. Why? E.g., reference? arithmetic? control flow? 7 Single Cycle Implementation Details Abstract / Simplified View: PC Address Registers ALU Address Two types of functional units: elements that operate on data values (combinational) elements that contain state (sequential) 8

Our Implementation - Edge triggered Typical execution: read contents of some state elements send values through some combinational logic write results to one or more state elements State element 1 Combinational logic State element 2 Read Comb. Write Clock cycle Clock cycle 9 A Single Cycle Implementation Abstract / Simplified View: PC Address Registers ALU Address Start of cycle: READ the IM to fetch an instr. Start of cycle: READ the register file (src operands) 10

A Single Cycle Implementation Abstract / Simplified View: PC Address Registers ALU Address Middle of cycle: EXECUTE Middle of cycle: EXECUTE (lw read ) 11 A Single Cycle Implementation Abstract / Simplified View: PC Address Registers ALU Address End of cycle: WRITE to the register file (arithmetic and lw) End of cycle: WRITE (sw update ) 12

Building a path: Start with Fetch Components to execute each class of instruction Fetch components Program counter - tracks address of instruction - from which we fetch an instruction to execute Adder - does increment of PC by 4, labeled as add address PC Add Sum a. b. Program counter c. Adder 13 Fetching s Fetch - get instruction from Increment PC by four after reading current instruction - by four since an instruction is 32 bits long Send address from PC to the instruction to read the instruction at IM[PC] read from the - send to rest of the data path 14

Accessing Registers After fetching, we need to get source operands for the instruction - read the register file Register file - collection of registers that can be read or written by specifying register number Address of the register to read - we need to read two registers, so there are two read ports For a write, we need to send only one destination register (number) and the data (one write port ) Whether this access is a read or a write operation read from the register file 15 Executing the For an arithmetic instruction, once we have the operands, we need to execute it with the ALU What kind of operation the ALU is going to do for an instruction Two source operand inputs (e.g., read from the register file for R-type) The result of the operation done on the ALU Includes zero detection - whether the output is zero 16

R-type s (Arithmetic) Path From register file and ALU, we can create the data path for arithmetic instructions Connect read outputs from register file to ALU Connect ALU output to register file write data input Register numbers come from the fixed fields in the instruction Output from the ALU fed back to the register file write data input 17 How bout Load and Store? Recall load and store: lw $t1,0($t2) sw $t1,12($t2) Effective address - the address from which we will load or store a value Formed by adding offset_value + $basereg offset_value is a 16-bit immediate (constant) we add on 32-bit values (using the ALU!) need to sign extend the value 18

Elements for Load and Store element - holds program data Address of the item to read/write from/to for a load/store Access to the is a write operation - use address to locate place in and write the new value in that place read from the value to write to for a store Access to the is a read operation - use address to locate value and send it to the output 19 Elements for Load and Store Sign extend - replicate the sign (msb) of the immediate offset in the top 16 bits of the 32 bit input to the adder (for forming the effective address) 16-bit input from the immediate field of the load or store instruction e.g.,16-bit offset -104 is 0xFF98 sign_ext(0xff98) = 0xFFFFFF98 32-bit sign extended output (going to the ALU for the E.A. addition) 20

path for Load and Store Combine the register file, sign extend, ALU, and the data Effective address Value of the load or store base register Value written to destination register (load) Immediate from the instruction Value to write to (store) Value read from (load) 21 OK, now, what about branches? Recall that the branches are: beq $t1,$t2,label Branch to label if $t1 == $t2 bne $t1,$t2,label Branch to label if $t1!= $t2 So, we have: 2 register source operands a 16-bit offset (PC-relative) ALU to do comparison (remember zero check?) When branch taken, PC is set to (PC+4) + (offset<<2) 22

More about branches For PC-relative branches on MIPS, the base value is actually the PC + 4 the offset is also shifted left by 2 (word aligned) PC + 4 value is available after we increment the PC to fetch the next instruction Wait a minute. We need to compute the target address AND use the ALU to compare $t1 and $t2 What do we do???? 23 Branch Elements A second adder - does target address calculation Shifter - shift offset by 2 A way to set the PC to the branch target address if the branch is actually taken ( taken vs. not taken ) PC + 4 for next instruction Computed branch target Should we take the branch? Zero means two values equal Does subtract for comparison 24

Jumps Recall that jump is: j label label is a 26 bit value Simply replaces PC with 26 bit immediate shifted left by 2 PC=PC[31..28]. (Imm26<<2) 25