You are on page 1of 134

Chapter Two:- Computer System

Computer System are collection of hardware and


software that are designed to receive ,process , manages
the instructions given by user and returns output in the
form of human readable.
There are three major components of a computer
system:
 Hardware
 Software
 Humanware
Hardware
The hardware of the computer consists of all the
electronic components and electromechanical
devices that comprise the physical entity of the
device.
HW is the physical, touchable, electronic and
mechanical parts of a computer system.
External
Components
Mouse
The mouse is a
pointing device that
sends control signals
into the computer.
It is used to move
the cursor (usually
arrow icon) on the
screen and to
perform click
actions.

Ba
ck
Monitor

It is used to display
data in visual form
(which can only be
seen). The images
it display are where
the user gets
information.

Ba
ck
Keyboard

This contains set of


keys that are used
to input characters
(letters, numbers)
and control signals
into the computer.

Ba
ck
Automatic Voltage Regulator
It protects the
computer from
changes in the
electricity that may
damage the
computer
components. It
regulates the
voltage that goes
to the computer.

Ba
ck
System Unit

It serves as a
container of the
computer’s
internal parts
(motherboard,
CPU, etc.)

Ba
ck
Internal Components
Power Supply Unit
It converts the
main alternating
current into low-
voltage direct
current that is
supplied to other
parts.
A power supply
unit has its own
fan.
Hard Disk Drive

It is the main
storage device of
the computer. It is
where most of the
files of the
computer are
stored.
Optical Disc Drive

It reads or writes
data into optical
discs (CD, DVD, Blu-
ray Disc).
Random Access Memory Module
It is the temporary
storage device of
the computer. It is
used to hold the
data that the
computer is
working on.
The black
rectangles are
called RAM chips.
Central Processing Unit

This is referred to
as the computer’s
brain as it does the
processing job of
the computer. This
means that it is
responsible for
manipulating the
data.
CPU Fan and Heatsink
These two
components work
together in keeping
the CPU from
overheating. The
metal is called the
heatsink as it
conducts heat from
the CPU while the
CPU fan blows the
air to the heatsink.
See next slide to
know the airflow
System Fan

This is found at the


left side panel and
the back panel of
the system unit.
It directs the flow
of air in the system
unit.
Motherboard

It is the main
circuit board of the
computer that
connects all other
parts.
PARTS OF THE MOTHERBOARD

Expansion Slots

These are where


the expansion
cards such as
modem card and
graphics card are
installed. These are
different types of
slots.
RAM Slots

These are where


the RAM modules
are installed.
Northbridge

Located between
the CPU socket,
Expansion slots,
and RAM slots.
It coordinates the
flow of data
between the CPU,
graphics card, and
RAM
Southbridge

Located below the


expansion slots,
the Southbridge
handles all of the
computer’s
input/output
functions.
The location of the two Chipsets
BIOS Chip

It stands for Basic


Input/Output
System.
It contains the
program that
checks devices to
know if the
computer is ready
to startup.
CMOS RAM

It is the one that


holds data used by
the BIOS or
Operating System.
These data
includes time,
date, BIOS
password.
CMOS Battery
It provides the
power used by the
CMOS RAM so that
even when the
computer is off, the
CMOS RAM can
still keep data (this
means time and
date will not be
reset).
Back Panel Ports
Located at the back
of the
motherboard. This
is where most of
the computer
peripherals are
connected. These
peripherals include
the keyboard,
mouse, and printer.
Front Panel Headers

It is mostly located
at the left and front
side of the
motherboard. Most
computers have
three front panel
headers: system
panel headers, audio
headers, USB
headers.
CPU Socket

It is where the CPU


is installed.
20+4 Pin ATX Main Power Connector

It is where the
20+4 Pin ATX Main
Power Connector
of the PSU is
connected.
Input Devices
Accepts data and instructions from the user or
from another computer system.
There are two types of Input Devices

1.Keyboard Entry
2.Direct Entry
Keyboard Entry – Data is inputted to the
computer through a keyboard.
• Direct Entry – A form of input that does not require
data to be keyed by someone sitting at a keyboard.
Direct-entry devices create machine-readable data on
paper, or magnetic media, or feed it directly into the
computer’s CPU

Three Categories of Direct Entry Devices


