SlideShare a Scribd company logo
ECE2030
Introduction to Computer Engineering
Lecture 19: Program Control
Prof. Hsien-Hsin Sean LeeProf. Hsien-Hsin Sean Lee
School of Electrical and Computer EngineeringSchool of Electrical and Computer Engineering
Georgia TechGeorgia Tech
Program Execution on Processors
• How a program is executed on a processor?
• How instructions ordering are maintained?
• Are there times we need to change the flow
of a program?
• How to handle change of flow of a program?
Program Counter
• How a sequence of
instructions are fetched
and executed by a
computer?
• Program Counter (PC)
– A special register
– Provide the logical
ordering of a program
– Point to the address of
the instruction to be
executed
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)
PC
Program Counter (Little Endian)
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)
0x01
0x10
0x08
0x3c
PC
la $8, array
0x00
0x00
0x09
0x81
PC+4
lb $9, ($8)
0x01
0x00
0x0a
0x81
PC+8
lb $10, 1($8)
• Each MIPS instruction is 4-byte wide
0x20
0x58
0x2a
0x01
0x00
0x00
0x0b
0xa1
0x04
add $11,$9,$10
sb $11, ($8)
PC+12
PC+16
PC+20
Program Counter Control
32-bit PC Register
System clock +
432
32
32
2k
x32
INSTRUCTION
MEMORY
32
Data (i.e. instruction)
Instruction Register
Change of Flow Scenarios
• Our current defaultdefault modemode
– Program executed in sequentialsequential order
• When a program will break the sequential
property?
– Subroutine Call and Return
– Conditional Jump (with Test/Compare)
– Unconditional Jump
• MIPS R3000/4000 uses
– Unconditional absolute instruction addressing
– Conditional relative instruction addressing
Absolute Instruction Addressing
• The next PC address is given as an absolute
value
– PC address = <given address>
• Jump class examples
– J LABEL
– JAL LABEL
– JALR $r
– JR $r
Absolute Addressing Example
• Assume no delay slot
• J Label2J Label2
– Encoding:
•Label2=0x00400048
•J opcode= (000010)2
•Encoding=0x8100012
– Temp = <Label2 26-bit addr>
– PC = PC31..28|| Temp || 0
2
main:
la $8, array
lb $9, ($8)
lb $10, 1($8)
add $11, $9, $10
sb $11, ($8)
j Label2
...
...
Label2:
addiu $8, $8, 4
lh $9, ($8)
lhu $10, 2($8)
Relative Instruction Addressing
• An offset relative to the current PC address is
given instead of an absolute address
– PC address = <current PC address> + <offset>
• Branch class examples
– bne $src, $dest, LABEL
– beq $src, $dest, LABEL
– bgez $src, LABEL
– Bltz $src, LABEL
– Note that there is no blt instruction, that’s why slt
is needed. To facilitate the assembly programming,
there is a “bltblt pseudo oppseudo op”” that programmers can
use.
Relative Addressing Example
• Assume no delay slot
• beq $20,$22,L1beq $20,$22,L1
– Encoding=0x12960004 (next slide)
– Target=(offset15)
14
|| offset || 0
2
– PC = PC + Target
la $8, array
beq $20, $22, L1
lb $10, 1($8)
add $11, $9, $10
sb $11, ($8)
L1:
addiu $8, $8, 4
BEQ Encoding (I-Format)
beq $20, $22, L1
Offset Value
= (Target addr – beq addr)/4
= # of instructions in-between
including beq instruction
rt
rs
0 1 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 00 0
Encoding = 0x12960004
0 1 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 00 0
31
opcode rs rt
26 25 21 20 16 15 0
Offset Value
Branch to L1 if $20==$22
Offset = 4
instructions
Relative Addressing Example
• The offset can be positive as well as negative
L2:
addiu $20, $22, 4
lw $24, ($22)
lw $23, ($20)
beq $24, $23, L2
0 1 0 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 10 0
Encoding = 0x1317FFFD
0 1 0 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 10 0
31
opcode rs rt
26 25 21 20 16 15 0
Offset Value
Offset = -3-3
instructions
beq $24, $23, L2
MIPS Control Code Example
• See array.s and prime.s
Procedural Calls in MIPS
• MIPS uses jal or jalr to perform procedure calls
(assume no branch delay slot)
– jal LABEL # r31 = PC + 4
– jal rd, rs # rd = PC + 4
• Return address is automatically saved
• When return from procedure
– jr $31 or jr $d
– Note that $31 is aliased to $ra
• Call convention
– Use $a0 to $a3 ($4 to $7) for the first 4 arguments
– Use $v0 ($2) for passing the result back to the caller
Procedural Call Example
C code snippetC code snippet
z = pyth(x, y);
z = sqrt(z);
int
pyth(int x, int y)
{
return(x2
+y2
);
}
MIPS snippetMIPS snippet
la $t0, x
la $t1, y
lw $a0, ($t0)
lw $a1, ($t1)
jal pyth
add $a0, $v0, $zero
jal sqrt
la $t2, z
sw $v0, ($t2)
pyth:
mult $a0, $a0
mflo $t0
mult $a1, $a1
mflo $t1
add $v0, $t0, $t1
jr $ra
sqrt:
….
jr $raNote that by software convention,
$t0 to $t7 are called “caller-saved” registers,
i.e. the caller is responsible to back them up
before procedure call if they are to be used
after the procedure call again
Procedural Call: Recursion
C code snippetC code snippet
z = fact(x);
int fact(int n)
{
if (n < 1)
return(1);
else
return(n * fact(n-1))
}
MIPS snippetMIPS snippet
la $t0, x
lw $a0, ($t0)
jal fact
fact:
addi $v0, $zero, 1
blt $a0, $v0, L1
addi $a0, $a0, -1
jal fact
L1:
jr $ra
?
$ra ($31) is overwritten and old value is lost
Procedural Call: Many Arguments
C code snippetC code snippet
long a[5];
z = foo(a[0], a[1], a[2],
a[3], a[4]);
int foo(int t, int u,
int v, int w,
int x)
{
return(t+u-v*w+x);
}
MIPS snippetMIPS snippet
la $t0, a
lw $a0, 0($t0)
lw $a1, 4($t0)
lw $a2, 8($t0)
lw $a3, 12($t0)
lw ???, 16($t0)
foo:
...
...
jr $ra
Run out of passing argument registers !
Stack
• The solution to address the prior 2 problems
• a LIFO (Last-In First-Out) memory
• A scratch memory space
• Typically grow downward (i.e. push to lower address)
Stack
• Stack Frame
– Base pointed by a special register $sp (=$29)
– Each procedure has its own stack frame (if stack space is
allocated)
• Push
– Allocate a new stack frame when entering a procedure
– subu $sp, $sp, 32
– What to store?
• Return address
• Additional passing arguments
• Local variables
• Pop
– Deallocate the stack frame when return from procedure
– addu $sp, $sp, 32
Stack Push
4 bytes
higher
addr
lower
addr
$sp
jal foo
...
...
foo:
subu $sp, $sp, 32
...
addu $sp, $sp, 32
jr $ra
PUSHPUSH
NewStackFrameNewStackFrame
forfoo()forfoo()
Stack Pop
4 bytes
higher
addr
lower
addr
$sp
jal foo
...
...
foo:
subu $sp, $sp, 32
...
addu $sp, $sp, 32
jr $ra
NewStackFrameNewStackFrame
forfoo()forfoo()
CurrentCurrent
StackStack
FrameFrame
Recursive Call
C code snippetC code snippet
z = fact(x);
int fact(int n)
{
if (n < 1)
return(1);
else
return(n * fact(n-1))
}
MIPS snippetMIPS snippet
li $v0, 1
j fact
fact:
beq $a0, $v0, return
return:
jr $ra
Recursive Call
C code snippetC code snippet
z = fact(x);
int fact(int n)
{
if (n < 1)
return(1);
else
return(n * fact(n-1))
}
MIPS snippetMIPS snippet
li $v0, 1
j fact
fact:
beq $a0, $v0, return
jal fact
return:
jr $ra
What to do with
$a0 and $ra ?
Push onto the Stack
MIPS snippetMIPS snippet
li $v0, 1
j fact
fact:
beq $a0, $v0, return
sub $sp, $sp, 8
sw $ra, 4($sp)
sw $a0, 0($sp)
sub $a0, $a0, 1
jal fact
return:
jr $ra
$sp
Return address
$a0 (= X)
C code snippetC code snippet
z = fact(x);
int fact(int n)
{
if (n < 1)
return(1);
else
return(n * fact(n-1))
}
What happens
after returning from
the procedure ???
Pop from the Stack
C code snippetC code snippet
z = fact(x);
int fact(int n)
{
if (n < 1)
return(1);
else
return(n * fact(n-1))
}
MIPS snippetMIPS snippet
li $v0, 1
j fact
fact:
beq $a0, $v0, return
sub $sp, $sp, 8
sw $ra, 4($sp)
sw $a0, 0($sp)
sub $a0, $a0, 1
jal fact
lw $a0, 0($sp)
lw $ra, 4($sp)
mult $a0, $v0
mflo $v0
add $sp, $sp, 8
return:
jr $ra$sp
Return address
$a0 (= X)
Recursive call for Factorial
C code snippetC code snippet
z = fact(x);
int fact(int n)
{
if (n < 1)
return(1);
else
return(n * fact(n-1))
}
MIPS snippetMIPS snippet
li $v0, 1
j fact
fact:
beq $a0, $v0, return
sub $sp, $sp, 8
sw $ra, 4($sp)
sw $a0, 0($sp)
sub $a0, $a0, 1
jal fact
lw $a0, 0($sp)
lw $ra, 4($sp)
mult $a0, $v0
mflo $v0
add $sp, $sp, 8
return:
jr $ra

