PART14
PART14
William Stallings
Computer Organization
and Architecture
10th Edition
© 2016 Pearson Education, Inc., Hoboken,
NJ. All rights reserved.
+ Chapter 14
Processor Structure and Function
Interpret instruction
The instruction is decoded to determine what action is required
Fetch data
The execution of an instruction may require reading data from memory or an I/O
module
Process data
The execution of an instruction may require performing some arithmetic or logical
operation on data
Write data
The results of an execution may require writing data to memory or an I/O module
ALU
Control
Unit
System
Bus
Status Flags
Registers
Shifter
Arithmetic
and
Boolean
Logic
Control
Unit
Control
Paths
Categories:
Referenced by means of • General purpose
the machine language • Can be assigned to a variety of functions by the
programmer
that the processor • Data
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
(a) MC68000
Interrupt Indirect
Execute
Multiple Multiple
operands results
Interrupt
Interrupt
PC MAR
Memory
Control
Unit
IR MBR
MAR
Memory
Control
Unit
MBR
PC MAR
Memory
Control
Unit
MBR
Discard
(b) Expanded view
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Instruction 1 FI DI CO FO EI WO
Instruction 2 FI DI CO FO EI WO
Instruction 3 FI DI CO FO EI WO
Instruction 4 FI DI CO FO EI WO
Instruction 5 FI DI CO FO EI WO
Instruction 6 FI DI CO FO EI WO
Instruction 7 FI DI CO FO EI WO
Instruction 8 FI DI CO FO EI WO
Instruction 9 FI DI CO FO EI WO
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Instruction 1 FI DI CO FO EI WO
Instruction 2 FI DI CO FO EI WO
Instruction 3 FI DI CO FO EI WO
Instruction 4 FI DI CO FO
Instruction 5 FI DI CO
Instruction 6 FI DI
Instruction 7 FI
Instruction 15 FI DI CO FO EI WO
Instruction 16 FI DI CO FO EI WO
Decode
DI Instruction
Calculate
CO Operands
Yes Uncon-
ditional
Branch?
No
Fetch
FO Operands
Execute
EI Instruction
Update Write
PC
WO Operands
Empty
Pipe Yes Branch No
or
Inter
-rupt?
1 I1 1 I1
2 I2 I1 2 I2 I1
3 I3 I2 I1 3 I3 I2 I1
4 I4 I3 I2 I1 4 I4 I3 I2 I1
5 I5 I4 I3 I2 I1 5 I5 I4 I3 I2 I1
6 I6 I5 I4 I3 I2 I1 6 I6 I5 I4 I3 I2 I1
Time
7 I7 I6 I5 I4 I3 I2 7 I7 I6 I5 I4 I3 I2
8 I8 I7 I6 I5 I4 I3 8 I15 I3
9 I9 I8 I7 I6 I5 I4 9 I16 I15
10 I9 I8 I7 I6 I5 10 I16 I15
11 I9 I8 I7 I6 11 I16 I15
12 I9 I8 I7 12 I16 I15
13 I9 I8 13 I16 I15
14 I9 14 I16
10 k = 12 stages
Speedup factor
8
k = 9 stages
6
k = 6 stages
4
0
1 2 4 8 16 32 64 128
Number of instructions (log scale)
(a)
14
12
n = 30 instructions
10
Speedup factor
8 n = 20 instructions
6
n = 10 instructions
4
0
0 5 10 15 20
Number of stages
(b)
Also referred to as a
pipeline bubble
Instrutcion
I2 FI DI FO EI WO
I3 FI DI FO EI WO
I4 FI DI FO EI WO
Clock cycle
1 2 3 4 5 6 7 8 9
I1 FI DI FO EI WO
Instrutcion
I2 FI DI FO EI WO
I3 Idle FI DI FO EI WO
I4 FI DI FO EI WO
I3 FI DI FO EI WO
I4 FI DI FO EI WO
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
Benefits:
Instructions fetched in sequence will be available without the
usual memory access time
If a branch occurs to a target just a few locations ahead of the
address of the branch instruction, the target will already be in the
buffer
This strategy is particularly well suited to dealing with loops
Instruction to be
8 decoded in case of hit
Loop Buffer
(256 bytes)
No Yes
Yes
Not Taken
Taken
Not Taken
Predict Predict Not Taken
Not Taken Not Taken
Taken
Select
Memory
E Branch Miss
Handling
Next sequential
address
IPFAR Branch
instruction Target
address address State
Select
Lookup
Memory
Update
state
Decode stage 1
All opcode and addressing-mode 3 bytes of instruction are passed to the D1 D1 decoder can then direct the D2 stage to
information is decoded in the D1 stage stage from the prefetch buffers capture the rest of the instruction
Decode stage 2
Also controls the computation of the more complex addressing
Expands each opcode into control signals for the ALU
modes
Execute
Write back
Updates registers and status flags modified during the preceding execute stage
MMX Registers
Exceptions
Generated from software and is provoked by the execution of an
instruction
Processor detected
Programmed
Unshaded: exceptions
Shaded: interrupts
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
+ The ARM Processor
ARM is primarily a RISC system with the following
attributes:
Moderate array of uniform registers
Sign
R15 (PC) Incrementer
extend
Rd
User Register File (R0 - R15)
Rn Rm Acc
Instruction register
Barrel
shifter
Instruction
decoder
Multiply/
ALU
accumulate
Control
unit
CPSR
Shading indicates that the normal register used by User or System mode has been replaced by an
alternative register specific to the exception mode.