问题 单项选择题

下面关于在I/O设备与主机间交换数据的叙述,()是错误的。

A.中断方式下,CPU需要执行程序来实现数据传送任务

B.中断方式和DMA方式下,CPU与I/O设备都可同步工作

C.中断方式和DMA方式中,快速I/O设备更适合采用中断方式传递数据

D.若同时接到DMA请求和中断请求,CPU优先响应DMA请求

答案

参考答案:C

解析:

[分析] 本题考查I/O设备与主机间交换数据的方式和特点。

I/O设备与主机间进行数据输入输出主要有直接程序控制方式、中断方式、DMA方式和通道控制方式。

直接程序控制方式的主要特点是:CPU直接通过FO指令对I/0接口进行访问操作,主机与外设之间交换信息的每个步骤均在程序中表示出来,整个输入输出过程是由CPU执行程序来完成的。

中断方式的特点是:当FO接口准备好接收数据或向CPU传送数据时,就发出中断信号通知CPU。对中断信号进行确认后,CPU保存正在执行的程序的现场,转而执行提前设置好的I/O中断服务程序,完成一次数据传送的处理。这样,CPU就不需要主动查询外设的状态,在等待数据期间可以执行其他程序,从而提高了CPU的利用率。采用中断方式管理I/O设备,CPU和外设可以并行地工作。

虽然中断方式可以提高CPU的利用率,能处理随机事件和实时任务,但一次中断处理过程需要经历保存现场、中断处理和恢复现场等阶段,需要执行若干条指令才能处理一次中断事件,因此这种方式无法满足高速的批量数据传送要求。

直接内存存取(Direct Memory Access,DMA)方式的基本思想是:通过硬件控制实现主存与I/O设备间的直接数据传送,数据的传送过程由DMA控制器(DMAC)进行控制,不需要CPU的干预。在DMA方式下,需要CPU启动传送过程,即向设备发出“传送一块数据”的命令。在传送过程结束时,DMAC通过中断方式通知CPU进行一些后续处理工作。

DMA方式简化了CPU对数据传送的控制,提高了主机与外设并行工作的程度,实现了快速外设和主存之间成批的数据传送,使系统的效率明显提高。

通道是一种专用控制器,它通过执行通道程序进行I/O操作的管理,为主机与I/O设备提供一种数据传输通道。用通道指令编制的程序存放在存储器中,当需要进行I/O操作时,CPU只要按约定格式准备好命令和数据,然后启动通道即可;通道则执行相应的通道程序,完成所要求的操作。用通道程序也可完成较复杂的I/O管理和预处理,从而在很大程度上将主机从繁重的I/O管理工作中解脱出来,提高了系统的效率。

单项选择题
填空题

A Accommodation 住宿

One is never at a loss for a place to (1) in Malaysia.The country’s cities and major towns have a (2)  range of accommodation to suit all tastes and budgets. Most international (3)  hotels cater to total living requirements and as such, one (4) easily find restaurants, entertainment outlets and fitness centres within the (5)  complex.

Several resort hotels even have adjoining golf courses and (6)  parks with special privileges accorded to hotel guests. Family outings (7)  these hotels can be a practical yet fun-filled activity. Guests (8)  on longer stays may appreciate the serviced apartments situated within (9)  major cities.

Malaysia is also an excellent destination for romantic getaways, (10)  for honeymooners seeking an idyllic tropical retreat with (11) amenities. The country’s award-winning island resorts are paradises waiting to be (12)

For budget-conscious tourists, there is an array of accommodations located (13)  to amenities and tourist attractions. Budget accommodations in Malaysia are (14)  according to the Orchid Classification Scheme and include hostels, bed (15)  breakfast establishments, inns, boarding houses, rest houses and lodging houses (16)  Orchid rating is awarded to tourist accommodations offering basic facilities (17)  well as safe and clean premises.

Adventurous souls can try (18)  the innumerable value-for-money kampung-style chalets located along popular beaches. Nature (19)  seeking communion with nature in Malaysia’s world-famous nature parks such (20) Taman Negara will be amazed by the easy availability of chalets with modern facilities in these areas.

3.()