Slot24 25 CH14 ProcessorStructureAndFunction 42 Slots
Slot24 25 CH14 ProcessorStructureAndFunction 42 Slots
Processor
Chapter Structure and
14 Function
William Stallings, Computer Organization and Architecture, 9 Edition
th
+ 2
Objectives
Contents
■14.1 Processor Organization
■14.2 Register Organization
■14.3 Instruction Cycle
■14.4 Instruction Pipelining
+ 4
User-Visible Registers
Categories:
• General purpose
Referenced by means of the • Can be assigned to a variety of functions by the
programmer
machine language that the • Data
processor executes • May be used only to hold data and cannot be employed in
the calculation of an operand address
• Address
• May be somewhat general purpose or may be devoted to a
particular addressing mode
• Examples: segment pointers, index registers, stack
pointer
• Condition codes
• Also referred to as flags
• Bits set by the processor hardware as the result of
operations
8
Status
Common fields or flags include:
information are
• Sign
• Zero used to give a
• Carry decision for
• Equal
• Overflow branching
• Interrupt Enable/Disable
• Supervisor
11
Example
Microprocessor
Register
Organizations
14.3- 12
Loop due to
additional memory
accesses
14
Pipeline Operation
I: Instruction
O: operand
F: Fetch
C: Calculate
E: Execute
W: Write
The Effect of a Conditional 21
I3 is a
conditional
branch to
I15
+
Speedup number of
instructions that are
Factors executed without a
with branch
Instructio
n
Pipelining
A resource hazard is
sometimes referred to FO is accessing memory. So, this step is idle
as a structural
Data Hazards 27
X86
Hazard
instruction
+
+ Types of Data Hazard 28
Control Hazard
■Also known as a branch hazard
Drawbacks:
• With multiple pipelines there are contention delays for access to the
registers and to memory
• Additional branch instructions may enter the pipeline before the
original branch decision is resolved
31
■Benefits:
Similar in principle to
■Instructions fetched in sequence
a cache dedicated to
will be available without the usual
memory access time instructions. Differences:
• The loop buffer only
■If a branch occurs to a target just a
retains instructions in
few locations ahead of the address sequence
of the branch instruction, the target • Is much smaller in size
will already be in the buffer and hence lower in cost
■This strategy is particularly well
suited to dealing with loops
+ 33
Branch Prediction
Diagram
The decision process
can be represented
more compactly by a
finite-state machine
Finite-state machine is a
way to express a
processing mechanism
in which each part of
input will determine a
step of the process.
Some bits are stored: 0: Not taken, 1: Taken. A history can be as 01110
+Dealing
With
Branches
sequential address.
Match: a prediction is
made based on the state of
the instruction: Either the
next sequential address or
the branch target address is
fed to the select logic.
+ Delayed Branch 37
■ Fetch
■ Objective is to fill the prefetch buffers with new data as soon as the
old data have been consumed by the instruction decoder
■ Operates independently of the other stages to keep the prefetch
buffers full
■ Decode stage 1
■ All opcode and addressing-mode information is decoded in the D1
stage
■ 3 bytes of instruction are passed to the D1 stage from the prefetch
buffers
■ D1 decoder can then direct the D2 stage to capture the rest of the
instruction
■ Decode stage 2
■ Expands each opcode into control signals for the ALU
■ Also controls the computation of the more complex addressing modes
■ Execute
■ Stage includes ALU operations, cache access, and register update
■ Write back
+
80486
Instructio
n
Pipeline
Examples
+ 40
Exercises
■14.1 What general roles are performed by processor
registers?
Exercises
14.8 - what would be the value of the following flags:
Carry, Zero, Overflow, Sign, Even Parity , Half-Carry ?
Structure and
Function
Chapter 14
■Processor ■Instruction
organization pipelining
■Pipelining strategy
■Register ■Pipeline
organization performance
■User-visible ■Pipeline hazards
registers
■Dealing with
■Control and status branches
registers
■Intel 80486
■Instruction cycle pipelining
■The indirect cycle