0% found this document useful (0 votes)
70 views18 pages

Coa Unit5

The document discusses input-output interfaces between a CPU and peripheral devices. It explains that I/O interfaces are needed to resolve differences between the CPU and peripherals in data formats, transfer rates, and operating modes. It then describes the typical components of an I/O interface unit, including ports, registers, control/status circuits, and buffers that allow communication between the CPU bus and attached peripheral devices. Finally, it outlines the main types of I/O commands - control, status, data output, and data input - that an interface can receive from the CPU.

Uploaded by

Om
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views18 pages

Coa Unit5

The document discusses input-output interfaces between a CPU and peripheral devices. It explains that I/O interfaces are needed to resolve differences between the CPU and peripherals in data formats, transfer rates, and operating modes. It then describes the typical components of an I/O interface unit, including ports, registers, control/status circuits, and buffers that allow communication between the CPU bus and attached peripheral devices. Finally, it outlines the main types of I/O commands - control, status, data output, and data input - that an interface can receive from the CPU.

Uploaded by

Om
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

UNI

T-V
I
nput
-Out
putI
nter
face
Que:
1.Whati sI /Oi nterface?Dr awbl ockdi agr am ofcommuni cati
onl i
nkbet ween
mi cropr ocessoranddi fferentper ipher als.
2.Dr awandExpl ainI/OI nterfaceUni t
.
3.Expl ainInt erfacingofI nput -Outputwi thCPUi ndet ail.
4.Expl ainv arioust ypesofcommandsf ori nput-out putor ganizat i
on.
Ans:
I nput -
out puti nterface pr ov i
des a met hod f ort ransf er
ring i nformat ion
bet weeni nternal storageandext ernal I/Odev ices.
 Per i
pher alsconnect edt oacomput erneedspeci alcommuni cationl i
nksf or
i
nt erfacingt hem wi tht hecent ralprocessi nguni t.
 Thepur poseoft hecommuni cationl inki stor esol vet hedi f f
erencest hat
existbet weent hecent ral comput erandeachper ipher al.
 Themaj ordi fferencesar e:
1.Per ipher alsar eel ect romechani caland el ectromagnet i
cdev i
cesand
theirmannerofoper at i
oni sdi f
ferentf rom t heoper at i
onoft heCPUand
memor y,whi char eel ectr oni
cdev ices.Ther ef ore,aconv er si
onofsi gnal
valuesmayber equi red.
2.Thedat at ransferr ateofper i
pher al si sslowert hant het ransferr ateof
theCPU.
3.Dat acodesandf or mat si nper ipher alsdi ff
erf r
om t hewor df ormati nt he
CPUandmemor y.
4.Theoper atingmodesofper ipher alsar edi f
f erentf r
om eachot her .
 Tor esol vet hesedi fferences, comput ersy st
emsi ncl udespeci alhar dwar e
component s bet ween t he CPU and per i
pher alst o super vise and
sy nchr onizeal li
nputandout putt ransf er s.
 These component s ar e cal l
ed i nter f
ace uni ts because t heyi nterface
bet weent hepr ocessorbusandt heper i
pher al dev ice.

I
/OBusandInter
faceModul
es:
A t ypicalcommunicat
ion l
i
nk bet
ween t
he pr
ocessor and sev
eral
peri
pheral
s
isshowninFig.
 TheI/Obusconsi stsofdat al i
nes, addressl ines, andcont rolli
nes.
 TheI/Obusf rom t hepr ocessori sattachedt oal l peripher ali
nterfaces.
 Tocommuni cat ewi thapar ti
culardev i
ce,t hepr ocessorpl acesadev ice
address
ont headdr essl ines.
 Eachi nter faceat tachedt ot heI /Obuscont ai nsanaddr essdecodert hat
moni t
or st headdr essl ines.
 Whent hei nter facedet ect si tsownaddr ess,i tact i
vat est hepathbet ween
thebusl inesandt hedev ice.
 Allper i
pher alswhoseaddr essdoesnotcor respondt ot headdr essi nt he
busar edi sabl edbyt heirint erface.
 Thepr ocessorpr ovidesaf unct i
oncodei nt hecont rollines.Thef unct ion
codei sr ef erredt oasanI /Ocommand.
 Ther ear ef ourt ypesofcommandst hatani nt er f
acemayr eceive.Theyar e
classifi
edascont rol,stat us, dataout put ,anddat ainput .
 Cont rol command:
