SlideShare uma empresa Scribd logo
1 de 22
ECE2030
Introduction to Computer Engineering
Lecture 18: Instruction Set Architecture
Prof. Hsien-Hsin Sean LeeProf. Hsien-Hsin Sean Lee
School of Electrical and Computer EngineeringSchool of Electrical and Computer Engineering
Georgia TechGeorgia Tech
Breakdown of a Computing Problem
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
ProblemProblemProblemProblem AlgorithmAlgorithm
ss
AlgorithmAlgorithm
ss
Programming inProgramming in
High-Level LanguageHigh-Level Language
Programming inProgramming in
High-Level LanguageHigh-Level Language
Compiler/Assembler/Compiler/Assembler/
LinkerLinker
Compiler/Assembler/Compiler/Assembler/
LinkerLinker
System LevelSystem LevelSystem LevelSystem Level
Human LevelHuman LevelHuman LevelHuman Level
System architectureSystem architectureSystem architectureSystem architecture
Target MachineTarget Machine
(one implementation)(one implementation)
Target MachineTarget Machine
(one implementation)(one implementation)Micro-architectureMicro-architectureMicro-architectureMicro-architecture
Functional units/Functional units/
Data PathData Path
Functional units/Functional units/
Data PathData Path
Gates LevelGates Level
DesignDesign
Gates LevelGates Level
DesignDesign
TransistorsTransistorsTransistorsTransistors ManufacturingManufacturingManufacturingManufacturing
RTL LevelRTL LevelRTL LevelRTL Level
Logic LevelLogic LevelLogic LevelLogic Level
Circuit LevelCircuit LevelCircuit LevelCircuit Level
Silicon LevelSilicon LevelSilicon LevelSilicon Level
Instruction Set Architecture (ISA)
• An abstraction
– Interface between hardware and low-level software
– Alleviate programmers from specifying control signals to
harness a machine
• Defined by
– An Instruction Set
– Software convention
• Independent from a specific internal implementation
(microarchitecture + system architecture)
ISA design principles
• Compatibility
• Implementability
• Programmability
• Usability
• Encoding efficiency
High Level
Language
ISA
CompilerCompiler
…
lw r2, mem[r7]
add r3, r4, r2
st r3, mem[r8]
main() {
int i,b,c,a[10];
for (i=0; i<10; i++)…
a[2] = b + c*i;
}
AssemblerAssembler
Binary code
General Purpose Computer
Central Processing UnitCentral Processing Unit
(CPU)(CPU)
MemoryMemory
Data
Data &
Instruction
0101 1001 1010 1001 1000
0100 1000 1110 1111 0011
0010 1011 1000 …… ……
A stored-program computer
called EDVACEDVAC proposed in 1944
while developing ENIACENIAC, first
general purpose computer
Contributors:
Presper Eckert
John Mauchly
John von Neumann
EDSACEDSAC built by Maurice Wilkes
implements the first operational
stored-program machine
Von Neumann Machine
Basic Operation
1000 1100 1110 0010 0000 0000 0000 00001000 1100 1110 0010 0000 0000 0000 0000 (= lw R2, mem[R7])
Instruction fetch from memory
Instruction Decoder/
Microcode ROM
Datapath Unit
Data written
back to
memory
It’s called HarvardHarvard
ArchitectureArchitecture
(Mark-III/IV) if
instruction and
data memory are
separated
MICROPROCESSORMICROPROCESSOR
Commercial ISA
• CDC6600, IBM 360, DEC VAX (good old days, 360 is
now IBM z-series)
• x86 (Intel 32, Intel 64, AMD64), Itanium (IA-64)
• Sun Sparc
• Xscale (PocketPC)
• IBM PowerPC (Mac, BlueGene)
• ARM, MIPS (embedded, MIPS once was popular in
workstations)
Basic Instruction Format (Assembly code)
• ISA defines a set of “architectural registersarchitectural registers” to avoid going to
memory all the time
– X86: EAX, EBX, ECX, EDX, ESI, EDI, EBP, ESP
– MIPS: r0 to r31 and Hi, Lo (or sometimes we use alias to show the
software convention when using these registers)
• Instruction main classes
– Arithmetic / Logical
– Data transfer (load or store for different data sizes)
– Change-of-flow
• Conditional branches
• Unconditional branches (e.g. jump, subroutine calls.)
• Operands
– Architectural registers
– Memory addresses
– Target address for change-of-flow
<instruction mnemonic><instruction mnemonic> <destination operand>, <source op>, <source op><destination operand>, <source op>, <source op>
MIPS Register Aliases
Register Names Usage by Software Convention
$0 $zero Hardwired to zero
$1 $at Reserved by assembler
$2 - $3 $v0 - $v1 Function return result registers
$4 - $7 $a0 - $a3 Function passing argument value registers
$8 - $15 $t0 - $t7 Temporary registers, caller saved
$16 - $23 $s0 - $s7 Saved registers, callee saved
$24 - $25 $t8 - $t9 Temporary registers, caller saved
$26 - $27 $k0 - $k1 Reserved for OS kernel
$28 $gp Global pointer
$29 $sp Stack pointer
$30 $fp Frame pointer
$31 $ra Return address (pushed by call instruction)
$hi $hi High result register (remainder/div, high word/mult)
$lo $lo Low result register (quotient/div, low word/mult)
Basic Instruction Format (Assembly code)
<instruction mnemonic><instruction mnemonic> <destination operand>, <source op>, <source op><destination operand>, <source op>, <source op>
R8 = R6 + R7 ⇒ add $8, $6, $7
or ⇒ add $t0, $a1, $a2
R9 = R9 + 2004 ⇒ addi $9, $9, 2004
R3 = R4 ⊕ R5 ⇒ xor $3, $4, $5
operationoperation MIPS assemblyMIPS assembly
R10 = R8 << R9 ⇒ sllv $10, $8, $9
R24 = R15 >> 2 ⇒ sra $24, $15, 2 (arith right shift)
R2 = mem[R3+100] ⇒ lw $2, 100($3)
mem[R3+100] = R2 ⇒ sw $2, 100($3)
if (R2<R3) R4=1 else R4=0 ⇒ slt $4, $2, $3
Procedural call ⇒ jal _func
$31=PC+4; go to address
pointed label _func (assuming no delay slot)
MIPS R-format Encoding
31
opcode rs rt rd
26 25 21 20 16 15 11 10 6 5 0
shamt funct
0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 00 0
31
opcode rs rt rd
26 25 21 20 16 15 11 10 6 5 0
shamt funct
add $4, $3, $2
rt
rs
rd
0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 00 0
Encoding = 0x00622020
MIPS R-format Encoding
31
opcode rs rt rd
26 25 21 20 16 15 11 10 6 5 0
shamt funct
0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 00 0
31
opcode rs rt rd
26 25 21 20 16 15 11 10 6 5 0
shamt funct
sll $3, $5, 7
shamt
rt
rd
0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 00 0
Encoding = 0x000519C0
MIPS I-format Encoding
31
opcode rs rt Immediate Value
26 25 21 20 16 15 0
lw $5, 3000($2)
Immediate
rs
rt
0 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 01 0
Encoding = 0x8C450BB8
0 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 01 0
31
opcode rs rt
26 25 21 20 16 15 0
Immediate Value
MIPS I-format Encoding
31
opcode rs rt Immediate Value
26 25 21 20 16 15 0
sw $5, 3000($2)
Immediate
rs
rt
1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 01 0
Encoding = 0xAC450BB8
1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 01 0
31
opcode rs rt
26 25 21 20 16 15 0
Immediate Value
MIPS J-format Encoding
31
opcode Target Address
26 0
jal 0x00400030
Target
0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 00 0
Encoding = 0x0C10000C
0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 00 0
31
opcode
26 25 0
Target Address
25
0000 0000 0100 0000 0000 0000 0011 0000X
Instruction=4 bytesTarget Address
•jal will jump and push
return address in $ra ($31)
•Use “jr $31” to return
JR and JALR
• JALR (Jump And Link Register) and JR (Jump
Register)
– Considered as R-type
– Unconditional jump
– JALR used for procedural call
0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 0 10 0
31
opcode rs 0 rd
(default=31)
26 25 21 20 16 15 11 10 6 5 0
0 funct
jalr r2
jr r2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 00 0
31
opcode rs 0
26 25 21 20 16 15 11 10 6 5 0
0 funct0
Assembly Program Example
.data
.globl array
array: .word 0x12345678
.word 0x98765432
.word 0x66bbccdd
.word 0x44332211
.text
.globl __start
__start:
jal main
# more code below
.globl main
main:
la $8, array
lb $9, ($8)
lb $10, 1($8)
add $11, $9, $10
sb $11, ($8)
addiu $8, $8, 4
lh $9, ($8)
lhu $10, 2($8)
add $11, $9, $10
sh $11, ($8)
addiu $8, $8, 4
lw $9, ($8)
lw $10, 4($8)
sub $11, $9, $10
sw $11, ($8)
Interface for System Services
Backup
ISA Design Philosophy
RISC  Reduced Instruction Set Computers
versus
CISC  Complex Instruction Set Computers
• IBM 801 led by John Cocke pioneered RISC concept
• Berkeley’s RISC-I and Stanford’s MIPS led the first academic
implementations
RISC versus CISC
• Why CISC?
– Memory are expensive
and slow back then
– Cramming more functions
into one instruction
– Using microcode ROM
(μROM) for “complex”
operations
• Justification for RISC
– Complex apps are mostly
composed of simple
assignments
– RAM speed catching up
– Compiler (human) getting
smarter
– Frequency↑ ⇒ shorter
pipe stages (also easier to
design a regular pipeline)
CISC RISC
Variable length instructions Fixed-length instructions
Abundant instructions and
addressing modes
Fewer instructions and
addressing modes
Longer decoding Easier decoding
Mem-to-mem operations Load/store architecture
Use on-core microcode No microinstructions,
directly executed by HW logic
Less pipelineability Better pipelineability
Closer semantic gap between
high level code and assembly
(shift complexity to
microcode)
Needs smart compilers
Intel IA32, IBM 360, DEC
VAX, Motorola 68030
MIPS, IBM 801, IBM
PowerPC, Sun Sparc
Other ISA Design Philosophy
• VLIW (Very Long Instruction Word)
– A Dumb Machine with a Smart Compiler
– Packing multiple (RISC-like) operation into one VLIW
– Instruction scheduling performed completely by compiler
– Multiflow, Cydrome in the 80s and most of the digital signal
processor (DSP) today
• EPIC (Explicit Parallel Instruction Computing)
– The return of the VLIW
– With new features in the ISA such as
• Data and control speculation
• Full Predication
– Intel/HP’s Itanium and Itanium 2 (or once called IA-64)

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
Lec7 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Dynamic Sch...
 
