COA UNIT-1 Input-Output Instructions.pdf

deshinirishitha 15 views 13 slides Oct 16, 2024
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

Sent by Copilot:
It looks like you’re asking for a detailed explanation or expansion of the previous information into a 3000-word format. While I can provide a thorough and detailed response, generating exactly 3000 words might be a bit challenging in this format. However, I can certainly give you...


Slide Content

Input-OutputandInterrupt
•Acomputercanservenousefulpurposeunless
itcommunicateswiththeexternalenvironment.
•Instructionsanddatastoredinmemorymust
comefromsomeinputdevice.
•Computationalresultsmustbetransmittedto
theuserthroughsomeoutputdevice.
•Todemonstratethemostbasicrequirementsfor
inputandoutputcommunication,wewilluseas
anillustrationaterminalunitwithakeyboard
andprinter.

Input-OutputConfiguration
•Theterminalsendsandreceivesserial
information.
•Eachquantityofinformationhaseightbitsof
analphanumericcode.
•Theserialinformationfromthekeyboardis
shiftedintotheinputregisterINPR.
•Theserialinformationfortheprinteris
storedintheoutputregisterOUTR.
•Thesetworegisterscommunicatewitha
communicationinterfaceseriallyandwith
theACinparallel.

•The1-bitinputflagFGIisacontrolflip-flop.The
flagbitissetto1whennewinformationis
availableintheinputdeviceandisclearedto0
whentheinformationisacceptedbythe
computer.
•Theflagisneededtosynchronizethetiming
ratedifferencebetweentheinputdeviceand
thecomputer.
•Theprocessofinformationtransferisasfollows.
Initially,theinputflagFGIisclearedto0.When
akeyisstruckinthekeyboard,an8-bit
alphanumericcodeisshiftedintoINPRandthe
inputflagFGIissetto1.

•Aslongastheflagisset,theinformationinINPRcannotbe
changedbystrikinganotherkey.
•Thecomputercheckstheflagbit;ifitis1,theinformation
fromINPRistransferredinparallelintoACandFGIiscleared
to0.
•Oncetheflagiscleared,newinformationcanbeshiftedinto
INPRbystrikinganotherkey.
•TheoutputregisterOUTRworkssimilarlybutthedirection
ofinformationflowisreversed.Initially,theoutputflag
FGOissetto1.
•Thecomputercheckstheflagbit;ifitis1,theinformation
fromACistransferredinparalleltoOUTRandFGOiscleared
to0.
•Theoutputdeviceacceptsthecodedinformation,printsthe
correspondingcharacter,andwhentheoperationis
completed,itsetsFGOto1.
•ThecomputerdoesnotloadanewcharacterintoOUTR
whenFGOis0becausethisconditionindicatesthatthe
outputdeviceisintheprocessofprintingthecharacter.

Input-OutputInstructions
•Inputandoutputinstructionsareneededfor
transferringinformationtoandfromACregister,for
checkingtheflagbits,andforcontrollingthe
interruptfacility.
•Input-outputinstructionshaveanoperationcode
1111andarerecognizedbythecontrolwhenD7=1
andI=1.
•Theremainingbitsoftheinstructionspecifythe
particularoperation.
•Theseinstructionsareexecutedwiththeclock
transitionassociatedwithtimingsignalT3.
•EachcontrolfunctionneedsaBooleanrelationD7IT3,
whichwedesignateforconveniencebythesymbolp.
•Thecontrolfunctionisdistinguishedbyoneofthe
bitsinIR(6-11).

Input-Output Instructions

•TheINPinstructiontransferstheinputinformation
fromINPRintotheeightlow-orderbitsofACandalso
clearstheinputflagto0.
•TheOUTinstructiontransferstheeightleast
significantbitsofACintotheoutputregisterOUTR
andclearstheoutputflagto0.
•ThenexttwoinstructionsinTablecheckthestatusof
theflagsandcauseaskipofthenextinstructionifthe
flagis1.
•Theinstructionthatisskippedwillnormallybea
branchinstructiontoreturnandchecktheflagagain.
Thebranchinstructionisnotskippediftheflagis0.
•Iftheflagis1,thebranchinstructionisskippedand
aninputoroutputinstructionisexecuted.Thelast
twoinstructionssetandclearaninterruptenableflip-
flopIEN.

ProgramInterrupt
•Theprocessofcommunicationjustdescribedis
referredtoasprogrammedcontroltransfer.
•Thecomputerkeepscheckingtheflagbit,and
whenitfindsitset,itinitiatesaninformation
transfer.
•Thedifferenceofinformationflowratebetween
thecomputerandthatoftheinput-output
devicemakesthistypeoftransferinefficient.
•Thecomputeriswastingtimewhilechecking
theflaginsteadofdoingsomeotheruseful
processingtask.
•Analternativetotheprogrammedcontrolled
procedureistolettheexternaldeviceinform
thecomputerwhenitisreadyforthetransfer.

•whenaflagisset,thecomputerismomentarily
interruptedfromproceedingwiththecurrent
programandisinformedofthefactthataflaghas
beenset.
•Thecomputerdeviatesmomentarilyfromwhatitis
doingtotakecareoftheinputoroutputtransfer.It
thenreturnstothecurrentprogramtocontinuewhat
itwasdoingbeforetheinterrupt.
•Theinterruptenableflip-flopIENcanbesetand
clearedwithtwoinstructions.
•WhenIENisclearedto0(withtheIOFinstruction),
theflagscannotinterruptthecomputer.
•WhenIENissetto1(withtheIONinstruction),the
computercanbeinterrupted.
•Thesetwoinstructionsprovidetheprogrammerwith
thecapabilityofmakingadecisionastowhetheror
nottousetheinterruptfacility.

•Aninterruptflip-flopRisincludedinthecomputer.
WhenR=0,thecomputergoesthroughan
instructioncycle.
•DuringtheexecutephaseoftheinstructioncycleIEN
ischeckedbythecontrol.
•Ifitis0,itindicatesthattheprogrammerdoesnot
wanttousetheinterrupt,socontrolcontinueswith
thenextinstructioncycle.
•IfIENis1,controlcheckstheflagbits.Ifbothflags
are0,itindicatesthatneithertheinputnorthe
outputregistersarereadyfortransferofinformation.
•Inthiscase,controlcontinueswiththenext
instructioncycle.Ifeitherflagissetto1whileIEN=1,
flip-flopRissetto1.
•Attheendoftheexecutephase,controlchecksthe
valueofR,andifitisequaltol,itgoestoaninterrupt
cycleinsteadofaninstructioncycle.

Demonstration of Interrupt cycle
Tags