oI tisi ssuedt oact iv
atet heper i
pher alandt oi nformi twhatt o
do.
o Forexampl e,a magnet ict ape uni tmaybe i nstructed t o
backspacet het apebyoner ecor d,t or ewi ndt het ape,ort o
star tthet apemov i
ngi nthef orwar ddi rect i
on.
 St atuscommand:
oI tisusedt ot estv ari
ousst atuscondi ti
onsi ntheinterfaceand
theper ipher al.
o Forexampl e,t hecomput ermaywi sht ocheckt hest at
usof
theper ipher al bef oreat ransferi si niti
ated.
 Dat aout put :
oI tcommandcausest hei nterfacet or espondbyt ransferring
dat a
f
rom t hebusi ntooneofi tsregist ers.
o Consi deranexampl ewi that apeuni t.Thecomput erst arts
the t ape mov i
ng by i ssui ng a cont rolcommand.The
processort henmoni torst hestatusoft hetapebymeansofa
statuscommand.Whent hetapei si
nt hecor r
ectposition,t
he
processori ssues a dat a out putcommand.The i nterf
ace
respondst ot headdr essandcommandandt r
ansf ersthe
informationfrom t hedat al i
nesinthebust oit
sbufferregister
.
 Dat
ainput:
oI ti
st heopposi teoft hedat aoutput.
oI nt hi
scaset hei nterfacer ecei
v esani tem ofdataf rom the
per i
pheralandpl acesi tinitsbufferregister
.

I
/OI
nter
faceUni
t
 AnI/Oint
erf
aceuni
tisshowni
nbl
ockdi
agr
am f
ormi
nFi
g.

I /
OI nt
erf
aceuni tconsi
stsofpor tA,PortBr egi
ster,acontr
olregi
ster
,a
stat
usregist
er,busbuffer
s,andtimingandcontrolcir
cui
ts.
 Theint
erfacecommuni cateswiththeCPUthrought hedatabus.
 Thechipselectandregist
erselectinput
sdeterminetheaddressassi
gned
tothei nt erface.
 TheI /Or eadandwr i
tearet wocont rol l
inesthatspeci f
yani nputorout put,
respect i
v ely.
 Thef ourr egi sterscommuni catedi rectl
ywi t
ht heI /Odev i
ceat tachedt o
theint er face.
 TheI /Odat at oandf r
om t hedev i
cecanbet r
ansf err
edintoeitherpor tAor
portB.
 A command i s passed t ot he I/O dev i
ce bysendi ng a wor dt othe
appr opr iatei nterfaceregister
.
 Cont roli ssentt othecont rolregi
ster ,stat
usi nformati
oni sreceivedf r
om
thest at usr egi ster
,anddat aaret ransf er
redt oandf r
om por tsAandB
register s.
 Thisci rcui tenabl est he chip select( CS)i nputwhen t he interface i
s
selectedby
theaddr essbus.
 Thet wor egi sterselectinputsRS1andRS0ar eusuallyconnect edt othe
twoleastsi gnificantli
nesoft headdr essbus.
 Theset wo i nput sselectoneoft hef ourr egister
si nthei nterfaceas
specifiedi nt het abl
eshownbel ow.

 Thecont
entoft heselectedregist
eri str
ansf
erint
ot heCPUv iat
hedat
a
buswhentheI/
Or eadsi gnalisenabled.
 TheCPUtransf
ersbinaryinformati
oni nt
othesel
ectedregi
sterv
iat
hedat
a
buswhentheI/
Owr it
ei nputisenabled.

Asy
nchr
onousDat
aTr
ansf
er
Que:

1.Expl
ainstr
obecontrolmet
hodofasy
nchr
onousdat atr
ansfer.
2.Descr
ibeStrobeContr
olwi
thhel
pofsour
ceinit
iat
edSt r
obeforData
tr
ansfer
.
3.Descr
ibeStrobeContr
olwi
thhel
pofDest
inat
ionini
tiat
edStrobeforData
tr
ansfer
.
4.Drawblockdiagr
am andti
mingdi
agr
am f
orthree-
wirehandshakeprotocol
.
5.WhyHandshaki ngmet hodi srequi
red?
6.Explai
nserialasynchronousdat atransmi ssiontechni
que.
7.DescribeAsynchronousSer i
alTransfer.
8.DescribeAsynchronousSer i
alTransferindet ai
lwithdi
agrams.
9.Explai
nmet hodsofAsy nchronousDat aTr ansfer.
10.
Explai
nAsy nchronousdat at r
ansferusinghandshaki ngindetail
.
11.
Givethedif
ferencesofSy nchronous&Asy nchronousdatatransfer.
12.
Compar eSerial&Par al
leldatatransfer
.Whi chonei ssuperi
ortot heot
her
?
13.
Drawt hebl
ockdi agram forser i
altr
ansfer.

