CHAPTER 2: INSTRUCTION SET PRINCIPLES. Prepared by Mdm Rohaya binti Abu Hassan

Size: px
Start display at page:

Download "CHAPTER 2: INSTRUCTION SET PRINCIPLES. Prepared by Mdm Rohaya binti Abu Hassan"

Transcription

1 CHAPTER 2: INSTRUCTION SET PRINCIPLES Prepared by Mdm Rohaya binti Abu Hassan

2 Chapter 2: Instruction Set Principles Instruction Set Architecture Classification of ISA/Types of machine Primary advantages and disadvantages of each class of machine Classification of General Purpose Register Machines Addressing modes Aligning Addresses Interpreting Memory Addresses Addressing Modes for Desktops and Servers Addressing Mode Usage (VAX) DLX Instruction Set

3 Instruction Sets What is an instruction set? Set of all instructions understood by the CPU Each instruction directly executed in hardware

4 Instruction Set Architecture (ISA) Definition: The instruction set architecture is informally the set of programmer visible registers and address spaces and the set of instructions that can operate on them.

5 Instruction Set Architecture (ISA) Instruction set architecture of a machine fills the semantic gap between the user and the machine. The ISA specifies the size of main memory, number of registers, and number of bits per instruction. It also specifies exactly which instructions the machine is capable of performing and how each of the instruction bits is interpreted.

6 Instruction Set Architecture (ISA) It is all of the programmer-visible components and operations of the computer The ISA provides all the information needed for someone to write a program in machine language translate from a high-level language to machine language

7 Instruction Set Architecture (ISA) ISA serves as the starting point for the design of a new machine or modification of an existing one.

8 Instruction Set Architecture (ISA) software instruction set hardware

9 Instruction Set Architecture (ISA)

10 Classification of ISA The type of internal storage in the CPU is the most basic differentiation. The major choices are a stack the operands are implicitly on top of the stack an accumulator one operand is implicitly the accumulator a set of registers all operands are explicit either registers or memory locations

11 Classification of ISA Stack Architecture: Operands are implicit. They are on the top of the stack. For example, a binary operation pops the top two elements of the stack, applies the operation and pushes the result back on the stack.

12 Classification of ISA Accumulator Architecture: One of the operands is implicitly the accumulator. Usually one of the source operand and the destination operand is assumed to be the accumulator.

13 Classification of ISA General Purpose Register Architecture: Operands are explicit: either memory operands or register operands. Any instruction can access memory. Load/Store Architecture: Only load/store instructions can access memory. All other instructions use registers. Also referred to as register- register architecture.

14 Types of Machines

15 Code Sequence for C=A+B Stack Accumulator Register-memory Register-register Push A Load A Load R1, A Load R1, A Push B Add B Add R1, B Load R2, B Add Store C Store C Add R3, R1, R2 Pop C Store C, R3

16 Classification of ISA While most early machines used stack or accumulator-style architectures, all machines designed in the past ten years use a general purpose architecture. Stack architecture : Early machines Accumulator architecture : Early machines General purpose register (GPR) architecture : machines after 1980.

17 Classification of ISA Reasons for emergence of general-purpose register (GPR) machines17 1. Registers are faster than memory 2. Registers are easily used by a compiler and used more effectively. 1. Example: (A*B)-(C*D)-(E*F) for stack machine? for GPR machine? 3. Registers can be used to hold variables: Reduce memory traffic, improve code density, speed up program.

18 Classification of General Purpose Register Machines There are two major instruction set characteristics that divide GPR architectures. 1. Concerns whether an ALU instruction has two or three operands 2. how many of the operands may be memory addressed in ALU instruction

19 Types of GPR Machines Number of memory address Max # of operands allowed Examples 0 3 SPARC, MIPS, PA, PowerPC 1 2 Intel 80X86, Motorola VAX 3 3 VAX

20 Classification of General Purpose Register Machines 1. They concern whether an ALU instruction has two or three operands Example: ADD R3, R1, R2 R3 <-R1 + R2 or ADD R1, R2 R1 <- R1 + R2 3 operands, R1.R2 and R3 2 operands, R1 and R2

21 Classification of General Purpose Register Machines 2. how many of the operands may be memory addressed in ALU instruction Register- Register (Load/Store) ADD R3, R1, R2 (R3 <- R1 + R2) Register - Memory ADD R1, A (R1 <- R1 + A) Memory - Memory ADD C, A, B (C <- A + B)

22 Primary advantages and disadvantages of each class of machine Machine Type Stack Accumulator Register Advantages Simple model of expression evaluation. Good code density. Minimizes internal state of machine. Short instructions Most general model for code generation Disadvantages A stack can't be randomly accessed. It makes it difficult to generate efficient code. Since accumulator is only temporary storage, memory traffic is highest. All operands must be named, leading to longer instructions.

23 Addressing modes ISA design must define how memory addresses are interpreted and specified in the instructions. Addressing modes are the ways how architectures specify the address of an object they want to access. In GPR machines, an addressing mode can specify a constant, a register or a location in memory.

