Chapter 2 Instruction Set Principles and Examples

Size: px
Start display at page:

Download "Chapter 2 Instruction Set Principles and Examples"

Transcription

1 EEF011 Computer Architecture 計算機結構 Chapter 2 Instruction Set Principles and Examples 吳俊興高雄大學資訊工程學系 October 2004

2 Chapter 2. Instruction Set Principles and Examples 2.1 Introduction 2.2 Classifying Instruction Set Architectures 2.3 Memory Addressing 2.4 Addressing Modes for Signal Processing 2.5 Type and Size of Operands 2.6 Operands for Media and Signal Processing 2.7 Operations in the Instruction Set 2.8 Operations for Media and Signal Processing 2.9 Instructions for Control Flow 2.10 Encoding an Instruction Set 2

3 2.1 Introduction Instruction Set Architecture the portion of the machine visible to the assembly level programmer or to the compiler writer In order to use the hardware of a computer, we must speak its language The words of a computer language are called instructions, and its vocabulary is called an instruction set software hardware instruction set Instr. # Operation+Operands i movl -4(%ebp), %eax (i+1) addl %eax, (%edx) (i+2) cmpl 8(%ebp), %eax (i+3) jl L5 : L5: 3

4 Topics 1. A taxonomy of instruction set alternatives and qualitative assessment 2. Instruction set quantitative measurements 3. Specific instruction set architecture 4. Issues and bearings of languages and compilers 5. Examples: MIPS and Trimedia TM32 CPU Appendices C-F: MIPS, PowerPC, Precision Architecture, SPARC ARM, Hitachi SH, MIPS 16, Thumb 80x86 (App. D),IBM 360/370 (App. E), VAX (App. F) 4

5 2.2 Classifying Instruction Set Architectures Operand storage in CPU # explicit operands named per instruction Addressing mode Where are they other than memory How many? Min, Max, Average How the effective address for an operand calculated? Can all use any mode? Operations Type & size of operands What are the options for the opcode? How is typing done? How is the size specified? These choices critically affect number of instructions, CPI, and CPU cycle time 5

6 ISA Classification Most basic differentiation: internal storage in a processor Operands may be named explicitly or implicitly Major choices: 1. In an accumulator architecture one operand is implicitly the accumulator => similar to calculator 2. The operands in a stack architecture are implicitly on the top of the stack 3. The general-purpose register architectures have only explicit operands either registers or memory location 6

7 Basic ISA Classes ISA Type Stack Accumulator Register Examples B5500, B6500 HP 3000/70 Motorola ancient ones Set IBM 360 DEC VAX + all modern micro s Explicit operands perresult ALU inst. Destination or 3 Stack Accumulator Registers or Memory Operand access Method Push & Pop Stack Acc = Acc + mem[a] Rx = Ry + mem[a] Rx = Rx + Ry (2) Rx = Rx + Rz (3) Register-register, register-memory, and memory-memory (gone) options 7

8 Stack: Example 0 address add tos tos + next Accumulator: 1 address add A acc acc + mem[a] General Purpose Register (register-memory): 1 address add R1 A R1 R1 + mem[a] GPR (register-register or called load/store): 0 address load R1, A R1 mem[a] load R2, B add R3, R1, R2 R2 mem[b] R3 R1+R2 ALU Instructions can have two operands. ALU Instructions can have three operands. 8

9 Operand Locations and Code Sequence for C=A+B Stack Push A Push B Add Pop C Accumulator Load A Add B Store C GPR (register-memory) Load R1, A Add R1, B Store C, R1 GPR (load-store) Load R1, A Load R2, B Add R3, R1, R2 Store C, R3 9

10 Pro s and Con s ISA Type Stack Accumulator Register Advantages Simple effective address Short instructions Good code density Minimal internal state Fast context switch Short instructions Registers are faster than memory Registers can be used to hold variables +reduce memory traffic +speed up programs Registers are more efficient for a compiler to use than other forms of internal storage Disadvantages Lack of random access Efficient code is difficult to generate Stack is often a bottleneck Very high memory traffic Longer instructions Possibly complex effective address generation Size and structure of register set has many options Register is the class that won out! 10

11 Register Machines How many registers are sufficient? General-purpose registers vs. special-purpose registers compiler flexibility and hand-optimization Two major concerns for arithmetic and logical instructions (ALU) 1. Two or three operands X + Y X X + Y Z 2. How many of the operands may be memory addresses (0 3) Number of memory addresses Max number of operands allowed Examples Alpha, ARM, MIPS, PowerPC, Sparc, SuperH, Trimedia TM5200 IBM 360/370, Intel 80x86, Motorola 68000, TI TMS320C54x VAX, PDP-1, National 32x32, IBM 360SS VAX Hence, register classification (# mem, # operands) 11

12 (0, 3): Register-Register ALU is Register to Register also known as pure Reduced Instruction Set Computer (RISC) oadvantages simple fixed length instruction encoding decode is simple since instruction types are small simple code generation model instruction CPI tends to be very uniform except for memory instructions of course but there are only 2 of them - load and store odisadvantages instruction count tends to be higher some instructions are short - wasting instruction word bits 12

13 (1, 2): Register-Memory Evolved RISC and also old CISC new RISC machines capable of doing speculative loads predicated and/or deferred loads are also possible oadvantages data access to ALU immediate without loading first instruction format is relatively simple to encode code density is improved over Register (0, 3) model odisadvantages operands are not equivalent - source operand may be destroyed need for memory address field may limit # of registers CPI will vary if memory target is in L0 cache then not so bad if not - life gets miserable 13

14 (2, 2) or (3, 3): Memory-Memory True and most complex CISC model currently extinct and likely to remain so more complex memory actions are likely to appear but not directly linked to the ALU oadvantages most compact code doesn t waste registers for temporary values good idea for use once data - e.g. streaming media odisadvantages large variation in instruction size - may need a shoe-horn large variation in CPI - i.e. work per instruction exacerbates the infamous memory bottleneck register file reduces memory accesses if reused Not used today 14

15 2.3 Memory Addressing Interpreting Memory Addresses In today s machine, objects have byte addresses an address refers to the number of bytes counted from the beginning of memory Object Length: Provides access for bytes (8 bits), half words (16 bits), words (32 bits), and double words (64 bits). The type is implied in opcode (e.g., LDB load byte; LDW load word; etc.) Byte Ordering Little Endian: puts the byte whose address is xx00 at the least significant position in the word. (7,6,5,4,3,2,1,0) Big Endian: puts the byte whose address is xx00 at the most significant position in the word. (0,1,2,3,4,5,6,7) Problem occurs when exchanging data among machines with different orderings 15

16 Interpreting Memory Addresses Alignment Issues 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. Misalignment causes hardware complications, since the memory is typically aligned on a word or a double-word boundary Misalignment typically results in an alignment fault that must be handled by the OS Hence byte address is anything - never misaligned half word - even addresses - low order address bit = 0 ( XXXXXXX0) else trap word - low order 2 address bits = 0 ( XXXXXX00) else trap double word - low order 3 address bits = 0 (XXXXX000) else trap 16

17 Figure

18 Addressing Modes How do architectures specify the addr. of an object they will access? v v Effective address: the actual memory address specified by the addressing mode. -> is for assignment. Mem[R[R1]] refers to the contents of the memory location whose location is given the contents of register 1 (R1). 18

19 Figure 2.7 Summary of use of memory addressing modes Based on a VAX which supported everything from SPEC89 19

20 Displacement Addressing Mode How big should the displacement be? Figure 2.8 Displacement values are widely distributed 20

21 Displacement Addressing Mode (cont.) Benchmarks show 12 bits of displacement would capture about 75% of the full 32-bit displacements and 16 bits should capture about 99% Remember: optimize for the common case. Hence, the choice is at least bits For addresses that do fit in displacement size: Add R4, (R0) For addresses that don t fit in displacement size, the compiler must do the following: Load R1, Add Add R1, R0 R4, 0 (R1) 21

22 Immediate Addressing Mode Used where we want to get to a numerical value in an instruction Around 20% of the operations have an immediate operand At high level: a = b + 3; if ( a > 17 ) At Assembler level: Load R2, 3 Add R0, R1, R2 Load R2, 17 CMPBGT R1, R2 goto Addr Load Jump R1, Address (R1) 22

23 Immediate Addressing Mode How frequent for immediates? Figure 2.9 About one-quarter of data transfers and ALU operations have an immediate operand 23

24 Immediate Addressing Mode How big for immediates? Figure 2.10 Benchmarks show that 50%-70% of the immediates fit within 8 bits and 75%-80% fit within 16 bits 24

25 2.4 Addressing Modes for Signal Processing Two addressing modes that distinguish DSPs 1.Modulo or circular addressing mode autoincrement/autodecrement to support circular buffers As data are added, a pointer is checked to see if it is pointing to the end of the buffer If not, the pointer is incremented to the next address If it is, the pointer is set instead to the start of the buffer 2.Bit reverse addressing mode the hardware reverses the lower bits of the address, with the number of bits reversed depending on the step of the FFT algorithm 25

26 Addressing for Fast Fourier Transform (FFT) FFTs start or end their processing with data shuffled in a particular order Without special support, such address transformations would take an extra memory access to get the new address, or involve a fair amount of logical instructions to transform the address 0 (000 2 ) 1 (001 2 ) 2 (010 2 ) 3 (011 2 ) 4 (100 2 ) 5 (101 2 ) 6 (110 2 ) 7 (111 2 ) => => => => => => => => 0 (000 2 ) 4 (100 2 ) 2 (010 2 ) 6 (110 2 ) 1 (001 2 ) 5 (101 2 ) 3 (011 2 ) 7 (111 2 ) 26

27 Figure 2.11 Static Frequency of Addressing Modes for TI TMS320C54x DSP 17 addressing modes, 6 modes also found in Figure 2.6 account for 95% of the DSP addressing 27

28 Summary: Memory Addressing A new architecture expected to support at least: displacement, immediate, and register indirect represent 75% to 99% of the addressing modes (Figure 2.7) The size of the address for displacement mode to be at least bits capture 75% to 99% of the displacements (Figure 2.8) The size of the immediate field to be at least 8-16 bits capture 50% to 80% of the immediates (Figure 2.10) Desktop and server processors rely on compilers, but historically DSPs rely on hand-coded libraries 28

29 2.5 Type And Size of Operands How is the type of an operand designated? The type of the operand is usually encoded in the opcode e.g., LDB load byte; LDW load word Common operand types: (imply their sizes) Character (8 bits or 1 byte) Half word (16 bits or 2 bytes) Word (32 bits or 4 bytes) Double word (64 bits or 8 bytes) Single precision floating point (4 bytes or 1 word) Double precision floating point (8 bytes or 2 words) Characters are almost always in ASCII 16-bit Unicode (used in Java) is gaining popularity Integers are two s complement binary Floating points follow the IEEE standard 754 Some architectures support packed decimal: 4 bits are used to encode the values 0-9; 2 decimal digits are packed into each byte 29

30 Figure 2.12 Distribution of data accesses by size for the benchmark programs SPEC2000 Operand Sizes The double-word data type is used for double-precision floating point in floating-point programs and for addresses 30

31 2.6 Operands for Media and Signal Processing Vertex A common 3D data type dealt in graphics applications four components: (x, y, z) and w=color or hidden surfaces vertex values are usually 32-bit floating-point values Three vertices specify a graphics primitive such as a triangle Pixel Typically 32 bits, consisting of four 8-bit channels R (red), G (green), B (blue), and A (attribute: eg. transparency) DSPs add fixed point fractions between -1 and +1 (divide by 2 n-1 ) Blocked floating point a block of variables with common exponent accumulators, registers that are wider to guard against round-off error to aid accuracy in fixed-point arithmetic 31

32 Size of Data operands for DSP Figure 2.13 Four generations of DSPs, their data width, and the width of the registers that reduces round-off error Figure 2.14 Size of data operands for TMS320C540x DSP. This DSP has two 40-bit accumulators and no floating-point operations. 32

33 Brief Summary Review instruction set classes choose register-register class Review memory addressing select displacement, immediate, and register indirect addressing modes Select the operand sizes and types 33

34 2.7 Operations in the Instruction Set Figure 2.15 Categories of instruction operators and examples of each. All computers generally provide a full set of operations for the first three categories All computers must have some instruction support for basic system functions Graphics instructions typically operate on many smaller data items in parallel 34

35 Figure 2.16 Top 10 instructions for the 80x86 Simple instructions dominate this list and responsible for 96% of the instructions executed These percentages are the average of the five SPECint 92 programs 35

36 2.8 Operations for Media & Signal Processing Data for multimedia operations is often narrower than the 64-bit data word normally in single precision, not double precision Single-instruction multiple-data (SIMD) or vector instructions A partitioned add operation on 16-bit data with a 64-bit ALU would perform four 16-bit adds in a single clock cycle Hardware cost: prevent carries between the four 16-bit partitions of the ALU Two 32-bit floating-point operations (paired single operations) The two partitions must be insulated to prevent operations on one half from affecting the other 36

37 Figure 2.17 Summary of multimedia support for desktop RISCs B: byte (8 bits), H: half word (16 bits), W: word (32 bits) 8B: operation on 8 bytes in a single instruction All are fixed-width operations, performing multiple narrow operations on either a 64-bit or 128-bit ALU 37

38 Multimedia Operations for DSPs DSP architectures use saturating arithmetic If the result is too large to be represented, it is set to the largest representable number There is not an option of causing an exception on arithmetic overflow Prevent missing an event in real-time applications The result will be used no matter what the inputs There are several modes to round the wider accumulators into the narrower data words The targeted kernels for DSPs accumulate a series of produces, and hence have a multiply-accumulate (MAC) instruction MACs are key to dot product operations for vector and matrix multiplies Finite Impulse Response (FIR) Problem y[n] = Σ c[k] * x[n-k] In C: y[n] = 0 for(k=0; k <N; k++) y[n] = y[n] + c[k]*x[n-k] General form: x = x + y * z IBM PowerPC 440 MAC instruction: macchw RT, RA, RB where RT = x, RA = y, RB = z 38

39 Figure 2.18 Mix of instructions for TMS320C540x DSP 16-bit architecture use two 40-bit accumulators, 8 address registers, no floating-point operations (fixed points instead), plus a stack for passing parameters to library routines and for saving return addresses 15% to 20% of the multiplies and MACs round the final sum (not shown) 39

40 2.9 Instructions for Control Flow q Control instructions change the flow of control: instead of executing the next instruction, the program branches to the address specified in the branching instructions q They are a big deal Primarily because they are difficult to optimize out AND they are frequent q Four types of control instructions Conditional branches Jumps unconditional transfer Procedure calls Procedure returns 40

41 Control Flow Instructions q Issues: Where is the target address? How to specify it? Where is return address kept? How are the arguments passed? (calls) Where is return address? How are the results passed? (returns) q Figure 2.19 Breakdown 41

42 Addressing Modes for Control Flow Instructions PC-relative (Program Counter) supply a displacement added to the PC Known at compile time for jumps, branches, and calls (specified within the instruction) the target is often near the current instruction requiring fewer bits independently of where it is loaded (position independence) Register indirect addressing dynamic addressing The target address may not be known at compile time Naming a register that contains the target address Case or switch statements Virtual functions or methods High-order functions or function pointers Dynamically shared libraries 42

43 Figure 2.20 Branch distances These measurements were taken on a load-store computer (Alpha architecture) with all instructions aligned on word boundaries 43

44 Conditional Branch Options Figure 2.21 Major methods for evaluating branch conditions 44

45 Figure 2.22 Comparison Type vs. Frequency Most loops go from 0 to n. Most backward branches are loops taken about 90% Program % backward branches % all control instructions that modify PC gcc 26% 63% spice 31% 63% TeX 17% 70% Average 25% 65% 45

46 Repeat Instruction for DSP DSPs: add looping structure, called a repeat instruction, to avoid loop overhead It allows a single instruction or a block of instructions to be repeated up to, say, 256 times eg. TMS320C54 dedicates three special registers to hold the block starting address, ending address, and repeat counter 46

47 Procedure Invocation Options Procedure calls and returns control transfer state saving; the return address must be saved Newer architectures require the compiler to generate stores and loads for each register saved and restored Two basic conventions in use to save registers caller saving: the calling procedure must save the registers that it wants preserved for access after the call the called procedure need not worry about registers callee saving: the called procedure must save the registers it wants to use leaving the caller unrestrained most real systems today use a combination of the two mechanisms specified in an application binary interface (ABI) that set down the basic rules as to which register be caller saved and which should be callee saved 47

48 2.10 Encoding an Instruction Set Figure 2.23 Three basic variations in instruction encoding The length of 80x86 instructions varies between 1 and 17 bytes Trade-off: size of programs vs. ease of decoding Opcode: specifying the operation # of operand addressing mode address specifier: tells what addressing mode is used Load-store computer Only one memory operand Only one or two addressing modes Encoding issues 1.The desire to have as many registers and addressing modes as possible 2.The impact of the size of the register and addressing mode fields on the average instruction size and hence on the average program size 3.A desire to have instructions encoded into lengths that will be easy to handle in a pipelined implementation 48

49 Instruction formats for desktop/server RISC architectures 49

50 Reduced Code Size in RISCs Hybrid encoding support 16-bit and 32-bit instructions in RISC, eg. ARM Thumb and MIPS 16 narrow instructions support fewer operations, smaller address and immediate fields, fewer registers, and two-address format rather than the classic three-address format claim a code size reduction of up to 40% Compression in IBM s CodePack Adds hardware to decompress instructions as they are fetched from memory on an instruction cache miss The instruction cache contains full 32-bit instructions, but compressed code is kept in main memory, ROMs, and the disk Hitachi s SuperH: fixed 16-bit format 16 rather than 32 registers fewer instructions 50

51 2.11 The Role of Compilers q Today almost all programming is done in high-level languages. As such, an ISA is essentially a complier target. q Because performance of a computer will be significantly affected by the compiler, understanding compiler technology today is critical to designing and efficiently implementing an IS. q Compiler goals: All correct programs execute correctly Most compiled programs execute fast (optimizations) Fast compilation Debugging support 51

52 Typical Modern Compiler Structure C, Fortran, or Cobol, etc. Object Code 52

53 Optimization Types High level done at or near source code level If procedure is called only once, put it in-line and save CALL more general case: if call-count < some threshold, put them in-line Local done within straight-line code common sub-expressions produce same value either allocate a register or replace with single copy constant propagation replace constant valued variable with the constant stack height reduction re-arrange expression tree to minimize temporary storage needs Global across a branch copy propagation replace all instances of a variable A that has been assigned X (i.e., A=X) with X. code motion remove code from a loop that computes same value each iteration of the loop and put it before the loop simplify or eliminate array addressing calculations in loops 53

54 Optimization Types Machine-dependent optimizations based on machine knowledge strength reduction replace multiply by a constant with shifts and adds would make sense if there was no hardware support for MUL a trickier version: 17 = arithmetic left shift 4 and add pipelining scheduling reorder instructions to improve pipeline performance dependency analysis branch offset optimization - reorder code to minimize branch offsets 54

55 Complier Optimizations Change in IC L0 unoptimized L1 local opts, code scheduling, & local reg. allocation L2 global opts and loop transformations, & global reg. Allocation L3 procedure integration 55

56 The Impact of Compiler Technology How are variables allocated and addressed? How many registers are needed to allocate variables appropriately? Three separate areas for data allocation Stack Used to allocate local variables Grown and shrunk on calls and returns Addressing is relative to the stack pointer Global data area Heap Used to allocate statically declared objects, such as global variables and constants A large percentage of these objects are aggregate data structures such as arrays Used to allocate dynamic objects Access are usually by pointers Data is typically not scalars (single variables) 56

57 Register Allocation Problem Reasonably simple for stack-allocated objects Done with the graph coloring theory: variable vertex; dependency between variables edge; # register will be equal to # colors Essentially impossible for heap-allocated objects because they are accessed with pointers Hard for global variables and some static variables due to aliasing opportunity There are multiple ways to refer to the address of a variable b p b = = p 2... b... & b = 3 57

58 How do you help the compiler writer? Key: make the frequent cases fast and the rare case correct Guidelines that will make it easy to write a complier Regularity Addressing modes, operations, and data types should be independent of each other Provide primitives, not solution What works in one language may be detrimental to others, so don t optimize for one particular language Simplify trade-offs among alternatives Anything that makes code sequence performance obvious is a definite win! Provide instructions that bind the quantities known at compile time as constants 58

59 2.12 The MIPS64 Architecture A Typical General-Purpose Load-Store Architecture q Registers 32 integer - 64-bit integer registers (R0:R31) R0 is always equal to 0 and the rest are general purpose 32 FP registers (F0:F31) Contains a single 32-bit or a single 64-bit float q Data Types byte, half word, word, double word q Instructions 32-bit long Fixed length: 4 bytes, 3 instruction types ==> easy decode Overall goal: simple ==> pipeline ease ==> performance 59

60 MIPS64 Operations q Key features addressing modes for data Displacement (size bits) Immediate (size 8-16 bits) Register indirect: placing 0 in the 16-bit displacement field Absolute addressing: using R0 as the base register conditional branches Test the register source for zero or nonzero (compare equal); or Compare 2 registers (compare less) If satisfied, then jump PC+4+immeidate (size 8 bits long) jump, call, and return floats - usual set of operations.s for single precision (32-bit).D for double precision (64-bit) 60

61 qnote: 16 bit immediate: Immediate data and PC-relative offset for short jumps and conditional branches. Instruction Format Fixed length with 3 types 26 bit PC-relative offset for calls and returns (regular or traps) and long jumps. 61

62 MIPS64 Operations ( load and store) Example instruction LD R1, 30(R2) LD R1, 1000(R0) LW R1, 30(R2) LB R1, 30(R2) L.S F0, 30(R2) L.D F0, 30(R2) Instruction name Load double word Load double word Load word Load byte Load FP single Load FP double Meaning Regs[R1] 64 Mem[30+Regs[R2]] Regs[R1] 64 Mem[1000+0] Regs[R1] 64 (Mem[30+Regs[R2]] 0 ) 32 ## Mem[30+Regs[R2]] Regs[R1] 64 (Mem[30+Regs[R2]] 0 ) 56 ## Mem[30+Regs[R2]] Regs[F0] 64 Mem[30+Regs[R2]]##0 32 Regs[F0] 64 Mem[30+Regs[R2]] SD R3, 500(R4) SW R3, 500(R4) SH R3, 500(R4) SB R3, 500(R4) S.S F0, 500(R4) S.D F0, 500(R4) Store double word Store word Store half word Store byte Store FP single Store FP double Mem[500+Regs[R4]] 64 Regs[R3] Mem[500+Regs[R4]] 32 Regs[R3] Mem[500+Regs[R4]] 16 Regs[R3] Mem[500+Regs[R4]] 8 Regs[R3] Mem[500+Regs[R4]] 32 Regs[F0] Mem[500+Regs[R4]] 16 Regs[F0] 62

63 MIPS64 Operations ( load and store) Illustration legends: F F F F F A subscript is appended to the symbol whenever the length of the datum being transferred might not be clear. Thus, n means transfer an n-bit quantity. A subscript is used to indicate selection of a bit from a filed. Bits are labeled from the most significant bit starting at 0. F(Mem[30+Regs[R2]] 0 ) 32 : replicating the sign bit for 32 times The variable Mem, used as an array that stands for main memory, is indexed a byte address and may transfer any number of bytes. A superscript is used to replicate a filed. The symbol ## is used to concatenate two fields and may appear on either sideof a data transfer. 63

64 MIPS64 Operations ( A/L w/o immediate ) Example instruction DADDU R1, R2, R3 DADDI R1, R1, #-3 LUI R1, #88 DSLL R1,R2, #3 DSLT R1,R2,R3 Instruction name Add unsigned Add immediate Load upper immediate Shift left logic Set less than Meaning Regs[R1] Regs[R2]+Regs[R3] Regs[R1] Regs[R1]-3 Regs[R1] 0 32 ## 88 ## 0 16 Regs[R1] Regs[R2]<<3 If (Regs[R2]<Regs[R3]) Regs[R1] 1 else Regs[R1] 0 <<: logical shift left 64

65 MIPS64 Operations ( flow control) Example instruction J name JAL name JALR R2 JR R3 BEQZ R4, name BNE R3, R4, name MOVZ R1, R2, R3 Instruction name Jump Jump and link Jump and link register Jump register Branch equal zero Branch not equal zero Conditional move if zero Meaning PC name; ((PC+4) 2 25 ) name < ((PC+4)+2 25 ) Regs[R31] PC+4; PC name; ((PC+4) 2 25 ) name < ((PC+4)+2 25 ) Regs[R31] PC+4; PC Regs[R2] PC Regs[R3] If (Regs[R4] == 0) PC name; ((PC+4) 2 15 ) name < ((PC+4)+2 15 ) If (Regs[R3]!= Regs[R4]) PC name; ((PC+4) 2 15 ) name < ((PC+4)+2 15 ) If (Regs[R3] == 0) Regs[R1] Regs[R2] 65

66 Summary Chapter 2 Instruction Set Principles and Examples 2.1 Introduction 2.2 Classifying Instruction Set Architectures 2.3 Memory Addressing 2.4 Addressing Modes for Signal Processing 2.5 Type and Size of Operands 2.6 Operands for Media and Signal Processing 2.7 Operations in the Instruction Set 2.8 Operations for Media and Signal Processing 2.9 Instructions for Control Flow 2.10 Encoding an Instruction Set 2.11 The Role of Compilers 2.12 The MIPS Architecture 66

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

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

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

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

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

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

Graduate Computer Architecture. Chapter 2. Instruction Set Principles

Graduate Computer Architecture. Chapter 2. Instruction Set Principles Graduate Computer Architecture Chapter 2 Instruction Set Principles 1 Outline Classifying instruction set architectures Memory addressing Addressing modes Type and size of operands Instructions for control

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

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

Lecture 04: ISA Principles CSE 564 Computer Architecture Summer 2017

Lecture 04: ISA Principles CSE 564 Computer Architecture Summer 2017 Lecture 04: ISA Principles CSE 564 Computer Architecture Summer 2017 Department of Computer Science and Engineering Yonghong Yan yan@oakland.edu www.secs.oakland.edu/~yan 1 Contents 1. Introduc@on 2. Classifying

More information

Instruction Set Architecture ISA ISA

Instruction Set Architecture ISA ISA Instruction Set Architecture ISA Today s topics: Note: desperate attempt to get back on schedule we won t cover all of these slides use for reference Risk vs. CISC x86 does both ISA influence on performance

More information

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing UNIVERSIDADE TÉCNICA DE LISBOA INSTITUTO SUPERIOR TÉCNICO Departamento de Engenharia Informática for Embedded Computing MEIC-A, MEIC-T, MERC Lecture Slides Version 3.0 - English Lecture 03 Title: Processor

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

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

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

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

COSC 6385 Computer Architecture. Defining Computer Architecture

COSC 6385 Computer Architecture. Defining Computer Architecture COSC 6385 Computer rchitecture Defining Computer rchitecture Fall 007 icro-processors in today s world arkets Desktop computing Servers Embedded computers Characteristics Price vailability Reliability

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

COSC 6385 Computer Architecture - Instruction Set Principles

COSC 6385 Computer Architecture - Instruction Set Principles COSC 6385 Computer rchitecture - Instruction Set Principles Fall 2006 Organizational Issues September 4th: no class (labor day holiday) Classes of onday Sept. 11 th and Wednesday Sept. 13 th have to be

More information

ECE 486/586. Computer Architecture. Lecture # 7

ECE 486/586. Computer Architecture. Lecture # 7 ECE 486/586 Computer Architecture Lecture # 7 Spring 2015 Portland State University Lecture Topics Instruction Set Principles Instruction Encoding Role of Compilers The MIPS Architecture Reference: Appendix

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

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

Systems Architecture I

Systems Architecture I Systems Architecture I Topics Assemblers, Linkers, and Loaders * Alternative Instruction Sets ** *This lecture was derived from material in the text (sec. 3.8-3.9). **This lecture was derived from material

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

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

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

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

Virtual Machines and Dynamic Translation: Implementing ISAs in Software

Virtual Machines and Dynamic Translation: Implementing ISAs in Software Virtual Machines and Dynamic Translation: Implementing ISAs in Software Krste Asanovic Laboratory for Computer Science Massachusetts Institute of Technology Software Applications How is a software application

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

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

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

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

Lecture 3 Machine Language. Instructions: Instruction Execution cycle. Speaking computer before voice recognition interfaces Lecture 3 Machine Language Speaking computer before voice recognition interfaces 1 Instructions: Language of the Machine More primitive than higher level languages e.g., no sophisticated control flow Very

More information

Lecture 4: Instruction Set Design/Pipelining

Lecture 4: Instruction Set Design/Pipelining Lecture 4: Instruction Set Design/Pipelining Instruction set design (Sections 2.9-2.12) control instructions instruction encoding Basic pipelining implementation (Section A.1) 1 Control Transfer Instructions

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

Computer Systems Architecture I. CSE 560M Lecture 3 Prof. Patrick Crowley

Computer Systems Architecture I. CSE 560M Lecture 3 Prof. Patrick Crowley Computer Systems Architecture I CSE 560M Lecture 3 Prof. Patrick Crowley Plan for Today Announcements Readings are extremely important! No class meeting next Monday Questions Commentaries A few remaining

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

EC 413 Computer Organization

EC 413 Computer Organization EC 413 Computer Organization Review I Prof. Michel A. Kinsy Computing: The Art of Abstraction Application Algorithm Programming Language Operating System/Virtual Machine Instruction Set Architecture (ISA)

More information

Instruction Set Architectures

Instruction Set Architectures Lecture 2 Instruction Set Architectures Dr. Soner Onder CS 4431 Michigan Technological University 09/04/12 1 Instruction Set Architecture (ISA) 1950s to 1960s: Computer Architecture Course Computer Arithmetic

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

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

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

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

Chapter 2: Instructions How we talk to the computer

Chapter 2: Instructions How we talk to the computer Chapter 2: Instructions How we talk to the computer 1 The Instruction Set Architecture that part of the architecture that is visible to the programmer - instruction formats - opcodes (available instructions)

More information

CPE 631 Lecture 08: Virtual Memory

CPE 631 Lecture 08: Virtual Memory Lecture 08: Virtual Virtual : Topics Why virtual memory? Virtual to physical address translation Page Table Translation Lookaside Buffer (TLB) Aleksandar Milenković, milenka@ece.uah.edu Electrical and

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

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

Slides for Lecture 6

Slides for Lecture 6 Slides for Lecture 6 ENCM 501: Principles of Computer Architecture Winter 2014 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 28 January,

More information

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

CHAPTER 2: INSTRUCTION SET PRINCIPLES. Prepared by Mdm Rohaya binti Abu Hassan CHAPTER 2: INSTRUCTION SET PRINCIPLES Prepared by Mdm Rohaya binti Abu Hassan Chapter 2: Instruction Set Principles Instruction Set Architecture Classification of ISA/Types of machine Primary advantages

More information

CPE300: Digital System Architecture and Design

CPE300: Digital System Architecture and Design CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Arithmetic Unit 10032011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Recap Chapter 3 Number Systems Fixed Point

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

Instructions: Assembly Language

Instructions: Assembly Language Chapter 2 Instructions: Assembly Language Reading: The corresponding chapter in the 2nd edition is Chapter 3, in the 3rd edition it is Chapter 2 and Appendix A and in the 4th edition it is Chapter 2 and

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

Lecture 3: Instruction Set Architecture

Lecture 3: Instruction Set Architecture Lecture 3: Instruction Set Architecture Interface Software/compiler instruction set hardware Design Space of ISA Five Primary Dimensions Number of explicit operands ( 0, 1, 2, 3 ) Operand Storage Where

More information

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

Machine Language Instructions Introduction. Instructions Words of a language understood by machine. Instruction set Vocabulary of the machine Machine Language Instructions Introduction Instructions Words of a language understood by machine Instruction set Vocabulary of the machine Current goal: to relate a high level language to instruction

More information

Lecture 3: The Instruction Set Architecture (cont.)

Lecture 3: The Instruction Set Architecture (cont.) Lecture 3: The Instruction Set Architecture (cont.) COS / ELE 375 Computer Architecture and Organization Princeton University Fall 2015 Prof. David August 1 Review: Instructions Computers process information

More information

Lecture 3: The Instruction Set Architecture (cont.)

Lecture 3: The Instruction Set Architecture (cont.) Lecture 3: The Instruction Set Architecture (cont.) COS / ELE 375 Computer Architecture and Organization Princeton University Fall 2015 Prof. David August 1 Review: Instructions Computers process information

More information

ECE 486/586. Computer Architecture. Lecture # 8

ECE 486/586. Computer Architecture. Lecture # 8 ECE 486/586 Computer Architecture Lecture # 8 Spring 2015 Portland State University Lecture Topics Instruction Set Principles MIPS Control flow instructions Dealing with constants IA-32 Fallacies and Pitfalls

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

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

Lecture Topics. Branch Condition Options. Branch Conditions ECE 486/586. Computer Architecture. Lecture # 8. Instruction Set Principles.

Lecture Topics. Branch Condition Options. Branch Conditions ECE 486/586. Computer Architecture. Lecture # 8. Instruction Set Principles. ECE 486/586 Computer Architecture Lecture # 8 Spring 2015 Portland State University Instruction Set Principles MIPS Control flow instructions Dealing with constants IA-32 Fallacies and Pitfalls Reference:

More information

Thomas Polzer Institut für Technische Informatik

Thomas Polzer Institut für Technische Informatik Thomas Polzer tpolzer@ecs.tuwien.ac.at Institut für Technische Informatik Branch to a labeled instruction if a condition is true Otherwise, continue sequentially beq rs, rt, L1 if (rs == rt) branch to

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

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

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 Topic Notes: MIPS Instruction Set Architecture vonneumann Architecture Modern computers use the vonneumann architecture. Idea:

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

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

計算機結構 Chapter 4 Exploiting Instruction-Level Parallelism with Software Approaches

計算機結構 Chapter 4 Exploiting Instruction-Level Parallelism with Software Approaches 4.1 Basic Compiler Techniques for Exposing ILP 計算機結構 Chapter 4 Exploiting Instruction-Level Parallelism with Software Approaches 吳俊興高雄大學資訊工程學系 To avoid a pipeline stall, a dependent instruction must be

More information

Storage I/O Summary. Lecture 16: Multimedia and DSP Architectures

Storage I/O Summary. Lecture 16: Multimedia and DSP Architectures Storage I/O Summary Storage devices Storage I/O Performance Measures» Throughput» Response time I/O Benchmarks» Scaling to track technological change» Throughput with restricted response time is normal

More information

Evolution of ISAs. Instruction set architectures have changed over computer generations with changes in the

Evolution of ISAs. Instruction set architectures have changed over computer generations with changes in the Evolution of ISAs Instruction set architectures have changed over computer generations with changes in the cost of the hardware density of the hardware design philosophy potential performance gains One

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 Architecture. Chapter 2-2. Instructions: Language of the Computer

Computer Architecture. Chapter 2-2. Instructions: Language of the Computer Computer Architecture Chapter 2-2 Instructions: Language of the Computer 1 Procedures A major program structuring mechanism Calling & returning from a procedure requires a protocol. The protocol is a sequence

More information

Communicating with People (2.8)

Communicating with People (2.8) Communicating with People (2.8) For communication Use characters and strings Characters 8-bit (one byte) data for ASCII lb $t0, 0($sp) ; load byte Load a byte from memory, placing it in the rightmost 8-bits

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

General Purpose Processors

General Purpose Processors Calcolatori Elettronici e Sistemi Operativi Specifications Device that executes a program General Purpose Processors Program list of instructions Instructions are stored in an external memory Stored program

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 2: Hardware/Software Interface Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Basic computer components How does a microprocessor

More information

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

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI To study Chapter 2: CSCI 402: Computer Architectures Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI Contents 2.1-2.3 Introduction to what is

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

Instruction Set Architecture

Instruction Set Architecture Computer Architecture Instruction Set Architecture Lynn Choi Korea University Machine Language Programming language High-level programming languages Procedural languages: C, PASCAL, FORTRAN Object-oriented

More information

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types Instruction Sets Ch 10-11 Characteristics Operands Operations Addressing Instruction Formats Instruction Set Collection of instructions that CPU understands Only interface to CPU from outside CPU executes

More information

Advanced Computer Architecture

Advanced Computer Architecture ECE 563 Advanced Computer Architecture Fall 2007 Lecture 14: Virtual Machines 563 L14.1 Fall 2009 Outline Types of Virtual Machine User-level (or Process VMs) System-level Techniques for implementing all

More information

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

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 MIPS Intro Adapted from slides developed for: Mary J. Irwin PSU CSE331 Dave Patterson s UCB CS152 M230 L09.1 Smith Spring 2008 MIPS

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 4: MIPS Instructions Adapted from Computer Organization and Design, Patterson & Hennessy, UCB From Last Time Two values enter from the left (A and B) Need

More information

Chapter 13 Reduced Instruction Set Computers

Chapter 13 Reduced Instruction Set Computers Chapter 13 Reduced Instruction Set Computers Contents Instruction execution characteristics Use of a large register file Compiler-based register optimization Reduced instruction set architecture RISC pipelining

More information

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

Stored Program Concept. Instructions: Characteristics of Instruction Set. Architecture Specification. Example of multiple operands Stored Program Concept Instructions: Instructions are bits Programs are stored in memory to be read or written just like data Processor Memory memory for data, programs, compilers, editors, etc. Fetch

More information

COMPUTER ORGANIZATION & ARCHITECTURE

COMPUTER ORGANIZATION & ARCHITECTURE COMPUTER ORGANIZATION & ARCHITECTURE Instructions Sets Architecture Lesson 5a 1 What are Instruction Sets The complete collection of instructions that are understood by a CPU Can be considered as a functional

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

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 199 5.2 Instruction Formats 199 5.2.1 Design Decisions for Instruction Sets 200 5.2.2 Little versus Big Endian 201 5.2.3 Internal

More information

Forecast. Instructions (354 Review) Basics. Basics. Instruction set architecture (ISA) is its vocabulary. Instructions are the words of a computer

Forecast. Instructions (354 Review) Basics. Basics. Instruction set architecture (ISA) is its vocabulary. Instructions are the words of a computer Instructions (354 Review) Forecast Instructions are the words of a computer Instruction set architecture (ISA) is its vocabulary With a few other things, this defines the interface of computers But implementations

More information

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing

INSTITUTO SUPERIOR TÉCNICO. Architectures for Embedded Computing UNIVERSIDADE TÉCNICA DE LISBOA INSTITUTO SUPERIOR TÉCNICO Departamento de Engenharia Informática Architectures for Embedded Computing MEIC-A, MEIC-T, MERC Lecture Slides Version 3.0 - English Lecture 04

More information

MIPS R-format Instructions. Representing Instructions. Hexadecimal. R-format Example. MIPS I-format Example. MIPS I-format Instructions

MIPS R-format Instructions. Representing Instructions. Hexadecimal. R-format Example. MIPS I-format Example. MIPS I-format Instructions Representing Instructions Instructions are encoded in binary Called machine code MIPS instructions Encoded as 32-bit instruction words Small number of formats encoding operation code (opcode), register

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set?

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set? COMP 212 Computer Organization & Architecture Quiz COMP 212 Fall 2008 Lecture 7 Fill in your student number only, do NOT write down your name Open book, but NO calculator, NO discussions, Relax and have

More information

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

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture Computer Science 324 Computer Architecture Mount Holyoke College Fall 2009 Topic Notes: MIPS Instruction Set Architecture vonneumann Architecture Modern computers use the vonneumann architecture. Idea:

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

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

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

Processor Architecture. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Processor Architecture Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Moore s Law Gordon Moore @ Intel (1965) 2 Computer Architecture Trends (1)

More information

EITF20: Computer Architecture Part2.2.1: Pipeline-1

EITF20: Computer Architecture Part2.2.1: Pipeline-1 EITF20: Computer Architecture Part2.2.1: Pipeline-1 Liang Liu liang.liu@eit.lth.se 1 Outline Reiteration Pipelining Harzards Structural hazards Data hazards Control hazards Implementation issues Multi-cycle

More information

CS429: Computer Organization and Architecture

CS429: Computer Organization and Architecture CS429: Computer Organization and Architecture Warren Hunt, Jr. and Bill Young Department of Computer Sciences University of Texas at Austin Last updated: October 1, 2014 at 12:03 CS429 Slideset 6: 1 Topics

More information