You are on page 1of 48

What is Computer?

A computer is a programmable electronic device that accepts raw data as


input and processes it with a set of instructions (a program) to produce the result as output. It
renders output just after performing mathematical and logical operations and can save the
output for future use. It can process numerical as well as non-numerical calculations. The term
"computer" is derived from the Latin word "computare" which means to calculate. It is believed
that the Analytical Engine was the first computer which was invented by Charles Babbage in
1837. It used punch cards as read-only memory. Charles Babbage is also known as the father
of the computer.

The basic parts without which a computer cannot work are as follows:

 Processor: It executes instructions from software and hardware.


 Memory: It is the primary memory for data transfer between the CPU and storage.
 Motherboard: It is the part that connects all other parts or components of a computer. 
Storage Device: It permanently stores the data, e.g., hard drive.
 Input Device: It allows you to communicate with the computer or to input data, e.g., a
keyboard.
 Output Device: It enables you to see the output, e.g., monitor.

Characteristics of Computer
• Speed: - A computer works with much higher speed and accuracy compared to humans
while performing mathematical calculations. Computers can process millions (1,000,000)
of instructions per second. The time taken by computers for their operations is microseconds
and nanoseconds.

• Accuracy: - Computers perform calculations with 100% accuracy. Errors may occur due to
data inconsistency or inaccuracy.
• Diligence: - A computer can perform millions of tasks or calculations with the same
consistency and accuracy. It doesn’t feel any fatigue or lack of concentration. Its memory
also makes it superior to that of human beings.
• Versatility: - Versatility refers to the capability of a computer to perform different kinds of
works with same accuracy and efficiency.
• Reliability: - A computer is reliable as it gives consistent result for similar set of data
i.e., if we give same set of input any number of times, we will get the same result.
• Automation:-Computer performs all the tasks automatically i.e. it performs tasks without
manual intervention.
• Memory: - A computer has built-in memory called primary memory where it stores data.
Secondary storage are removable devices such as CDs, pen drives, etc., which are also used
to store data.

Benefits of Using a Computer:

Increases your productivity: A computer increases your productivity. For example,


after having a basic understanding of a word processor, you can create, edit, store, and
print the documents easily and quickly.

Connects to the Internet: It connects you to the internet that allows you to send emails,
browse content, gain information, use social media platforms, and more. By connecting
to the internet, you can also connect to your long-distance friends and family members.
Storage: A computer allows you to store a large amount of information, e.g., you can
store your projects, ebooks, documents, movies, pictures, songs, and more.
Organized Data and Information: It not only allows you to store data but also enables
you to organize your data. For example, you can create different folders to store
different data and information and thus can search for information easily and quickly.
Improves your abilities: It helps write good English if you are not good at spelling and
grammar. Similarly, if you are not good at math, and don't have a great memory, you
can use a computer to perform calculations and store the results.
Assist the physically challenged: It can be used to help the physically challenged, e.g.,
Stephen Hawking, who was not able to speak used computer to speak. It also can be
used to help blind people by installing special software to read what is on the screen.
Keeps you entertained: You can use the computer to listen to songs, watch movies,
play games and more.
Von Neumann Architecture
Historically there have been 2 types of Computers:

1. Fixed Program Computers – Their function is very specific and they couldn’t be programmed, e.g.
Calculators.
2. Stored Program Computers – These can be programmed to carry out many different tasks, applications
are stored on them, hence the name.
The modern computers are based on a stored-program concept introduced by John Von Neumann. In this
stored-program concept, programs and data are stored in a separate storage unit called memories and are
treated the same.

Components of Von-Neumann Model:

Central Processing Unit

The part of the Computer that performs the bulk of data processing operations is called the Central Processing
Unit and is referred to as the CPU. The Central Processing Unit can also be defined as an electric circuit
responsible for executing the instructions of a computer program. The CPU performs a variety of functions
dictated by the type of instructions that are incorporated in the computer.

The major components of CPU are Arithmetic and Logic Unit (ALU), Control Unit (CU) and a variety of
registers.

Arithmetic and Logic Unit (ALU)

The Arithmetic and Logic Unit (ALU) performs the required micro-operations for executing the instructions.
In simple words, ALU allows arithmetic (add, subtract, etc.) and logic (AND, OR, NOT, etc.) operations to
be carried out.

Control Unit

The Control Unit of a computer system controls the operations of components like ALU, memory and
input/output devices. The Control Unit consists of a program counter that contains the address of the
instructions to be fetched and an instruction register into which instructions are fetched from memory for
execution.
Input/Output Devices

Program or data is read into main memory from the input device or secondary storage under the control of
CPU input instruction. Output devices are used to output the information from a computer. If some results
are evaluated by computer and it is stored in the computer, then with the help of output devices, we can
present it to the user.

Registers

Registers refer to high-speed storage areas in the CPU. The data processed by the CPU are fetched from the
registers.

Following is the list of registers that plays a crucial role in data processing.

Registers Description

MAR (Memory Address This register holds the memory location of


Register) the data that needs to be accessed.

MDR (Memory Data This register holds the data that is being
Register) transferred to or from memory.

AC (Accumulator)

This register holds the intermediate


arithmetic and logic results.

PC (Program Counter)

This register contains the address of the next


instruction to be executed.
CIR (Current Instruction This register contains the current instruction
Register) during processing.

Buses

Buses are the means by which information is shared between the registers in a multiple-register configuration
system.
A bus structure consists of a set of common lines, one for each bit of a register, through which binary
information is transferred one at a time. Control signals determine which register is selected by the bus during
each particular register transfer.

Von-Neumann Architecture comprised of three major bus systems for data transfer.

Bus Description

Address Address Bus carries the address of data (but not the
Bus data) between the processor and the memory.

Data Bus

Data Bus carries data between the processor, the


memory unit and the input/output devices.

Control Bus carries signals/commands from the CPU.

Control
Bus

Memory Unit

A memory unit is a collection of storage cells together with associated circuits needed to transfer information
in and out of the storage. The memory stores binary information in groups of bits called words. The internal
structure of a memory unit is specified by the number of words it contains and the number of bits in each
word.
Two major types of memories are used in computer systems:

1. RAM (Random Access Memory)


2. ROM (Read-Only Memory)

Inside a Computer

SMPS

SMPS stands for Switched-Mode Power Supply. It is an electronic power supply that uses a switching
regulator to convert electrical power efficiently. It is also known as Switching Mode Power Supply. It is
power supply unit (PSU) generally used in computers to convert the voltage into the computer
acceptable range.
This device has the power handling electronic components that converts electrical power efficiently.
Switched Mode Power Supply uses a great power conversion technique to reduce overall power loss.

The most common application of an SMPS is the power supply unit of a computer. Switching Mode Power
Supply (SMPS) has become a standard type of power supply unit for electronic devices because of their high
efficiency, low cost and high power density.