24 Addressing modes Addressing Modes Example Instruction Meaning When used Register Add R4,R3 R4 <- R4 + R3 When a value is in a register Immediate Add R4, #3 R4 <- R4 + 3 For constants Displacement Add R4, 100(R1) Accessing local R4 <- R4 + M[100+R1] variables Accessing using a Register deffered Add R4,(R1) R4 <- R4 + M[R1] pointer or a computed address Indexed Add R3, (R1 + R2) R3 <- R3 + M[R1+R2] Useful in array addressing: R1 - base of array R2 - index amount Direct Add R1, (1001) R1 <- R1 + M[1001] Useful in accessing static data

25 Addressing modes Addressing Modes Example Instruction Memory deferred Add Autoincrement Autodecrement Scaled Add R1, (R2)+ Add R1,-(R2) Add R1, 100(R2)[R3] Meaning R1 <- R1 + M[M[R3]] R1 <- R1 +M[R2] R2 <- R2 + d R2 <-R2-d R1 <- R1 + M[R2] R1<- R1+M[100+R2+R3*d ] When used If R3 is the address of a pointer p, then mode yields *p Useful for stepping through arrays in a loop. R2 - start of array d - size of an element Same as auto increment. Both can also be used to implement a stack as push and pop Used to index arrays. May be applied to any base addressing mode in some machines.

26 Addressing modes - Notation <- - assignment M - the name for memory: M[R1] refers to contents of memory location whose address is given by the contents of R1

27 Interpreting Memory Addresses How is a memory address interpreted? Byte addressed: Provide access for bytes (8 bits), half words (16 bits), words (32 bits), and double words (64 bits) Conventions for ordering the bytes within a word: Little Endian: put byte whose address xxxx00 at LSB position. followed by DEC and Intel Word address Data Big Endian: Put byte whose address xxxx00 at MSB position. followed by IBM, Motorola and others Word address Data

28 Example To store a word in byte-addressable memory (i.e. where each element of memory is one byte), you have to break up the 32 bit quantity into 4 bytes. Thus, if the word was 0x01ab23cd, it's broken up into 0x01, 0xab, 0x23, 0xcd.

29 Interpreting Memory Addresses When operating within one machine, the byte order is often unnoticeable - only programs that access the same locations as both words and bytes can notice the difference. However, byte order is a problem when exchanging data among machines with different ordering.

30 Aligning Addresses In some machines, accesses to objects larger than a byte must be aligned. An access to an object of size s bytes at byte address A is aligned if A mod s = 0. Object Addressed Aligned at Byte Offset byte 0,1,2,3,4,5,6,7 never halfword 0,2,4,6 1,3,5,7 Misaligned at Byte Offset word 0,4 1,2,3,5,6,7 doubleword 0 1,2,3,4,5,6,7

31 Aligning Addresses Quantity Address divisible by (Binary) address ends in Byte 1 anything Halfword (16 bits) 2 0 Word (32 bits) 4 00 Doubleword (64 bits) 8 000

32 Aligning Addresses

33 Aligning Addresses Misalignment causes hardware complications, since the memory is typically aligned on a word boundary. A misaligned memory access will, therefore, take multiple aligned memory references. Misalignment typically results in an alignment fault that must be handled by the OS

34 Addressing Mode How architectures specify the address of an object they will access? In a GPR, an addressing mode can specify a constant, a register, a location in memory (used to compute effective address). Immediate or literals are usually considered as memory addressing mode. Addressing modes that depend on the program counter is called PCrelative addressing. Addressing modes can significantly reduce instruction counts, but may add to the complexity of building a machine and increase the average CPI.

35 Addressing Modes for Desktops and Servers Register ADD R4, R3 Immediate ADD R4, #3 Displacement ADD R4, 100(R1) Register Indirect ADD R4, (R1) Indexed ADD R3, (R1+R2) Direct (Absolute) ADD R1, (1001) Memory Indirect ADD Autoincrement ADD R1, (R2)+ Autodecrement ADD R1, -(R2) Scaled ADD R1, 100(R2)[R3]

36 Addressing Mode Usage (VAX)

37 Operations in the Instruction Set Data transfer instructions. Arithmetic and logic instructions. Instructions for control flow: conditional and unconditional branches, jumps, procedure calls and procedure returns. System calls. Floating point instructions. Decimal instructions. String instructions. Graphics instructions

38 DLX The DLX(pronounced "Deluxe") is a RISC processor architecture designed by John L. Hennessy and David A. Patterson, the principal designers of the MIPS and the Berkeley RISC designs (respectively), the two benchmark examples of RISC design. The DLX is essentially a cleaned up and simplified MIPS, with a simple 32-bit load/store architecture. Intended primarily for teaching purposes, the DLX design is widely used in university-level computer architecture courses.

39 DLX Instruction Set The architecture of DLX was chosen based on observations about most frequently used primitives in programs. DLX provides a good architectural model for study, not only because of the recent popularity of this type of machine, but also because it is easy to understand. Like most recent load/store machines, DLX emphasizes A simple load/store instruction set Design for pipelining efficiency An easily decoded instruction set Efficiency as a compiler target

40 DLX s Operation 1. Load/Store Any of the GPRs or FPRs may be loaded and stored except that loading R0 has no effect. 2. ALU Operations All ALU instructions are register-register instructions. The operations are : - add, subtract, AND, OR, XOR,shifts Compare instructions compare two registers (=,!=,<,>,=<,=>). If the condition is true, these instructions place a 1 in the destination register, otherwise they place a 0.

41 DLX s Operation Branches/Jumps All branches are conditional.the branch condition is specified by the instruction, which may test the register source for zero or nonzero. Floating-Point Operations - add - subtract - multiply - divide

