You are on page 1of 35

UJJAIN ENGINEERING COLLEGE

UJJAIN

ACAP Practical File


BE VI Semester
Computer Science And Engineering
Enrollment Number
0701CS161008
Session 2019-20
Submitted To: Submitted By:
Mr. Sanjay Kumar Arpit Singh
Ms. Mitali Khandelwal
Ms. Payal Parmar
1
INDEX

Page Date of Date of


S.No Topic Remark
No. Practical Submission

Case study of
1. 3
Keyboard

Case study of
2. 10
Magnetic Disks

Case study of Floppy


3. 14
disk and Controller

Case study of Hard


4. 19
Disk and its working

5. Case study of Printer 25

A Program for Mouse


6. Handling/Keyboard 30
Handling

2
ACAP PRACTICALS
KEYBOARD CASE STUDY
Computer Peripherals are add-on hardware to the computer to expand its abilities or
improve its performance. Computer peripherals are devices such as monitors, modems, or
printers ,keyboards ,mouse that are external to a computer system but work closely with it.

Keyboard : In computing, a computer keyboard is a typewriter-style device[1] which uses


an arrangement of buttons or keys to act as mechanical levers or electronic switches.
Following the decline of punch cards and paper tape, interaction via teleprinter-style
keyboards became the main input method for computers.

A computer keyboard distinguishes each physical key from every other and reports all key
presses to the controlling software. Keyboards are also used for computer gaming, either
with regular keyboards or by using keyboards with special gaming features, which can
expedite frequently used keystroke combinations. A keyboard is also used to give commands
to the operating system of a computer, such as Windows' Control-Alt Delete combination,
which brings up a task window or shuts down the machine. Keyboards are the only way to
enter commands on a command-line interface.

Basically, all keyboards have the following parts :

Typing Area: It looks and arranged like a traditional typewriter where you press alphabetic
keys. It holds alphabetic character such as letter, special characters and numbers. This is the
area you use mostly when you do word processing.
3
Function Key: The functions keys are located at the top of a keyboard and grouped into
four. There are 12 functions keys starting from F1 through F12. These keys are used for
special purposes and most programmers use these keys to do a specific task.

For example, if you are writing text with Microsoft Word and wanted to read Help, you can
press F1 to display the Help. F5 key will display Find and Replace dialogue box. F12 key
will display Save As dialogue box. These keys used differently again in other applications,
for example, if you are a user of AutoCAD, pressing F2 will display AutoCAD text window.

Numeric Keypad: Numeric keypad is the other part of computer keyboard. Usually, it is
located at the right side of a keyboard. It is arranged like a standard calculator used to enter
numerical data.

Cursor and monitor Controls: These are keys found between the typing keypad and the
numeric keypad. It has two groups of keys, arranged top and bottom. The top keys holds
Insert, Home, Page Up, Page Down, Delete, and Endkeys.

Insert key switches between insert and overtype modes. Home key brings you back at the
beginning of a page. Page Up and Page Down keys help you to move one page or screen up
or down. Delete key erases a text or page. The End key takes you at the end of a page.

The bottom keys are independent directional keys, which let you to move the cursor Left,
Right, Up and Down. Status lights, Escape key, Print Screen/SysRq, Scroll Lock,
Pause/Break are user for frequent functions.

For example, if you press the Caps Lock on the typing keypad, the Caps Lock Status light
tells you that is on and can type Capital letters. You press Print Screen key if you want to
save the current Window as an image.

Types Of Keyboards

1. Standard Keyboard: Though standard keyboards have undergone considerable


changes in design over the last 20 years, their basic layout remains similar. The
average number of keys on a regular keyboard is 105, though some older versions
have keys in the range of 95-103. Even though standard keyboards are the most basic
form of keyboards, they can have slight variations, especially in the manner the keys
are placed.
2. Ergonomic Keyboard: The artifact of this keyboard is slightly broader and different
in shape, when compared with the normal keyboard. In this key board certain space
will be existing between the two sets of keys and the countered shape of this key board
allow the users to place their hands in the natural position to type. These key boards
are mostly used by the people who often work with the key board as their usage is
4
easier and is less stressful for the wrist. The following figure: Ergonomic keyboard
shows how the set of keys are separated with gaps in between.

3. ADB(Apple Desktop Bus): ADB refers to a special type of port which is enabled in
some computers such as Apple computers. The ADB key boards can be connected
only to the ADB jack enabled computers, but with the use of the adapter, the ADB key
boards can also be inserted over a USB port.

4. XT : An obsolete type, these keyboards only support the older computers such as IBM
8086/8088, XT-286. Not supported by present computers, keyboards are much larger
than the modern keyboards and the “Enter” key is backward-”L” shaped.

5. MultiMedia: The multimedia keyboard is specially designed for the people who are
much into multimedia designing. This keyboard is just like the standard key board, but
composed of additional keys for the multimedia purposes such as multimedia
application launch, volume control and mute button.

6. Internet: The Internet keyboards are designed for wider range of multimedia
applications, these keyboards are specially designed for the intense Internet user. The
special keys included in this keyboard are the home key, back and forward key, e-mail
launch key, and browser launch key etc. these keys carry out the same functionality as
of the buttons on the webpage. In order use these extra keys the computer must be
embedded with right operating system.

7. Wireless: A wireless keyboard, the name itself doles the meaning that this keyboard
can be operated without addressing a wired connection to the processor. The wireless
keyboards are also referred as Cordless keyboards; these keyboards require batteries to
provide the electricity which usually delivered through a PS/2 or USB cable. “AA” or
“AAA” batteries are most widely used standard batteries for wireless keyboards.
Apple Macs are known to revolutionize the wireless keyboard by making them thinner
than the wired ones. These keyboards usually work at 2.4 GHz frequency and come
with a dongle that connects and makes them communicate with the computer.

8. Gaming: As the name suggest, gaming keyboards are those who are into gaming and
need easy access to the keys that are usually utilized in gaming. These keyboards are
composed of particular gaming-oriented features such as key lighting, programmable

5
keys, and/or extra controls of volume and brightness. These keyboards are available in
wired and wireless, in case if wired, it usually supports the USB port.

Keyboard Interfacing

At the lowest level, keyboards are organized in a matrix of rows and columns. The CPU
accesses both rows and columns through ports; therefore, with two 8-bit ports, an 8 x 8
matrix of keys can be connected to a microprocessor. When a key is pressed, a row and a
column make a contact; otherwise, there is no connection between rows and columns. In
IBM PC keyboards, a single microcontroller (consisting of a microprocessor, RAM and
EPROM, and several ports all on a single chip) takes care of hardware and software
interfacing of the keyboard. In such systems, it is the function of programs stored in the
EPROM of the microcontroller to scan the keys continuously, identify which one has been
activated, and present it to the motherboard. In this section we look at the mechanism by
which the 8051 scans and identifies the key.

Figure below shows a 4 x 4 matrix connected to two ports. The rows are connected to an
output port and the columns are connected to an input port. If no key has been pressed,
reading the input port will yield 1 s for all columns since they are all connected to high (Vcc).
If all the rows are grounded and a key is pressed, one of the columns will have 0 since the
key pressed provides the path to ground. It is the function of the microcontroller to scan the
keyboard continuously to detect and identify the key pressed. How it is done is explained
next.

6
To detect a pressed key, the microcontroller grounds all rows by providing 0 to the output
latch, then it reads the columns. If the data read from the columns is D3 – DO = 1111, no key
has been pressed and the process continues until a key press is detected. However, if one of
the column bits has a zero, this means that a key press has occurred. For example, if D3 –
DO = 1101, this means that a key in the Dl column has been pressed. After a key press is
detected, the microcontroller will go through the process of identifying the key. Starting with
the top row, the microcontroller grounds it by providing a low to row DO only; then it reads
the columns. If the data read is all Is, no key in that row is activated and the process is moved
to the next row. It grounds the next row, reads the columns, and checks for any zero. This
process continues until the row is identified.

Interfacing Methods

Interface-1:

1. Outputs 8 bit row code (0FEH, 0FDH etc.,) on port0

2. Interrupts micro-controller when a key is pressed

3. Interrupt software to find which column and key is pressed

7
Interface-2:

• 74C922 is a 16 key encoder that performs keypad

• scanning and de-bouncing

• When key is pressed it outputs a 4 bit code

• When interfaced to micro-controller, it reads the

• code through its port pins

• Has key De-bouncing and key mask features

• It has a data available output that interrupts the

• micro-controller

• Interrupt software to find the key pressed

8
Interface 3:

• The circuit interfaces 64 keys

• It consists of 14051 a 8:1 multiplexer and 74138 a 3:8 decoder

• When a key is pressed 89C51 is interrupted

• The 3 bit input of multiplexer and 3 bit input of the decoder gives the key

code

• which is read in the interrupt routine

9
STUDY OF MAGNETIC DISKS
Description: A memory device, such as a floppy disk, a hard disk, or a removable cartridge,
that is covered with a magnetic coating on which digital information is stored in the form of
microscopically small, magnetized needles.

Like tape, it is magnetically recorded and can be re-recorded over and over. Disks are
rotating platters with a mechanical arm that moves a read/write head between the outer and
inner edges of the platter's surface. It can take as long as one second to find a location on a
floppy disk to as little as a couple of milliseconds on a fast hard disk.

Tracks and Spots : The disk surface is divided into concentric tracks (circles within circles).
The thinner the tracks, the more storage. The data bits are recorded as tiny magnetic spots on
the tracks. The smaller the spot, the more bits per inch and the greater the storage.

Sectors: Tracks are further divided into sectors, which hold a block of data that is read or
written at one time; for example, READ SECTOR 782, WRITE SECTOR 5448. In order to
update the disk, one or more sectors are read into the computer, changed and written back to
disk. The operating system figures out how to fit data into these fixed spaces. Modern disks
have more sectors in the outer tracks than the inner ones because the outer radius of the
platter is greater than the inner radius.

Write Mechanism

 Writes binary data by magnetizing small areas or zones of the disk.


 Current through the coil produces magnetic field.
 Corresponding magnetic pattern is recorded on the surface.
10
Read Mechanism

 It reads data by detecting current pulses induced in a coil.


 Bits could be read back as a time sequence of pulse (one) or no pulse (zero).


Basic geometry:

o 1-5 platters, magnetically coated on each surface

o Platters spin at 5000-15000 RPM

o Actuator arm positions heads, which can read and write data on the magnetic
surfaces.

o Overall size of disk package: 1-8 inches.

 Organization of disk data:

o Circular tracks corresponding to a particular position of the actuator arm.

o Typical density today: 200,000 tracks per radial inch.

o Tracks divided into 512-byte sectors. Typical tracks contain a few thousand
sectors.

o Typical total drive capacities: 100GB-2TB

 100GB ~ 50M double-spaced pages of text.

o Disk technology is one of the most rapidly advancing technologies: capacities


increasing faster than Moore's Law.

 Reading and writing:

o Seek: move actuator arm to position heads over desired track. Typical seek time:
2-10ms.

o Select a particular head.

11
o Rotational latency: wait for desired sector to pass under the head. One-half disk
rotation on average (4ms @ 7500RPM)

o Transfer: read or write one or more sectors as they pass under the head. Typical
transfer rates: 100-150 MBytes/sec.

o Latency refers to the sum of seek time plus rotational latency; typically 5-10ms.

The following magnetic disk technologies are summarized below. Several have been
discontinued, but are often still used long after their official demise. Media tend to be made
for many years thereafter.

12
13
STUDY OF FLOPPY DISKS AND WORKING
A floppy disk, or diskette, is a disk storage medium composed of a disk of thin and flexible
magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that
removes dust particles. They are read and written by a floppy disk drive (FDD).

Floppy disks, initially as 8-inch (200 mm) media and later in 5.25-inch (133 mm) and 3.5-
inch (90 mm) sizes, were a ubiquitous form of data storage and exchange from the mid-
1970s well into the first decade of the 21st century.

By 2010, computer motherboards were rarely manufactured with floppy drive support; 3 1 ⁄2
" floppies could be used as an external USB drive, but 5 1 ⁄4 ", 8 ", and non-standard drives
could only be handled by old equipment. While floppy disk drives still have some limited
uses, especially with legacy industrial computer equipment, they have been superseded by
data storage methods with much greater capacity, such as USB flash drives, portable external
hard disk drives, optical discs, memory cards, and computer networks.

A floppy disk, like a cassette tape, is made from a thin piece of plastic coated with a
magnetic material on both sides. However, it is shaped like a disk rather than a long thin
ribbon. The tracks are arranged in concentric rings so that the software can jump from
"file 1" to "file 19" without having to fast forward through files 2-18. The diskette spins like a
record and the heads move to the correct track, providing what is known as direct access
storage.

Floppy Disk Drive:

The major parts of a FDD include:

14
 Read/Write Heads: Located on both sides of a diskette, they move together on the
same assembly. The heads are not directly opposite each other in an effort to prevent
interaction between write operations on each of the two media surfaces. The same
head is used for reading and writing, while a second, wider head is used for erasing a
track just prior to it being written. This allows the data to be written on a wider "clean
slate," without interfering with the analog data on an adjacent track.

 Drive Motor: A very small spindle motor engages the metal hub at the center of the
diskette, spinning it at either 300 or 360 rotations per minute (RPM).

 Stepper Motor: This motor makes a precise number of stepped revolutions to move
the read/write head assembly to the proper track position. The read/write head
assembly is fastened to the stepper motor shaft.

 Mechanical Frame: A system of levers that opens the little protective window on the
diskette to allow the read/write heads to touch the dual-sided diskette media. An
external button allows the diskette to be ejected, at which point the spring-loaded
protective window on the diskette closes.

 Circuit Board: Contains all of the electronics to handle the data read from or written
to the diskette. It also controls the stepper-motor control circuits used to move the
read/write heads to each track, as well as the movement of the read/write heads toward
the diskette surface.

Writing Data To Floppy Disks

The following is an overview of how a floppy disk drive writes data to a floppy disk.
Reading data is very similar. Here's what happens:

1. The computer program passes an instruction to the computer hardware to write a


data file on a floppy disk, which is very similar to a single platter in a hard disk
drive except that it is spinning much slower, with far less capacity and slower access
time.
2. The computer hardware and the floppy-disk-drive controller start the motor in the
diskette drive to spin the floppy disk. The disk has many concentric tracks on each
side. Each track is divided into smaller segments called sectors, like slices of a pie.
3. A second motor, called a stepper motor, rotates a worm-gear shaft (a miniature
version of the worm gear in a bench-top vise) in minute increments that match the
spacing between tracks. The time it takes to get to the correct track is called "access
time." This stepping action (partial revolutions) of the stepper motor moves the
15
read/write heads like the jaws of a bench-top vise. The floppy-disk-drive electronics
know how many steps the motor has to turn to move the read/write heads to the
correct track.
4. The read/write heads stop at the track. The read head checks the prewritten
address on the formatted diskette to be sure it is using the correct side of the
diskette and is at the proper track. This operation is very similar to the way a record
player automatically goes to a certain groove on a vinyl record.
5. Before the data from the program is written to the diskette, an erase coil (on the
same read/write head assembly) is energized to "clear" a wide, "clean slate" sector
prior to writing the sector data with the write head. The erased sector is wider than
the written sector -- this way, no signals from sectors in adjacent tracks will interfere
with the sector in the track being written.
6. The energized write head puts data on the diskette by magnetizing minute, iron,
bar-magnet particles embedded in the diskette surface, very similar to the
technology used in the mag stripe on the back of a credit card. The magnetized
particles have their north and south poles oriented in such a way that their pattern
may be detected and read on a subsequent read operation.
7. The diskette stops spinning. The floppy disk drive waits for the next command.

The Read operation is performed in a similar way.

Floppy Disk Controller: A floppy-disk controller (FDC) is a special-purpose chip and


associated disk controller circuitry that directs and controls reading from and writing to a
computer's floppy disk drive (FDD).

Overview: A single floppy-disk controller (FDC) board can support up to four floppy disk
drives. The controller is linked to the system bus of the computer and appears as a set of I/O
ports to the CPU. It is often also connected to a channel of the DMA controller. On the x86
PC the floppy controller uses IRQ 6, on other systems other interrupt schemes may be used.
The floppy disk controller usually performs data transmission in direct memory access
(DMA) mode.

The diagram below shows a floppy disk controller which communicates with the CPU via an
Industry Standard Architecture (ISA) bus. An alternative arrangement which is more usual in
recent designs has the FDC included in a super I/O chip which communicates via a Low Pin
Count (LPC) bus.

16
Floppy disk controller functions (FDC)

 Translate data bits into MFM or GCR format to be able to record them
 Interpret and execute commands such as seek, read, write, format, etc.
 Error detection with checksums generation and verification, like CRC
 Synchronize data with phase-locked loop (PLL)

FC5025

The FC5025 is a floppy disk controller card. This card operates the floppy disk drive of a
system. Older systems frequently have these controllers onboard at manufacture; however
for modern systems this is typically not the case, as floppy disk media has become obsolete.
The FC5025 is not the only modern floppy disk controller card oriented toward recovery of
materials on legacy floppy disk media, other products in this niche include the Catweasel and
Kryoflux.

17
Connections: There are two connections on the FC5025. The first is a Type B 4-pin USB
port . You can use a USB cable to connect the FC5025 to a USB port on a modern system.

The USB port most common on systems today is a Type A USB port, also 4- pin, but
rectangular in shape. Therefore the USB cable for this job will likely need Type B and Type
A connections. Many printers have Type B USB connections, so a printer cable may fit the
description.

Jumpering: Assuming the FC5025 is now connected to the USB port of a system and to a
5.25" floppy disk drive through a ribbon cable, you can check the jumper settings on the
floppy disk drive. Jumpers are electrical conductors that can alter the operation logic of a
circuit board by applying jumper shunts over the jumper pins. Jumper pins are closed if the
shunt is applied over them, they are open if there is no shunt on them. Jumper pins are
usually coupled in pairs called heads. Heads are labeled D1, IU, U0, etc., on the circuit board
itself. Thus, a "D1 closed" instruction indicates one should apply the jumper shunt to the two
pins by the label D1.

The FC5025 is compatible with TEAC FD-55GFR floppy drives and equivalent models
(listed below), but we have seen the device work with a variety of drives, including Chinon
and Canon drives. If you have a TEAC drive, follow these jumper setting instructions. If you
do not, test the device with the floppy drive as is. If there are read problems, consider trying
to match the jumper settings to the ones described here for TEAC drives.

Powering: Once the jumpers have been set you now need a power supply for the floppy disk
drive if it is not already powered by a computer system. If it is not powered by the power
cable from a system, an external power supply, such as a hard drive sled, can be used to
power the drive. Note that you must power the computer system to which the floppy drive is
attached for it to be powered.

18
STUDY OF HARDDISK AND WORKING
A hard disk drive (HDD) [note 2] is a data storage device used for storing and retrieving
digital information using rapidly rotating discs (platters) coated with magnetic material. An
HDD retains its data even when powered off. Data is read in a random-access manner,
meaning individual blocks of data can be stored or retrieved in any order rather than just
sequentially. An HDD consists of one or more rigid ("hard") rapidly rotating discs (platters)
with magnetic heads arranged on a moving actuator arm to read and write data to the
surfaces. Introduced by IBM in 1956,[1] HDDs became the dominant secondary storage
device for general purpose computers by the early 1960s. Continuously improved, HDDs
have maintained this position into the modern era of servers and PCs. More than 200
companies have produced HDD units, though most current units are manufactured by
Seagate, Toshiba and Western Digital. Worldwide revenues for HDDs shipments are
expected to reach $38 billion in 2012, up about 19% from $32 billion in 2011.

The primary characteristics of an HDD are its capacity and performance. Capacity is
specified in unit prefixescorresponding to powers of 1000: a 1- terabyte (TB) drive has a
capacity of 1,000 gigabytes (GB; where 1 gigabyte = 1 billion bytes). Typically, some of an
HDD's capacity is unavailable to the user due to use by the file system and the computer
operating system, and possibly inbuilt redundancy for error correction and recovery.
Performance is specified by the time to move the heads to a file (Average Access Time) plus
the time it takes for the file to move under its head (average latency, a function of the
physical rotational speed in revolutions per minute) and the speed at which the file is
transmitted (data rate).

The two most common form factors for modern HDDs are 3.5-inch in desktop computers
and 2.5-inch in laptops. HDDs are connected to systems by standard interface cables such as
SATA (Serial ATA), USB or SAS (Serial attached SCSI) cables.

As of 2012, the primary competing technology for secondary storage is flash memory in the
form ofsolid-state drives (SSDs). HDDs are expected to remain the dominant medium for
secondary storage due to predicted continuing advantages in recording capacity and price per
unit of storage,[2][3] but solid state drives are replacing rotating hard drives especially in
portable electronics where physical size and durability are more important considerations
than price and capacity.

Components Of Hard Disk

The hard drive, which typically provides storage for data and applications within a computer,
has four key components inside its casing -- the platter (for storing data), the spindle (for
19
spinning the platters), the read/write arm (for reading and writing data) and the actuator (for
controlling the actions of the read/write arm). Only the most technically proficient IT
professionals should attempt to work on the components inside a hard drive.

Platters: The platters are the circular discs inside the hard drive where the 1s and 0s that
make up your files are stored. Platters are made out of aluminum, glass or ceramic and have
a magnetic surface in order to permanently store data. On larger hard drives, several platters
are used to increase the overall capacity of the drive. Data is stored on the platters in tracks,
sectors and cylinders to keep it organized and easier to find.

The Spindle: The spindle keeps the platters in position and rotates them as required. The
revolutions-per-minute rating determines how fast data can be written to and read from the
hard drive. A typical internal desktop drive runs at 7,200 RPM, though faster and slower
speeds are available. The spindle keeps the platters at a fixed distance apart from each other
to enable the read/write arm to gain access.

The Read/Write Arm: The read/write arm controls the movement of the read/write heads,
which do the actual reading and writing on the disk platters by converting the magnetic
surface into an electric current. The arm makes sure the heads are in the right position based
on the data that needs to be accessed or written; it's also known as the head arm or actuator
arm. There is typically one read/write head for every platter side, which floats 3 to 20
millionths of an inch above the platter surface.

Actuator: The actuator or head actuator is a small motor that takes instructions from the
drive's circuit board to control the movement of the read/write arm and supervise the transfer
of data to and from the platters. It's responsible for ensuring the read/write heads are in
exactly the right place at all times.

Other Components: As well as the casing on the outside of the hard disk that holds all of
the components together, the front-end circuit board controls input and output signals in
tandem with the ports at the end of the drive. No matter what the type of drive, it has one
port for a power supply and one port for transferring data and instructions to and from the
rest of the system.

20
The platters in contemporary HDDs are spun at speeds varying from 4,200 rpm in energy-
efficient portable devices, to 15,000 rpm for high performance servers. The first HDDs spun
at 1,200 rpm and, for many years, 3,600 rpm was the norm. Today, most consumer HDDs
operate at a speed of 7,200 rpm.

Performance Characteristics

Time to access data: The factors that limit the time to access the data on an HDD are
mostly related to the mechanical nature of the rotating disks and moving heads. Seek time is
a measure of how long it takes the head assembly to travel to the track of the disk that
contains data. Average seek time ranges from 3 ms for high-end server drives, to 15 ms for
mobile drives, with the most common mobile drives at about 12 ms and the most common
desktop type typically being around 9 ms.

Rotational latency is incurred because the desired disk sector may not be directly under the
head when data transfer is requested. These two delays are on the order of milliseconds each.
The bit rate or data transfer rate (once the head is in the right position) creates delay which is
a function of the number of blocks transferred; typically relatively small, but can be quite
long with the transfer of large contiguous files. Delay may also occur if the drive disks are
stopped to save energy.

An HDD's Average Access Time is its average Seek time which technically is the time to do
all possible seeks divided by the number of all possible seeks, but in practice is determined
by statistical methods or simply approximated as the time of a seek over one-third of the
number of tracks

21
Latency: Latency is the delay for the rotation of the disk to bring the required disk sector
under the read-write mechanism. It depends on rotational speed of a disk, measured in
revolutions per minute (rpm).

Date transfer rate: HDD data transfer rate depends upon the rotational speed of the platters
and the data recording density. Because heat and vibration limit rotational speed, advancing
density becomes the main method to improve sequential transfer rates.

Interfacing

Modern HDDs present a consistent interface to the rest of the computer, no matter what data
encoding scheme is used internally. Typically a DSP in the electronics inside the HDD takes
the raw analog voltages from the read head and uses PRML and Reed–Solomon error
correction[94] to decode the sector boundaries and sector data, then sends that data out the
standard interface. That DSP also watches the error rate detected by error detection and
correction, and performs bad sector remapping, data collection for Self-Monitoring,
Analysis, and Reporting Technology, and other internal tasks.

Modern interfaces connect an HDD to a host bus interface adapter (today typically integrated
into the "south bridge") with one data/control cable. Each drive also has an additional power
cable, usually direct to the power supply unit.

 Small Computer System Interface (SCSI), originally named SASI for Shugart
Associates System Interface, was standard on servers, workstations, Commodore
Amiga, Atari ST and Apple Macintosh computers through the mid-1990s, by which
time most models had been transitioned to IDE (and later, SATA) family disks. The
range limitations of the data cable allows for external SCSI devices.
 Integrated Drive Electronics (IDE), later standardized under the name AT Attachment
(ATA, with the alias P-ATA or PATA (Parallel ATA) retroactively added upon
introduction of SATA) moved the HDD controller from the interface card to the disk
drive. This helped to standardize the host/contoller interface, reduce the programming
complexity in the host device driver, and reduced system cost and complexity. The 40-
pin IDE/ATA connection transfers 16 bits of data at a time on the data cable. The data
cable was originally 40-conductor, but later higher speed requirements for data
transfer to and from the HDD led to an "ultra DMA" mode, known as UDMA.
Progressively swifter versions of this standard ultimately added the requirement for an
80-conductor variant of the same cable, where half of the conductors provides
grounding necessary for enhanced high-speed signal quality by reducing cross talk.
 EIDE was an unofficial update (by Western Digital) to the original IDE standard, with
the key improvement being the use of direct memory access (DMA) to transfer data
22
between the disk and the computer without the involvement of the CPU, an
improvement later adopted by the official ATA standards. By directly transferring data
between memory and disk, DMA eliminates the need for the CPU to copy byte per
byte, therefore allowing it to process other tasks while the data transfer occurs.
 Fibre Channel (FC) is a successor to parallel SCSI interface on enterprise market. It is
a serial protocol. In disk drives usually the Fibre Channel Arbitrated Loop (FC-AL)
connection topology is used. FC has much broader usage than mere disk interfaces,
and it is the cornerstone of storage area networks (SANs). Recently other protocols for
this field, like iSCSI and ATA over Ethernet have been developed as well.
Confusingly, drives usually use copper twisted-pair cables for Fibre Channel, not fibre
optics. The latter are traditionally reserved for larger devices, such as servers or disk
array controllers.
 Serial Attached SCSI (SAS). The SAS is a new generation serial communication
protocol for devices designed to allow for much higher speed data transfers and is
compatible with SATA. SAS uses a mechanically identical data and power connector
to standard 3.5-inch SATA1/SATA2 HDDs, and many server-oriented SAS RAID
controllers are also capable of addressing SATA HDDs. SAS uses serial
communication instead of the parallel method found in traditional SCSI devices but
still uses SCSI commands
 Serial ATA (SATA). The SATA data cable has one data pair for differential
transmission of data to the device, and one pair for differential receiving from the
device, just like EIA-422. That requires that data be transmitted serially. A similar
differential signaling system is used in RS485,LocalTalk, USB, FireWire, and
differential SCSI.

Working Of Hard Disk Drive

Data on a hard disk is stored in microscopic areas called magnetic domains on the magnetic
material. Each domain stores either a 1 or 0 value. Similar to a floppy disk, a hard disk
records its data in concentric circles or tracks, which are numbered from the outermost edge
to the innermost edge of the platter. These tracks are further subdivided into smaller units
called sectors which typically store 512 bytes of data each. Zoning may be needed to further
optimise the data storage as the outer circumference would normally pack more sector units
than the inner circumference.

Read Write Head: The RW head is the key component that performs the reading and
writing functions. It is placed on a slider which is in term connected to an actuator arm which
allow the RW head to access various parts of the platter during data IO functions by sliding
across the spinning platter. The sliding motion is derived by passing a current through the
23
coil which is part of the actuator-assembly. As the coil is placed between two magnets, the
forward or backward sliding motion is hence derived by simple current reversal. This
location of the platter (just like the landmark along the road) is identified and made possible
by the embedded servo code written on the platter.

Parking of RW Head: When the computer is switched off, the head is usually pulled to a
safe parking zone to prevent the head from scratching against the data zone on platter when
the air bearing subsides. This process is called a parking and different techniques have been
implemented in various hard disks to handle the take offs and landings. In a Ramp
load/unload design, a lifting mechanism parks the head outside of the platter onto a "parking
bay" prior to a shutdown. It then automatically unparks and relocates itself above the disk
platter when the platter spins up to appropriate rotational speed.

Hard Disk Controller PCB Board: A hard disk also contains a pcb controller circuit board
that regulates data traffic. It ensures massive data to be streamed in and out of the disk
smoothly. A logic board that sits under the drive controls and connects the spindle, head
actuator, and various disk functions of the disk. Embedded with a micro-controller, it
executes self-diagnostics test and cleans up data working area in the memory and all internal
chip bus in the hard drive when it powers up.

Read Write Function Of Disk: As the head writes data onto the disk, it changes its
magnetic polarization to induce either a one or zero value. During a read request, data is
interpreted when the magnetic fields on the platter brings about an electrical change (as a
result of change in electrical resistance of some special material property) in the read-head
that passes over it. These electrical fields are then encoded and transmitted to the CPU to be
processed and read by the system.
24
STUDY OF PRINTER
In computing, a printer is a peripheral device which makes a persistent human-readable
representation of graphics or text on paper. The first computer printer designed was a
mechanically driven apparatus by Charles Babbage for his difference engine in the 19th
century; however, his mechanical printer design was not built until 2000.The first electronic
printer was the EP-101, invented by Japanese company Epson and released in 1968. The first
commercial printers generally used mechanisms from electric typewriters and Teletype
machines. The demand for higher speed led to the development of new systems specifically
for computer use. In the 1980s were daisy wheel systems similar to typewriters, line printers
that produced similar output but at much higher speed, and dot matrix systems that could mix
text and graphics but produced relatively low-quality output. The plotter was used for those
requiring high quality line art like blueprints.

Types Of Printers

Personal printers are primarily designed to support individual users, and may be connected to
only a single computer. These printers are designed for low-volume, short-turnaround print
jobs, requiring minimal setup time to produce a hard copy of a given document. However,
they are generally slow devices ranging from 6 to around 25 pages per minute (ppm), and the
cost per page is relatively high. However, this is offset by the on-demand convenience. Some
printers can print documents stored on memory cards or from digital cameras and scanners.

Networked or shared printers are "designed for high-volume, high-speed printing". They are
usually shared by many users on a network and can print at speeds of 45 to around 100
ppm.[6] The Xerox 9700 could achieve 120 ppm.

A virtual printer is a piece of computer software whose user interface and API resembles that
of a printer driver, but which is not connected with a physical computer printer. A virtual
printer can be used to create a file which is an image of the data which would be printed, for
archival purposes or as input to another program, for example to create a PDF or to transmit
to another system or user.

A 3D printer is a device for making a three-dimensional object from a 3D model or other


electronic data source through additive processes in which successive layers of material
(including plastics, metals, food, cement, wood, and other materials) are laid down under
computer control. It is called a printer by analogy with an inkjet printer which produces a
two-dimensional document by a similar process of depositing a layer of ink on paper.

25
Technologies

The choice of print technology has a great effect on the cost of the printer and cost of
operation, speed, quality and permanence of documents, and noise. Some printer
technologies do not work with certain types of physical media, such as carbon paper or
transparencies.

A second aspect of printer technology that is often forgotten is resistance to alteration: liquid
ink, such as from an inkjet head or fabric ribbon, becomes absorbed by the paper fibers, so
documents printed with liquid ink are more difficult to alter than documents printed with
toner or solid inks, which do not penetrate below the paper surface.

Toner-based Printers: A laser printer rapidly produces high quality text and graphics. As
with digital photocopiers and multifunction printers (MFPs), laser printers employ a
xerographic printing process but differ from analog photocopiers in that the image is
produced by the direct scanning of a laser beam across the printer's photoreceptor.

Another toner-based printer is the LED printer which uses an array of LEDs instead of a
laser to cause toner adhesion to the print drum.

Liquid inkjet printers: Inkjet printers operate by propelling variably sized droplets of liquid
ink onto almost any sized page. They are the most common type of computer printer used by
consumers.

Solid ink Printers: Solid ink printers, also known as phase-change printers, are a type of
thermal transfer printer. They use solid sticks of CMYK-coloured ink, similar in consistency
to candle wax, which are melted and fed into a piezo crystal operated print-head. The
printhead sprays the ink on a rotating, oil coated drum. The paper then passes over the print
drum, at which time the image is immediately transferred, or transfixed, to the page. Solid
ink printers are most commonly used as colour office printers, and are excellent at printing
on transparencies and other non-porous media. Solid ink printers can produce excellent
results. Acquisition and operating costs are similar to laser printers. Drawbacks of the
technology include high energy consumption and long warm-up times from a cold state.
Also, some users complain that the resulting prints are difficult to write on, as the wax tends
to repel inks from pens, and are difficult to feed through automatic document feeders, but
these traits have been significantly reduced in later models. In addition, this type of printer is
only available from one manufacturer, Xerox, manufactured as part of their Xerox Phaser
office printer line. Previously, solid ink printers were manufactured by Tektronix, but Tek
sold the printing business to Xerox in 2001.

26
Dye-Sublimation Printers: A dye-sublimation printer (or dye-sub printer) is a printer which
employs a printing process that uses heat to transfer dye to a medium such as a plastic card,
paper or canvas. The process is usually to lay one colour at a time using a ribbon that has
colour panels. Dye-sub printers are intended primarily for high-quality colour applications,
including colour photography; and are less well-suited for text. While once the province of
high-end print shops, dye-sublimation printers are now increasingly used as dedicated
consumer photo printers.

Laser Printing

Laser printing is an electrostatic digital printing process. It produces high-quality text and
graphics (and moderate-quality photographs) by repeatedly passing a laser beam back and
forth over a negatively charged cylinder called a "drum" to define a differentially charged
image. The drum then selectively collects electrically charged powdered ink (toner), and
transfers the image to paper, which is then heated in order to permanently fuse the text,
imagery, or both. As with digital photocopiers, laser printers employ a xerographic printing
process. However, laser printing differs from analog photocopiers in that the image is
produced by the direct scanning of the medium across the printer's photoreceptor. This
enables laser printing to copy images more quickly than most photocopiers.

Printing Process: A laser beam (typically, an aluminium gallium arsenide (AlGaAs)


semiconductor laser) projects an image of the page to be printed onto an electrically charged,
selenium-coated, rotating, cylindrical drum (or, more commonly in subsequent versions, a
drum called an organic photoconductor made of N-vinylcarbazole, an organic monomer).
Photoconductivity allows the charged electrons to fall away from the areas exposed to light.
Powdered ink (toner) particles are then electrostatically attracted to the charged areas of the
drum that have not been laser-beamed. The drum then transfers the image onto paper (which
is passed through the machine) by direct contact. Finally the paper is passed onto a finisher,
which uses heat to instantly fuse the toner that represents the image onto the paper.

There are seven steps involved in the process.

Raster Image Processing: The document to be printed is encoded in a page description


language such as PostScript, Printer Command Language (PCL), or Open XML Paper
Specification (OpenXPS). The raster image processor converts the page description into a
bitmap which is stored in the printer's raster memory. Each horizontal strip of dots across the
page is known as a raster line or scan line.
27
Laser printing differs from other printing technologies in that each page is always rendered
in a single continuous process without any pausing in the middle, while other technologies
like inkjet can pause every few lines. To avoid a buffer underrun (where the laser reaches a
point on the page before it has the dots to draw there), a laser printer typically needs enough
raster memory to hold the bitmap image of an entire page.

Charging: In older printers, a corona wire positioned parallel to the drum or, in more recent
printers, a primary charge roller, projects an electrostatic charge onto the photoreceptor
(otherwise named the photo conductor unit), a revolving photosensitive drum or belt, which
is capable of holding an electrostatic charge on its surface while it is in the dark.

An AC bias voltage is applied to the primary charge roller to remove any residual charges
left by previous images. The roller will also apply a DC bias on the drum surface to ensure a
uniform negative potential.

Exposing: A laser printer uses a laser because lasers are able to form highly focused,
precise, and intense beams of light, especially over the short distances inside of a printer. The
laser is aimed at a rotating polygonal mirror which directs the light beam through a system of
lenses and mirrors onto the photoreceptor drum, writing pixels at rates up to sixty five
million times per second. The drum continues to rotate during the sweep, and the angle of
sweep is canted very slightly to compensate for this motion. The stream of rasterized data
held in the printer's memory rapidly turns the laser on and off as it sweeps.

The laser beam neutralizes (or reverses) the charge on the surface of the drum, leaving a
static electric negative image on the drum's surface which will repel the negatively charged
toner particles. The areas on the drum which were struck by the laser, however, momentarily
have no charge, and the toner being pressed against the drum by the toner-coated developer
roll in the next step moves from the roll's rubber surface to the charged portions of the
surface of the drum

Developing: As the drums rotate, toner is continuously applied in a 15-micron-thick layer to


the developer roll. The surface of the photoreceptor with the latent image is exposed to the
toner-covered developer roll.

Toner consists of fine particles of dry plastic powder mixed with carbon black or coloring
agents. The toner particles are given a negative charge inside the toner cartridge, and as they
emerge onto the developer drum they are electrostatically attracted to the photoreceptor's
latent image (the areas on the surface of the drum which had been struck by the laser).
Because negative charges repel each other, the negatively charged toner particles will not
28
adhere to the drum where the negative charge (imparted previously by the charge roller)
remains.

Transferring: A sheet of paper is then rolled under the photoreceptor drum, which has been
coated with a pattern of toner particles in the exact places where the laser struck it moments
before. The toner particles have a very weak attraction to both the drum and the paper, but
the bond to the drum is weaker and the particles transfer once again, this time from the
drum's surface to the paper's surface.

Fusing: The paper passes through rollers in the fuser assembly, where temperatures up to
427 °C (801 °F) and pressure are used to permanently bond the toner to the paper. One roller
is usually a hollow tube (heat roller) and the other is a rubber backed roller (pressure roller).
A radiant heat lamp is suspended in the centre of the hollow tube, and its infrared energy
uniformly heats the roller from the inside. For proper bonding of the toner, the fuser roller
must be uniformly hot.

Dot Matrix Printer

Dot matrix printing, sometimes called impact matrix printing, is the process of computer
printing from a collection of dot matrix data to a device, which can be one of:

 Impact dot matrix printers


 non-impact dot matrix printers, such as inkjet, thermal, or laser printers.

Impact dot matrix printing uses a print head that moves back-and-forth, or in an up-and-
down motion, on the page and prints by impact, striking an ink-soaked cloth ribbon against
the paper, much like the print mechanism on a typewriter. However, unlike a typewriter or
daisy wheel printer, letters are drawn out of a dot matrix, and thus, varied fonts and arbitrary
graphics can be produced.

These printers can print on multi-part (carbon or carbonless paper) forms since they print
using mechanical pressure.

The alternative to dot matrix printing is sometimes known as a letter-quality printer or a line
printer which use fully formed type elements that impact a sheet of paper.

Design: Each dot is produced by a tiny metal rod, also called a "wire" or "pin", which is
driven forward by the power of a tiny electromagnet or solenoid, either directly or through
small levers (pawls). Facing the ribbon and the paper is a small guide plate named ribbon
mask holder or protector, sometimes also called butterfly for its typical shape. It is pierced
with holes to serve as guides for the pins. The plate may be made of hard plastic or an
artificial jewel such as sapphire or ruby.
29
PROGRAMS
Write a program for Mouse Handling
#include<graphics.h>

#include<stdio.h>

#include<conio.h>

#include<dos.h>

union REGS in,out;

int callmouse()

in.x.ax=1;

int86(51,&in,&out);

return 1;

void mouseposi(int &xpos,int &ypos,int &click)

in.x.ax=3;

int86(51,&in,&out);

click=out.x.bx;

xpos=out.x.cx;

ypos=out.x.dx;

int mousehide()

in.x.ax=2;

int86(51,&in,&out);

return 1;
}

void setposi(int &xpos,int &ypos)


30
{

in.x.ax=4;

in.x.cx=xpos;

in.x.dx=ypos;

int86(51,&in,&out);

int main()

int x,y,cl,a,b;

clrscr();

int g=DETECT,m;

initgraph(&g,&m,"c:\tc\bgi");

a=100;

b=400;

setposi(a,b);

callmouse();

do

mouseposi(x,y,cl);

gotoxy(10,9);

printf("\n\tMouse Position is: %d,%d",x,y);

printf("\n\tClick: %d",cl);

printf("\n\tPress any key to hide the mouse");

}while(!kbhit());

getch();

mousehide();

printf("\n\n\tPress any key to Exit");

getch();

31
OUTPUT

32
Interrupt Service Codes
Interrupt Service Purpose
Reset mouse and get status
Call with AX=0
Returns: AX = FFFFH if
51 0
mouse support is available
AX = 0 If mouse support is
not available
Show Mouse Pointer
51 1 Call with AX=1
Returns: Nothing
Hide Mouse Pointer
51 2 Call with AX = 2
Returns: Nothing
Get mouse position and
button status
Call with AX=3
Returns: BX = Mouse button
status
Bit-Significance
51 3
0-button not pressed
1-left button is pressed
2-right button is pressed
3-center button is pressed
CX = x coordinate
DX = y coordinate
Set mouse pointer position
Call with AX = 4
51 4
CX = x coordinate
DX = y coordinate
Set Horizontal limits for
pointer
Call with AX = 7
51 7
CX = minimum x coordinate
DX = maximum x coordinate
Returns: Nothing
Set Vertical limits for pointer
Call with AX =8
51 8 CX = minimum y coordinate
DX = maximum y coordinate
Returns: Nothing

33
Write a Program for Keyboard Manipulation
# include <stdio.h>

# include <conio.h>

# include <dos.h>

int main( )

int iCount=15;

int iMaxValue=128;

unsigned char far* ptrKeyboard=(unsigned char far*)0x00400017;

clrscr( );

printf("\nKeyboard Status Byte (Hex) = %X",*ptrKeyboard);

printf("\nKeyboard Status Byte (Binary) = ");

for(iCount=7;iCount>=0;iCount--)

if(iCount==3)

printf(" ");

if((*ptrKeyboard&iMaxValue)==iMaxValue)

printf("1");

else

printf("0");

iMaxValue/=2;

34
}

printf("\n\nWhere:");

printf("\n Bit 7 Insert");

printf("\n Bit 6 Caps Lock");

printf("\n Bit 5 Num Lock");

printf("\n Bit 4 Scroll Lock");

printf("\n Bit 3 Alt Key");

printf("\n Bit 2 Ctrl Key");

printf("\n Bit 1 Left Shift");

printf("\n Bit 0 Right Shift");

getch( );

return 0;

OUTPUT

35

You might also like