Memory Hierarchy & Cache Memory
Memory Hierarchy & Cache Memory
HIERARCHY &
CACHE MEMORY
WEEK 08
COMPUTER MEMORY
KEY CHARACTERISTIC OF MEMORY
LOCATION
CAPACITY
UNIT OF TRANSFER
• A related concept is the unit of transfer. For internal memory, the unit of transfer is equal to the number
of electrical lines into and out of the memory module.
• This may be equal to the word length, but is often larger, such as 64, 128, or 256 bits.
• For external memory, data are often transferred in much larger units than a word, and these are referred to
as blocks.
ACCESS METHOD
PERFORMANCE
PHYSICAL TYPE
PHYSICAL CHARACTERISTIC
ORGANIZATION
MEMORY HIERARCHY
MEMORY HIERARCHY
MEMORY HIERARCHY
MEMORY HIERARCHY
• The fastest, smallest, and most expensive type of memory consists of the registers internal to the
processor. Typically, a processor will contain a few dozen such registers, although some machines contain
• hundreds of registers.
• Skipping down two levels, main memory is the principal internal memory system of the computer. Each
location in main memory has a unique address.
• Main memory is usually extended with a higher-speed, smaller cache. The cache is not usually visible to
the programmer or, indeed, to the processor. It is a device for staging the movement of data between main
memory and processor registers to improve performance.
MEMORY
• The three forms of memory just described are, typically, volatile and employ semiconductor technology.
• The use of three levels exploits the fact that semiconductor memory comes in a variety of types, which
differ in speed and cost. Data are stored more permanently on external mass storage devices, of which the
most common are hard disk and removable media, such as removable magnetic disk, tape, and optical
storage.
• External, nonvolatile memory is also referred to as secondary memory or auxiliary memory. These are
used to store program and data files and are usually visible to the programmer only in terms of files and
records, as opposed to individual bytes or words.
BIG PICTURE OF MEMORIES
BIG PICTURE OF MEMORIES
BIG PICTURE OF MEMORIES
BIG PICTURE OF MEMORIES
CACHE MEMORY PRINCIPLES (CACHE
HIT & MISS,LOCALITY OF REFERENCE)
FIGURE 4.6 EXPLANATION
• .In this organization, the cache connects to the processor via data, control, and address lines.
• The data and address lines also attach to data and address buffers, which attach to a system bus from
which main memory is reached.
• When a cache hit occurs, the data and address buffers are disabled and communication is only between
processor and cache, with no system bus traffic.
• When a cache miss occurs, the desired address is loaded onto the system bus and the data are returned
through the data buffer to both the cache and the processor.
• In other organizations, the cache is physically interposed between the processor and the main memory for
all data, address, and control lines. In this latter case, for a cache miss, the desired word is first read into
the cache and then transferred from cache to processor.
FIGURE 4.4 EXPLANATION
FIGURE 4.4 EXPLANATION
MAPPING
• Replacement policy is required to increse cache hit and to reduce miss penalty.
– FIFO (First In First Out)
– LRU (Least Recently Used)
– MRU (Most Recently Used)
– Random