42 DLX s Operation There are four classes of instructions: 1. Load/Store 2. ALU Operations 3. Branches/Jumps 4. Floating-Point Operations

43 DLX Instruction Set opcode Data transfers Instruction meaning Move data between registers and memory, or between the integer and FP or special register; only memory address mode is 16-bit displacement + contents of a GPR LB, LBU, SB Load byte, load byte unsigned, store byte LH, LHU, SH Load halfword, load halfword unsigned, store halfword LW, SW LF, LD, SF, SD MOVI2S, MOVS2I MOVF, MOVD MOVFP2I, MOVI2FP Load word, store word (to/from integer registers) Load SP float, load DP float, store SP float, store DP float (SP - single precision, DP - double precision) Move from/to GPR to/from a special register Copy one floating-point register or a DP pair to another register or pair Move 32 bits from/to FP tegister to/from integer registers

44 DLX Instruction Set opcode Arithmetic / Logical ADD, ADDI, ADDU, ADDUI SUB, SUBI, SUBU, SUBUI Instruction meaning Operations on integer or logical data in GPRs; signed arithmetics trap on overflow Add, add immediate (all immediates are 16-bits); signed and unsigned Subtract, subtract immediate; signed and unsigned MULT, MULTU, DIV, DIVU Multiply and divide, signed and unsigned; operands must be floating-point registers; all operations take and yield 32-bit values AND, ANDI OR, ORI, XOP, XOPI LHI And, and immediate Or, or immediate, exclusive or, exclusive or immediate Load high immediate - loads upper half of register with immediate SLL, SRL, SRA, SLLI, SRLI, SRAI S, S I Shifts: both immediate(s I) and variable form(s ); shifts are shift left logical, right logical, right arithmetic Set conditional: " "may be LT, GT, LE, GE, EQ, NE

45 DLX Instruction Set opcode Control Instruction meaning Conditional branches and jumps; PC-relative or through register BEQZ, BNEZ Branch GPR equal/not equal to zero; 16-bit offset from PC BFPT, BFPF Test comparison bit in the FP status register and branch; 16-bit offset from PC J, JR Jumps: 26-bit offset from PC(J) or target in register(jr) JAL, JALR TRAP Jump and link: save PC+4 to R31, target is PC-relative(JAL) ot a register(jalr) Transfer to operating system at a vectored address RFE Return to user code from an exception; restore user code

46 DLX Instruction Set Floating point ADDD, ADDF SUBD, SUBF MULTD, MULTF DIVD, DIVF CVTF2D, CVTF2I, CVTD2F, CVTD2I, CVTI2F, CVTI2D D, F Floating-point operations on DP and SP formats Add DP, SP numbers Subtract DP, SP numbers Multiply DP, SP floating point Divide DP, SP floating point Convert instructions: CVTx2y converts from type x to type y, where x and y are one of I(Integer), D(Double precision), or F(Single precision). Both operands are in the FP registers. DP and SP compares: " " may be LT, GT, LE, GE, EQ, NE; set comparison bit in FP status register.

47 THANK YOU

Computer Architecture. MIPS Instruction Set Architecture

Computer Architecture. MIPS Instruction Set Architecture Computer Architecture MIPS Instruction Set Architecture Instruction Set Architecture An Abstract Data Type Objects Registers & Memory Operations Instructions Goal of Instruction Set Architecture Design

More information

A Model RISC Processor. DLX Architecture

A Model RISC Processor. DLX Architecture DLX Architecture A Model RISC Processor 1 General Features Flat memory model with 32-bit address Data types Integers (32-bit) Floating Point Single precision (32-bit) Double precision (64 bits) Register-register

More information

Lecture 4: Instruction Set Architecture

Lecture 4: Instruction Set Architecture Lecture 4: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation Reading: Textbook (5 th edition) Appendix A Appendix B (4 th edition)

More information

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA) Instruction Set Architecture (ISA)... the attributes of a [computing] system as seen by the programmer, i.e. the conceptual structure and functional behavior, as distinct from the organization of the data

More information

Review of instruction set architectures

Review of instruction set architectures Review of instruction set architectures Outline ISA and Assembly Language RISC vs. CISC Instruction Set Definition (MIPS) 2 ISA and assembly language Assembly language ISA Machine language 3 Assembly language

More information

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

ISA and RISCV. CASS 2018 Lavanya Ramapantulu ISA and RISCV CASS 2018 Lavanya Ramapantulu Program Program =?? Algorithm + Data Structures Niklaus Wirth Program (Abstraction) of processor/hardware that executes 3-Jul-18 CASS18 - ISA and RISCV 2 Program

