2. There are three commonly used methods to
translate main memory addresses to cache
memory addresses.
• Direct-Mapping
• Associative Mapping
• Set-Associative Mapping
3. Fixed sized packet of information that
moves back and forth between a cache
and main memory.
Container in a cache that stores a
block as well as other information such as the
valid bit and tag bits.
Collection of one or more lines.
4. o Set of Blocks of main
memory mapped onto
specific block of
cache
5. • Cache of 64kByte.
• Cache block of 4 bytes.
• 16MBytes main memory.
• Show hexadecimal main memory
address BBBBBB in direct format.
6. • The tag memory is much smaller than in
associative mapped cache.
• It is less costly compare to other
mapping technique.
• It is easy to implement.
• It is not flexible.
7. o Any main memory blocks
can be mapped into
each cache slot.
8. • Cache of 64kByte.
• Cache block of 4 bytes.
• 16MBytes main memory.
• Show hexadecimal main memory
address BBBBBB in associate format.
9. • Flexibility. Main Memory block can be
mapped anywhere in Cache Memory.
• Regardless of how irregular the data and
program references are, if a slot is
available for the block, it can be stored in
the cache.
• Slow or expensive.
10. o Combines the simplicity of
direct mapping with the
flexibility of associative
mapping.
o Cache is divided into a
number of sets.
o Each set contains a number
of lines.
11. • 2-way set-associative.
• Cache of 64kByte.
• Cache block of 4 bytes.
• 16MBytes main memory.
• Show hexadecimal main memory
address BBBBBB in set-associate
format.
12. • Minimize the over-head in Direct and
Associate mapping.
• In our example the tag memory increases
only slightly from the direct mapping and
only two tags need to be searched for
each memory reference.
• The set-associative cache is widely used
in today’s microprocessors.
13. • Least Recently used (LRU)
e.g. in 2 way set associative Which of the 2
block is LRU?
• First in first out (FIFO)
replace block that has been in cache longest
• Least frequently used
replace block which has had fewest hits
• Random