Lec6 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Instruction...
Lec6 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Instruction...Lec6 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Instruction...
Lec6 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Instruction...
 
Lec15 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Re...
Lec15 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Re...Lec15 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Re...
Lec15 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Re...
 
Lec17 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Me...
Lec17 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Me...Lec17 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Me...
Lec17 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Me...
 
06 mips-isa
06 mips-isa06 mips-isa
06 mips-isa
 
Sequential Logic Circuits
Sequential Logic CircuitsSequential Logic Circuits
Sequential Logic Circuits
 
PROCESSOR AND CONTROL UNIT
PROCESSOR AND CONTROL UNITPROCESSOR AND CONTROL UNIT
PROCESSOR AND CONTROL UNIT
 
Instruction Set Architecture
Instruction  Set ArchitectureInstruction  Set Architecture
Instruction Set Architecture
 
Mips
MipsMips
Mips
 
Mips architecture
Mips architectureMips architecture
Mips architecture
 
isa architecture
isa architectureisa architecture
isa architecture
 
Class4
Class4Class4
Class4
 
Lec02
Lec02Lec02
Lec02
 
isa architecture
isa architectureisa architecture
isa architecture
 
MIPS Assembly Language I
MIPS Assembly Language IMIPS Assembly Language I
MIPS Assembly Language I
 