More information

Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions

Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions Structure of von Nuemann machine Arithmetic and Logic Unit Input Output Equipment Main Memory Program Control Unit 1 1 Instruction Set - the type of Instructions Arithmetic + Logical (ADD, SUB, MULT, DIV,

More information

CPU Architecture and Instruction Sets Chapter 1

CPU Architecture and Instruction Sets Chapter 1 CPU Architecture and Instruction Sets Chapter 1 1 Is CPU Architecture Relevant for DBMS? CPU design focuses on speed resulting in a 55%/year improvement since 1987: If CPU performance in database code

More information

CSCE 5610: Computer Architecture

CSCE 5610: Computer Architecture HW #1 1.3, 1.5, 1.9, 1.12 Due: Sept 12, 2018 Review: Execution time of a program Arithmetic Average, Weighted Arithmetic Average Geometric Mean Benchmarks, kernels and synthetic benchmarks Computing CPI

More information

Reduced Instruction Set Computer (RISC)

Reduced Instruction Set Computer (RISC) Reduced Instruction Set Computer (RISC) Reduced Instruction Set Computer (RISC) Focuses on reducing the number and complexity of instructions of the machine. Reduced number of cycles needed per instruction.

More information

Reduced Instruction Set Computer (RISC)

Reduced Instruction Set Computer (RISC) Reduced Instruction Set Computer (RISC) Focuses on reducing the number and complexity of instructions of the ISA. RISC Goals RISC: Simplify ISA Simplify CPU Design Better CPU Performance Motivated by simplifying

More information

M2 Instruction Set Architecture

M2 Instruction Set Architecture M2 Instruction Set Architecture Module Outline Addressing modes. Instruction classes. MIPS-I ISA. High level languages, Assembly languages and object code. Translating and starting a program. Subroutine

More information

Instruction Set Principles and Examples. Appendix B

Instruction Set Principles and Examples. Appendix B Instruction Set Principles and Examples Appendix B Outline What is Instruction Set Architecture? Classifying ISA Elements of ISA Programming Registers Type and Size of Operands Addressing Modes Types of

More information

Computer Architecture. The Language of the Machine

Computer Architecture. The Language of the Machine Computer Architecture The Language of the Machine Instruction Sets Basic ISA Classes, Addressing, Format Administrative Matters Operations, Branching, Calling conventions Break Organization All computers

More information

CS3350B Computer Architecture MIPS Instruction Representation

CS3350B Computer Architecture MIPS Instruction Representation CS3350B Computer Architecture MIPS Instruction Representation Marc Moreno Maza http://www.csd.uwo.ca/~moreno/cs3350_moreno/index.html Department of Computer Science University of Western Ontario, Canada

More information

Computer Architecture

Computer Architecture CS3350B Computer Architecture Winter 2015 Lecture 4.2: MIPS ISA -- Instruction Representation Marc Moreno Maza www.csd.uwo.ca/courses/cs3350b [Adapted from lectures on Computer Organization and Design,

More information

Instruction Set Principles. (Appendix B)

Instruction Set Principles. (Appendix B) Instruction Set Principles (Appendix B) Outline Introduction Classification of Instruction Set Architectures Addressing Modes Instruction Set Operations Type & Size of Operands Instruction Set Encoding

More information

Instruction Set Architecture of. MIPS Processor. MIPS Processor. MIPS Registers (continued) MIPS Registers

Instruction Set Architecture of. MIPS Processor. MIPS Processor. MIPS Registers (continued) MIPS Registers CSE 675.02: Introduction to Computer Architecture MIPS Processor Memory Instruction Set Architecture of MIPS Processor CPU Arithmetic Logic unit Registers $0 $31 Multiply divide Coprocessor 1 (FPU) Registers

More information

CS4617 Computer Architecture

CS4617 Computer Architecture 1/27 CS4617 Computer Architecture Lecture 7: Instruction Set Architectures Dr J Vaughan October 1, 2014 2/27 ISA Classification Stack architecture: operands on top of stack Accumulator architecture: 1

More information

The MIPS Instruction Set Architecture

The MIPS Instruction Set Architecture The MIPS Set Architecture CPS 14 Lecture 5 Today s Lecture Admin HW #1 is due HW #2 assigned Outline Review A specific ISA, we ll use it throughout semester, very similar to the NiosII ISA (we will use

More information

Computer Architecture, EDT030

Computer Architecture, EDT030 Department of Information Technology Computer Architecture, EDT030 Exam, Tuesday, March 7, 2000, 8.00-12.00 am The exam consists of a number of assignments with a total of 100 points. Grading: 40p grade

More information

Chapter 2A Instructions: Language of the Computer

Chapter 2A Instructions: Language of the Computer Chapter 2A Instructions: Language of the Computer Copyright 2009 Elsevier, Inc. All rights reserved. Instruction Set The repertoire of instructions of a computer Different computers have different instruction

More information

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA CISC 662 Graduate Computer Architecture Lecture 4 - ISA Michela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

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

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization CISC 662 Graduate Computer Architecture Lecture 4 - ISA MIPS ISA Michela Taufer http://www.cis.udel.edu/~taufer/courses Powerpoint Lecture Notes from John Hennessy and David Patterson s: Computer Architecture,

More information

CS/ECE/752 Chapter 2 Instruction Sets Instructor: Prof. Wood

CS/ECE/752 Chapter 2 Instruction Sets Instructor: Prof. Wood CS/ECE/752 Chapter 2 Instruction Sets Instructor: Prof. Wood Computer Sciences Department University of Wisconsin Slides developed by Profs. Falsafi,, Hill, Smith, Sohi,, and Vijaykumar of Carnegie Mellon

More information

55:132/22C:160, HPCA Spring 2011

55:132/22C:160, HPCA Spring 2011 55:132/22C:160, HPCA Spring 2011 Second Lecture Slide Set Instruction Set Architecture Instruction Set Architecture ISA, the boundary between software and hardware Specifies the logical machine that is

More information

MIPS Instruction Set

MIPS Instruction Set MIPS Instruction Set Prof. James L. Frankel Harvard University Version of 7:12 PM 3-Apr-2018 Copyright 2018, 2017, 2016, 201 James L. Frankel. All rights reserved. CPU Overview CPU is an acronym for Central

More information

Chapter 2. Instruction Set Design. Computer Architectures. software. hardware. Which is easier to change/design??? Tien-Fu Chen

Chapter 2. Instruction Set Design. Computer Architectures. software. hardware. Which is easier to change/design??? Tien-Fu Chen Computer Architectures Chapter 2 Tien-Fu Chen National Chung Cheng Univ. chap2-0 Instruction Set Design software instruction set hardware Which is easier to change/design??? chap2-1 Instruction Set Architecture:

More information

COSC 6385 Computer Architecture. Instruction Set Architectures

COSC 6385 Computer Architecture. Instruction Set Architectures COSC 6385 Computer Architecture Instruction Set Architectures Spring 2012 Instruction Set Architecture (ISA) Definition on Wikipedia: Part of the Computer Architecture related to programming Defines set

More information

Instructions: Language of the Computer

Instructions: Language of the Computer CS359: Computer Architecture Instructions: Language of the Computer Yanyan Shen Department of Computer Science and Engineering 1 The Language a Computer Understands Word a computer understands: instruction

More information

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009 101 Assembly ENGR 3410 Computer Architecture Mark L. Chang Fall 2009 What is assembly? 79 Why are we learning assembly now? 80 Assembly Language Readings: Chapter 2 (2.1-2.6, 2.8, 2.9, 2.13, 2.15), Appendix

More information

Instruction Set Design

Instruction Set Design Instruction Set Design software instruction set hardware CPE442 Lec 3 ISA.1 Instruction Set Architecture Programmer's View ADD SUBTRACT AND OR COMPARE... 01010 01110 10011 10001 11010... CPU Memory I/O

More information

Design for a simplified DLX (SDLX) processor Rajat Moona

Design for a simplified DLX (SDLX) processor Rajat Moona Design for a simplified DLX (SDLX) processor Rajat Moona moona@iitk.ac.in In this handout we shall see the design of a simplified DLX (SDLX) processor. We shall assume that the readers are familiar with

More information

Computer Architecture (TT 2011)

Computer Architecture (TT 2011) Computer Architecture (TT 2011) The MIPS/DLX/RISC Architecture Daniel Kroening Oxford University, Computer Science Department Version 1.0, 2011 Outline ISAs Overview MIPS/DLX Instruction Formats D. Kroening:

More information

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4 Processor Han Wang CS3410, Spring 2012 Computer Science Cornell University See P&H Chapter 2.16 20, 4.1 4 Announcements Project 1 Available Design Document due in one week. Final Design due in three weeks.

More information

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Instruction Set Principles The Role of Compilers MIPS 2 Main Content Computer

More information

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

2.7 Supporting Procedures in hardware. Why procedures or functions? Procedure calls 2.7 Supporting Procedures in hardware Why procedures or functions? Procedure calls Caller: Callee: Proc save registers save more registers set up parameters do function call procedure set up results get

More information

Instruction Set Architecture. "Speaking with the computer"

Instruction Set Architecture. Speaking with the computer Instruction Set Architecture "Speaking with the computer" The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture Digital Design

More information

Course Administration

Course Administration Fall 2017 EE 3613: Computer Organization Chapter 2: Instruction Set Architecture 2/4 Avinash Kodi Department of Electrical Engineering & Computer Science Ohio University, Athens, Ohio 45701 E-mail: kodi@ohio.edu

More information

Instructions: Language of the Computer

Instructions: Language of the Computer Instructions: Language of the Computer Tuesday 22 September 15 Many slides adapted from: and Design, Patterson & Hennessy 5th Edition, 2014, MK and from Prof. Mary Jane Irwin, PSU Summary Previous Class

More information

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support Components of an ISA EE 357 Unit 11 MIPS ISA 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support SUBtract instruc. vs. NEGate + ADD instrucs. 3. Registers accessible

More information

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3

Lecture 5: Instruction Set Architectures II. Take QUIZ 2 before 11:59pm today over Chapter 1 Quiz 1: 100% - 29; 80% - 25; 60% - 17; 40% - 3 Lecture 5: Instruction Set Architectures II Announcements Turn in Homework #1 XSPIM tutorials in PAI 5.38 during TA office hours Tue Feb 2: 2-3:30pm Wed Feb 3: 1:30-3pm Thu Feb 4: 3-4:30pm Take QUIZ 2

More information

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1 CSIS1120A 10. Instruction Set & Addressing Mode CSIS1120A 10. Instruction Set & Addressing Mode 1 Elements of a Machine Instruction Operation Code specifies the operation to be performed, e.g. ADD, SUB

More information

INSTRUCTION SET COMPARISONS

INSTRUCTION SET COMPARISONS INSTRUCTION SET COMPARISONS MIPS SPARC MOTOROLA REGISTERS: INTEGER 32 FIXED WINDOWS 32 FIXED FP SEPARATE SEPARATE SHARED BRANCHES: CONDITION CODES NO YES NO COMPARE & BR. YES NO YES A=B COMP. & BR. YES

More information

R-type Instructions. Experiment Introduction. 4.2 Instruction Set Architecture Types of Instructions

R-type Instructions. Experiment Introduction. 4.2 Instruction Set Architecture Types of Instructions Experiment 4 R-type Instructions 4.1 Introduction This part is dedicated to the design of a processor based on a simplified version of the DLX architecture. The DLX is a RISC processor architecture designed

More information

ECE232: Hardware Organization and Design. Computer Organization - Previously covered

ECE232: Hardware Organization and Design. Computer Organization - Previously covered ECE232: Hardware Organization and Design Part 6: MIPS Instructions II http://www.ecs.umass.edu/ece/ece232/ Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Computer Organization

More information

EC-801 Advanced Computer Architecture

EC-801 Advanced Computer Architecture EC-801 Advanced Computer Architecture Lecture 5 Instruction Set Architecture I Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC University Taxila!1 Instruction Set Architecture

More information

Review: MIPS Organization

Review: MIPS Organization 1 MIPS Arithmetic Review: MIPS Organization Processor Memory src1 addr 5 src2 addr 5 dst addr 5 write data Register File registers ($zero - $ra) bits src1 data src2 data read/write addr 1 1100 2 30 words

More information

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro 1 Levels of Representation/Interpretation Machine Interpretation High Level Language Program (e.g., C) Compiler Assembly

More information

Chapter 2. Instruction Set Principles and Examples. In-Cheol Park Dept. of EE, KAIST

Chapter 2. Instruction Set Principles and Examples. In-Cheol Park Dept. of EE, KAIST Chapter 2. Instruction Set Principles and Examples In-Cheol Park Dept. of EE, KAIST Stack architecture( 0-address ) operands are on the top of the stack Accumulator architecture( 1-address ) one operand

More information

TSK3000A - Generic Instructions

TSK3000A - Generic Instructions TSK3000A - Generic Instructions Frozen Content Modified by Admin on Sep 13, 2017 Using the core set of assembly language instructions for the TSK3000A as building blocks, a number of generic instructions

More information

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture EEM 486: Computer Architecture Lecture 2 MIPS Instruction Set Architecture EEM 486 Overview Instruction Representation Big idea: stored program consequences of stored program Instructions as numbers Instruction

More information

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer. See P&H Chapter: 2.16-2.20, 4.1-4.4,

More information

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

CSE 141 Computer Architecture Spring Lecture 3 Instruction Set Architecute. Course Schedule. Announcements CSE141: Introduction to Computer Architecture CSE 141 Computer Architecture Spring 2005 Lecture 3 Instruction Set Architecute Pramod V. Argade April 4, 2005 Instructor: TAs: Pramod V. Argade (p2argade@cs.ucsd.edu)

More information

ECE331: Hardware Organization and Design

ECE331: Hardware Organization and Design ECE331: Hardware Organization and Design Lecture 15: Midterm 1 Review Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Basics Midterm to cover Book Sections (inclusive) 1.1 1.5

More information

Computer Organization MIPS ISA

Computer Organization MIPS ISA CPE 335 Computer Organization MIPS ISA Dr. Iyad Jafar Adapted from Dr. Gheith Abandah Slides http://www.abandah.com/gheith/courses/cpe335_s08/index.html CPE 232 MIPS ISA 1 (vonneumann) Processor Organization

More information

Instruction Set (ISA) Design and Addressing Modes

Instruction Set (ISA) Design and Addressing Modes 3-1 3-1 Instruction Set (ISA) Design and Addressing Modes Material from sections 2.1, 2.2, and 2.3. Outline ISA Design Choices It s more than just picking instructions. ISA Design Choice Details Screw

More information

Reminder: tutorials start next week!

Reminder: tutorials start next week! Previous lecture recap! Metrics of computer architecture! Fundamental ways of improving performance: parallelism, locality, focus on the common case! Amdahl s Law: speedup proportional only to the affected

More information

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2)

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2) Introduction to the MIPS ISA Overview Remember that the machine only understands very basic instructions (machine instructions) It is the compiler s job to translate your high-level (e.g. C program) into

