Reduced Instruction Set Computer

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

Computer organization

Computer Organization and Components

Design of Digital Circuits (SS16)

Review: MIPS Addressing Modes/Instruction Formats

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

Systems I: Computer Organization and Architecture

CS352H: Computer Systems Architecture

Central Processing Unit (CPU)

A FPGA Implementation of a MIPS RISC Processor for Computer Architecture Education

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

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

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

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1

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

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

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

Microprocessor & Assembly Language

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

Instruction Set Architecture

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

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

CPU Organization and Assembly Language

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

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

MICROPROCESSOR AND MICROCOMPUTER BASICS

CPU Organisation and Operation

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

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

Computer Organization. and Instruction Execution. August 22

WAR: Write After Read

Data Dependences. A data dependence occurs whenever one instruction needs a value produced by another.

Central Processing Unit

The 104 Duke_ACC Machine

Summary of the MARIE Assembly Language

Chapter 9 Computer Design Basics!

CHAPTER 4 MARIE: An Introduction to a Simple Computer

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

Reduced Instruction Set Computer (RISC)

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

Generating MIF files

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

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

CHAPTER 7: The CPU and Memory

Preface. Any questions from last time? A bit more motivation, information about me. A bit more about this class. Later: Will review 1st 22 slides

PART B QUESTIONS AND ANSWERS UNIT I

Chapter 2 Logic Gates and Introduction to Computer Architecture

MACHINE ARCHITECTURE & LANGUAGE

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

CSE 141L Computer Architecture Lab Fall Lecture 2

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

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

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

Giving credit where credit is due

TIMING DIAGRAM O 8085

Chapter 5 Instructor's Manual

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

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

Instruction Set Design

Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine

CSE140: Components and Design Techniques for Digital Systems. Introduction. Prof. Tajana Simunic Rosing

Let s put together a Manual Processor

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

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

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

Levels of Programming Languages. Gerald Penn CSC 324

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

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

Building a computer. Electronic Numerical Integrator and Computer (ENIAC)

Basic Computer Organization

EECS 427 RISC PROCESSOR

COMPUTER ARCHITECTURE. Input/Output

Computer Organization and Architecture

A SystemC Transaction Level Model for the MIPS R3000 Processor

Here is a diagram of a simple computer system: (this diagram will be the one needed for exams) CPU. cache

COMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ

Memory ICS 233. Computer Architecture and Assembly Language Prof. Muhamed Mudawar

5 Combinatorial Components. 5.0 Full adder. Full subtractor

Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX

TEACHING COMPUTER ARCHITECTURE THROUGH SIMULATION (A BRIEF EVALUATION OF CPU SIMULATORS) *

Chapter 02: Computer Organization. Lesson 04: Functional units and components in a computer organization Part 3 Bus Structures

PROBLEMS. which was discussed in Section

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

Intel 8086 architecture

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

EC 362 Problem Set #2

Using Graphics and Animation to Visualize Instruction Pipelining and its Hazards


Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

361 Computer Architecture Lecture 14: Cache Memory

MIPS Assembler and Simulator

BASIC COMPUTER ORGANIZATION AND DESIGN

Microprocessor/Microcontroller. Introduction

Lesson-16: Real time clock DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK

CPU Performance Equation

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

1 Computer hardware. Peripheral Bus device "B" Peripheral device. controller. Memory. Central Processing Unit (CPU)

Register File, Finite State Machines & Hardware Control Language

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

Transcription:

Reduced Instruction Set Computer Virendra Singh Associate Professor Computer Architecture and Dependable Systems Lab Department of Electrical Engineering Indian Institute of Technology Bombay http://www.ee.iitb.ac.in/~viren/ E-mail: viren@ee.iitb.ac.in Computer Organization & Architecture Lecture 11 (09 April 2013)

Processor Architecture PI Controlle r Control Signals From memory Datapath Status Signals PO To memory 08 Apr 2013 Computer Architecture@IIT Mandi 2

Where Does It All Begin? In a register called program counter (PC). PC contains the memory address of the next instruc9on to be executed. In the beginning, PC contains the address of the memory loca9on where the program begins. 08 Apr 2013 Computer Architecture@IIT Mandi 3