SMPS is a type of regulated power supply that uses a high frequency switching regulator to convert the power
supply and also regulate the output in a highly efficient way. Motherboard

The motherboard is the computer's main circuit board. It's a thin plate that holds the CPU,
memory, connectors for the hard drive and optical drives, expansion cards to control the video and audio,
and connections to your computer's ports (such as USB ports). The motherboard connects directly or
indirectly to every part of the computer.

There are multiple types of motherboards, designed to fit different types and sizes of computers. Each type
of motherboard is designed to work with specific types of processors and memory, so they don’t work with
every processor and type of memory. However, hard drives are mostly universal and work with the majority
of motherboards, regardless of the type or brand.
BIOS

Short for Basic Input/Output System, the BIOS (pronounced bye-oss) is a ROM chip found on motherboards
that allows you to access and set up your computer system at the most basic level.

The picture below is an example of what a BIOS chip may look like on a computer motherboard. The BIOS
pictured is of an early AMIBIOS, a type of BIOS manufactured by AMI.

What is included in a BIOS?


The BIOS includes instructions on how to load basic computer hardware. It also includes a test referred to as
a POST (Power-On Self-Test) that helps verify the computer meets requirements to boot up properly. If the
computer does not pass the POST, you hear a combination of beeps indicating what is malfunctioning in the
computer.
CMOS

The term CMOS stands for “Complementary Metal Oxide Semiconductor”. This is one of the most
popular technology in the computer chip design industry and it is broadly used today to form integrated
circuits in numerous and varied applications. Today’s computer memories, CPUs, and cell phones make use
of this technology due to several key advantages.

CMOS is an integrated circuit designed on a printed circuit board (PCB), widely used type of semiconductor
used in transistors. It is a battery powered memory chip that simply stores the startup information and BIOS
uses this information to turn on your computer i.e. during the boot up process.

The "MOS" in CMOS refers to the transistors in a CMOS component, called MOSFETs (metal oxide
semiconductor field-effect transistors). The "metal" part of the name is a bit misleading, as modern MOSFETs
often use polysilicon instead of aluminum as the conductive material. Each MOSFET includes two terminals
("source" and "drain") and a gate, which is insulated from the body of the transistor. When enough voltage is
applied between the gate and body, electrons can flow between the source and drain terminals.

Complementary term refers to the charged used which is either positive (PMOS) or negative (NMOS). CMOS
uses only one charge at a time. Due to this, CMOS consumes less power because charges can stay in one state
for a longer period of time and hence consume energy only when needed. CMOS based transistors do not
heat up and gives a high speed. CMOS batteries are made up of Lithium material that can last up to 10 years.

CMOS Advantages

CMOS transistors are known for their efficient use of electrical power. They require no electrical current
except when they are changing from one state to another. Additionally, the complimentary semiconductors
work together to limit the output voltage. The result is a low-power design that gives off minimal heat.

Ports and Interfaces

A place where data can pass into out of a central processing unit, computer or peripheral is called
port.

A special piece of circuitry that is fitted inside a computer and sits between the computer and the
port is called interface. The purpose of an interface is to provide a compatible connection between computer
and port where the peripheral device is connected.
Types of Interfaces

There are two types of interfaces, they are:

• Serial Interface
• Parallel interface

Serial interface: - It is an interface which transfers one bit of data at a time. In a serial interface, only one
line or a pair of lines are used to transmit a data. It is used for low-speed peripherals. Normally, serial interface
is found in 9 pins. In serial interface, data is transferred serially. So, the speed is slow.

Parallel interface: - The interface which transfers set off a bit at a time is called parallel interface. In a
parallel interface, there are multiple lines to connect the peripheral to the port. A parallel interface is used to
transfer data at a faster rate for high speed peripherals such as a printer, disk and tape. In parallel interface,
data is transferred parallel. So, the speed is high.

Features of Computer ports:

• We can connect external devices to the computer with the help of ports and cables.
• These are basically slots on mother board where we connect external devices or we can have plugged in
external devices through cables.
• Mouse, keyboards, printers, speakers are some of the example of external devices that connected to the
computer through ports.
Types of ports:
Serial ports –
A serial port is basically a serial communication interface through which information transforms one
bit at a time. It is one of the oldest type of interfaces.
Parallel ports –
A parallel port is basically a parallel communication interface through which information transforms
multiple bits at a time. These are basically used to connect peripherals such as scanner or printers.
These are also known as printer port.

PS/2 ports –
These are basically 6 pin mini Din connector used to connect keyboard, mice to a PC compatible
computers. These are basically used by old computers for connecting mouse or keyboard. These are
called as mouse port.
Universal serial bus port –
It is basically a standard cable connection interface between computer and external device. USB is an
industrial standard for short-distance digital data communication. Basically it can connect all types of
external devices to the computer such as mouse, keyboard, printers, speakers etc.
VGA Ports –
VGA connector stands for Video Graphic Array connector, these are basically 15 pin connector available
in many video-cards, computer, projectors etc.

Expansion cards

An expansion card is an electronic card/board that is used to add extra functionality to a computer. It is
inserted into an expansion slot on the motherboard of a computer. Expansion cards contain edge connectors
that are used to create an electronic link between motherboard and card, thus enabling these two to
communicate.

Many different classes of expansion card are available, including sound cards, video graphics cards, network
cards and so on. All expansion cards are used to enhance the quality of their specific function. For example,
video graphics cards are used to enhance the video quality on a computer.

Expansion cards are also known as add-on cards or interface cards.

The basic purpose of expansion cards is to enhance the existing abilities of the motherboard. The adoption of
expansion cards occurred rapidly in the computing world because of the ability for users to customize
performance.

Ribbon cables

A ribbon cable (also known as multi-wire planar cable) is a cable with many conducting wires running
parallel to each other on the same flat plane. Ribbon cables are usually seen for internal peripherals in
computers, such as hard drives, CD drives and floppy drives.

A ribbon cable is a flat, thin cable composed of multiple small-grade cables placed parallel to each other.
With each core situated side by side, they form a wide-flat cable resembling a piece of ribbon, hence its name.
This type of cable is mostly used in electronic systems that require multiple data buses to link internal
peripherals, such as disk drives to their respective drive controllers. Ribbon cables are also known as
multiplanar cables

Ribbon cabling is used for data transmission and communications. It is often chosen for computer cable
applications, where it is used as internal wiring for hard drives, CD drives, and more. Ribbon cables are also
commonly used as internal wiring for other electronics and appliances.

ASCII

Stands for "American Standard Code for Information Interchange." ASCII is a character encoding that uses
numeric codes to represent characters. These include upper and lowercase English letters, numbers, and
punctuation symbols.
Standard ASCII

Standard ASCII can represent 128 characters. It uses 7 bits to represent each character since the first bit of
the byte is always 0. For instance, a capital "T" is represented by 84, or 01010100 in binary. A lowercase "t"
is represented by 116 or 01110100 in binary. Other keyboard keys are also mapped to standard ASCII values.
For example, the Escape key (ESC) is 27 in ASCII and the Delete key (DEL) is 127.

