COMPUTER HARDWARE AND SOFTWARE
UNIT-2
Input Output Devices:
The devices which are a means of communication between the computer and the
outside world are called as peripheral devices.
Those peripheral devices which supply information i.e. data and programs from
the outside world to the computer are the input devices.
Examples: Keyboard, Mouse, Joy Stick, Light pen, Track Ball, Scanner, Graphic Tablet,
and Microphone.
Those peripheral devices which give information from the computer to the user or
store them in secondary storage devices, like floppy disks or tapes for future use
are called output devices.
Examples: Monitor, Printer, Speakers, Projectors, headphones.
What is a Software?
In a computer system, the software is basically a set of instructions or commands that tell
a computer what to do. In other words, the software is a computer program that provides a
set of instructions to execute a user’s commands and tell the computer what to do. For
example like MS-Word, MS-Excel, PowerPoint, etc.
Types of Software
The chart below describes the types of software:
Above is the diagram of types of software. Now we will briefly describe each type and its
subtypes:
1. System Software
● Operating System
● Language Processor
● Device Driver
2. Application Software
● General Purpose Software
● Customize Software
● Utility Software
System Software
System software is software that directly operates the computer hardware and provides
the basic functionality to the users as well as to the other software to operate smoothly. Or
in other words, system software basically controls a computer’s internal functioning and
also controls hardware devices such as monitors, printers, and storage devices, etc. It is like
an interface between hardware and user applications, it helps them to communicate with
each other because hardware understands machine language(i.e. 1 or 0) whereas user
applications are work in human-readable languages like English, Hindi, German, etc. so
system software converts the human-readable language into machine language and vice
versa.
Types of System Software
It has two subtypes which are:
1. Operating System: It is the main program of a computer system. When the computer
system ON it is the first software that loads into the computer’s memory. Basically, it
manages all the resources such as computer memory, CPU, printer, hard disk, etc., and
provides an interface to the user, which helps the user to interact with the computer
system. It also provides various services to other computer software. Examples of
operating systems are Linux, Apple macOS, Microsoft Windows, etc.
2. Language Processor: As we know that system software converts the human-readable
language into a machine language and vice versa. So, the conversion is done by the
language processor. It converts programs written in high-level programming languages
like Java, C, C++, Python, etc(known as source code), into sets of instructions that are
easily readable by machines(known as object code or machine code).
3. Device Driver: A device driver is a program or software that controls a device and helps
that device to perform its functions. Every device like a printer, mouse, modem, etc.
needs a driver to connect with the computer system eternally. So, when you connect a
new device with your computer system, first you need to install the driver of that device
so that your operating system knows how to control or manage that device.
Application Software
Software that performs special functions or provides functions that are much more than
the basic operation of the computer is known as application software. Or in other words,
application software is designed to perform a specific task for end-users. It is a product or
a program that is designed only to fulfill end-users’ requirements. It includes word
processors, spreadsheets, database management, inventory, payroll programs, etc.
Types of Application Software
There are different types of application software and those are:
1. General Purpose Software: This type of application software is used for a variety of
tasks and it is not limited to performing a specific task only. For example, MS-Word,
MS-Excel, PowerPoint, etc.
2. Customized Software: This type of application software is used or designed to
perform specific tasks or functions or designed for specific organizations. For example,
railway reservation system, airline reservation system, invoice management system,
etc.
3. Utility Software: This type of application software is used to support the computer
infrastructure. It is designed to analyze, configure, optimize and maintains the system,
and take care of its requirements as well. For example, antivirus, disk fragmenter,
memory tester, disk repair, disk cleaners, registry cleaners, disk space analyzer, etc.
Relationship between Hardware and Software
● Hardware refers to the tangible or physical components of a computer system.
● Software, on the other hand, represents the collection of programs that instruct
hardware to perform tasks.
● An intimate relationship exists between hardware and software as neither can
work without the other.
Role of Hardware
● Hardware is designed to carry out computations and tasks but it cannot do so
without instructions from software.
● Loved by gamers, Graphics Processing Units (GPUs) need software (games
themselves and drivers) to utilize their raw computing power.
● Central Processing Units (CPUs) need a compatible operating system and
applicable software to perform calculations and process information.
● Peripheral devices, such as printers or scanners, require appropriate software
drivers to function properly with a computer system.
Role of Software
● System software coordinates and controls hardware functionality. The operating
system (OS) is an essential part of system software that manages computer
hardware and software resources.
● Application software, often just called applications, refers to programs designed for
end users. Such programs use an operating system (OS) and hardware to deliver
their function.
● For instance, a word processing app heavily relies on the capabilities of the OS,
CPU (processing), memory (storing document as you work), hard drive (long term
storage), display (visualization) and input devices (keyboard and mouse for
interface).
Interdependence
● Hardware and software are highly interdependent. Without software, hardware is
meaningless and without hardware, software has nothing to run on. They must
cooperate together to execute tasks.
● For example, when a user requests to open an application, the OS (software)
harnesses the CPU (hardware) to launch it.
Evolution
● With advances in technology, the relationship between hardware and software has
become more cooperative rather than strictly hierarchical. New hardware often
inspires new software development, and vice versa.
● Hardware upgrades often require corresponding software updates. This is evident
in new generations of CPUs often necessitating updates to the OS.
● Virtualisation is blurring the lines between hardware and software as software is
used to emulate hardware setups leading to greater flexibility.
Importance of Understanding Relationship
● As aspiring computer scientists, understanding the symbiotic relationship between
hardware and software lets you diagnose and rectify system failures, design
efficient systems, and predict future trends in technology.
Conclusion
● In summary, hardware provides the raw power and structure for the system while
software tells the hardware what, when and how to accomplish tasks. A mutual
understanding and communication exists that makes the functioning of a computer
system possible.
Summery points
● Hardware and software are mutually dependent on each other. Both of
them must work together to make a computer produce a useful output.
● Software cannot be utilized without supporting hardware.
● Hardware without a set of programs to operate upon cannot be utilized and
is useless.
● To get a particular job done on the computer, relevant software should be
loaded into the hardware.
● Hardware is a one-time expense. Software development is very expensive
and is a continuing expense.
● Different software applications can be loaded on a hardware to run
different jobs. A software acts as an interface between the user and the
hardware.
● If the hardware is the 'heart' of a computer system, then the software is its
'soul'. Both are complementary to each other.
Operating System:
An Operating System acts as a communication bridge (interface) between the
user and computer hardware. The purpose of an operating system is to
provide a platform on which a user can execute programs conveniently and
efficiently.
An operating system is a piece of software that manages the allocation of
Computer Hardware.
The main goal of the Operating System is to make the computer environment
more convenient to use and the Secondary goal is to use the resources most
efficiently.
Functions of Operating System
Memory Management
The operating system manages the Primary Memory or Main Memory. Main
memory is made up of a large array of bytes or words where each byte or
word is assigned a certain address. Main memory is fast storage and it can be
accessed directly by the CPU. For a program to be executed, it should be first
loaded in the main memory. An operating system manages the allocation and
deallocation of memory to various processes and ensures that the other
process does not consume the memory allocated to one process. An
Operating System performs the following activities for Memory Management:
● It keeps track of primary memory, i.e., which bytes of memory are
used by which user program. The memory addresses that have
already been allocated and the memory addresses of the memory
that has not yet been used.
● In multiprogramming, the OS decides the order in which processes
are granted memory access, and for how long.
● It Allocates the memory to a process when the process requests it
and deallocates the memory when the process has terminated or is
performing an I/O operation.
Processor Management
In a multiprogramming environment, the OS decides the order in which
processes have access to the processor, and how much processing time each
process has. This function of OS is called Process Scheduling. An Operating
System performs the following activities for Processor Management.
● An operating system manages the processor’s work by allocating
various jobs to it and ensuring that each process receives enough time
from the processor to function properly.
● Keeps track of the status of processes. The program which performs
this task is known as a traffic controller. Allocates the CPU that is a
processor to a process. De-allocates processor when a process is no
longer required.
Device Management
An OS manages device communication via its respective drivers. It performs
the following activities for device management.
● Keeps track of all devices connected to the system. Designates a
program responsible for every device known as the Input/Output
controller.
● Decide which process gets access to a certain device and for how
long.
● Allocates devices effectively and efficiently. Deallocates devices
when they are no longer required.
● There are various input and output devices. An OS controls the
working of these input-output devices.
● It receives the requests from these devices, performs a specific task,
and communicates back to the requesting process.
File Management
A file system is organized into directories for efficient or easy navigation and
usage. These directories may contain other directories and other files. An
Operating System carries out the following file management activities. It
keeps track of where information is stored, user access settings, the status of
every file, and more. These facilities are collectively known as the file system.
An OS keeps track of information regarding the creation, deletion, transfer,
copy, and storage of files in an organized way. It also maintains the integrity
of the data stored in these files, including the file directory structure, by
protecting against unauthorized access.
User Interface or Command Interpreter
The user interacts with the computer system through the operating system.
Hence OS acts as an interface between the user and the computer hardware.
This user interface is offered through a set of commands or a graphical user
interface (GUI). Through this interface, the user makes interacts with the
applications and the machine hardware.
Booting the Computer
The process of starting or restarting the computer is known as booting. If the
computer is switched off completely and if turned on then it is called cold
booting. Warm booting is a process of using the operating system to restart
the computer.
Security
The operating system uses password protection to protect user data and
similar other techniques. it also prevents unauthorized access to programs
and user data. The operating system provides various techniques which
assure the integrity and confidentiality of user data. The following security
measures are used to protect user data:
● Protection against unauthorized access through login.
● Protection against intrusion by keeping the firewall active.
● Protecting the system memory against malicious access.
● Displaying messages related to system vulnerabilities.
Control Over System Performance
Operating systems play a pivotal role in controlling and optimizing system
performance. They act as intermediaries between hardware and software,
ensuring that computing resources are efficiently utilized. One fundamental
aspect is resource allocation, where the OS allocates CPU time, memory, and
I/O devices to different processes, striving to provide fair and optimal
resource utilization. Process scheduling, a critical function, helps decide
which processes or threads should run when preventing any single task from
monopolizing the CPU and enabling effective multitasking.
Job Accounting
The operating system Keeps track of time and resources used by various
tasks and users, this information can be used to track resource usage for a
particular user or group of users. In a multitasking OS where multiple
programs run simultaneously, the OS determines which applications should
run in which order and how time should be allocated to each application.
Error-Detecting Aids
The operating system constantly monitors the system to detect errors and
avoid malfunctioning computer systems. From time to time, the operating
system checks the system for any external threat or malicious software
activity. It also checks the hardware for any type of damage. This process
displays several alerts to the user so that the appropriate action can be taken
against any damage caused to the system.
Coordination Between Other Software and Users
Operating systems also coordinate and assign interpreters, compilers,
assemblers, and other software to the various users of the computer systems.
In simpler terms, think of the operating system as the traffic cop of your
computer. It directs and manages how different software programs can share
your computer’s resources without causing chaos. It ensures that when you
want to use a program, it runs smoothly without crashing or causing
problems for others. So, it’s like the friendly officer ensuring a smooth flow of
traffic on a busy road, making sure everyone gets where they need to go
without any accidents or jams.
Performs Basic Computer Tasks
The management of various peripheral devices such as the mouse, keyboard,
and printer is carried out by the operating system. Today most operating
systems are plug-and-play. These operating systems automatically recognize
and configure the devices with no user interference.
Multiprogramming
Multiprogramming is an essential technique in modern operating systems that allows
multiple programs or processes to execute simultaneously by sharing the system's
resources like CPU, memory, and I/O devices. Although the programs do not actually run at
the same time (except in systems with multiple processors), the operating system quickly
switches between them, creating the appearance of concurrent execution.
Example: Imagine you are using your smartphone and performing several tasks
simultaneously:
● Task 1: Listening to Music (Spotify)
● Task 2: Downloading a File
● Task 3: Browsing the Web
How Multiprogramming Works Here
○ The smartphone's operating system (e.g., Android or iOS) keeps all these tasks
active in memory. It rapidly switches between them to make sure none of the tasks is
paused for too long.
○ While you're listening to music, the Spotify app is using network resources to stream
audio. When the app is fetching the next part of the song (I/O), it waits for data, so
the operating system switches to another task like downloading a file or updating
the web browser. This way, while the music app waits for network data, other tasks
make use of the CPU.
Features of Multiprogramming
● Need Single CPU for implementation.
● Context switch between process.
● Switching happens when current process undergoes waiting state.
● CPU idle time is reduced.
● High resource utilization.
● High Performance.
Advantages of Multiprogramming
1. Increased CPU Utilization: The CPU is kept busy by switching to another process when
one is waiting for I/O.
2. Throughput: More processes are completed in a given amount of time because the
system efficiently allocates resources.
3. Reduced Idle Time: By overlapping CPU and I/O activities of different processes, the
system minimizes idle time.
4. Responsiveness: The system appears more responsive to the user, as multiple
processes can run in parallel.
Disadvantages of Multiprogramming
1. Complexity: Managing multiple processes, memory, and I/O efficiently requires
sophisticated algorithms and mechanisms.
2. Context Switching Overhead: Frequent context switching between processes can lead
to performance degradation due to the overhead of saving and loading process states.
3. Resource Contention: Multiple processes may compete for limited resources, leading to
bottlenecks (e.g., CPU time, memory, I/O devices).
4. Deadlock: If processes are improperly managed, they may get stuck in a deadlock
situation where they all wait indefinitely for each other to release resources.
Multitasking
It is the ability of an operating system to execute multiple tasks or processes
simultaneously, or at least make it appear as though they are happening at the same time.
It's an extension of multiprogramming, where not only multiple programs are in memory,
but they are also quickly switched between in such a way that users experience them as
running simultaneously.
Example: You might have multiple programs open, like a web browser, video editing
software, and a music player, all running simultaneously. While you're actively working in
one, others run in the background without freezing or crashing.
Benefits of Multitasking
1. Increased Productivity: Users can run multiple applications at the same time, like
writing a document while keeping an eye on emails.
2. Better CPU Utilization: The CPU is always busy doing useful work, switching
between tasks that need attention at any given time.
3. User Convenience: Users can switch between tasks without closing applications,
which is key to a seamless user experience.
Challenges in Multitasking
1. Overhead of Context Switching: Constantly switching between tasks (saving and
restoring their states) introduces overhead, which can reduce performance.
2. Resource Contention: Multiple tasks compete for the same resources (CPU,
memory, etc.), which can slow down the system if it’s overwhelmed.
3. Deadlock and Starvation: Poor scheduling or resource management can cause
deadlocks (where tasks are waiting indefinitely) or starvation (where certain tasks
never get CPU time).
Difference Between Multiprogramming and Multitasking
Multiprogramming Multi-tasking
It uses multiple tasks for the task
It includes the single CPU to execute allocation within the same CPU,
the program. allowing it to manage and execute
several operations concurrently.
Concept of Context Switching and
Concept of Context Switching is used.
Time Sharing is used.
The processor is typically used in time
In multiprogrammed system, the sharing mode. Switching happens
operating system simply switches to, when either allowed time expires or
and executes, another job when current where there other reason for current
job needs to wait. process needs to wait (example
process needs to do IO).
In multi-tasking also increases CPU
Multiprogramming increases CPU
utilization, it also increases
utilization by organizing jobs .
responsiveness.
The idea is to further extend the CPU
The idea is to reduce the CPU idle time
Utilization concept by increasing
for as long as possible.
responsiveness Time Sharing.
It uses job scheduling algorithms so Time sharing mechanism is used so
that more than one program can run at that multiple tasks can run at the
the same time. same time.
Promotions, personalized shopping
In community edition, personalized
experiences can be displayed in
shopping experiences is not created.
enterprise edition products.
Execution of process takes more time. Execution of process takes less time.
Multithreading in operating systems is a programming technique that allows multiple
threads to exist within a single process, sharing resources and enabling parallel execution.
Think of it like having multiple hands working together to complete different parts of a job
faster. Each “hand” is called a thread, and they help make programs run more efficiently.
Example: Downloading the file and viewing it simultaneously.
Here are some key concepts and components:
Thread vs. Process
Process: An independent execution unit with its own memory space. Each process has its
own resources, including memory and file descriptors.
Thread: A lightweight unit of execution that exists within a process. Threads share the
same memory space, allowing for faster communication but also introducing potential
issues like race conditions.
Benefits of Multithreading
● Responsiveness: Applications can remain responsive while performing background
tasks.
● Resource Sharing: Threads share memory and resources, reducing overhead.
● Performance: On multi-core processors, threads can run in parallel, improving
performance.
Challenges
● Race Conditions: Occur when multiple threads access shared data simultaneously
and modify it.
● Deadlock: A situation where two or more threads are blocked forever, waiting for
each other.
● Starvation: A thread is perpetually denied the resources it needs to proceed.
Multiprocessing in operating systems refers to the ability of a system to support
multiple processes simultaneously. It enables the execution of multiple programs or tasks
in parallel by using multiple CPU to enhance performance.
Example: when Zoey has an accounting application and spreadsheet open at the same
time, one processor will continue to work on the accounting software while the second
processor will work on the spreadsheet computations.
Benefits of Multiprocessing
● Performance: By utilizing multiple CPU cores, tasks can be executed in parallel,
significantly reducing the overall execution time.
● Isolation: Processes are isolated from each other, meaning that a crash in one
process doesn’t affect others.
● Concurrency: Allows multiple processes to run at the same time, improving the
responsiveness of applications.
Challenges
● Overhead: Creating and managing processes can be more resource-intensive than
managing threads.
● Complexity: Handling communication and synchronization between processes can
add complexity.
● Resource Contention: Multiple processes competing for system resources can lead
to performance degradation.
Multiprocessing Models
● Symmetric Multiprocessing (SMP): All processors share the same memory and I/O
resources.
● Asymmetric Multiprocessing (AMP): Each processor has its own memory and I/O
resources, with one processor acting as the master.
Time-sharing operating systems These are designed to allow multiple users to
share system resources simultaneously.
This short period of time during which the user gets the attention of the CPU is known as
time slice, time slot, or quantum.
Key Features
1. Multiprogramming: Multiple programs can be loaded into memory and executed
concurrently, maximizing CPU usage.
2. User Interaction: Time-sharing systems provide quick response times, allowing
users to interact with the system in real-time.
3. Time Slices: The CPU time is divided into small intervals, or time slices, which are
allocated to different users or processes, giving the illusion that they are running
simultaneously.
4. Resource Management: The OS manages resources such as CPU, memory, and I/O
devices to ensure fair access among users.
5. Multi-user Environment: Supports multiple users logging in from different
terminals, allowing for collaborative work.
Advantages
● Efficiency: Better resource utilization compared to batch processing systems.
● Interactivity: Users can interact with the system, leading to a more dynamic
computing experience.
● Cost-effective: Makes it feasible for organizations to support multiple users on a
single system.
Applications
Time-sharing systems are commonly used in academic environments, research institutions,
and businesses where multiple users need access to computing resources simultaneously.
Real-time operating system (RTOS) is a special kind of operating system designed
to handle tasks that need to be completed quickly and on time. Unlike general-purpose
operating systems (GPOS), which are good at multitasking and user interaction, RTOS
focuses on doing things in real time.
Key Features
1. Determinism: Guarantees that tasks will be executed within a specified time frame,
ensuring predictable behavior.
2. Task Scheduling: Uses specialized scheduling algorithms (e.g., rate monotonic
scheduling, earliest deadline first) to prioritize tasks based on their timing
requirements.
3. Interrupt Handling: Supports quick response to external events through efficient
interrupt handling mechanisms.
4. Multitasking: Allows multiple tasks to run concurrently, often with strict timing
constraints.
5. Resource Management: Manages system resources to meet the timing
requirements of applications.
Types of Real-Time Systems
1. Hard Real-Time Systems: Missing a deadline could lead to catastrophic
consequences (e.g., medical devices, automotive safety systems).
2. Soft Real-Time Systems: Missing a deadline may degrade performance but does
not result in failure (e.g., video streaming, online gaming).
3. Firm Real-Time Systems: A deadline can be missed, but doing so may mean that
the result is no longer useful (e.g., some types of telecommunication).
Advantages
● Predictability: Ensures that critical tasks are completed on time.
● Performance: Optimized for time-sensitive applications, leading to better system
responsiveness.
● Efficiency: Minimizes latency and maximizes throughput for real-time applications.
Applications
● Embedded Systems: Used in devices like medical equipment, automotive control
systems, and industrial automation.
● Telecommunications: Manages call processing and data transmission.
● Aerospace and Defense: Controls navigation and flight systems.
● Consumer Electronics: Found in devices like digital cameras and gaming consoles.
Single-User Operating System
Definition: An operating system designed to manage the resources of a computer for one
user at a time.
Characteristics:
● User Interface: Simple and tailored for individual use.
● Resource Allocation: All system resources are dedicated to the single user,
optimizing performance for their applications.
● Examples:
○ Windows (home versions)
○ macOS
○ Android
Advantages:
● Ease of Use: Simpler to navigate and manage.
● Performance: Optimized for a single user, often leading to better responsiveness.
Disadvantages:
● Limited Functionality: Cannot support multiple users simultaneously.
● Resource Wastage: Resources may be underutilized when not actively used by the
single user.
Multi-User Operating System
Definition: An operating system that allows multiple users to access and use the computer
resources simultaneously.
Characteristics:
● User Management: Supports multiple accounts with permissions and roles for
resource management.
● Resource Sharing: Resources are allocated among users, often using time-sharing
techniques.
● Examples:
○ UNIX
○ Linux
○ Windows Server
Advantages:
● Resource Efficiency: Better utilization of system resources among users.
● Collaboration: Enables multiple users to work together on projects or share files
easily.
Disadvantages:
● Complexity: More complex setup and management due to user permissions and
resource allocation.
● Potential Performance Issues: Performance may degrade with too many
simultaneous users, depending on resource limits.
Comparison Table
Aspect Single-User OS Multi-User OS
Definition Manages resources for one Manages resources for multiple
user users
User Interface Simple, personal-focused More complex, supports user
management
Resource All resources for one user Resources shared among users
Allocation
Performance Optimized for individual use May vary with user load
Examples Windows (home), macOS, UNIX, Linux, Windows Server
Android