Ans:
 Twouni ts, suchasaCPUandanI /Oi nterface, aredesi gnedi ndependentl
y
ofeachot her.
I fther egistersi nthei nterfaceshar eacommoncl ockwi t
ht heCPU
registers,thet ransf erbet weent het wouni tsi ssaidt obesy nchronous.
I nmostcases, thei nternaltimingi neachuni tisindependentf rom the
otheri nthateachusesi t
sownpr i
vatecl ockf orinternal registers.
I nthatcase, t
het wouni tsar esaidt obeasy nchr onoust oeachot her.
 Thi sappr oachi swi delyusedi nmostcomput ersy stems.
 Asy nchronousdat at ransferbet weent woi ndependentuni tsrequiresthat
cont r
ol signalsbet r
ansmi ttedbet weent hecommuni catinguni tsto
i
ndi catet het i
meatwhi chdat aisbei ngt ransmi t
ted.
 Ther ear et woway stoachi ev eAsy nchronousdat atransf er:
1.St robeCont rol:
a.St r
obpul sesuppl iedbyoneoft heuni tst oi ndicatet otheother
unitwhent het r
ansf erhast ooccur .
2.Handshaki ng:
a.I nthismet hod, eachdat aitem bei ngt r
ansf erredwi t
hacont rol
signalsi ndicatest hepr esenceofdat aint hebus.
b.Theuni treceiv i
ngt hedat aitem r espondswi t
hanot hercontrol
signal toacknowl edger ecei ptoft hedat a.
c.Thi st ypeofagr eementbet weent woi ndependentuni t
sis
referredt oashandshaki ng.

1.St
robeCont
rol
:
 Thestr
obecont
rol
methodofasynchronousdat
atr
ansferemploysasi
ngle
cont
roll
inet
oti
meeachtr
ansfer
.
 Thestr
obemaybeacti
vat
edbyeitherthesour
ceorthedest
inati
onuni
t.

Sour
ce-
ini
ti
atedt
ransf
er:
 Fi
g.(
a)showsasource-i
nit
iat
edt
ransf
er.
 Thedat abuscar r
iesthebi nar yi nformat ionf rom sour ceuni ttothe
destinationuni t
.
 Thebushasmul tipl
elinest ot r
ansf eranent i
rebyt eorwor d.
 Thest robei sasi ngleli
net hati nformst hedest inationunitwhenav ali
d
datawor di savail
ableint hebus.
 Asshowni nt hetimingdi agr am ofFi g.(
b) ,thesour ceunitfirstplacest he
dataont hedat abus.
 Afterabr i
efdelayt oensur et hatt hedat ast aytoast eadyv alue,thesour ce
activatest hestrobepul se.
 Thei nformat ionont hedat abusandt hest robesi gnal r
emai nint heact i
ve
statef orasuf fi
cientti
meper i
odt oallowt hedest inationuni ttoreceivethe
data.
 Thedest inati
onuni tusest hef alli
ngedgeoft hestrobepul set otransfer
thecont ent softhedat abusi ntooneofi tsinternal r
egisters.
 Thesour cer emov esthedat af rom t hebusabr iefper i
odaf teritdisabl
es
i
tsst robepul se.
 Thest robesi gnal i
sdisabl edi ndi catest hatt hedat abusdoesnotcont ain
vali
ddat a.
 Newv aliddat awillbeav ailableonl yaftert hestrobei senabl edagai n.

Dest
inat
ion-
ini
ti
atedt
ransf
er:

 Fi
g.(
a)showsadat
atr
ansf
eri
nit
iat
edbyt
hedest
inat
ionuni
t.
I nthi
scase, thedest i
nati
onunitactivatesthestrobepulse,i
nformingt
he
sourcetoprov i
det hedata.
 Thesour ceunitrespondsbypl acingther equestedbinar
yinformati
onon
thedatabus.
 Thedat amustbev ali
dandr emainint hebusl ongenoughf orthe
desti
nationunittoaccepti t
.
 Thef al
l
ingedgeoft hestrobepulsecanbeusedagai nt otr
iggera
desti
nationregist
er .
 Thedest i
nati
onuni tthendisablesthest r
obe.
 Thesour ceremov est hedatafrom thebusaf terapredeter
mi nedti
me
i
nterval
.

2.Handshaki
ng
 Thedi sadv antageoft hest robemet hod:
o Thesour ceuni tthati niti
atest het r
ansf erhasnowayofknowi ng
whet hert hedest inat i
onuni thasact uall
yr ecei vedthedat ait
em that
waspl acedi nthebus.
o Adest inat ionuni tt hati nit
iatest het ransf erhasnowayofknowi ng
whet hert hesour ceuni thasact uall
ypl acedt hedat aont hebus.
 Thehandshakemet hodsol v esthispr oblem byi ntroducingasecond
cont r
ol si
gnal thatpr ovidesar eplytot heuni tthati niti
atesthet r
ansfer.
 Thebasi cprincipl eoft het wo- wirehandshaki ngmet hodofdat atransf
eris
asf oll
ows.
o Onecont rollinei si nt hesamedi rectionast hedat aflowi nthebus
from thesour cet ot hedest inat i
on.I ti susedbyt hesour ceuni tto
informt hedest i
nat ionuni twhet hert her ear ev ali
ddat ainthebus.
o Theot hercont rollinei si ntheot herdi rectionf rom thedest i
nati
ont o
thesour ce.I ti susedbyt hedest inationuni tt oinformt hesour ce
whet heri tcanacceptdat a.
 Thesequenceofcont rol dur i
ngt het ransf erdependsont heunitthat
init
iat
est het ransf er.
Source-i
niti
atedt ransf erusi ngHandshaki ng:
 Figureshowst hedat at ransf erpr ocedur ewheni nitiatedbyt hesource.
 Thetwohandshakinglinesar edataval
id,
whichisgeneratedbyt
hesource
unit
,anddataaccepted,generatedbythedest
inat
ionunit.
 Thetimingdiagr
am showst heexchangeofsignal
sbetweent het
wounits.
 Thesequenceofev entslistedinpart(c)showst hefourpossi
blest
ates
thatt
hesy st
em canbeatanygi v ent
ime.

 Thesour ceunitiniti
atest het r
ansferbyplaci
ngt hedat aont hebusand
enabli
ngitsdatav ali
dsi gnal.
 The data accepted signali sacti
vated bythe destinati
on unitafterit
acceptsthedatafr om thebus.
 Thesour ceunitthendi sablesitsdatavali
dsignal,whichi nv
alidat
est he
dataonthebus.
 Thedestinati
onuni tthendi sablesi
tsdataacceptedsignalandt hesy st
em
goesintoit
sinit
ial st
ate.
 Thesourcedoesnotsendt henextdatait
em untilaf
terthedestinati
onunit
showsi t
sr eadi
nesst oacceptnew dat abydi sabli
ngi t
sdat aaccept ed
si
gnal.

Dest
inat
ion-
ini
ti
atedt
ransf
erusi
ngHandshaki
ng:

 Thedest
inat
ion-
ini
ti
atedt
ransf
erusi
nghandshaki
ngl
i
nesi
sshowni
nFi
g.
 Here,t
henameoft hesi
gnalgeneratedbythedestinati
onunithasbeen
changedt or eadyfordatatoref
lectitsnewmeani ng.
 Thesour ceuni tinthi
scasedoesnotpl acedataont hebusuntilaft
eri
t
recei
vest her eadyfordat
asignalfrom thedesti
nati
onunit.
 From thereon, thehandshaki
ngpr ocedurefol
lowst hesamepat t
ernasin
thesource-initi
atedcase.
Asy
nchr
onousSer ialTransfer
:
 Thetransf erofdat abetweent wounitsmaybedonei nparall
el orser
ial
.
 Paral
l
el datat r
ansmi ssi
on:
o Eachbi toft hemessagehasi t
sownpat handthetotalmessagei s
transmi t
tedatt hesamet i
me.
o Thi smeanst hatann-bitmessagemustbet ransmit
tedt hroughn
separ ateconduct orpaths.
o Par all
eltransmissionisfasterbutr
equir
esmanywi res.
oI tisusedf orshortdi
stancesandwher espeedisimportant.
 Seri
aldat atransmi ssi on:
o Eachbi ti nt hemessagei ssenti nsequenceoneatat i
me.
o Thi smet hodr equi restheuseofonepai rofconduct orsorone
conduct orandacommongr ound.
o Ser i
al t
ransmi ssioni ssl owerbuti sl essexpensi v esi nceitrequires
onl yonepai rofconduct or s.
 Seri
altransmi ssi oncanbesy nchr onousorasy nchr onous.
 SynchronousSer ial tr