More information

ISA: The Hardware Software Interface

ISA: The Hardware Software Interface ISA: The Hardware Software Interface Instruction Set Architecture (ISA) is where software meets hardware In embedded systems, this boundary is often flexible Understanding of ISA design is therefore important

More information

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 MIPS Intro II Lect 10 Feb 15, 2008 Adapted from slides developed for: Mary J. Irwin PSU CSE331 Dave Patterson s UCB CS152 M230 L10.1

More information

Programmable Machines

Programmable Machines Programmable Machines Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. Quiz 1: next week Covers L1-L8 Oct 11, 7:30-9:30PM Walker memorial 50-340 L09-1 6.004 So Far Using Combinational

More information

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering MIPS Instruction Set James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy MIPS Registers MIPS

More information

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

Today s topics. MIPS operations and operands. MIPS arithmetic. CS/COE1541: Introduction to Computer Architecture. A Review of MIPS ISA. Today s topics CS/COE1541: Introduction to Computer Architecture MIPS operations and operands MIPS registers Memory view Instruction encoding A Review of MIPS ISA Sangyeun Cho Arithmetic operations Logic

More information

Assembly Programming

Assembly Programming Designing Computer Systems Assembly Programming 08:34:48 PM 23 August 2016 AP-1 Scott & Linda Wills Designing Computer Systems Assembly Programming In the early days of computers, assembly programming

