Instruction Set Architectures. Our Progress Done with levels 0 and 1 Seen multiple examples of level 2 Ready for ISA general principles.

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

Chapter 3 Instruction Set Architecture Advanced Computer Architecture COE 501.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
RISC / CISC Architecture By: Ramtin Raji Kermani Ramtin Raji Kermani Rayan Arasteh Rayan Arasteh An Introduction to Professor: Mr. Khayami Mr. Khayami.
INSTRUCTION SET ARCHITECTURES
Instruction Set Architecture Classification According to the type of internal storage in a processor the basic types are Stack Accumulator General Purpose.
Operand And Instructions Representation By Dave Maung.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
Chapter 5 A Closer Look at Instruction Set Architectures.
Implementation of a Stored Program Computer
A Closer Look at Instruction Set Architectures
Lecture 7: Instruction Set Architecture CSE 30: Computer Organization and Systems Programming Winter 2014 Diba Mirza Dept. of Computer Science and Engineering.
Operand Addressing and Instruction Representation
Lecture 17 Today’s Lecture –Instruction formats Little versus big endian Internal storage in the CPU: stacks vs. registers Number of operands and instruction.
Instruction Set Architecture
ITEC 352 Lecture 20 JVM Intro. Functions + Assembly Review Questions? Project due today Activation record –How is it used?
1/9/02CSE ISA's Instruction Set Architectures Part 1 I/O systemInstr. Set Proc. Compiler Operating System Application Digital Design Circuit Design.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
Cosc 2150: Computer Organization Chapter 5 Instruction Sets.
Chapter 5 A Closer Look at Instruction Set Architectures.
Chapter 5 A Closer Look at Instruction Set Architectures.
SG 5: FIT1001 Computer Systems S Important Notice for Lecturers This file is provided as an example only Lecturers are expected to modify / enhance.
Instruction Set Architecture Basics. Our Progress Done with levels 0 and 1 Seen multiple examples of level 2 Ready for ISA general principles.
Chapter 5 A Closer Look at Instruction Set Architectures.
Chapter 5 A Closer Look at Instruction Set Architectures.
Chapter 2-2 Assembly Instructions Number Systems Number Systems Assembly Instructions Assembly Instructions Branch Branch Next Lecture Next Lecture  Addressing.
Instruction Set Architecture Formats Speaker: Duc Nguyen Prof. Sin-Min Lee, CS 147, Fall 2009.
Instruction Set Architecture The portion of the machine visible to the programmer Issues: Internal storage model Addressing modes Operations Operands Encoding.
Differences in ISA Instruction length
Operand Addressing And Instruction Representation Cs355-Chapter 6.
Csci 136 Computer Architecture II – Summary of MIPS ISA Xiuzhen Cheng
Chapter 5 A Closer Look at Instruction Set Architectures.
CS 211: Computer Architecture Lecture 2 Instructor: Morris Lancaster.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Lecture 5 A Closer Look at Instruction Set Architectures Lecture Duration: 2 Hours.
Operand Addressing And Instruction Representation Tutorial 3.
Chapter 5 A Closer Look at Instruction Set Architectures.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
Chapter 5 A Closer Look at Instruction Set Architectures.
Chapter 5 A Closer Look at Instruction Set Architectures.
Computer Architecture & Operations I
Computer Architecture & Operations I
A Closer Look at Instruction Set Architectures
Assembly language.
Computer Organization
A Closer Look at Instruction Set Architectures
A Closer Look at Instruction Set Architectures
Architecture Review Instruction Set Architecture
A Closer Look at Instruction Set Architectures
An example of multiplying two numbers A = A * B;
Basics Of X86 Architecture
Instruction Set Architectures
Lecture 4: MIPS Instruction Set
Computer Organization and ASSEMBLY LANGUAGE
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Instruction Set Architectures Continued
ECEG-3202 Computer Architecture and Organization
A Closer Look at Instruction Set Architectures Chapter 5
ECEG-3202 Computer Architecture and Organization
Evolution of ISA’s ISA’s have changed over computer “generations”.
Overheads for Computers as Components 2nd ed.
Evolution of ISA’s ISA’s have changed over computer “generations”.
CPU Structure CPU must:
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Presentation transcript:

Instruction Set Architectures

Our Progress Done with levels 0 and 1 Seen multiple examples of level 2 Ready for ISA general principles

Choices, choices ISA design is a balancing act – Hardware complexity – Compiler complexity – Programmer friendliness – Backwards compatibility

Choice 0 : Instruction Length Will instructions be – Fixed length ARM Easier to decode – Variable length Intel Better use of space

Choice 1 : Memory Model Memory Model – Is the machine little endian or big endian?

Choice 1 : Memory Model Memory Model – Is the machine little endian or big endian? "Compute" Which is easier for programmers to read? Little Endian pmoC 0004\0etu Big Endian Comp 0004ute\0

Choice 1 : Memory Model Memory Model – Is the machine little endian or big endian? -16 (FFFFFFF0) followed by 5 ( ) Which is easier to convert int to char? Little Endian FF F Big Endian FF F

Who uses what? MARS is little endian – MIPS hardware is biendian

Choice 2 : CPU Storage How will CPU store data? – General Purpose vs Special Purpose Registers – How many?

Choice 2 : CPU Storage Accumulator architecture – Single Result Register – Shorter instructions Add X vs Add $9, $8, $7 – More fiddly to program

