SlideShare a Scribd company logo
1
Chapter No. 07 – Input /
Output
Lecture – 11
2
Topics to Cover
 7.1 - External Devices
• Keyboard/Monitor
• Disk Drive
 7.2 - I/O Modules
• Module Function
• I/O Module Structure
 7.3 - Programmed I/O
• Overview of Programmed I/O
• I/O Commands
• I/O Instructions
 7.4 - Interrupt Driven I/O
• Interrupt Processing
• Design Issues
 7.5 - Direct Memory Access (DMA)
• Drawbacks of Programmed and
Interrupt-Driven I/O
• DMA Function
 Final Paper Pattern
3
Add Slide
• Image
4
Introduction
• In addition to the processor and a set of memory modules, the third
key element of a computer system is a set of I/O modules.
• Each I/O module interfaces to the system bus and controls one or
more peripherals (I/O devices).
• An I/O module not only wires a device into the system bus but also
contains logic for performing a communication function between the
peripheral and the bus.
• I/O function can be performed in cooperation with the processor and
memory called: ‘the internal I/O interface’, whereas the ‘external I/O
interface’ is between the I/O module and the outside world. (bridge)
5
Why an I/O Module is Required?
• The peripherals are not connected directly to the system bus, the
reasons are as follows:
1. There are a wide variety of peripherals with various methods of
operation. It would be impractical to incorporate the necessary logic
within the processor to control a range of devices. (bulky μpr)
2. The data transfer rate of the peripherals is often much slower than
that of the memory or processor. Thus, it is impractical to use the
high-speed system bus to communicate directly with the peripheral.
3. Peripherals often use different data formats and word lengths than
the computer to which they are attached.
6
Function of I/O Module
• An I/O module has two major
functions: (It provides data links
to I/O)
1. Interface to the processor and
memory via the system bus.
2. Interface to one or more
peripheral devices.
• Note: An external device
attaches to the computer by a
link to an I/O module. (I/O Devices)
The link is used to exchange control, status, and data between and I/O module and the ‘external device’. driver
7
7.1 External Devices
• I/O external devices provide a means of exchanging data between
the external environment and the computer.
• An external device connected to an I/O module is often referred to as
a peripheral device or simply a peripheral. (e.g. keyboard, monitor)
Classification of external devices: are three:
1. Human readable: Suitable for communicating with the computer
user e.g. screen, printer, keyboard.
2. Machine readable: Suitable for communication with equipment e.g.
magnetic disk (controlled by I/O module).
3. Communication: Suitable for communicating with remote devices
e.g. modem, network interface card (NIC).
8
An External Device
Transducer: An electrical device
that converts one form of signal
into another.
Buffer: is associated with the
Transducer to temporary hold
Data being transferred between
The I/O module and the external
Environment; a buffer size of 8 to
16 bits is common.
9
• The interface to the I/O module is in the form of control, data and
status signals.
1. Control signals: determine the function that the device will
perform, such as send data to the I/O module (Input or Read),
accept data from the I/O module (Output or Write), report status,
or perform some control function. (e.g. position a disk head).
2. Data: are in the form of a set of bits to be sent or received from the
I/O module.
3. Status signals: indicate the state of the device e.g.
ready/busy/offline/error. (for data transfer)
Interface b/w the Device and the I/O Module
Active and passive devices.
10
Keyboard/Monitor (Read)
• The most common means of computer/user interaction is a
keyboard / monitor arrangement.
• The user provides input through the keyboard.
• This input is then transmitted to the computer and may also be
displayed on the monitor.
• In addition, the monitor displays data provided by the computer.
• The basic unit of exchange is the character.
• Associated with each character is a code, typically 7 or 8 bits in length
• The most commonly used text code is the ASCII code.
11
Types of Characters (Read)
• Each character in this code is represented by a unique 7-bit binary
code; thus, 128 different characters can be represented.
• Characters are of two types: printable and control.
• Printable characters are the alphabetic, numeric, and special
characters that can be printed on paper or displayed on a screen.
• Some of the control characters have to do with controlling the
printing or displaying of characters; an example is carriage return
(back space).
12
Keyboard Input / Output (Read)
• For Keyboard input, when the user depresses a key, this generates an
electronic signal that is interpreted by the transducer in the keyboard
and translated into the bit pattern of the corresponding ASCII code.
• This bit pattern is then transmitted to the I/O module in the computer
• At the computer, the text can be stored in the same ASCII code.
• On Output, ASCII code characters are transmitted to an external
device from the I/O module.
• The transducer at the device interprets this code and sends the
required electronic signals to the output device either to display the
indicated character or perform the requested control function (print).
13
Disk Drive (Skip)
• A ‘disk drive’ contains electronics for exchanging data, control, and
status signals with an I/O module plus the electronics for controlling
the disk read/write mechanism.
• A ‘moving-head disk’ must be able to cause the disk arm to move
radially in and out across the disk’s surface.
• The ‘transducer’, converts between the magnetic patterns on the
moving disk surface and bits in the device’s buffer.
(Break)
14
7.2 I/O Modules
• I/O Module Function:
1. Control and timing.
2. Processor communication.
3. Device communication.
4. Data buffering.
5. Error detection.
15
1. Control and Timing
• During any period of time, the processor may communicate with one
or more external devices in unpredictable patterns, depending on the
program’s need for I/O.
• The internal resources, such as main memory and the system bus,
must be shared among a number of activities, including data I/O.
• The I/O function includes control and timing requirement, to
coordinate the flow of traffic between internal resources and external
devices.
16
2. Processor Communication
• The I/O module communicates with the processor in following ways:
• Command decoding: The I/O module accepts commands from the
processor, typically sent as signals on the control bus e.g. Read/Write.
• Data: Data are exchanged between the processor and the I/O module.
• Status reporting: Because peripherals are so slow, it is important to know
the status of the I/O module. Common status signals are Busy and Ready.
• E.g. if an I/O module is asked to send data to the processor (read), it may
not be ready to do so, because it is still working on the previous I/O
command. This fact can be reported with a ‘status signal’.
• Address recognition: Each I/O device has an address. Thus an I/O module
must recognize one unique address for each peripheral it controls.
17
Module Function (Continued)
3. Device communication: The I/O module must be able to perform
device communication. This communication involves commands,
status information, and data.
4. Data buffering: Data coming from main memory are sent to an I/O
module in a rapid burst. The data are buffered in the I/O module
and then sent to the peripheral device at its ‘data rate’.
• In the opposite direction, the data are buffered so as not to tie up the
memory in a slow transfer operation.
5. Error detection: Finally, an I/O module is responsible for error
detection and for subsequently reporting errors to the processor.
E.g. paper jam, bad disk track, parity error etc.
18
Steps for Transfer of Data from Device to CPU
• The control of the transfer of data from an external device to the
processor might involve the following sequence of steps:
1. The processor interrogates the I/O module to check the status of
the attached device.
2. The I/O module returns the device status.
3. If the device is operational and ready to transmit, the processor
requests the transfer of data, by means of a command to the I/O
module.
4. The I/O module obtains a unit of data (e.g. 8 or 16 bits) from the
external device.
5. The data are transferred from the I/O module to the processor.
19
I/O Module Structure (Description Next Slide)
• I/O modules vary considerably in complexity and the number of
external devices that they control.
(Device-1)
(Device-2)
(Port-1)
(Port-2)
20
I/O Module ‘Interfaces’ (Fig. Last Slide)
• The module connects to the rest of the computer through a set of ‘system-
bus’ lines.
• The data transferred to and from the module are buffered in one or more
‘data registers’.
• There may also be one or more ‘status’ registers that provide current status
information.
• The logic within the I/O module interacts with the processor via a set of
‘control’ lines. The CPU issues commands to I/O module via them.
• The module must be able to recognize and generate addresses associated
with the devices it controls.
• Finally, the I/O module contains logic specific to the interface with each
device it controls. (e.g. disk drive or printer)
21
I/O Module (Generic term)
• An I/O module functions to allow the processor to view a wide range
of devices in a simple-minded way.
• The I/O module may hide the details of timing, data formats, and the
electro-mechanics of an external device, so that the processor can
function in terms of simple Read and Write commands.
• An I/O module that is quite primitive and requires detailed control is
usually referred to as an I/O controller or device controller.
• ‘I/O controllers’ are commonly seen on microcomputers.
• However, we will use the generic term, I/O module.
22
I/O Commands (by CPU to I/O Module)
• To execute an I/O related instruction, the processor issues an address,
specifying the particular I/O module and external device, and an I/O
command.
• Types of I/O Commands: There are four types of I/O commands that an
I/O module may receive when it is addressed by a processor:
1) Control 2) Write 3) Read 4) Test
1. Control: command is used to activate a peripheral and tell it what to
do.
2. Write: causes the I/O module to take an item of data (byte or word)
from the data bus and then transmit the data item to the peripheral
23
Types of I/O Commands (Continued)
3. Read: causes the I/O module to obtain an item of data from the
peripheral and place it in an internal buffer (data register).
• The processor can then obtain the data item by requesting that the
I/O module place it on the ‘data bus’.
4. Test: command is used to test various status conditions associated
with an I/O module and its peripherals.
• E.g. if the device is powered ON and Available for use.
• Processor will also want to know if the most recent I/O operation is
complete and if any errors occurred.
24
1. Memory-Mapped I/O
• When the processor, main memory and I/O share a
common bus, two modes of addressing are possible:
1) Memory mapped I/O 2) Isolated I/O
1. With memory-mapped I/O, there is a single address space for
memory locations and I/O device addresses.
• The processor treats the status and data register of I/O modules as
memory locations and uses the same machine instruction to access
both memory and I/O devices. I/O data transfer is very like memory access.(CPU viewpoint)
• So, for example, with 10 address lines, a combined total of 210
= 1024
memory locations and I/O addresses can be supported.
Modes of Addressing I/O
25
2. Isolated I/O
• With memory-mapped I/O, a single read line
and a single write line are needed on the bus.
2. Isolated I/O: The address space for I/O is isolated from that from
memory. (both memory and I/O use separate addressing space)
• The full range of addressing is available for both.
• Now, the command line specifies whether the address refers to a
memory location or an I/O device.
• Again with 10 address lines, the system may now support both 1024
memory locations and 1024 I/O addresses.
26
Advantages & Disadvantages (Memory-mapped I/O)
• With Isolated I/O, the I/O ports are accessible only by special I/O
commands (less), which activate the I/O command lines on the bus.
• For most processor types, there is a relatively large set of different
instructions (more) for referencing memory.
• If Isolated I/O is used, there are only a few I/O instructions. (Dis-Adv)
• Thus an advantage of memory-mapped I/O is that, this large number
of instructions can be used, allowing more efficient programming.
• A disadvantage of memory-mapped I/O is that a valuable memory
address space is used up by I/O.
• Intel prefers isolated-I/O over memory-mapped I/O.
(Break)
27
Input / Output Techniques
• The three techniques for
input of a block of data
are: (figure)
1) Programmed I/O
2) Interrupt-Driven I/O
3) Direct memory Access
(DMA)
Figure 7.4
Three techniques
For Input of a
Block of Data
28
7.3 Programmed I/O (First Technique)
• With programmed I/O, the processor executes a program that gives it
direct control of the I/O operation, including sensing device status,
sending a read or write command, and transferring the data.
• When the processor issues a command to the I/O module, it must
wait until the I/O operation is complete.
• If the processor is faster than the I/O module, (and it usually is) then
this is wasteful of processor time. (Disadvantage)
29
Overview of Programmed I/O
• When the processor is executing a program and encounters an instruction
relating to I/O, it executes that instruction by issuing a command to the
appropriate I/O module.
• With programmed I/O, the I/O module will perform the requested action and
then set the appropriate bits in the ‘I/O status register’.
• The I/O module takes no further action to alert the processor.
• In particular, it does not interrupt the processor. (to tell work is done)
• Thus, it is the responsibility of the processor to periodically check the status
of the I/O module until it finds that the operation is complete.
• This is the main disadvantage of programmed I/O, as a result the level of
performance of the system is severely degraded.
CPU waits for I/O module to complete operation, this Wastes CPU time. CPU is tied with I/O. (Disadvantage)
30
Flowchart of Programmed I/O
• Figure gives an example of the use of programmed
I/O to read in a block of data from the peripheral
device into memory.
• Data are read in one word (e.g. 16 bits) at a time.
• For each word that is read in, the processor must
remain in a status-checking cycle until it
determines that the word is available in the I/O
module’s ‘data register’.
• The main disadvantage of programmed I/O
technique is that I/O is a time-consuming process
that keeps the processor busy needlessly.
31
I/O Instructions (Executed by the CPU)
• With programmed I/O, there is a close correspondence between the
I/O related instructions that the processor fetches from memory and
the I/O commands that the processor issues to an I/O module to
execute the instructions.
• That is, the program instructions are easily mapped into I/O
commands, and there is often a simple one-to-one relationship.
• Typically, there will be many I/O devices connected through I/O
modules to the system bus.
• Each device is given a unique identifier or address.
• When the processor issues an I/O command, the command contains
the address of the desired device.
• Thus, each I/O module must interpret the address lines to determine
if the command is for itself.
32
7.4 Interrupt-Driven I/O (Second Technique)
• The problem with programmed I/O, the processor has to wait, and
must repeatedly interrogate the status of the I/O module if it is ready
for either reception or transmission of data. (A big Disadvantage)
• As a result, the level of performance of system is severely degraded.
• With interrupt-driven I/O, the processor issues an ‘I/O command’,
continues to execute other instructions, and is interrupted by the I/O
module when it has completed its work. (and is ready to be serviced)
• With both programmed and interrupt I/O, the processor is
responsible for extracting data from main memory for output and
storing data in main memory for input.
• Interrupt I/O is better than programmed I/O, CPU does not wait.(Adv)
33
How Interrupt-Driven I/O Works
• From the point of view of the ‘I/O module’
1. For input, the I/O module receives a read command from the
processor.
2. The I/O module then proceeds to read data in from required
peripheral.
3. Once the data are in the module’s ‘data register’, the module signals
an interrupt to the processor over a control line. (saying I’m ready)
4. The module then waits until its data are requested by the processor.
5. When the CPU requests, the module places data on the ‘data bus’.
34
How Interrupt-Driven I/O Works
• From the point of view of the ‘processor’
1. For input, the processor issues a READ command.
2. It then goes off and does something else. (e.g. program execution)
3. At the end of each instruction cycle, the processor checks for interrupts.
4. When the interrupt from the I/O module occurs, the processor saves
the context of the current program and processes the interrupt. (e.g.
saving program counter and processor register)
5. The processor reads the word of data from the I/O module and stores it
in memory.
6. The processor then restores the context of the program it was working
on and resumes execution.
35
Interrupt-Driven I/O (Flowchart)
36
Interrupt Processing
• The occurrence of an
interrupt triggers a number
of events, both in the
processor hardware and in
software.
• Figure shows a typical
sequence.
(ISR)
37
Programmed I/O & Interrupt Driven I/O
• Drawbacks of Programmed and Interrupt-driven I/O
1. The I/O transfer rate is limited by the speed with which the
processor can test and service a device.
2. The processor is tied up in managing an I/O transfer; a number of
instructions must be executed for each I/O transfer.
• Advantages of Programmed and Interrupt-driven I/O
• Using these I/O techniques, the processor is dedicated to the task of
I/O and can move data at a rather higher rate. (manages resources)
38
7.5 Direct Memory Access (DMA), 3rd
Technique
(DMA Function)
• In Direct memory access (DMA), the I/O
module and main-memory exchange data
directly, without processor involvement.
• DMA is an additional module on the system bus.
• The DMA module must force the processor to
suspend operation temporarily to gain control
over the system bus, which is needed for a data
transfer, directly between the I/O module and
main memory.
• This technique is called cycle stealing, because
the DMA module in effect steals a bus cycle.
39
DMA Read or Write Operation
• When the processor wishes to read or write a block of data, it issues a
command to the DMA module, by sending the DMA module the
following information:
Whether a read or write is requested, using a read/write control line.
The address of the I/O device involved.
The starting location in memory to read from or write to.
The number of words to be read or written.
40
DMA Read or Write Operation
1. After issuing a Read command to the DMA, the
processor then continues with other work.
2. The DMA module transfers the entire block of data, one word at a
time, directly to or from memory, without going through the
processor.
3. When the transfer is complete, the DMA module sends an interrupt
signal to the processor. (telling work done)
• Thus, the processor is involved only at the beginning and end of the
transfer.
41
Review Questions (Chapter 07)
(Slide-7)
(Slide-14, 15, 17 & 18)
(Slide-27,28, 32 & 38)
(Slide-24 & 25)
(Slide-40)
(Slide-37)
(Slide-31, Red)
7.8 How ‘Interrupt Driven I/O’ works from the point of view of ‘I/O Module’? (Slide-33)
42
Final Paper Pattern
• Total Marks = 50
• Short Questions (Preparatory Questions) = [3*10 = 30 Marks]
• Long Questions (Preparatory Questions) = [5*2 = 10 Marks]
• Numerical Problems (Examples + Problems) = [5*2 = 10 Marks]
• Chapters Included in Final-Term Course: Ch-4,Ch-7
• Chapter – 4: 40% Marks
• Chapter – 7: 30% Marks
• Chapter – 3: 20%, Chapter – 5: 10%
43
Interrupt-Driven I/O (Design Issues)
• Two design issues arise in implementing interrupt I/O.
• First, because there are multiple I/O modules, how does the
processor determine which device issued the interrupt?
• Second, if multiple interrupts have occurred, how does the processor
decide which one to process?
• Four techniques serve to identify the I/O module & assign priorities:
1) Multiple interrupt lines 2) Software poll
3) Daisy chain (hardware poll, vectored)
4) Bus arbitration (vectored)
44
1. Multiple interrupt lines between the processor and the I/O modules,
serve to identify the requesting I/O module. (Impractical)
2. Software poll: When the processor detects an interrupt, it branches to
an interrupt-service routine whose job is to poll each I/O module to
determine which module caused the interrupt.
3. Daisy chain: provides a ‘hardware poll’. When the processor senses an
interrupt, it sends out an ‘interrupt acknowledge’. This signal propagates
through a series of I/O modules until it gets to a requesting module.
• The requesting module places a word called vector, the processor uses the
vector as a pointer to the appropriate device-service routine.
4. Bus arbitration: an I/O module must first gain control of the bus before
it can raise the ‘interrupt request line’. Thus only one module can raise
the line at a time.
Ad

