Coa Blog
Coa Blog
Coa Blog
Memory Hierarchy
Main Memory
Associative Memory
Cache Memory
Virtual Memory
Memory Management Hardware
Introduction
i.
Memory Hierarchy
PYRAMID TABLE.
memory
cache
main memory
main memory
disks
ii.
MAIN MEMORY
Main memory with linear selection of multiple words (with a single address
decoder and a selector)
v.
Virtual Memory
A cache stores a subset of the addresss space of RAM. An address space is the set of valid
addresses. Thus, for each address in cache, there is a corresponding address in RAM. This subset
of addresses (and corresponding copy of data) changes over time, based on the behavior of your
program.
Cache is used to keep the most commonly used sections of RAM in the cache, where it can be
accessed quickly. This is necessary because CPU speeds increase much faster than speed of
memory access. If we could access RAM at 3 GHz, there wouldn't be any need for cache,
because RAM could keep up. Because it can't keep up, we use cache.
What if we wanted more RAM than we had available. For example, we might have 1 M of
RAM, what if we wanted 10 M? How could we manage?
One way to extend the amount of memory accessible by a program is to use disk. Thus, we can
use 10 Megs of disk space. At any time, only 1 Meg resides in RAM.
In effect, RAM acts like cache for disk.
This idea of extending memory is called virtual memory. It's called "virtual" only because it's not
RAM. It doesn't mean it's fake.
The real problem with disk is that it's really, really slow to access. If registers can be accessed in
1 nanosecond, and cache in 5 ns and RAM in about 100 ns, then disk is accessed in fractions of
seconds. It can be a million times slower to access disk than a register.
The advantage of disk is it's easy to get lots of disk space for a small cost.
Still, becaues disk is so slow to access, we want to avoid accessing disk unnecessarily.
The length of each segment is allowed to grow and contract according to the
needs of the program being executed. One way of specifying the length of a
segment is by associating with it a number of equal-sized pages.
Consider the diagram below: