Computer Architecture PDF
Computer Architecture PDF
ORGANIZATIONAND
ARCHITECTURE
Thischapterdiscussesthecomputerhardware,
softwareandtheirinterconnection,anditalso
discussesconceptslikecomputertypes,
evolutionofcomputers,functionalunits,basic
operations,RISCandCISCsystems.
BriefHistoryofComputer
Evolution
Twophases:
VLSI = Very Large
1. beforeVLSI 1945 1978 Scale Integration
ENIAC
IAS
IBM
PDP8
2. VLSI 1978 presentday
microprocessors!
Evolution of Computers
FIRSTGENERATION(1945
1955)
Programanddataresideinthesamememory
(storedprogramconcepts JohnvonNeumann)
ALPwasmadeusedtowriteprograms
Vacuumtubeswereusedtoimplementthefunctions
(ALU&CUdesign)
Magneticcoreandmagnetictapestoragedevicesare
used
Usingelectronicvacuumtubes,astheswitching
components
SECONDGENERATION
(1955 1965)
TransistorwereusedtodesignALU&CU
HLLisused(FORTRAN)
ToconvertHLLtoMLLcompilerwereused
SeparateI/Oprocessorweredevelopedtooperatein
parallelwithCPU,thusimprovingtheperformance
Inventionofthetransistorwhichwasfaster,smaller
andrequiredconsiderablylesspowertooperate
THIRDGENERATION
(19651975)
ICtechnologyimproved
ImprovedICtechnologyhelpedindesigninglowcost,high
speedprocessorandmemorymodules
Multiprogramming,pipeliningconceptswereincorporated
DOSallowedefficientandcoordinateoperationofcomputer
systemwithmultipleusers
Cacheandvirtualmemoryconceptsweredeveloped
Morethanonecircuitonasinglesiliconchipbecame
available
FOURTHGENERATION
(19751985)
CPU Termedasmicroprocessor
INTEL,MOTOROLA,TEXAS,NATIONAL
semiconductorsstarteddevelopingmicroprocessor
Workstations,microprocessor(PC)&Notebook
computersweredeveloped
Interconnectionofdifferentcomputerforbetter
communicationLAN,MAN,WAN
Computationalspeedincreasedby1000times
SpecializedprocessorslikeDigitalSignalProcessor
werealsodeveloped
BEYOND THE FOURTH GENERATION
(1985 TILL DATE)
ECommerce,E banking,homeoffice
ARM,AMD,INTEL,MOTOROLA
Highspeedprocessor GHzspeed
BecauseofsubmicronICtechnologylotof
addedfeaturesinsmallsize
COMPUTERTYPES
Computersareclassifiedbasedonthe
parameterslike
Speedofoperation
Cost
Computationalpower
Typeofapplication
DESKTOPCOMPUTER
Processing&storageunits,visualdisplay&audiouits,
keyboards
StoragemediaHarddisks,CDROMs
Eg:Personalcomputerswhichisusedinhomesandoffices
Advantage:Costeffective,easytooperate,suitableforgeneral
purposeeducationalorbusinessapplication
NOTEBOOKCOMPUTER
Compactformofpersonalcomputer(laptop)
Advantageisportability
WORK STATIONS
More computational power than PC
Costlier
Used to solve complex problems which arises in
engineering application (graphics, CAD/CAM etc)
SUPER COMPUTERS
Computer Software
Adevicethatacceptsinput, Acomputerprogramthattells
processesdata,storesdata,and thecomputerhowtoperform
producesoutput,allaccordingto particulartasks.
aseriesofstoredinstructions.
Network
Hardware Twoormorecomputersand
Includestheelectronicand otherdevicesthatare
mechanicaldevicesthatprocess connected,forthepurposeof
thedata;referstothecomputer sharingdataandprograms.
aswellasperipheraldevices.
Peripheraldevices
Usedtoexpandthecomputers
input,outputandstorage
capabilities.
BasicTerminology
Input
Whateverisputintoacomputersystem.
Data
Referstothesymbolsthatrepresentfacts,objects,orideas.
Information
Theresultsofthecomputerstoringdataasbitsandbytes;thewords,
numbers,sounds,andgraphics.
Output
Consistsoftheprocessingresultsproducedbyacomputer.
Processing
Manipulationofthedatainmanyways.
Memory
Areaofthecomputerthattemporarilyholdsdatawaitingtobeprocessed,
stored,oroutput.
Storage
Areaofthecomputerthatholdsdataonapermanentbasiswhenitisnot
immediatelyneededforprocessing.
Basic Terminology
Computershavetwokindsofcomponents:
Hardware,consistingofitsphysicaldevices
(CPU,memory,bus,storagedevices,...)
Software,consistingoftheprogramsithas
(Operatingsystem,applications,utilities,...)
Calvin College
FUNCTIONALUNITSOF
COMPUTER
InputUnit
OutputUnit
CentralprocessingUnit(ALUandControlUnits)
Memory
BusStructure
TheBigPicture
Processor
Input
Control
Memory
ALU
Output
Since1946allcomputershavehad5components!!!
IMPORTANT
Function SLIDE !
ALL computerfunctionsare:
DataPROCESSING
DataSTORAGE Data = Information
DataMOVEMENT
CONTROL Coordinates How
Information is Used
NOTHINGELSE!
INPUT UNIT:
OUTPUT UNIT:
T1 Enable R1
T2 Enable R2
T4
Control unit works with
a reference signal called
T1 processor clock
R1 R2
R2
MEMORY
Two types are RAM or R/W memory and ROM read only memory
BasicFunctionofComputer
ToExecuteagiventaskaspertheappropriateprogram
Programconsistsoflistofinstructionsstoredin
memory
Interconnection between Processor and Memory
Registers
Registers are fast stand-alone storage locations that hold data
temporarily. Multiple registers are needed to facilitate the
operation of the CPU. Some of these registers are
AninterruptisarequestfromI/Odevicefor
servicebyprocessor
Processorprovidesrequestedserviceby
executinginterruptserviceroutine(ISR)
ContentsofPC,generalregisters,andsome
controlinformationarestoredinmemory.
WhenISRcompleted,processorrestored,so
thatinterruptedprogrammaycontinue
BUS STRUCTURE
Connecting CPU and memory
The CPU and memory are normally connected by three
groups of connections, each called a bus: data bus, address
bus and control bus
To
improve performance multibus structure can be
used
0 0 0 0th Location
0 0 1 1st Location
0 1 0
W/R
CS RD 0 1 1
A0 PROCESSOR
A1 1 0 0
A2
1 0 1
ADDRESS BUS
1 1 0
D7 D0
D0 D7
1 1 1
DATA BUS
Cont:-
Clock speed
Example 2
A computer has 128 MB of memory. Each word in this computer
is eight bytes. How many bits are needed to address any single
word in memory?
Solution
The memory address space is 128 MB, which means 227.
However, each word is eight (23) bytes, which means that we
have 224 words. This means that we need log2 224, or 24 bits, to
address each word.
Assignmentofbyteaddresses
LittleEndian(e.g.,inDEC,Intel)
loworderbytestoredatlowestaddress
byte0byte1byte2byte3
Eg:46,78,96,54(32bitdata)
HBYTE LBYTE
8000 54
8001 96
8002 78
8003
46
8004
|
BigEndian
BigEndian(e.g.,inIBM,Motorolla,Sun,HP)
highorderbytestoredatlowestaddress
byte3byte2byte1byte0
Programmers/protocolsshouldbecareful
whentransferringbinarydatabetweenBig
EndianandLittleEndianmachines
Incaseof16bitdata,alignedwordsbeginat
byteaddressesof0,2,4,.
Incaseof32bitdata,alignedwordsbeginat
byteaddressof0,4,8,.
Incaseof64bitdata,alignedwordsbeginat
byteaddressesof0,8,16,..
Insomecaseswordscanstartatanarbitrary
byteaddressalsothen,wesaythatword
locationsareunaligned
MEMORYOPERATIONS
Today,generalpurposecomputers useasetofinstructionscalleda
program toprocessdata.
Acomputerexecutestheprogramtocreateoutputdatafrominput
data
Bothprograminstructionsanddataoperandsarestoredinmemory
Twobasicoperationsrequiresinmemoryaccess
Loadoperation(ReadorFetch)Contentsofspecified
memorylocationarereadbyprocessor
Storeoperation(Write) Datafromtheprocessorisstoredin
specifiedmemorylocation
INSTRUCTIONSETARCHITECTURE:Complete
instructionsetoftheprocessor
BASIC4TYPESOFOPERATION:
Datatransferbetweenmemoryand
processorregister
Arithmeticandlogicoperation
Programsequencingandcontrol
I/Otransfer
Registertransfernotation(RTN)
Transferbetweenprocessorregisters&memory,between
processorregister&I/Odevices
Memorylocations,registersandI/Oregisternamesare
identifiedbyasymbolicnameinuppercasealphabets
LOC,PLACE,MEMaretheaddressofmemorylocation
R1,R2,areprocessorregisters
DATA_IN,DATA_OUTareI/Oregisters
Contents of location is indicated by using square
brackets [ ]
R2[LOCN]
R4[R3]+[R2]
ASSEMBLYLANGUAGE
NOTATION(ALN)
RTNiseasytounderstandandbutcannotbe
usedtorepresentmachineinstructions
Mnemonicscanbeconvertedtomachine
language,whichprocessorunderstands
usingassembler
Eg:
1. MOVELOCN,R2
2. ADDR3,R2,R4
TYPEOFINSTRUCTION
Threeaddressinstruction
Locationofalloperandsaredefinedimplicitly
Operandsarestoredinastructurecalled
pushdownstack
Continued
IfprocessorsupportsALUoperationsonedatainmemoryand
otherinregisterthentheinstructionsequenceis
MOVED,Ri
ADDE,Ri
MOVERi,F
IfprocessorsupportsALUoperationsonlywithregistersthen
onehastofollowtheinstructionsequencegivenbelow
LOADD,Ri
LOADE,Rj
ADDRi,Rj
MOVERj,F
BasicInstructionCycle
Basiccomputeroperationcycle
Fetchtheinstruction frommemoryintoacontrol
register(PC)
Decodetheinstruction
Locatetheoperands usedbytheinstruction
Fetchoperands frommemory(ifnecessary)
Executetheoperation inprocessorregisters
Storetheresults intheproperplace
Gobacktostep1tofetchthenextinstruction
INSTRUCTIONEXECUTION&STRIAGHTLINE
SEQUENCING
Address Contents
}
Begin execution here i Move A,R0
i+4 Add B,R0
3-instruction program
i+8 Move R0,C
. segment
.
.
A
.
.
.
C
PC Programcounter:holdtheaddressofthenext
instructiontobeexecuted
Straightlinesequencing:Iffetchingandexecutingof
instructionsiscarriedoutonebyonefrom
successiveaddressesofmemory,itiscalledstraight
linesequencing.
Majortwophaseofinstructionexecution
Instructionfetchphase:Instructionisfetchedform
memoryandisplacedininstructionregisterIR
Instructionexecutephase:ContentsofIRisdecoded
andprocessorcarriesouttheoperationeitherby
readingdatafrommemoryorregisters.
BRANCHING
Sequencecanbechangedeitherconditionallyor
unconditionally.
Accordinglywehaveconditional branchinstructions
andunconditionalbranchinstruction.
Conditionalbranchinstructionchangesthesequence
onlywhencertainconditionsaremet.
Unconditionalbranchinstructionchangesthe
sequenceofexecutionirrespectiveofconditionof
theresults.
CONDITIONCODES
CONDITIONALCODEFLAGS:Theprocessorkeepstrackof
informationabouttheresultsofvariousoperationsfor
usebysubsequentconditionalbranchinstructions
N Negative1ifresultsareNegative
0ifresultsarePositive
Z Zero1ifresultsareZero
0ifresultsareNonzero
V Overflow1ifarithmeticoverflowoccurs
0nonoverflowoccurs
C Carry1ifcarryandfromMSBbit
0ifthereisnocarryfromMSBbit
Figure Format and different instruction types
Processing the instructions
Simple computer, like most computers, uses machine cycles.
During the execute phase, the instruction is executed and the results are
placed in the appropriate memory location or the register.
Once the third phase is completed, the control unit starts the cycle again,
but now the PC is pointing to the next instruction.
The process continues until the CPU reaches a HALT instruction.
TypesofAddressingModes
Thedifferentwaysinwhichthelocationoftheoperandis
specifiedinaninstructionarereferredtoasaddressing
modes
ImmediateAddressing
DirectAddressing
IndirectAddressing
RegisterAddressing
RegisterIndirectAddressing
RelativeAddressing
IndexedAddressing
ImmediateAddressing
Operandisgivenexplicitlyintheinstruction
Operand=Value
e.g.ADD5
Add5tocontentsofaccumulator
5isoperand
Nomemoryreferencetofetchdata
Fast
Limitedrange
Instruction
opcode
operand
DirectAddressing
Addressfieldcontainsaddressofoperand
Effectiveaddress(EA)=addressfield(A)
e.g.ADDA
AddcontentsofcellAtoaccumulator
LookinmemoryataddressAforoperand
Singlememoryreferencetoaccessdata
Noadditionalcalculationstoworkouteffectiveaddress
Limitedaddressspace
DirectAddressingDiagram
Instruction
Opcode Address A
Memory
Operand
IndirectAddressing(1)
Memorycellpointedtobyaddressfield
containstheaddressof(pointerto)the
operand
EA=[A]
LookinA,findaddress(A)andlooktherefor
operand
e.g.ADD(A)
AddcontentsofcellpointedtobycontentsofAto
accumulator
IndirectAddressing(2)
Largeaddressspace
2n wheren=wordlength
Maybenested,multilevel,cascaded
e.g.EA=(((A)))
Drawthediagramyourself
Multiplememoryaccessestofindoperand
Henceslower
IndirectAddressingDiagram
Instruction
Opcode Address A
Memory
Pointer to operand
Operand
RegisterAddressing(1)
Operandisheldinregisternamedinaddress
field
EA=R
Limitednumberofregisters
Verysmalladdressfieldneeded
Shorterinstructions
Fasterinstructionfetch
RegisterAddressing(2)
Nomemoryaccess
Veryfastexecution
Verylimitedaddressspace
Multipleregistershelpsperformance
Requiresgoodassemblyprogrammingorcompiler
writing
RegisterAddressingDiagram
Instruction
Opcode Register Address R
Registers
Operand
RegisterIndirect
Addressing
C.f.indirectaddressing
EA=[R]
Operandisinmemorycellpointedtoby
contentsofregisterR
Largeaddressspace(2n)
Onefewermemoryaccessthanindirect
addressing
RegisterIndirect
AddressingDiagram
Instruction
Opcode Register Address R
Memory
Registers
Instruction
Opcode Register R Constant Value
Memory
Registers
Aversionofdisplacementaddressing
R=Programcounter,PC
EA=X+(PC)
i.e.getoperandfromXbytesawayfrom
currentlocationpointedtobyPC
c.flocalityofreference&cacheusage
Autoincrementmode
Theeffectiveaddressoftheoperandisthe
contentsofaregisterspecifiedintheinstruction.
Afteraccessingtheoperand,thecontentsofthis
registerareautomaticallyincrementedtopoint
tothenextiteminthelist
EA=[Ri];IncrementRi (Ri)+
Eg:Add(R2)+,R0
Autodecrementmode
Thecontentsofaregisterspecifiedinthe
instructionarefirstautomatically
decrementedandarethenusedasthe
effectiveaddressoftheoperand
DecrementRi;EA=[Ri] (Ri)
AddressingArchitecture
MemorytoMemoryarchitecture
Alloftheaccessofaddressing>Memory
HaveonlycontrolregisterssuchPC
Toomanymemoryaccesses
RegistertoRegisterarchitecture
Allowonlyonememoryaddress
load,store instructions
RegistertoMemoryarchitecture
Programlengthsand#ofmemoryaccessestendtobeintermediate
betweentheabovetwoarchitectures
Singleaccumulatorarchitecture
Havenoregisterprofile
Toomanymemoryaccesses
Stackarchitecture
Datamanipulationinstructionsusenoaddress.
Toomanymemory(stack)accesses
Usefulforrapidinterpretationofhighlevellang.programsinwhichthe
intermediatecoderepresentationusesstackoperations.
AddressingModes
Impliedmode
Theoperandisspecifiedimplicitlyinthedefinition
oftheopcode.
Immediatemode
Theactualoperandisspecifiedintheinstruction
itself.
AddressingModes(Summary)
CISC(ComplexInstructionSetComputer)Architectures
Memoryaccessisdirectlyavailabletomosttypesofinstruction.
Addressingmodearesubstantialinnumber.
Instructionformatsareofdifferentlengths.
Instructionsperformbothelementaryandcomplexoperations.
InstructionSetArchitecture
RISC(ReducedInstructionSetComputer)
Architectures
Largeregisterfile
Controlunit:simpleandhardwired
pipelining
CISC(ComplexInstructionSetComputer)
Architectures
Registerfile:smallerthaninaRISC
Controlunit:oftenmicroprogrammed
Currenttrend
CISCoperation asequenceofRISClikeoperations
CISCExamples
ExamplesofCISCprocessorsarethe
System/360(excludingthe'scientific'Model44),
VAX,
PDP11,
Motorola68000family
Intelx86architecturebasedprocessors.
Pros
Emphasis on hardware
Includes multi-clock complex
instructions
Memory-to-memory:
"LOAD" and "STORE"
incorporated in instructions
Small code sizes,
high cycles per second
Transistors used for storing
complex instructions
Cons
Thatis,theincorporationofolderinstructionsets
intonewgenerationsofprocessorstendedtoforce
growingcomplexity.
ManyspecializedCISCinstructionswerenotused
frequentlyenoughtojustifytheirexistence.
BecauseeachCISCcommandmustbetranslatedby
theprocessorintotensorevenhundredsoflinesof
microcode,ittendstorunslowerthananequivalent
seriesofsimplercommands thatdonotrequireso
muchtranslation.
RISCExamples
AppleiPods(customARM7TDMISoC)
AppleiPhone(SamsungARM1176JZF)
PalmandPocketPCPDAsandsmartphones(Intel
XScalefamily,SamsungSC32442 ARM9)
NintendoGameBoyAdvance(ARM7)
NintendoDS(ARM7,ARM9)
SonyNetworkWalkman(SonyinhouseARMbased
chip)
SomeNokiaandSonyEricssonmobilephones
Pros
Emphasis on software
Single-clock,
reduced instruction only
Register to register:
"LOAD" and "STORE"
are independent instructions
Low cycles per second,
large code sizes
Spends more transistors
on memory registers
Performance
Computercomponentsanditsfunction
Evolutionandtypesofcomputer
Instructionandinstructionsequencing
Addressingmodes
RISCVsCISC
REFERENCES
CarlHammacher,Computer
Organization,FifthEdition,McGrawHill
InternationalEdition,2002
P.PalChaudhuri,CompterOrganizationand
Design,2nd Edition,PHI,2003
WilliamStallings,Computerorganizationand
ArchitectureDesigningfor
Performance,PHI,2004