Where is the Program? Processor Memory Program counter (register) Start address Machine code of program 08 Apr 2013 Computer Architecture@IIT Mandi 4

How Does It Run? Start PC has memory address where program begins Fetch instruction word from memory address in PC and increment PC PC + 4 for next instruction Decode and execute instruction No Program complete? Yes STOP 08 Apr 2013 Computer Architecture@IIT Mandi

Datapath and Control Ø Datapath: Memory, registers, adders, ALU, and communica9on buses. Each step (fetch, decode, execute) requires communica9on (data transfer) paths between memory, registers and ALU. Ø Control: Datapath for each step is set up by control signals that set up dataflow direc9ons on communica9on buses and select ALU and memory func9ons. Control signals are generated by a control unit consis9ng of one or more finite- state machines. 08 Apr 2013 Computer Architecture@IIT Mandi 6

Datapath for Instruction Fetch 4 Add PC Address Instruction Memory Instruction word to control unit and registers 08 Apr 2013 Computer Architecture@IIT Mandi 7

Register File: A Datapath Component Read registers Write register Write data reg 1 reg 2 Registers (reg. file) reg 1 data reg 2 data RegWrite from control 08 Apr 2013 Computer Architecture@IIT Mandi 8

Multi-Operation ALU Opera9on select ALU func9on 000 AND 001 OR 010 Add 110 Subtract 111 Set on less than Operation select from control ALU 3 zero overflow result zero = 1, when all bits of result are 0 08 Apr 2013 Computer Architecture@IIT Mandi 9

R-Type Instructions Also known as arithme9c- logical instruc9ons add, sub, slt Example: add $t0, $s1, $s2 Machine instruc9on word 000000 10001 10010 01000 00000 100000 opcode $s1 $s2 $t0 func9on Read two registers Write one register Opcode and func9on code go to control unit that generates RegWrite and ALU opera9on code. 08 Apr 2013 Computer Architecture@IIT Mandi 10

Datapath for R-Type Instruction 000000 10001 10010 01000 00000 100000 opcode $s1 $s2 $t0 function (add) Read register numbers Write reg. number 10001 10010 01000 $s1 $s2 $t0 Registers (reg. file) Operation select from control (add) ALU 3 zero overflow result Write data RegWrite from control activated 08 Apr 2013 Computer Architecture@IIT Mandi 11

Load and Store Instructions I- type instruc9ons lw $t0, 1200 ($t1) # incr. in bytes 100011 01001 01000 0000 0100 1011 0000 opcode $t1 $t0 1200 sw $t0, 1200 ($t1) # incr. in bytes 101011 01001 01000 0000 0100 1011 0000 opcode $t1 $t0 1200 08 Apr 2013 Computer Architecture@IIT Mandi 12

Read register numbers Write reg. number Write data 0000 0100 1011 0000 01001 01000 Datapath for lw Instruction 100011 01001 01000 0000 0100 1011 0000 opcode $t1 $t0 1200 $t1 $t0 16 Registers (reg. file) RegWrite from control activated Sign extend ALU Operation select from control (add) 08 Apr 2013 Computer Architecture@IIT Mandi 13 3 zero overflow result mem. data to $t0 Addr. Write data MemWrite Read data Data memory MemRead activated

Read register numbers Write reg. number Write data 0000 0100 1011 0000 Datapath for sw Instruction 101011 01001 01000 0000 0100 1011 0000 opcode $t1 $t0 1200 01001 01000 $t1 $t0 16 Registers (reg. file) RegWrite from control Sign extend ALU Operation select from control (add) 08 Apr 2013 Computer Architecture@IIT Mandi 14 3 zero overflow result $t0 data to mem. MemWrite activated Addr. Write data Read data Data memory MemRead

Branch Instruction (I-Type) beq $s1, $s2, 2 # if $s1 = $s2, advance PC through 2 instruc9ons Note: 16- bits 000100 10001 10010 0000 0000 0001 1001 opcode $s1 $s2 2 Can branch within ± 2 1 words from the current instruction address in PC. 08 Apr 2013 Computer Architecture@IIT Mandi 1

Datapath for beq Instruction Read register numbers Write reg. number Write data 0000 0000 0001 1001 16 10001 10010 $s1 $s2 Sign extend Registers (reg. file) RegWrite from control Shift left 2 000100 10001 10010 0000 0000 0001 1001 opcode $s1 $s2 2 Operation select from control (subtract) 3 ALU zero overflow PC+4 From instruction fetch datapath result To branch control logic Add Branch target 08 Apr 2013 Computer Architecture@IIT Mandi 16

J-Type Instruction j 200 # jump to instruc9on 2,00 26- bits 000010 0000 0000 0000 0010 0111 0001 00 opcode 2,00 0000 0000 0000 0000 0010 0111 0001 0000 bits 28-31 from PC+4 -bit jump address 08 Apr 2013 Computer Architecture@IIT Mandi 17

Datapath for Jump Instruction Branch 4 Add Branch addr. PC+4 1 mux 0 Jump 0 mux 1 4 PC Address Instruction Memory 26 Shift left 2 opcode (bits 26-31) to control 6 28 Instruction word to control and registers 08 Apr 2013 Computer Architecture@IIT Mandi 18

0-2 Jump Shift 4 Add RegDst opcode 26-31 left 2 CONTROL Branch ALU 1 mux 0 0 mux 1 MemtoReg PC Instr. mem. Combined Datapaths 0-1 21-2 16-20 11-1 Sign ext. 1 mux 0 Reg. File Shift left 2 1 mux 0 ALU ALU Cont. zero MemWrite MemRead Data mem. 0 mux 1 0-08 Apr 2013 Computer Architecture@IIT Mandi 19

Control Logic Instruction bits 26-31 opcode Instruction bits 0- funct. Control Logic ALUOp RegDst Jump Branch MemRead MemtoReg MemWrite ALUSrc RegWrite ALU Control 08 Apr 2013 Computer Architecture@IIT Mandi 20 2 to ALU

Control Logic: Truth Table Instr type Inputs: instr. opcode bits 31 30 29 28 27 26 RegDst Jump Outputs: control signals Branch MemWrite MemRead RegWrite MemtoReg ALUSrc ALOOp1 ALUOp2 R 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 lw 1 0 0 0 1 1 0 0 1 1 1 1 0 0 0 0 sw 1 0 1 0 1 1 X 0 1 X 0 0 1 0 0 0 beq 0 0 0 1 0 0 X 0 0 X 0 0 0 1 0 1 j 0 0 0 0 1 0 X 1 X X X X X X X X 08 Apr 2013 Computer Architecture@IIT Mandi 21

How Long Does It Take? Assume control logic is fast and does not affect the cri9cal 9ming. Major 9me delay components are ALU, memory read/write, and register read/write. Arithme9c- type (R- type) Fetch (memory read) 2ns Register read 1ns ALU opera9on 2ns Register write 1ns Total 6ns 08 Apr 2013 Computer Architecture@IIT Mandi 22

Time for lw and sw (I-Types) ALU (R- type) 6ns Load word (I- type) Fetch (memory read) 2ns Register read 1ns ALU opera9on 2ns Get data (mem. Read) 2ns Register write 1ns Total 8ns Store word (no register write) 7ns 08 Apr 2013 Computer Architecture@IIT Mandi 23

Time for beq (I-Type) ALU (R- type) 6ns Load word (I- type) 8ns Store word (I- type) 7ns Branch on equal (I- type) Fetch (memory read) 2ns Register read 1ns ALU opera9on 2ns Total ns 08 Apr 2013 Computer Architecture@IIT Mandi 24

Time for Jump (J-Type) ALU (R- type) 6ns Load word (I- type) 8ns Store word (I- type) 7ns Branch on equal (I- type) ns Jump (J- type) Fetch (memory read) 2ns Total 2ns 08 Apr 2013 Computer Architecture@IIT Mandi 2

How Fast Can the Clock Be? If every instruc9on is executed in one clock cycle, then: Clock period must be at least 8ns to perform the longest instruc9on, i.e., lw. This is a single cycle machine. It is slower because many instruc9ons take less than 8ns but are s9ll allowed that much 9me. Method of speeding up: Use mul9cycle datapath. 08 Apr 2013 Computer Architecture@IIT Mandi 26

Thank You 08 Apr 2013 Computer Architecture@IIT Mandi 27