0% found this document useful (0 votes)
22 views14 pages

MemoryCAcheVIRTUAL ASSOCIMEMORY HIERARCHY

Memory in computers functions similarly to the human brain, storing data and instructions, and is characterized by speed, size, and cost. It is categorized into primary memory (RAM and ROM), cache memory, and secondary memory, each with distinct features and purposes. Virtual memory allows systems to use secondary memory as if it were part of main memory, enhancing the illusion of larger storage capacity.

Uploaded by

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

MemoryCAcheVIRTUAL ASSOCIMEMORY HIERARCHY

Memory in computers functions similarly to the human brain, storing data and instructions, and is characterized by speed, size, and cost. It is categorized into primary memory (RAM and ROM), cache memory, and secondary memory, each with distinct features and purposes. Virtual memory allows systems to use secondary memory as if it were part of main memory, enhancing the illusion of larger storage capacity.

Uploaded by

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

What is the requirement of Memory:

A memory is just like a human brain. It is used to store data and instructions.

Memory can be characterized by the following points like:


· Speed

· Size

· Cost

Unit of Memory Size:


1 bit=the value of 0 or 1
4 BITS =1 Nibble
8 bits = 1 byte
1024 byte =1 kilobyte
1024 kilobytes = 1 megabyte
1024 megabytes = 1 gigabyte
1024 gigabytes = 1 terabyte
1024 terabytes = 1 petabyte

Memory is primarily of three types


• · · Primary Memory/Main Memory

• · Cache Memory

• Secondary Memory

Primary Memory (Main Memory)

• Primary memory holds only those data and instructions on


which computer is currently working.
• It has limited capacity and data is lost when power is switched
off.(Volatile)
• It is generally made up of semiconductor device.
• These memories are not as fast as registers.
• The data and instruction required to be processed reside in
main memory.
• It is divided into two subcategories RAM and ROM.
RAM

• A RAM constitutes the internal memory of


the CPU for storing data, program and
program result.
• It is read/write memory.
• It is called random access memory (RAM).
• Since access time in RAM is independent of
the address to the word that is, each storage
location inside the memory is as easy to
reach as other location & takes the same
amount of time.
• We can reach into the memory at random &
extremely fast but can also be quite
expensive.
• RAM is volatile, i.e. data stored in it is lost
when we switch off the computer or if there
is a power failure.
• Hence, a backup uninterruptible power
system (UPS) is often used with computers.
• RAM is small, both in terms of its physical
size and in the amount of data it can hold.
• RAM is of two types
• Static RAM (SRAM)
• Dynamic RAM (DRAM)
• Static RAM (SRAM)
• The word static indicates that the memory
retains its contents as long as power remains
applied. However, data is lost when the
power gets down due to volatile nature.
SRAM chips use a matrix of 6-transistors and
no capacitors. Transistors do not require
power to prevent leakage, so SRAM need not
have to be refreshed on a regular basis.
• Because of the extra space in the matrix,
SRAM uses more chips than DRAM for the
same amount of storage space, thus making
the manufacturing costs higher.
• Static RAM is used as cache memory needs
to be very fast and small.
• Dynamic RAM (DRAM)
• DRAM, unlike SRAM, must be continually
refreshed in order for it to maintain the data.
• This is done by placing the memory on a
refresh circuit that rewrites the data several
hundred times per second.
• DRAM is used for most system memory
because it is cheap and small.
• All DRAMs are made up of memory cells.
These cells are composed of one capacitor and
one transistor
ROM
• ROM stands for Read Only Memory.
• The memory from which we can only read
but cannot write on it.
• This type of memory is non-volatile.
• The information is stored permanently in
such memories during manufacture .
• A ROM, stores such instruction as are
required to start computer when electricity is
first turned on, this operation is referred to
as bootstrap.
• ROM chip are not only used in the computer
but also in other electronic items like
washing machine and microwave oven.
• Following are the various types of ROM:
• PROM (Programmable Read Only Memory)
• PROM is read-only memory that can be modified
only once by a user.
• The user buys a blank PROM and enters the
desired contents using a PROM programmer.
• Inside the PROM chip there are small fuses which
are burnt open during programming.
• It can be programmed only once and is not
erasable.
• EPROM(Erasable and Programmable Read Only
Memory)
• The EPROM can be erased by exposing it to ultra-violet
light for a duration of upto 40 minutes.
• Usually, an EPROM eraser achieves this function.
• During programming an electrical charge is trapped in
an insulated gate region.
• The charge is retained for more than ten years because
the charge has no leakage path.
• For erasing this charge, ultra-violet light is passed
through a quartz crystal window (lid).
• This exposure to ultra-violet light dissipates the
charge. During normal use the quartz lid is sealed with
a sticker.
• EEPROM(Electrically Erasable and Programmable Read
Only Memory)
• The EEPROM is programmed and erased electrically.
• It can be erased and reprogrammed about ten
thousand times.
• Both erasing and programming take about 4 to 10 ms
(millisecond).
• In EEPROM, any location can be selectively erased and
programmed.
• EEPROMs can be erased one byte at a time, rather
than erasing the entire chip.
• Hence, the process of re-programming is flexible but
slow.
ROM Vs RAM
• There is one major difference between a ROM and a RAM
chip.
• · A ROM chip is non-volatile storage and does not require a
constant source of power
to retain information stored on it.
When power is lost or turned off, a ROM chip will keep the
information stored on it.
• So for permanent storage, ROM is used.
• · In contrast, a RAM chip is volatile and requires a constant
source of power to retain
information.
• When power is lost or turned off, a RAM chip will lose the
information stored on it.
• · A ROM chip is used primarily in the start up process of a
computer, whereas a RAM chip is used in the normal
operations of a computer after starting up and loading the
operating system.
• · Writing data to a ROM chip is a slow process, whereas
writing data to a RAM chip is a faster process
• · A RAM chip can store multiple gigabytes (GB) of data, up to
16 GB or more per chip;
• A ROM chip typically stores only several megabytes (MB) of
data, up to 4 MB or more per chip
• Advantages of Main Memory
• These are semiconductor memories
• · It is working memory of the computer.
• · Faster than secondary memories.
• · Cheaper than Cache memory.

• Disadvantages of Main Memory:


• · Volatile when power goes off.
• · High cost as transistors are used.
• · Usually size is less than secondary memory.

