0% found this document useful (0 votes)
4 views

Lecture 3

OS

Uploaded by

saman zia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture 3

OS

Uploaded by

saman zia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 17

Memory System

Lecture 3
Memory System: An
Introduction
 Memory system is designed for high
performance computers.
 Design goal of memory system for
high performance computers is to
present the user with as much
memory as is available.
Memory Hierarchy: An
introduction

Fast memory is expensive and cheap


memory is slow, therefore a memory
hierarchy is organized into several
levels.
Storage Type in Memory
System
 The semiconductor memories such as
registers or RAM are fast in access speed
but are expensive.
 Used in small size and placed either inside
or closest to the processor.
 Secondary storage devices which offer
huge storage at lowest cost per bit are
placed farthest away from the processor.
Storage Systems

Classification of memory systems based


on different attributes and their design

Attributes:
 Material: Semiconductor, magnetic, optical

 Accessing: Random, Sequential

 Store/Retrieve: ROM, RWM


Random-Access Memory (RAM)

Key features
 RAM is packaged as a chip.

 Basic storage unit is a cell (one bit

per cell).
 Multiple RAM chips form a memory.
Cache

 Cache is the name given to the first level


of the memory hierarchy encountered
once the address leaves the CPU.
 When the CPU finds a requested data item
in the cache, it is called a cache hit.
 When the CPU does not find a data item it
needs in the cache, it is called a cache
miss.
REPLACEMENT
ALGORITHM
 Optimal Replacement: replace the block which
is no longer needed in the future. If all blocks
currently in Cache Memory will be used again,
replace the one which will not be used in the
future for the longest time.

 Random selection: replace a randomly selected


block among all blocks currently in Cache
Memory.
 FIFO (first-in first-out): replace the block
that has been in Cache Memory for the
longest time.
 LRU (Least recently used): replace the
block in Cache Memory that has not been
used for the longest time.
 LFU (Least frequently used): replace the
block in Cache Memory that has been
used for the least number of times.
First-In-First-Out (FIFO) Page Replacement
FIFO Anomaly
 The optimal replacement : the best but is not
realistic because when a block will be needed in the
future is usually not known ahead of time.

 The LRU is suboptimal based on the temporal locality


of reference, i.e., memory items that are recently
referenced are more likely to be referenced soon
than those which have not been referenced for a
longer time.

 FIFO is not necessarily consistent with LRU therefore


is usually not as good.

 The random selection, surprisingly, is not necessarily


bad.
Nonvolatile Memories

 DRAM and SRAM are volatile memories


 Lose information if powered off.
 Nonvolatile memories retain value even if
powered off.
 Generic name is read-only memory
(ROM).
 Misleading because some ROMs can be
read and modified.
Virtual Memory
If your computer lacks the random access memory (RAM)
needed to run a program or operation, Windows uses virtual
memory to compensate.
Virtual memory is storage space on your computer's hard
disk that Windows uses in combination with random access
memory (RAM).
The more RAM your computer has, the faster your programs
will generally run. If a lack of RAM is slowing your
computer, you might need to increase virtual memory to
compensate.
However, your computer can read data from RAM much
more quickly than from a hard disk, so adding RAM is a
better solution.

You might also like