Instruction Set Architectures

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
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.
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.
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.
Differences in ISA Instruction length
Operand Addressing And Instruction Representation Cs355-Chapter 6.
Chapter 5 A Closer Look at Instruction Set Architectures.
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.
What is a program? A sequence of steps
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.
Instruction Set Architectures. 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.
Displacement (Indexed) Stack
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
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
An example of multiplying two numbers A = A * B;
A Closer Look at Instruction Set Architectures: Expanding Opcodes
Basics Of X86 Architecture
William Stallings Computer Organization and Architecture 8th Edition
MIPS Assembly.
Lecture 4: MIPS Instruction Set
Computer Organization and ASSEMBLY LANGUAGE
CISC AND RISC SYSTEM Based on instruction set, we broadly classify Computer/microprocessor/microcontroller into CISC and RISC. CISC SYSTEM: COMPLEX INSTRUCTION.
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
Overheads for Computers as Components 2nd ed.
Introduction to Microprocessor Programming
Evolution of ISA’s ISA’s have changed over computer “generations”.
CPU Structure CPU must:
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Introduction to Assembly Chapter 2
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 "Compute" Is the machine little endian or big endian? "Compute" Which is easier for programmers to read? Big Endian +0 +1 +2 +3 0000 C o m p 0004 u t e \0 Little Endian +3 +2 +1 +0 0000 p m o C 0004 \0 e t u

Choice 1 : Memory Model Memory Model Is the machine little endian or big endian? -16 (FFFFFFF0) followed by 5 (00000005) Which is easier to convert int to char? Big Endian +0 +1 +2 +3 0000 FF F0 0004 00 05 Little Endian +3 +2 +1 +0 0000 FF F0 0004 00 05

Who uses what? ARM was little endian up to v3 Now can be used little or big

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 R1 X R2 Y R3 W R4 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 R1 X R2 Y R3 W R4 U

Examples 3 Operand Instructions: Z = X  Y + W  U R1 XY R2 Y R3 W R4 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 R1 XY R2 Y R3 W R4 U

Examples 3 Operand Instructions: Z = X  Y + W  U R1 XY R2 Y R3 WU R4 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 R1 XY R2 Y R3 WU R4 U

Examples 3 Operand Instructions: Z = X  Y + W  U R1 XY + WU R2 Y R3 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 R1 XY + WU R2 Y R3 WU R4 U

Examples 3 Operand Instructions: Z = X  Y + W  U R1 XY + WU R2 Y R3 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 R1 XY + WU R2 Y R3 WU R4 U

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 R1 X R2 Y R3 W R4 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 R1 X R2 Y R3 W R4 U

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

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

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

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

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

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

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

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

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

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

Examples 1 Operand Instructions - Accumulator Z = X  Y + W  U AC LOAD X MULT Y STORE TEMP LOAD W MULT U ADD TEMP STORE Z AC W*U + X*Y temp X*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 X PUSH X PUSH Y MULT PUSH W PUSH U ADD STORE Z X Destination assumed to be top of stack

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

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U X * Y PUSH X PUSH Y MULT PUSH W PUSH U 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 W PUSH X PUSH Y MULT PUSH W PUSH U ADD STORE Z W X * Y

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

Examples 1 Operand Instructions – Stack based Z = X  Y + W  U W * U PUSH X PUSH Y MULT PUSH W PUSH U 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 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 ADD STORE Z 11-14 trips to main memory (Mult/Add 2 or 3 each!)