glforlPerformancel(11thlEdition).lStallings
TABLElOFlCONTENTS
Chapterl1l Introduction............................................................................................ 5
Chapterl2l ComputerlEvolutionlandlPerformance............................................... 6
Chapterl3l ComputerlFunctionlandlInterconnection ......................................... 14
Chapterl4l CachelMemory ..................................................................................... 19
Chapterl5l InternallMemory .................................................................................. 32
Chapterl6l ExternallMemory ................................................................................. 38
Chapterl7l Input/Output ........................................................................................ 43
Chapterl8l OperatinglSystemlSupport ................................................................. 50
Chapterl9l ComputerlArithmetic .......................................................................... 57
Chapterl10l InstructionlSets:lCharacteristicslandlFunctions ............................. 69
Chapterl11l InstructionlSets:lAddressinglModeslandlFormats......................... 80
Chapterl12l ProcessorlStructurelandlFunction ................................................... 85
Chapterl13l ReducedlInstructionlSetlComputers ............................................... 92
Chapterl14l Instruction-LevellParallelismlandlSuperscalarlProcessors .......... 97
Chapterl15l ControllUnitlOperation ................................................................... 103
Chapterl16l MicroprogrammedlControl............................................................ 106
Chapterl17l ParallellProcessing ........................................................................... 109
Chapterl18l MulticorelComputers ...................................................................... 118
Chapterl19l NumberlSystems.............................................................................. 121
Chapterl20l DigitallLogic ..................................................................................... 122
Chapterl21l ThelIA-64lArchitecture .................................................................... 126
AppendixlBl AssemblylLanguagelandlRelatedlTopics .................................... 130
-4-
, CHAPTER 1 INTRODUCTION L L
ANSWERS TO QUESTIONS
l l l l l l l l l l l l l ll l l l
1.1 Computerlarchitecturelrefersltolthoselattributesloflalsystemlvisibleltolalprogramm
erlor,lputlanotherlway,lthoselattributeslthatlhavelaldirectlimpactlonlthellogicallexec
utionloflalprogram.lComputerlorganizationlrefersltoltheloperationallunitslandlthei
rlinterconnectionslthatlrealizelthelarchitecturallspecifications.lExamplesloflarchitec
turallattributeslincludelthelinstructionlset,lthelnumberloflbitslusedltolrepresentlvari
ousldataltypesl(e.g.,lnumbers,lcharacters),lI/Olmechanisms,landltechniqueslforladd
ressinglmemory.lOrganizationallattributeslincludelthoselhardwareldetailsltranspar
entltolthelprogrammer,lsuchlaslcontrollsignals;linterfaceslbetweenlthelcomputerlan
dlperipherals;landlthelmemoryltechnologylused.
1.2 Computerlstructurelrefersltolthelwaylinlwhichlthelcomponentsloflalcomputerlareli
nterrelated.lComputerlfunctionlrefersltoltheloperationlofleachlindividuallcompon
entlaslpartloflthelstructure.
1.3 Datalprocessing;ldatalstorage;ldatalmovement;landlcontrol.
1.4 Centrallprocessinglunitl(CPU):lControlsltheloperationloflthelcomputerlandlp
erformslitsldatalprocessinglfunctions;loftenlsimplylreferredltolaslprocessor.lM
ainlmemory:lStoresldata.
I/O:lMovesldatalbetweenlthelcomputerlandlitslexternallenvironment.lSysteml
interconnection:lSomelmechanismlthatlprovideslforlcommunicationlamongl
CPU,lmainlmemory,landlI/O.lAlcommonlexampleloflsystem
interconnectionlislbylmeansloflalsystemlbus,lconsistingloflalnumberloflconductinglw
iresltolwhichlalllthelotherlcomponentslattach.
1.5 Controllunit:lControlsltheloperationloflthelCPUlandlhencelthelcomputerlAr
ithmeticlandllogiclunitl(ALU):lPerformslthelcomputer’sldatalprocessinglfun
ctions
Registers:lProvideslstoragelinternalltolthelCPU
CPUlinterconnection:lSomelmechanismlthatlprovideslforlcommunicationlamonglth
elcontrollunit,lALU,landlregisters
-5-
, CHAPTER 2 COMPUTER EVOLUTION AND
L L L L
PERFORMANCE
ANSWERS TO QUESTIONS
l l l l l l l l l l l l l ll l l l
2.1 Inlalstoredlprogramlcomputer,lprogramslarelrepresentedlinlalformlsuitablelforlstorin
glinlmemorylalongsideltheldata.lThelcomputerlgetslitslinstructionslbylreadinglthemlfr
omlmemory,landlalprogramlcanlbelsetlorlalteredlbylsettinglthelvaluesloflalportionlofl
memory.
2.2 Almainlmemory,lwhichlstoreslbothldatalandlinstructions:lanlarithmeticlandllogicl
unitl(ALU)lcapablelofloperatinglonlbinaryldata;lalcontrollunit,lwhichlinterpretslthe
linstructionslinlmemorylandlcauseslthemltolbelexecuted;landlinputlandloutputl(I/O
)lequipmentloperatedlbylthelcontrollunit.
2.3 Gates,lmemorylcells,landlinterconnectionslamonglgateslandlmemorylcells.
2.4 Moorelobservedlthatlthelnumberlofltransistorslthatlcouldlbelputlonlalsinglelchipl
wasldoublingleverylyearlandlcorrectlylpredictedlthatlthislpacelwouldlcontinuelin
tolthelnearlfuture.
2.5 Similarlorlidenticallinstructionlset:lInlmanylcases,lthelsamelsetloflmachinelinstru
ctionslislsupportedlonlalllmembersloflthelfamily.lThus,lalprogramlthatlexecuteslon
lonelmachinelwilllalsolexecutelonlanylother.lSimilarlorlidenticalloperatinglsyste
m:lThelsamelbasicloperatinglsystemlislavailablelforlalllfamilylmembers.lIncreasin
glspeed:lThelrateloflinstructionlexecutionlincreaseslinlgoinglfromllowerltolhigherlf
amilylmembers.lIncreasinglNumberloflI/Olports:lInlgoinglfromllowerltolhigherlf
amilylmembers.lIncreasinglmemorylsize:lInlgoinglfromllowerltolhigherlfamilylm
embers.lIncreasinglcost:lInlgoinglfromllowerltolhigherlfamilylmembers.
2.6 Inlalmicroprocessor,lallloflthelcomponentsloflthelCPUlarelonlalsinglelchip.
ANSWERS TO PROBLEMS
l l l l l l l l l l l l l l l l l
2.1 Thislprogramlisldevelopedlinl[HAYE98].l ThelvectorslA,lB,landlClareleachlstoredli
nl1,000lcontiguousllocationslinlmemory,lbeginninglatllocationsl1001,l2001,landl300
1,lrespectively.lThelprogramlbeginslwithlthelleftlhalflofllocationl3.lAlcountinglvari
ablelNlislsetltol999landldecrementedlafterleachlstepluntillitlreachesl–
1.lThus,lthelvectorslarelprocessedlfromlhighllocationltollowllocation.
-6-
, Location Instruction Comments
0 999 Constantl(countlN)
1 1 Constant
2 1000 Constant
3L LOAD M(2000) TransferlA(I)ltolAC
3R ADDlM(3000) Computel A(I)l +l B(I)
4L STORlM(4000) TransferlsumltolC(I)
4R LOADlM(0) LoadlcountlN
5L SUBlM(1) DecrementlNlbyl1
5R JUMP+l M(6,l 20:39) TestlNlandlbranchltol6Rliflnonnegative
6L JUMPlM(6,l0:19) Halt
6R STORlM(0) UpdatelN
7L ADDlM(1) IncrementlAClbyl1
7R ADDlM(2)
8L STORlM(3,l8:19) Modifyladdresslinl3L
8R ADDlM(2)
9L STORlM(3,l28:39) Modifyladdresslinl3R
9R ADDlM(2)
10L STORlM(4,l8:19) Modifyladdresslinl4L
10R JUMPlM(3,l0:19) Branchltol3L
2.2 a.
Opcode Operand
00000001 000000000010
b.l First,lthelCPUlmustlmakelaccesslmemoryltolfetchlthelinstruction.lThelinstructionl
containsltheladdresslofltheldatalwelwantltolload.lDuringlthelexecutelphaselaccess
eslmemoryltolloadltheldatalvaluellocatedlatlthatladdresslforlaltotallofltwoltripsltol
memory.
2.3
Tolreadlalvaluelfromlmemory,lthelCPUlputsltheladdressloflthelvaluelitlwantsli
ntolthelMAR.lThelCPUlthenlassertslthelReadlcontrolllineltolmemorylandlplaceslthel
addresslonltheladdresslbus.lMemorylplaceslthelcontentsloflthelmemoryllocationlpa
ssedlonltheldatalbus.lThisldatalislthenltransferredltolthelMBR.lTolwritelalvalueltolm
emory,lthelCPUlputsltheladdressloflthelvaluelitlwantsltolwritelintolthelMAR.lThelC
PUlalsolplacesltheldatalitlwantsltolwritelintolthelMBR.lThelCPUlthenlassertslthelWri
telcontrolllineltolmemorylandlplacesltheladdresslonltheladdresslbuslandltheldatalon
ltheldatalbus.lMemoryltransfersltheldatalonltheldatalbuslintolthelcorrespondinglme
moryllocation.
-7-