Cache Memory
• Cache memory is a very high speed semiconductor memory
which can speed up CPU.
• It acts as a buffer between the CPU and main memory.
• It is used to hold those parts of data and program which are
most frequently used by CPU.
• The parts of data and programs are transferred from disk to
cache memory by operating system, from where CPU can
access them.
• Advantages
• The advantages of cache memory are as follows:
• § Cache memory is faster than main memory.
• § It consumes less access time as compared to main memory.
• § It stores the program that can be executed within a short
period of time.
• § It stores data for temporary use.
• Disadvantages
• The disadvantages of cache memory are as follows:
• § Cache memory has limited capacity.
• § It is very expensive
• The basic operation of the cache is as follows.
• When the CPU needs to access memory, the cache is
examined.
• If the word is found in the cache, it is read from the fast
memory. If the word addressed by the CPU is not found
in the cache, the main memory is accessed to read the
word.
• A block of words containing the one just accessed is
then transferred from main memory to cache memory.
• The block size may vary from one word (the one just
accessed) to about 16 words adjacent to the one just
accessed.
• In this manner, some data are transferred to cache so
that future references to memory find the required
words in the fast cache memory.
• The performance of cache memory is frequently
measured in terms of a quantity called hit ratio.
• When the CPU refers to memory and finds the word in
cache, it is said to produce a hit.
• If the word is not found in cache, it is in main memory
and it counts as a miss.
• The ratio of the number of hits divided by the total CPU
references to memory (hits plus misses) is the hit ratio.
• The hit ratio is best measured experimentally by
running representative programs in the computer and
measuring the number of hits and misses during a given
interval of time.
• Hit ratios of 0.9 and higher have been reported. This
high ratio verifies the validity of the locality of reference
property.
• The average memory access time of a computer system can be
improved considerably by use of a cache.
• If the hit ratio is high enough so that most of the time the CPU
accesses the cache instead of main memory, the average access
time is closer to the access time of the fast cache memory.
• The basic characteristic of cache memory is its fast access
time.
• Therefore, very little or no time must be wasted when
searching for words in the cache.
• The transformation of data from main memory to cache
memory is referred to as a mapping process.
• Three types of mapping procedures are of practical interest
when considering the organization of cache memory:
• 1. Associative mapping
• 2. Direct mapping
• 3. Set-associative mapping
VIRTUAL MEMORY
In a memory hierarchy system, programs and data are brought
into main memory as they are needed by the CPU.
Virtual memory is a concept used in some large computer
systems that permit the user to construct programs as though a
large memory space were available, equal to the totality of
auxiliary memory.
Each address that is referenced by the CPU goes through an
address mapping from the so-called virtual address to a
physical address in main memory.
Virtual memory is used to give programmers the illusion that
they have a very large memory at their disposal, even though
the computer actually has a relatively small main memory.
A virtual memory system provides a mechanism for translating
program-generated addresses into correct main memory
locations.
This is done dynamically, while programs are being executed in
the CPU.
The translation or mapping is handled automatically by the
hardware by means of a mapping table.
Virtual memory A storage allocation scheme in which
secondary memory can be addressed as though it were part of
main memory.
The addresses a program may use to reference memory are
distinguished from the addresses the memory system uses to
identify physical storage sites, and program-generated
addresses are translated automatically to the corresponding
machine addresses.
The size of virtual storage is limited by the addressing scheme
of the computer system and by the amount of secondary
memory available and not by the actual number of main
storage locations.
Virtual address The address assigned to a location in virtual
memory to allow that location to be accessed as though it were
part of main memory.
Virtual address space The virtual storage assigned to a
process.
Address space The range of memory addresses available to a
process.
Real address The address of a storage location in main
memory.

Memory Hierarchy
• Ideally we need fast, large and cheap memory. But
unfortunately it’s not possible to get all the three
simultaneously.
• So a various types of memory like above having different
characteristics are used for different purposes
combined, which creates a hierarchy of memory module
wile being used in computer. This is depicted in the fig

ASSOCIATIVE MEMORY
Many data-processing applications require the search of items in
a table stored in memory. An assembler program searches the
symbol address table in order to extract the symbol’s binary
equivalent. An account number may be searched in a file to
determine the holder’s name and account status. The established
way to search a table is to store all items where they can be
addressed in sequence. The search procedure is a strategy for
choosing a sequence of addresses, reading the content of
memory at each address, and comparing the information read
with the item being searched until a match occurs.
The number of accesses to memory depends on the location of
the item and the efficiency of the search algorithm. Many search
algorithms have been developed to minimize the number of
accesses while searching for an item in a random or sequential
access memory.
The time required to find an item stored in memory can be
reduced considerably if stored data can be identified for access
by the content of the data itself rather than by an address. A
memory unit accessed by content is called an associative
memory or content addressable memory (CAM).
This type of memory is accessed simultaneously and in parallel
on the basis of data content rather than by specific address or
location.
When a word is written in an associative memory, no address is
given,. The memory is capable of finding an empty unused
location to store the word.
When a word is to be read from an associative memory, the
content of the word, or part of the word, is specified. The
memory locaters all words which match the specified content
and marks them for reading.
Because of its organization, the associative memory is uniquely
suited to do parallel searches by data association.
Moreover, searches can be done on an entire word or on a
specific field within a word.
An associative memory is more expensive then a random access
memory because each cell must have storage capability as well
as logic circuits for matching its content with an external
argument.
For this reason, associative memories are used in applications
where the search time is very critical and must be very short.

You might also like