More information

Computer Organization

Computer Organization Computer Organization (Instruction set Architecture & Assembly Language Programming) KR Chowdhary Professor & Head Email: kr.chowdhary@gmail.com webpage: krchowdhary.com Department of Computer Science

More information

Mark Redekopp, All rights reserved. EE 357 Unit 11 MIPS ISA

Mark Redekopp, All rights reserved. EE 357 Unit 11 MIPS ISA EE 357 Unit 11 MIPS ISA Components of an ISA 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support SUBtract instruc. vs. NEGate + ADD instrucs. 3. Registers accessible

More information

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering MIPS Instruction Set James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy MIPS Registers MIPS

More information

Computer Architecture. Chapter 3: Arithmetic for Computers

Computer Architecture. Chapter 3: Arithmetic for Computers 182.092 Computer Architecture Chapter 3: Arithmetic for Computers Adapted from Computer Organization and Design, 4 th Edition, Patterson & Hennessy, 2008, Morgan Kaufmann Publishers and Mary Jane Irwin

More information

Programmable Machines

Programmable Machines Programmable Machines Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. Quiz 1: next week Covers L1-L8 Oct 11, 7:30-9:30PM Walker memorial 50-340 L09-1 6.004 So Far Using Combinational

More information

Mark Redekopp, All rights reserved. EE 352 Unit 3 MIPS ISA

