




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
ComputerOrganization&ArchitectureChapter7
Input/OutputMotivationforInput/Output5ComponentsofAnyComputerMotivationforInput/OutputI/OishowhumansinteractwithcomputersI/Ogivescomputersacapabilityoflong-termmemory.I/Oletscomputersdoamazingthings:Readpressureofsynthetic
handand
controlsynthetic
armandhandoffiremanControlpropellers,fins,
communicateinBOB
(BreathableObservableBubble)ComputerwithoutI/OlikeacarwithoutwheelsMotivationforInput/OutputWidevarietyofperipheralsDeliveringdifferentamountsofdataAtdifferentspeedsAccordingtodifferenttimingsequenceIndifferentformatsAllslowerthanCPUandRAMPeripheralsdonotconnectdirectlytosystembusNeedI/OmodulesComputerMotivationforInput/OutputInput/OutputModuleInterfacetoCPUandMemoryInterfacetooneormoreperipheralsI/OmodulararchitectureisdesignedtoprovideasystematicmeansofcontrollinginteractionwithoutsideworldandprovidetheO.SwithinformationtomanageI/Oactivityeffectively7.1ExternalDevices
GenericModelofI/OModularHumanreadableScreen,printer,keyboardMachinereadableMonitoringandcontrolCommunicationModemNetworkInterfaceCard(NIC)I/ODeviceExamplesandSpeedsI/OSpeed:bytestransferredpersecond
(frommousetodisplay:1-to-million)
Device Behavior Partner DataRate
(KBytes/s)Keyboard Input Human 0.01Mouse Input Human 0.02Voiceoutput Output Human 5.00Floppydisk Storage Machine 50.00Laserprinter Output Human 100.00Magneticdisk Storage Machine 10,000.00Network-LAN IorO Machine 10,000.00Graphicsdisplay Output Human 30,000.00
ExternalDeviceBlockDiagramKeyboardandMonitorThemostcommonmeansofcomputer/useriskeyboardandmonitorKeyboardworkingprinciple(A/D)Akeyanelectronicsignalbitpattern(transducer)BitpatternI/OmodularProcessedandstoredasASCⅡincomputerMonitorworkingasoutput(D/A)OnthecontraryASCⅡASCⅡ:AmericanStandardCodeforInformationInterchangeAcharacterisrepresentedby7-bitbinarycode,total:128differentcharactersDEL:1111111=127A:1000001=65;a:1100001=971:0110001=49;OtherscanseeTable7.1ConverttoUppercasecisalowercaseletter;C=c-32;c&=0xdf;CExample
b:98=11000101100010&1101111101000010=66=BNote:nonreversibleDiskdriveContaintwotypesofelectronicsOnetypeforexchangingdata,controlandstatussignalswithanI/OmoduleTheotherforcontrollingthediskread/writemechanism7.2I/OModules
FunctionofI/OModuleControl&TimingCPU~I/OCommunicationDevice~I/OCommunicationMemory~I/OcommunicationDataBufferingErrorDetectionI/OStepsCPUchecksI/OmoduleanddevicestatusI/OmodulereturnsstatusIfready,CPUrequestsdatatransferI/OmodulegetsdatafromdeviceI/OmoduletransfersdatatoCPUProgrammed-I/OInterrupt-DrivenI/ODMA/ChannelI/OCommunicationCommanddecoding:
Readsector,Seektrack,ScanIDWhichblockscanbereadorwritten.DataexchangeExternaldataI/Omodulebufferthroughlocalbus
I/OmodulebufferCPU/memorythroughsystembus
StatusreportingBusy,ready,error,etcAddressrecognitionRecognizeeachperipheralDataBufferingAnimportantroleofI/OmodularAdaptperipheralstoCPUormainmemoryintheirvelocitiesCPU/DRAMI/ObufferI/ObufferperipheralsErrorDetectionAnI/OmodularisoftenresponsibleforerrordetectionandreportingerrorstoCPUOneclassoferrorsishardwarefailureMechanicalorelectricalE.g.:paperjam,baddisktrackAnotherclassoferrorsistransmittingerrorsBiterrorsDatalosses
I/OModuleStructureI/OModuleDecisionsSupportmultipleorsingledeviceHideorrevealdevicepropertiestoCPUControldevicefunctionsorleaveforCPUAlsoO/Sdecisionse.g.UnixtreatseverythingitcanasafileInputOutputModesProgrammedInterruptdrivenDirectMemoryAccess(DMA)I/OChannelI/Oprocessor7.3ProgrammedI/OWithprogrammedI/O,dataareexchangedbetweentheCPUandI/OmodularCPUhasdirectcontroloverI/OinaprogramSensingstatusRead/writecommandsTransferringdataCPUwaitsforI/OmoduletocompleteoperationwhenitissuesanI/OcommandWastesCPUtimeCPUencountersanI/OinstructionsItexecutesit,sendacommandtoI/Omodular,waitingfortheI/OmodularreadyI/OmodularperformsthecommandandthensettheappropriatebitintheI/OstatusregisterCPUperiodicallychecksthestatusbituntilitfindtheoperationcompletedI/OCommandsCPUissuesaddressIdentifiesmodule&device(if>1permodule)CPUissuescommands:4commandsControl-tellingmodulewhattodoe.g.rewind,opendiskdrive,etcTest-checkstatuse.g.power?Error?Read/WriteModuletransfersdataviabufferfrom/todeviceAddressingI/ODevicesUnderprogrammedI/Odatatransferisverylikememoryaccess(CPUviewpoint)EachdevicegivenuniqueidentifierCPUcommandscontainidentifier(address)I/OMappingMemorymappedI/ODevicesandmemoryshareanaddressspace0xxxxxx,1xxxxxxI/Olooksjustlikememoryread/writeNospecialcommandsforI/OLargeselectionofdevicesavailableIsolatedI/OSeparateaddressspacesNeedI/OormemoryselectlinesSpecialcommandsforI/OLimitedset
MemoryMappedandIsolatedI/OSummaryAdvantage:Simple:processoristotallyincontrolanddoesallDisadvantage:PollingoverheadcanconsumealotofCPUtimeSolution:useexceptionmechanismtohelpI/O.InterruptprogramwhenI/Oready,returnwhendonewithdatatransfer7.4InterruptDrivenI/OOvercomesCPUwaitingNorepeatedCPUcheckingofdeviceI/OmoduleinterruptswhenreadyInterruptDrivenI/OBasicOperationCPUissuesreadcommand,andthendootherthingsI/OmodulegetsdatafromperipheralwhilstCPUdoesotherworkI/OmoduleinterruptsCPUCPUrequestsdataI/OmoduletransfersdatathroughbusAtlast,CPUrecoverpreviousworkCPUViewpointIssuereadcommandDootherworkCheckforinterruptatendofeachinstructioncycleIfinterrupted:-Savecontext(registers)ProcessinterruptFetchdata&storeContinuepreviousworkI/OModuleViewpointReceiveaREADcommandfromCPUDetectthestateoftheperipheralReaddatafromtheperipheral,putitintoregistersSignalaninterrupttoCPUWaituntilitsdataarerequestedbyCPUPlacethedataonthedatabusReadingbasedoninterruptI/OSimpleinterruptprocessingChangesinMemoryandRegisters
foranInterruptDesignIssuesHowdoyouidentifythemoduleissuingtheinterrupt?Howdoyoudealwithmultipleinterrupts?i.e.aninterrupthandlerbeinginterruptedSolutionsMultipleinterruptlinesDifferentlineforeachmodule,LimitsnumberofdevicesSoftwarepollCPUaskseachmoduleinturnthroughinterrupt-servicesubroutineCommand+addressofI/OmoduleReadaddressablestatusregistercontainedineachI/OmoduleCPUbranchestothedeviceserviceroutineSlow(timeconsuming)
DaisychainorHardwarepollBus
AllI/OmodulesshareacommoninterruptrequestlineOnceCPUsensesaninterrupt,InterruptAcknowledgesentdownachainModuleresponsibleplacesvector(address,id)onbusCPUusesvectortopointtoanappropriatedevice-serviceroutineReferredtoasvectoredinterruptArbitration(vectored)ModulemustclaimthebusbeforeitcanraiseinterruptCPUdetectstheinterrupt,responditthroughinterruptacknowledgeline.I/Omoduleplacesvectoronthedatabuse.g.PCI&SCSIMultipleInterruptsProcessingWithmultiplelines,EachinterruptlinehasapriorityHigherprioritylinescaninterruptlowerprioritylinesWithsoftwarepolling,theorderinwhichmodulesarepolleddeterminestheirpriorityWithdaisy,theorderofmodulesonthedaisydeterminestheirpriorityExample—Intel82C59A82C59Aisachip,interruptcontroller,adaptivetoIntel80386CPU80386hasoneINTRpinandoneINTApinDevices82C59ACPUAsingle82C59Acanhandleupto8devices,formoredevices,cascadeisused(seefig.7.9,pp.214)82C59A’ssoleresponsibilityisthemanagementofinterrupt
Cascadeof82C59As
80x86INTR82C59AIRQ0IRQ1IRQ2IRQ3IRQ4IRQ5IRQ6IRQ782C59AIRQ0(8)IRQ1(9)IRQ2(10)IRQ3(11)IRQ4(12)IRQ5(13)IRQ6(14)IRQ7(15)(IRQ2)SequenceofEvents82C59Aacceptsinterruptsfromdevices82C59Adeterminesonewiththehighestpriority82C59Asignals80386(raisesINTRline)CPUAcknowledges(INTA)82C59AputscorrectvectorondatabusCPUprocessesinterrupt,communicatewithI/Omodule82C59Aisprogrammable:bysettingthecontrolwordinthe82C59A,CPUmaydeterminethedevices’priorityFullynestedTheinterruptrequestsareorderedinpriorityfromIR0toIR7,allchipsaresameasthisRotatingEqualpriority,roundrobinSpecialmaskInhibitinterruptsfromsomedevices82C55A--InterfaceProgrammableperipheralinterface,40pins(24I/Opins)GeneralI/Omoduleusedwith80386ControlregistercanbesetbyprogramThree-8bitI/Oports(A,C,B)C=>CA+CB,carryingcontrol&statussignalsCAmaybeusedinconjunctionwithportACBmaybeusedinconjunctionwithportB8bitdatalines,2bitaddresslines,etc.ThreemajormodesofoperationsMode0:three8-bitportsMode1:two12-bitportsMode2:astrobedbi-directionalbusconfiguration.7.5DirectMemoryAccessDrawbacksofprogrammedandinterrupt-drivenI/OProgrammedI/OneedstooccupyallCPUtimeInterruptdrivenI/OstillrequiresactiveCPUintervention,
thoughmoreefficientCPUusagethanProgrammedI/O(transferrateislower)Inbothmodes,datatransfermusttraverseCPUTransferrateislimitedCPUistiedupWhenlargevolumesofdataaretransferred,
DMAisamoreefficienttechniqueCh.7-7.5
WhatisDMAExternaltotheCPUAdditionalModule(hardware)onbusDMAcontrollertakesoverfromCPUforI/O
TransferblocksofdatatoorfrommemorywithoutCPUinterventionInfact,DMAisanI/OmodulealsoActasamaseronthebusMemorysystemactslikeslaveDMAgivesexternaldeviceabilitytowritememorydirectlyThreemodesofdatatransferbetweenCPUandDMA:Blocktransfermode
(Monopolisticmode)AnentireblockofdataistransferredinonecontiguoussequenceIfDMAtransfersdata,CPUbedisabledforaduration
untilDMAreleasebusUsefulforloadinganprogramsordatafilesintomemoryCyclestealingmodeDMAusesthebusonlywhenCPUdoesnotneeditorforcingCPUtosuspendoperationtemporarily
DMAtransferonebyteofdata,thenreleasebusDMAinterleavesinstructionsanddatatransfersTransparentmode(alternatemode)DMAandCPUusebusbydivisiontimemultiplexing
Requiremosttime,butmostefficientDMAStructureCounterBufferAddressregisterControl&statuslogicInterruptcontrollerDMAOperationPreprocessing:
CPUtellsDMAcontrollerRead/WriteDeviceaddressStartingaddressofmemoryblockfordataAmountofdatatobetransferredCPUcarriesonwithotherworkDatatransferring:
DMAcontrollerdealswithtransfer(wordbyword)Postprocessing:
DMAcontrollersendsinterruptwhenfinished
DMAtransferprocessThus,CPUisinvolvedonlyatthestartingandendofthetransferDMATransferCycleStealingDMAcontrollertakesoverbusforacycleTransferofonewordofdataNotaninterruptCPUdoesnotswitchcontextCPUsuspendedjustbeforeitaccessesbusi.e.beforeanoperandordatafetchoradatawriteSlowsdownCPUbutnotasmuchasCPUdoingtransferDMAandInterruptBreakpoints
DuringanInstructionCycleDMAConfigurationsSingleBus,detachedDMAcontrollerEachtransferusesbustwiceI/OtoDMAthenDMAtomemoryCPUissuspendedtwiceSingleBus,IntegratedDMAcontrollerControllermaysupport>1deviceEachtransferusesbusonceDMAtomemoryCPUissuspendedonceSeparateI/OBusBussupportsallDMAenableddevicesEachtransferusesbusonceDMAtomemoryCPUissuspendedonce7.6I/OChannelsI/OchannelisanI/OmodulewithitsownprocessorwhichcanexecuteI/OprogramI/OprogramislocatedinmainmemoryInfact,theI/OchannelrepresentsanextensionoftheDMAconceptThus,anI/OchannelhastheabilitytoexecuteI/OinstructionsandcontroltheI/OoperationsFunctionsofI/OChannelsReceivecommandfromCPUMicrocommandLoadI/Oprogramfrommemory,sendcommandstodeviceBuffer,controlandtransferdata,providepathfortransferringReportdevicestatusorinterruptWorkingPrincipleMasterCPUsendsI/OcommandandwaitschannelanddevicereadythenumberofChannelthenumberofdeviceEntryofchannelprogramSizeofdataMasterCPUstartsthechannelandreturnstomainprogramThechannelexecutesI/OprogramtotransferdatabetweenmemoryanddeviceWhendatatransfercompleted,interruptCPUTypesofI/OChannelsSelectorchannelAtanyonetime,onlyonedeviceisselectedtotransferdataHigh-speeddevicesMultiplexorchannelBytemultiplexorchannelRoundrobinbetweendevicesForadevice,onlyonebytedatatransferredForlowspeeddevicesBlockmultiplexorchannelRoundrobinbetweendevicesForadevice,KbytesdatatransferredEvolutionoftheI/OFunctionCPUdirectlycontrolaperipheralAcontrolorI/Omoduleisadded programmedI/OInterrupt-drivenI/ODMADevice--memoryI/OchannelI/Oprocessor,nolocalmemoryI/OprocessorI/Oprocessor+localmemory7.7ExternalInterfaceConnectingdevicestogetherPointtopointDedicatedlinebetweenI/OmoduleandexternaldevicesE.g.keyboard,printer,modem,etc.Pointtomulti-pointexternalbusesExternalmassstorageMultimediadevices(CD-ROMs,video,audio)SerialorparallelPrinter,mouse,keyboard,etc.Disk,tape,etc.WriteoperationfromI/OmoduletoaperipheralI/OmodulesendsacontrolsignalrequestingpermissiontosenddataTheperipheralacknowledgestherequestTheI/OmoduletransfersdataTheperipheralacknowledgesthereceiptofthedataSmallComputerSystemsInterface(SCSI)StandardinterfaceforCD-ROMdrive,audioequipment,externalmassstoragedevicesParallelinterface8,16,32bitdatalinesDaisychainedlocalbus,attachedtoPCIDevicesareindependentDevicescancommunicatewitheachotheraswellashostSCSIVersionsSCSI–1Early1980s,8bit,5MHz,Datarate5MBytes.s-1Sevendevices,daisychainedSCSI-21991,16and32bit,10MHz,Datarate20or40Mbytes.s-18devicesSCSI-3:1995,100MB/s,32devicessupportedSignals&PhasesEventsinSCSItypicallyexperiencefollowingphases:BusfreeArbitration-takecontrolofbusSelecttarget-adevice,CPU,memoryReselection-AllowsreconnectionaftersuspensionCommand-targetrequestingfrominitiatorDatarequestStatusrequestMessagerequest(bothways,e.g.disconnect,commandcomplete)SCSIPhasesAboutSCSIDevicesconnectedtoSCSI:Directaccessdevice,sequentaccessdevicePrinter,processorOpticdriverScanner,mediatransformingdevicesCommunicationdevices,etc.SCSIisastandardSpecificationandisverycomplicatedAllweknowaboveareenoughAboutFireWireHighperformanceserialbus,withasimpleconnector,upto63devicesonsingleportDaisychainortreestructureHotplugging,automaticconfigurationFastLowcost,easytoimplementAlsobeingusedindigitalcameras,VCRandTV
SimpleFireWireConfigurationFireWire3LayerProtocolsPhysicalTransmissionmedium,electricalandsignalingcharacteristicsDataratesfrom25to400MbpsArbitration:priorityLinkTransmissionofdatainpacketsTwotransmissiontypes:AsynchronousIsochronousTransactionRequest-responseprotocolInfiniBandI/OspecificationaimedathighendserversMergerofFutureI/O(Cisco,HP,Compaq,IBM)andNextGenerationI/O(Intel)Version1releasedearly2001Architectureandspec.fordataflowbetweenprocessorandintelligentI/OdevicesIntendedtor
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 義齒注冊(cè)檢驗(yàn)合同范例
- 出租房交物業(yè)費(fèi)合同范例
- 砂礫排水墊層施工方案
- 人工安全合同范例
- 出售養(yǎng)殖棚合同范例
- 仿真綠植布置合同范例
- 考慮水平隔板的單箱雙室波形鋼腹板組合箱梁的剪力滯效應(yīng)研究
- 信訪信息咨詢合同范例
- PEDOT-PSS基二元、三元熱電復(fù)合材料的制備與性能測(cè)試
- 基于粒子群算法的低碳冷鏈物流配送路徑優(yōu)化
- (二模)2025年寶雞市高考模擬檢測(cè)試題(二)物理試卷(含答案)
- 基地種植合作合同范本
- 露天煤礦安全生產(chǎn)技術(shù)露天煤礦安全管理培訓(xùn)
- 【2025年衛(wèi)生健康宣傳日】世界防治結(jié)核病日
- 新版《醫(yī)療器械經(jīng)營質(zhì)量管理規(guī)范》(2024)培訓(xùn)試題及答案
- 2025年人教版數(shù)學(xué)五年級(jí)下冊(cè)教學(xué)計(jì)劃(含進(jìn)度表)
- 《神奇糖果店》教學(xué)課件
- 部編人教版二年級(jí)道德與法治下冊(cè)同步練習(xí)(全冊(cè))
- h型鋼力學(xué)性能計(jì)算表
- 接觸網(wǎng)專業(yè)施工安全質(zhì)量重點(diǎn)及卡控表
- 音樂室使用記錄表
評(píng)論
0/150
提交評(píng)論