More Related Content

Similar to Lecture 10 - Ch No. 7 Input and Output.pptx (20)

comporgppt.pptx
comporgppt.pptxcomporgppt.pptx
comporgppt.pptx
FaisalAijaz1
 
Unit4_IO_13623_AnilRawat.ppt
Unit4_IO_13623_AnilRawat.pptUnit4_IO_13623_AnilRawat.ppt
Unit4_IO_13623_AnilRawat.ppt
prateeksingh235912
 
MODULE 5-1.computer organization and archit
MODULE 5-1.computer organization and architMODULE 5-1.computer organization and archit
MODULE 5-1.computer organization and archit
Sindhu Mani
 
Lecture 9.pptx
Lecture 9.pptxLecture 9.pptx
Lecture 9.pptx
JavedIqbal549896
 
Hardware I/O organization
Hardware  I/O organization Hardware  I/O organization
Hardware I/O organization
faria_khan
 
Input Output - Computer Architecture
Input Output - Computer ArchitectureInput Output - Computer Architecture
Input Output - Computer Architecture
Maruf Abdullah (Rion)
 
Input-Output Modules
Input-Output ModulesInput-Output Modules
Input-Output Modules
Mukesh Tekwani
 
Input_Output_Organization.pptx
Input_Output_Organization.pptxInput_Output_Organization.pptx
Input_Output_Organization.pptx
SherinRappai
 
Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
Nehal Naik
 
IOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfIOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdf
aptinstallpython3
 
COMPUTER ORGANIZATION-Input-Output Organization
COMPUTER ORGANIZATION-Input-Output OrganizationCOMPUTER ORGANIZATION-Input-Output Organization
COMPUTER ORGANIZATION-Input-Output Organization
KAVITHA N S
 
chapter 4 Device Management systemss.ppt
chapter 4 Device Management systemss.pptchapter 4 Device Management systemss.ppt
chapter 4 Device Management systemss.ppt
danielarega25
 
input output ports
input output portsinput output ports
input output ports
aslamslides
 
i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...
i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...
i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...
ggg032019
 
Embedded Systems and Arduino Architecture
Embedded Systems and Arduino ArchitectureEmbedded Systems and Arduino Architecture
Embedded Systems and Arduino Architecture
ATHIRAMENONMS
 
Embedded Systems and Arduino Architecture
Embedded Systems and Arduino ArchitectureEmbedded Systems and Arduino Architecture
Embedded Systems and Arduino Architecture
ATHIRAMENONMS
 
I/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxI/o management and disk scheduling .pptx
I/o management and disk scheduling .pptx
webip34973
 
I/O Management
I/O ManagementI/O Management
I/O Management
Keyur Vadodariya
 
DAY- 1.pptx,.............................
DAY- 1.pptx,.............................DAY- 1.pptx,.............................
DAY- 1.pptx,.............................
PraveenKumarEnduri
 