Mark Redekopp, All rights reserved. EE 352 Unit 3 MIPS ISA EE 352 Unit 3 MIPS ISA Instruction Set Architecture (ISA) Defines the software interface of the processor and memory system Instruction set is the vocabulary the HW can understand and the SW is composed

More information

CHAPTER 5 A Closer Look at Instruction Set Architectures

CHAPTER 5 A Closer Look at Instruction Set Architectures CHAPTER 5 A Closer Look at Instruction Set Architectures 5.1 Introduction 5.2 Instruction Formats 5.2.1 Design Decisions for Instruction Sets 5.2.2 Little versus Big Endian 5.2.3 Internal Storage in the

More information

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

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University. Instructions: ti Language of the Computer Rui Wang, Assistant professor Dept. of Information and Communication Tongji University it Email: ruiwang@tongji.edu.cn Computer Hierarchy Levels Language understood

More information

Computer Systems Laboratory Sungkyunkwan University

Computer Systems Laboratory Sungkyunkwan University ARM & IA-32 Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu ARM (1) ARM & MIPS similarities ARM: the most popular embedded core Similar basic set

More information

ECE 2035 Programming HW/SW Systems Fall problems, 7 pages Exam Two 23 October 2013

ECE 2035 Programming HW/SW Systems Fall problems, 7 pages Exam Two 23 October 2013 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

More information

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

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls Announcements HW1 is due on this Friday (Sept 12 th ) Appendix A is very helpful to HW1. Check out system calls on Page A-48. Ask TA (Liquan chen: liquan@ece.rutgers.edu) about homework related questions.

More information

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier

Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier Some material adapted from Mohamed Younis, UMBC CMSC 611 Spr 2003 course slides Some material adapted from Hennessy & Patterson / 2003 Elsevier Science To command a computer's hardware, you must speak

More information

MIPS Instruction Format

MIPS Instruction Format MIPS Instruction Format MIPS uses a 32-bit fixed-length instruction format. only three different instruction word formats: There are Register format Op-code Rs Rt Rd Function code 000000 sssss ttttt ddddd

More information

ECE 154A Introduction to. Fall 2012

ECE 154A Introduction to. Fall 2012 ECE 154A Introduction to Computer Architecture Fall 2012 Dmitri Strukov Lecture 4: Arithmetic and Data Transfer Instructions Agenda Review of last lecture Logic and shift instructions Load/store instructionsi

More information

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

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Introduction to the MIPS Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Introduction to the MIPS The Microprocessor without Interlocked Pipeline Stages

More information

DLXsim A Simulator for DLX

