1. CSE491 Computer Interfacing and Peripherals
Instructor: Abdelhameed Sharaf
Schedule: Every Saturday ( Lectures)
from 11:00 AM to 01:00 PM @ SS 208 OR
from 01:00 PM to 03:00 PM @ 315 PH
( Lab/Tut.)
Saturday: Sec1: 03:00 PM to 06:00 PM
Tuesday: Sec2: 11:00 AM to 02:00 PM
Sec3: 02:00 PM to 05:00 PM
Wednesday: Sec4: 11:00 AM to 02:00 PM
Course Content
Main Interfacing Units
Direct Memory Access
Synchronous and Asynchronous Computer Communications
Parallel and Serial Communications
Peripherals Types and Its Connections
Channel Programming
Synchronous and Operation Control
Case Study: Using C-Language
Grading System
First Exam 20 Pts., Week 6 (first 4
Second Exam 20 Pts., Week 11(the
Assignment/Absent 20 Pts. , Weeks 5 and 10
Final Exam 90 Pts.
2. Main Textbooks:
• THE INTEL MICROPROCESSORS
8086/8088, 80186/80188, 80286, 80386, 80486, Pentium, Pentium Pro
Processor, Pentium II, Pentium III, Pentium 4, and Core2 with 64-Bit Extensions
Architecture, Programming, and Interfacing, BARRY B. BREY
Other Textbooks:
• Computer Peripherals for Micro Computers, Microprocessor and PC by Levis
Hahensteu.
• Computer Peripherals And Interfacing by Priti Srivastav- Ishan Publication.
• Computer Peripheral & Interfacing by Gourav Gupta, Eagle Prakashan,
Jalandhar.
• Microprocessors and Interfacing by Hall, Douglas: McGraw Hill.
4. Peripherals are any device that can be
attached to a CPU, e.g. hard disk, mouse,
printer.
Peripherals are slow. They hold up the CPU
from carrying out its’ tasks.
For Example - playing a game and it needs to
load the next level. The level is being read
from the CD and written to memory.
What is an interface?
The interface is the combination of
hardware and software needed to link the
CPU to the peripherals and to enable them
to communicate with the CPU despite all
their differing characteristics.
The hardware is the bit you connect the cable
into e.g. USB, parallel Firewire.
The software is the driver disk that you usually
need to install when you get the device, e.g.
printer diriver.
5. Computer peripherals all have different
characteristics. For example, they may:
Have different data transfer rates;
Use a wide variety of codes and control signals;
Transmit data in serial or in parallel form;
Even work at higher voltages than the CPU; &
All operate at much slower speeds than the CPU.
The main functions of an interface that you need to know
about are:
Buffering;
Converting data to and from serial and parallel forms;
Converting data to and from analogue and digital forms;
Voltage conversion;
Protocol conversion; &
Handling of status signals.
Buffering:
This is an area of RAM within the interface which
stores the data while in transmit between the
processor and the peripheral.
The interface uses the buffer to temporarily
store the data it is working with.
It also uses the buffer to compensate for the
differences in speed between the peripherals and
the CPU by temporarily storing incoming data so
that the faster CPU can process it in manageable
blocks rather than waiting for the slower
peripheral.
Converting data to and from serial and parallel
forms:
Data transmission is the passing of data from one
device to another.
A serial interface uses serial data transmission;
A parallel interface uses parallel data transmission.
Serial data transmission - is when data is
transmitted along a communication channel one bit
after another in sequence. Very slow but efficient
over long distances.
6. Parallel data transmission - transmit several
bits of data simultaneously across a series of
parallel channels, often transmitting 16 or 32
bits at a time. Very fast but only suitable for
short distances.
The buses internal to the processor are parallel
channels. Any data coming from a serial device
has to be sent to an interface which buffers the
data then converts it to parallel form before it
is passed to the processor.
1 0 1 0 1
0
1
0
1
0
1
0
1
0
1
0
1
0
Serial data format
Interface
Parallel data format
Converting data to and from analogue and digital
forms:
Analogue signals – many electrical signals are analogue
signals. These signals vary between two limits. Analogue
signals that are sent in from peripherals to the digital form
that the CPU can handle. If you could see an analogue signal
it would look roughly like this:
Digital signals – computers can only work with digital
signals, which have only two values – on or off. A digital
signal therefore consists of a series of “on’s” and “off’s”.
An on signal is represented by a 1 and an off by a 0
0 1 1 0 0 1 1
7. ADC and DAC
A computer is connected to a peripheral
by an interface. This interface has to be
able to change the digital signals from the
computer to an analogue signal that the
other device can understand. This is done
by a DAC – Digital to Analogue Converter.
Signals can be changed in the other
direction by an ADC – Analogue to Digital
Converter.
Voltage Conversion
Peripherals send data using a different voltage
from that used by the processor and its
associated components on the motherboard of the
computer.
An interface is used to compensate for these
differences.
Protocol Conversion
A protocol is a standard that enables the connection,
communication and data transfer between computers or
between a computer system and a peripheral. Protocol
conversion means ensuring that the protocols used by the
peripheral can be understood by the computer it is
attached to and vice versa.
Handling of Status Signal
The purpose of the status information is to show whether
or not a peripheral device is ready to communicate. This
information is used to inform the user of a problem
requiring attention. Some printers
Buffers and spoolers are terms generally
associated with printers.
The terms are not dedicated to printers but
that is the context that will be described.
8. What is a Buffer?
A buffer is an area of memory used for the transfer
of data between a computer and a peripheral.
A buffer provides temporary storage of data.
Using a buffer provides a link between a device and
the processor and helps compensate for any
differences in their working speeds.
Why use buffers?
Peripherals operate at much slower speeds than the
CPU. Using buffers helps the computer system
compensate for the differences in operating speeds
between CPU and its peripherals.
When transferring data out to a peripheral such as a
printer, the processor can transfer it faster into the
buffer and the buffer will send it to the printer at a
speed that the printer can cope with.
Why use buffers?
The use of buffers reduces the frequency with
which the CPU is interrupted to deal with input.
Data from a keyboard is stored in a buffer until
there is a larger amount of data for the CPU to
process.
Spoolers
Spooling is another technique used in the transfer of
data to a slow peripherals. In this case the data
intended for the peripheral, the best example is a
printer, is transferred to storage, often a hard disk.
Then when the processor is idle it will transfer the
data to the printer at an acceptable speed. This is
also called background printing.
This frees up the much faster CPU to process other
tasks. Spooling is another possible method of
improving system performance.
9. Buffer v’s Spooler
If the CPU is very busy and doesn’t get much idle
time then spooling can be a very slow process.
Spooler v’s Buffer
A buffer is limited by the amount of RAM
whereas a spooler uses backing storage which
has a very large capacity.
Use BOTH for optimum efficiency.
New interfaces are continually being
developed.
One focus of development is to increase the
speed at which interfaces allows the
peripheral and computer to communicate.
Another aim is to allow wireless
communication between peripheral devices
and the CPU.
Interface speeds are measured in Megabits
per second (Mbps).
N.B. do not confuse Megabits and Megabytes
Manufacturers normally use Megabits per
second in their advertising as this allows
them to print larger numbers on their
advertisements.
10. One example of increasing interface
speeds is the development of the USB 2
and the Firewire 800 interfaces.
The USB 2 improves upon the maximum 12
Mbps speed of the USB 1 interface by 40
times to 480 Mbps.
The Firewire 800 interface provides 800
Mbps, double the speed of the Firewire 400
interface.
Interface Description
RS232 Recommended Standard (Serial)
SCSI Small computer Systems Interface ( Parallel)
IDE Integrated Drive Electronics
SATA Serial Advanced Technology Attachment – up to 1.5Gbps
IEEE Institute of Electrical and Electronic Engineers e.g. firewire
MIDI Musical Instrument Digital Interface
PCI Peripheral Component Interconnect
PCMCIA Personal Computer Memory Card International Association
USB1 & 2 Universal Serial Bus
The use of interface standards by a computer manufacturer means that their
computers will be able to connect to peripherals using the same standards.
The use of interface standards by peripheral manufacturers means that their
peripherals will connect to a computer which uses the same standards.
Makes them COMPATABLE!!!
Interface Description Transfer Speeds
USB1 Universal Serial Bus Fast transfer rate:
A means of connecting 12 MBPS for fast
external devices devices
USB2 An improvement of the Up to 480 Mbps
USB.
Firewire A high speed serial interface In its latest version,
used for connecting audio/ IEEE 1394b, up to a
visual and multimedia max of 800Mbps.
applications like digital 3.2Gbps are under
camcorders. Development.
Current trends in wireless communication include
the standards WiFi and Bluetooth.
Bluetooth and WiFi both use radio waves at the
same frequency.
Radio waves can pass through most materials
and walls, and devices do not need to be pointing
at one another, unlike, infrared data
transmission (TV remote control).
11. Bluetooth
Bluetooth can make short-range links between personal
devices, such as mobile phones and headsets, palmtops
(PDA) and laptop (notebook) computers.
Bluetooth is also used for wireless keyboards and mice.
It is expected that later versions of Bluetooth will be
able to transmit data at a speed of 2 Mbps and for
longer distances
WiFi
WiFi stands for the Wireless Fidelity Alliance.
The main use for WiFi is in wireless local area
networking (WLAN). WiFi devices have typical ranges
from 15 to 50 meters and typical data transfer rates
from 5 to 20 Mbps.
A solid-state storage device contains no moving
parts.
Examples include flash cards and USB flash memory
Both of these types of device contain the same type of
backing storage medium, namely flash ROM.
The effective difference between them is that they use
different interfaces to connect to a computer system or
another peripheral.
Flash cards are used mainly for data storage in cameras,
although they can hold any type of program or data file.
There a number of different standards of flash cards.
Each digital camera normally uses only one type of flash
card
Specialised card readers have been developed which have
‘slots’ to fit all the different varieties of flash cards.
So called ‘all-in-one’ devices (printer, scanner, photocopies) have
slots into which flash cards may be placed. This allows documents
to be printed directly from the card, without a computer system
having to be connected.
12. There are two types of USB Flash Memory,
according to the type of interface being used.
The are USB 1 and USB 2.
Most of these devices are now compatible with
USB 2.
USB2 devices are always backwards compatible.
In this case the speed of access will be USB 1
Solid-state storage devices are small.
Flash cards can fit inside the camera.
USB flash memory can fit on key rings and in
watches.
Solid-state storage devices are robust because
they have no moving parts.
This means that they are ideal for wearing because they
are unaffected by vigorous movement.
iPods take advantage of this feature of Solid-state
storage devices.
Solid-State storage devices use less
power than hard disk drives.
This lower power requirement means that a
music player which uses solid-state storage
will play music for a longer time relative to a
hard disk-based music player with the same
battery capacity.
Solid-state storage devices are available in a range of
capacities, from 256 Mb to 8 Gb (at the time of writing).
USB flash memory has now replace floppy disk as a
convenient, portable storage medium, which can fit into
almost any modern computer system.
USB flash memory is used for security applications.
One type has fingerprint recognition and another type
works with security software to prevent a computer system
from starting up unless the USB flash memory is plugged in.
13. Increased capacity
DVD
The DVD-Recordable format capacity was
increased with the introduction of the dual
layer DVD-R disk with a capacity of 8.4 Gb
(Single –layer DVD-R capacity is 4.7 Gb)
Most computers now incorporate this dual
layer drive.
Blu-ray
Blu-ray disc (BD) is the name of the next
generation optical disc format.
The format was developed to enable
recording, rewriting and playback of high-
definition video (HD).
The format may become a standard for PC
data storage and high-definition movies.
Increased read and write speeds
Faster interfaces are constantly being developed, e.g. USB 2, Firewire
800, with speeds of 480 Mbps and 800 Mbps, respectively
Reduced Physical Size
In 2004, Guinness World Records certified that Toshiba’s 0.85 inch
diameter hard disk drive as the smallest hard disk drive in the world.
Lower Cost Per Unit of Storage
In 1995, a 100 Mb capacity hard disk drive cost £300. In 2005, a 100
Mb capacity ZIP drive cost £5, and a 512 Mb USB flash memory cost
£25.
Implications of Development Trends
One implication may be that new peripherals and media may not
work with old ‘legacy’ hardware.
An older computer may not have a USB port, or if it does, it may
not be USB 2, only USB 1.
A DVD re-writer may not be able to read or write to new disk
formats.
Care must also be taken with archived data, to make sure that it
is regularly copied to a current storage format so that it can
always be accessed.
In 2004 we say some electrical stores discontinue the sales of
VHS video recorders in favour of DVD.
Digital video cameras, which record directly to DVD instead of
tape are now common.
14. 54
For the Higher course you need to be aware of how peripherals
work and of the current specifications and trends.
You should be aware of the following characteristics for each
type of device:
• capacity
• speed
• cost
• type of interface
• resolution
pctechguide.com howstuffworks.com
55
• speed
• resolution
Keyboards generally follow the standard Qwerty layout
although new innovative designs are available which attempt
to improve user comfort and ease of use.
n/a(not applicable)
Speed of input is determined by the user’s typing
ability. This is always very slow in computer terms
and so speed is not a performance issue.
56
• capacity
• cost
• type of interface
A keyboard has a very small buffer to store several
keypresses but again capacity is not particularly relevant
for keyboards.
Keyboards are inexpensive items with prices ranging from
£8 up to £50 and more for more stylish models.
Manufacturers include Microsoft, Logitech and Benq.
The PS2 (Personal System 2) interface was the standard
but USB, Bluetooth and infra red are becoming more
common.
15. 57
Scanners are used to convert graphic images into a digital
format suitable for processing in a computer.
Text can also be input when the scanner is used with Optical
character recognition (OCR) software.
• resolution
The resolution of a scanner is measured in dots per inch
(dpi). Note that 600 dpi means that every square inch has
600 x 600 dots = 360000 dots.
The bit depth also affects quality with modern scanners
offering 48 bit depth.
58
• speed
The speed of a scanner is measured by how long it takes
to scan a page at a particular resolution and bit depth.
• capacity
• cost
• type of interface
n/a
Scanners cost from £50 to £300 depending on features.
Manufacturers include Canon and Epson.
The USB 2 interface is the standard with SCSI and
Firewire also available.
59
A sound card takes an analogue sound and converts into a
digital one.The sound is sampled by listening and measuring
the sound every nth fraction of a second and storing the
sample as a digital number.
The sampling rate determines how often per second a sample is
taken. CD quality samples at 44.1 kHz = 44,100 times per
second.
The sample size/bit depth determines the range of sounds
which can be recorded each time. CD quality works at 16 bit
depth which gives a range of 65,536 different sounds.
60
• speed n/a
• capacity
• cost
• type of interface
n/a
Sound cards cost from £10 to £200 depending on features.
Manufacturers include Creative Labs and Terratec.
The PCI (Peripheral Component Interconnect ) interface
is the standard with USB and Firewire also available.
16. 61
A digital camcorder takes moving images and converts them
into a series of individual digital images.
A CCD (Charge coupled device) detects light intensity and
converts it into an electrical signal.
• resolution
The number of pixels in the CCD can affect quality.
More expensive models have 3 CCDs, one for each
primary colour, which also improves quality. A high
optical zoom also allows good quality.
62
• speed
Digital camcorders allow video display at 25 frames per
second following the PAL standard which is used in most
of Europe.
• capacity
• cost
• type of interface
The capacity of a camcorder depends on the type of
backing storage used. These include MiniDV,
Digital8, Hi8 tapes and optical DVD.
Costs range from £200 to £3000 depending on features.
Manufacturers include Sony, Canon and JVC
Firewire is the standard interface for digital camcorders.
63
A digital camera takes a still image and converts it into a
digital image.
A CCD(Charge coupled device) detects light intensity and
converts it into an electrical signal.
• resolution
The number of pixels in the CCD affects quality.
CCDs of 4 megapixels and upwards are now
common. Cameras typically use 24 bit depth for
colour. A high optical zoom also allows good quality.
64
• speed
Shutter speeds are relevant for taking photographs in
different situations, e.g. sports shots, night scenes.
• capacity
• cost
• type of interface
The capacity of a camera depends on the type of backing
storage used. These include SD, XD, Compact flash
which are all solid state memory cards, and a microdrive
which is a miniature Hard drive.
Costs range from £40 to £5000 depending on features.
Manufacturers include Fuji, Olympus, Canon and Nikon
USB 2 is the standard interface for digital cameras.
17. 65
Tiny droplets of ink are heated and explode onto the page.
Printers can print text and graphics, colour and a range of
greyscales.
• resolution
Resolution is measured in dpi and 4800 x 1200 is
typical. 24 bit depth is commonly used for colour.
• speed
Printer speed is measured in pages per minute (ppm).
The speed depends on the size of the page and the
complexity of the image being printed.
66
• capacity
• cost
• type of interface
Printers store data about to be printed in a buffer. A large
buffer will allow the user to begin other work on the
computer while the printer is still processing the page.
Costs range from £40 to £300 depending on features.
Manufacturers include Epson, Lexmark, Canon &
Hewlett Packard (HP).
USB is the standard interface for modern inkjet printers with
older models using serial or parallel interfaces.
Running costs for inkjet printers are very high as cartridges
have a limited capacity and are very expensive
67
Lasers write a page image onto a special drum as an
electrostatic charge. The charged drum attracts toner particles
which are transferred to the page and heated to fuse the
image onto the paper.
• resolution
Resolution is measured in dpi and 600 x 600 is typical.
Monochrome models are very common in offices and
colour models are coming down in price.
• speed
Printer speed is measured in pages per minute (ppm). The
speed depends on the size of the page and the complexity
of the image being printed.
68
• capacity
• cost
• type of interface
Printers store data about to be printed in a buffer. A large
buffer will allow the user to begin other work on the
computer while the printer is still processing the page.
Costs range from £70 to £13,000 depending on features.
Manufacturers include Epson, Lexmark, Canon &
Hewlett Packard (HP).
USB, serial, parallel and ethernet interfaces are used for
laser printers.
Running costs for laser printers are low as laser toner
cartridges have a larger capacity than inkjets. Laser toner
for colour lasers however is still very expensive.
18. 69
Two techniques are used with printers to cope with the fact
that they work slowly compared to the processor.
These involve the use of buffers and spoolers.
Buffer
You have already met the concept of buffering, using RAM to
store data until the printer is ready to process it. Look back at
slide 3 for more details
70
Spooler
Spooling is a similar technique but here the file to be printed is:
On our school network every time you print, a spool file is
created and sent to the server for printing.
The server then takes over the job of sending it down to
the printer when the printer is ready.
• Sent to the computer’s hard disk for temporary storage.
• Stored in a queue and sent to the printer in stages as a a
background job during the processor’s idle moments.
This can slow down printing but allows the user to carry on with
other tasks while printing is taking place in the background
71
CRT Monitors are large and bulky and use a similar technology
to traditional television sets. The Cathode Ray Tube is the
bulky part which sticks out at the back.
• resolution
Resolution is measured in dpi and CRT monitors can
display at different resolutions.
The size of the display directly affects resolution. An
image on a 21-inch monitor with an 800x600 resolution
will not appear nearly as sharp as it would on a 15-inch
display at 800x600.
• speed n/a
The refresh rate is the number of times that the image on
the display is drawn each second. A CRT monitor with a
refresh rate of 72 Hertz (Hz) cycles through all the pixels
from top to bottom 72 times a second.
A low refresh rate means that the screen flickers and
this can cause headaches and eye strain.
• capacity
• cost
• type of interface
n/a
Costs range from £50 to £600 depending on size and
features. Manufacturers include Samsung, Phillips,
Viewsonic.
The VGA (Video Graphic Array) interface is common with
the new DVI (Digital Visual Interface) digital interface
becoming more popular.
19. 73
Thin Film Transistor(TFT) Monitors use Liquid Crystal
Display(LCD) technology to create monitors which are very
slim and light. These are used on laptops and are rapidly
becoming the standard type of display on desktops.
• resolution
Resolution is measured in dpi and TFT monitors are built
with a particular resolution for best quality.
Lower resolutions can be set but quality is poor.
1024 x 768 is common for laptop displays. This
requires 2,359,296 transistors etched onto the glass.
74
• speed n/a
There is no need to worry about refresh rate or flickering
on a TFT monitor as transistors are either on or off.
Due to manufacturing limitations TFT panels virtually
always have some dead pixels which do not display
correctly.
• capacity
• cost
• type of interface
n/a
Costs range from £100 to £1600 depending on size and
features. Manufacturers include NEC, Sony, LG.
The VGA interface is common with the new DVI digital
interface becoming more popular.
75
Hard Disks and floppy disks are the main examples of magnetic
disk with floppy disks rapidly becoming obsolete due to their
limited capacity of 1.44 Mb.
• resolution n/a
The read/write head moves to the required track and waits
until the requested block spins past the head.
The following characteristics refer to hard disk.
76
• capacity
• cost
• type of
interface
The capacity of modern hard disks ranges from
500 GB to 2 TB.
Costs range from £30 to £160 depending on
capacity and type of interface. Manufacturers
include Maxtor and Seagate.
Interfaces include IDE, SCSI, ATA and SATA.
• speed Speed of access is important. The main factor
here is the rotational speed of the disk with
typical figures being 5,400 or 7,200 rpm.
(Revolutions per minute) The type of
interface also affects the speed of access.
20. 77
These include CD-ROM, CD-R, CD-RW, and their DVD
equivalents.
• resolution n/a
The disk surface is a mirror covered with billions of tiny lands
and pits that are arranged in a long, tightly wound spiral.
A laser reads and interprets the information as bits of data.
ROMs are read only.
R can be written to once but not erased.
RW can be written to and erased using special software.
78
• speed CD Speed is measured as a multiple of single
speed audio which runs at 150 Kbps.
Speeds for reading and writing differ with
reading speed normally being the fastest.
Single speed DVD is 1,250 Kbps
Typical
speed is now x52.
and x16 speed
is common.
• capacity CD –
DVD –
650 MB
Between 4.7 GB and 17 GB depending
on single/double sided, single/double
layered.
79
• cost
• type of interface
Costs range from £10 to £130 depending on
type and whether the drive is internal or
external. Manufacturers include Pioneer,
Lite-On and NEC.
Interfaces include IDE, USB2 and firewire.
80
Magnetic tape drives are still commonly used for backup
purposes although removable magnetic disks and optical RW
technology can now also be used for backups.
• resolution n/a
Tape drives are relatively expensive but tapes are cheap.
The school network backs up all user data files every night at
midnight and five generations are kept.
Tapes have a
higher capacity than any of the optical media is use today.
21. 81
• speed Tapes allow serial/ sequential access and so
their use is generally restricted to making
backups.
Transfer rates range from 2 to 30 Mbps
depending on model and price.
• capacity Capacities vary widely depending on model
and price. Data can be stored in a
compressed format which increases capacity
but reduces transfer rates.
Figures up to 1.3 TB were found on
current price lists. (June 2009)
82
• cost
• type of interface
Costs range from £80 to £6,000 depending
on type, capacity and data transfer rate.
Interfaces include IDE, USB and SCSI.
Manufacturers include Seagate, Travan and
Hewlett Packard.
83
Solid state storage devices have no mechanical or moving parts
and use integrated circuits rather than magnetic or optical
media.
Current technology means that capacity is lower than magnetic
or optical media but costs are falling and capacities are
increasing.
Data transfer takes place at very high speeds and the devices
are very robust.
Flash cards are a popular form of solid state storage and are
commonly found in digital cameras and mobile phones.
84
• speed With no moving parts, data transfer speeds
are high at up to 480 Mbps using a USB2
interface
• resolution n/a
Memory sticks have virtually replaced floppy disks as a
portable storage medium being easy to carry around.
Some even double up as key rings or mp3 players.
22. 85
• cost
• type of
interface
Costs vary up to £45 depending on type and
capacity.
USB 2
Manufacturers include Crucial, Kingston and
Sony.
• capacity Capacities vary widely depending on type.
Figures from up to 16 GB were found on
current price lists. (June 2009)
86
Solid state storage is replacing floppy disks as the
portable medium.
DVD is replacing CD as the main optical drive in
computer systems.
Blu Ray is now the standard for High definition DVD
technology. It won against its rival
Capacities for all devices are increasing and cost per
byte is falling.
HD-DVD.