Dcs write up
Dcs write upDcs write up
Dcs write up
Arthur Marshall
 
MODULE 5-1.computer organization and archit
MODULE 5-1.computer organization and architMODULE 5-1.computer organization and archit
MODULE 5-1.computer organization and archit
Sindhu Mani
 
Hardware I/O organization
Hardware  I/O organization Hardware  I/O organization
Hardware I/O organization
faria_khan
 
Input Output - Computer Architecture
Input Output - Computer ArchitectureInput Output - Computer Architecture
Input Output - Computer Architecture
Maruf Abdullah (Rion)
 
Input_Output_Organization.pptx
Input_Output_Organization.pptxInput_Output_Organization.pptx
Input_Output_Organization.pptx
SherinRappai
 
Io techniques & its types
Io techniques & its typesIo techniques & its types
Io techniques & its types
Nehal Naik
 
IOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdfIOhardware_operting_systems_2022_libya.pdf
IOhardware_operting_systems_2022_libya.pdf
aptinstallpython3
 
COMPUTER ORGANIZATION-Input-Output Organization
COMPUTER ORGANIZATION-Input-Output OrganizationCOMPUTER ORGANIZATION-Input-Output Organization
COMPUTER ORGANIZATION-Input-Output Organization
KAVITHA N S
 
chapter 4 Device Management systemss.ppt
chapter 4 Device Management systemss.pptchapter 4 Device Management systemss.ppt
chapter 4 Device Management systemss.ppt
danielarega25
 
input output ports
input output portsinput output ports
input output ports
aslamslides
 
i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...
i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...
i_o updated.pptx 6=₹cnjxifj,lsbd ধ and vjcjcdbgjfu n smn u cut the lb, it ও o...
ggg032019
 
Embedded Systems and Arduino Architecture
Embedded Systems and Arduino ArchitectureEmbedded Systems and Arduino Architecture
Embedded Systems and Arduino Architecture
ATHIRAMENONMS
 
Embedded Systems and Arduino Architecture
Embedded Systems and Arduino ArchitectureEmbedded Systems and Arduino Architecture
Embedded Systems and Arduino Architecture
ATHIRAMENONMS
 
I/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxI/o management and disk scheduling .pptx
I/o management and disk scheduling .pptx
webip34973
 
DAY- 1.pptx,.............................
DAY- 1.pptx,.............................DAY- 1.pptx,.............................
DAY- 1.pptx,.............................
PraveenKumarEnduri
 

More from AdeelAsghar36 (19)

Week 3 intro to computer organization and assembly language
Week 3 intro to computer organization and assembly languageWeek 3 intro to computer organization and assembly language
Week 3 intro to computer organization and assembly language
AdeelAsghar36
 
Week 3 intro to computer organization and assembly language
Week 3 intro to computer organization and assembly languageWeek 3 intro to computer organization and assembly language
Week 3 intro to computer organization and assembly language
AdeelAsghar36
 
Week 2 intro to computer organization and assembly language
Week 2 intro to computer organization and assembly languageWeek 2 intro to computer organization and assembly language
Week 2 intro to computer organization and assembly language
AdeelAsghar36
 
Week 1 intro to computer organization and assembly language
Week 1 intro to computer organization and assembly languageWeek 1 intro to computer organization and assembly language
Week 1 intro to computer organization and assembly language
AdeelAsghar36
 
CC-5 - MOD.pptx Cloud Vertulization nand
CC-5 - MOD.pptx Cloud Vertulization nandCC-5 - MOD.pptx Cloud Vertulization nand
CC-5 - MOD.pptx Cloud Vertulization nand
AdeelAsghar36
 
CC-11 Part b Software as a Service Cloud Architecxture
CC-11 Part b Software as a Service Cloud ArchitecxtureCC-11 Part b Software as a Service Cloud Architecxture
CC-11 Part b Software as a Service Cloud Architecxture
AdeelAsghar36
 
CC-11 Part a Software as a Service Cloud Architecxture
CC-11 Part a Software as a Service Cloud ArchitecxtureCC-11 Part a Software as a Service Cloud Architecxture
CC-11 Part a Software as a Service Cloud Architecxture
AdeelAsghar36
 
CC-9b AWS Infra as a service part 3 (AWS).pptx
CC-9b AWS Infra as a service part 3 (AWS).pptxCC-9b AWS Infra as a service part 3 (AWS).pptx
CC-9b AWS Infra as a service part 3 (AWS).pptx
AdeelAsghar36
 
CC-8-9 Infrastructure as a service slide part b
CC-8-9 Infrastructure as a service slide part bCC-8-9 Infrastructure as a service slide part b
CC-8-9 Infrastructure as a service slide part b
AdeelAsghar36
 
