ADD R Operation : ACC = ACC + R SIZE : 1 byte, 8 bit Time : 3 T Cycle Work : Read R, Read ACC, Add, Write Result to ACC

Similar documents
CS222: MIPS Instruction Set

Chapter 3. Instructions:

Chapter 2. Instructions:

Its Assembly language programming

ECE232: Hardware Organization and Design

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Computer Model. What s in a computer? Processor Memory I/O devices (keyboard, mouse, LCD, video camera, speaker, disk, CD drive, )

Chapter 2 Instruction: Language of the Computer

CSEE 3827: Fundamentals of Computer Systems

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2)

CS3350B Computer Architecture MIPS Introduction

Chapter 2: Instructions:

Stored Program Concept. Instructions: Characteristics of Instruction Set. Architecture Specification. Example of multiple operands

EECS Computer Organization Fall Based on slides by the author and prof. Mary Jane Irwin of PSU.

Lecture 3 Machine Language. Instructions: Instruction Execution cycle. Speaking computer before voice recognition interfaces

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

CS3350B Computer Architecture

CS521 CSE IITG 11/23/2012

CSE 141 Computer Architecture Spring Lecture 3 Instruction Set Architecute. Course Schedule. Announcements

COMPSCI 313 S Computer Organization. 7 MIPS Instruction Set

IC220 SlideSet #2: Instructions (Chapter 2)

Hardware Level Organization

Instructions: MIPS arithmetic. MIPS arithmetic. Chapter 3 : MIPS Downloaded from:

EN164: Design of Computing Systems Lecture 09: Processor / ISA 2

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI

Chapter 1. Computer Abstractions and Technology. Lesson 3: Understanding Performance

Stored Program Concept. Instructions: Characteristics of Instruction Set. Architecture Specification. Example of multiple operands

Architecture I. Computer Systems Laboratory Sungkyunkwan University

COE608: Computer Organization and Architecture

Lecture 4: Instruction Set Architecture

CPE300: Digital System Architecture and Design

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

Chapter 3 MIPS Assembly Language. Ó1998 Morgan Kaufmann Publishers 1

Lecture 4: RISC Computers

Instructions: Language of the Computer

Lectures 3-4: MIPS instructions

CS222: Dr. A. Sahu. Indian Institute of Technology Guwahati

ECE 486/586. Computer Architecture. Lecture # 7

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Computer Organization MIPS Architecture. Department of Computer Science Missouri University of Science & Technology

CS/COE1541: Introduction to Computer Architecture

5/17/2012. Recap from Last Time. CSE 2021: Computer Organization. The RISC Philosophy. Levels of Programming. Stored Program Computers

ECE232: Hardware Organization and Design

Recap from Last Time. CSE 2021: Computer Organization. Levels of Programming. The RISC Philosophy 5/19/2011

Lecture 4: MIPS Instruction Set

MIPS Instruction Set Architecture (1)

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

Part II Instruction-Set Architecture. Jan Computer Architecture, Instruction-Set Architecture Slide 1

EC-801 Advanced Computer Architecture

ECE 154A Introduction to. Fall 2012

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

Review of instruction set architectures

Computer Systems Laboratory Sungkyunkwan University

EEC 581 Computer Architecture Lecture 1 Review MIPS

Instruction Set Architecture

ECE369. Chapter 2 ECE369

Levels of Programming. Registers

Topic Notes: MIPS Instruction Set Architecture

Instructions: Language of the Computer

Chapter 2. Instruction Set Architecture (ISA)

Processor Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Instruction Set Design and Architecture

Concepts Introduced in Chapter 3

MIPS Datapath. MIPS Registers (and the conventions associated with them) MIPS Instruction Types

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

Lecture 4: RISC Computers

Processor Architecture

Chapter 2A Instructions: Language of the Computer

Machine Language Instructions Introduction. Instructions Words of a language understood by machine. Instruction set Vocabulary of the machine

Do-While Example. In C++ In assembly language. do { z--; while (a == b); z = b; loop: addi $s2, $s2, -1 beq $s0, $s1, loop or $s2, $s1, $zero

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

Computer Architecture

Chapter 13 Reduced Instruction Set Computers

Computer Organization

COMP2121: Microprocessors and Interfacing. Instruction Set Architecture (ISA)

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI

MIPS History. ISA MIPS Registers

Instructions: Language of the Computer

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

Computer Organization MIPS ISA

CPE300: Digital System Architecture and Design

Chapter 2. Instructions: Language of the Computer. HW#1: 1.3 all, 1.4 all, 1.6.1, , , , , and Due date: one week.

LECTURE 2: INSTRUCTIONS

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017

Today s topics. MIPS operations and operands. MIPS arithmetic. CS/COE1541: Introduction to Computer Architecture. A Review of MIPS ISA.

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes

MIPS%Assembly% E155%

CENG3420 L03: Instruction Set Architecture

Systems Architecture I

Real instruction set architectures. Part 2: a representative sample

CSE A215 Assembly Language Programming for Engineers

2.7 Supporting Procedures in hardware. Why procedures or functions? Procedure calls

CENG3420 Lecture 03 Review

Chapter 4. The Processor. Computer Architecture and IC Design Lab

COMP3221: Microprocessors and. and Embedded Systems. Instruction Set Architecture (ISA) What makes an ISA? #1: Memory Models. What makes an ISA?

RISC I from Berkeley. 44k Transistors 1Mhz 77mm^2

Digital System Design Using Verilog. - Processing Unit Design

Transcription:

CISC to RISC and MIPS Instruction Set A. Sahu CSE, IIT Guwahati Please be updated with http://jatinga.iitg.ernet.in/~asahu/cs222/ Outline Prev Class Understanding an existing architecture CISC : 8085 Example Analyze and Identify the difficulty or problem with CISC Works division of some 8085 instruction Listing of works done in executing instructions Simplifying instruction to make it RISC Simpler hardware : Data Path + Control Low power consumption MIPS ISA and Assembly Language Programming ACC 8085 Microprocessor Architecture tmp R Flag ALU Timing and Control Bus 8 Bit IR I Decode & M/C Encodin g MUX W Z B C D E H L SP PC Inc/Dec. ter Add latch Add Buff Data/Add Buff ADD R Operation : ACC = ACC + R Time : 3 T Cycle Work : Read R, Read ACC, Add, Write Result to ACC ADD M Operation : ACC = ACC + M[HL] Time : 7 T Cycle Work : Read H, Read L, Put HL to Add Buff, Read M, Put Buff to Temp A, Read ACC, Add, Write Result to ACC Operation : M[HL] = M[HL]+1 INC M Time : 10 T Cycle Work : Read H, Read L, Put HL to Add Buff, Read M, Put Buff to Temp A, Put 1 to TempB, Add, Write M 1

MVI A 34H Operation : ACC = ACC+37 SIZE : 2 byte 16 bit Time : 7 T Cycle Work : Read I from IR, Read ACC, Add, Write Result to ACC LDA A 2000H Operation : ACC = ACC+M[2000] SIZE : 3 byte, 24 bit Time : 13 T Cycle Work : Read NextPC, Put to Add Buff, Read Next PC, add to Add Buff, Read ACC, Add, Write Result to ACC PUSH D Operation : M[SP] = D, SP, M[SP]=E, SP Time : 12 T Cycle Work : Read dsph, Put to Add Buff, Read dspl, add to Add Buff, Read D, Put to Data Buff, Write to Mem, Read SP,Put Temp1 1, ALU Sub, Write to SP, Read SPH, Put to Add Buff, Read SPL, add to Add Buff, Read D, Put to Data Buff, Write to Mem, Read SP,Put Temp1 1, ALU Sub, Write to SP JMP 5000H Operation : PC = 5000 SIZE : 3 byte, 24 bit Time : 12 T Cycle Work : Read NextPC, Put to PCH, Read Next PC, Put to PCL Comparison Table INS Size Work TCycle ADD R 1 Byte A=A+R 3 ADD M 1 Byte A = A+M[HL] 7 INC M 1 Byte M[HL]=M[HL]+1 10 MVI A 34H 2 Byte A=34 7 LDA 2000H 3 Byte A=M[2000] 13 PUSHD 1 Byte M[SP ]=D,M[SP ]=E 12 JMP 5000H 3 Byte PC=5000 10 Instruction Set Design 2

Instruction Set Design Keep all the instruction simple Number of work is upto 1 to 4 Size of instruction are almost same Load store are separated from arithmetic INS, no combination of load and store No complex instruction Controller and Data path simpler Instructions are: mixed of complex and simple instruction Number of work is upto 1 to 20 CISC Instruction Set How many different types instruction Example RISC : Around 80 CISC : Around 3000 OISC : 1 ASIP : 100, N/W processor, DSP OISC RISC ASIP CISC X86 Instruction Set Size Cost of Hardware, Power, Area Design time (of Hardware) Code Size (CISC smaller, OISC bigger) Compile time CISC : Huge, may not take advantage of all the hardware Execution time (Performance) Instructions Language of the Machine Primitive compared to HLLs Easily interpreted by hardware Instruction set design goals Maximize performance Minimize cost, Reduce design time Type of Instructions Instructions for arithmetic Instructions to move data Instructions for decision i making Handling constant operands Example: Instruction Set Architecture MIPS Representative of architectures developed since the 1980's Used by NEC, Nintendo, Silicon Graphics, Sony Real architecture but easy to understand MIPS: Microprocessor without Interlocked Pipeline Stages : ISA MIPS: Millions Instructions Per Sec: Measure 3

MIPS Arithmetic All instructions have 3 operands Operand order is fixed (destination first) Example: C code: A = B + C MIPS code: add $s0, $s1, $s2 (associated with variables by compiler) A mapped to $s0, B mapped to $s1 and C mapped to $s2 MIPS Arithmetic Simplicity favors regularity Operands must be registers, only 32 registers provided (smaller is faster) Expressions need to be broken C code MIPS code A = B + C + D; add $t0, $s1, $s2 E = F A; add $s0, $t0, $s3 sub $s4, $s5, $s0 A mapped to $s0, B mapped to $s1, C mapped to $s2 D mapped to $s3, E mapped to $s4, F mapped to $s5 Registers vs. Memory Scalars mapped to registers Structures, arrays etc in memory Control Datapath Processor Memory Input Output I/O Memory Organization Viewed as a large, singledimension array, with an address. A memory address is an index into the array "Byte addressing" means that the index points to a byte of memory. 0 1 2 3 4 5 6... Register Names and Purpose Name Register number Usage $zero 0 the constant value 0 $v0-$v1 2-3 values for results $a0-$a3 4-7 arguments $t0-$t7 8-15 temporaries $s0-$s7 16-23 saved $t8-$t9 24-25 more temporaries $gp 28 global pointer $sp 29 stack pointer $fp 30 frame pointer $ra 31 return address Words and Bytes 2 32 bytes : byte addresses from 0 to 2 32 1 2 30 words : byte addresses 0, 4, 8,... 2 32 4 Big endian bt byte order 0 1 2 3 Little endian byte order Non aligned word 4 5 6 7 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 4

Instructions to access memory Load and store instructions Example: C code: A[8] = h + A[8]; MIPS code: lw $t0, 32($s3) add $t0, $s2, $t0 sw $t0, 32($s3) &A mapped to $s3 and h mapped to $s2 5