Micro task1
Micro task1Micro task1
Micro task1
 
Types of instructions
Types of instructionsTypes of instructions
Types of instructions
 
Lec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processorLec 12-15 mips instruction set processor
Lec 12-15 mips instruction set processor
 
Data hazards ppt
Data hazards pptData hazards ppt
Data hazards ppt
 

Destaque

Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Hsien-Hsin Sean Lee, Ph.D.
 
Lec10 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Mu...
Lec10 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Mu...Lec10 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Mu...
Lec10 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Mu...
Hsien-Hsin Sean Lee, Ph.D.
 
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Hsien-Hsin Sean Lee, Ph.D.
 
Lec7 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Kar...
Lec7 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Kar...Lec7 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Kar...
Lec7 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Kar...
Hsien-Hsin Sean Lee, Ph.D.
 
Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boo...
Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boo...Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boo...
Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boo...
Hsien-Hsin Sean Lee, Ph.D.
 

Destaque (20)

Lec14 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Se...
Lec14 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Se...Lec14 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Se...
Lec14 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Se...
 
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
Lec2 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Num...
 
Lec1 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Intro
Lec1 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- IntroLec1 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Intro
Lec1 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Intro
 
Lec4 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ISA
Lec4 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ISALec4 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ISA
Lec4 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- ISA
 
