Please enable JavaScript.
Coggle requires JavaScript to display documents.
THE COMPUTER SYSTEM : CACHE MEMORY - Coggle Diagram
THE COMPUTER SYSTEM : CACHE MEMORY
Introduction
Physical devices used to store programs or data on a temporary or permanent basis for use in a computer
Memory is used for temporary or storage of small amounts of data
Reading data from memory is faster than reading from other types of storage but cost much more (eg. hard disk)
Internal memory
directly accessible by the processor
External memory
accessible by the processor via an input/output module
Memory Hierarchy
used in the theory of computation when discussing performance issues in computer architectural design
each level in the hierarchy in computer storage distinguishes by response time
response time, complexity and capacity related
levels may also be distinguished by the controlling technology
Key characteristic of memory
capacity
access time
cost
As one goes down the hierarchy, the following occur :
decreasing cost per beat
increasing capacity
increasing access time
decreasing frequency of accessing memory by the processor
Cache Memory
is an internal memory
contains a copy of portions of main memory
How It Works :
processor attempts to read a word of memory
a check is made to determine if the word is in the cache
a block of main memory, consisting of some fixed number of words, is read into the cache
the word is delivered to the processor
CPU looks for data first in the cache and then in the main memory when the data is not found in the cache
The larger the cache, the larger the number of gates involved in addressing the cache
cache memory is random access memory (RAM) that a computer microprocessor can access more quickly than it can access regular RAM
Mapping Functions
: An algorithm is needed for mapping main memory blocks into cache lines because there are fewer cache lines than main memory blocks
Mapping Techniques
Direct Mapping :
the content of a location in main memory can be stored at one and only one, specific location in the cache
there is only one block in the cache that could possibly contain that information
Advantages
maps each block of main memory into only one possible cache line
simple technique
inexpensive to implement
Disadvantages
there is a fixed cache location for any given block
the hit ratio will be low where results in data transfer at maximum speed
Associative Mapping :
overcomes the disadvantage of direct mapping by permitting each main memory block to be loaded into into any line of the cache
there is flexibility as to which block to replace when a new block is read into the cache
Advantages
each memory location can be in any cache block
there is no restriction on mapping memory to cache
associative search of tags is expensive
Disadvantages
the complex circuitry required
examine the tag of all cache lines in parallel
Set Associative Mapping :
set associative mapped cache combines the ideas of direct mapped and associative cache
allows that each word that is present in the cache can have two or more words in the main memory for the same index address