Difference between an input and output device List of Input Output Devices

Input Devices: Computer related input devices are Keyboard, Mouse, Touchpad, TrackPoint, Scanner,
Microphone, Digital Cameras, Barcode reader, Joystick, Webcam, etc.
Output Devices: Few examples of output devices are Printers, Projector, Plotters, Monitor, Speakers, Head
Phone, etc.

Keyboard: A computer or laptop keyboard is kind of hardware device that you can use to type data in a
computer system. It usually plugs and play device. A computer keyboard includes a set of alphabets (A-Z),
numbers (0-9), symbols and function keys. A computer keyboard type should be PS/2 (5-Pin DIN or 6-Pin
DIN), USB (Universal Serial Bus), Wireless. Now days USB and Wireless keyboard are common in use.
Earlier, PS/2 was the most used keyboard.

Mouse: A computer mouse is an input and a hardware, pointing device that you can connect to your computer
system. You can move cursor on your screen. It’s a hand held device that you can move with your hand and
do clicks (right or left) on your screen to send commands to your computer screen area. Earlier PS/2 mouse
was in existence but now a days USB and Wireless Mouse have taken place.

Touchpad: A touchpad or trackpad is a kind of input device that has a limited area wherein you can Point,
scroll, click and swipe. A Touchpad most commonly found on computer laptops (computer brand doesn’t
matter). Touchpad allows to use all the features as you do with a computer mouse.

TrackPoint: Most commonly TrackPoint found in IBM ThinkPad Notebook computers, and originally
introduced by IBM in 1992. TrackPoint is a cursor control device that’s built between laptop keyboard and
also known as pointing stick. Now the days touchpad method is in existence.

Scanner: A scanner is an electronic and input device that allows user to scan any of document, images, etc.
and convert them to digital formats that you can see on your computer screen. It’s a kind of hardware device
that you can connect to your desktop computer/laptop by using USB connection. Most uses in offices to create
an image files of physical documents.

Microphone: Also knows as its common name “Mic”. Basically Microphone converts your voice/sound into
electrical signals and you will get an output on connected speakers. Can be used to record voice.

Digital Cameras: A Digital Camera allow user to take pictures by using digital technology in cameras. You
can click and take photographs/pictures of anything that you have focused. You can control it by its certain
features.
Barcode Reader: A Barcode Reader is an input device and also known as Barcode Scanner is a hand held
device. It is an electronic device that can read barcodes those has printed on any product, etc. It is generally
used to track products and prices in a computer software system.

Joystick: Joystick is a kind of control stick that most used for computer gaming’s that allows users to control
characters or machine.

Webcam: Webcam is a short form of Web Camera is an input device. It should be connected to computer
directly or indirectly. It allows users to stream live video calling, take pictures, etc.

Output Devices
Printers: A printer is an output device that can print any document, web page, photographs, etc by command
send by your computer desktop or laptop. There are several brands and type of printers available for an
example: Laser-jet, Office jet, Ink jet, Line printers. Now days most of the printers includes the feature of
scanner and copier.

Projector: A projector is a hardware device that you can connected to computer desktop/laptop by using
HDMI or VGA cable (depends compatibility) to project your computer display in a large screen. If you are
using a projector, you also required a projection screen where you can project the computer display.

Plotters: A Plotter is a big size printer that allow users to get big size print that cannot be done by basic
printers. Most of the plotter has the feature of LTP, LAN and USB printing ports that connectivity to your
computer. Generally, plotters are used to take prints of line-art application, big maps, architecture designs,
drawings, etc.

Monitor: In computing, a monitor screen is a computer display. A monitor could be a CRT, LED or LCD.
Whatever you do in your computer, monitor is the hardware device that shows you the output. So, without
monitor you can’t work in your computer.

Speakers: Computer speaker is an output device because you are getting sound from it whenever you play
any online or offline music, video or anything that has sound in it. Basically, speaker is a hardware device
that you can connect to your computer to generate sound.

Head Phone: A head phone is an output device that also generate sound. Headphones are a pair of small
loudspeakers. Headphones can be placed inside or outer part of your ears to listen anything and won’t disturb
anyone else while playing anything. Can be used on computers or smartphones.
Computer Memory
Memory Representation

A memory unit is an essential component in any digital computer since it is needed for storing programs
and data.

Typically, a memory unit can be classified into two categories:

1. The memory unit that establishes direct communication with the CPU is called Main Memory.
The main memory is often referred to as RAM (Random Access Memory).
2. The memory units that provide backup storage are called Auxiliary Memory. For instance, magnetic
disks and magnetic tapes are the most commonly used auxiliary memories.

Memory Hierarchy

The memory in a computer can be divided into five hierarchies based on the
speed as well as use. The processor can move from one level to another based on its requirements. The
five hierarchies in the memory are registers, cache, main memory, magnetic discs, and magnetic
tapes. The first three hierarchies are volatile memories which mean when there is no power, and then
automatically they lose their stored data. Whereas the last two hierarchies are not volatile which means
they store the data permanently.

Primary Memory

The primary memory is also known as internal memory, and this is accessible by the processor
straightly. This memory includes main, cache, as well as CPU registers.

Secondary Memory
The secondary memory is also known as external memory, and this is accessible by the processor
through an input/output module. This memory includes an optical disk, magnetic disk, and magnetic
tape.

Classification of Computer Memory

Random Access Memory (RAM) –


• It is also called as read write memory or the main memory or the primary memory.
• The programs and data that the CPU requires during execution of a program are stored in this
memory.
• It is a volatile memory as the data loses when the power is turned off.
• RAM is further classified into two types- SRAM (Static Random Access Memory) and DRAM
(Dynamic Random Access Memory).
SRAM & DRAM
These two types of RAM are useful for holding data, but they do so in
their ways. The pros and cons of using DRAM and SRAM are also quite diverse, given their many
points of difference. For instance, for data to be retained effectively in DRAM, it has to be refreshed
periodically. This is not the case in SRAM as the transistors placed inside it continues to hold data until
the power supply is cut off.
Read Only Memory (ROM) –
• Stores crucial information essential to operate the system, like the program essential to boot the
computer.
• It is not volatile.
• Always retains its data.
• Used in embedded systems or where the programming needs no change.
• Used in calculators and peripheral devices.
• ROM is further classified into 4 types- ROM, PROM, EPROM, and EEPROM.
Types of Read Only Memory (ROM) –
1) PROM (Programmable read-only memory) – It can be programmed by user. Once programmed,
the data and instructions in it cannot be changed.
2) EPROM (Erasable Programmable read only memory) – It can be reprogrammed. To erase data
from it, expose it to ultra violet light. To reprogram it, erase all the previous data.
3) EEPROM (Electrically erasable programmable read only memory) – The data can be erased by
applying electric field, no need of ultra violet light. We can erase only portions of the chip.