ansmi ssion:
o Thet wouni tsshar eacommoncl ockf requencyandbi tsar e
transmi ttedcont inuousl yatt her atest atedbyt hecl ockpul ses.
oI nlongdi stantser i
al t
ransmi ssi on, eachuni tisdr i
venbyasepar at
e
clockoft hesamef requency .
o Sy nchroni zat ionsi gnalsar et ransmi tt
edper i
odical l
ybet weent he
twouni tst okeept heircl ocksi nst epwi theachot her .
oI nit,bitsmustbet ransmi ttedcont inuouslyt okeept hecl ock
frequencyi nbot huni t
ssy nchr oni zedwi t
heachot her .
 AsynchronousSer i
al transmi ssi on:
o Binar yinfor mat ioni ssentonl ywheni tisav ailableandt heline
remai nsi dlewhent herei snoi nformat i
ont obet ransmi tt
ed.
o Aser i
al asy nchr onousdat at ransmi ssiont echni queusedi nmany
interactivet er mi nalsempl oy sspeci al bit
st hatar ei nsertedatbot h
endsoft hechar actercode.
o Wi ththist echni que, eachchar act erconsi stsoft hreepar t
s: astart
bit,thechar act erbi ts,andst opbi ts.
o Theconv ent ioni st hatthet ransmi tterrestsatt he1- statewhenno
char acter sar et ransmi tted.
o Thef i
rstbi t,cal l
edt hest artbi t,isal way sa0andi susedt oindicate
thebegi nningofachar act er.
o Thel astbi tcal l
edt hest opbi tisal way sa1.
o Anexampl eoft hisf ormati sshowni nFig.

 Atransmittedchar act ercanbedet ectedbyt her eceiverfrom knowledgeof


thetr
ansmi ssionr ules:
1.Whenachar acterisnotbeingsent ,thelineiskepti nthe1-stat
e.
2.Thei nit
iationofachar actertransmissionisdet ectedf r
om the
startbit
, whi chisalway s0.
3.Thechar act erbit
salway sfollowthest artbi
t .
4.Afterthel astbi tofthechar acteri
stransmi tted,ast opbiti
s
detectedwhent helinereturnst ot
he1- statef oratleastonebit
ti
me.
 Usingtheser ul
es, ther ecei
vercandet ectt
hest artbitwhent heli
negoes
fr
om 1t o0.
 Acl ocki nt her ecei v erexami nest hel ineatpr operbi ttimes.
 Ther ecei verknowst het ransf errat eoft hebi tsandt henumberof
char act erbi t
st oaccept .
 Aftert hechar act erbi tsar et ransmi tted, oneort wost opbi tsar esent.
 Thest opbi tsar eal way sint he1- stat eandf r
amet heendoft hechar acter
tosigni f ythei dleorwai tst ate.
 Thel iner emai nsi nt he1- st ateunt i
lanot herchar act eri str
ansmi tt
ed.
 Thest opt i
meensur est hatanewchar act erwillnotf ol
lowf oroneort wo
bittimes.
 Ani l
lust ration:
o consi dert heser i
alt r
ansmi ssionofat ermi nalwhoset ransferrateis
10char act erspersecond.
o Eacht r ansmi ttedchar acterconsi stsofast artbi t
,eighti nformat i
on
bits, andt wost opbi ts, f
orat ot alof11bi ts.
o Tenchar act erspersecondmeanst hateachchar actert akes0. 1s
fort ransf er .
o Si ncet her ear e11bi tst obet ransmi t
ted,i tfol l
owst hatt hebi tti
me
i
s9. 09ms.
o Thebaudr atei sdef inedast her ateatwhi chser ialinformat ionis
transmi t tedandi sequi v al
entt ot hedat at ransf erinbi t
spersecond.
o Tenchar act erspersecondwi than11- bitf ormathasat ransferrate
of110baud.
o Thet ermi nal hasakey boar dandapr inter
.
o Ev eryt i
meakeyi sdepr essed,t het ermi nalsends11bi tsser i
all
y
alongawi re.
o To pr inta char act eri nt hepr inter,an 11- bitmessagemustbe
recei vedal onganot herwi re.
o Thet ermi nal interfaceconsi stsofat ransmi tt
erandar eceiver.
o Thet r
ansmi tteraccept san8- bitchar acterf rom t hecomput erand
pr oceedst osendaser ial11- bitmessagei ntot hepr i
nterl i
ne.
o Ther ecei veraccept saser ial11- bitmessagef rom thekey boardl i
ne
andf or war dst he8- bitchar actercodei ntot hecomput er.
oI ntegr at edci rcui t
sar eav ai l
abl ewhi char especi fi
callydesi gnedt o
pr ovide t he i nt erf
ace bet ween comput erand si milari nteracti
ve
ter minal s.
o Suchaci rcui tiscal ledanasy nchr onouscommuni cat i
oni nterf
aceor
auni ver salsy nchr onousr ecei v ert ransmit ter( UART) .
ModesofTr
ansf
er
Que:
1.Expl ainanyt woModeofDat aTr ansf er
.
2.Listv ari
ousmodesofDat aTransf er&expl ai
nanytwo, wit
hexampl e.
3.Expl ainv ari
ousmodesofdat at ransferbet weencentr
alcomput erand
peri
pher als.
4.Expl ainModesofDat aTransfer.
5.Di f
ferentiatepr ogrammedI /OV/ Si nter
ruptini
ti
ati
veI/O.
Ans:
 Dat at r