Lec6 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Can...
Lec6 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Can...Lec6 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Can...
Lec6 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Can...
 
Lec10 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Mu...
Lec10 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Mu...Lec10 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Mu...
Lec10 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Mu...
 
Lec3 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Performance
Lec3 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- PerformanceLec3 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Performance
Lec3 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Performance
 
Lec8 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Qui...
Lec8 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Qui...Lec8 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Qui...
Lec8 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Qui...
 
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
Lec3 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMO...
 
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...
Lec9 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Com...
 
Lec13 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Sh...
Lec13 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Sh...Lec13 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Sh...
Lec13 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Sh...
 
Lec16 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Fi...
Lec16 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Fi...Lec16 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Fi...
Lec16 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Fi...
 
Lec12 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Ad...
Lec12 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Ad...Lec12 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Ad...
Lec12 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Ad...
 
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOS
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOSLec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOS
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOS
 
Lec7 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Kar...
Lec7 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Kar...Lec7 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Kar...
Lec7 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Kar...
 
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...
Lec11 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- De...
 
Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boo...
Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boo...Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boo...
Lec5 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Boo...
 
CMOS Topic 6 -_designing_combinational_logic_circuits
CMOS Topic 6 -_designing_combinational_logic_circuitsCMOS Topic 6 -_designing_combinational_logic_circuits
CMOS Topic 6 -_designing_combinational_logic_circuits
 
CMOS logic circuits
CMOS logic circuitsCMOS logic circuits
CMOS logic circuits
 
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- SMP
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- SMPLec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- SMP
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- SMP
 

Semelhante a Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Instruction Set Architecture

LECTURE2 td 2 sue les theories de graphes
LECTURE2 td 2 sue les theories de graphesLECTURE2 td 2 sue les theories de graphes
LECTURE2 td 2 sue les theories de graphes
AhmedMahjoub15
 
CA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptx
CA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptxCA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptx
CA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptx
trupeace
 
Systemsoftwarenotes 100929171256-phpapp02 2
Systemsoftwarenotes 100929171256-phpapp02 2Systemsoftwarenotes 100929171256-phpapp02 2
Systemsoftwarenotes 100929171256-phpapp02 2
Khaja Dileef
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64
FFRI, Inc.
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
EstelaJeffery653
 

Semelhante a Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Instruction Set Architecture (20)

LECTURE2 td 2 sue les theories de graphes
LECTURE2 td 2 sue les theories de graphesLECTURE2 td 2 sue les theories de graphes
LECTURE2 td 2 sue les theories de graphes
 
Introduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM ProcessorIntroduction to Processor Design and ARM Processor
Introduction to Processor Design and ARM Processor
 
other-architectures.ppt
other-architectures.pptother-architectures.ppt
other-architectures.ppt
 
r2con 2017 r2cLEMENCy
r2con 2017 r2cLEMENCyr2con 2017 r2cLEMENCy
r2con 2017 r2cLEMENCy
 
CA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptx
CA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptxCA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptx
CA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptx
 
Joel Falcou, Boost.SIMD
Joel Falcou, Boost.SIMDJoel Falcou, Boost.SIMD
Joel Falcou, Boost.SIMD
 
ISA.pptx
ISA.pptxISA.pptx
ISA.pptx
 
Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11Performance is a Feature! at DDD 11
Performance is a Feature! at DDD 11
 
Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06
Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06
Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06Lect-06
 
Pipelining1
Pipelining1Pipelining1
Pipelining1
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
 
80x86_2.pdf
80x86_2.pdf80x86_2.pdf
80x86_2.pdf
 
Systemsoftwarenotes 100929171256-phpapp02 2
Systemsoftwarenotes 100929171256-phpapp02 2Systemsoftwarenotes 100929171256-phpapp02 2
Systemsoftwarenotes 100929171256-phpapp02 2
 
Performance is a Feature!
Performance is a Feature!Performance is a Feature!
Performance is a Feature!
 
Эксплуатируем неэксплуатируемые уязвимости SAP
Эксплуатируем неэксплуатируемые уязвимости SAPЭксплуатируем неэксплуатируемые уязвимости SAP
Эксплуатируем неэксплуатируемые уязвимости SAP
 
Getting access to the SAP server via SAP Management Console
Getting access to the SAP server via SAP Management ConsoleGetting access to the SAP server via SAP Management Console
Getting access to the SAP server via SAP Management Console
 
Module_01.ppt
Module_01.pptModule_01.ppt
Module_01.ppt
 
Exploring the x64
Exploring the x64Exploring the x64
Exploring the x64
 
Chapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structuChapter 1SyllabusCatalog Description Computer structu
Chapter 1SyllabusCatalog Description Computer structu
 
The forgotten art of assembly
The forgotten art of assemblyThe forgotten art of assembly
The forgotten art of assembly
 

Último

怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
ehyxf
 
一比一原版(USYD毕业证书)澳洲悉尼大学毕业证如何办理
一比一原版(USYD毕业证书)澳洲悉尼大学毕业证如何办理一比一原版(USYD毕业证书)澳洲悉尼大学毕业证如何办理
一比一原版(USYD毕业证书)澳洲悉尼大学毕业证如何办理
uodye
 
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
wpkuukw
 
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
wpkuukw
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
ehyxf
 
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
wpkuukw
 
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pillsIn Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
Abortion pills in Riyadh +966572737505 get cytotec
 
Buy Abortion pills in Riyadh |+966572737505 | Get Cytotec
Buy Abortion pills in Riyadh |+966572737505 | Get CytotecBuy Abortion pills in Riyadh |+966572737505 | Get Cytotec
Buy Abortion pills in Riyadh |+966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in DammamAbortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
ahmedjiabur940
 
Abortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get CytotecAbortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
uodye
 
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
ougvy
 
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
uodye
 
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptxCRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
Rishabh332761
 

Último (20)

怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
怎样办理阿德莱德大学毕业证(Adelaide毕业证书)成绩单留信认证
 
一比一原版(USYD毕业证书)澳洲悉尼大学毕业证如何办理
一比一原版(USYD毕业证书)澳洲悉尼大学毕业证如何办理一比一原版(USYD毕业证书)澳洲悉尼大学毕业证如何办理
一比一原版(USYD毕业证书)澳洲悉尼大学毕业证如何办理
 
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
一比一定(购)坎特伯雷大学毕业证(UC毕业证)成绩单学位证
 
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In Palghar [ 7014168258 ] Call Me For Genuine Models W...
 
Low Cost Patna Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gi...
Low Cost Patna Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gi...Low Cost Patna Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gi...
Low Cost Patna Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top Class Call Gi...
 
🌹Patia⬅️ Vip Call Girls Bhubaneswar 📱9777949614 Book Well Trand Call Girls In...
🌹Patia⬅️ Vip Call Girls Bhubaneswar 📱9777949614 Book Well Trand Call Girls In...🌹Patia⬅️ Vip Call Girls Bhubaneswar 📱9777949614 Book Well Trand Call Girls In...
🌹Patia⬅️ Vip Call Girls Bhubaneswar 📱9777949614 Book Well Trand Call Girls In...
 
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
一比一定(购)新西兰林肯大学毕业证(Lincoln毕业证)成绩单学位证
 