Secondary Storage Devices Magnetic Tape & Magnetic Disk


Magnetic tape and magnetic disk both stores the data magnetically. The surface of a
magnetic tape and the surface of a magnetic disk are covered with a magnetic material which helps in
storing the information magnetically. Both are non-volatile storage.
The basic difference between magnetic tape and magnetic disk is that magnetic tape is used for backups
whereas, magnetic disk are used as secondary storage.
BASIS FOR MAGNETIC TAPE MAGNETIC DISK
COMPARISON

Basic Used for backup, and storage of less Used as a secondary storage. frequently
used information.
Physical Plastic thin, long, narrow strip coated Several platters arranged above each
with magnetic material. other to form a cylinder, each platter has
a readwrite head.

Use Idle for sequential access. Idle for random access.


Access Slower in data accessing. Fast in data accessing.

Update Once data is fed, it can't be updated. Data can be updated.

Data loss If the tape is damaged, the data is lost. In a case of a head crash, the data is lost.

Storage Typically stores from 20 GB to 200 GB. From Several hundred GB to Terabytes.

Expense Magnetic tapes are less expensive. Magnetic disk is more expensive

Optical Disk
An optical disk is any computer disk that uses optical storage techniques and
technology to read and write data. It is a computer storage disk that stores data digitally and uses laser
beams (transmitted from a laser head mounted on an optical disk drive) to read and write data.
An optical disk is primarily used as a portable and secondary storage device. It can store more data than
the previous generation of magnetic storage media, and has a relatively longer lifespan. Compact disks
(CD), digital versatile/video disks (DVD) and Blu-ray disks are currently the most commonly used
forms of optical disks. These disks are generally used to:

• Distribute software to customers


• Store large amounts of data such as music, images and videos
• Transfer data to different computers or devices
• Back up data from a local machine

USB
Universal Serial Bus (USB) is an industry standard that establishes specifications for cables
and connectors and protocols for connection, communication and power supply (interfacing)
between computers, peripherals and other computers.
USB (Universal Serial Bus) is the most popular connection used to connect a computer to
devices such as digital cameras, printers, scanners, and external hard drives. USB is a
crossplatform technology that is supported by most of the major operating systems. On
Windows, it can be used with Windows 98 and higher. USB is a hot-swappable technology,
meaning that
USB devices can be added and removed without having to restart the computer. USB is also
“plug and play”. When you connect a USB device to your PC, Windows should detect the
device and even install the drivers needed to use it.

USB connectors come in three different types: o The Type A connector is the flat connector

that plugs into the USB port on your computer.

o The other end of the USB cable can be either Type B or mini-Type B. The bigger, square-shaped
Type B connector is often used for scanners and hard drives.

o A smaller, trapezoid shaped mini-Type B is used for cameras, MP3 players and other smaller
devices.

Pen drive
A pen drive is a portable Universal Serial Bus (USB) flash memory device
for transferring information between computers. It is a portable device which means it can be
easily transferred from one location to another due to its compact design it looks like a pen shape
and therefore it is named as pen drive. A pen drive is inserted into a port on a personal computer
and the computer's operating system moves files onto or off of the drive for storage.

It enables the user to transfer data like text, videos, images, etc, from the laptop or computer instantly.

Pen drives have replaced the floppy drives of old and have become the most
popular data-storage devices among consumers. Micro, lightweight and handy, a pen drive can
be easily carried from place to place by students, professionals, academicians and independent
tech consultants. Currently available pen drives with storage capacities ranging from 8GB and
32GB can be used to store graphics-heavy documents, photos, music files and video clips.

Advantages of Pen Drives


• Pen drives come in large data storing capacity from 64 MB to 128 GB
• It has a faster data transferring rate
• A pen drive comes in a variety of sizes and is easy to carry
• It consists of a compact design that makes it portable
• A pen drive is known as secondary storage devices as it holds or stores data as a permanent memory
• It cannot be damaged due to scratches like on CD’s and DVD’s

Disadvantages of pen drives


• Pen drives are so small that they can be easily misplaced.
• They are primary source for spreading Computer viruses and can easily infect other computer if
comes in contact if not taken proper precautions such as Scanning with good Antivirus.
• Don’t have high storage capacity like hard disk

External Hard Disk

An external hard disk is just a hard disk drive (HDD) located outside of
a computer that is connected through a USB cable or wireless connection. An external hard
drive is usually used to store media that a user needs to be portable, for backups, and when the
internal drive of the computer is already at its full memory capacity. These devices have a high
storage capacity compared to flash drives and are mostly used for backing up numerous
computer files or serving as a network drive to store shared content.

Main Usage of External Hard Disk

The external hard disk is mainly used for backing up data and expanding the capacity
of your computer when you think that important data in your computer needs backup (such as
movies, music files, e-books, applications, etc.) or the internal hard disk is not big enough.

The external hard disk is very convenient for backing up data compared with the burning of
CD/DVD, and is way larger than the capacity of a USB flash drive, so now the external hard
disk is basically the standard equipment of an advanced computer user.

Features of External Hard Disk

• High storage capacity


• High Speed

• Small in size

• Portability

• High data transmission speed

• Easy to use

Disadvantages

• External hard drive is infected with virus

• Unplug external hard drive to PC unsafely

• Unexpected power failure during data transferring or writing


Memory Stick
Memory stick is a kind of portable card, which is release by Sony Company at the end of 1998.

Typically, Memory Sticks are used as storage media for a portable device, in a form that can
easily be removed for access by a personal computer. For example, Sony digital compact
cameras use Memory Stick for storing image files.

Advantages
• memory sticks can hold large quantities of data.
• they are extremely portable, so the user can take them wherever they go. •
they are durable, because they have no moving parts

CPU Registers
In Computer Architecture, the Registers are very fast computer memory
which are used to execute programs and operations efficiently. This does by giving access to
commonly used values, i.e., the values which are in the point of operation/execution at that
time.
These registers are used to quickly accept, store, and transfer data and instructions that are
being used immediately by the CPU. The registers used by the CPU are often termed as
Processor registers.
Register memory is the smallest and fastest memory in a computer. It is not a part of the main memory
and is located in the CPU in the form of registers, which are the smallest data holding elements.
Registers hold a small amount of data around 32 bits to 64 bits. The speed of a CPU depends on the
number and size (no. of bits) of registers that are built into the CPU.

Types of CPU Registers and their Functions

PC Register
PC stands for “Program Counter” register, its function is to hold all records in
sequence of entire execution of programs. PC has the memory address of further instruction
that is fetched in next step. PC registers to keep track the address of next instruction which to
be fetched from the primary memory, if recently instruction is completely executed. It helps
to count all numbers of entire instructions.

IR Register
IR stands for “Instruction Register“, and this register is used to store those data which are needed in
currently execution period.

MAR Register
MAR stand for “Memory Address Register”, and its main objective is to store all memory
addresses of entire data and instructions. MAR helps to make the communication with using
of MDR (Memory Data Register) in between the CPU and Main Memory.

Memory Data Registers (MDR): It contains data to be written into or to be


read out from the addressed location.

MBR
MB register stands for “Memory Buffer Register“, and this register contains the information
of data or instruction which are read or written in the main memory. So, Memory Buffer
Register’ function is to hold all data and instruction that are fetching or going to the primary
memory side.

AC Register
AC register is also called of the “Accumulator Register“, because this register holds the
integer values which are needed by the ALU (Arithmetically Logical Unit) while executing of
any specific instruction.

General Purpose Registers:


These are numbered as R0, R1, R2….Rn-1, and used to store temporary data and intermediate
results during any ongoing operation. Its contents can be accessed through assembly
programming.

Special purpose Registers: Users do not access these registers. These are used by computer
system at the time of program execution. Some types of special purpose registers are given below:
MAR, MBR, IR, PC
Cache Memory
Cache memory is a high-speed memory, which is small in size but faster than
the main memory (RAM). The CPU can access it more quickly than the primary memory. So,
it is used to synchronize with high-speed CPU and to improve its performance.
Cache memory can only be accessed by CPU. It can be a reserved part of the main
memory or a storage device outside the CPU. It holds the data and programs which are
frequently used by the CPU. So, it makes sure that the data is instantly available for CPU
whenever the CPU needs this data. In other words, if the CPU finds the required data or
instructions in the cache memory, it doesn't need to access the primary memory (RAM). Thus,
by acting as a buffer between RAM and CPU, it speeds up the system performance.

Operations in Cache memory


 When the CPU needs to access memory, the cache is examined. If the word (memory
location) is found in the cache, it is read from the fast memory.
 If the word addressed by the CPU is not found in the cache, the main memory is accessed
to read the word.
 If the processor finds that the memory location is in the cache, a cache hit has occurred
and data is read from cache
 If the processor does not find the memory location in the cache, a cache miss has
occurred. For a cache miss, the cache allocates a new entry and copies in data from main
memory, then the request is fulfilled from the contents of the cache.
 The performance of the cache memory is frequently measured in terms of a
quantity called hit ratio.
 When the CPU refers to memory and finds the word in cache, it is said to produce
a hit.
 If the word is not found in the cache, it is in main memory and it counts as a
miss.
 The ratio of the number of hits divided by the total CPU references to memory
(hits plus misses) is the hit ratio.

Hit Ratio

Cache hit ratio is a measurement of how many content requests a cache can deliver successfully from
its cache storage, compared to how many requests it receives.

Hit ratio = hit / (hit + miss)* 100 = no. of hits/total accesses

1. Determine the number of cache hits and misses over a given period of time
2. Divide the cache hits by the combined number of hits and misses
3. Multiply that number by 100
For example, if you have 51 cache hits and three misses over a period of time,
Hit = 51
Miss = 3
Hit ratio = Hit/ (Hit + Miss) * 100
= 51 / (51 +3) * 100
= 51 / 54 * 100
= 0.944 * 100
= 94.4%
An efficient cache policy maximizes the number of cache hits while minimizing the number of cache
misses, leading to a higher cache hit ratio, lower latency, and better resource utilization.
A cache hit ratio of 90% and higher means that most of the requests are satisfied by the cache.
A value below 80% on static files indicates inefficient caching due to poor configuration.

Virtual Memory
Virtual Memory is a storage scheme that provides user an illusion of having a
very big main memory. This is done by treating a part of secondary memory as the main
memory.

In this scheme, User can load the bigger size processes than the available main memory by
having the illusion that the memory is available to load the process. Instead of loading one
big process in the main memory, the Operating System loads the different parts of
more than one process in the main memory. By doing this, the degree of
multiprogramming will be increased and therefore, the CPU utilization will also be
increased.

How Virtual Memory Works?


In modern word, virtual memory has become quite common these days. In this scheme,
whenever some pages needs to be loaded in the main memory for the execution and the memory
is not available for those many pages, then in that case, instead of stopping the pages from
entering in the main memory, the OS search for the RAM area that are least used in the recent
times or that are not referenced and copy that into the secondary memory to make the space for
the new pages in the main memory.

Since all this procedure happens automatically, therefore it makes the computer feel like it is having the
unlimited RAM.

Advantages of Virtual Memory


1. The degree of Multiprogramming will be increased.
2. User can run large application with less real RAM.
3. There is no need to buy more memory RAMs.

Disadvantages of Virtual Memory


1. The system becomes slower since swapping takes time.
2. It takes more time in switching between applications.
3. The user will have the lesser hard disk space for its use.

Computer Instructions
Computer instructions are a set of machine language instructions that a particular processor
understands and executes. A performs tasks on the basis of the instruction provided.

An instruction comprises of groups called fields. These fields include:


The Operation code (Opcode) field which specifies the operation to be performed. The Mode
field which specifies how the operand will be located The Address field which contains the
location of the operand, i.e., register or memory location.

• Memory – reference instruction


• Register – reference instruction
• Input-output instruction

Memory - reference instruction


In Memory-reference instruction, 12 bits of memory is used to specify an address and
one bit to specify the addressing mode 'l'.

Note: The Operation code (Opcode) of an instruction refers to a group of bits that define
arithmetic and logic operations such as add, subtract, multiply, shift, and compliment.
Register - reference instruction
The Register-reference instructions are represented by the Opcode 111 with a 0 in the
leftmost bit (bit 15) of the instruction.

Input-Output Instructions
Just like the Register-reference instruction, an Input-Output instruction does not
need a reference to memory and is recognized by the operation code 111 with a
1 in the leftmost bit of the instruction. The remaining 12 bits are used to specify
the type of the input-output operation or test performed.
Instruction Cycle

• An instruction cycle (sometimes called fetch-decode-execute cycle) is the basic operation


cycle of a computer. It is the process by which a computer retrieves a program instruction
from its memory, determines what actions the instruction requires, and carries out those
actions.
• This cycle is repeated continuously by the central processing unit (CPU), from boot up to
when the computer is shut down.
• In simpler CPUs, the instruction cycle is executed sequentially: each instruction is
completely processed before the next one is started.
• In most modern CPUs, the instruction cycle is instead executed concurrently in parallel, as
an instruction pipeline: the next instruction starts being processed before the previous
instruction is finished, which is possible because the cycle is broken up into separate steps.

1. Initiating the cycle

• The cycle starts immediately when power is applied to the system using an initial PC value
that is predefined for the system architecture
• Typically this address points to instructions in a read-only memory (ROM) (not the random
access memory or RAM) which begins the process of loading the operating system.

2. Fetch the Instruction