1.Pointing Devices - An input device used to
move the pointer (cursor) on screen
Mouse - The most common 'pointing device' used in
PCs. Every mouse has two buttons and most have one
or two scroll wheels.
• Touch screen- A display screen that is sensitive to the
touch of a finger or stylus. Used in myriad
applications, including ATM machines, retail point-of-
sale terminals, car navigation and industrial controls.
The touch screen became wildly popular for smart
phones and tablets
• Light Pen - A light sensitive stylus wired to a video
terminal used to draw pictures or select menu
options. The user brings the pen to the desired point
on screen and presses the pen button to make
contact.
2. Scanning Devices- A device that can read text or
illustrations printed on paper and translates the
information into a form the computer can use.

3. Voice- Input Devices - Audio input devices also


known as speech or voice recognition systems that
allow a user to send audio signals to a computer for
processing, recording, or carrying out commands.
Audio input devices such as microphones allow
users to speak to the computer in order to record a
voice message or navigate software.
Output Devices
Output Devices - Any piece of computer
hardware that displays results after the computer
has processed the input data that has been
entered.
1. Computer Display Monitor- It displays
information in visual form, using text and
graphics.
The portion of the monitor that displays the
information is called the screen or video display
terminal. Types of monitor CRT ,LCD &LED.
Smart Board - A type of display screen that has a
touch sensitive transparent panel covering the
screen, which is similar to a touch screen.
Printer - A device that prints text or illustrations on
paper.
Types of printer
Ink-Jet or Bubble-Jet Printer - bprays ink at a sheet
of paper. Inkjet printers produce high-quality text
and graphics.
Laser Printer - Uses the same technology as copy
machines. Laser printers produce very high
quality text and graphics.
• LCD and LED Printer- Similar to a laser
printer, but uses liquid crystals or light emitting
diodes rather than a laser to produce an image
on the drum.
Line Printer - Contains a chain of characters
or pins that print an entire line at one time.
Line printers are very fast, but produce lowquality
print.
Thermal Printer- An inexpensive printer that
works by pushing heated pins against heat
sensitive paper. Thermal printers are widely
used in calculators and fax machines.
• Speakers - Used to play sound. They may
be built into the system unit or connected
with cables. Speakers allow you to listen to
music and hear sound effects from your
computer.
Ports
External connecting sockets on the outside of
the computer. This is a pathway into and out
of the computer. A port lets users plug in
outside peripherals, such as monitors,
scanners and printers.
The Ports and their function
SOFTWARE
The software component refers to the instructions,
programs, data, and protocols which run on top of
hardware.
Computer systems divide software systems into two
major classes:
1. System software
2. Application software.
System software
System software:-Programs that control the
operations of the computer and its devices.
 The system manages other software and devices inside
the computer.
Example of system software is the operating
system (OS), Device drivers, compilers,
Assemblers.
Operating systems for traditional computers
include Windows, Mac OS X, and Linux.
Popular mobile operating systems include
Android OS, iPhone OS.
Application software.
Application software is a Programs that perform
specific tasks for users.
An application software is designed for benefit of
users to perform one or more tasks.
Example of application software is Microsoft
Word, Excel, PowerPoint, Oracle, Adobe
Photoshop, AutoCAD, Media player software,
Internet browsers, Image editing,
Mathematical software, Simulation software,
Spreadsheets, Video editing software, Word
processing.
Humanware
The human ware component refers to the
person that uses the computer.

Refers to people involved in the data processing


operations such as the system administrator,
office workers, students and others.
Memory system
 Computer memory is any physical device capable of
storing information temporarily or permanently.
 A memory is just like a human brain. It is used to store data
and instructions.
 The memory is divided into large number of small parts
called cells.
 Each location or cell has a unique address, which varies
from zero to memory size minus one.
 For example, if the computer has 64k words, then this
memory unit has 64 * 1024 = 65536 memory locations.
The address of these locations varies from 0 to 65535
Memory Access Methods
 An important design issue is to provide a
computer system with as large and fast a
memory as possible, within a given cost
target.
 Measures for the speed of a memory:
 memory access time.
 memory cycle time.
 Several techniques to increase the effective size and
speed of the memory:
 Cache memory (to increase the effective speed).
 Virtual memory (to increase the effective size).
• Each memory cell can hold one bit of information.
• Memory cells are organized in the form of an array.
• One row is one memory word.
• All cells of a row are connected to a common line,
known as the “word line”.
• Word line is connected to the address decoder.
• Sense/write circuits are connected to the data
input/output lines of the memory chip.
Memory Hierarchy
In the Computer System Design, Memory
Hierarchy is an enhancement to organize the
memory such that it can minimize the access
time. The Memory Hierarchy was developed
based on a program behavior known as locality
of references.
REGISTER
 Registers are a type of computer memory 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.
 The computer needs processor registers for