ansf erbet weent hecentral comput erandI/Odevicesmaybe
handledi nav ari
etyofmodes.
 Somemodesuset heCPUasani ntermediatepath;ot
herstransfert
hedat
a
di
rectlytoandf r
om thememor yuni t
.
 Dat at r
ansf ert oandf r
om per i
pher alsmaybehandl edinoneoft hr
ee
possiblemodes:
1.Pr ogrammedI /
O
2.I nterrupt-
ini
ti
atedI/O
3.Di r
ectmemor yaccess( DMA)

1.Progr ammedI /O
 Progr ammedI /Ooper ationsar et heresul tofI /Oi nst r
uctionswr it
tenint he
comput erpr ogram.
 Eachdat aitem t ransferi sini ti
atedbyani nst ructioni nt hepr ogr
am.
 Transf er r
ingdat aunderpr ogr am cont r
olr equi resconst antmoni tori
ngof
theper i
pher al byt heCPU.
 Once a dat at ransferi si ni t
iated,the CPU i sr equired t o moni t
ort he
interfacet oseewhenat ransf ercanagai nbemade.
I nt hi
smet hod, theCPUst ay sinapr ogram l oopunt i
ltheI /Ounitindicates
thatiti sreadyf ordat at ransf er.
 Thi sisat i
me- consumi ngpr ocesssi ncei tkeepst hepr ocessorbusy .
I nt hepr ogr ammedI /Omet hod, t
heI /Odev i
cedoesnothav edi
rectaccess
tomemor y.
 At ransf erf rom anI /
Odev icet omemor yr equirest heexecut i
onofsev eral
instructionsbyt heCPU,i ncl udingani nputi nstruct i
ont otransferthedat a
from t hedev i
cet ot heCPUandast orei nstruct i
ont ot ransf
ert hedat a
from t heCPUt omemor y.
 Ot herinst ructionsmaybeneededt ov erifyt hatt hedat aar eav ail
ablefrom
thedev iceandt ocountt henumber sofwor dst ransf erred.
Exampl eofPr ogr ammedI /
O:
 Anexampl eofdat atransf erf rom anI /
Odev i
cet hroughani nterf
acei nto
theCPUi sshowni nFig.
 Thedev icet ransfersby tesofdat aoneatat i
meast heyareav ail
abl e.
 Whenaby teofdat ai sav ailable,thedev i
cepl acesitintheI /Obusand
enabl esi tsdat av ali
dl i
ne.
 Thei nter f
aceaccept st heby teintoit
sdat ar egi st
erandenabl est hedat a
accept edl i
ne.
 Thei nter faceset sabi tint hest atusregisterthatwewi l
lrefertoasanFor
"fl
ag"bi t .
 Thedev i
cecannow di sabl et hedat av alidl i
ne,buti twi l
lnott ransfer
anot herby teunt ilt
hedat aaccept edli
neisdi sabl edbytheinterface.
 Thisi saccor dingt othehandshaki ngprocedur e.
 A pr ogr am i swr it
tenf ort hecomput ert ocheckt hef l
agi nt hest at
us
registert odet erminei faby tehasbeenpl acedi nthedatar egisterbyt he
I/Odev ice.
 Thisi s done byr eading t he status registeri nto a CPU r egisterand
checki ngt hev alueoft hef lagbi t.
I fthef lagi sequal to1, theCPUr eadsthedat af rom thedatar egister.
 Thef l
ag bi tist hen cl ear ed to 0 byei thert heCPU ort hei nt er
face,
dependi ngonhowt hei nterfaceci rcui
tsaredesi gned.
 Oncet hef lagi scleared,t hei nt
erfacedisablest hedat aaccept edl ineand
thedev icecant hent ransf ert henextdat aby t
e.

2.I
nterrupt-i
nit
iatedI /O
InPr ogr ammedI /O met hod,CPU const antlymoni tor i
ngt hef lagmeans
CPUst ay sbusyunt i
ltheI /Ouniti ndicatest hatitisreadyf ordatat ransfer.
 Thismode oft ransferusest he int err
uptf acil
it
yt o solve pr oblem of
ProgrammedI /Omet hod.
Int hi
smode, t
hei nterfacekeepsmoni tor
ingt hedev ice.
Int hemeant imet heCPUcanpr oceedt oexecut eanot herprogram.
 Whent hei nterfacedet ermi nest hatt hedev i
cei sreadyf ordatat ransfer,i
t
generatesani nterruptr equesttot hecomput er.
 Upondet ect
ingt heext ernalinterruptsi gnal,theCPUst opst het askitis
processing,stor i
ngt her eturnaddr essf rom t hepr ogr am count erintoa
memor ystackandcont rolbranchest oaser vi
cer outinet hatprocessest he
requi
redI /Otransf er.
 Aftert het ransf eri scompl eted,t hecomput err eturnst ot hepr evi
ous
program t ocont i
nuewhati twasdoi ngbef oret hei nterrupt.
 Thewayt hatt hepr ocessorchoosest hebr anchaddr essoft heser vi
ce
routi
nev ariesf rom oneuni ttoanot her.
Inpr i
nci ple, ther earet womet hodsf oraccompl ishingt his.
1.Nonv ect oredi nter r
upt
oI nit,thebr anchaddr essi sassi gnedt oaf ixedl ocationinmemor y
.
2.Vect oredi nt err
upt
oI ni t,thesour cet hatint errupt ssuppl iest hebr anchi nformationto
thecomput er.
o Thi sinf ormat ioni scall
edt hei nterruptv ect or.
oI nsomecomput ersthei nt erruptv ectori st hefirstaddr essoftheI/O
ser vi
cer outine.
oI not hercomput ersthei nterruptv ect orisanaddr esst hatpointstoa
l
ocat i
oni nmemor ywher et hebegi nni
ngaddr essoft heI /
Oser vi
ce
rout i
nei sstored.

3.
Dir
ectmemor yaccess( DMA)
 Thet ransf erofdat abet weenaf aststoragedev i
cesuchasmagnet i
cdi sk
and
memor yi softensl owert hant hespeedoft heCPU.
 Remov ingt heCPUf rom t hepat handl ett
ingt heperi
pher aldevicemanage
thememor ybusesdi rect lywoul dimpr ovet hespeedoft ransfer
.
 Thi stransf ertechni quei scal ledDirectmemor yAccess( DMA) .
I ndirectmemor yaccess( DMA) ,thei nterfacet r
ansfersdat aintoandout
ofthememor yuni tthrought hememor ybus.
 Fort hatCPUf irstiniti
al izedt heDMA.
 TheCPUi niti
atest het ransf erbysuppl y i
ngt hefoll
owingi nformationt othe
DMAt hr ought hedat abus:
o Thest arti
ngaddr essoft hememor ybl ockswher edat aareav ail
able
(forRead)orwher edat aaret obest or ed(f
orwr i
te).
o Thewor dcount ,whi chisthenumberofwor dsint hememor yblock.
o Cont rol t
ospeci fyt hemodeoft ransf ersuchasr eadorwr it
e.
o Acont roltost ar tt heDMAt r
ansf er.
 Oncet heDMAi si nit
ial i
zed,t heDMAr equest smemor ycy clesthrought he
memor ybus.
 Whent her equesti sgr ant edbyt hememor ycontr
oll
er ,DMAst artsand
Continuest ot ransferdat abetweenmemor yandper ipheralunitunt ilan
entir
ebl ockist ransfer red.
 Af terini ti
ali
zingDMA, CPUst opscommuni cati
ngwi t
ht heDMAunl essit
receivesani nter r
uptsi gnalori fitwant st ocheckhow manywor dshav e
beent ransf err
ed.
I
nput
-Out
putPr
ocessor
Que:
1.Descr i
beTerm“ I
OP”.
2.Explainwi thdiagram t
hef unct
ionofI nputOut putProcessor(I
OP).
3.Whati sfuncti
onofI OP?Explainwi t
hcircuitdiagram.
4.ExplainCPU- I
OPcommuni cati
onwi thblockdiagr am.
5.Wr it
eashor tnoteonCPU- IOPCommuni cati
onwi thnecessarydi
agr
am.
6.ExplainCPU- I
OPcommuni cati
on.
7.HowCPU/ IOPcommuni cati
ont akesplacet oachi ev
eeffect
iveI/
O
operati
on.
Ans:

