William Stallings �Computer Organization �and Architecture�7th Edition
Chapter 12
CPU Structure and Function
CPU Structure
CPU With Systems Bus
CPU Internal Structure
Registers
User Visible Registers
General Purpose Registers (1)
General Purpose Registers (2)
How Many GP Registers?
How big?
Condition Code Registers (Flags)
Control & Status Registers
Program Status Word
🡺 These flags are available in low level programming languages
Supervisor Mode
Other Registers
Example Register Organizations
Instruction Cycle
Indirect Cycle
Instruction Cycle with Indirect
Instruction Cycle State Diagram
Data Flow (Instruction Fetch)
Data Flow (Data Fetch)
Data Flow (Fetch Diagram)
Data Flow (Indirect Diagram)
Data Flow (Execute)
Interrupt sequence
Data Flow (Interrupt)
Data Flow (Interrupt Diagram)
Prefetch
Improved Performance
INC R1
ADD (100)
SUB R3
DIV (200)
LOAD R6
XYZ: MOVE R1,-3
ADD (100)
ISZ R1
JMP XYZ
DIV (200)
LOAD R6
Pipelining
INC R1
ADD (100)
SUB R3
DIV (200)
Lab: INC R1
ADD (100)
JMP Lab
DIV (200)
Lab: MOV R1,50
BRE R1,R2,Lab
Lab2 SUB X,Y
BRZ LAB2
Two Stage Instruction Pipeline
Timing Diagram for �Instruction Pipeline Operation
The Effect of a Conditional Branch on Instruction Pipeline Operation
The Effect of an Unconditional Branch on the Instruction Pipeline Operation
Six Stage �Instruction Pipeline
Alternative Pipeline Depiction
Speedup Factors�with Instruction�Pipelining
Dealing with Branches
Multiple Streams
Prefetch Branch Target
Loop Buffer
for( int i=0; i<10; i++)
{
..
..
..
..
..
}
Loop Buffer Diagram
Branch Prediction (1)
Branch Prediction (2)
Branch Prediction (3)
Branch Prediction Flowchart
Branch Prediction State Diagram
Dealing With �Branches
Intel 80486 Pipelining
80486 Instruction Pipeline Examples
Pentium 4 Registers
EFLAGS Register
Control Registers
MMX Register Mapping
Mapping of MMX Registers to �Floating-Point Registers
Pentium Interrupt Processing
PowerPC User Visible Registers
PowerPC Register Formats
Foreground Reading