Choice 2 : CPU Storage General Purpose Registers – Any data (mostly) anywere – ARM style – More flexible/easier to program

Choice 2 : CPU Storage Special Purpose Registers – Intel: Some instructions must work with specific registers – Motorola: Separate data/address registers

Choice 2 : CPU Storage How many? – Fewer = more data shuffling – More = More hardware More bits eaten up in instructions – 8 registers = 3 bits – 16 registers = 4 bits – 32 regisers = 5 bits

Choice 3 : Addressing Modes How restricted are we to registers? Memory-Memory – Can work directly with memory in all instructions – Memory Address are BIG!!! Register-Memory (Intel) – At least one operand in register, other can be directly from memory Load-Store (ARM) – Only special load/store instructions can reference memory More Flexible More Complex

Choice 3 : Addressing Modes How can we address memory: – Directly MOV eax, [0x1040] – Indirectly LDR r0, [r1] 0x1040

Choice 4 : What Operations Lots of different instructions/formats? – CISC – More hardware – Shorter programs – Longer opcodes Fewer machine instructions – RISC 500 instructions * 4 addressing modes = 2000 instructions = 11 bit opcodes 100 instructions * 2 addressing modes = 200 instructions = 8 bit opcodes

Choice 3 : Number of Operands How many operands? – 0 : ADD Stack based operations – 1 : ADD 100 LMC – 2 : Add r2, r3 Intel – 3 : Add r2, r3, r4 Longer, More flexible Instructions

Examples 3 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R1,R2 MULT R3,R3,R4 ADD R1,R1,R3 STORE Z, R1 R1X R2Y R3W R4U

Examples 3 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R1,R2 MULT R3,R3,R4 ADD R1,R1,R3 STORE Z, R1 R1XY R2Y R3W R4U

Examples 3 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R1,R2 MULT R3,R3,R4 ADD R1,R1,R3 STORE Z, R1 R1XY R2Y R3WU R4U

Examples 3 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R1,R2 MULT R3,R3,R4 ADD R1,R1,R3 STORE Z, R1 R1XY + WU R2Y R3WU R4U

Examples 3 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R1,R2 MULT R3,R3,R4 ADD R1,R1,R3 STORE Z, R1 R1XY + WU R2Y R3WU R4U

2 Operand 2 Operand Instructions – First operand is source and destination ADD r1, r2 r1 = r1 + r2 – Intel style:

Examples 2 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R2 MULT R3,R4 ADD R1,R3 STORE Z, R1 R1X R2Y R3W R4U

Examples 2 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R2 MULT R3,R4 ADD R1,R3 STORE Z, R1 R1XY R2Y R3W R4U Destination always same as first operand

Examples 2 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R2 MULT R3,R4 ADD R1,R3 STORE Z, R1 R1XY R2Y R3WU R4U

Examples 2 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R2 MULT R3,R4 ADD R1,R3 STORE Z, R1 R1XY + WU R2Y R3WU R4U

Examples 2 Operand Instructions: Z = X  Y + W  U LOAD R1,X LOAD R2,Y LOAD R3,W LOAD R4,U MULT R1,R2 MULT R3,R4 ADD R1,R3 STORE Z, R1 R1XY + WU R2Y R3WU R4U

Examples 1 Operand Instructions - Accumulator Z = X  Y + W  U LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z ACX Destination assumed to be accumulator

Examples 1 Operand Instructions - Accumulator Z = X  Y + W  U LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z ACX*Y Destination assumed to be accumulator

Examples 1 Operand Instructions - Accumulator Z = X  Y + W  U LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z ACX*Y tempX*Y

Examples 1 Operand Instructions - Accumulator Z = X  Y + W  U LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z ACW tempX*Y

Examples 1 Operand Instructions - Accumulator Z = X  Y + W  U LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z ACW*U tempX*Y

Examples 1 Operand Instructions - Accumulator Z = X  Y + W  U LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z ACW*U + X*Y tempX*Y

Examples 1 Operand Instructions - Accumulator Z = X  Y + W  U LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z ACW*U + X*Y tempX*Y 7 trips to main memory!!!

Stack Based Stack based CPU storage – Loads place value on stack – Math operations pop top two values, work with them, push answer – Store pops value off stack

Choice 2 : CPU Storage Java bytecode is stack based language: Pro/Con + Instruction Size + Hardware neutrality - Does not take advantage of complex hardwar - Lots of memory access

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U PUSH X PUSH Y MULT PUSH W PUSH U MULT ADD STORE Z X Destination assumed to be top of stack

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U PUSH X PUSH Y MULT PUSH W PUSH U MULT ADD STORE Z Y X Destination assumed to be top of stack

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U PUSH X PUSH Y MULT PUSH W PUSH U MULT ADD STORE Z X * Y Take off top two items, multiply, put result back on stack

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U PUSH X PUSH Y MULT PUSH W PUSH U MULT ADD STORE Z W X * Y

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U PUSH X PUSH Y MULT PUSH W PUSH U MULT ADD STORE Z U W X * Y

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U PUSH X PUSH Y MULT PUSH W PUSH U MULT ADD STORE Z W * U X * Y Take off top two items, multiply, put result back on stack

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U PUSH X PUSH Y MULT PUSH W PUSH U MULT ADD STORE Z W * U + X * Y Take off top two items, add, put result back on stack

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U PUSH X PUSH Y MULT PUSH W PUSH U MULT ADD STORE Z trips to main memory (Mult/Add 2 or 3 each!)