0% found this document useful (0 votes)
61 views11 pages

Direct Mapping: Each Word in Cache Consists of The Data Word and It Associated Tag

- Each word in cache consists of a data word and its associated tag. When a new word is brought into cache, the tag bits are stored along with the data. - In set-associative mapping, each word of cache can store two or more words of memory under the same index address. Each data word is stored together with its tag. - The most common replacement algorithms for removing and placing new contents in cache are random replacement, FIFO, and LRU.

Uploaded by

Akshat Keshari
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)
61 views11 pages

Direct Mapping: Each Word in Cache Consists of The Data Word and It Associated Tag

- Each word in cache consists of a data word and its associated tag. When a new word is brought into cache, the tag bits are stored along with the data. - In set-associative mapping, each word of cache can store two or more words of memory under the same index address. Each data word is stored together with its tag. - The most common replacement algorithms for removing and placing new contents in cache are random replacement, FIFO, and LRU.

Uploaded by

Akshat Keshari
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/ 11

Direct Mapping

Each word in cache consists of the data word and it associated tag.

When a new word is brought into cache, the tag bits store along
data

When the CPU generates a memory request, the index field is


used in the address to access the cache.

The tag field of the CPU address is equal to tag in the word from
cache; there is a hit, otherwise miss.
Set – Associative Mapping

In set – Associative mapping, each word of cache can store two or


more words of memory under the same index address.
Each data word is stored together with its tag and the number of
tag – data items in one word of cache is said to form a set.
Each index address refers to two data words and their associated tags.
Set – Associative Mapping

Each tag requires 6 bits & each data word has 12 bits, so the word
length is 2(6+12) =36 bits

An index address of 9 bits can accommodate 512 cache words. It


can accommodate 1024 memory words.

When the CPU generates a memory request, the index value of the
address is used to access the cache.

The tag field of the CPU address is compared with both tags in the
cache.

The most common replacement algorithms are:

· Random replacement
· FIFO
· Least Recently Used (LRU)
The algorithm to remove and place new contents into the cache is
called _______

a) Replacement algorithm
b) Renewal algorithm
c) Updation
d) None of the mentioned
Writing into cache

there are two writing methods that the system can proceed.

Write-through method (The simplest & commonly used way)


update main memory with every memory write operation, with cache
memory being update in parallel if it contains the word at the specified
address.

This method has the advantage that main memory always contains the
same data as the cache.

Write-back method
In this method only the cache location is updated during a write operation.

The location is then marked by a flag so that later when the word is
removed from the cache it is copied into main memory.

The reason for the write-back method is that during the time a word resides
in the cache, it may be updated several times.
The correspondence between the main memory blocks and those in the
cache is given by _________

a) Hash function
b) Mapping function
c) Locale function
d) Assign function
The write-through procedure is used ________

a) To write onto the memory directly


b) To write and read from memory simultaneously
c) To write directly on the memory and the cache simultaneously
d) None of the mentioned

You might also like