Chapter 3 - Pipelining-And-Vector-Processing
Chapter 3 - Pipelining-And-Vector-Processing
CHAPTER 3
-T.KAVITHA,
ASSOC.PROF.
MVSREC
CHARACTERISTICS OF RISC
- Relatively few instructions
- Relatively few addressing modes
- Memory access limited to load and store instructions
- All operations done within the registers of the CPU
- Fixed-length, easily decoded instruction format
- Single-cycle instruction format
- Hardwired rather than micro programmed control
More RISC Characteristics
-A relatively large numbers of registers in the processor unit.
-Efficient instruction pipeline
-Compiler support: provides efficient translation of high-level Language
programs into machine language programs.
Advantages of RISC
- VLSI Realization
- Computing Speed
- Design Costs and Reliability
- High Level Language Support
• Parallel Processing
• Pipelining
• Arithmetic Pipeline
• Instruction Pipeline
• RISC Pipeline
• Vector Processing
PARALLEL PROCESSING
Parallel processing is a term used to denote a large class of techniques that are
used to provide simultaneous data-processing tasks for the purpose of increasing
Computational speed of a computer system.
- Inter-Instruction level
- Intra-Instruction level
PARALLEL COMPUTERS
Architectural Classification
– Flynn's classification
» Based on the multiplicity of Instruction Streams and Data
Streams
» Instruction Stream
• Sequence of Instructions read from memory
» Data Stream
• Operations performed on the data in the processor
VLIW
MISD Nonexistence
Systolic arrays
Dataflow
Associative processors
Message-passing multicomputers
Hypercube
Mesh
Reconfigurable
Instruction stream
Characteristics
- Standard von Neumann machine
- Instructions and data are stored in memory
- One operation at a time
Limitations
Von Neumann bottleneck
M CU P
M CU P
Memory
• •
• •
• •
M CU P Data stream
Instruction stream
Characteristics
- There is no computer at present that can be
classified as MISD
Control Unit
Instruction stream
Data stream
Alignment network
Characteristics
- Only one copy of the program exists
- A single controller executes one instruction at a time
Interconnection Network
Shared Memory
Characteristics
- Multiple processing units
- Message-passing multicomputers
Multiple-Functional Units
PIPELINING
A technique of decomposing a sequential process into sub operations, with
each sub process being executed in a partial dedicated segment that
operates concurrently with all other segments.
Ai * Bi + Ci for i = 1, 2, 3, ... , 7
Ai Bi Memory Ci
Segment 1
R1 R2
Multiplier
Segment 2
R3 R4
Adder
Segment 3
R5
GENERAL PIPELINE
General Structure of a 4-Segment Pipeline
Clock
Input S1 R1 S2 R2 S3 R3 S4 R4
Space-Time Diagram
1 2 3 4 5 6 7 8 9 Clock cycles
Segment 1 T1 T2 T3 T4 T5 T6
2 T1 T2 T3 T4 T5 T6
3 T1 T2 T3 T4 T5 T6
4 T1 T2 T3 T4 T5 T6
PIPELINE SPEEDUP
n: Number of tasks to be performed
Speedup The remaining (n-1) tasks emerge from the pipe at the rate of
one task per clock cycle and will be completed in (n-1)tp.
Sk: Speedup
Sk = n*tn / (k + n - 1)*tp If ‘n’ becomes larger than K-1 and K+n-1 approaches
The value of ‘n’.
tn
lim Sk = ( = k, if tn = k * tp )
n tp
Pipelined System
(k + n - 1)*tp = (4 + 99) * 20 = 2060nS
Non-Pipelined System
n*k*tp = 100 * 80 = 8000nS
Speedup
Sk = 8000 / 2060 = 3.88
ARITHMETIC PIPELINE
Floating-point adder Exponents Mantissas
a b A B
X = A x 2a
Y = B x 2b
R R
[1] Compare the exponents
[2] Align the mantissa
[3] Add/sub the mantissa Compare Difference
Segment 1: exponents
[4] Normalize the result by subtraction
R
X=0.95404x103
Y=0.8200x102
Segment 2: Choose exponent Align mantissa
1.The two exponents are subtracted
in the first segment. R
INSTRUCTION CYCLE
Six Phases* in an Instruction Cycle
[1] Fetch an instruction from memory
[2] Decode the instruction
[3] Calculate the effective address of the operand
[4] Fetch the operands from memory
[5] Execute the operation
[6] Store the result in the proper place
INSTRUCTION PIPELINE
i FI DA FO EX
i+1 FI DA FO EX
i+2 FI DA FO EX
Pipelined
i FI DA FO EX
i+1 FI DA FO EX
i+2 FI DA FO EX
Decode instruction
Segment2: and calculate
effective address
yes Branch?
no
Fetch operand
Segment3: from memory
Interrupt yes
Interrupt?
handling
no
Update PC
Empty pipe
Step: 1 2 3 4 5 6 7 8 9 10 11 12 13
Instruction 1 FI DA FO EX
2 FI DA FO EX
(Branch) 3 FI DA FO EX
4 FI FI DA FO EX
5 FI DA FO EX
6 FI DA FO EX
7 FI DA FO EX
Data dependency
R1 <- B + C ADD DA B,C +
R1 <- R1 + 1
INC DA bubble R1 +1
Control hazards
Branches and other instructions that change the PC
make the fetch of the next instruction to be delayed
JMP ID PC + PC Branch address dependency
bubble IF ID OF OE OS
STRUCTURAL HAZARDS
Structural Hazards(Resource conflicts)
Occur when some resource has not been
duplicated enough to allow all combinations
of instructions in the pipeline to execute
i+1 FI DA FO EX
DATA HAZARDS
Data Hazards
Cont……
Branch Instructions
CONTROL HAZARDS
Prefetch Target Instruction
– Fetch instructions in both streams, instruction to be executed if
branch
not taken and the instruction if branch taken
– Both are saved until branch is executed. Then, select the right
instruction stream and discard the wrong stream