GNCC-9 cloud architecture (infrastructure as a Service).pptx
GNCC-9 cloud architecture (infrastructure as a Service).pptxGNCC-9 cloud architecture (infrastructure as a Service).pptx
GNCC-9 cloud architecture (infrastructure as a Service).pptx
AdeelAsghar36
 
Lecture 10b - Ch No. 04 (Part 02) (1).pptx
Lecture 10b - Ch No. 04 (Part 02) (1).pptxLecture 10b - Ch No. 04 (Part 02) (1).pptx
Lecture 10b - Ch No. 04 (Part 02) (1).pptx
AdeelAsghar36
 
Lecture 09 - Ch No. 05 Internal Memory.pptx
Lecture 09 - Ch No. 05 Internal Memory.pptxLecture 09 - Ch No. 05 Internal Memory.pptx
Lecture 09 - Ch No. 05 Internal Memory.pptx
AdeelAsghar36
 
Introduction to computer_Lecture 1 of IICT course
Introduction to computer_Lecture 1 of IICT courseIntroduction to computer_Lecture 1 of IICT course
Introduction to computer_Lecture 1 of IICT course
AdeelAsghar36
 
Chapter 3 part 2 Interconnections Computer organization
Chapter 3 part 2 Interconnections Computer organizationChapter 3 part 2 Interconnections Computer organization
Chapter 3 part 2 Interconnections Computer organization
AdeelAsghar36
 
COAL LAB 2 data addressing modes and register
COAL LAB 2 data addressing modes and registerCOAL LAB 2 data addressing modes and register
COAL LAB 2 data addressing modes and register
AdeelAsghar36
 
Soft Sand Minimalist Modern Thesis Defense Presentation.pdf
Soft Sand Minimalist Modern Thesis Defense Presentation.pdfSoft Sand Minimalist Modern Thesis Defense Presentation.pdf
Soft Sand Minimalist Modern Thesis Defense Presentation.pdf
AdeelAsghar36
 
Simplified AES from information security
Simplified AES from information securitySimplified AES from information security
Simplified AES from information security
AdeelAsghar36
 
Hash Functions from Information Security
Hash Functions from Information SecurityHash Functions from Information Security
Hash Functions from Information Security
AdeelAsghar36
 
lect 03- MIT Addressing Modes.pdf
lect 03- MIT Addressing Modes.pdflect 03- MIT Addressing Modes.pdf
lect 03- MIT Addressing Modes.pdf
AdeelAsghar36
 
Week 3 intro to computer organization and assembly language
Week 3 intro to computer organization and assembly languageWeek 3 intro to computer organization and assembly language
Week 3 intro to computer organization and assembly language
AdeelAsghar36
 
Week 3 intro to computer organization and assembly language
Week 3 intro to computer organization and assembly languageWeek 3 intro to computer organization and assembly language
Week 3 intro to computer organization and assembly language
AdeelAsghar36
 
Week 2 intro to computer organization and assembly language
Week 2 intro to computer organization and assembly languageWeek 2 intro to computer organization and assembly language
Week 2 intro to computer organization and assembly language
AdeelAsghar36
 
Week 1 intro to computer organization and assembly language
Week 1 intro to computer organization and assembly languageWeek 1 intro to computer organization and assembly language
Week 1 intro to computer organization and assembly language
AdeelAsghar36
 
CC-5 - MOD.pptx Cloud Vertulization nand
CC-5 - MOD.pptx Cloud Vertulization nandCC-5 - MOD.pptx Cloud Vertulization nand
CC-5 - MOD.pptx Cloud Vertulization nand
AdeelAsghar36
 
CC-11 Part b Software as a Service Cloud Architecxture
CC-11 Part b Software as a Service Cloud ArchitecxtureCC-11 Part b Software as a Service Cloud Architecxture
CC-11 Part b Software as a Service Cloud Architecxture
AdeelAsghar36
 
CC-11 Part a Software as a Service Cloud Architecxture
CC-11 Part a Software as a Service Cloud ArchitecxtureCC-11 Part a Software as a Service Cloud Architecxture
CC-11 Part a Software as a Service Cloud Architecxture
AdeelAsghar36
 
CC-9b AWS Infra as a service part 3 (AWS).pptx
CC-9b AWS Infra as a service part 3 (AWS).pptxCC-9b AWS Infra as a service part 3 (AWS).pptx
CC-9b AWS Infra as a service part 3 (AWS).pptx
AdeelAsghar36
 
CC-8-9 Infrastructure as a service slide part b
CC-8-9 Infrastructure as a service slide part bCC-8-9 Infrastructure as a service slide part b
CC-8-9 Infrastructure as a service slide part b
AdeelAsghar36
 
GNCC-9 cloud architecture (infrastructure as a Service).pptx
GNCC-9 cloud architecture (infrastructure as a Service).pptxGNCC-9 cloud architecture (infrastructure as a Service).pptx
GNCC-9 cloud architecture (infrastructure as a Service).pptx
AdeelAsghar36
 
Lecture 10b - Ch No. 04 (Part 02) (1).pptx
Lecture 10b - Ch No. 04 (Part 02) (1).pptxLecture 10b - Ch No. 04 (Part 02) (1).pptx
Lecture 10b - Ch No. 04 (Part 02) (1).pptx
AdeelAsghar36
 
Lecture 09 - Ch No. 05 Internal Memory.pptx
Lecture 09 - Ch No. 05 Internal Memory.pptxLecture 09 - Ch No. 05 Internal Memory.pptx
Lecture 09 - Ch No. 05 Internal Memory.pptx
AdeelAsghar36
 
Introduction to computer_Lecture 1 of IICT course
Introduction to computer_Lecture 1 of IICT courseIntroduction to computer_Lecture 1 of IICT course
Introduction to computer_Lecture 1 of IICT course
AdeelAsghar36
 
Chapter 3 part 2 Interconnections Computer organization
Chapter 3 part 2 Interconnections Computer organizationChapter 3 part 2 Interconnections Computer organization
Chapter 3 part 2 Interconnections Computer organization
AdeelAsghar36
 
COAL LAB 2 data addressing modes and register
COAL LAB 2 data addressing modes and registerCOAL LAB 2 data addressing modes and register
COAL LAB 2 data addressing modes and register
AdeelAsghar36
 
Soft Sand Minimalist Modern Thesis Defense Presentation.pdf
Soft Sand Minimalist Modern Thesis Defense Presentation.pdfSoft Sand Minimalist Modern Thesis Defense Presentation.pdf
Soft Sand Minimalist Modern Thesis Defense Presentation.pdf
AdeelAsghar36
 
