SlideShare a Scribd company logo
1 of 27
TThhee VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree 
VVoonn NNeeuummaannnn 
AArrcchhiitteeccttuurree
DDeessiiggnniinngg CCoommppuutteerrss 
• AAllll ccoommppuutteerrss mmoorree oorr lleessss bbaasseedd oonn tthhee ssaammee 
bbaassiicc ddeessiiggnn,, tthhee VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree!! 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 2 
Execute Cycle
TThhee VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree 
• MMooddeell ffoorr ddeessiiggnniinngg aanndd bbuuiillddiinngg ccoommppuutteerrss,, 
bbaasseedd oonn tthhee ffoolllloowwiinngg tthhrreeee cchhaarraacctteerriissttiiccss:: 
11)) TThhee ccoommppuutteerr ccoonnssiissttss ooff ffoouurr mmaaiinn ssuubb--ssyysstteemmss:: 
• MMeemmoorryy 
• AALLUU ((AArriitthhmmeettiicc//LLooggiicc UUnniitt)) 
• CCoonnttrrooll UUnniitt 
• IInnppuutt//OOuuttppuutt SSyysstteemm ((II//OO)) 
11)) PPrrooggrraamm iiss ssttoorreedd iinn mmeemmoorryy dduurriinngg eexxeeccuuttiioonn.. 
22)) PPrrooggrraamm iinnssttrruuccttiioonnss aarree eexxeeccuutteedd sseeqquueennttiiaallllyy.. 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
3 
Execute Cycle
TThhee VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree 
Computer Architectures & Fetch- 
Execute Cycle 
Memory 
Processor (CPU) 
Bus 
Input-Output 
Control Unit 
ALU 
SSttoorree ddaattaa aanndd pprrooggrraamm 
EExxeeccuuttee pprrooggrraamm 
DDoo aarriitthhmmeettiicc//llooggiicc ooppeerraattiioonnss 
rreeqquueesstteedd bbyy pprrooggrraamm 
CCoommmmuunniiccaattee wwiitthh 
""oouuttssiiddee wwoorrlldd"",, ee..gg.. 
• SSccrreeeenn 
• KKeeyybbooaarrdd 
• SSttoorraaggee ddeevviicceess 
• ...... 
SYED ZARYAB HUSSAIN 4
MMeemmoorryy SSuubbssyysstteemm 
• MMeemmoorryy,, aallssoo ccaalllleedd RRAAMM ((RRaannddoomm AAcccceessss MMeemmoorryy)),, 
– CCoonnssiissttss ooff mmaannyy mmeemmoorryy cceellllss ((ssttoorraaggee uunniittss)) ooff aa ffiixxeedd ssiizzee.. 
EEaacchh cceellll hhaass aann aaddddrreessss aassssoocciiaatteedd wwiitthh iitt:: 00,, 11,, …… 
– AAllll aacccceesssseess ttoo mmeemmoorryy aarree ttoo aa ssppeecciiffiieedd aaddddrreessss.. 
AA cceellll iiss tthhee mmiinniimmuumm uunniitt ooff aacccceessss ((ffeettcchh//ssttoorree aa ccoommpplleettee 
cceellll)).. 
– TThhee ttiimmee iitt ttaakkeess ttoo ffeettcchh//ssttoorree aa cceellll iiss tthhee ssaammee ffoorr aallll cceellllss.. 
• WWhheenn tthhee ccoommppuutteerr iiss rruunnnniinngg,, bbootthh 
– PPrrooggrraamm 
– DDaattaa ((vvaarriiaabblleess)) 
aaSrrYEeeD ZssARttYooABrr HeeUSddSA INiinn tthhee mmeemmoorryy.. Computer Architectures & Fetch- 
5 
Execute Cycle
RRAAMM 
00000000000000000000000000000011 
Computer Architectures & Fetch- 
Execute Cycle 
• NNeeeedd ttoo ddiissttiinngguuiisshh bbeettwweeeenn 
– tthhee aaddddrreessss ooff aa mmeemmoorryy cceellll aanndd 
tthhee ccoonntteenntt ooff aa mmeemmoorryy cceellll 
• MMeemmoorryy wwiiddtthh ((WW)):: 
– HHooww mmaannyy bbiittss iiss eeaacchh mmeemmoorryy 
cceellll,, ttyyppiiccaallllyy oonnee bbyyttee ((==88 bbiittss)) 
• AAddddrreessss wwiiddtthh ((NN)):: 
– HHooww mmaannyy bbiittss uusseedd ttoo rreepprreesseenntt 
eeaacchh aaddddrreessss,, ddeetteerrmmiinneess tthhee 
mmaaxxiimmuumm mmeemmoorryy ssiizzee == aaddddrreessss 
ssppaaccee 
– IIff aaddddrreessss wwiiddtthh iiss NN--bbiittss,, tthheenn 
aaddddrreessss ssppaaccee iiss 22NN ((00,,11,,......,,22NN--11)) 
... 
00 
11 
22 
22NN--11 
11 bbiitt 
WW 
NN 
22NN 
6 
SYED ZARYAB HUSSAIN
MMeemmoorryy SSiizzee // SSppeeeedd 
• TTyyppiiccaall mmeemmoorryy iinn aa ppeerrssoonnaall ccoommppuutteerr ((PPCC)):: 
Computer Architectures & Fetch- 
Execute Cycle 
– 6644MMBB -- 225566MMBB 
• MMeemmoorryy ssiizzeess:: 
– KKiilloobbyyttee ((KKBB)) == 221100 == 11,,002244 bbyytteess ~~ 11 tthhoouussaanndd 
– MMeeggaabbyyttee((MMBB)) == 222200 == 11,,004488,,557766 bbyytteess ~~ 11 mmiilllliioonn 
– GGiiggaabbyyttee ((GGBB)) == 223300 == 11,,007733,,774411,,882244 bbyytteess ~~ 11 bbiilllliioonn 
• MMeemmoorryy AAcccceessss TTiimmee ((rreeaadd ffrroomm// wwrriittee ttoo mmeemmoorryy)) 
– 5500--7755 nnaannoosseeccoonnddss ((11 nnsseecc.. == 00..000000000000000011 sseecc..)) 
• RRAAMM iiss 
– vvoollaattiillee ((ccaann oonnllyy ssttoorree wwhheenn ppoowweerr iiss oonn)) 
– rreellaattiivveellyy eexxppeennssiivvee 
SYED ZARYAB HUSSAIN 7
OOppeerraattiioonnss oonn MMeemmoorryy 
Computer Architectures & Fetch- 
Execute Cycle 
• FFeettcchh ((aaddddrreessss)):: 
– FFeettcchh aa ccooppyy ooff tthhee ccoonntteenntt ooff mmeemmoorryy cceellll wwiitthh tthhee ssppeecciiffiieedd 
aaddddrreessss.. 
– NNoonn--ddeessttrruuccttiivvee,, ccooppiieess vvaalluuee iinn mmeemmoorryy cceellll.. 
• SSttoorree ((aaddddrreessss,, vvaalluuee)):: 
– SSttoorree tthhee ssppeecciiffiieedd vvaalluuee iinnttoo tthhee mmeemmoorryy cceellll ssppeecciiffiieedd bbyy aaddddrreessss.. 
– DDeessttrruuccttiivvee,, oovveerrwwrriitteess tthhee pprreevviioouuss vvaalluuee ooff tthhee mmeemmoorryy cceellll.. 
• TThhee mmeemmoorryy ssyysstteemm iiss iinntteerrffaacceedd vviiaa:: 
– MMeemmoorryy AAddddrreessss RReeggiisstteerr ((MMAARR)) 
– MMeemmoorryy DDaattaa RReeggiisstteerr ((MMDDRR)) 
– FFeettcchh//SSttoorree ssiiggnnaall 
SYED ZARYAB HUSSAIN 8
Structure ooff tthhee MMeemmoorryy SSuubbssyysstteemm 
• FFeettcchh((aaddddrreessss)) 
– LLooaadd aaddddrreessss iinnttoo MMAARR.. 
– DDeeccooddee tthhee aaddddrreessss iinn MMAARR.. 
– CCooppyy tthhee ccoonntteenntt ooff mmeemmoorryy cceellll wwiitthh 
ssppeecciiffiieedd aaddddrreessss iinnttoo MMDDRR.. 
• SSttoorree((aaddddrreessss,, vvaalluuee)) 
– LLooaadd tthhee aaddddrreessss iinnttoo MMAARR.. 
– LLooaadd tthhee vvaalluuee iinnttoo MMDDRR.. 
– DDeeccooddee tthhee aaddddrreessss iinn MMAARR 
– CCooppyy tthhee ccoonntteenntt ooff MMDDRR iinnttoo mmeemmoorryy 
cceellll wwiitthh tthhee ssppeecciiffiieedd aaddddrreessss.. 
Computer Architectures & Fetch- 
Execute Cycle 
MAR MDR 
F/S 
... 
Memory 
decoder 
circuit 
Fetch/Store 
controller 
SYED ZARYAB HUSSAIN 9
IInnppuutt//OOuuttppuutt SSuubbssyysstteemm 
• HHaannddlleess ddeevviicceess tthhaatt aallllooww tthhee ccoommppuutteerr ssyysstteemm ttoo:: 
– CCoommmmuunniiccaattee aanndd iinntteerraacctt wwiitthh tthhee oouuttssiiddee wwoorrlldd 
• SSccrreeeenn,, kkeeyybbooaarrdd,, pprriinntteerr,, ...... 
– SSttoorree iinnffoorrmmaattiioonn ((mmaassss--ssttoorraaggee)) 
• HHaarrdd--ddrriivveess,, ffllooppppiieess,, CCDD,, ttaappeess,, …… 
• MMaassss--SSttoorraaggee DDeevviiccee AAcccceessss MMeetthhooddss:: 
– DDiirreecctt AAcccceessss SSttoorraaggee DDeevviicceess ((DDAASSDDss)) 
• HHaarrdd--ddrriivveess,, ffllooppppyy--ddiisskkss,, CCDD--RROOMMss,, ...... 
– SSeeqquueennttiiaall AAcccceessss SSttoorraaggee DDeevviicceess ((SSAASSDDss)) 
• TTaappeess ((ffoorr eexxaammppllee,, uusseedd aass bbaacckkuupp ddeevviicceess)) 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
10 
Execute Cycle
II//OO CCoonnttrroolllleerrss 
• SSppeeeedd ooff II//OO ddeevviicceess iiss ssllooww ccoommppaarreedd ttoo RRAAMM 
– RRAAMM ~~ 5500 nnsseecc.. 
– HHaarrdd--DDrriivvee ~~ 1100mmsseecc.. = ((1100,,000000,,000000 nnsseecc)) 
• SSoolluuttiioonn:: 
– II//OO CCoonnttrroolllleerr,, aa ssppeecciiaall ppuurrppoossee pprroocceessssoorr:: 
• HHaass aa ssmmaallll mmeemmoorryy bbuuffffeerr,, aanndd aa ccoonnttrrooll llooggiicc ttoo ccoonnttrrooll II//OO 
ddeevviiccee ((ee..gg.. mmoovvee ddiisskk aarrmm)).. 
• SSeennddss aann iinntteerrrruupptt ssiiggnnaall ttoo CCPPUU wwhheenn ddoonnee rreeaadd//wwrriittee.. 
– DDaattaa ttrraannssffeerrrreedd bbeettwweeeenn RRAAMM aanndd mmeemmoorryy bbuuffffeerr.. 
– PPrroocceessssoorr ffrreeee ttoo ddoo ssoommeetthhiinngg eellssee wwhhiillee II//OO ccoonnttrroolllleerr 
rreeaaddss//wwrriitteess ddaattaa ffrroomm//ttoo ddeevviiccee iinnttoo II//OO bbuuffffeerr.. 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
11 
Execute Cycle
SSttrruuccttuurree ooff tthhee II//OO SSuubbssyysstteemm 
I/O controller 
I/O Buffer 
Control/Logic 
I/O device 
Computer Architectures & Fetch- 
Execute Cycle 
Data from/to memory 
Interrupt signal (to processor) 
SYED ZARYAB HUSSAIN 12
TThhee AALLUU SSuubbssyysstteemm 
• TThhee AALLUU ((AArriitthhmmeettiicc//LLooggiicc UUnniitt)) ppeerrffoorrmmss 
– mmaatthheemmaattiiccaall ooppeerraattiioonnss ((++,, --,, xx,, //,, ……)) 
– llooggiicc ooppeerraattiioonnss ((=,, <<,, >>,, aanndd,, oorr,, nnoott,, ......)) 
• IInn ttooddaayy''ss ccoommppuutteerrss iinntteeggrraatteedd iinnttoo tthhee CCPPUU 
• CCoonnssiissttss ooff:: 
– CCiirrccuuiittss ttoo ddoo tthhee aarriitthhmmeettiicc//llooggiicc ooppeerraattiioonnss.. 
– RReeggiisstteerrss ((ffaasstt ssttoorraaggee uunniittss)) ttoo ssttoorree iinntteerrmmeeddiiaattee 
Computer Architectures & Fetch- 
Execute Cycle 
ccoommppuuttaattiioonnaall rreessuullttss.. 
– BBuuss tthhaatt ccoonnnneeccttss tthhee ttwwoo.. 
SYED ZARYAB HUSSAIN 13
SSttrruuccttuurree ooff tthhee AALLUU 
Computer Architectures & Fetch- 
Execute Cycle 
• RReeggiisstteerrss:: 
– VVeerryy ffaasstt llooccaall mmeemmoorryy cceellllss,, tthhaatt 
ssttoorree ooppeerraannddss ooff ooppeerraattiioonnss aanndd 
iinntteerrmmeeddiiaattee rreessuullttss.. 
– CCCCRR ((ccoonnddiittiioonn ccooddee rreeggiisstteerr)),, aa 
ssppeecciiaall ppuurrppoossee rreeggiisstteerr tthhaatt ssttoorreess 
tthhee rreessuulltt ooff <<,, = ,, >> ooppeerraattiioonnss 
• AALLUU cciirrccuuiittrryy:: 
– CCoonnttaaiinnss aann aarrrraayy ooff cciirrccuuiittss ttoo ddoo 
mmaatthheemmaattiiccaall//llooggiicc ooppeerraattiioonnss.. 
• BBuuss:: 
– DDaattaa ppaatthh iinntteerrccoonnnneeccttiinngg tthhee 
rreeggiisstteerrss ttoo tthhee AALLUU cciirrccuuiittrryy.. 
ALU circuitry 
GT EQ LT 
R0 
R1 
R2 
Rn 
SYED ZARYAB HUSSAIN 14
TThhee CCoonnttrrooll UUnniitt 
• PPrrooggrraamm iiss ssttoorreedd iinn mmeemmoorryy 
– aass mmaacchhiinnee llaanngguuaaggee iinnssttrruuccttiioonnss,, iinn bbiinnaarryy 
• TThhee ttaasskk ooff tthhee ccoonnttrrooll uunniitt iiss ttoo eexxeeccuuttee pprrooggrraammss 
bbyy rreeppeeaatteeddllyy:: 
– FFeettcchh ffrroomm mmeemmoorryy tthhee nneexxtt iinnssttrruuccttiioonn ttoo bbee eexxeeccuutteedd.. 
– DDeeccooddee iitt,, tthhaatt iiss,, ddeetteerrmmiinnee wwhhaatt iiss ttoo bbee ddoonnee.. 
– EExxeeccuuttee iitt bbyy iissssuuiinngg tthhee aapppprroopprriiaattee ssiiggnnaallss ttoo tthhee 
AALLUU,, mmeemmoorryy,, aanndd II//OO ssuubbssyysstteemmss.. 
– CCoonnttiinnuueess uunnttiill tthhee HHAALLTT iinnssttrruuccttiioonn 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
15 
Execute Cycle
MMaacchhiinnee LLaanngguuaaggee IInnssttrruuccttiioonnss 
• AA mmaacchhiinnee llaanngguuaaggee iinnssttrruuccttiioonn ccoonnssiissttss ooff:: 
– OOppeerraattiioonn ccooddee,, tteelllliinngg wwhhiicchh ooppeerraattiioonn ttoo ppeerrffoorrmm 
– AAddddrreessss ffiieelldd((ss)),, tteelllliinngg tthhee mmeemmoorryy aaddddrreesssseess ooff tthhee 
vvaalluueess oonn wwhhiicchh tthhee ooppeerraattiioonn wwoorrkkss.. 
• EExxaammppllee:: AADDDD XX,, YY ((AAdddd ccoonntteenntt ooff mmeemmoorryy llooccaattiioonnss XX 
aanndd YY,, aanndd ssttoorree bbaacckk iinn mmeemmoorryy llooccaattiioonn YY)).. 
• AAssssuummee:: ooppccooddee ffoorr AADDDD iiss 99,, aanndd aaddddrreesssseess XX==9999,, YY==110000 
OOppccooddee ((88 bbiittss)) AAddddrreessss 11 ((1166 bbiittss)) AAddddrreessss 22 ((1166 bbiittss)) 
00001001 0000000001100011 0000000001100100 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
16 
Execute Cycle
IInnssttrruuccttiioonn SSeett DDeessiiggnn 
• TTwwoo ddiiffffeerreenntt aapppprrooaacchheess:: 
– RReedduucceedd IInnssttrruuccttiioonn SSeett CCoommppuutteerrss ((RRIISSCC)) 
• IInnssttrruuccttiioonn sseett aass ssmmaallll aanndd ssiimmppllee aass ppoossssiibbllee.. 
• MMiinniimmiizzeess aammoouunntt ooff cciirrccuuiittrryy ---->> ffaasstteerr ccoommppuutteerrss 
– CCoommpplleexx IInnssttrruuccttiioonn SSeett CCoommppuutteerrss ((CCIISSCC)) 
• MMoorree iinnssttrruuccttiioonnss,, mmaannyy vveerryy ccoommpplleexx 
• EEaacchh iinnssttrruuccttiioonn ccaann ddoo mmoorree wwoorrkk,, bbuutt rreeqquuiirree mmoorree 
cciirrccuuiittrryy.. 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
17 
Execute Cycle
TTyyppiiccaall MMaacchhiinnee IInnssttrruuccttiioonnss 
• NNoottaattiioonn:: 
– WWee uussee XX,, YY,, ZZ ttoo ddeennoottee RRAAMM cceellllss 
– AAssssuummee oonnllyy oonnee rreeggiisstteerr RR ((ffoorr ssiimmpplliicciittyy)) 
– UUssee EEnngglliisshh--lliikkee ddeessccrriippttiioonnss ((sshhoouulldd bbee bbiinnaarryy)) 
• DDaattaa TTrraannssffeerr IInnssttrruuccttiioonnss 
– LLOOAADD XX LLooaadd ccoonntteenntt ooff mmeemmoorryy llooccaattiioonn XX ttoo RR 
– SSTTOORREE XX LLooaadd ccoonntteenntt ooff RR ttoo mmeemmoorryy llooccaattiioonn XX 
– MMOOVVEE XX,, YY CCooppyy ccoonntteenntt ooff mmeemmoorryy llooccaattiioonn XX ttoo lloocc.. YY 
((nnoott aabbssoolluutteellyy nneecceessssaarryy)) 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
18 
Execute Cycle
MMaacchhiinnee IInnssttrruuccttiioonnss ((ccoonntt..)) 
Computer Architectures & Fetch- 
Execute Cycle 
• AArriitthhmmeettiicc 
– AADDDD XX,, YY,, ZZ CCOONN((ZZ)) == CCOONN((XX)) ++ CCOONN((YY)) 
– AADDDD XX,, YY CCOONN((YY)) == CCOONN((XX)) ++ CCOONN((YY)) 
– AADDDD XX RR == CCOONN((XX)) ++ RR 
– ssiimmiillaarr iinnssttrruuccttiioonnss ffoorr ootthheerr ooppeerraattoorrss,, ee..gg.. SSUUBBTTRR,,OORR,, ...... 
• CCoommppaarree 
– CCOOMMPPAARREE XX,, YY 
CCoommppaarree tthhee ccoonntteenntt ooff mmeemmoorryy cceellll XX ttoo tthhee ccoonntteenntt ooff mmeemmoorryy 
cceellll YY aanndd sseett tthhee ccoonnddiittiioonn ccooddeess ((CCCCRR)) aaccccoorrddiinnggllyy.. 
– EE..gg.. IIff CCOONN((XX)) == RR tthheenn sseett EEQQ==11,, GTT==00,, LLTT==00 
SYED ZARYAB HUSSAIN 19
MMaacchhiinnee IInnssttrruuccttiioonnss ((ccoonntt..)) 
• BBrraanncchh 
– JJUUMMPP XX LLooaadd nneexxtt iinnssttrruuccttiioonn ffrroomm mmeemmoorryy lloocc.. XX 
– JJUUMMPPGTT XX LLooaadd nneexxtt iinnssttrruuccttiioonn ffrroomm mmeemmoorryy lloocc.. XX 
oonnllyy iiff GTT ffllaagg iinn CCCCRR iiss sseett,, ootthheerrwwiissee llooaadd 
ssttaatteemmeenntt ffrroomm nneexxtt sseeqquueennccee lloocc.. aass 
uussuuaall.. 
• JJUUMMPPEEQQ,, JJUUMMPPLLTT,, JJUUMMPPGEE,, JJUUMMPPLLEE,,JJUUMMPPNNEEQQ 
• CCoonnttrrooll 
– HHAALLTT SSttoopp pprrooggrraamm eexxeeccuuttiioonn.. 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
20 
Execute Cycle
EExxaammppllee 
• PPsseeuuddoo--ccooddee:: SSeett AA ttoo BB ++ CC 
• AAssssuummiinngg vvaarriiaabbllee:: 
– AA ssttoorreedd iinn mmeemmoorryy cceellll 110000,, BB ssttoorreedd iinn mmeemmoorryy cceellll 
115500,, CC ssttoorreedd iinn mmeemmoorryy cceellll 115511 
• MMaacchhiinnee llaanngguuaaggee ((rreeaallllyy iinn bbiinnaarryy)) 
Computer Architectures & Fetch- 
Execute Cycle 
– LLOOAADD 115500 
– AADDDD 115511 
– SSTTOORREE 110000 
– oorr 
– ((AADDDD 115500,, 115511,, 110000)) 
SYED ZARYAB HUSSAIN 21
SSttrruuccttuurree ooff tthhee CCoonnttrrooll UUnniitt 
IR 
Computer Architectures & Fetch- 
Execute Cycle 
• PPCC ((PPrrooggrraamm CCoouunntteerr)):: 
– ssttoorreess tthhee aaddddrreessss ooff nneexxtt iinnssttrruuccttiioonn ttoo ffeettcchh 
• IIRR ((IInnssttrruuccttiioonn RReeggiisstteerr)):: 
– ssttoorreess tthhee iinnssttrruuccttiioonn ffeettcchheedd ffrroomm mmeemmoorryy 
• IInnssttrruuccttiioonn DDeeccooddeerr:: 
– DDeeccooddeess iinnssttrruuccttiioonn aanndd aaccttiivvaatteess nneecceessssaarryy cciirrccuuiittrryy 
Instruction 
Decoder 
+1 
PC 
SYED ZARYAB HUSSAIN 22
Computer Architectures & Fetch- 
Execute Cycle 
vvoonn NNeeuummaannnn 
AArrcchhiitteeccttuurree 
SYED ZARYAB HUSSAIN 23
HHooww ddooeess tthhiiss aallll wwoorrkk ttooggeetthheerr?? 
• PPrrooggrraamm EExxeeccuuttiioonn:: 
– PPCC iiss sseett ttoo tthhee aaddddrreessss wwhheerree tthhee ffiirrsstt pprrooggrraamm 
iinnssttrruuccttiioonn iiss ssttoorreedd iinn mmeemmoorryy.. 
– RReeppeeaatt uunnttiill HHAALLTT iinnssttrruuccttiioonn oorr ffaattaall eerrrroorr 
Computer Architectures & Fetch- 
Execute Cycle 
FFeettcchh iinnssttrruuccttiioonn 
DDeeccooddee iinnssttrruuccttiioonn 
EExxeeccuuttee iinnssttrruuccttiioonn 
EEnndd ooff lloooopp 
SYED ZARYAB HUSSAIN 24
PPrrooggrraamm EExxeeccuuttiioonn ((ccoonntt..)) 
• FFeettcchh pphhaassee 
– PPCC ---->> MMAARR ((ppuutt aaddddrreessss iinn PPCC iinnttoo MMAARR)) 
– FFeettcchh ssiiggnnaall ((ssiiggnnaall mmeemmoorryy ttoo ffeettcchh vvaalluuee iinnttoo MMDDRR)) 
– MMDDRR ---->> IIRR ((mmoovvee vvaalluuee ttoo IInnssttrruuccttiioonn RReeggiisstteerr)) 
– PPCC ++ 11 ---->> PPCC ((IInnccrreeaassee aaddddrreessss iinn pprrooggrraamm ccoouunntteerr)) 
• DDeeccooddee PPhhaassee 
– IIRR -->> IInnssttrruuccttiioonn ddeeccooddeerr ((ddeeccooddee iinnssttrruuccttiioonn iinn IIRR)) 
– IInnssttrruuccttiioonn ddeeccooddeerr wwiillll tthheenn ggeenneerraattee tthhee ssiiggnnaallss ttoo 
aaccttiivvaattee tthhee cciirrccuuiittrryy ttoo ccaarrrryy oouutt tthhee iinnssttrruuccttiioonn 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
25 
Execute Cycle
PPrrooggrraamm EExxeeccuuttiioonn ((ccoonntt..)) 
• EExxeeccuuttee PPhhaassee 
– DDiiffffeerrss ffrroomm oonnee iinnssttrruuccttiioonn ttoo tthhee nneexxtt.. 
• EExxaammppllee:: 
– LLOOAADD XX ((llooaadd vvaalluuee iinn aaddddrr.. XX iinnttoo rreeggiisstteerr)) 
Computer Architectures & Fetch- 
Execute Cycle 
• IIRR__aaddddrreessss -->> MMAARR 
• FFeettcchh ssiiggnnaall 
• MMDDRR ---->> RR 
– AADDDD XX 
• lleefftt aass aann eexxeerrcciissee 
SYED ZARYAB HUSSAIN 26
Instruction Set ffoorr OOuurr VVoonn NNeeuummaannnn MMaacchhiinnee 
OOppccooddee OOppeerraattiioonn MMeeaanniinngg 
0000 LOAD X CON(X) --> R 
0001 STORE X R --> CON(X) 
0010 CLEAR X 0 --> CON(X) 
0011 ADD X R + CON(X) --> R 
0100 INCREMENT X CON(X) + 1 --> CON(X) 
0101 SUBTRACT X R - CON(X) --> R 
0101 DECREMENT X CON(X) - 1 --> CON(X) 
COMPARE X If CON(X) > R then GT = 1 else 0 
0111 
If CON(X) = R then EQ = 1 else 0 
If CON(X) < R then LT = 1 else 0 
1000 JUMP X Get next instruction from memory location X 
1001 JUMPGT X Get next instruction from memory loc. X if GT=1 
... JUMPxx X xx = LT / EQ / NEQ 
1101 IN X Input an integer value and store in X 
1110 OUT X Output, in decimal notation, content of mem. loc. X 
1111 HALT Stop program execution 
SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 
27 
Execute Cycle

More Related Content

Viewers also liked

Harvard vs Von Neumann Architecture
Harvard vs Von Neumann ArchitectureHarvard vs Von Neumann Architecture
Harvard vs Von Neumann ArchitectureProject Student
 
IS 139 Lecture 2
IS 139 Lecture 2IS 139 Lecture 2
IS 139 Lecture 2wajanga
 
Processors used in System on chip
Processors used in System on chip Processors used in System on chip
Processors used in System on chip A B Shinde
 
Harvard architecture
Harvard architectureHarvard architecture
Harvard architectureGichelle Amon
 
Computer architecture
Computer architecture Computer architecture
Computer architecture Ashish Kumar
 
Lecture 2
Lecture 2Lecture 2
Lecture 2Mr SMAK
 
Harvard architecture
Harvard architectureHarvard architecture
Harvard architectureCarmen Ugay
 
Life Beyond the Illusion of Present
Life Beyond the Illusion of PresentLife Beyond the Illusion of Present
Life Beyond the Illusion of PresentJonas Bonér
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRavikumar Tiwari
 

Viewers also liked (13)

Harvard vs Von Neumann Architecture
Harvard vs Von Neumann ArchitectureHarvard vs Von Neumann Architecture
Harvard vs Von Neumann Architecture
 
IS 139 Lecture 2
IS 139 Lecture 2IS 139 Lecture 2
IS 139 Lecture 2
 
Processors used in System on chip
Processors used in System on chip Processors used in System on chip
Processors used in System on chip
 
Architecture de Von Neumann & Harvard
Architecture de Von Neumann & HarvardArchitecture de Von Neumann & Harvard
Architecture de Von Neumann & Harvard
 
Harvard architecture
Harvard architectureHarvard architecture
Harvard architecture
 
Harvard University
Harvard UniversityHarvard University
Harvard University
 
Computer architecture
Computer architecture Computer architecture
Computer architecture
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Control unit
Control unitControl unit
Control unit
 
Harvard architecture
Harvard architectureHarvard architecture
Harvard architecture
 
Life Beyond the Illusion of Present
Life Beyond the Illusion of PresentLife Beyond the Illusion of Present
Life Beyond the Illusion of Present
 
Cpu
CpuCpu
Cpu
 
RISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van NeumannRISC Vs CISC, Harvard v/s Van Neumann
RISC Vs CISC, Harvard v/s Van Neumann
 

Similar to Von neumann architecture

Maurizio Elia. I problemi psichiatrici in età adulta.
Maurizio Elia. I problemi psichiatrici in età adulta.Maurizio Elia. I problemi psichiatrici in età adulta.
Maurizio Elia. I problemi psichiatrici in età adulta.claudiopagano
 
Introduction to microsoft access ppt
Introduction to microsoft access pptIntroduction to microsoft access ppt
Introduction to microsoft access pptranjitkumar08
 
21 High-quality programming code construction part-ii
21 High-quality programming code construction part-ii21 High-quality programming code construction part-ii
21 High-quality programming code construction part-iimaznabili
 
05 The Learning Process
05 The Learning Process05 The Learning Process
05 The Learning ProcessPeter Fenrich
 
Interview Questions-Basics of Electronics and Communication Engg
 Interview Questions-Basics of Electronics and Communication Engg Interview Questions-Basics of Electronics and Communication Engg
Interview Questions-Basics of Electronics and Communication Enggsanjeeev bahadur, m.tech,mba
 
Introduction to Music Videos and Music Industry
Introduction to Music Videos and Music IndustryIntroduction to Music Videos and Music Industry
Introduction to Music Videos and Music Industryhurtwoodhousemedia5
 
introduccion basica php
introduccion basica phpintroduccion basica php
introduccion basica phpPablo Mamani
 
Service Oriented Architecture (SOA) Overview by kovair
Service Oriented Architecture (SOA) Overview by kovairService Oriented Architecture (SOA) Overview by kovair
Service Oriented Architecture (SOA) Overview by kovairKovair
 
Doing Outplacement Inhouse
Doing Outplacement InhouseDoing Outplacement Inhouse
Doing Outplacement InhouseGail Houston
 
2011planningforcollege 111129150759-phpapp01
2011planningforcollege 111129150759-phpapp012011planningforcollege 111129150759-phpapp01
2011planningforcollege 111129150759-phpapp01Ariunaa Nasan-Ochir
 
18 Hash tables and sets
18 Hash tables and sets18 Hash tables and sets
18 Hash tables and setsmaznabili
 
Antihypertensive agents. calcium channel blockers
Antihypertensive agents. calcium channel blockersAntihypertensive agents. calcium channel blockers
Antihypertensive agents. calcium channel blockersSravani Ganti
 
Surface treatments
Surface treatmentsSurface treatments
Surface treatmentsBilalwahla
 
Aula Trabalho IDH 17-09-2014
Aula Trabalho IDH 17-09-2014Aula Trabalho IDH 17-09-2014
Aula Trabalho IDH 17-09-2014Antonio Pessoa
 
Hardware and operating sytems
Hardware and operating sytemsHardware and operating sytems
Hardware and operating sytemsspooler85
 
Lect 1 physical assessment
Lect 1 physical assessmentLect 1 physical assessment
Lect 1 physical assessmentAli Mohamed Aziz
 

Similar to Von neumann architecture (20)

Maurizio Elia. I problemi psichiatrici in età adulta.
Maurizio Elia. I problemi psichiatrici in età adulta.Maurizio Elia. I problemi psichiatrici in età adulta.
Maurizio Elia. I problemi psichiatrici in età adulta.
 
Biochemistry 1
Biochemistry 1Biochemistry 1
Biochemistry 1
 
Introduction to microsoft access ppt
Introduction to microsoft access pptIntroduction to microsoft access ppt
Introduction to microsoft access ppt
 
21 High-quality programming code construction part-ii
21 High-quality programming code construction part-ii21 High-quality programming code construction part-ii
21 High-quality programming code construction part-ii
 
05 The Learning Process
05 The Learning Process05 The Learning Process
05 The Learning Process
 
Interview Questions-Basics of Electronics and Communication Engg
 Interview Questions-Basics of Electronics and Communication Engg Interview Questions-Basics of Electronics and Communication Engg
Interview Questions-Basics of Electronics and Communication Engg
 
Introduction to Music Videos and Music Industry
Introduction to Music Videos and Music IndustryIntroduction to Music Videos and Music Industry
Introduction to Music Videos and Music Industry
 
introduccion basica php
introduccion basica phpintroduccion basica php
introduccion basica php
 
84640 633554912394375000
84640 63355491239437500084640 633554912394375000
84640 633554912394375000
 
Service Oriented Architecture (SOA) Overview by kovair
Service Oriented Architecture (SOA) Overview by kovairService Oriented Architecture (SOA) Overview by kovair
Service Oriented Architecture (SOA) Overview by kovair
 
Socratic method
Socratic methodSocratic method
Socratic method
 
Doing Outplacement Inhouse
Doing Outplacement InhouseDoing Outplacement Inhouse
Doing Outplacement Inhouse
 
2011planningforcollege 111129150759-phpapp01
2011planningforcollege 111129150759-phpapp012011planningforcollege 111129150759-phpapp01
2011planningforcollege 111129150759-phpapp01
 
18 Hash tables and sets
18 Hash tables and sets18 Hash tables and sets
18 Hash tables and sets
 
Antihypertensive agents. calcium channel blockers
Antihypertensive agents. calcium channel blockersAntihypertensive agents. calcium channel blockers
Antihypertensive agents. calcium channel blockers
 
Team+work
Team+workTeam+work
Team+work
 
Surface treatments
Surface treatmentsSurface treatments
Surface treatments
 
Aula Trabalho IDH 17-09-2014
Aula Trabalho IDH 17-09-2014Aula Trabalho IDH 17-09-2014
Aula Trabalho IDH 17-09-2014
 
Hardware and operating sytems
Hardware and operating sytemsHardware and operating sytems
Hardware and operating sytems
 
Lect 1 physical assessment
Lect 1 physical assessmentLect 1 physical assessment
Lect 1 physical assessment
 

Von neumann architecture

  • 1. TThhee VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree
  • 2. DDeessiiggnniinngg CCoommppuutteerrss • AAllll ccoommppuutteerrss mmoorree oorr lleessss bbaasseedd oonn tthhee ssaammee bbaassiicc ddeessiiggnn,, tthhee VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree!! SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 2 Execute Cycle
  • 3. TThhee VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree • MMooddeell ffoorr ddeessiiggnniinngg aanndd bbuuiillddiinngg ccoommppuutteerrss,, bbaasseedd oonn tthhee ffoolllloowwiinngg tthhrreeee cchhaarraacctteerriissttiiccss:: 11)) TThhee ccoommppuutteerr ccoonnssiissttss ooff ffoouurr mmaaiinn ssuubb--ssyysstteemmss:: • MMeemmoorryy • AALLUU ((AArriitthhmmeettiicc//LLooggiicc UUnniitt)) • CCoonnttrrooll UUnniitt • IInnppuutt//OOuuttppuutt SSyysstteemm ((II//OO)) 11)) PPrrooggrraamm iiss ssttoorreedd iinn mmeemmoorryy dduurriinngg eexxeeccuuttiioonn.. 22)) PPrrooggrraamm iinnssttrruuccttiioonnss aarree eexxeeccuutteedd sseeqquueennttiiaallllyy.. SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 3 Execute Cycle
  • 4. TThhee VVoonn NNeeuummaannnn AArrcchhiitteeccttuurree Computer Architectures & Fetch- Execute Cycle Memory Processor (CPU) Bus Input-Output Control Unit ALU SSttoorree ddaattaa aanndd pprrooggrraamm EExxeeccuuttee pprrooggrraamm DDoo aarriitthhmmeettiicc//llooggiicc ooppeerraattiioonnss rreeqquueesstteedd bbyy pprrooggrraamm CCoommmmuunniiccaattee wwiitthh ""oouuttssiiddee wwoorrlldd"",, ee..gg.. • SSccrreeeenn • KKeeyybbooaarrdd • SSttoorraaggee ddeevviicceess • ...... SYED ZARYAB HUSSAIN 4
  • 5. MMeemmoorryy SSuubbssyysstteemm • MMeemmoorryy,, aallssoo ccaalllleedd RRAAMM ((RRaannddoomm AAcccceessss MMeemmoorryy)),, – CCoonnssiissttss ooff mmaannyy mmeemmoorryy cceellllss ((ssttoorraaggee uunniittss)) ooff aa ffiixxeedd ssiizzee.. EEaacchh cceellll hhaass aann aaddddrreessss aassssoocciiaatteedd wwiitthh iitt:: 00,, 11,, …… – AAllll aacccceesssseess ttoo mmeemmoorryy aarree ttoo aa ssppeecciiffiieedd aaddddrreessss.. AA cceellll iiss tthhee mmiinniimmuumm uunniitt ooff aacccceessss ((ffeettcchh//ssttoorree aa ccoommpplleettee cceellll)).. – TThhee ttiimmee iitt ttaakkeess ttoo ffeettcchh//ssttoorree aa cceellll iiss tthhee ssaammee ffoorr aallll cceellllss.. • WWhheenn tthhee ccoommppuutteerr iiss rruunnnniinngg,, bbootthh – PPrrooggrraamm – DDaattaa ((vvaarriiaabblleess)) aaSrrYEeeD ZssARttYooABrr HeeUSddSA INiinn tthhee mmeemmoorryy.. Computer Architectures & Fetch- 5 Execute Cycle
  • 6. RRAAMM 00000000000000000000000000000011 Computer Architectures & Fetch- Execute Cycle • NNeeeedd ttoo ddiissttiinngguuiisshh bbeettwweeeenn – tthhee aaddddrreessss ooff aa mmeemmoorryy cceellll aanndd tthhee ccoonntteenntt ooff aa mmeemmoorryy cceellll • MMeemmoorryy wwiiddtthh ((WW)):: – HHooww mmaannyy bbiittss iiss eeaacchh mmeemmoorryy cceellll,, ttyyppiiccaallllyy oonnee bbyyttee ((==88 bbiittss)) • AAddddrreessss wwiiddtthh ((NN)):: – HHooww mmaannyy bbiittss uusseedd ttoo rreepprreesseenntt eeaacchh aaddddrreessss,, ddeetteerrmmiinneess tthhee mmaaxxiimmuumm mmeemmoorryy ssiizzee == aaddddrreessss ssppaaccee – IIff aaddddrreessss wwiiddtthh iiss NN--bbiittss,, tthheenn aaddddrreessss ssppaaccee iiss 22NN ((00,,11,,......,,22NN--11)) ... 00 11 22 22NN--11 11 bbiitt WW NN 22NN 6 SYED ZARYAB HUSSAIN
  • 7. MMeemmoorryy SSiizzee // SSppeeeedd • TTyyppiiccaall mmeemmoorryy iinn aa ppeerrssoonnaall ccoommppuutteerr ((PPCC)):: Computer Architectures & Fetch- Execute Cycle – 6644MMBB -- 225566MMBB • MMeemmoorryy ssiizzeess:: – KKiilloobbyyttee ((KKBB)) == 221100 == 11,,002244 bbyytteess ~~ 11 tthhoouussaanndd – MMeeggaabbyyttee((MMBB)) == 222200 == 11,,004488,,557766 bbyytteess ~~ 11 mmiilllliioonn – GGiiggaabbyyttee ((GGBB)) == 223300 == 11,,007733,,774411,,882244 bbyytteess ~~ 11 bbiilllliioonn • MMeemmoorryy AAcccceessss TTiimmee ((rreeaadd ffrroomm// wwrriittee ttoo mmeemmoorryy)) – 5500--7755 nnaannoosseeccoonnddss ((11 nnsseecc.. == 00..000000000000000011 sseecc..)) • RRAAMM iiss – vvoollaattiillee ((ccaann oonnllyy ssttoorree wwhheenn ppoowweerr iiss oonn)) – rreellaattiivveellyy eexxppeennssiivvee SYED ZARYAB HUSSAIN 7
  • 8. OOppeerraattiioonnss oonn MMeemmoorryy Computer Architectures & Fetch- Execute Cycle • FFeettcchh ((aaddddrreessss)):: – FFeettcchh aa ccooppyy ooff tthhee ccoonntteenntt ooff mmeemmoorryy cceellll wwiitthh tthhee ssppeecciiffiieedd aaddddrreessss.. – NNoonn--ddeessttrruuccttiivvee,, ccooppiieess vvaalluuee iinn mmeemmoorryy cceellll.. • SSttoorree ((aaddddrreessss,, vvaalluuee)):: – SSttoorree tthhee ssppeecciiffiieedd vvaalluuee iinnttoo tthhee mmeemmoorryy cceellll ssppeecciiffiieedd bbyy aaddddrreessss.. – DDeessttrruuccttiivvee,, oovveerrwwrriitteess tthhee pprreevviioouuss vvaalluuee ooff tthhee mmeemmoorryy cceellll.. • TThhee mmeemmoorryy ssyysstteemm iiss iinntteerrffaacceedd vviiaa:: – MMeemmoorryy AAddddrreessss RReeggiisstteerr ((MMAARR)) – MMeemmoorryy DDaattaa RReeggiisstteerr ((MMDDRR)) – FFeettcchh//SSttoorree ssiiggnnaall SYED ZARYAB HUSSAIN 8
  • 9. Structure ooff tthhee MMeemmoorryy SSuubbssyysstteemm • FFeettcchh((aaddddrreessss)) – LLooaadd aaddddrreessss iinnttoo MMAARR.. – DDeeccooddee tthhee aaddddrreessss iinn MMAARR.. – CCooppyy tthhee ccoonntteenntt ooff mmeemmoorryy cceellll wwiitthh ssppeecciiffiieedd aaddddrreessss iinnttoo MMDDRR.. • SSttoorree((aaddddrreessss,, vvaalluuee)) – LLooaadd tthhee aaddddrreessss iinnttoo MMAARR.. – LLooaadd tthhee vvaalluuee iinnttoo MMDDRR.. – DDeeccooddee tthhee aaddddrreessss iinn MMAARR – CCooppyy tthhee ccoonntteenntt ooff MMDDRR iinnttoo mmeemmoorryy cceellll wwiitthh tthhee ssppeecciiffiieedd aaddddrreessss.. Computer Architectures & Fetch- Execute Cycle MAR MDR F/S ... Memory decoder circuit Fetch/Store controller SYED ZARYAB HUSSAIN 9
  • 10. IInnppuutt//OOuuttppuutt SSuubbssyysstteemm • HHaannddlleess ddeevviicceess tthhaatt aallllooww tthhee ccoommppuutteerr ssyysstteemm ttoo:: – CCoommmmuunniiccaattee aanndd iinntteerraacctt wwiitthh tthhee oouuttssiiddee wwoorrlldd • SSccrreeeenn,, kkeeyybbooaarrdd,, pprriinntteerr,, ...... – SSttoorree iinnffoorrmmaattiioonn ((mmaassss--ssttoorraaggee)) • HHaarrdd--ddrriivveess,, ffllooppppiieess,, CCDD,, ttaappeess,, …… • MMaassss--SSttoorraaggee DDeevviiccee AAcccceessss MMeetthhooddss:: – DDiirreecctt AAcccceessss SSttoorraaggee DDeevviicceess ((DDAASSDDss)) • HHaarrdd--ddrriivveess,, ffllooppppyy--ddiisskkss,, CCDD--RROOMMss,, ...... – SSeeqquueennttiiaall AAcccceessss SSttoorraaggee DDeevviicceess ((SSAASSDDss)) • TTaappeess ((ffoorr eexxaammppllee,, uusseedd aass bbaacckkuupp ddeevviicceess)) SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 10 Execute Cycle
  • 11. II//OO CCoonnttrroolllleerrss • SSppeeeedd ooff II//OO ddeevviicceess iiss ssllooww ccoommppaarreedd ttoo RRAAMM – RRAAMM ~~ 5500 nnsseecc.. – HHaarrdd--DDrriivvee ~~ 1100mmsseecc.. = ((1100,,000000,,000000 nnsseecc)) • SSoolluuttiioonn:: – II//OO CCoonnttrroolllleerr,, aa ssppeecciiaall ppuurrppoossee pprroocceessssoorr:: • HHaass aa ssmmaallll mmeemmoorryy bbuuffffeerr,, aanndd aa ccoonnttrrooll llooggiicc ttoo ccoonnttrrooll II//OO ddeevviiccee ((ee..gg.. mmoovvee ddiisskk aarrmm)).. • SSeennddss aann iinntteerrrruupptt ssiiggnnaall ttoo CCPPUU wwhheenn ddoonnee rreeaadd//wwrriittee.. – DDaattaa ttrraannssffeerrrreedd bbeettwweeeenn RRAAMM aanndd mmeemmoorryy bbuuffffeerr.. – PPrroocceessssoorr ffrreeee ttoo ddoo ssoommeetthhiinngg eellssee wwhhiillee II//OO ccoonnttrroolllleerr rreeaaddss//wwrriitteess ddaattaa ffrroomm//ttoo ddeevviiccee iinnttoo II//OO bbuuffffeerr.. SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 11 Execute Cycle
  • 12. SSttrruuccttuurree ooff tthhee II//OO SSuubbssyysstteemm I/O controller I/O Buffer Control/Logic I/O device Computer Architectures & Fetch- Execute Cycle Data from/to memory Interrupt signal (to processor) SYED ZARYAB HUSSAIN 12
  • 13. TThhee AALLUU SSuubbssyysstteemm • TThhee AALLUU ((AArriitthhmmeettiicc//LLooggiicc UUnniitt)) ppeerrffoorrmmss – mmaatthheemmaattiiccaall ooppeerraattiioonnss ((++,, --,, xx,, //,, ……)) – llooggiicc ooppeerraattiioonnss ((=,, <<,, >>,, aanndd,, oorr,, nnoott,, ......)) • IInn ttooddaayy''ss ccoommppuutteerrss iinntteeggrraatteedd iinnttoo tthhee CCPPUU • CCoonnssiissttss ooff:: – CCiirrccuuiittss ttoo ddoo tthhee aarriitthhmmeettiicc//llooggiicc ooppeerraattiioonnss.. – RReeggiisstteerrss ((ffaasstt ssttoorraaggee uunniittss)) ttoo ssttoorree iinntteerrmmeeddiiaattee Computer Architectures & Fetch- Execute Cycle ccoommppuuttaattiioonnaall rreessuullttss.. – BBuuss tthhaatt ccoonnnneeccttss tthhee ttwwoo.. SYED ZARYAB HUSSAIN 13
  • 14. SSttrruuccttuurree ooff tthhee AALLUU Computer Architectures & Fetch- Execute Cycle • RReeggiisstteerrss:: – VVeerryy ffaasstt llooccaall mmeemmoorryy cceellllss,, tthhaatt ssttoorree ooppeerraannddss ooff ooppeerraattiioonnss aanndd iinntteerrmmeeddiiaattee rreessuullttss.. – CCCCRR ((ccoonnddiittiioonn ccooddee rreeggiisstteerr)),, aa ssppeecciiaall ppuurrppoossee rreeggiisstteerr tthhaatt ssttoorreess tthhee rreessuulltt ooff <<,, = ,, >> ooppeerraattiioonnss • AALLUU cciirrccuuiittrryy:: – CCoonnttaaiinnss aann aarrrraayy ooff cciirrccuuiittss ttoo ddoo mmaatthheemmaattiiccaall//llooggiicc ooppeerraattiioonnss.. • BBuuss:: – DDaattaa ppaatthh iinntteerrccoonnnneeccttiinngg tthhee rreeggiisstteerrss ttoo tthhee AALLUU cciirrccuuiittrryy.. ALU circuitry GT EQ LT R0 R1 R2 Rn SYED ZARYAB HUSSAIN 14
  • 15. TThhee CCoonnttrrooll UUnniitt • PPrrooggrraamm iiss ssttoorreedd iinn mmeemmoorryy – aass mmaacchhiinnee llaanngguuaaggee iinnssttrruuccttiioonnss,, iinn bbiinnaarryy • TThhee ttaasskk ooff tthhee ccoonnttrrooll uunniitt iiss ttoo eexxeeccuuttee pprrooggrraammss bbyy rreeppeeaatteeddllyy:: – FFeettcchh ffrroomm mmeemmoorryy tthhee nneexxtt iinnssttrruuccttiioonn ttoo bbee eexxeeccuutteedd.. – DDeeccooddee iitt,, tthhaatt iiss,, ddeetteerrmmiinnee wwhhaatt iiss ttoo bbee ddoonnee.. – EExxeeccuuttee iitt bbyy iissssuuiinngg tthhee aapppprroopprriiaattee ssiiggnnaallss ttoo tthhee AALLUU,, mmeemmoorryy,, aanndd II//OO ssuubbssyysstteemmss.. – CCoonnttiinnuueess uunnttiill tthhee HHAALLTT iinnssttrruuccttiioonn SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 15 Execute Cycle
  • 16. MMaacchhiinnee LLaanngguuaaggee IInnssttrruuccttiioonnss • AA mmaacchhiinnee llaanngguuaaggee iinnssttrruuccttiioonn ccoonnssiissttss ooff:: – OOppeerraattiioonn ccooddee,, tteelllliinngg wwhhiicchh ooppeerraattiioonn ttoo ppeerrffoorrmm – AAddddrreessss ffiieelldd((ss)),, tteelllliinngg tthhee mmeemmoorryy aaddddrreesssseess ooff tthhee vvaalluueess oonn wwhhiicchh tthhee ooppeerraattiioonn wwoorrkkss.. • EExxaammppllee:: AADDDD XX,, YY ((AAdddd ccoonntteenntt ooff mmeemmoorryy llooccaattiioonnss XX aanndd YY,, aanndd ssttoorree bbaacckk iinn mmeemmoorryy llooccaattiioonn YY)).. • AAssssuummee:: ooppccooddee ffoorr AADDDD iiss 99,, aanndd aaddddrreesssseess XX==9999,, YY==110000 OOppccooddee ((88 bbiittss)) AAddddrreessss 11 ((1166 bbiittss)) AAddddrreessss 22 ((1166 bbiittss)) 00001001 0000000001100011 0000000001100100 SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 16 Execute Cycle
  • 17. IInnssttrruuccttiioonn SSeett DDeessiiggnn • TTwwoo ddiiffffeerreenntt aapppprrooaacchheess:: – RReedduucceedd IInnssttrruuccttiioonn SSeett CCoommppuutteerrss ((RRIISSCC)) • IInnssttrruuccttiioonn sseett aass ssmmaallll aanndd ssiimmppllee aass ppoossssiibbllee.. • MMiinniimmiizzeess aammoouunntt ooff cciirrccuuiittrryy ---->> ffaasstteerr ccoommppuutteerrss – CCoommpplleexx IInnssttrruuccttiioonn SSeett CCoommppuutteerrss ((CCIISSCC)) • MMoorree iinnssttrruuccttiioonnss,, mmaannyy vveerryy ccoommpplleexx • EEaacchh iinnssttrruuccttiioonn ccaann ddoo mmoorree wwoorrkk,, bbuutt rreeqquuiirree mmoorree cciirrccuuiittrryy.. SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 17 Execute Cycle
  • 18. TTyyppiiccaall MMaacchhiinnee IInnssttrruuccttiioonnss • NNoottaattiioonn:: – WWee uussee XX,, YY,, ZZ ttoo ddeennoottee RRAAMM cceellllss – AAssssuummee oonnllyy oonnee rreeggiisstteerr RR ((ffoorr ssiimmpplliicciittyy)) – UUssee EEnngglliisshh--lliikkee ddeessccrriippttiioonnss ((sshhoouulldd bbee bbiinnaarryy)) • DDaattaa TTrraannssffeerr IInnssttrruuccttiioonnss – LLOOAADD XX LLooaadd ccoonntteenntt ooff mmeemmoorryy llooccaattiioonn XX ttoo RR – SSTTOORREE XX LLooaadd ccoonntteenntt ooff RR ttoo mmeemmoorryy llooccaattiioonn XX – MMOOVVEE XX,, YY CCooppyy ccoonntteenntt ooff mmeemmoorryy llooccaattiioonn XX ttoo lloocc.. YY ((nnoott aabbssoolluutteellyy nneecceessssaarryy)) SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 18 Execute Cycle
  • 19. MMaacchhiinnee IInnssttrruuccttiioonnss ((ccoonntt..)) Computer Architectures & Fetch- Execute Cycle • AArriitthhmmeettiicc – AADDDD XX,, YY,, ZZ CCOONN((ZZ)) == CCOONN((XX)) ++ CCOONN((YY)) – AADDDD XX,, YY CCOONN((YY)) == CCOONN((XX)) ++ CCOONN((YY)) – AADDDD XX RR == CCOONN((XX)) ++ RR – ssiimmiillaarr iinnssttrruuccttiioonnss ffoorr ootthheerr ooppeerraattoorrss,, ee..gg.. SSUUBBTTRR,,OORR,, ...... • CCoommppaarree – CCOOMMPPAARREE XX,, YY CCoommppaarree tthhee ccoonntteenntt ooff mmeemmoorryy cceellll XX ttoo tthhee ccoonntteenntt ooff mmeemmoorryy cceellll YY aanndd sseett tthhee ccoonnddiittiioonn ccooddeess ((CCCCRR)) aaccccoorrddiinnggllyy.. – EE..gg.. IIff CCOONN((XX)) == RR tthheenn sseett EEQQ==11,, GTT==00,, LLTT==00 SYED ZARYAB HUSSAIN 19
  • 20. MMaacchhiinnee IInnssttrruuccttiioonnss ((ccoonntt..)) • BBrraanncchh – JJUUMMPP XX LLooaadd nneexxtt iinnssttrruuccttiioonn ffrroomm mmeemmoorryy lloocc.. XX – JJUUMMPPGTT XX LLooaadd nneexxtt iinnssttrruuccttiioonn ffrroomm mmeemmoorryy lloocc.. XX oonnllyy iiff GTT ffllaagg iinn CCCCRR iiss sseett,, ootthheerrwwiissee llooaadd ssttaatteemmeenntt ffrroomm nneexxtt sseeqquueennccee lloocc.. aass uussuuaall.. • JJUUMMPPEEQQ,, JJUUMMPPLLTT,, JJUUMMPPGEE,, JJUUMMPPLLEE,,JJUUMMPPNNEEQQ • CCoonnttrrooll – HHAALLTT SSttoopp pprrooggrraamm eexxeeccuuttiioonn.. SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 20 Execute Cycle
  • 21. EExxaammppllee • PPsseeuuddoo--ccooddee:: SSeett AA ttoo BB ++ CC • AAssssuummiinngg vvaarriiaabbllee:: – AA ssttoorreedd iinn mmeemmoorryy cceellll 110000,, BB ssttoorreedd iinn mmeemmoorryy cceellll 115500,, CC ssttoorreedd iinn mmeemmoorryy cceellll 115511 • MMaacchhiinnee llaanngguuaaggee ((rreeaallllyy iinn bbiinnaarryy)) Computer Architectures & Fetch- Execute Cycle – LLOOAADD 115500 – AADDDD 115511 – SSTTOORREE 110000 – oorr – ((AADDDD 115500,, 115511,, 110000)) SYED ZARYAB HUSSAIN 21
  • 22. SSttrruuccttuurree ooff tthhee CCoonnttrrooll UUnniitt IR Computer Architectures & Fetch- Execute Cycle • PPCC ((PPrrooggrraamm CCoouunntteerr)):: – ssttoorreess tthhee aaddddrreessss ooff nneexxtt iinnssttrruuccttiioonn ttoo ffeettcchh • IIRR ((IInnssttrruuccttiioonn RReeggiisstteerr)):: – ssttoorreess tthhee iinnssttrruuccttiioonn ffeettcchheedd ffrroomm mmeemmoorryy • IInnssttrruuccttiioonn DDeeccooddeerr:: – DDeeccooddeess iinnssttrruuccttiioonn aanndd aaccttiivvaatteess nneecceessssaarryy cciirrccuuiittrryy Instruction Decoder +1 PC SYED ZARYAB HUSSAIN 22
  • 23. Computer Architectures & Fetch- Execute Cycle vvoonn NNeeuummaannnn AArrcchhiitteeccttuurree SYED ZARYAB HUSSAIN 23
  • 24. HHooww ddooeess tthhiiss aallll wwoorrkk ttooggeetthheerr?? • PPrrooggrraamm EExxeeccuuttiioonn:: – PPCC iiss sseett ttoo tthhee aaddddrreessss wwhheerree tthhee ffiirrsstt pprrooggrraamm iinnssttrruuccttiioonn iiss ssttoorreedd iinn mmeemmoorryy.. – RReeppeeaatt uunnttiill HHAALLTT iinnssttrruuccttiioonn oorr ffaattaall eerrrroorr Computer Architectures & Fetch- Execute Cycle FFeettcchh iinnssttrruuccttiioonn DDeeccooddee iinnssttrruuccttiioonn EExxeeccuuttee iinnssttrruuccttiioonn EEnndd ooff lloooopp SYED ZARYAB HUSSAIN 24
  • 25. PPrrooggrraamm EExxeeccuuttiioonn ((ccoonntt..)) • FFeettcchh pphhaassee – PPCC ---->> MMAARR ((ppuutt aaddddrreessss iinn PPCC iinnttoo MMAARR)) – FFeettcchh ssiiggnnaall ((ssiiggnnaall mmeemmoorryy ttoo ffeettcchh vvaalluuee iinnttoo MMDDRR)) – MMDDRR ---->> IIRR ((mmoovvee vvaalluuee ttoo IInnssttrruuccttiioonn RReeggiisstteerr)) – PPCC ++ 11 ---->> PPCC ((IInnccrreeaassee aaddddrreessss iinn pprrooggrraamm ccoouunntteerr)) • DDeeccooddee PPhhaassee – IIRR -->> IInnssttrruuccttiioonn ddeeccooddeerr ((ddeeccooddee iinnssttrruuccttiioonn iinn IIRR)) – IInnssttrruuccttiioonn ddeeccooddeerr wwiillll tthheenn ggeenneerraattee tthhee ssiiggnnaallss ttoo aaccttiivvaattee tthhee cciirrccuuiittrryy ttoo ccaarrrryy oouutt tthhee iinnssttrruuccttiioonn SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 25 Execute Cycle
  • 26. PPrrooggrraamm EExxeeccuuttiioonn ((ccoonntt..)) • EExxeeccuuttee PPhhaassee – DDiiffffeerrss ffrroomm oonnee iinnssttrruuccttiioonn ttoo tthhee nneexxtt.. • EExxaammppllee:: – LLOOAADD XX ((llooaadd vvaalluuee iinn aaddddrr.. XX iinnttoo rreeggiisstteerr)) Computer Architectures & Fetch- Execute Cycle • IIRR__aaddddrreessss -->> MMAARR • FFeettcchh ssiiggnnaall • MMDDRR ---->> RR – AADDDD XX • lleefftt aass aann eexxeerrcciissee SYED ZARYAB HUSSAIN 26
  • 27. Instruction Set ffoorr OOuurr VVoonn NNeeuummaannnn MMaacchhiinnee OOppccooddee OOppeerraattiioonn MMeeaanniinngg 0000 LOAD X CON(X) --> R 0001 STORE X R --> CON(X) 0010 CLEAR X 0 --> CON(X) 0011 ADD X R + CON(X) --> R 0100 INCREMENT X CON(X) + 1 --> CON(X) 0101 SUBTRACT X R - CON(X) --> R 0101 DECREMENT X CON(X) - 1 --> CON(X) COMPARE X If CON(X) > R then GT = 1 else 0 0111 If CON(X) = R then EQ = 1 else 0 If CON(X) < R then LT = 1 else 0 1000 JUMP X Get next instruction from memory location X 1001 JUMPGT X Get next instruction from memory loc. X if GT=1 ... JUMPxx X xx = LT / EQ / NEQ 1101 IN X Input an integer value and store in X 1110 OUT X Output, in decimal notation, content of mem. loc. X 1111 HALT Stop program execution SYED ZARYAB HUSSAIN Computer Architectures & Fetch- 27 Execute Cycle