manipulating data and a register for holding a memory
address.
 The register holding the memory location is used to
calculate the address of the next instruction after the
execution of the current instruction is completed.
Following is the list of some of the most common registers used in a basic computer
Register Symbol Number of bits Function

Data register DR 16 Holds memory


operand
Address register AR 12 Holds address
for the memory
Accumulator AC 16 Processor
register
Instruction IR 16 Holds
register instruction code
Program PC 12 Holds address
counter of the
instruction
Temporary TR 16 Holds
register temporary data
Input register INPR 8 Carries input
character
Output register OUTR 8 Carries output
character
Internal registers include the instruction
register (IR), memory buffer register (MBR),
memory data register (MDR), and memory
address register (MAR).
The instruction register fetches instructions
from the program counter (PC) and holds each
instruction as it is executed by the processor.
 The memory registers are used to pass data
from memory to the processor.
basically a register will perform the following
operations.
 Fetch: To fetch the instructions of the user also
the instructions that are present in the main
memory in a sorted way
 Decode: The second operation is to decode the
instructions that need to perform. Thus CPU will
be knowing what are the instructions
 Execute: Once the instructions are decoded then
execute operation is performed by the CPU. Once
done the result is presented on the user screen
Cache Memory
Cache Memory is a special very high-speed memory. It is
used to speed up and synchronizing with high-speed CPU
Cache memory is an extremely fast memory type that
acts as a buffer between RAM and the CPU.
Data is transferred in the form of words between the
cache memory and the CPU.
Data is transferred in the form of blocks or pages between
the cache memory and the main memory.
Whenever the CPU needs to access memory, it first
checks the cache memory. If the data is not found in
cache memory, then the CPU moves into the main
memory.
Levels of Cache Memory
 Levels of Cache: Cache memory is categorized in levels
based on it’s closeness and accessibility to the
microprocessor. There are three levels of a cache.
 Level 1(L1) Cache: This cache is inbuilt in the processor
and is made of SRAM(Static RAM) Each time the
processor requests information from memory, the cache
controller on the chip uses special circuitry to first check
if the memory data is already in the cache. If it is present,
then the system is spared from time consuming access to
the main memory. In a typical CPU, primary cache ranges
in size from 8 to 64 KB, with larger amounts on the newer
processors. This type of Cache Memory is very fast
because it runs at the speed of the processor since it is
integrated into it.
Level 2(L2) Cache: The L2 cache is larger but
slower in speed than L1 cache. It is used to see
recent accesses that is not picked by L1 cache
and is usually 64 to 2 MB in size. A L2 cache is
also found on the CPU. If L1 and L2 cache are
used together, then the missing information
that is not present in L1 cache can be retrieved
quickly from the L2 cache. Like L1 caches, L2
caches are composed of SRAM but they are
much larger. L2 is usually a separate static RAM
(SRAM) chip and it is placed between the CPU &
DRAM(Main Memory)
Level 3(L3) Cache: L3 Cache memory is an
enhanced form of memory present on the
motherboard of the computer. It is an extra
cache built into the motherboard between the
processor and main memory to speed up the
processing operations. It reduces the time gap
between request and retrieving of the data and
instructions much more quickly than a main
memory. L3 cache are being used with
processors nowadays, having more than 3 MB
of storage in it.
Primary Memory (Main Memory)
Primary memory holds only those data and
instructions on which the computer is currently
working.
It has a limited capacity and data is lost when
power is switched off.
It is generally made up of semiconductor device.
 It is the working memory of the computer. Faster
