ProcessorDesign
buildingblocks
building blocks
Asimpleimplementation:SingleCycle
Datapathandcontrol
Data path and control
Performanceconsiderations
Multicycledesign
M lti
l d i
Datapathandcontrol
Microprogrammedcontrol
Mi
d
t l
Exceptionhandling
2
MIPSsubsetforimplementation
MIPS
subset for implementation
Designoverview
Divisionintodatapathandcontrol
i ii i
d
h d
l
Buildingblocks combinationalandsequential
Clockandtimings
Components required for MIPS subset
ComponentsrequiredforMIPSsubset
add,sub,and,or,slt
Memoryreferenceinstructions
Memory reference instructions
lw,sw
Controlflowinstructions
C t l fl i t ti
beq,j
Incrementalchangesinthedesigntoinclude
otherinstructionswillbediscussedlater
Generic Implementation
GenericImplementation
Usetheprogramcounter(PC)tosupply
p g
( )
pp y
instructionaddress
Gettheinstructionfrommemoryy
Readregisters
Usetheinstructiontodecideexactlywhatto
Use the instruction to decide exactly what to
do
Design overview
Designoverview
PC
Instruction
Memory
Data
Instruction
Reg#
Address
Register
Reg# FILE
Address
ALU
Reg#
Data
Memory
Data
DATAPATH
control
signals
status
signals
CONTROLLER
Elementsthatcontainstate(sequential)
Outputisfunctionofcurrentandpreviousinputs
Output is function of current and previous inputs
State=memory
Gates:and,or,nand,nor,xor,inverter
Gates:
and or nand nor xor inverter
Multiplexer
p
Decoder
Adder,subtractor,comparator
ALU
Arraymultipliers
Unclocked stateelement
state element
Statechangescanoccurwithchangesinother
inputs
falling edge
cycle time
rising edge
Unclocked stateelements
state elements
C
_
Q
_
Q
D
D
C
Q
D
C
D
C
Q
D
la tch
Q
D
latch _
C
Q
Q
_
Q
Clockandtimings
g
D
Set-up time
Hold time
State
State
Element
1
Cl k C l
ClockCycle
Combinational
Logic
State
State
Element
2
Register
Adder
ALU
Multiplexer
R i t fil
Registerfile
Programmemory
Datamemory
Bitmanipulationcomponents
PC
32
32
clock
PC
32
32
+
32
32
offset
32
32
overflow
32
result
ALU
b
32
32
mux
PC+4+offset
1
32
select
32
Register
Number
ReadReg 1
ReadReg 2
Read
Data1
Registers
32
Data
W it R
WriteReg
Read
Data2
Data
32
Writedata
Reg Write
Write
32
MIPSComponents:Programmemory
S Co po e ts: og a
e oy
Instruction
Address
Instruction
Memory
Instruction
Address
dd
Data
Memory
Write
data
Mem
R d
Read
Read
data
MIPSComponents
Bitmanipulationcircuits
i
i l i
i i
16
sign
xtend
MSB
32
LSB
MSB
32
32
shift
0
LSB