More Related Content

What's hot

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...
Hsien-Hsin Sean Lee, Ph.D.
 
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...
Hsien-Hsin Sean Lee, Ph.D.
 
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
Hsien-Hsin Sean Lee, Ph.D.
 
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...
Hsien-Hsin Sean Lee, Ph.D.
 
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Multicore
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- MulticoreLec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Multicore
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Multicore
Hsien-Hsin Sean Lee, Ph.D.
 
Lec11 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part3
Lec11 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part3Lec11 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part3
Lec11 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part3
Hsien-Hsin Sean Lee, Ph.D.
 
Lec05
Lec05Lec05
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler OptimizationsPragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Marina Kolpakova
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Marina Kolpakova
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
Motaz Saad
 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly language
hemant meena
 
8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware
Prof. Swapnil V. Kaware
 
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Marina Kolpakova
 
CArcMOOC 05.02 - Reference architecture
CArcMOOC 05.02 - Reference architectureCArcMOOC 05.02 - Reference architecture
CArcMOOC 05.02 - Reference architecture
Alessandro Bogliolo
 
Code GPU with CUDA - SIMT
Code GPU with CUDA - SIMTCode GPU with CUDA - SIMT
Code GPU with CUDA - SIMT
Marina Kolpakova
 
Assembly Language Lecture 3
Assembly Language Lecture 3Assembly Language Lecture 3
Assembly Language Lecture 3
Motaz Saad
 
Lec02
Lec02Lec02
Code GPU with CUDA - Device code optimization principle
Code GPU with CUDA - Device code optimization principleCode GPU with CUDA - Device code optimization principle
Code GPU with CUDA - Device code optimization principle
Marina Kolpakova
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
Karthik Vivek
 
Chp2 introduction to the 68000 microprocessor copy
Chp2 introduction to the 68000 microprocessor   copyChp2 introduction to the 68000 microprocessor   copy
Chp2 introduction to the 68000 microprocessor copy
mkazree
 

What's hot (20)

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...
 
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...
 
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
 
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...
 
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Multicore
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- MulticoreLec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Multicore
Lec13 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Multicore
 
Lec11 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part3
Lec11 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part3Lec11 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part3
Lec11 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- Memory part3
 
Lec05
Lec05Lec05
Lec05
 
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler OptimizationsPragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
Pragmatic Optimization in Modern Programming - Mastering Compiler Optimizations
 
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the CompilerPragmatic Optimization in Modern Programming - Demystifying the Compiler
Pragmatic Optimization in Modern Programming - Demystifying the Compiler
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
 
The 8051 assembly language
The 8051 assembly languageThe 8051 assembly language
The 8051 assembly language
 
8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware8086 microprocessor instruction set by Er. Swapnil Kaware
8086 microprocessor instruction set by Er. Swapnil Kaware
 
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization ApproachesPragmatic Optimization in Modern Programming - Ordering Optimization Approaches
Pragmatic Optimization in Modern Programming - Ordering Optimization Approaches
 
