5 Coa
5 Coa
Cache Memory
Characteristics
• Location
• Capacity
• Unit of transfer
• Access method
• Performance
• Physical type
• Physical characteristics
• Organisation
Access Methods
Random
Individual addresses identify locations exactly
Access time is independent of location or previous access
e.g. RAM
Associative
Data is located by a comparison with contents of a portion of the store
Access time is independent of location or previous access
e.g. cache
In CPU
• Internal or Main memory
Backing store
Performance
• Access time
Time between presenting the address and getting the valid data
• Memory Cycle time
Time may be required for the memory to “recover” before next access
Cycle time is access + recovery
• Transfer Rate
Rate at which data can be moved
Cache
Small amount of fast memory
Sits between normal main memory and CPU
May be located on CPU chip or module
Cache operation – overview
CPU requests contents of memory location
Check cache for this data
If present, get from cache (fast)
If not present, read required block from main memory to cache
Then deliver from cache to CPU
Cache includes tags to identify which block of main memory is in each cache slot
Inexpensive
If a program accesses 2 blocks that map to the same line repeatedly, cache misses are very high
• Random
Write Policy
• Must not overwrite a cache block unless main memory is up to date
Write through
• All writes go to main memory as well as cache
• Multiple CPUs can monitor main memory traffic to keep local (to CPU) cache up to date
• Lots of traffic
Write back
• Updates initially made in cache only
Chapter 5
Internal memory
MEMORY
• he term memory identifies data storage that comes in the form of chips, and the word storage
is used for memory that exists on tapes or disks. Moreover, the term memory is usually used
as a shorthand for physical memory, which refers to the actual chips capable of holding data.
Some computers also use virtual memory, which expands physical memory onto a hard disk.
Every computer comes with a certain amount of physical memory, usually referred to as main
memory or RAM. A computer that has 1 megabyte of memory, therefore, can hold about 1
million bytes (or characters) of information
The place or location where data and programs are stored called Memory. There are two
types of Memory.
Primary Memory and Secondary Memory.
PRIMARY MEMORY
• The memory where data and programs are stored for the purpose of processing called Primary
Memory. Primary Memory Stored Data for Temporary Time.
• it is also called Internal Memory or Main Memory. Primary storage has a limited storage
capacity because it is very expensive.
RAM
• RAM Stand for Random Access Memory because we can access data directly from any
memory location of RAM.
• It is also called Volatile Memory because it stored data whenever power is On and Lost data if
power is Off.
ROM
• ROM Stands for Read Only Memory. It is also called Non Volatile Memory because it store
data and programs if power is on or Off. It store Bios Setup Program.
• In ROM Data and Programs are stored by manufacturer during Manufacturing. And we can not
erase or change the data stored in Rom
It stands for Read Only Memory. Information can be read from ROM but not change or write
information into it. It can not accept any input data or instructions from the users.
• The data stored in the ROM is permanent and is not lost due to light failure. So, it is called
permanent memory.
• It is non-volatile memory. It cannot be lost if power supply is switched-off. Program are stored
in ROM by manufacturers.
PROM
• PROM is stand for programmable Read Only Memory
• The data is recorded on them with special programming device which them become
permanent like Rom.
EPROM
• The data is also recorded on them with a special programming device but the difference is
that the data can be erased and reprogrammed when ever it is required.
EEPROM
• EEPROM is stand for Electrically Erasable Programmable Read Only Memory.
• The Characteristics of this EEPROM are same as EPROM but the only difference is that it uses
electrical pulses instead of ultraviolet light for erasing.
Chapter 6
External Memory
External memory
• Primary memory has limited storage capacity and is volatile.
• Secondary memory overcomes this limitation by providing permanent storage of data and in
bulk quantity.
• Secondary memory is also termed external memory and refers to the various storage media
on which a computer can store data and programs.
• magnetic tapes
• Portability: Storage mediums, like CDs, flash drives can be used to transfer the data from one
device to another
fixed
Removable
• Optical
CD-ROM
CD-Recordable (CD-R)
CD-R/W
DVD
• Magnetic Tape
• Disadvantages:-
These are less expensive than RAM but more expensive than magnetic tape memories.
It needs a clean and dust-free environment to store.
These are not suitable for sequential access.
• Platters: These are the ‘disks’ in a disk drive. They are typically made of aluminum or glass and
are coated with a thin layer of magnetic material.
• Read/Write Heads: These are the devices that interpret or modify the magnetic field on the
platters. When writing data, the heads produce a magnetic field that changes the orientation
of the magnetic particles on the platters.
• Actuator Arm: This is the component that moves the read/write heads across the surface of
the platters.
• Spindle: This is the axis that the platters spin around. The speed of the spin, measured in RPM
(Revolutions Per Minute), is a significant factor in the performance of the drive
• Magnetic disk is a storage device that is used to write, rewrite and access data.
• It uses a magnetization process
• These tracks are further divided into sectors which are the smallest divisions in the disk.
• Read-Write(R-W) head moves over the rotating hard disk. It is this Read-
Write head that performs all the read and writes operations on the disk
and hence, the position of the R-W head is a major concern.
• To perform a read or write operation on a memory location, we need to
place the R-W head over that position.
• The disk is rotating at 3600 RPM, what is the data transfer rate?
60 sec -> 3600 rotations
1 sec -> 60 rotations
Data transfer rate = surfaces * Rotation per second * sectors/track *
bytes/sector
Chapter 7
Input/output
Input/Output Problems
Interfaces
Input-Output Interface
• Peripherals connected to a computer need special communication links
for interfacing with CPU. 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.
Direct Memory Access
• Removing the CPU from the path and letting the peripheral device
manage the memory buses directly would improve the speed of transfer.
This technique is known as DMA.
• In this, the interface transfer data to and from the memory through
memory bus. A DMA controller manages to transfer data between
peripherals and memory unit
• Many hardware systems use DMA such as disk drive controllers, graphic
cards, network cards and sound cards etc. It is also used for intra chip
data transfer in multicore processors.
• In DMA, CPU would initiate the transfer, do other operations while the
transfer is in progress and receive an interrupt from the DMA controller
when the transfer has been completed.
Input/ Output Processor
• An input-output processor (IOP) is a processor with direct memory access
capability. In this, the computer system is divided into a memory unit and
number of processors.
• Each IOP controls and manage the input-output tasks. The IOP is similar to
CPU except that it handles only the details of I/O processing. The IOP can
fetch and execute its own instructions. These IOP instructions are
designed to manage I/O transfers only.
I/O Steps
• 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
• Variations for output, DMA, etc.
Chapter 9
Operating System Support
Operating system
• Operating system is a software that acts as an intermediary between the
user and computer hardware. It is a program with the help of which we
are able to run various applications.
• It is the only one program that is running all the time.
• Every computer must have an operating system to smoothly execute
other programs.
• The OS coordinates the use of the hardware and application programs for
various users
• It provides a platform for other application programs to work.
• The operating system is a set of special programs that run on a computer
system that allows it to work properly.
• It controls input-output devices, execution of programs, managing files,
etc.
Services of Operating System
• Program execution
• Input Output Operations
• Communication between Process
• File Management
• Memory Management
• Process Management
Operating system service
• Security and Privacy
• Resource Management
• User Interface
• Networking
• Error handling
• Time Management
Program Execution
• It is the Operating System that manages how a program is going to be
executed. It loads the program into the memory after which it is
executed.
• The order in which they are executed depends on the CPU Scheduling
Algorithms.
• A few are FCFS, SJF, etc. When the program is in execution, the Operating
System also handles deadlock i.e. no two processes come for execution at
the same time.
• The Operating System is responsible for the smooth execution of both
user and system programs.
• The Operating System utilizes various resources available for the efficient
running of all types of functionalities.
Input Output Operations
• Operating System manages the input-output operations and establishes
communication between the user and device drivers.
• Device drivers are software that is associated with hardware that is being
managed by the O/S so that the sync between the devices works
properly.
• It also provides access to input-output devices to a program when
needed.
Communication between Processes
• The Operating system manages the communication between processes.
• Communication between processes includes data transfer among them.
• If the processes are not on the same computer but connected through a
computer network, then also their communication is managed by the
Operating System itself.
File Management
• The operating system helps in managing files also. If a program needs
access to a file, it is the operating system that grants access.
• These permissions include read-only, read-write, etc.
• It also provides a platform for the user to create, and delete files.
• The Operating System is responsible for making decisions regarding the
storage of all types of data or files, i.e, floppy disk/hard disk/pen drive,
etc. The Operating System decides how the data should be manipulated
and stored.
Memory Management
• Let’s understand memory management by OS in simple way.
• Imagine a cricket team with limited number of player .
• The team manager (OS) decide whether the upcoming player will be in
playing 11 ,playing 15 or will not be included in team , based on his
performance .
• In the same way, OS first check whether the upcoming program fulfil all
requirement to get memory space or not ,if all things good, it checks how
much memory space will be sufficient for program and then load the
program into memory at certain location. And thus , it prevents program
from using unnecessary memory.
Process Management
• Let’s understand the process management in unique way.
• Imagine, our kitchen stove as the (CPU) where all cooking(execution) is
really happen and chef as the (OS) who uses kitchen-stove(CPU) to cook
different dishes(program).
• The chef(OS) has to cook different dishes(programs) so he ensure that any
particular dish(program) does not take long time(unnecessary time) and
all dishes(programs) gets a chance to cooked(execution) .
• The chef(OS) basically scheduled time for all dishes(programs) to run
kitchen(all the system) smoothly and thus cooked(execute) all the
different dishes(programs) efficiently.
Security and Privacy
• Security : OS keep our computer safe from an unauthorized user by
adding security layer to it.
• Basically, Security is nothing but just a layer of protection which protect
computer from bad guys like viruses and hackers.
• OS provide us defenses like firewalls and anti-virus software and ensure
good safety of computer and personal information
Privacy
• OS give us facility to keep our essential information hidden like having a
lock on our door, where only you can enter and other are not allowed .
• Basically , it respect our secrets and provide us facility to keep it safe.
Resource Management
• System resources are shared between various processes. It is the
Operating system that manages resource sharing.
• It also manages the CPU time among processes using CPU Scheduling
Algorithms.
• It also helps in the memory management of the system. It also controls
input-output devices.
• The OS also ensures the proper use of all the resources available by
deciding which resource to be used by whom
User Interface
• User interface is essential and all operating systems provide it. Users
either interface with the operating system through the command-line
interface or graphical user interface or GUI.
• The command interpreter executes the next user-specified command.
• A GUI offers the user a mouse-based window and menu system as an
interface
Networking
• This service enables communication between devices on a network, such
as connecting to the internet, sending and receiving data packets, and
managing network connections.
Error Handling
• The Operating System also handles the error occurring in the CPU, in
Input-Output devices, etc. It also ensures that an error does not occur
frequently and fixes the errors.
• It also prevents the process from coming to a deadlock.
• It also looks for any type of error or bugs that can occur while any task.
The well-secured OS sometimes also acts as a countermeasure for
preventing any sort of breach of the Computer System from any external
source and probably handling them.
Time Management
single-program (Uni-programming)
• A single-program (uni-programming) operating system is a
simple type of operating system that only allows one program to
run at a time.
• In this type of operating system, the central processing unit
(CPU) is dedicated to executing a single program until it
completes or encounters an input/output (I/O) operation that
requires waiting for external devices.
uni-programming operating system
• In a uni-programming operating system, when a program is
executed, it occupies the entire system's resources until it
finishes or is interrupted. This means that the CPU remains idle
while waiting for I/O operations to complete.
• Once the I/O operation is finished, the CPU can resume
executing the program.
• since only one program can run at a time in a uni-programming
system, the overall system performance may be inefficient. The
system may experience significant idle time, especially when the
running program is performing I/O operations.