(8.4.7)--Ch_07-Input Output计算机组成原理.ppt
《(8.4.7)--Ch_07-Input Output计算机组成原理.ppt》由会员分享,可在线阅读,更多相关《(8.4.7)--Ch_07-Input Output计算机组成原理.ppt(67页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 计算机组成原理 -双语教学课件双语教学课件William Stallings Computer Organization and Architecture6th EditionChapter 7Input/OutputInput/Output ProblemsWide variety of peripheralsDelivering different amounts of dataAt different speedsIn different formatsAll slower than CPU and RAMNeed I/O modulesInput/Output ModuleInter
2、face to CPU and MemoryInterface to one or more peripheralsGeneric Model of I/O ModuleExternal DevicesHuman readableScreen,printer,keyboardMachine readableMonitoring and controlCommunicationModemNetwork Interface Card(NIC)External Device Block DiagramTypical I/O Data RatesI/O Module FunctionControl&T
3、imingCPU CommunicationDevice CommunicationData BufferingError DetectionI/O Steps e.g.Read from input moduleCPU checks I/O module device statusI/O module prepares status for CPU to fetchIf the status is ready,CPU requests data transferI/O module gets data from deviceCPU fetches data from I/O moduleVa
4、riations for output,I/O Module DiagramI/O Module DecisionsHide or reveal device properties to CPUSupport multiple or single deviceControl device functions or leave for CPUAlso O/S decisionse.g.Unix treats everything it can as a fileInput Output TechniquesProgrammedInterrupt drivenDirect Memory Acces
5、s(DMA)Programmed I/OCPU has direct control over I/OSensing statusRead/write commandsTransferring dataCPU waits for I/O module to complete operationWastes CPU timeProgrammed I/O-detailCPU requests I/O operationI/O module performs operationI/O module sets status bitsCPU checks status bits periodically
6、I/O module does not inform CPU directlyI/O module does not interrupt CPUCPU may wait or come back laterProgram I/O block of data PAGE 206 Issue read command to I/O moduleRead status of I/O moduleCheck status Read word from I/O moduleWrite word into memoryDone?Next instruction yesNo No readyreadyCPU-
7、I/OI/O-CPUError ConditionI/O-CPUCPU-MEMORYI/O CommandsCPU issues addressIdentifies module(&device if 1 per module)CPU issues commandControl-telling module what to doe.g.spin up diskTest-check statuse.g.power?Error?Read/WriteModule transfers data via buffer from/to deviceAddressing I/O DevicesUnder p
8、rogrammed I/O data transfer is very like memory access(CPU viewpoint)Each device given unique identifierCPU commands contain identifier(address)I/O MappingMemory mapped I/ODevices and memory share an address spaceI/O looks just like memory read/writeNo special commands for I/OLarge selection of memo
9、ry access commands availableIsolated I/OSeparate address spacesNeed I/O or memory select linesSpecial commands for I/OLimited set7.4 Interrupt Driven I/O PAGE 208Overcomes CPU waitingNo repeated CPU checking of deviceI/O module interrupts when readyTransfer of Control via Interrupts page61suspending
10、resumingbranchingprocessingInterrupt-driven I/O block of data PAGE 208 Issue read command to I/O moduleRead status of I/O moduleCheck status Read word from I/O moduleWrite word into memoryDone?Next instruction yesNo readyCPU-I/OI/O-CPUError ConditionI/O-CPUCPU-MEMORYDo something elseinterruptSimple
11、interrupt processing Hardware software ISRDevice controller or other system hardware issue an interruptProcessor finishes execution of current instruction Processor signals acknowledgment of interruptProcessor pushes PSW&PC onto control stackProcessor loads new PC value based on interrupt Save remai
12、nder of process state informationProcess interruptRestore process state information Restore old PSW&PCInterrupt Driven I/OBasic OperationCPU issues read commandI/O module gets data from peripheral whilst CPU does other workI/O module interrupts CPUCPU requests dataCPU fetches data from I/O module CP
13、U ViewpointIssue read commandDo other workCheck for interrupt at end of each instruction cycleIf interrupted:-Save context(registers)Process interruptFetch data&storeSee Operating Systems notesInterrupt processing(1)0.CPU does something else.1.The device issues an interrupt signal to CPU2.The CPU fi
14、nishes execution of the current instruction before responding to the interrupt3.The CPU tests for&makes sure of an interrupt,and sends an acknowledge signal to device(allows the device to remove its interrupt signal&to sends interrupt number to CPU)4.The CPU saves information of current program to s
15、tack for resuming it.The important information is PSW(running status of current program)&PC(the address of next instruction)Interrupt processing(2)5.The CPU loads PC with the entry location of ISR(Interrupt Service Routine)which responds to this interrupt.The CPU must determine the enter location(st
16、art address)of ISR by some method based on interrupt number.Above is completed by HARDWARE in the interrupt cycle.Following is completed by SOFTWARE(ISR)6.The CPU begins to execute the instructions of ISR.It saves the remainder(the context of some registers)of program-interrupted onto stack for resu
17、ming.(e.g.AC contains the sum of addition.)Interrupt processing(3)7.The CPU executes instructions of ISR to process interrupt:tests status of device,fetches data from the device,stores data to memory,.(or fetches data form memory,sends data to device).8.After service,the CPU prepares to resume the p
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 8.4.7-Ch_07-Input Output计算机组成原理 8.4 Ch_07 Input Output 计算机 组成 原理
限制150内