0% found this document useful (0 votes)
12 views5 pages

Adobe Scan 02-Jun-2023

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

Adobe Scan 02-Jun-2023

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

Cache Mapping

There are three different types of mapping used


for the purpose of cache memory which is as
follows:

• Direct Mapping
• Associative Mapping
• Set-Associative Mapping

1. Direct Mapping

The simplest technique, known as direct


mapping, maps each block of main memory into
only one possible cache line. or In Direct
mapping, assign each memory block to a specific
line in the cache. If a line is previously taken up by
a memory block when a new block needs to be
loaded, the old block is trashed. An address
space is split into two parts index field and a tag
field. The cache is used to store the tag field
whereas the rest is stored in the main memory.
Direct mapping's performance is directly
proportional to the Hit ratio.
MAIN MEMORY PAGES

Set (0)
BLOCK FRAM
Set (1)
DATA
CACHE

CONTROL

LOGIC
Set (S-1)

Direct Mapping - Structure

2. Associative Mapping

In this type of mapping, associative memory is


used to store the content and addresses of the
memory word. Any block can go into any line of
the cache. This means that the word id bits are
used to identify which word in the block is
needed, but the tag becomes all of the remaining
bits. This enables the placement of any word at
any place in the cache memory. It is considered
to be the fastest and most flexible mapping
form. In associative mapping, the index bits are
zero.
Mam Memo,y

SET(O)
BLOCK FRAMES

BLK(O) BLK( 1) BLK(N-1)

LOGIC

Associative Mapping - Structure

3. Set-Associative Mapping

This form of mapping is an enhanced form of


direct mapping where the drawbacks of direct
mapping are removed. Set associative addresses
the problem of possible thrashing in the direct
mapping method. It does this by saying that
instead of having exactly one line that a block
can map to in the cache, we will group a few lines
together creating a set. Then a block in memory
can map to any one of the lines of a specific set.
Set-associative mapping allows each word that is
present in the cache can have two or more words
in the main memory for the same index address.
Set associative cache mapping combines the
best of direct and associative cache mapping
techniques. In set associative mapping the index
3. Set-Associative Mapping

This form of mapping is an enhanced form of


direct mapping where the drawbacks of direct
mapping are removed. Set associative addresses
the problem of possible thrashing in the direct
mapping method. It does this by saying that
instead of having exactly one line that a block
can map to in the cache, we will group a few lines
together creating a set. Then a block in memory
can map to any one of the lines of a specific set.
Set-associative mapping allows each word that is
present in the cache can have two or more words
in the main memory for the same index address.
Set associative cache mapping combines the
best of direct and associative cache mapping
techniques. In set associative mapping the index
bits are given by the set offset bits. In this case,
the cache consists of a number of sets, each of
which consists of a number of lines.
I
Ma.lMefflOf}'
I

BLOCK FRAMEs - - -

BLK{O) - - - - : - - BLK(N-1 J

SET(O)

- - SET(N-1)

Set-Associative Mapping - Structure

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy