Computer Architecture
- Computer Architecture is the design and organization of a computer system that describes how different components of a computer work together to perform tasks.
- It defines the structure, functionality, and interaction of hardware components such as the CPU, memory, input/output devices, and storage systems.
- Computer architecture acts as a blueprint that explains how instructions are processed and how data flows within a computer.
Main Components of Computer Architecture
1. Central Processing Unit (CPU)
- The CPU is the main processing unit of a computer.
- It executes instructions and controls all operations.
- It consists of:
Arithmetic Logic Unit (ALU)
- Performs arithmetic operations such as addition, subtraction, multiplication, and division.
- Performs logical operations such as comparison and decision-making.
Control Unit (CU)
- Controls and coordinates all activities of the computer.
- Manages the flow of data between CPU, memory, and input/output devices.
Registers
- Small, high-speed storage locations inside the CPU.
2.
Memory
Unit
§ Stores data,
instructions, and results temporarily or permanently.
§ Includes:
1.
Primary
Memory: RAM and ROM.
2.
Secondary
Memory: Hard drives, SSDs, and other storage devices.
3.
Input
Unit
·
Allows
users to enter data and instructions into the computer.
·
Examples:
Keyboard, mouse, scanner.
4.
Output
Unit
·
Displays
processed information to users.
·
Examples:
Monitor, printer, speakers.
5.
System
Bus
·
A
communication pathway that transfers data, instructions, and signals between
computer components.
Importance
of Computer Architecture
·
Determines
the speed and performance of a computer.
·
Helps
in designing efficient computer systems.
·
Improves
hardware and software compatibility.
· Defines how data is processed and stored.
Registers
- Registers are small, high-speed storage locations inside the CPU used to temporarily store data, instructions, and addresses during processing.
- They provide faster access to information compared to main memory (RAM).
- Registers help the CPU perform calculations, execute instructions, and control computer operations efficiently.
- The size and number of registers affect the performance and speed of a processor.
- Used in computers, smartphones, and other digital devices to improve processing speed.
Types
of Registers
1.
Accumulator (ACC)
- Stores intermediate results of arithmetic and logical operations.
- Helps
the CPU perform calculations quickly.
- Used
frequently by the Arithmetic Logic Unit (ALU).
2.
Program Counter (PC)
- Stores
the address of the next instruction to be executed.
- Helps
the CPU execute instructions in the correct sequence.
- Automatically
updates after each instruction is processed.
3.
Instruction Register (IR)
- Holds
the current instruction being executed by the CPU.
- Helps
the control unit decode and process instructions.
- Ensures
proper execution of program commands.
4.
Memory Address Register (MAR)
- Stores
the address of the memory location to be accessed.
- Helps
the CPU locate data or instructions in memory.
- Used
during read and write operations.
5.
Memory Data Register (MDR)
- Stores
data being transferred to or from memory.
- Acts
as a temporary storage area during memory operations.
- Helps
transfer information between CPU and memory.
6.
General Purpose Registers (GPR)
- Store
temporary data and intermediate results during processing.
- Can
be used for various operations by programs.
- Improve
the efficiency of CPU operations.
Memory Management
- Memory management is the process of controlling and organizing the computer's main memory (RAM) by the operating system.
- It manages the allocation and deallocation of memory space to different programs and processes.
- Ensures that programs get enough memory to run efficiently and prevents memory conflicts.
- Improves system performance by using memory resources effectively.
- Handles tasks such as memory allocation, memory protection, and virtual memory management.
Functions of Memory Management
1. Memory Allocation
- Assigns memory space to programs and processes when they need it.
- Ensures efficient use of available memory resources.
- Releases memory when a program finishes execution.
2. Memory Deallocation
- Removes unused memory from completed processes.
- Makes memory available for other programs.
- Prevents unnecessary memory usage.
3. Memory Protection
- Prevents one process from accessing another process's memory without permission.
- Maintains security and stability of the system.
- Protects important operating system data.
4. Virtual Memory Management
- Uses a portion of secondary storage as an extension of RAM.
- Allows larger programs to run even when physical memory is limited.
- Improves multitasking capability of the computer.
5. Address Translation
- Converts logical addresses generated by programs into physical memory addresses.
- Helps the CPU access the correct memory location.
- Managed using techniques such as paging and segmentation.
Types
of Memory Management Techniques
1.
Paging
- Divides
memory into fixed-size blocks called pages and frames.
- Allows
efficient use of memory and reduces external fragmentation.
- Commonly
used in modern operating systems.
Types of Paging
1.
Simple Paging
o
Uses
a single page table to map pages to frames.
o
Suitable
for smaller memory systems.
2.
Hierarchical
(Multi-Level) Paging
o
Divides
the page table into multiple levels.
o
Reduces
memory usage for large address spaces.
3.
Hashed Paging
o
Uses
a hash table to map virtual page numbers to physical frames.
o
Commonly
used in 64-bit systems with large virtual address spaces.
4.
Inverted Paging
o
Maintains
one page table entry for each physical frame instead of each virtual page.
o
Saves
memory by reducing the size of page tables.
5.
Demand Paging
o
Loads
pages into memory only when they are needed.
o
Improves
memory utilization and reduces loading time.
Advantages
·
Eliminates
external fragmentation.
·
Efficient
memory utilization.
·
Supports
virtual memory.
·
Allows
processes to use non-contiguous physical memory.
Disadvantages
·
Can
cause internal fragmentation.
·
Requires
page tables, increasing memory overhead.
·
Address
translation may slow execution without a Translation Lookaside Buffer (TLB).
2.
Segmentation
- Divides
memory into variable-sized segments based on program structure.
- Helps
organize programs into logical parts such as code, data, and stack.
- Provides
better memory organization.
Types of Segmentation
1.
Simple Segmentation
o
Divides
a program into logical segments (e.g., code, data, stack).
o
Each
segment has its own base address and limit.
2.
Pure Segmentation
o
Memory
is managed entirely using segments.
o
Each
segment can grow or shrink independently.
3.
Segmentation with
Paging
o
Combines
segmentation and paging.
o
Each
segment is further divided into fixed-size pages.
o
Reduces
external fragmentation while preserving the logical organization of
segmentation.
Advantages
·
Supports
logical memory organization.
·
Easy
sharing and protection of program segments.
·
Segments
can grow independently.
Disadvantages
·
Causes
external fragmentation.
·
Memory
allocation is more complex than paging.
·
May
require memory compaction.
3.
Swapping
- Temporarily moves processes between RAM and secondary storage.
- Helps manage limited memory resources.
- Allows multiple programs to run simultaneously.
Types of Swapping
1.
Standard Swapping
o
The
entire process is moved from RAM to secondary storage and later brought back
into memory for execution.
2.
Roll-Out/Roll-In
Swapping
o
A
lower-priority process is swapped out to allow a higher-priority process to
execute.
o
After
the higher-priority process finishes, the swapped-out process is brought back
into RAM.
Advantages
·
Increases
the number of processes that can run.
·
Improves
memory utilization.
·
Supports
multiprogramming.
Disadvantages
·
Swapping
is slow because it depends on disk speed.
·
Frequent
swapping can reduce system performance (called thrashing).
·
Increases
overhead due to disk I/O.
Importance of Memory Management
- Improves computer performance and speed.
- Allows multiple programs to run at the same time.
- Prevents memory wastage and conflicts.
- Provides security and efficient use of memory resources.
Types
of Computer Memory
Computer
memory is divided into two main categories: Primary Memory and Secondary
Memory.
1.
Primary Memory (Main Memory)
- Primary memory is the main storage area directly accessed by the CPU.
- It stores data and instructions that are currently being processed.
- It is faster than secondary memory but has limited storage capacity.
Types
of Primary Memory
a.
RAM (Random Access Memory)
- RAM is a
temporary (volatile) memory used to store data and
programs currently in use.
- Data is lost when
the computer is turned off.
- The CPU reads
from and writes to RAM during program execution.
- It provides fast
access to data compared to secondary storage.
- The amount of RAM
affects the computer's multitasking performance.
- More RAM allows
more applications to run simultaneously.
- RAM is the main
working memory of a computer.
- Common types of
RAM include Dynamic RAM (DRAM) and Static RAM
(SRAM).
Types of RAM
·
DRAM (Dynamic RAM): Requires continuous
refreshing; commonly used as main memory.
·
SRAM (Static RAM): Faster and more
expensive; commonly used in memory.
b.
ROM (Read Only Memory)
- ROM is a permanent (non-volatile)
memory that stores important instructions.
- Data remains stored even
when power is turned off.
- It contains
firmware and boot instructions required to start the computer.
- Data stored in
ROM cannot be easily modified.
- ROM is more
reliable for storing permanent system programs.
- It is mainly used
during the booting process.
- It consumes very
little power to retain data.
Types of ROM
·
PROM (Programmable
ROM):
Can be programmed only once.
·
EPROM (Erasable
Programmable ROM):
Can be erased using ultraviolet (UV) light and reprogrammed.
·
EEPROM (Electrically
Erasable Programmable ROM): Can be erased and rewritten electrically.
·
Flash ROM: A faster form of
EEPROM widely used in BIOS, SSDs, and USB drives.
c.
Cache Memory
- Cache is a
high-speed memory located near or inside the CPU.
- Stores frequently
used data and instructions for faster access.
- Improves the
overall performance of the computer.
- Reduces the
average time required to access data from RAM.
- It is smaller in
size but much faster than RAM.
- Cache memory is
usually built using SRAM.
- It reduces CPU
waiting time and speeds up processing.
Types of Cache Memory
·
L1 Cache (Level 1): Fastest and smallest;
located inside each CPU core.
·
L2 Cache (Level 2): Larger than L1 but
slightly slower.
·
L3 Cache (Level 3): Shared among CPU
cores; larger but slower than L1 and L2.
d. Registers
•
Registers
are the fastest memory units located inside the CPU.
•
They
temporarily store data, instructions, addresses, and processing results.
•
Registers
help the CPU execute operations quickly.
•
They
have very small storage capacity.
•
Registers
are directly accessed by the CPU.
•
Different
registers perform different functions during instruction execution.
•
They
are essential for arithmetic, logic, and control operations.
2.
Secondary Memory (Auxiliary Memory)
- Secondary
memory is used for permanent storage of data and programs.
- It
has larger storage capacity but is slower than primary memory.
- Data
remains stored even when the power is turned off.
Types
of Secondary Memory
A.
Solid State Drive (SSD)
- SSD
is a non-volatile storage device that uses flash memory to store data.
- It
is faster and more reliable than traditional hard disk drives.
- SSDs
have no moving mechanical parts, making them more durable.
- It
provides faster boot time and quicker application loading.
- It
consumes less power compared to HDDs.
- SSDs
produce less heat and noise during operation.
- Commonly
used in modern computers, laptops, and high-performance systems.
- It
is more expensive than HDD for the same storage capacity.
B.
Optical Storage
- Optical storage
is a secondary storage technology that uses laser technology
to read and write data.
- Data is stored on
optical discs with reflective surfaces.
- It is used for
media storage, software distribution, and data backup.
- Optical discs are
portable and easy to store.
- They are less
commonly used today due to the popularity of cloud storage and flash
devices.
- Storage capacity
is generally lower compared to HDDs and SSDs.
Types of Optical Storage
·
CD (Compact Disc): Stores approximately
700 MB of data.
·
DVD (Digital Versatile
Disc):
Stores more data than CDs (commonly 4.7 GB or more).
·
Blu-ray Disc: Provides higher
capacity storage, mainly used for HD videos.
C.
USB Flash Drive
- A USB flash drive
is a small, portable secondary storage device used to store and transfer
data.
- It uses flash
memory technology for data storage.
- It connects to
computers through a USB port.
- It is
lightweight, reusable, and easy to carry.
- It does not
require external power to store data.
- Commonly used for
file transfer, backups, and software installation.
- Available in
different storage capacities, such as 8GB, 32GB, 128GB, and more.
D.
Memory Card
- A memory card is
a small portable storage device used in cameras, smartphones, tablets, and
other electronic devices.
- It uses flash
memory technology to store digital data.
- It provides
additional storage capacity for photos, videos, applications, and files.
- It is
lightweight, removable, and easy to transfer between devices.
- Memory cards are
available in different storage capacities and speed classes.
- They are commonly
used in mobile devices and digital cameras.
e.
Hard Disk Drive (HDD)
- HDD
is a non-volatile secondary storage device used to store large amounts of data
permanently.
- It
uses magnetic storage technology to read and write data.
- Data
is stored on rotating magnetic disks called platters.
- It
is commonly used for storing operating systems, software, documents, videos,
and other files.
- HDD
provides large storage capacity at a lower cost compared to SSDs.
- It
has slower data access speed because it contains moving mechanical parts.
- HDDs
are available in different capacities, such as 500GB, 1TB, 2TB, and more.
- Commonly
used in desktop computers, servers, and external storage devices.
Organization
of Hard Disk
- A
hard disk is organized into several parts that work together to store and
retrieve data efficiently.
- Data
is stored magnetically on rotating platters and accessed by read/write heads.
- The
organization of a hard disk helps the operating system locate and manage stored
files.
Components of Hard Disk Organization
1.
Platters
- Platters are circular magnetic disks where data is permanently stored.
- A hard disk may contain one or more platters.
- Both sides of each platter can store data.
2.
Tracks
- Tracks
are concentric circular paths on the surface of a platter.
- Data
is written and read along these circular paths.
- Each
platter surface contains many tracks.
3.
Sectors
- Sectors
are small divisions of a track used to store data.
- Each
sector stores a fixed amount of data, usually 512 bytes or 4096 bytes (4 KB).
- Sectors
are the smallest physical storage units on a hard disk.
4.
Clusters
- A
cluster is a group of one or more sectors.
- The
operating system stores files in clusters instead of individual sectors.
- Larger
files occupy multiple clusters.
5.
Cylinder
- A
cylinder is formed by tracks of the same position on all platters.
- It
allows faster data access without moving the read/write head to another track.
- Cylinders
help organize data across multiple platters.
6.
Read/Write Head
- A
read/write head reads data from and writes data to the platter surface.
- Each
platter surface has its own read/write head.
- The
heads move across the platters to access different tracks.
7.
Spindle
- The
spindle holds the platters together and rotates them at high speed.
- Common
speeds are 5400 RPM and 7200 RPM.
- Faster
rotation provides quicker data access.
Importance
of Hard Disk Organization
- Enables
efficient storage and retrieval of data.
- Improves
file management and disk performance.
- Reduces
the time required to access stored information.
- Supports
reliable and organized data storage.
Working
of Hard Disk
- The
platter rotates at high speed using the spindle.
- The
read/write head moves over the platter surface.
- The
head reads data from or writes data to specific tracks and sectors.
- The
disk controller manages the data transfer between the hard disk and computer.
CPU
Architecture
- CPU
(Central Processing Unit) architecture refers to the design and organization of
the internal components of a processor.
- It
defines how the CPU processes instructions, manages data, and communicates with
other computer components.
- CPU
architecture determines the speed, performance, and efficiency of a computer
system.
- It
includes components such as the Control Unit, Arithmetic Logic Unit, Registers,
and Cache Memory.
- Modern
CPUs use advanced architectures to perform multiple operations quickly and
efficiently.
Components
of CPU Architecture
1.
Control Unit (CU)
- Controls
and coordinates all activities of the CPU.
- Fetches
instructions from memory and decodes them for execution.
- Manages
the flow of data between CPU, memory, and input/output devices.
2.
Arithmetic Logic Unit (ALU)
- Performs
arithmetic operations such as addition, subtraction, multiplication, and
division.
- Performs
logical operations such as comparisons and decision-making.
- Processes
data according to instructions provided by the Control Unit.
3.
Registers
- Small
and high-speed storage locations inside the CPU.
- Temporarily
store data, instructions, and intermediate results.
- Help
the CPU execute instructions faster.
4.
Cache Memory
- A
high-speed memory located inside or near the CPU.
- Stores
frequently used data and instructions.
- Reduces
the time needed to access information from main memory.
5.
Buses
- Buses
are communication pathways that transfer data between CPU and other components.
- Data
Bus transfers actual data.
- Address
Bus carries memory addresses.
- Control
Bus carries control signals.
•
CPU
Instruction Cycle
1.
Fetch
•
The
CPU retrieves an instruction from memory.
•
The
address of the instruction is stored in the Program Counter (PC).
2.
Decode
•
The
Control Unit interprets the instruction.
•
Determines
what operation needs to be performed.
3.
Execute
•
The
CPU performs the required operation using the ALU or other components.
•
Results
are stored in registers or memory.
4.
Store
•
The
result of the operation is saved for future use.
Types
of CPU Architecture
1.
Von Neumann Architecture
- Uses
a single memory unit to store both data and instructions.
- Data
and instructions are transferred through the same bus.
- Works
on the fetch-decode-execute cycle.
- It
is simple, cost-effective, and widely used in general-purpose computers.
- A
limitation is the Von Neumann bottleneck, where data and instructions compete
for the same memory path.
- Used
in desktop computers, laptops, and many general-purpose systems.
Main
Features
- Uses a single memory for storing both data
and instructions.
- Uses a common bus system for transferring data and
instructions between CPU and memory.
- Instructions are executed sequentially, one after another.
- Uses a Program Counter (PC) to keep track of
the next instruction.
- CPU consists of:
- Arithmetic Logic Unit (ALU) for
calculations and logical operations.
- Control Unit (CU) for controlling
instruction execution.
- Registers for temporary
data storage.
- Data and instructions are
transferred through the same communication pathway.
Advantages
of Von Neumann Architecture
- Simple and easy to design.
- Requires less hardware
because data and instructions share the same memory.
- Less expensive compared to
separate memory architectures.
- Flexible because programs
can be modified easily.
- Suitable for general-purpose
computers.
- Allows programs to be stored
and executed automatically.
Disadvantages of
Von Neumann Architecture
- Von Neumann Bottleneck:
- Data and instructions use
the same bus, causing delays in processing.
- CPU cannot fetch
instructions and access data simultaneously.
- Slower performance compared
to architectures with separate memory systems.
- Memory speed limits overall
system performance.
- Heavy data transfer can
reduce CPU efficiency.
- Limited parallel processing
capability.
Applications of
Von Neumann Architecture
- Desktop computers.
- Laptops.
- Servers.
- General-purpose computing
systems.
- Many modern computer
systems.
2.
Harvard Architecture
- Uses
separate memory units for data and instructions.
- Has
separate buses for transferring data and instructions.
- Allows
data and instructions to be accessed simultaneously.
- Provides
faster processing compared to Von Neumann architecture.
- Commonly
used in microcontrollers, embedded systems, and digital signal processors.
Main
Features
- Uses separate memories:
- Instruction Memory – stores
program instructions.
- Data Memory – stores data
used by programs.
- Uses separate buses for
transferring instructions and data.
- Allows simultaneous
instruction fetching and data access.
- Provides faster processing
compared to Von Neumann Architecture.
- Reduces memory access
conflicts.
- Commonly used in embedded systems and specialized processors.
Advantages of
Harvard Architecture
- Faster execution because
instructions and data can be accessed simultaneously.
- Reduces the bottleneck
caused by shared memory.
- Provides better performance
for real-time applications.
- Allows different memory
technologies to be used for instructions and data.
- Improves CPU efficiency.
- Supports parallel
processing.
Disadvantages of
Harvard Architecture
- More complex hardware
design.
- Requires separate memory
units and buses.
- Higher implementation cost.
- Less flexible because
instruction memory and data memory are separated.
- Memory utilization can be
inefficient if one memory area is unused.
Applications of
Harvard Architecture
- Microcontrollers.
- Digital Signal Processors
(DSPs).
- Embedded systems.
- Robotics systems.
- Audio and video processing
devices.
- Automotive control systems.
3.
RISC Architecture (Reduced Instruction Set Computer)
- Uses
a small set of simple instructions.
- Instructions
are executed quickly, usually in a single clock cycle.
- Requires
fewer transistors and provides high efficiency.
- Uses
more registers to improve performance.
- Examples:
ARM processors used in smartphones and tablets.
4.
CISC Architecture (Complex Instruction Set Computer)
- Uses
a large set of complex instructions.
- A
single instruction can perform multiple operations.
- Reduces
the number of instructions needed to complete a task.
- Requires
more hardware complexity.
- Examples:
x86 processors used in personal computers.
Difference
Between RISC and CISC
I/O
Management
- I/O
(Input/Output) Management is the function of an operating system that controls
and manages communication between the CPU, memory, and input/output devices.
- It
provides a standard way for applications to interact with hardware devices.
- Ensures
efficient data transfer between the computer and external devices.
- Manages
device allocation, device drivers, buffering, and error handling.
- Improves
the performance and reliability of input/output operations.
Functions
of I/O Management
1.
Device Control
•
Controls
and coordinates the operation of input and output devices.
•
Sends
commands to devices through device drivers.
•
Ensures
devices work properly with the operating system.
2.
Device Scheduling
•
Determines
the order in which I/O requests are processed.
•
Reduces
waiting time and improves system performance.
•
Manages
multiple requests from different programs.
3.
Buffering
•
Uses
temporary memory areas to store data during transfer.
•
Helps
match the speed difference between CPU and I/O devices.
•
Improves
efficiency of data transfer operations.
4.
Error Handling
•
Detects
and manages errors during I/O operations.
•
Reports
device failures and communication problems.
•
Helps
maintain system reliability.
I/O
Interface
- An I/O (Input/Output) Interface is a
hardware component that acts as a communication link between the CPU, memory, and peripheral devices.
- It allows the computer
system to communicate with external devices such as keyboards, monitors,
printers, storage devices, and network devices.
- Since CPU and peripheral
devices operate at different speeds and use different data formats, the
I/O interface manages communication between them.
- It provides control, data
transfer, and synchronization between the processor and input/output
devices.
Functions of I/O Interface
1. Data Transfer
- Transfers data between the
CPU and input/output devices.
- Controls the movement of
data through buses.
- Ensures accurate and
reliable communication.
2. Device
Control
- Sends control signals to
connected devices.
- Manages operations such as
reading, writing, starting, and stopping devices.
3. Data
Conversion
- Converts data between
different formats used by the CPU and peripheral devices.
- Converts serial data into
parallel data and vice versa when required.
4. Speed
Matching
- Handles speed differences
between the CPU and slower peripheral devices.
- Uses buffering techniques to
prevent data loss.
5. Error
Detection and Handling
- Detects communication errors
during data transfer.
- Reports errors to the CPU
for correction.
6. Device
Selection
- Identifies and selects the
appropriate input/output device for communication.
Components of I/O Interface
1. Data
Registers
- Temporarily store data being
transferred between CPU and devices.
- Hold input data before
sending it to the CPU.
- Hold output data before
sending it to external devices.
2. Status
Registers
- Store information about the
current condition of an I/O device.
- Indicate whether a device is
ready, busy, or has encountered an error.
3. Control
Registers
- Store control commands sent
by the CPU.
- Used to configure and
operate I/O devices.
4. Address
Decoder
- Identifies the specific I/O
device selected by the CPU.
- Ensures data is sent to the
correct device.
5. Bus Interface
- Provides communication
between the CPU and I/O devices.
- Uses data bus, address bus,
and control bus.
Types of I/O Interfaces
1. Serial Interface
- Transfers data one bit at a time through a single
communication line.
- Suitable for long-distance
communication.
- Requires fewer wires.
- Provides reliable
communication.
Examples:
·
USB
·
RS-232
·
Serial
communication ports
Advantages:
·
Low
cost.
·
Simple
design.
·
Suitable
for external devices.
Disadvantages:
·
Slower
compared to parallel communication.
2. Parallel Interface
- Transfers multiple bits
simultaneously using multiple data lines.
- Provides faster data
transfer over short distances.
- Commonly used in older
computer systems.
Examples:
·
Parallel
printer ports.
·
Older
storage interfaces.
Advantages:
·
Faster
data transfer.
·
Efficient
for short-distance communication.
Disadvantages:
·
Requires
more wires.
·
More
expensive and complex.
3. USB (Universal Serial Bus) Interface
- A widely used interface for
connecting peripheral devices.
- Supports data transfer and
power supply.
- Allows multiple devices to
be connected.
Examples:
·
Keyboard
·
Mouse
·
External
storage devices
·
Printers
Advantages:
·
Plug-and-play
support.
·
High-speed
data transfer.
·
Easy
to use.
4. Wireless I/O Interface
- Transfers data without
physical cables.
- Uses wireless communication
technologies.
Examples:
·
Bluetooth
·
Wi-Fi
·
NFC
Advantages:
·
Provides
mobility.
·
Reduces
cable connections.
Disadvantages:
·
May
have security risks.
·
Depends
on signal strength.
Methods of I/O Data Transfer
1. Programmed I/O
- CPU controls all data
transfer operations.
- CPU continuously checks the
status of the device.
- Simple but wastes CPU time.
Advantages:
·
Easy
to implement.
·
Low
hardware cost.
Disadvantages:
·
CPU
remains busy during data transfer.
2. Interrupt-Driven I/O
- Device sends an interrupt
signal to the CPU when it needs attention.
- CPU performs other tasks
until an interrupt occurs.
- Improves CPU efficiency.
Advantages:
·
Better
CPU utilization.
·
Faster
response compared to programmed I/O.
Disadvantages:
·
Requires
interrupt handling hardware.
3. Direct Memory Access (DMA)
- Allows I/O devices to
transfer data directly to or from memory without continuous CPU
involvement.
- A DMA controller manages
data transfer.
- Improves performance for
large data transfers.
Advantages:
·
Reduces
CPU workload.
·
Provides
faster data transfer.
Disadvantages:
·
Requires
additional hardware.
·
More
complex design.
Advantages of I/O Interface
- Provides communication
between CPU and peripherals.
- Improves system performance.
- Reduces CPU workload.
- Supports different types of
devices.
- Provides error detection and
device management.
- Allows expansion of computer
systems.
Disadvantages of I/O Interface
- Adds hardware complexity.
- Requires additional cost.
- May slow communication due
to device limitations.
- Requires proper device
drivers for operation.
Steps
of I/O Request Handling
1.
Request Generation
•
A
program sends an I/O request to the operating system.
•
The
request specifies the required operation and device.
2.
Request Processing
•
The
operating system checks the request and identifies the required device.
•
It
communicates with the device driver to perform the operation.
3.
Device Operation
•
The
device controller performs the requested input or output task.
•
Data
is transferred between the device and memory.
4.
Completion and Notification
•
The
device sends a signal when the operation is completed.
•
The
operating system informs the requesting program about the result.
I/O
Devices
- I/O (Input/Output) Devices are hardware
components that allow a computer system to communicate with the outside
world.
- Input
devices
are used to enter data and instructions into the computer.
- Output
devices
are used to display or provide processed information from the computer.
- Some devices perform both
input and output functions and are called I/O devices.
- I/O devices are connected to
the CPU through I/O interfaces and controllers.
Types of I/O Devices
1. Input Devices
Input devices
allow users to enter data and instructions into a computer system.
a. Keyboard
- A keyboard is a common input
device used to enter text, numbers, and commands.
- It contains different keys
such as alphabet keys, numeric keys, function keys, and control keys.
- Converts user keystrokes
into digital signals.
- Commonly used for typing
documents and entering commands.
b. Mouse
- A mouse is a pointing device
used to control the movement of the cursor on the screen.
- Allows users to select,
open, move, and interact with objects.
- Common types include:
- Optical mouse
- Wireless mouse
- Mechanical mouse
c. Scanner
- A scanner converts physical
documents and images into digital form.
- Used for creating electronic
copies of documents.
- Commonly used in offices,
schools, and businesses.
d. Microphone
- A microphone converts sound
signals into digital audio data.
- Used for voice recording,
video calls, and speech recognition.
e. Webcam
- A webcam captures images and
videos.
- Used for online meetings,
video calls, and security systems.
f. Joystick
- A joystick is a control
device mainly used for gaming and simulations.
- Allows users to control
movement and direction.
g. Touch Screen
- A touchscreen acts as both
an input and output device.
- Allows users to provide
input by touching the display.
- Commonly used in
smartphones, tablets, and ATMs.
2. Output Devices
Output devices
display or provide processed information from a computer.
a. Monitor
- A monitor is an output
device that displays text, images, and videos.
- It uses a display screen to
show information.
- Common types include:
- LCD (Liquid Crystal
Display)
- LED (Light Emitting Diode)
- OLED (Organic LED)
b. Printer
- A printer is an output
device that produces a hard copy (physical copy) of digital documents,
images, and other information stored in a computer.
- It converts electronic
data into printed output on paper or other materials.
- Printers are
commonly used in homes, offices, schools, and industries.
- The quality of
printed output is measured in DPI (Dots Per Inch).
- Higher DPI
provides better print quality and sharper images.
Functions of Printer
- Converts digital information
into physical form.
- Prints text, images,
graphics, and documents.
- Provides permanent records
of electronic data.
- Supports color and
black-and-white printing.
- Allows users to create
reports, photographs, and other printed materials.
Types of Printers:
1. Impact Printers
·
Impact
printers are printers that print by physically striking an ink ribbon against
paper.
·
They
use mechanical movement to create printed characters.
·
They
are generally slower and produce more noise compared to non-impact printers.
·
Examples:
a. Dot Matrix Printer
·
A
dot matrix printer creates characters and images using a print head containing
small pins that strike an ink ribbon.
·
Pins
hit the ribbon and transfer ink onto paper.
·
A
combination of dots forms letters and images.
Advantages:
·
Cheap to operate.
·
Durable and reliable.
·
Suitable for continuous forms.
·
Can print multiple copies.
Disadvantages:
·
Noisy operation.
·
Slow printing speed.
·
Low-quality graphics.
·
Limited color printing.
b.
Daisy Wheel Printer
- A daisy wheel
printer is an impact printer that uses a rotating wheel with characters on
its petals.
- A hammer strikes
the selected character against an ink ribbon.
- Produces
high-quality text output.
- Works like a
typewriter.
- Cannot print
graphics.
Advantages:
·
Good
quality text printing.
·
Reliable
and simple design.
Disadvantages:
·
Very
slow.
·
No
graphics support.
·
Noisy
operation.
c.
Line Printer
- A line printer
prints an entire line of text at one time.
- It is designed for
high-volume printing.
- Very high
printing speed.
- Suitable for
large organizations.
- Uses continuous
paper.
Advantages:
·
Fast
printing.
·
Low
cost per page.
·
Suitable
for bulk printing.
Disadvantages:
·
Large
and expensive.
·
Noisy.
·
Poor
graphics quality
2. Non-Impact Printers
·
Print
without physical contact.
·
Non-impact
printers print without physically touching the paper.
·
They
use technologies such as ink spraying, laser beams, and heat.
·
They
provide faster and higher-quality printing.
Types of Non-Impact
Printers
a. Inkjet Printer
·
Inkjet
printers produce output by spraying tiny droplets of liquid ink onto paper.
·
The
print head moves across the paper.
·
Small
nozzles spray ink droplets.
·
These
droplets form text and images.
Features:
·
Uses
ink cartridges.
·
Supports
color printing.
·
Provides
high-quality image printing.
·
Suitable
for home use.
Advantages:
·
Low
purchase cost.
·
Excellent
color output.
·
Good
for photo printing.
·
Compact
design.
Disadvantages:
·
Ink
cartridges are costly.
·
Slower
than laser printers.
·
Ink
may dry when unused.
Uses:
·
Home
printing.
·
Photo
printing.
·
Small
offices.
b. Laser Printer
·
Laser
printers use laser technology and toner powder to produce printed output.
·
A
laser beam creates an image on a drum.
·
Toner
powder sticks to the image area.
·
Heat
transfers toner onto paper.
Features:
·
High-speed
printing.
·
Produces
sharp text.
·
Uses
toner cartridges.
·
Suitable
for large printing tasks.
Advantages:
·
Fast
printing speed.
·
High-quality
output.
·
Low
cost per page.
·
Suitable
for offices.
Disadvantages:
·
Higher
initial cost.
·
Color
models are expensive.
·
Larger
size.
Uses:
·
Offices.
·
Schools.
·
Businesses.
c. Thermal Printer
·
Thermal
printers use heat to create images on specially coated paper.
·
A
thermal print head applies heat to the paper.
·
Heat
creates text or images.
Types of
Thermal Printers:
1.
Direct Thermal Printer
o
Prints
directly on heat-sensitive paper.
o
Commonly
used for receipts.
2.
Thermal Transfer Printer
o
Uses
a ribbon to transfer ink onto paper.
o
Produces
more durable prints.
Features:
·
Fast
and quiet operation.
·
Requires
little maintenance.
·
Does
not use ink cartridges.
Advantages:
·
Low
maintenance.
·
Fast
printing.
·
Quiet
operation.
Disadvantages:
·
Special
paper is required.
·
Prints
may fade over time.
Uses:
·
ATM
receipts.
·
Barcode
printing.
·
Point-of-sale
systems.
c.
Speaker
- Speakers convert digital
audio signals into sound.
- Used for music, videos, and
communication.
d. Projector
- A projector displays
computer output on a large screen.
- Commonly used in classrooms,
meetings, and presentations.
e. Plotter
- A plotter produces
high-quality graphical output.
- Used for engineering drawings, maps, and architectural designs.
Importance
of I/O Management
- Provides
communication between CPU and external devices.
- Improves
speed and efficiency of data transfer.
- Allows
multiple devices to work together smoothly.
- Ensures
proper control and error handling of I/O operations.