than secondary memories.
It is divided into two subcategories RAM and
ROM.
Random Access Memory (RAM)
RAM is a part of computer’s Main Memory which
is directly accessible by CPU.
It temporarily stores copy of information and files
loaded from a computer hard drive that are
required by a processor.
It is volatile in nature, which means that data will
be erased once supply to the storage device is
turned off.
RAM stores data randomly and the processor
accesses these data randomly from the RAM
storage.
Types of Random Access Memory
(RAM)
The RAM chips are of two types.
Dynamic RAM(DRAM) A type of RAM that
stores each bit of data in a separate capacitor
within an integrated circuit.
DRAM has to be refreshed (given a new
electronic charge) every few milliseconds to
retain data.
Static RAM (SRAM) It is a type of memory in
which, memory refreshing is not required.
Static RAM (SRAM)
Static random-access memory (static
RAM or SRAM) is a type of random-access
memory (RAM) that uses latching circuitry
(flip-flop) to store each bit. SRAM is volatile
memory; data is lost when power is removed.
data is stored using the state of a six transistor
memory cell. Static RAM is mostly used as a
cache memory for the processor (CPU).
Dynamic RAM(DRAM)
Do not retain their state indefinitely.
Contents must be periodically refreshed.
Contents may be refreshed while accessing
them for reading.
SDRAM vs DRAM
• Dynamic RAM
• Static RAM
• Less expensive
• More expensive.
• It has excellent speed to DRAM. • It has slow speed to SRAM
• Use in L1 and L2 Caches Memory. • It is used in Main Memory.
• High density, it means six transistors • It uses low density per cell; it means one
per chip. transistor per chip.
• Volatile Memory – Do not need extra • Volatile Memory – need regular power
charges for storing data. supply to store data.
• It is placed between main memory • It is embedded on the motherboard of PC.
and processor. • It is attached directly with CPU bus.
• Linked directly to Cache Memory.
• Large size
• Small size
• Use capacitors.
• Use transistors and latches.
• It uses one transistor in one block
• It uses six transistors in one block
memory. memory.
• Do not need refreshing circuit. • Need power refreshing circuit
• Consume less power to DRAM. • Consume high power.
• SRAM is on chip memory, it needs • DRAM is off chip memory that means, it
small access time. needs large access time.
ROM
 ROM holds programs and data permanently even
when computer is switched off
 Data can be read by the CPU in any order so ROM
is also direct access
 The contents of ROM are fixed at the time of
manufacture
 Stores a program called the bootstrap loader that
helps start up the computer
 Access time of between 10 and 50 nanoseconds
Types of ROM
1.Programmable Read Only Memory (PROM)
 • Empty of data when manufactured
 • May be permanently programmed by the user
2. Erasable Programmable Read Only Memory (EPROM)
 Can be programmed, erased and reprogrammed
 The EPROM chip has a small window on top allowing it
to be erased by shining ultra-violet light on it
 After reprogramming the window is covered to prevent
new contents being erased
 Access time is around 45 – 90 nanoseconds
3.Electrically Erasable Programmable Read Only
Memory (EEPROM)
Reprogrammed electrically without using
ultraviolet light
Access times between 45 and 200
nanoseconds
RAM vs ROM
SECONDARY MEMORY
This type of memory is also known as external
memory or non-volatile.
 It is slower than the main memory.
These are used for storing data/information
permanently.
CPU directly does not access these memories,
instead they are accessed via input-output routines.
The contents of secondary memories are first
transferred to the main memory, and then the CPU
can access it.
These are some characteristics of secondary
memory, which distinguish it from primary memory
• It is non-volatile, i.e. it retains data when power is
switched off
• It is large capacities to the tune of terabytes
• It is cheaper as compared to primary memory
• Depending on whether secondary memory device is part of
CPU or not, there are two types of secondary memory – fixed
and removable.
Hard Disk Drive
• Hard disk drive is made up of a series of circular disks
called platters arranged one over the other almost ½
inches apart around a spindle. Disks are made of non-
magnetic material like aluminum alloy and coated with
10-20 nm of magnetic material.
• Standard diameter of these disks is 14 inches and they
rotate with speeds varying from 4200 rpm (rotations
per minute) for personal computers to 15000 rpm for
servers. Data is stored by magnetizing or demagnetizing
the magnetic coating. A magnetic reader arm is used to
read data from and write data to the disks. A typical
modern HDD has capacity in terabytes (TB).
CD Drive
CD stands for Compact Disk. CDs are circular disks that use optical rays, usually lasers, to read and write
data. They are very cheap as you can get 700 MB of storage space for less than a dollar. CDs are inserted
in CD drives built into CPU cabinet. They are portable as you can eject the drive, remove the CD and carry
it with you. There are three types of CDs −
CD-ROM (Compact Disk – Read Only Memory) − The data on these CDs are recorded by the
manufacturer. Proprietary Software, audio or video are released on CD-ROMs.
CD-R (Compact Disk – Recordable) − Data can be written by the user once on the CD-R. It cannot be
deleted or modified later.
CD-RW (Compact Disk – Rewritable) − Data can be written and deleted on these optical disks again and
again.
DVD Drive
DVD stands for Digital Video Display. DVD are optical devices that can store 15 times the data held by
CDs. They are usually used to store rich multimedia files that need high storage capacity. DVDs also come
in three varieties – read only, recordable and rewritable.
Pen Drive
Pen drive is a portable memory device that uses solid state memory rather than magnetic fields or lasers
to record data. It uses a technology similar to RAM, except that it is nonvolatile. It is also called USB drive,
key drive or flash memory.
Blue Ray Disk
Blue Ray Disk (BD) is an optical storage media used to store high definition (HD) video and other
multimedia filed. BD uses shorter wavelength laser as compared to CD/DVD. This enables writing arm to
focus more tightly on the disk and hence pack in more data. BDs can store up to 128 GB data.
Memory management
Memory management is the process of
controlling and coordinating computer memory,
assigning portions called blocks to various
running programs to optimize overall system
performance.
It is the most important function of an operating
system that manages primary memory.
 It helps processes to move back and forward
