Instruction Fetch Execute Cycle Tutorial - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Instruction Fetch Execute Cycle Tutorial

Description:

Instruction Fetch Execute Cycle Tutorial. Bosky Agarwal. CS 518. Key Points. Once started, a computer continuously performs the following: ... – PowerPoint PPT presentation

Number of Views:1572
Avg rating:3.0/5.0
Slides: 15
Provided by: coe288
Category:

less

Transcript and Presenter's Notes

Title: Instruction Fetch Execute Cycle Tutorial


1
Instruction Fetch Execute Cycle Tutorial
  • Bosky Agarwal
  • CS 518

2
Key Points
  • Once started, a computer continuously performs
    the following
  • Fetch next instruction from memory
  • Decode the instruction
  • Execute the instruction
  • Special purpose registers used
  • PC Program Counter to hold address of next
    instruction to be fetched
  • MBR Memory Buffer Register for value to be
    read/written from/to memory
  • IR Instruction Register to contain opcode of the
    last Instruction

3
Basic Instruction Cycle
Memory
Fetching
CPU
Execution
4
Fetch Cycle
PC
PC
Memory
IR
MBR
Memory Buffer Register
5
Execute Cycle
e.g Execute a simple instruction Load A, 1234H
IR
Memory
A
MBR
6
Walkthrough of Instruction Fetch Execute Cycle
Control Unit
ALU
PC 1000H
Memory
1000H add 512H, 435H, 867H
PC initialized to 1000H which holds the
instruction
Add values stored in addresses 512H and 435H and
store result in 867H
7
Fetch Cycle Example
Move instruction from memory to Control Unit
Control Unit
ALU
PC 1000
add 512H, 435H, 867H
Memory
1000H add 512H, 435H, 867H
8
Decode Cycle Example
Decode instruction by parsing the addresses of
operands
ALU
512H 435H 867H

9
Decode Cycle (contd.)
Fetch the stored value of operands from
corresponding memory address
Determine the type of operation to be performed
Control Unit
ALU
PC 1001
512H 5 435H 2 867H

add 512H, 435H, 867H
Memory
512H 5 467H 2
10
Execute Cycle Example
Execute the instruction
ALU
512H 5 435H 2

11
Execute Cycle (contd.)
Store the result back in memory
ALU
867H 7
Memory
867H 7
12
Basic Instruction Cycle (contd.)
Begin
Fetch Next Instruction
Decode Instruction
Execute Instruction
13
Complete Instruction Cycle
Begin
Fetch Instr. from PC
  • Raise Exception/Interrupt
  • Save PC
  • Load PC with pre-determined value
  • Set us bit 1

IR Instruction
Increment PC
No
Decode Instruction
Yes
No
Yes
Execute Instruction
No
Yes
14
System Bootup
Boot Loader
Power On
ROM
Fetch Instr. from PC
Boot Loader Running
DISK
MEMORY
OS
LILO/GRUB
MBR
OS loads itself to memory now
Master Boot Record
Write a Comment
User Comments (0)
About PowerShow.com