Lesson 10
Processors Continued
�Building a datapath�
Two state elements are needed to store and access instructions, and an adder is needed to compute the next instruction address
A portion of the datapath used for fetching instructions and incrementing the program counter
To execute any instruction, we must start by fetching the instruction from memory.
Register files�
A register file with two read ports and one write port has five inputs and two outputs
The two elements needed to implement R-format ALU operations are the register file and the ALU
Sign-extend:
Two units needed to implement loads and stores
Datapath for a branch uses the ALU to evaluate the branch condition and a separate adder to compute the branch target as the sum of the incremented PC and the sign-extended
The datapath for the memory instructions and the R-type instructions
�Pipelining�
non-pipelined approach to laundry
non-pipelined approach to laundry
pipelined approach to laundry
Pipelining in Processors
Total time for each instruction calculated from the time for each component
Pipelining Speed-up Formula
Pipelining improves performance by increasing instruction throughput
�Pipeline hazards�
Structural hazard
Data hazards
add $s0, $t0, $t1
sub $t2, $s0, $t3
Forwarding:
Data Hazard continued
Data Hazard
Data Hazard
Control Hazards
�Parallelism via instructions�
Two major ways to implement a multiple-issue processor
Reading