Unit 6
Unit 6
Computer Organization
Unit-VI
• A Peripheral Device is defined as the device which
provides input/output functions for a computer and serves as an
auxiliary computer device without computing-intensive functionality.
• Generally peripheral devices, however, are not essential for the
computer to perform its basic tasks, they can be thought of as an
enhancement to the user’s experience. A peripheral device is a device
that is connected to a computer system but is not part of the core
computer system architecture. Generally, more people use the term
peripheral more loosely to refer to a device external to the computer
case.
• Classification of Peripheral devices:
It is generally classified into 3 basic categories which are given below:
1.Input Devices:
The input devices is defined as it converts incoming data and instructions
into a pattern of electrical signals in binary code that are comprehensible to a
digital computer.
Example:
Keyboard, Mouse, Scanner, Microphone etc.
Output Devices:
An output device is generally reverse of the input process and generally
translating the digitized signals into a form intelligible to the user. The output
device is also performed for sending data from one computer system to
another. For some time punched-card and paper-tape readers were extensively
used for input, but these have now been supplanted by more efficient devices.
Example:
Monitors, headphones, printers etc
• Input/Output peripherals:
Input/output peripherals are the means by which the user and the
computer communicate with each other. A computer is very little
use unless it has at least one input peripheral and one output
peripheral. The input device is needed so that the user can tell the
machine what he wants it to do, and to enter data. The output device
reports the results to the user.
• Advantage of Peripherals Devices:
Peripherals devices provides more feature due to this operation of the
system is easy. These are given below:
• It is helpful for taking input very easily.
• It is also provided a specific output.
• It has a storage device for storing information or data
• It also improves the efficiency of the system.
I/O mapped I/O and Memory Mapped I/O
• Basically this are two different techniques to interface devices,
interfacing devices means connecting devices with processor now this
devices can be either I/O devices or can be memory devices. Depending
upon technique you can use I/O mapped I/O and Memory Mapped I/O.
• 1. Memory-Mapped I/O Interfacing :
In this kind of interfacing, we assign a memory address that can be used
in the same manner as we use a normal memory location.
• 2. I/O Mapped I/O Interfacing :
A kind of interfacing in which we assign an 8-bit address value to the
input/output devices which can be accessed using IN and OUT
instruction is called I/O Mapped I/O Interfacing.
Features Memory Mapped IO IO Mapped IO
IO devices are accessed like any other memory They cannot be accessed like any other
Addressing
location. memory location.
Address Size They are assigned with 16-bit address values. They are assigned with 8-bit address values.
Instructions Used The instruction used are LDA and STA, etc. The instruction used are IN and OUT.
Cycles involved during operation are Memory Cycles involved during operation are IO read
Cycles
Read, Memory Write. and IO writes in the case of IO Mapped IO.
Registers Communicating Any register can communicate with the IO Only Accumulator can communicate with IO
device in case of Memory Mapped IO. devices in case of IO Mapped IO.
216 IO ports are possible to be used for Only 256 I/O ports are available for interfacing
Space Involved interfacing in case of Memory Mapped IO. in case of IO Mapped IO.
IO/M` signal During writing or read cycles (IO/M` = 0 ) in During writing or read cycles (IO/M` = 1) in
case of Memory Mapped IO. case of IO Mapped IO.
Arithmetic and logical operations are Arithmetic and logical operations cannot be
Arithmetic and Logical operations performed directly on the data in the case of performed directly on the data in the case of
Memory Mapped IO. IO Mapped IO.
Memory-Mapped I/O
• When I/O devices and the memory share the same address space, the
arrangement is called memory-mapped I/O.
• Any machine instruction that can access memory can be used to transfer
data to or from an I/O device.
Move DATAIN, R0
I/O devices operate at speeds that are very much different from that of
the processor.
It needs to make sure that only after a character is available in the input
buffer of the keyboard interface; also, this character must be read only
once.
• Three Major Mechanisms
• Interrupt
Processor sends the starting address, the number of data, and the direction of transfer to
DMA controller.
Processor suspends the application program requesting DMA, starts DMA transfer, and
starts
another program.
After the DMA transfer is done, DMA controller sends an interrupt signal to the processor.
1. The processor is executing a program and encounters an instruction relating to I/O operation.
2. The processor then executes that instruction by issuing a command to the appropriate I/O module.
3. The I/O module will perform the requested action based on the I/O command issued by the processor
(READ/WRITE) and set the appropriate bits in the I/O status register.
4. The processor will periodically check the status of the I/O module until it find that the operation is complete
INTERRUPTS
• An interrupt in computer architecture is a signal that requests the processor to suspend its current execution
and service the occurred interrupt
• To service the interrupt the processor executes the corresponding interrupt service routine (ISR). After the
execution of the interrupt service routine, the processor resumes the execution of the suspended program.
• When a program enters a wait loop, it will repeatedly check the device status. During this period, the
processor will not perform any function.
• The Interrupt request line will send a hardware signal called the interrupt signal to the processor.
• On receiving this signal, the processor will perform the useful function during the waiting period.
• The routine executed in response to an interrupt request is called Interrupt Service Routine.
• The interrupt resembles the subroutine calls.