between the main memory and execution disk.
Why Use Memory Management?
It allows you to check how much memory needs
to be allocated to processes that decide which
processor should get memory at what time.
Tracks whenever inventory gets freed or
unallocated. According to it will update the
status.
It allocates the space to application routines.
It also make sure that these applications do not
interfere with each other.
Helps protect different processes from each other
It places the programs in memory so that
memory is utilized to its full extent.
• Uni-program
– Memory split into two
– One for Operating System (monitor)
– One for currently executing program
• Multi-program
– “User” part is sub-divided and shared among
active processes
Effective memory management is vital in a
multiprogramming system.
 If only a few processes are in memory, then for
much of the time all of the processes will be waiting
for I/O and the processor will be idle.
Thus, memory needs to be allocated efficiently to
pack as many processes into memory as possible.
Partitioning
• Splitting memory into sections to allocate to
processes (including Operating System)
• Two types
– Fixed-sized partitions
– Variable-sized partitions
Fixed-sized partitions
• Equal size or Unequal size partitions
• Process is fitted into smallest hole that will
take it (best fit)
• Some wasted memory due to each block
having a hole of unused memory at the end of
its partition
• Leads to variable sized partitions
For example, a process that requires 3M bytes
of memory would be placed in the 4M
partition of Figure, wasting 1M that could be
used by another process.
Variable-Sized Partitions
• Allocate exactly the required memory to a process
• This leads to a hole at the end of memory, too small to
use – Only one small hole - less waste
• When all processes are blocked, swap out a process and
bring in another
• New process may be smaller than swapped out process
• Reloaded process not likely to return to same place in
memory it started in
• Another hole
• Eventually have lots of holes (fragmentation)
• An example, using 64 MB of main memory, is shown in Figure
Initially, main memory is empty, except for the OS (a). The first
three processes are loaded in, starting where the OS ends and
occupying just enough space for each process (b, c, d). This leaves a
“hole” at the end of memory that is too small for a fourth process.
At some point, none of the processes in memory is ready. The OS
swaps out process 2 (e), which leaves sufficient room to load a new
process, process 4 (f). Because process 4 is smaller than process 2,
another small hole is created. Later, a point is reached at which
none of the processes in main memory is ready, but process 2, in
the Ready-Suspend state, is available. Because there is insufficient
room in memory for process 2, the OS swaps process 1
out (g) and swaps process 2 back in (h).
Solutions to Holes in Variable-Sized
Partitions
Coalesce - Join adjacent holes into a single
large hole
Compaction - From time to time go through
memory and move all holes into one free
block (c.f. disk de-fragmentation
Input Output systems
The I/O subsystem of a computer provides an
efficient mode of communication between the
central system and the outside environment.
It handles all the input-output operations of
the computer system.
Peripheral Devices Input or output devices that
are connected to computer
These devices are designed to read information
into or out of the memory unit upon command
from the CPU and are considered to be the part
of computer system. These devices are also
called peripherals. For example: Keyboards,
display units and printers are common
peripheral devices.
There are three types of peripherals:
Input peripherals : Allows user input, from the
outside world to the computer. Example:
Keyboard, Mouse etc.
 Output peripherals: Allows information
output, from the computer to the outside
world. Example: Printer, Monitor etc.
Input-Output peripherals: Allows both
input(from outside world to computer) as well
as, output(from computer to the outside
world). Example: Touch screen etc.
External Devices
 External devices are needed as a means of
communication to the outside world (both input and
output – I/O)
 Types of External Devices are
Human readable – communication with user
(monitor, printer, keyboard, mouse)
Machine readable – communication with equipment
(hard drive, CDROM, sensors, and actuators)
Communication – communication with remote
computers/devices (Can be any of the first two or a
network interface card or modem)
Interfaces
Interface is a shared boundary between two separate
components of the computer system which can be
used to attach two or more components to the system
for communication purposes.
There are two types of interface:
CPU Interface
I/O Interface
Input-Output Interface
 Input Output Interface provides a method for transferring
information between internal storage (such as memory and CPU
registers) and external I/O devices. Peripherals connected to a
computer need special communication links for interfacing them
with the central processing unit.
 In computer system, there are special hardware components
between the CPU and peripherals to control or manage the input-
output transfers. These components are called input-output
interface units because they provide communication links between
processor bus and peripherals. They provide a method for
transferring information between internal system and input-output
devices.

The Major Differences of CPU and I/O
Interface
 Peripherals are electromechanically and electromagnetic devices and
their manner of operation of the CPU and memory, which are electronic
devices. Therefore, a conversion of signal values may be needed.
 The data transfer rate of peripherals is usually slower than the transfer
rate of CPU and consequently, a synchronization mechanism may be
needed.
 Data codes and formats in the peripherals differ from the word format in
the CPU and memory. Peripherals- Byte, Block, …
CPU or memory- word.
 To Resolve these differences, computer systems include special
hardware components between the CPU and Peripherals to supervises
and synchronizes all input and out transfers. These components are
called Interface Units because they interface between the processor bus
and the peripheral devices.
I/O module function
 Control and timing: coordinates the flow of traffic
between internal resources and external devices.
 Processor communication: involves command
decoding data status reporting address recognition.
 Error detection: detect and reports transmission
errors.
 Data buffering: perform the needed buffering
operation to balance device and memory speeds.
 Device communication: involves commands, status
information and data.
I/O Module: Control and Timing
Required because of multiple devices all
communicating on the same channel
Example
CPU checks I/O module device status
I/O module returns status
If ready, CPU requests data transfer
I/O module gets data from device
I/O module transfers data to CPU
I/O Module: Processor Communication
Commands from processor – Examples: READ
SECTOR, WRITE SECTOR, SEEK track number, and
SCAN record ID.
Data – passed back and forth over the data bus
Status reporting – Request from the processor for
the I/O Module's status. May be as simple as
BUSY and READY
Address recognition – I/O device is setup as a
block of one or more addresses unique to itself
I/O Module Structure
I/O BUS and Interface Module

I/O BUS and Interface Module It defines the


typical link between the processor and several
peripherals. The I/O Bus consists of data
lines, address lines and control lines
I/O Commands
 There are four types of I/O commands that an I/O module may
receive when it is addressed by a processor:
Control
- used to activate a peripheral and tell it what to do.
Test
- used to test various status conditions associated with
an I/O module and its peripherals.
Read
- causes the I/O module to obtain an item of data from
the peripheral and place it in an internal buffer.
Write
- causes the I/O module to take an item of data from the
data bus and subsequently transmit that data item to the
peripheral.
 There are two methods in which the Processor can
address the input/output devices:
In the First arrangement, I/O devices are assigned
particular addresses, isolated from the address space
assigned to the memory .
 The execution of an input instruction at an input device
address will cause the character stored in the input
register of that device to be transferred to a specific
register in the CPU. Similarly, the execution of an
output instruction . This arrangement, called ”Shared
I/O’’, in the case, the address and data lines from the
CPU can be shared between the memory and I/O
devices. A separate control line will have to be used.
This is because of the need for executing input and
output instruction.
The main Advantage of the Shared I/O
arrangement is the Separation between the
memory address space and that of the I/O
devices.
Its main Disadvantage is the need to have
special input and output instruction in the
processor instruction set.
 The Second, possible I/O arrangement is deal with input and output
registers as if they are regular memory locations. For example, Read
Device 6 is equivalent to performing an input operation from the
input register in Device #6. Similarly, a write operation. This
arrangement is called Memory – Mapped I/O.
 The main advantage of the memory-mapped I/O is the use of the
read and write instructions of the processor to perform the input and
output operations, respectively. It eliminates the need for
introducing special I/O instructions.
 The main Disadvantage of the memory-mapped I/O is the need to
reserve a certain part of the memory address space for addressing
I/O devices, that is, a reduction in the available memory address
space.
I/O Mapping Summary
 Memory mapped I/O
 Devices and memory share an address space.
 I/O looks just like memory read/write
 No special commands for I/O
 Large selection of memory access commands
available
 Isolated I/O
 Separate address spaces
 Need I/O or memory select lines
 Special commands for I/O Limited set
Modes/Techniques of I/O Data
Transfer
Data transfer between the central unit and I/O
devices can be handled in generally three
types of modes which are given below:
 Programmed I/O
 Interrupt Initiated I/O
 Direct Memory Access
Programmed I/O
 Data are exchanged between the processor and the I/O module.
 The processor executes a program that gives it direct control of
the I/O operation, including sensing device status, sending a
read or write command, and transferring the data.
 When the processor issues a command to the I/O module, it
must wait until the I/O operation is complete. If the processor is
faster than the I/O module, this is wasteful of processor time.
 Programmed I/O instructions are the result of I/O instructions
written in computer program.
 Each data item transfer is initiated by the instruction in the
program. Usually the program controls data transfer to and
from CPU and peripheral.
 Transferring data under programmed I/O requires constant
monitoring of the peripherals by the CPU.
I/O module does not inform CPU directly
CPU may wait or do something and come back
later
Wastes CPU time because typically processor
is much faster than I/O
CPU acts as a bridge for moving data between I/O
module and main memory, i.e., every piece of
data goes through CPU
CPU waits for I/O module to complete operation
In the programmed I/O
method the CPU stays in
the program loop until
the I/O unit indicates
that it is ready for data
transfer.
Interrupt Driven I/O
The CPU issues commands to the i/o module then
proceeds with its normal work until interrupted by
i/o device on completion of its work.
For input, the device interrupts the CPU when new
data has arrived and is ready to be arrived by the
system processor .
The actual actions to perform depend on whether
the device uses i/o ports, memory mapping.
For output, the deice delivers an interrupt either
when it is ready to accept new data or to
acknowledge a successful data transfer.
Overcomes CPU waiting
Requires setup code and interrupt service
routine
No repeated CPU checking of device
I/O module interrupts when ready
Still requires CPU to be go between for
moving data between I/O module and main
memory
Interrupt Driven I/O Basic Operation
CPU issues read command.
•I/O module gets data from peripheral whilst
CPU does other work.
•I/O module interrupts CPU.
•CPU requests data.
•I/O module transfers data.
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 in to 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.
Direct Memory Access (DMA)
 Direct Memory Access (DMA) means CPU grants I/O module
authority to read from or write to memory without involvement
DMA module controls exchange of data between main memory
and the I/O device.
 DMA device can transfer data directly to and from memory, rather
than using the CPU as an intermediary, and can thus relieve
congestion on the bus.
 CPU is only involved at the beginning and end of the transfer and
interrupted only after entire block has been transferred . Direct
Memory Access needs a special hardware called DMA controller
(DMAC) that manages the data transfers and arbitrates access to
the system bus.
 Hardware design is complicated because the DMA controller must
be integrated into the system, and the system must allow the DMA
controller to be a bus master.
DMA controller
 DMA controller has an address register, data count
register, control logic.
 Address register :contains an address that specifies the
memory location of the data to be transferred. The DMA
controller automatically increment the address register
after each word transfer, so the transfer will be from the
next memory location.
 Data count register: holds the number of words to be
transfer ,the word count is decremented by one after each
word transfer.
 Control logic: specifies the transfer mode ( number of
DMA operation they support)
 DMA transfer types:
-Burst mode
the DMA controller keeps control of the bus until all the
data has been transferred to (from ) memory from (to)
the peripheral device. This mode of transfer is needed
for fast devices where data transfer cannot be stopped
until the entire transfer is done .
• Single – cycle mode
the DMA controller releasing the bus after each
transfer of one data word . This minimizes the
amount of time that the DMA controller keeps the
CPU from controlling the bus , but it requires that
the bus request / acknowledge sequence be
performed for every single transfer.
DMA Configurations
Single Bus, Detached DMA controller
– Each transfer uses bus twice – I/O to DMA then
DMA to memory
– CPU is suspended twice
Single Bus, DMA controller integrated into I/O module
– Controller may support one or more devices
– Each transfer uses bus once – DMA to memory
– CPU is suspended once
Separate I/O Bus
– Bus supports all DMA enabled devices with single
DMA controller
– Each transfer uses bus once – DMA to memory
– CPU is suspended once
Computer buses
 A bus is a communication system in computer architecture that
transfers data between components inside a computer, or between
computers.
 The following are a few points to describe a computer bus:-
 A bus is a group of lines/wires which carry computer signals.
 A bus is the means of shared transmission.
 Lines are assigned for providing descriptive names. — carries a
single electrical signal, e.g. 1- bit memory address, data bits
series, or timing control that turns the device on or off.
 Data can be transferred from one computer system location to
another (between different I / O modules, memory, and CPU).
 The bus is not only cable but also hardware (bus architecture),
protocol, program, and bus controller.
• Following are the three components of a bus: –
The address bus, a one-way pathway that
allows information to pass in one direction only,
carries information about where data is stored
in memory.
The data bus is a two-way pathway carrying the
actual data (information) to and from the
main memory.
The control bus holds the control and timing
signals needed to coordinate all of the
computer’s activities.
Functions of a computer bus
 Data sharing – All types of buses used in network
transfer data between the connected computer
peripherals. The buses either transfer or send data in
serial or parallel transfer method. This allows 1, 2, 4, or
even 8 bytes of data to be exchanged at a time. (A Byte
is an 8- bit group). Buses are classified according to
how many bits they can move simultaneously, meaning
we have 8-bit, 16-bit, 32-bit, or even 64-bit buses.
 Addressing – A bus has address lines that suit the
processors. This allows us to transfer data to or from
different locations in the memory.
 Power – A bus supplies the power to various
connected peripherals.
• Lines are grouped as mentioned below –
Power line provides electrical power to the
components connected
• Data lines carrying data or instructions between
modules of the system
• Address lines indicate the recipient of the bus data
• Control lines control the synchronization and operation
of the bus and the modules linked to the bus
What are the different types of
computer buses?
 Computers normally have two bus types:-
 System bus – This is the bus that connects the CPU to
the motherboard’s main memory. The system bus is
also known as a front-side bus, a memory bus, a local
bus, or a host bus.
 A number of I / O Buses:-connecting various
peripheral devices to the CPU. These devices connect
to the system bus through a ‘bridge’ implemented on
the chipset of the processors. Other I / O bus names
include “expansion bus,” “external
bus” or “host bus”
Types of Expansion buses
• ISA – Industry Standard Architecture
The Industry Standard Architecture (ISA) bus is still one of the
oldest buses in service today. Although it has been replaced
by faster buses, ISA still has a lot of legacy devices that
connect to it
such as cash registers, CNC machines, and barcode scanners.
• Since being expanded to 16 bits in 1984, ISA remains
largely unchanged
EISA – Extended Industry Standard Architecture An upgrade
to ISA is Extended Industry Standard Architecture or EISA. This
doubled the data channels from 16 to 32 and allowed the bus
to be used by more than one CPU.
• MCA – Micro Channel Architecture
IBM developed this bus as a substitute for ISA when
they designed the PS/2 PC which was launched in
1987. The bus provided some technological
improvements over the ISA bus. The MCA, for
example, ran at a speed of 10MHz faster and
supported either 16-bit or 32-bit data.
One advantage of MCA was that the plug-in cards
were configurable software; that means they
needed minimal user input during configuration.
• VESA Local (VL) Bus
The ISA bus quickly became a bottleneck as
graphics processors; even the 32-bit EISA was not
able
to help that much.
The Video Electronics Standards Association
(VESA) Local bus was created to split the load and
allow the ISA bus to handle interrupts and port
I/O (input/output) and the VL bus to work with
Direct
Memory Access (DMA) and memory I/O. Because
of its size and other considerations, this was only
a temporary solution.
PCI – Peripheral Component
Interconnect
 The PCI bus was developed to solve ISA and VL-bus related issues.
PCI has a 32-bit data path and will run at half the speed of the
system memory bus.
 One of its enhancements was to provide connected computers with
direct access to machine memory.
 That increased computer efficiency while reducing the CPU ‘s
capacity for interference. Today’s computers mostly have PCI slots.
PCI is considered a hybrid between ISA and VL-Bus that
provides direct access to the connected devices system memory.
This uses a bridge to connect to the front side bus and CPU and is
able to provide higher performance while reducing the potential for
CPU interference.

You might also like