Simplified AES from information security
Simplified AES from information securitySimplified AES from information security
Simplified AES from information security
AdeelAsghar36
 
Hash Functions from Information Security
Hash Functions from Information SecurityHash Functions from Information Security
Hash Functions from Information Security
AdeelAsghar36
 
lect 03- MIT Addressing Modes.pdf
lect 03- MIT Addressing Modes.pdflect 03- MIT Addressing Modes.pdf
lect 03- MIT Addressing Modes.pdf
AdeelAsghar36
 
Ad

Recently uploaded (20)

Rock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian HistoryRock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian History
Virag Sontakke
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
Origin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theoriesOrigin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theories
PrachiSontakke5
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
Rock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian HistoryRock Art As a Source of Ancient Indian History
Rock Art As a Source of Ancient Indian History
Virag Sontakke
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
Origin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theoriesOrigin of Brahmi script: A breaking down of various theories
Origin of Brahmi script: A breaking down of various theories
PrachiSontakke5
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
Ad

Lecture 10 - Ch No. 7 Input and Output.pptx

  • 1. 1 Chapter No. 07 – Input / Output Lecture – 11
  • 2. 2 Topics to Cover  7.1 - External Devices • Keyboard/Monitor • Disk Drive  7.2 - I/O Modules • Module Function • I/O Module Structure  7.3 - Programmed I/O • Overview of Programmed I/O • I/O Commands • I/O Instructions  7.4 - Interrupt Driven I/O • Interrupt Processing • Design Issues  7.5 - Direct Memory Access (DMA) • Drawbacks of Programmed and Interrupt-Driven I/O • DMA Function  Final Paper Pattern
  • 4. 4 Introduction • In addition to the processor and a set of memory modules, the third key element of a computer system is a set of I/O modules. • Each I/O module interfaces to the system bus and controls one or more peripherals (I/O devices). • An I/O module not only wires a device into the system bus but also contains logic for performing a communication function between the peripheral and the bus. • I/O function can be performed in cooperation with the processor and memory called: ‘the internal I/O interface’, whereas the ‘external I/O interface’ is between the I/O module and the outside world. (bridge)
  • 5. 5 Why an I/O Module is Required? • The peripherals are not connected directly to the system bus, the reasons are as follows: 1. There are a wide variety of peripherals with various methods of operation. It would be impractical to incorporate the necessary logic within the processor to control a range of devices. (bulky μpr) 2. The data transfer rate of the peripherals is often much slower than that of the memory or processor. Thus, it is impractical to use the high-speed system bus to communicate directly with the peripheral. 3. Peripherals often use different data formats and word lengths than the computer to which they are attached.
  • 6. 6 Function of I/O Module • An I/O module has two major functions: (It provides data links to I/O) 1. Interface to the processor and memory via the system bus. 2. Interface to one or more peripheral devices. • Note: An external device attaches to the computer by a link to an I/O module. (I/O Devices) The link is used to exchange control, status, and data between and I/O module and the ‘external device’. driver
  • 7. 7 7.1 External Devices • I/O external devices provide a means of exchanging data between the external environment and the computer. • An external device connected to an I/O module is often referred to as a peripheral device or simply a peripheral. (e.g. keyboard, monitor) Classification of external devices: are three: 1. Human readable: Suitable for communicating with the computer user e.g. screen, printer, keyboard. 2. Machine readable: Suitable for communication with equipment e.g. magnetic disk (controlled by I/O module). 3. Communication: Suitable for communicating with remote devices e.g. modem, network interface card (NIC).
  • 8. 8 An External Device Transducer: An electrical device that converts one form of signal into another. Buffer: is associated with the Transducer to temporary hold Data being transferred between The I/O module and the external Environment; a buffer size of 8 to 16 bits is common.
  • 9. 9 • The interface to the I/O module is in the form of control, data and status signals. 1. Control signals: determine the function that the device will perform, such as send data to the I/O module (Input or Read), accept data from the I/O module (Output or Write), report status, or perform some control function. (e.g. position a disk head). 2. Data: are in the form of a set of bits to be sent or received from the I/O module. 3. Status signals: indicate the state of the device e.g. ready/busy/offline/error. (for data transfer) Interface b/w the Device and the I/O Module Active and passive devices.
  • 10. 10 Keyboard/Monitor (Read) • The most common means of computer/user interaction is a keyboard / monitor arrangement. • The user provides input through the keyboard. • This input is then transmitted to the computer and may also be displayed on the monitor. • In addition, the monitor displays data provided by the computer. • The basic unit of exchange is the character. • Associated with each character is a code, typically 7 or 8 bits in length • The most commonly used text code is the ASCII code.
  • 11. 11 Types of Characters (Read) • Each character in this code is represented by a unique 7-bit binary code; thus, 128 different characters can be represented. • Characters are of two types: printable and control. • Printable characters are the alphabetic, numeric, and special characters that can be printed on paper or displayed on a screen. • Some of the control characters have to do with controlling the printing or displaying of characters; an example is carriage return (back space).
  • 12. 12 Keyboard Input / Output (Read) • For Keyboard input, when the user depresses a key, this generates an electronic signal that is interpreted by the transducer in the keyboard and translated into the bit pattern of the corresponding ASCII code. • This bit pattern is then transmitted to the I/O module in the computer • At the computer, the text can be stored in the same ASCII code. • On Output, ASCII code characters are transmitted to an external device from the I/O module. • The transducer at the device interprets this code and sends the required electronic signals to the output device either to display the indicated character or perform the requested control function (print).
  • 13. 13 Disk Drive (Skip) • A ‘disk drive’ contains electronics for exchanging data, control, and status signals with an I/O module plus the electronics for controlling the disk read/write mechanism. • A ‘moving-head disk’ must be able to cause the disk arm to move radially in and out across the disk’s surface. • The ‘transducer’, converts between the magnetic patterns on the moving disk surface and bits in the device’s buffer. (Break)
  • 14. 14 7.2 I/O Modules • I/O Module Function: 1. Control and timing. 2. Processor communication. 3. Device communication. 4. Data buffering. 5. Error detection.
  • 15. 15 1. Control and Timing • During any period of time, the processor may communicate with one or more external devices in unpredictable patterns, depending on the program’s need for I/O. • The internal resources, such as main memory and the system bus, must be shared among a number of activities, including data I/O. • The I/O function includes control and timing requirement, to coordinate the flow of traffic between internal resources and external devices.
  • 16. 16 2. Processor Communication • The I/O module communicates with the processor in following ways: • Command decoding: The I/O module accepts commands from the processor, typically sent as signals on the control bus e.g. Read/Write. • Data: Data are exchanged between the processor and the I/O module. • Status reporting: Because peripherals are so slow, it is important to know the status of the I/O module. Common status signals are Busy and Ready. • E.g. if an I/O module is asked to send data to the processor (read), it may not be ready to do so, because it is still working on the previous I/O command. This fact can be reported with a ‘status signal’. • Address recognition: Each I/O device has an address. Thus an I/O module must recognize one unique address for each peripheral it controls.
  • 17. 17 Module Function (Continued) 3. Device communication: The I/O module must be able to perform device communication. This communication involves commands, status information, and data. 4. Data buffering: Data coming from main memory are sent to an I/O module in a rapid burst. The data are buffered in the I/O module and then sent to the peripheral device at its ‘data rate’. • In the opposite direction, the data are buffered so as not to tie up the memory in a slow transfer operation. 5. Error detection: Finally, an I/O module is responsible for error detection and for subsequently reporting errors to the processor. E.g. paper jam, bad disk track, parity error etc.
  • 18. 18 Steps for Transfer of Data from Device to CPU • The control of the transfer of data from an external device to the processor might involve the following sequence of steps: 1. The processor interrogates the I/O module to check the status of the attached device. 2. The I/O module returns the device status. 3. If the device is operational and ready to transmit, the processor requests the transfer of data, by means of a command to the I/O module. 4. The I/O module obtains a unit of data (e.g. 8 or 16 bits) from the external device. 5. The data are transferred from the I/O module to the processor.
  • 19. 19 I/O Module Structure (Description Next Slide) • I/O modules vary considerably in complexity and the number of external devices that they control. (Device-1) (Device-2) (Port-1) (Port-2)
  • 20. 20 I/O Module ‘Interfaces’ (Fig. Last Slide) • The module connects to the rest of the computer through a set of ‘system- bus’ lines. • The data transferred to and from the module are buffered in one or more ‘data registers’. • There may also be one or more ‘status’ registers that provide current status information. • The logic within the I/O module interacts with the processor via a set of ‘control’ lines. The CPU issues commands to I/O module via them. • The module must be able to recognize and generate addresses associated with the devices it controls. • Finally, the I/O module contains logic specific to the interface with each device it controls. (e.g. disk drive or printer)
  • 21. 21 I/O Module (Generic term) • An I/O module functions to allow the processor to view a wide range of devices in a simple-minded way. • The I/O module may hide the details of timing, data formats, and the electro-mechanics of an external device, so that the processor can function in terms of simple Read and Write commands. • An I/O module that is quite primitive and requires detailed control is usually referred to as an I/O controller or device controller. • ‘I/O controllers’ are commonly seen on microcomputers. • However, we will use the generic term, I/O module.
  • 22. 22 I/O Commands (by CPU to I/O Module) • To execute an I/O related instruction, the processor issues an address, specifying the particular I/O module and external device, and an I/O command. • Types of I/O Commands: There are four types of I/O commands that an I/O module may receive when it is addressed by a processor: 1) Control 2) Write 3) Read 4) Test 1. Control: command is used to activate a peripheral and tell it what to do. 2. Write: causes the I/O module to take an item of data (byte or word) from the data bus and then transmit the data item to the peripheral
  • 23. 23 Types of I/O Commands (Continued) 3. Read: causes the I/O module to obtain an item of data from the peripheral and place it in an internal buffer (data register). • The processor can then obtain the data item by requesting that the I/O module place it on the ‘data bus’. 4. Test: command is used to test various status conditions associated with an I/O module and its peripherals. • E.g. if the device is powered ON and Available for use. • Processor will also want to know if the most recent I/O operation is complete and if any errors occurred.
  • 24. 24 1. Memory-Mapped I/O • When the processor, main memory and I/O share a common bus, two modes of addressing are possible: 1) Memory mapped I/O 2) Isolated I/O 1. With memory-mapped I/O, there is a single address space for memory locations and I/O device addresses. • The processor treats the status and data register of I/O modules as memory locations and uses the same machine instruction to access both memory and I/O devices. I/O data transfer is very like memory access.(CPU viewpoint) • So, for example, with 10 address lines, a combined total of 210 = 1024 memory locations and I/O addresses can be supported. Modes of Addressing I/O
  • 25. 25 2. Isolated I/O • With memory-mapped I/O, a single read line and a single write line are needed on the bus. 2. Isolated I/O: The address space for I/O is isolated from that from memory. (both memory and I/O use separate addressing space) • The full range of addressing is available for both. • Now, the command line specifies whether the address refers to a memory location or an I/O device. • Again with 10 address lines, the system may now support both 1024 memory locations and 1024 I/O addresses.
  • 26. 26 Advantages & Disadvantages (Memory-mapped I/O) • With Isolated I/O, the I/O ports are accessible only by special I/O commands (less), which activate the I/O command lines on the bus. • For most processor types, there is a relatively large set of different instructions (more) for referencing memory. • If Isolated I/O is used, there are only a few I/O instructions. (Dis-Adv) • Thus an advantage of memory-mapped I/O is that, this large number of instructions can be used, allowing more efficient programming. • A disadvantage of memory-mapped I/O is that a valuable memory address space is used up by I/O. • Intel prefers isolated-I/O over memory-mapped I/O. (Break)
  • 27. 27 Input / Output Techniques • The three techniques for input of a block of data are: (figure) 1) Programmed I/O 2) Interrupt-Driven I/O 3) Direct memory Access (DMA) Figure 7.4 Three techniques For Input of a Block of Data
  • 28. 28 7.3 Programmed I/O (First Technique) • With programmed I/O, the processor executes a program that gives it direct control of the I/O operation, including sensing device status, sending a read or write command, and transferring the data. • When the processor issues a command to the I/O module, it must wait until the I/O operation is complete. • If the processor is faster than the I/O module, (and it usually is) then this is wasteful of processor time. (Disadvantage)
  • 29. 29 Overview of Programmed I/O • When the processor is executing a program and encounters an instruction relating to I/O, it executes that instruction by issuing a command to the appropriate I/O module. • With programmed I/O, the I/O module will perform the requested action and then set the appropriate bits in the ‘I/O status register’. • The I/O module takes no further action to alert the processor. • In particular, it does not interrupt the processor. (to tell work is done) • Thus, it is the responsibility of the processor to periodically check the status of the I/O module until it finds that the operation is complete. • This is the main disadvantage of programmed I/O, as a result the level of performance of the system is severely degraded. CPU waits for I/O module to complete operation, this Wastes CPU time. CPU is tied with I/O. (Disadvantage)
  • 30. 30 Flowchart of Programmed I/O • Figure gives an example of the use of programmed I/O to read in a block of data from the peripheral device into memory. • Data are read in one word (e.g. 16 bits) at a time. • For each word that is read in, the processor must remain in a status-checking cycle until it determines that the word is available in the I/O module’s ‘data register’. • The main disadvantage of programmed I/O technique is that I/O is a time-consuming process that keeps the processor busy needlessly.
  • 31. 31 I/O Instructions (Executed by the CPU) • With programmed I/O, there is a close correspondence between the I/O related instructions that the processor fetches from memory and the I/O commands that the processor issues to an I/O module to execute the instructions. • That is, the program instructions are easily mapped into I/O commands, and there is often a simple one-to-one relationship. • Typically, there will be many I/O devices connected through I/O modules to the system bus. • Each device is given a unique identifier or address. • When the processor issues an I/O command, the command contains the address of the desired device. • Thus, each I/O module must interpret the address lines to determine if the command is for itself.
  • 32. 32 7.4 Interrupt-Driven I/O (Second Technique) • The problem with programmed I/O, the processor has to wait, and must repeatedly interrogate the status of the I/O module if it is ready for either reception or transmission of data. (A big Disadvantage) • As a result, the level of performance of system is severely degraded. • With interrupt-driven I/O, the processor issues an ‘I/O command’, continues to execute other instructions, and is interrupted by the I/O module when it has completed its work. (and is ready to be serviced) • With both programmed and interrupt I/O, the processor is responsible for extracting data from main memory for output and storing data in main memory for input. • Interrupt I/O is better than programmed I/O, CPU does not wait.(Adv)
  • 33. 33 How Interrupt-Driven I/O Works • From the point of view of the ‘I/O module’ 1. For input, the I/O module receives a read command from the processor. 2. The I/O module then proceeds to read data in from required peripheral. 3. Once the data are in the module’s ‘data register’, the module signals an interrupt to the processor over a control line. (saying I’m ready) 4. The module then waits until its data are requested by the processor. 5. When the CPU requests, the module places data on the ‘data bus’.
  • 34. 34 How Interrupt-Driven I/O Works • From the point of view of the ‘processor’ 1. For input, the processor issues a READ command. 2. It then goes off and does something else. (e.g. program execution) 3. At the end of each instruction cycle, the processor checks for interrupts. 4. When the interrupt from the I/O module occurs, the processor saves the context of the current program and processes the interrupt. (e.g. saving program counter and processor register) 5. The processor reads the word of data from the I/O module and stores it in memory. 6. The processor then restores the context of the program it was working on and resumes execution.
  • 36. 36 Interrupt Processing • The occurrence of an interrupt triggers a number of events, both in the processor hardware and in software. • Figure shows a typical sequence. (ISR)
  • 37. 37 Programmed I/O & Interrupt Driven I/O • Drawbacks of Programmed and Interrupt-driven I/O 1. The I/O transfer rate is limited by the speed with which the processor can test and service a device. 2. The processor is tied up in managing an I/O transfer; a number of instructions must be executed for each I/O transfer. • Advantages of Programmed and Interrupt-driven I/O • Using these I/O techniques, the processor is dedicated to the task of I/O and can move data at a rather higher rate. (manages resources)
  • 38. 38 7.5 Direct Memory Access (DMA), 3rd Technique (DMA Function) • In Direct memory access (DMA), the I/O module and main-memory exchange data directly, without processor involvement. • DMA is an additional module on the system bus. • The DMA module must force the processor to suspend operation temporarily to gain control over the system bus, which is needed for a data transfer, directly between the I/O module and main memory. • This technique is called cycle stealing, because the DMA module in effect steals a bus cycle.
  • 39. 39 DMA Read or Write Operation • When the processor wishes to read or write a block of data, it issues a command to the DMA module, by sending the DMA module the following information: Whether a read or write is requested, using a read/write control line. The address of the I/O device involved. The starting location in memory to read from or write to. The number of words to be read or written.
  • 40. 40 DMA Read or Write Operation 1. After issuing a Read command to the DMA, the processor then continues with other work. 2. The DMA module transfers the entire block of data, one word at a time, directly to or from memory, without going through the processor. 3. When the transfer is complete, the DMA module sends an interrupt signal to the processor. (telling work done) • Thus, the processor is involved only at the beginning and end of the transfer.
  • 41. 41 Review Questions (Chapter 07) (Slide-7) (Slide-14, 15, 17 & 18) (Slide-27,28, 32 & 38) (Slide-24 & 25) (Slide-40) (Slide-37) (Slide-31, Red) 7.8 How ‘Interrupt Driven I/O’ works from the point of view of ‘I/O Module’? (Slide-33)
  • 42. 42 Final Paper Pattern • Total Marks = 50 • Short Questions (Preparatory Questions) = [3*10 = 30 Marks] • Long Questions (Preparatory Questions) = [5*2 = 10 Marks] • Numerical Problems (Examples + Problems) = [5*2 = 10 Marks] • Chapters Included in Final-Term Course: Ch-4,Ch-7 • Chapter – 4: 40% Marks • Chapter – 7: 30% Marks • Chapter – 3: 20%, Chapter – 5: 10%
  • 43. 43 Interrupt-Driven I/O (Design Issues) • Two design issues arise in implementing interrupt I/O. • First, because there are multiple I/O modules, how does the processor determine which device issued the interrupt? • Second, if multiple interrupts have occurred, how does the processor decide which one to process? • Four techniques serve to identify the I/O module & assign priorities: 1) Multiple interrupt lines 2) Software poll 3) Daisy chain (hardware poll, vectored) 4) Bus arbitration (vectored)
  • 44. 44 1. Multiple interrupt lines between the processor and the I/O modules, serve to identify the requesting I/O module. (Impractical) 2. Software poll: When the processor detects an interrupt, it branches to an interrupt-service routine whose job is to poll each I/O module to determine which module caused the interrupt. 3. Daisy chain: provides a ‘hardware poll’. When the processor senses an interrupt, it sends out an ‘interrupt acknowledge’. This signal propagates through a series of I/O modules until it gets to a requesting module. • The requesting module places a word called vector, the processor uses the vector as a pointer to the appropriate device-service routine. 4. Bus arbitration: an I/O module must first gain control of the bus before it can raise the ‘interrupt request line’. Thus only one module can raise the line at a time.
  翻译: