Upload
peter-sarwat
View
223
Download
0
Embed Size (px)
Citation preview
8/8/2019 CSEN 402 - Ch4 the Processor_4509
1/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 1
Dr.MohamedF.Ahmed
Chapter4TheProcessor
CPUperformancefactors
4.1In
troduction
Instructioncount DeterminedbyISAandcompiler
CPIandCycletime DeterminedbyCPUhardware
WewillexaminetwoMIPSimplementations Asimplifiedversion
Amore
realistic
i elined
version
Simplesubset,showsmostaspects Memoryreference:lw,sw Arithmetic/logical:add,sub,and,or,slt Controltransfer:beq,j
Chapter 4 The Processor 2Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
2/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 2
PC instructionmemory,fetchinstruction
Registernumbers registerfile,readregisters Dependingoninstructionclass
UseALUtocalculate
Arithmeticresult
Memoryaddressforload/store
Accessdatamemoryforload/store
PC targetaddressorPC+4
Chapter 4 The Processor 3Thursday, April 22, 2010
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
3/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 3
Cant just join
w res oge er
Use multiplexers
Chapter 4 The Processor 3Thursday, April 22, 2010
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
4/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 4
Informationencodedinbinary
4.2L
ogicD
esign
Co
Lowvoltage=0,Highvoltage=1
Onewireperbit
Multibitdataencodedonmultiwirebuses
Combinationalelement O erateondata
nv
en
tion
s
Outputisafunctionofinput
State(sequential)elements Storeinformation
Chapter 4 The Processor 3Thursday, April 22, 2010
ANDgate
A
Y+ Adder
A
BY
Multiplexer
=
Arithmetic/Logic Unit
Y = F(A, B)
Chapter 4 The Processor 3
I0
I1Y
M
u
x
S
A
B
YALU
F
Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
5/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 5
Register:stores
data
in
acircuit
Usesac oc signa to eterminew entoup atethestoredvalue
Edgetriggered:updatewhenClk changesfrom0to1
Clk
Chapter 4 The Processor 3
Clk
D
Q
Thursday, April 22, 2010
Combinationallogictransformsdataduring
Betweenclockedges
Inputfromstateelements,outputtostateelement
Longestdelaydeterminesclockperiod
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
6/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 6
Data ath
4.3B
uildin
ga
Datap
ElementsthatprocessdataandaddressesintheCPU
Registers,ALUs,muxs,memories,
WewillbuildaMIPSdatapath incrementally
ath
Chapter 4 The Processor 3Thursday, April 22, 2010
Increment by
4 for next
instruction
Chapter 4 The Processor 3
-
register
Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
7/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 7
Readtwo
register
operands
Writeregisterresult
Chapter 4 The Processor 3Thursday, April 22, 2010
Readregisteroperands Calculateaddressusin 16bitoffset
UseALU,butsignextendoffset
Load:Readmemoryandupdateregister Store:Writeregistervaluetomemory
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
8/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 8
Readre istero erands Compareoperands
UseALU,subtractandcheckZerooutput
Calculatetargetaddress
Signextenddisplacement
t e t2p aces wor sp acement
AddtoPC+4
Alreadycalculated
by
instruction
fetch
Chapter 4 The Processor 3Thursday, April 22, 2010
Just
re-routes
wires
Chapter 4 The Processor 3
Sign-bit wire
replicated
Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
9/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor
Firstcutdata athdoesaninstructioninoneclockcycle
Eachdatapath elementcanonlydoonefunctionatatime
Hence,weneedseparateinstructionanddata
Usemultiplexerswherealternatedata
sourcesare
used
for
different
instructions
Chapter 4 The Processor 3Thursday, April 22, 2010
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
10/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 10
Chapter 4 The Processor 3Thursday, April 22, 2010
ALUusedfor
=
4.4A
Sim
pleIm
plem
Branch:F=subtract
Rtype:Fdependsonfunct field
en
tation
Sch
em
eALU control Function
0000 AND
Chapter 4 The Processor 3
0010 add
0110 subtract
0111 set-on-less-than
1100 NOR
Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
11/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 11
Controlsignals
derived
from
instruction
0 rs rt rd shamt funct
31:26 5:025:21 20:16 15:11 10:6
35 or 43 rs rt address
31:26 25:21 20:16 15:0
R-type
Load/
Store
Chapter 4 The Processor 3
31:26 25:21 20:16 15:0
ranc
opcode always
read
read,
except
for load
write for
R-type
and load
sign-extend
and add
Thursday, April 22, 2010
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
12/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 12
Chapter 4 The Processor 3Thursday, April 22, 2010
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
13/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 13
Chapter 4 The Processor 3Thursday, April 22, 2010
2 address
31:26 25:0
Jump
Jumpuseswordaddress UpdatePCwithconcatenationof
Top4bitsofoldPC
26bitjumpaddress
00
Needanextracontrolsignaldecodedfromopcode
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
14/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Cha ter 4 The Processor 14
Chapter 4 The Processor 3Thursday, April 22, 2010
Lon estdela determinesclock eriod
Criticalpath:loadinstruction
Instructionmemory registerfileALU datamemory registerfile
Notfeasibletovaryperiodfordifferent
Violatesdesignprinciple
Makingthecommoncasefast
Wewillimproveperformancebypipelining
Chapter 4 The Processor 3Thursday, April 22, 2010
8/8/2019 CSEN 402 - Ch4 the Processor_4509
15/15
CSEN 402 Computer Organization & Design
Spring 2010
22 April, 2010
Dr.MohamedF.Ahmed
Chapter4TheProcessor