Step 1 of the Instruction Cycle is called the Fetch Cycle. This step is the same for each
instruction.
1) The CPU sends PC to the MAR and sends a READ command on the control bus
2) In response to the read command (with address equal to PC), the memory returns the
data stored at the memory location indicated by PC on the databus.
3) The CPU copies the data from the databus into its MDR (also known as MBR)
4) A fraction of a second later, the CPU copies the data from the MDR to the Instruction
Register (IR)
5) The PC is incremented so that it points to the following instruction in memory. This step
prepares the CPU for the next cycle. The Control Unit fetches the instruction's address
from the Memory Unit
3. Decode the Instruction Step 2 of the instruction Cycle is called the Decode Cycle. The
decoding process allows the CPU to determine what instruction is to be performed, so that the
CPU can tell how many operands it needs to fetch in order to perform the instruction.
The opcode fetched from the memory is decoded for the next steps and moved to the
appropriate registers. The decoding is done by the CPU's Control Unit.

4. Read the effective address

• Step 3 is deciding which operation it is. If this is a Memory operation - in this step the
computer checks if it's a direct or indirect memory operation:
• Direct memory instruction - Nothing is being done.
• Indirect memory instruction - The effective address is being read from the memory. If this
is a I/O or Register instruction - the computer checks its kind and executes the instruction.
5. Execute the Instruction Step 4 of the Instruction Cycle is the Execute Cycle. Here, the function
of the instruction is performed.
• If the instruction involves arithmetic or logic, the Arithmetic Logic Unit is utilized. This is
the only stage of the instruction cycle that is useful from the perspective of the end user.
• Everything else is overhead required to make the execute stage happen.
Memory Chips

A memory chip is a small computer device used to store information, data or a program that is run
on a computer or other electronic device that runs like a computer, such as a camera or video game
console. There are several different types of memory chips, although some are more commonly
used than others.

Memory chips are integrated circuits that are capable of storing information. Today, memory
chips are on various types of RAM, like DRAM, EPROM, EEPROM, and SRAM. Memory chips
can also be integrated into hardware devices, like a video card.

The picture below is an example of a 512 MB DIMM RAM stick with eight visible memory chips
integrated on the circuit board.

There are a few different types of memory chips:

• Dynamic random access memory (DRAM) chips: Also known as volatile memory chips
because they lose memory once the power supply is removed. DRAM can only transmit a
single line of memory and needs to be constantly refreshed to prevent the loss of memory
bits.
• Static random access memory (SRAM) chips: Non-volatile chips that are commonly used
in portable battery-powered devices. Unlike DRAM, they do not need to be refreshed and
do not immediately lose memory when the power source is disconnected.
• First in, first out (FIFO) memory chips: Mainly used when memory is being transferred
between different types of devices.
• Erasable programmable read only memory (EPROM): The memory in these chips can be
erased when exposed to ultraviolet rays. These chips can then be reprogrammed for a new
set of data values.
• Programmable read only memory (PROM) memory: Differs from other programmable
memory chips as they can only be programmed once.The contents cannot be erased
electronically or though ultraviolet rays.

Pipelining and Parallel Processing


Pipelining

Pipelining is the process of accumulating instruction from the processor through a pipeline. It
allows storing and executing instructions in an orderly process. It is also known as pipeline
processing.
Pipelining is a technique where multiple instructions are overlapped during execution. Pipeline is
divided into stages and these stages are connected with one another to form a pipe like structure.
Instructions enter from one end and exit from another end.
Pipelining increases the overall instruction throughput.
In pipeline system, each segment consists of an input register followed by a combinational circuit.
The register is used to hold data and combinational circuit performs operations on it. The output
of combinational circuit is applied to the input register of the next segment.
Advantages of Pipelining

1. The cycle time of the processor is reduced.


2. It increases the throughput of the system
3. It makes the system reliable.

Disadvantages of Pipelining
1. The design of pipelined processor is complex and costly to manufacture.
2. The instruction latency is more.

Parallel Processing

Instead of processing each instruction sequentially, a parallel processing system provides


concurrent data processing to increase the execution time.
In this the system may have two or more ALU's and should be able to execute two or more
instructions at the same time. The purpose of parallel processing is to speed up the computer
processing capability and increase its throughput.

NOTE: Throughput is the number of instructions that can be executed in a unit of time.

A parallel processing system can be achieved by having a multiplicity of functional units that
perform identical or different operations simultaneously. The data can be distributed among
various multiple functional units.

The following diagram shows one possible way of separating the execution unit into eight functional
units operating in parallel.
o The adder and integer multiplier performs the arithmetic operation with integer numbers.
oThe floating-point operations are separated into three circuits operating in parallel.
o The logic, shift, and increment operations can be performed concurrently on different data.

All units are independent of each other, so one number can be shifted while another number is
being incremented.

Micro-programmed Control and Hardwired Control.


To execute an instruction, there are two types of control units Hardwired Control unit and
Microprogrammed control unit.
1. Hardwired control units are generally faster than microprogrammed designs. In hardwired
control, we saw how all the control signals required inside the CPU can be generated using a
state counter and a PLA circuit.
2. A microprogrammed control unit is a relatively simple logic circuit that is capable of
(1) sequencing through microinstructions and
(2) generating control signals to execute each microinstruction.

Hardwired Control Unit Microprogrammed Control Unit


Micrprogrammed control unit generates the
Hardwired control unit generates the control control signals with the help of micro signals
needed for the processor using logic
circuits instructions stored in control memory

Hardwired control unit is faster when compared to microprogrammed control unit as the This
is slower than the other as micro required control signals are generated with the instructions
are used for generating signals
help of hardwares here

Difficult to modify as the control signals that need Easy to modify as the modification need to to
be generated are hard wired be done only at the instruction level

Less costlier than hardwired control as only


micro instructions are used for generating
More costlier as everything has to be realized in control signals
terms of logic gates

It cannot handle complex instructions as the


circuit design for it becomes complex It can handle complex instructions

Only limited number of instructions are used due Control signals for many instructions can be
to the hardware implementation generated
Used in computer that makes use of Reduced Used in computer that makes use of
Instruction Set Computers(RISC) Complex Instruction Set Computers(CISC)

-
Input Output organization
 In addition to the processor and a set of memory modules, the third key element of a
computer system is a set of input output subsystem referred to as I/O, provides an efficient
-

mode of communication between the central system and the outside environment.
 Input output interface is used as a method which helps in transferring of information

between the internal storage devices i.e. memory and the external peripheral device.
 A peripheral device is that which provide input and output for the computer, it is also
called Input-Output devices.
 For Example: A keyboard and mouse provide Input to the computer are called input
devices while a monitor and printer that provide output to the computer are called output
devices.
 Just like the external hard-drives, there is also availability of some peripheral devices
which are able to provide both input and output.

 For accessing I/O Devices the bus enables all the devices connected to it to exchange
information
 Typically, the bus consists of three sets of lines used to carry address, data, and control
signals. The method that is used to transfer information between internal storage and
external I/O devices is known as I/O interface.

The protocols for serial data transfer can be grouped into two types:
Synchronous and Asynchronous

Synchronous data transfer: sender and receiver use the same clock signal
• supports high data transfer rate
• needs clock signal between the sender and the receiver
• requires master/slave configuration

For synchronous data transfer, both the sender and receiver access the data according
to the same clock. Therefore, a special line for the clock signal is required. A master
(or one of the senders) should provide the clock signal to all the receivers in the
synchronous data transfer.

Asynchronous data transfer: sender provides a synchronization signal to the


receiver before starting the transfer of each message
• Does not need clock signal between the sender and the receiver
• Slower data transfer rate

There are mainly 4 types of Asynchronous data transfer

1) Source initiated strobe data transfer (Strobe is just a signal)


2) Destination initiated strobe data transfer
3) Source initiated handshaking data transfer
4) Destination initiated handshaking data transfer

Data is transferred from source to destination through data bus

Source initiated Strobe Data Transfer

When source initiates the process of data transfer

 First, source puts data on the data bus and ON the strobe signal.
 Destination on seeing the ON signal of strobe, read data from the data
bus.
 After reading data from the data bus by destination, strobe gets OFF.
Destination initiated strobe data transfer

– When destination initiates the process of data transfer

 First, the destination ON the strobe signal to ensure the source to put the fresh data
on the data bus.
 Source on seeing the ON signal puts fresh data on the data bus.
 Destination reads the data from the data bus and strobe gets OFF signal.
Problems faced in Strobe based asynchronous input output –

1. In Source initiated Strobe, it is assumed that destination has read the data from the data bus
but there is no surety.
2. In Destination initiated Strobe, it is assumed that source has put the data on the data bus but
there is no surety.
This problem is overcome by Handshaking.
Handshaking Mechanism:
1. Source initiated Handshaking – When source initiates the data transfer process. It consists
of signals:
DATA VALID: if ON tells data on the data bus is valid otherwise invalid.
DATA ACCEPTED: if ON tells data is accepted otherwise not accepted.

 Source places data on the data bus and enable Data valid signal.
 Destination accepts data from the data bus and enable Data accepted
signal.
 After this, disable Data valid signal means data on data bus is invalid
now.
 Disable Data accepted signal and the process ends.
Now there is surety that destination has read the data from the data bus through data accepted
signal.
Destination initiated Handshaking – When destination initiates the process of data transfer.
REQUEST FOR DATA: if ON requests for putting data on the data bus.
DATA VALID: if ON tells data is valid on the data bus otherwise invalid data.

 When destination is ready to receive data, Request for Data signal


gets activated.
 source in response puts data on the data bus and enabled Data valid
signal.
 Destination then accepts data from the data bus and after accepting
data, disabled Request for Data signal.
 At last, Data valid signal gets disabled means data on the data bus is
no more valid data.
Now there is surety that source has put the data on the data bus through data
valid signal.
Data transfer between the CPU and I/O devices can be done in variety of
modes. These are three possible modes:

1. Programmed I/O
2. Interrupt initiated I/O
3. Direct Memory Access (DMA)

1. Programmed I/O :
In this mode the data transfer is initiated by the instructions written in a
computer program. An input instruction is required to store the data from the
device to the CPU and a store instruction is required to transfer the data from
the CPU to the device. Data transfer through this mode requires constant
monitoring of the peripheral device by the CPU and also monitor the possibility
of new transfer once the transfer has been initiated. Thus CPU stays in a loop
until the I/O device indicates that it is ready for data transfer. Thus programmed
I/O is a time consuming process that keeps the processor busy needlessly and
leads to wastage of the CPU cycles.
This can be overcome by the use of an interrupt facility. This forms the basis
for the Interrupt Initiated I/O.
Interrupt
An interrupt is a signal to the processor emitted by hardware or software
indicating an event that needs immediate attention. It alerts the processor to a
high priority process requiring interruption of the current working process. In
I/O devices one of the bus control lines is dedicated for this purpose and is
called the Interrupt Service Routine (ISR).
When a device raises an interrupt at lets say process i, the processor first
completes the execution of instruction i. Then it loads the Program Counter
(PC) with the address of the first instruction of the ISR. Before loading the
Program Counter with the address, the address of the interrupted instruction is
moved to a temporary location. Therefore, after handling the interrupt the
processor can continue with process i+1.
While the processor is handling the interrupts, it must inform the device that its
request has been recognized so that it stops sending the interrupt request signal.
Also, saving the registers so that the interrupted process can be restored in the
future, increases the delay between the time an interrupt is received and the start
of the execution of the ISR. This is called Interrupt Lattency. The term
interrupt latency refers to the delay between the start of an Interrupt Request
(IRQ) and the start of the respective Interrupt Service Routine (ISR).
Sequence of events involved in handling an IRQ:
1. Devices raise an IRQ.
2. Processor interrupts the program currently being executed.
3. Device is informed that its request has been recognized and the device
deactivates the request signal.
4. The requested action is performed.
5. Interrupt is enabled and the interrupted program is resumed.
Handling Multiple Devices:
When more than one device raises an interrupt request signal, then additional
information is needed to decide which device to be considered first. The
following methods are used to decide which device to select: Polling, Vectored
Interrupts, and Interrupt Nesting. These are explained as following below.
1. Polling:
In polling, the first device encountered with IRQ bit set is the device that
is to be serviced first. Appropriate ISR is called to service the same. It is
easy to implement but a lot of time is wasted by interrogating the IRQ bit
of all devices.
2. Vectored Interrupts:
In vectored interrupts, a device requesting an interrupt identifies itself
directly by sending a special code to the processor over the bus. This
enables the processor to identify the device that generated the interrupt.
The special code can be the starting address of the ISR or where the ISR
is located in memory, and is called the interrupt vector.
3. Interrupt Nesting:
In this method, I/O device is organized in a priority structure. Therefore,
interrupt request from a higher priority device is recognized where as
request from a lower priority device is not.
Types of Interrupts:
 Hardware Interrupts: If the signal for the processor is from external
device or hardware is called hardware interrupts. Example: from keyboard
we will press the key to do some action this pressing of key in keyboard
will generate a signal which is given to the processor to do action, such
interrupts are called hardware interrupts. Hardware interrupts can be
classified into two types they are
 Maskable Interrupt: The hardware interrupts which can be delayed
when a much highest priority interrupt has occurred to the processor.
 Non Maskable Interrupt: The hardware which cannot be delayed and
should process by the processor immediately.
 Software Interrupts: Software interrupt can also divided into two types.
They are
 Normal Interrupts: the interrupts which are caused by the software
instructions are called software instructions.
 Exception: unplanned interrupts while executing a program is called
Exception. For example: while executing a program if we got a value
which should be divided by zero is called a exception.
 Periodic Interrupt: If the interrupts occurred at fixed interval in timeline
then that interrupts are called periodic interrupts
 Aperiodic Interrupt: If the occurrence of interrupt cannot be predicted
then that interrupt is called aperiodic interrupt.
 Synchronous Interrupt: The source of interrupt is in phase to the system
clock is called synchronous interrupt. In other words interrupts which are
dependent on the system clock. Example: timer service that uses the
system clock.
 Asynchronous Interrupts: If the interrupts are independent or not in
phase to the system clock is called asynchronous interrupt.
Interrupt Handling:
Instruction cycle consists of fetch, decode, execute and read/write functions.
After every instruction cycle the processor will check for interrupts to be
processed if there is no interrupt is present in the system it will go for the next
instruction cycle which is given by the instruction register.
If there is an interrupt present then it will trigger the interrupt handler, the
handler will stop the present instruction which is processing and save its
configuration in a register and load the program counter of the interrupt from
a location which is given by the interrupt vector table. After processing the
interrupt by the processor interrupt handler will load the instruction and its
configuration from the saved register, process will start its processing where
it’s left. This saving the old instruction processing configuration and loading
the new interrupt configuration is also called as context switching.

The interrupt handler is also called as Interrupt service routine (ISR). There
are different types of interrupt handler which will handle different interrupts.
For example for the clock in a system will have its interrupt handler, keyboard
it will have its interrupt handler for every device it will have its interrupt
handler.

The main features of the ISR are

• Interrupts can occur at any time they are asynchronous. ISR’s can call
for asynchronous interrupts.
• Interrupt service mechanism can call the ISR’s from multiple sources.
• ISR’s can handle both maskable and non maskable interrupts. An
instruction in a program can disable or enable an interrupt handler call.
• ISR on beginning of execution it will disable other devices interrupt
services. After completion of the ISR execution it will re initialize the
interrupt services
DMA:
Direct Memory Access (DMA) transfers the block of data between the memory
and peripheral devices of the system, without the participation of the processor. The unit that
controls the activity of accessing memory directly is called a DMA controller.

The processor relinquishes the system bus for a few clock cycles. So, the DMA controller can
accomplish the task of data transfer via the system bus.

What is DMA and Why it is used?


Direct memory access (DMA) is a mode of data transfer between the
memory and I/O devices. This happens without the involvement of the processor. We have
two other methods of data transfer, programmed I/O and Interrupt driven I/O. Let’s revise
each and get acknowledge with their drawbacks.

In programmed I/O, the processor keeps on scanning whether any device is ready for data
transfer. If an I/O device is ready, the processor fully dedicates itself in transferring the data
between I/O and memory. It transfers data at a high rate, but it can’t get involved in any
other activity during data transfer. This is the major drawback of programmed I/O.

In Interrupt driven I/O, whenever the device is ready for data transfer, then it raises an
interrupt to processor. Processor completes executing its ongoing instruction and saves its
current state. It then switches to data transfer which causes a delay. Here, the processor doesn’t
keep scanning for peripherals ready for data transfer. But, it is fully involved in the data transfer
process. So, it is also not an effective way of data transfer.

The above two modes of data transfer are not useful for transferring a large block of data. But,
the DMA controller completes this task at a faster rate and is also effective for transfer of large
data block.

Direct Memory Access Controller & it’s Working


DMA controller is a hardware unit that allows I/O devices to access memory
directly without the participation of the processor. Here, we will discuss the working of the
DMA controller. Below we have the diagram of DMA controller that explains its working:
1. Whenever an I/O device wants to transfer the data to or from memory, it sends the DMA request
(DRQ) to the DMA controller. DMA controller accepts this DRQ and asks the CPU to hold for
a few clock cycles by sending it the Hold request (HLD).
2. CPU receives the Hold request (HLD) from DMA controller and relinquishes the bus and sends
the Hold acknowledgement (HLDA) to DMA controller.
3. After receiving the Hold acknowledgement (HLDA), DMA controller acknowledges I/O
device (DACK) that the data transfer can be performed and DMA controller takes the charge
of the system bus and transfers the data to or from memory.
4. When the data transfer is accomplished, the DMA raise an interrupt to let know the processor
that the task of data transfer is finished and the processor can take control over the bus again
and start processing where it has left.

Now the DMA controller can be a separate unit that is shared by various I/O devices, or it can
also be a part of the I/O device interface.

Direct Memory Access Advantages and Disadvantages

Advantages:

1. Transferring the data without the involvement of the processor will speed up the read-write
task.
2. DMA reduces the clock cycle requires to read or write a block of data.
3. Implementing DMA also reduces the overhead of the processor.

Disadvantages

1. As it is a hardware unit, it would cost to implement a DMA controller in the system.


2. Cache coherence problem can occur while using DMA controller.
DMA Transfer modes
The DMA controller transfers the data in three modes:

1. Burst Mode: Here, once the DMA controller gains the charge of the system bus, then it releases
the system bus only after completion of data transfer. Till then the CPU has to wait for the
system buses.

a) It is the fastest DMA mode. In this two or more data bytes are transferred continuously.
b) Processor is disconnected from system bus during DMA transfer. N number of machine
cycles are adopted into the machine cycles of the processor where N is the number of
bytes to be transferred.
c) DMA sends HOLD signal to processor to request for system bus and waits for HLDA
signal.
d) After receiving HLDA signal, DMA gains control of system bus and transfers one byte.
After transferring one byte, it increments memory address, decrements counter and
transfers next byte.
e) In this way, it transfer all data bytes between memory and I/O devices. After transferring
all data bytes, the DMA controller disables HOLD signal & enters into slave mode.

2. Cycle Stealing Mode: In this mode, the DMA controller forces the CPU to stop its operation
and relinquish the control over the bus for a short term to DMA controller. After the
transfer of every byte, the DMA controller releases the bus and then again requests for the
system bus. In this way, the DMA controller steals the clock cycle for transferring every byte.

a) In this mode only one byte is transferred at a time. This is slower than burst DMA.
b) DMA sends HOLD signal to processor and waits for HLDA signal on receiving HLDA
signal, it gains control of system bus and executes only one DMA cycle.
c) After transfer one byte, it disables HOLD signal and enters into slave mode.
d) Processor gains control of system bus and executes next machine cycle. If count is not
zero and data is available then the DMA controller sends HOLD signal to the processor
and transfer next byte of data block.

3. Transparent Mode: Here, the DMA controller takes the charge of system bus only if the
processor does not require the system bus.

I/O Processor
An input-output processor (IOP) is a processor with direct memory access capability. In this, the
computer system is divided into a memory unit and number of processors.
Each IOP controls and manage the input-output tasks. The IOP is similar to CPU except that it
handles only the details of I/O processing. The IOP can fetch and execute its own instructions.
These IOP instructions are designed to manage I/O transfers only.
Block Diagram of I/O Processor
Below is a block diagram of a computer along with various I/O Processors. The memory unit
occupies the central position and can communicate with each processor.
The CPU processes the data required for solving the computational tasks. The IOP provides a
path for transfer of data between peripherals and memory. The CPU assigns the task of
initiating the I/O program.
The IOP operates independent from CPU and transfer data between peripherals and memory.

You might also like