CArcMOOC 05.02 - Reference architecture
CArcMOOC 05.02 - Reference architectureCArcMOOC 05.02 - Reference architecture
CArcMOOC 05.02 - Reference architecture
 
Code GPU with CUDA - SIMT
Code GPU with CUDA - SIMTCode GPU with CUDA - SIMT
Code GPU with CUDA - SIMT
 
Assembly Language Lecture 3
Assembly Language Lecture 3Assembly Language Lecture 3
Assembly Language Lecture 3
 
Lec02
Lec02Lec02
Lec02
 
Code GPU with CUDA - Device code optimization principle
Code GPU with CUDA - Device code optimization principleCode GPU with CUDA - Device code optimization principle
Code GPU with CUDA - Device code optimization principle
 
ARM instruction set
ARM instruction  setARM instruction  set
ARM instruction set
 
Chp2 introduction to the 68000 microprocessor copy
Chp2 introduction to the 68000 microprocessor   copyChp2 introduction to the 68000 microprocessor   copy
Chp2 introduction to the 68000 microprocessor copy
 

Viewers also liked

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
Hsien-Hsin Sean Lee, Ph.D.
 
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...
Hsien-Hsin Sean Lee, Ph.D.
 
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.
 
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...
Hsien-Hsin Sean Lee, Ph.D.
 
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
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.
 
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...
Hsien-Hsin Sean Lee, Ph.D.
 
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...
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.
 
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...
Hsien-Hsin Sean Lee, Ph.D.
 
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...
Hsien-Hsin Sean Lee, Ph.D.
 
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...
Hsien-Hsin Sean Lee, Ph.D.
 
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
Hsien-Hsin Sean Lee, Ph.D.
 
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...
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.
 
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...
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.
 
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
Ikhwan_Fakrudin
 
CMOS logic circuits
CMOS logic circuitsCMOS logic circuits
CMOS logic circuits
Mahesh_Naidu
 
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
Hsien-Hsin Sean Lee, Ph.D.
 

Viewers also liked (20)

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
 
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...
 
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...
 
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...
 
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
 
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...
 
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...
 
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...
 
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...
 
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
 
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...
 
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
 

Similar to Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Program Control

Mips
MipsMips
C:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 BC:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 B
ececourse
 
MIPS_Programming.pdf
MIPS_Programming.pdfMIPS_Programming.pdf
MIPS_Programming.pdf
XxUnnathxX
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12
Rabia Khalid
 
Instruction Set Architecture: MIPS
Instruction Set Architecture: MIPSInstruction Set Architecture: MIPS
Instruction Set Architecture: MIPS
Prasenjit Dey
 
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsReverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
Asuka Nakajima
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
bolovv
 
Chapter 2 Part2 C
Chapter 2 Part2 CChapter 2 Part2 C
Chapter 2 Part2 C
ececourse
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
EasyStudy3
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
Functional Thursday
 
stack.pptx
stack.pptxstack.pptx
stack.pptx
KalimuthuVelappan
 
Faster Python, FOSDEM
Faster Python, FOSDEMFaster Python, FOSDEM
Faster Python, FOSDEM
Victor Stinner
 
The TclQuadcode Compiler
The TclQuadcode CompilerThe TclQuadcode Compiler
The TclQuadcode Compiler
Donal Fellows
 
07-MIPS-Functions.pptx COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE
07-MIPS-Functions.pptx COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE07-MIPS-Functions.pptx COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE
07-MIPS-Functions.pptx COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE
MuhammadUmarAwanCSIT
 
17
1717
06 Recursion in C.pptx
06 Recursion in C.pptx06 Recursion in C.pptx
06 Recursion in C.pptx
MouDhara1
 
An Example MIPS
An Example  MIPSAn Example  MIPS
An Example MIPS
Sandra Long
 
functions
functionsfunctions
functions
Makwana Bhavesh
 
New Functional Features of Java 8
New Functional Features of Java 8New Functional Features of Java 8
New Functional Features of Java 8
franciscoortin
 
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Data Con LA
 

Similar to Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Program Control (20)

Mips
MipsMips
Mips
 
C:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 BC:\Fakepath\Chapter 2 Part2 B
C:\Fakepath\Chapter 2 Part2 B
 
MIPS_Programming.pdf
MIPS_Programming.pdfMIPS_Programming.pdf
MIPS_Programming.pdf
 
Lecture 2 coal sping12
Lecture 2 coal sping12Lecture 2 coal sping12
Lecture 2 coal sping12
 
Instruction Set Architecture: MIPS
Instruction Set Architecture: MIPSInstruction Set Architecture: MIPS
Instruction Set Architecture: MIPS
 
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading SkillsReverse Engineering Dojo: Enhancing Assembly Reading Skills
Reverse Engineering Dojo: Enhancing Assembly Reading Skills
 
Chapter Eight(3)
Chapter Eight(3)Chapter Eight(3)
Chapter Eight(3)
 
Chapter 2 Part2 C
Chapter 2 Part2 CChapter 2 Part2 C
Chapter 2 Part2 C
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
 
stack.pptx
stack.pptxstack.pptx
stack.pptx
 
Faster Python, FOSDEM
Faster Python, FOSDEMFaster Python, FOSDEM
Faster Python, FOSDEM
 
The TclQuadcode Compiler
The TclQuadcode CompilerThe TclQuadcode Compiler
The TclQuadcode Compiler
 
07-MIPS-Functions.pptx COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE
07-MIPS-Functions.pptx COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE07-MIPS-Functions.pptx COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE
07-MIPS-Functions.pptx COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE
 
17
1717
17
 
06 Recursion in C.pptx
06 Recursion in C.pptx06 Recursion in C.pptx
06 Recursion in C.pptx
 
An Example MIPS
An Example  MIPSAn Example  MIPS
An Example MIPS
 
functions
functionsfunctions
functions
 
New Functional Features of Java 8
New Functional Features of Java 8New Functional Features of Java 8
New Functional Features of Java 8
 
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
Big Data Day LA 2016/ Hadoop/ Spark/ Kafka track - Data Provenance Support in...
 

Recently uploaded

Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalRBuilding a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Peter Gallagher
 
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
yizxn4sx
 
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
1jtj7yul
 
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
yizxn4sx
 
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDARLORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
lorraineandreiamcidl
 
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
terpt4iu
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
terpt4iu
 
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
ei8c4cba
 
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
kuehcub
 
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
8db3cz8x
 
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
nudduv
 
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
nudduv
 
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
2g3om49r
 
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
xuqdabu
 
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
6oo02s6l
 
按照学校原版(Columbia文凭证书)哥伦比亚大学毕业证快速办理
按照学校原版(Columbia文凭证书)哥伦比亚大学毕业证快速办理按照学校原版(Columbia文凭证书)哥伦比亚大学毕业证快速办理
按照学校原版(Columbia文凭证书)哥伦比亚大学毕业证快速办理
uyesp1a
 
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
u0g33km
 
Production.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd ddddddddddddddddddddddddddddddddddProduction.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd dddddddddddddddddddddddddddddddddd
DanielOliver74
 
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
1jtj7yul
 
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
xuqdabu
 

Recently uploaded (20)

Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalRBuilding a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
Building a Raspberry Pi Robot with Dot NET 8, Blazor and SignalR
 
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
按照学校原版(UAL文凭证书)伦敦艺术大学毕业证快速办理
 
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
按照学校原版(SUT文凭证书)斯威本科技大学毕业证快速办理
 
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
按照学校原版(Greenwich文凭证书)格林威治大学毕业证快速办理
 
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDARLORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
LORRAINE ANDREI_LEQUIGAN_GOOGLE CALENDAR
 
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
按照学校原版(UOL文凭证书)利物浦大学毕业证快速办理
 
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
按照学校原版(KCL文凭证书)伦敦国王学院毕业证快速办理
 
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
按照学校原版(AU文凭证书)英国阿伯丁大学毕业证快速办理
 
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
一比一原版(KCL文凭证书)伦敦国王学院毕业证如何办理
 
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理按照学校原版(QU文凭证书)皇后大学毕业证快速办理
按照学校原版(QU文凭证书)皇后大学毕业证快速办理
 
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
 
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
一比一原版(ANU文凭证书)澳大利亚国立大学毕业证如何办理
 
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
1比1复刻澳洲皇家墨尔本理工大学毕业证本科学位原版一模一样
 
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
一比一原版(Monash文凭证书)莫纳什大学毕业证如何办理
 
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
按照学校原版(Birmingham文凭证书)伯明翰大学|学院毕业证快速办理
 
按照学校原版(Columbia文凭证书)哥伦比亚大学毕业证快速办理
按照学校原版(Columbia文凭证书)哥伦比亚大学毕业证快速办理按照学校原版(Columbia文凭证书)哥伦比亚大学毕业证快速办理
按照学校原版(Columbia文凭证书)哥伦比亚大学毕业证快速办理
 
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样加急办理美国南加州大学毕业证文凭毕业证原版一模一样
加急办理美国南加州大学毕业证文凭毕业证原版一模一样
 
Production.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd ddddddddddddddddddddddddddddddddddProduction.pptxd dddddddddddddddddddddddddddddddddd
Production.pptxd dddddddddddddddddddddddddddddddddd
 
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
按照学校原版(UVic文凭证书)维多利亚大学毕业证快速办理
 
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
一比一原版(Adelaide文凭证书)阿德莱德大学毕业证如何办理
 

