版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年天津职业技术师范大学高职单招职业适应性测试备考题库及答案详细解析
- 2026年郑州黄河护理职业学院单招职业技能考试备考试题含详细答案解析
- 2026年黑龙江艺术职业学院高职单招职业适应性测试模拟试题及答案详细解析
- 2026年天津艺术职业学院单招职业技能考试备考试题含详细答案解析
- 2026年内蒙古交通职业技术学院单招综合素质笔试模拟试题含详细答案解析
- 2026年上海海洋大学高职单招职业适应性测试备考试题及答案详细解析
- 2026年忻州职业技术学院单招职业技能考试模拟试题含详细答案解析
- 2026年广东环境保护工程职业学院单招综合素质考试备考题库含详细答案解析
- 2026年无锡商业职业技术学院单招综合素质笔试备考题库含详细答案解析
- 2026年广西现代职业技术学院高职单招职业适应性测试备考题库及答案详细解析
- 2025年秋季散学典礼校长讲话:以四马精神赴新程携温暖期许启寒假
- 2026贵州省黔晟国有资产经营有限责任公司面向社会招聘中层管理人员2人备考考试试题及答案解析
- 2025年营养师考试练习题及答案
- 2026中国电信四川公用信息产业有限责任公司社会成熟人才招聘备考题库及答案详解一套
- 2026江苏省数据集团数字科技有限公司招聘考试备考题库及答案解析
- 2026年集团企业全员春节节前安全教育专项培训课件
- 消费者权益保护与投诉处理手册(标准版)
- 南京航空航天大学飞行器制造工程考试试题及答案
- 规范广告宣传误差真实性核查流程
- 注塑模具调试员聘用协议
- 2026年工程监理招聘面试常见问题集
评论
0/150
提交评论