Professional Documents
Culture Documents
04 Instruction Execution Cycle
04 Instruction Execution Cycle
04 Instruction Execution Cycle
2
Instruction Format
Every Instruction has two ingredients:
OpCode
Explicitly Defined Operands: (1, 2 or 3)
3
Program Execution Example
In our example, every instruction has:
OpCode
Only one explicitly defined operand
4
Program Execution Example
Suppose the Instruction Set has 3 instructions only:
1. OpCode=(0001)2=1h: Load AC from the Data Memory
Instruction Format:
OpCode + Address of the Data Memory Location
5
Step 1: Fetching Inst-1
Instruction Memory CPU Registers
300 1940 300 PC
AC
301 5941
302
1940 IR
2941
Data Memory
940 0003
941 0002
6
Step 2: Executing Inst-1
Instruction Memory CPU Registers
300 1940 301 PC
302
1940 IR
2941
Data Memory
940 0003
941 0002
302
5941 IR
2941
Data Memory
940 0003
941 0002
302
5941 IR
2941
Data Memory
3+2=5
940 0003
941 0002
9
Step 5: Fetching Inst-3
Instruction Memory CPU Registers
300 1940 302 PC
302
2941 IR
2941
Data Memory
940 0003
941 0002
10
Step 6: Executing Inst-3
Instruction Memory CPU Registers
300 1940 303 PC
302
2941 IR
2941
Data Memory
940 0003
941 0005
11
+
All Six Steps of the Example Program Execution
12
Instruction Cycle State Diagram
13
+
Classes of Interrupts
14
Program Flow Control
15
Transfer of Control via Interrupts
16
Instruction Cycle With Interrupts
17
+ Program Timing: Short I/O Wait
18
Program Timing: Long I/O Wait
+
19
Instruction Cycle State Diagram With Interrupts
20
Transfer of Control with Multiple Interrupts
21
Time Sequence of Multiple Interrupts
22
23
End of Lectures