Lec19 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- Program Control

  • 1. ECE2030 Introduction to Computer Engineering Lecture 19: Program Control Prof. Hsien-Hsin Sean LeeProf. Hsien-Hsin Sean Lee School of Electrical and Computer EngineeringSchool of Electrical and Computer Engineering Georgia TechGeorgia Tech
  • 2. Program Execution on Processors • How a program is executed on a processor? • How instructions ordering are maintained? • Are there times we need to change the flow of a program? • How to handle change of flow of a program?
  • 3. Program Counter • How a sequence of instructions are fetched and executed by a computer? • Program Counter (PC) – A special register – Provide the logical ordering of a program – Point to the address of the instruction to be executed 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) PC
  • 4. Program Counter (Little Endian) 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) 0x01 0x10 0x08 0x3c PC la $8, array 0x00 0x00 0x09 0x81 PC+4 lb $9, ($8) 0x01 0x00 0x0a 0x81 PC+8 lb $10, 1($8) • Each MIPS instruction is 4-byte wide 0x20 0x58 0x2a 0x01 0x00 0x00 0x0b 0xa1 0x04 add $11,$9,$10 sb $11, ($8) PC+12 PC+16 PC+20
  • 5. Program Counter Control 32-bit PC Register System clock + 432 32 32 2k x32 INSTRUCTION MEMORY 32 Data (i.e. instruction) Instruction Register
  • 6. Change of Flow Scenarios • Our current defaultdefault modemode – Program executed in sequentialsequential order • When a program will break the sequential property? – Subroutine Call and Return – Conditional Jump (with Test/Compare) – Unconditional Jump • MIPS R3000/4000 uses – Unconditional absolute instruction addressing – Conditional relative instruction addressing
  • 7. Absolute Instruction Addressing • The next PC address is given as an absolute value – PC address = <given address> • Jump class examples – J LABEL – JAL LABEL – JALR $r – JR $r
  • 8. Absolute Addressing Example • Assume no delay slot • J Label2J Label2 – Encoding: •Label2=0x00400048 •J opcode= (000010)2 •Encoding=0x8100012 – Temp = <Label2 26-bit addr> – PC = PC31..28|| Temp || 0 2 main: la $8, array lb $9, ($8) lb $10, 1($8) add $11, $9, $10 sb $11, ($8) j Label2 ... ... Label2: addiu $8, $8, 4 lh $9, ($8) lhu $10, 2($8)
  • 9. Relative Instruction Addressing • An offset relative to the current PC address is given instead of an absolute address – PC address = <current PC address> + <offset> • Branch class examples – bne $src, $dest, LABEL – beq $src, $dest, LABEL – bgez $src, LABEL – Bltz $src, LABEL – Note that there is no blt instruction, that’s why slt is needed. To facilitate the assembly programming, there is a “bltblt pseudo oppseudo op”” that programmers can use.
  • 10. Relative Addressing Example • Assume no delay slot • beq $20,$22,L1beq $20,$22,L1 – Encoding=0x12960004 (next slide) – Target=(offset15) 14 || offset || 0 2 – PC = PC + Target la $8, array beq $20, $22, L1 lb $10, 1($8) add $11, $9, $10 sb $11, ($8) L1: addiu $8, $8, 4
  • 11. BEQ Encoding (I-Format) beq $20, $22, L1 Offset Value = (Target addr – beq addr)/4 = # of instructions in-between including beq instruction rt rs 0 1 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 00 0 Encoding = 0x12960004 0 1 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 00 0 31 opcode rs rt 26 25 21 20 16 15 0 Offset Value Branch to L1 if $20==$22 Offset = 4 instructions
  • 12. Relative Addressing Example • The offset can be positive as well as negative L2: addiu $20, $22, 4 lw $24, ($22) lw $23, ($20) beq $24, $23, L2 0 1 0 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 10 0 Encoding = 0x1317FFFD 0 1 0 0 1 1 0 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 10 0 31 opcode rs rt 26 25 21 20 16 15 0 Offset Value Offset = -3-3 instructions beq $24, $23, L2
  • 13. MIPS Control Code Example • See array.s and prime.s
  • 14. Procedural Calls in MIPS • MIPS uses jal or jalr to perform procedure calls (assume no branch delay slot) – jal LABEL # r31 = PC + 4 – jal rd, rs # rd = PC + 4 • Return address is automatically saved • When return from procedure – jr $31 or jr $d – Note that $31 is aliased to $ra • Call convention – Use $a0 to $a3 ($4 to $7) for the first 4 arguments – Use $v0 ($2) for passing the result back to the caller
  • 15. Procedural Call Example C code snippetC code snippet z = pyth(x, y); z = sqrt(z); int pyth(int x, int y) { return(x2 +y2 ); } MIPS snippetMIPS snippet la $t0, x la $t1, y lw $a0, ($t0) lw $a1, ($t1) jal pyth add $a0, $v0, $zero jal sqrt la $t2, z sw $v0, ($t2) pyth: mult $a0, $a0 mflo $t0 mult $a1, $a1 mflo $t1 add $v0, $t0, $t1 jr $ra sqrt: …. jr $raNote that by software convention, $t0 to $t7 are called “caller-saved” registers, i.e. the caller is responsible to back them up before procedure call if they are to be used after the procedure call again
  • 16. Procedural Call: Recursion C code snippetC code snippet z = fact(x); int fact(int n) { if (n < 1) return(1); else return(n * fact(n-1)) } MIPS snippetMIPS snippet la $t0, x lw $a0, ($t0) jal fact fact: addi $v0, $zero, 1 blt $a0, $v0, L1 addi $a0, $a0, -1 jal fact L1: jr $ra ? $ra ($31) is overwritten and old value is lost
  • 17. Procedural Call: Many Arguments C code snippetC code snippet long a[5]; z = foo(a[0], a[1], a[2], a[3], a[4]); int foo(int t, int u, int v, int w, int x) { return(t+u-v*w+x); } MIPS snippetMIPS snippet la $t0, a lw $a0, 0($t0) lw $a1, 4($t0) lw $a2, 8($t0) lw $a3, 12($t0) lw ???, 16($t0) foo: ... ... jr $ra Run out of passing argument registers !
  • 18. Stack • The solution to address the prior 2 problems • a LIFO (Last-In First-Out) memory • A scratch memory space • Typically grow downward (i.e. push to lower address)
  • 19. Stack • Stack Frame – Base pointed by a special register $sp (=$29) – Each procedure has its own stack frame (if stack space is allocated) • Push – Allocate a new stack frame when entering a procedure – subu $sp, $sp, 32 – What to store? • Return address • Additional passing arguments • Local variables • Pop – Deallocate the stack frame when return from procedure – addu $sp, $sp, 32
  • 20. Stack Push 4 bytes higher addr lower addr $sp jal foo ... ... foo: subu $sp, $sp, 32 ... addu $sp, $sp, 32 jr $ra PUSHPUSH NewStackFrameNewStackFrame forfoo()forfoo()
  • 21. Stack Pop 4 bytes higher addr lower addr $sp jal foo ... ... foo: subu $sp, $sp, 32 ... addu $sp, $sp, 32 jr $ra NewStackFrameNewStackFrame forfoo()forfoo() CurrentCurrent StackStack FrameFrame
  • 22. Recursive Call C code snippetC code snippet z = fact(x); int fact(int n) { if (n < 1) return(1); else return(n * fact(n-1)) } MIPS snippetMIPS snippet li $v0, 1 j fact fact: beq $a0, $v0, return return: jr $ra
  • 23. Recursive Call C code snippetC code snippet z = fact(x); int fact(int n) { if (n < 1) return(1); else return(n * fact(n-1)) } MIPS snippetMIPS snippet li $v0, 1 j fact fact: beq $a0, $v0, return jal fact return: jr $ra What to do with $a0 and $ra ?
  • 24. Push onto the Stack MIPS snippetMIPS snippet li $v0, 1 j fact fact: beq $a0, $v0, return sub $sp, $sp, 8 sw $ra, 4($sp) sw $a0, 0($sp) sub $a0, $a0, 1 jal fact return: jr $ra $sp Return address $a0 (= X) C code snippetC code snippet z = fact(x); int fact(int n) { if (n < 1) return(1); else return(n * fact(n-1)) } What happens after returning from the procedure ???
  • 25. Pop from the Stack C code snippetC code snippet z = fact(x); int fact(int n) { if (n < 1) return(1); else return(n * fact(n-1)) } MIPS snippetMIPS snippet li $v0, 1 j fact fact: beq $a0, $v0, return sub $sp, $sp, 8 sw $ra, 4($sp) sw $a0, 0($sp) sub $a0, $a0, 1 jal fact lw $a0, 0($sp) lw $ra, 4($sp) mult $a0, $v0 mflo $v0 add $sp, $sp, 8 return: jr $ra$sp Return address $a0 (= X)
  • 26. Recursive call for Factorial C code snippetC code snippet z = fact(x); int fact(int n) { if (n < 1) return(1); else return(n * fact(n-1)) } MIPS snippetMIPS snippet li $v0, 1 j fact fact: beq $a0, $v0, return sub $sp, $sp, 8 sw $ra, 4($sp) sw $a0, 0($sp) sub $a0, $a0, 1 jal fact lw $a0, 0($sp) lw $ra, 4($sp) mult $a0, $v0 mflo $v0 add $sp, $sp, 8 return: jr $ra