DLXsim A Simulator for DLX DLXsim A Simulator for DLX Larry B. Hostetler Brian Mirtich November 26, 2003 1 Introduction Our project involved writing a simulator (DLXsim) for the DLX instruction set (as described in Computer Architecture,

More information

CENG3420 Lecture 03 Review

CENG3420 Lecture 03 Review CENG3420 Lecture 03 Review Bei Yu byu@cse.cuhk.edu.hk 2017 Spring 1 / 38 CISC vs. RISC Complex Instruction Set Computer (CISC) Lots of instructions of variable size, very memory optimal, typically less

More information

MIPS History. ISA MIPS Registers

MIPS History. ISA MIPS Registers MIPS History MIPS is a computer family R2000/R3000 (32-bit) R4000/4400 (64-bit) R10000 (64-bit) and others MIPS originated as a Stanford research project under the direction of John Hennessy Microprocessor

More information

Character Is a byte quantity (00~FF or 0~255) ASCII (American Standard Code for Information Interchange) Page 91, Fig. 2.21

Character Is a byte quantity (00~FF or 0~255) ASCII (American Standard Code for Information Interchange) Page 91, Fig. 2.21 2.9 Communication with People: Byte Data & Constants Character Is a byte quantity (00~FF or 0~255) ASCII (American Standard Code for Information Interchange) Page 91, Fig. 2.21 32: space 33:! 34: 35: #...

More information

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

Chapter 2. Instructions: Language of the Computer. HW#1: 1.3 all, 1.4 all, 1.6.1, , , , , and Due date: one week. Chapter 2 Instructions: Language of the Computer HW#1: 1.3 all, 1.4 all, 1.6.1, 1.14.4, 1.14.5, 1.14.6, 1.15.1, and 1.15.4 Due date: one week. Practice: 1.5 all, 1.6 all, 1.10 all, 1.11 all, 1.14 all,

More information

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

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017 COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface RISC-V Edition Chapter 2 Instructions: Language of the Computer These slides are based on the slides by the authors. The slides doesn t

More information

ICS 233 COMPUTER ARCHITECTURE. MIPS Processor Design Multicycle Implementation

ICS 233 COMPUTER ARCHITECTURE. MIPS Processor Design Multicycle Implementation ICS 233 COMPUTER ARCHITECTURE MIPS Processor Design Multicycle Implementation Lecture 23 1 Add immediate unsigned Subtract unsigned And And immediate Or Or immediate Nor Shift left logical Shift right

More information

Instruction Sets: Characteristics and Functions

Instruction Sets: Characteristics and Functions Instruction Sets: Characteristics and Functions Chapter 10 Lesson 15 Slide 1/22 Machine instruction set Computer designer: The machine instruction set provides the functional requirements for the CPU.

More information

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro

CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro CS 61C: Great Ideas in Computer Architecture Intro to Assembly Language, MIPS Intro Instructors: Vladimir Stojanovic & Nicholas Weaver http://inst.eecs.berkeley.edu/~cs61c/sp16 1 Machine Interpretation

More information

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture

EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture EITF20: Computer Architecture Part2.1.1: Instruction Set Architecture Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Instruction Set Principles The Role of Compilers MIPS 2 Main Content Computer

More information

5DV118 Computer Organization and Architecture Umeå University Department of Computing Science Stephen J. Hegner. Topic 3: Arithmetic

5DV118 Computer Organization and Architecture Umeå University Department of Computing Science Stephen J. Hegner. Topic 3: Arithmetic 5DV118 Computer Organization and Architecture Umeå University Department of Computing Science Stephen J. Hegner Topic 3: Arithmetic These slides are mostly taken verbatim, or with minor changes, from those

More information

software hardware Which is easier to change/design???

software hardware Which is easier to change/design??? CS152 Computer Architecture and Engineering Lecture 2 Review of MIPS ISA and Performance January 27, 2003 John Kubiatowicz (http.cs.berkeley.edu/~kubitron) lecture slides: http://inst.eecs.berkeley.edu/~cs152/

More information

EE 109 Unit 13 MIPS Instruction Set. Instruction Set Architecture (ISA) Components of an ISA INSTRUCTION SET OVERVIEW

EE 109 Unit 13 MIPS Instruction Set. Instruction Set Architecture (ISA) Components of an ISA INSTRUCTION SET OVERVIEW 1 2 EE 109 Unit 13 MIPS Instruction Set Architecting a vocabulary for the HW INSTRUCTION SET OVERVIEW 3 4 Instruction Set Architecture (ISA) Defines the of the processor and memory system Instruction set

More information

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design

ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design ENGN1640: Design of Computing Systems Topic 03: Instruction Set Architecture Design Professor Sherief Reda http://scale.engin.brown.edu School of Engineering Brown University Spring 2014 Sources: Computer

More information

Typical Processor Execution Cycle

Typical Processor Execution Cycle Typical Processor Execution Cycle Instruction Fetch Obtain instruction from program storage Instruction Decode Determine required actions and instruction size Operand Fetch Locate and obtain operand data

More information

Instruction Set Architecture

Instruction Set Architecture C Fortran Ada etc. Basic Java Instruction Set Architecture Compiler Assembly Language Compiler Byte Code Nizamettin AYDIN naydin@yildiz.edu.tr http://www.yildiz.edu.tr/~naydin http://akademik.bahcesehir.edu.tr/~naydin

More information

Assembly Language. Prof. Dr. Antônio Augusto Fröhlich. Sep 2006

Assembly Language. Prof. Dr. Antônio Augusto Fröhlich.   Sep 2006 Sep 2006 Prof. Antônio Augusto Fröhlich (http://www.lisha.ufsc.br) 33 Assembly Language Prof. Dr. Antônio Augusto Fröhlich guto@lisha.ufsc.br http://www.lisha.ufsc.br/~guto Sep 2006 Sep 2006 Prof. Antônio

More information

Lecture 2: RISC V Instruction Set Architecture. Housekeeping

Lecture 2: RISC V Instruction Set Architecture. Housekeeping S 17 L2 1 18 447 Lecture 2: RISC V Instruction Set Architecture James C. Hoe Department of ECE Carnegie Mellon University Housekeeping S 17 L2 2 Your goal today get bootstrapped on RISC V RV32I to start

More information

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

Chapter 2. Instructions: Language of the Computer. Adapted by Paulo Lopes Chapter 2 Instructions: Language of the Computer Adapted by Paulo Lopes Instruction Set The repertoire of instructions of a computer Different computers have different instruction sets But with many aspects

More information

MIPS Assembly Language

MIPS Assembly Language MIPS Assembly Language Chapter 15 S. Dandamudi Outline MIPS architecture Registers Addressing modes MIPS instruction set Instruction format Data transfer instructions Arithmetic instructions Logical/shift/rotate/compare

More information