I nst
eadofhav ingeachi nter
facecommuni catewi t
ht heCPU,acomput er
mayi ntegrateoneormor eexternalprocessor sandassi gnt hem thetask
ofcommuni cati
ngdirectl
ywithallI/
Odev ices.
 Thesepr ocessorsareknownasi nput-
OutputPr ocessor(IOP).
 TheIOPcanhandl emanyper i
pheral
s.
 AnI OP iscl assi
fi
edasapr ocessorwi t
hdi rectmemor yaccess( DMA)
capabili
tythatcommuni cateswithI/Odev ices.
I OP issi mil
art o aCPU exceptt hati ti sdesi gned to handlet heI/O
processing.
I OP can f et
ch and execut eits own inst ructi
ons.I OP instr
ucti
ons are
speciall
ydesignedtof aci
li
tat
eI /
Ot r
ansfers.
 Thebl ockdiagram ofacomput erwithtwopr ocessorsi sshowni nFig.

 Thememor yunitoccupiesacent r
alposit
ionandcancommunicat
ewith
CPUandI OP.
 TheIOPpr ov
idesapat hf ortransferofdatabet
weenvari
ousperi
pher
al
devi
cesandthememor yunit
.
 CPUassignsthetaskofI/OtransfertoIOP.
 From t
henIOPoper at
esindependentoft heCPUandconti
nuest
ot r
ansf
er
datafrom I/Odev icesandmemor y.
 Thecommuni cat ionbetweent heIOP andt hedevi
cesat t
achedt oi tis
sameaspr ogram cont rolmethodoft r
ansfer.
 Thecommuni cat i
onbet weent heIOPandt hememor yissameasDi rect
memor yTransf er( DMA).
 Thewaybywhi cht heCPUandI OPcommuni cat
edependsont hesystem.
I nvery-l
arge-scal ecomput er
s,eachprocessorisindependentofal
lot hers
andanyonepr ocessorcani nit
iateanoperat
ion.
I nmostcomput ersystems,theCPUi sthemast erwhil
etheIOPisasl ave
processor.
 The CPU assi gnst he t
askofal loperati
ons,butIOP instr
ucti
onsar e
executedintheI OP.

CPU-I
OPCommuni
cat
ion
 Thecommuni cati
onbet weenCPUandI OPmaytakedi
ffer
entf
orms,
dependingont heparticularcomput er
.
Inmostcasest hememor yunitactsasamessagecenterwher
eeach
processorleavesinf
ormat i
onfortheother.
 Thesequenceofoper ationsbetweenCPUandI OPareshowninthe
fl
owchar tofFig.
1.TheCPUsendsani nstructiont otestt heIOPpat h.
2.TheI OPr espondsbyi nser t
ingast atuswor di nmemor yf ortheCPUt o
check.
Thebi t
soft hest at uswor dindicatethecondi tionoft heIOPandI /Odev i
ce,
suchasI OP ov er l
oad condi ti
on,dev i
cebusywi t
hanot hert ransfer
,or
devicereadyf orI/Ot ransf er.
3.TheCPUr efer
st ot hest atuswor dinmemor yt odecidewhatt odonext .If
alli
sinor der,theCPUsendst heinstructiont ost artI/
Ot ransf er.
4.Thememor yaddr essr eceivedwi t
ht hisi nstructiontell
st heI OPwher et o
fi
ndi t
spr ogram.
5.TheCPUcannow cont inuewi t
hanot herpr ogr am whi l
et heI OPi sbusy
withtheI/Opr ogr am.
6.Bothpr ogramsr ef ertomemor ybymeansofDMAt r
ansfer.
7.Whent heI OPt ermi natest heexecut ionofi tspr ogram, i
tsendsani nter
rupt
requesttot heCPU.
8.TheCPUr espondst ot hei nterr
uptbyi ssui ngani nstructiont or eadt he
stat
usf r
om theIOP.
9.TheI OP respondsbypl acing t
hecont entsofi tsstatusr eportintoa
speci
fiedmemor ylocat
ion.Thestatuswordindicateswhet herthetr
ansfer
hasbeencompl etedorifanyerr
orsoccurredduringthetransfer.
10.
From inspect
ionofthebitsinthest at
uswor d,theCPUdet erminesifthe
I/
Ooper ati
onwascompl etedsati
sfactor
il
ywithouterror
s.

You might also like