Vashi Affordable Call Girls ,07506202331,Vasai Virar Charming Call Girl
Vashi Affordable Call Girls ,07506202331,Vasai Virar Charming Call GirlVashi Affordable Call Girls ,07506202331,Vasai Virar Charming Call Girl
Vashi Affordable Call Girls ,07506202331,Vasai Virar Charming Call Girl
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
 
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
一比一定(购)UNITEC理工学院毕业证(UNITEC毕业证)成绩单学位证
 
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pillsIn Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
In Riyadh Saudi Arabia |+966572737505 | Buy Cytotec| Get Abortion pills
 
Buy Abortion pills in Riyadh |+966572737505 | Get Cytotec
Buy Abortion pills in Riyadh |+966572737505 | Get CytotecBuy Abortion pills in Riyadh |+966572737505 | Get Cytotec
Buy Abortion pills in Riyadh |+966572737505 | Get Cytotec
 
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in DammamAbortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
Abortion Pill for sale in Riyadh ((+918761049707) Get Cytotec in Dammam
 
Abortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get CytotecAbortion pills in Jeddah |+966572737505 | Get Cytotec
Abortion pills in Jeddah |+966572737505 | Get Cytotec
 
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
在线制作(UQ毕业证书)昆士兰大学毕业证成绩单原版一比一
 
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
在线制作(ANU毕业证书)澳大利亚国立大学毕业证成绩单原版一比一
 
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
一比一原版(Otago毕业证书)奥塔哥理工学院毕业证成绩单学位证靠谱定制
 
Mass storage systems presentation operating systems
Mass storage systems presentation operating systemsMass storage systems presentation operating systems
Mass storage systems presentation operating systems
 
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Udgir [ 7014168258 ] Call Me For Genuine Models We ...
 
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptxCRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
CRISIS COMMUNICATION presentation=-Rishabh(11195)-group ppt (4).pptx
 

Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Instruction Set Architecture

  • 1. ECE2030 Introduction to Computer Engineering Lecture 18: Instruction Set Architecture Prof. Hsien-Hsin Sean LeeProf. Hsien-Hsin Sean Lee School of Electrical and Computer EngineeringSchool of Electrical and Computer Engineering Georgia TechGeorgia Tech
  • 2. Breakdown of a Computing Problem Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)Instruction Set Architecture (ISA) ProblemProblemProblemProblem AlgorithmAlgorithm ss AlgorithmAlgorithm ss Programming inProgramming in High-Level LanguageHigh-Level Language Programming inProgramming in High-Level LanguageHigh-Level Language Compiler/Assembler/Compiler/Assembler/ LinkerLinker Compiler/Assembler/Compiler/Assembler/ LinkerLinker System LevelSystem LevelSystem LevelSystem Level Human LevelHuman LevelHuman LevelHuman Level System architectureSystem architectureSystem architectureSystem architecture Target MachineTarget Machine (one implementation)(one implementation) Target MachineTarget Machine (one implementation)(one implementation)Micro-architectureMicro-architectureMicro-architectureMicro-architecture Functional units/Functional units/ Data PathData Path Functional units/Functional units/ Data PathData Path Gates LevelGates Level DesignDesign Gates LevelGates Level DesignDesign TransistorsTransistorsTransistorsTransistors ManufacturingManufacturingManufacturingManufacturing RTL LevelRTL LevelRTL LevelRTL Level Logic LevelLogic LevelLogic LevelLogic Level Circuit LevelCircuit LevelCircuit LevelCircuit Level Silicon LevelSilicon LevelSilicon LevelSilicon Level
  • 3. Instruction Set Architecture (ISA) • An abstraction – Interface between hardware and low-level software – Alleviate programmers from specifying control signals to harness a machine • Defined by – An Instruction Set – Software convention • Independent from a specific internal implementation (microarchitecture + system architecture)
  • 4. ISA design principles • Compatibility • Implementability • Programmability • Usability • Encoding efficiency High Level Language ISA CompilerCompiler … lw r2, mem[r7] add r3, r4, r2 st r3, mem[r8] main() { int i,b,c,a[10]; for (i=0; i<10; i++)… a[2] = b + c*i; } AssemblerAssembler Binary code
  • 5. General Purpose Computer Central Processing UnitCentral Processing Unit (CPU)(CPU) MemoryMemory Data Data & Instruction 0101 1001 1010 1001 1000 0100 1000 1110 1111 0011 0010 1011 1000 …… …… A stored-program computer called EDVACEDVAC proposed in 1944 while developing ENIACENIAC, first general purpose computer Contributors: Presper Eckert John Mauchly John von Neumann EDSACEDSAC built by Maurice Wilkes implements the first operational stored-program machine Von Neumann Machine
  • 6. Basic Operation 1000 1100 1110 0010 0000 0000 0000 00001000 1100 1110 0010 0000 0000 0000 0000 (= lw R2, mem[R7]) Instruction fetch from memory Instruction Decoder/ Microcode ROM Datapath Unit Data written back to memory It’s called HarvardHarvard ArchitectureArchitecture (Mark-III/IV) if instruction and data memory are separated MICROPROCESSORMICROPROCESSOR
  • 7. Commercial ISA • CDC6600, IBM 360, DEC VAX (good old days, 360 is now IBM z-series) • x86 (Intel 32, Intel 64, AMD64), Itanium (IA-64) • Sun Sparc • Xscale (PocketPC) • IBM PowerPC (Mac, BlueGene) • ARM, MIPS (embedded, MIPS once was popular in workstations)
  • 8. Basic Instruction Format (Assembly code) • ISA defines a set of “architectural registersarchitectural registers” to avoid going to memory all the time – X86: EAX, EBX, ECX, EDX, ESI, EDI, EBP, ESP – MIPS: r0 to r31 and Hi, Lo (or sometimes we use alias to show the software convention when using these registers) • Instruction main classes – Arithmetic / Logical – Data transfer (load or store for different data sizes) – Change-of-flow • Conditional branches • Unconditional branches (e.g. jump, subroutine calls.) • Operands – Architectural registers – Memory addresses – Target address for change-of-flow <instruction mnemonic><instruction mnemonic> <destination operand>, <source op>, <source op><destination operand>, <source op>, <source op>
  • 9. MIPS Register Aliases Register Names Usage by Software Convention $0 $zero Hardwired to zero $1 $at Reserved by assembler $2 - $3 $v0 - $v1 Function return result registers $4 - $7 $a0 - $a3 Function passing argument value registers $8 - $15 $t0 - $t7 Temporary registers, caller saved $16 - $23 $s0 - $s7 Saved registers, callee saved $24 - $25 $t8 - $t9 Temporary registers, caller saved $26 - $27 $k0 - $k1 Reserved for OS kernel $28 $gp Global pointer $29 $sp Stack pointer $30 $fp Frame pointer $31 $ra Return address (pushed by call instruction) $hi $hi High result register (remainder/div, high word/mult) $lo $lo Low result register (quotient/div, low word/mult)
  • 10. Basic Instruction Format (Assembly code) <instruction mnemonic><instruction mnemonic> <destination operand>, <source op>, <source op><destination operand>, <source op>, <source op> R8 = R6 + R7 ⇒ add $8, $6, $7 or ⇒ add $t0, $a1, $a2 R9 = R9 + 2004 ⇒ addi $9, $9, 2004 R3 = R4 ⊕ R5 ⇒ xor $3, $4, $5 operationoperation MIPS assemblyMIPS assembly R10 = R8 << R9 ⇒ sllv $10, $8, $9 R24 = R15 >> 2 ⇒ sra $24, $15, 2 (arith right shift) R2 = mem[R3+100] ⇒ lw $2, 100($3) mem[R3+100] = R2 ⇒ sw $2, 100($3) if (R2<R3) R4=1 else R4=0 ⇒ slt $4, $2, $3 Procedural call ⇒ jal _func $31=PC+4; go to address pointed label _func (assuming no delay slot)
  • 11. MIPS R-format Encoding 31 opcode rs rt rd 26 25 21 20 16 15 11 10 6 5 0 shamt funct 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 00 0 31 opcode rs rt rd 26 25 21 20 16 15 11 10 6 5 0 shamt funct add $4, $3, $2 rt rs rd 0 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 00 0 Encoding = 0x00622020
  • 12. MIPS R-format Encoding 31 opcode rs rt rd 26 25 21 20 16 15 11 10 6 5 0 shamt funct 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 00 0 31 opcode rs rt rd 26 25 21 20 16 15 11 10 6 5 0 shamt funct sll $3, $5, 7 shamt rt rd 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 0 00 0 Encoding = 0x000519C0
  • 13. MIPS I-format Encoding 31 opcode rs rt Immediate Value 26 25 21 20 16 15 0 lw $5, 3000($2) Immediate rs rt 0 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 01 0 Encoding = 0x8C450BB8 0 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 01 0 31 opcode rs rt 26 25 21 20 16 15 0 Immediate Value
  • 14. MIPS I-format Encoding 31 opcode rs rt Immediate Value 26 25 21 20 16 15 0 sw $5, 3000($2) Immediate rs rt 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 01 0 Encoding = 0xAC450BB8 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 0 01 0 31 opcode rs rt 26 25 21 20 16 15 0 Immediate Value
  • 15. MIPS J-format Encoding 31 opcode Target Address 26 0 jal 0x00400030 Target 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 00 0 Encoding = 0x0C10000C 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 00 0 31 opcode 26 25 0 Target Address 25 0000 0000 0100 0000 0000 0000 0011 0000X Instruction=4 bytesTarget Address •jal will jump and push return address in $ra ($31) •Use “jr $31” to return
  • 16. JR and JALR • JALR (Jump And Link Register) and JR (Jump Register) – Considered as R-type – Unconditional jump – JALR used for procedural call 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 0 0 10 0 31 opcode rs 0 rd (default=31) 26 25 21 20 16 15 11 10 6 5 0 0 funct jalr r2 jr r2 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 00 0 31 opcode rs 0 26 25 21 20 16 15 11 10 6 5 0 0 funct0
  • 17. Assembly Program Example .data .globl array array: .word 0x12345678 .word 0x98765432 .word 0x66bbccdd .word 0x44332211 .text .globl __start __start: jal main # more code below .globl main main: la $8, array lb $9, ($8) lb $10, 1($8) add $11, $9, $10 sb $11, ($8) addiu $8, $8, 4 lh $9, ($8) lhu $10, 2($8) add $11, $9, $10 sh $11, ($8) addiu $8, $8, 4 lw $9, ($8) lw $10, 4($8) sub $11, $9, $10 sw $11, ($8)
  • 20. ISA Design Philosophy RISC  Reduced Instruction Set Computers versus CISC  Complex Instruction Set Computers • IBM 801 led by John Cocke pioneered RISC concept • Berkeley’s RISC-I and Stanford’s MIPS led the first academic implementations
  • 21. RISC versus CISC • Why CISC? – Memory are expensive and slow back then – Cramming more functions into one instruction – Using microcode ROM (μROM) for “complex” operations • Justification for RISC – Complex apps are mostly composed of simple assignments – RAM speed catching up – Compiler (human) getting smarter – Frequency↑ ⇒ shorter pipe stages (also easier to design a regular pipeline) CISC RISC Variable length instructions Fixed-length instructions Abundant instructions and addressing modes Fewer instructions and addressing modes Longer decoding Easier decoding Mem-to-mem operations Load/store architecture Use on-core microcode No microinstructions, directly executed by HW logic Less pipelineability Better pipelineability Closer semantic gap between high level code and assembly (shift complexity to microcode) Needs smart compilers Intel IA32, IBM 360, DEC VAX, Motorola 68030 MIPS, IBM 801, IBM PowerPC, Sun Sparc
  • 22. Other ISA Design Philosophy • VLIW (Very Long Instruction Word) – A Dumb Machine with a Smart Compiler – Packing multiple (RISC-like) operation into one VLIW – Instruction scheduling performed completely by compiler – Multiflow, Cydrome in the 80s and most of the digital signal processor (DSP) today • EPIC (Explicit Parallel Instruction Computing) – The return of the VLIW – With new features in the ISA such as • Data and control speculation • Full Predication – Intel/HP’s Itanium and Itanium 2 (or once called IA-64)