1,071 views
0 votes
0 votes
What is the use of Valid bit if we have a TAG comparator in Direct Mapped cache ?

3 Answers

Best answer
3 votes
3 votes
Comparing 1 bit or $n$ bits is faster?

1 bit rt? So, with a valid bit, CPU can detect a cache miss faster and fetch the required block from main memory to cache.

For cache hit, we always require a tag comparison. But valid bit can make cache misses slightly faster.

And with multiple cores sharing data, valid bit has more significance - to invalidate cache entries like when a different core updates its copy of cached data.

PS: Have to add more.
selected by
0 votes
0 votes

 Each cache block holds a "valid bit" that tells us if anything is contained in the line of this cache block or if the cache block has not yet had any memory put into it. Perhaps most importantly, there is a number called a "tag" composed of more significant bits of the memory address from which the line's data came from.There is also a block of data called a "line" which stores a recently used block of data. We have our valid bit which tells us if this cache block currently holds data. Next is our tag, a number that tell us where in memory this bit is from. After that, we have our line, which is the data that we have stored in cache.

0 votes
0 votes

In Direct mapping , tag bits are nothing but the Ratio of main Memory Size and Cache Size , i.e (MM Size)/(Cache Size) , since the size of cache is smaller than main memory therefore Tag bits says the mapping from cache to Main Memory.

It is 1:M mapping.

Related questions

1 votes
1 votes
1 answer
1
2 votes
2 votes
1 answer
3
elakashi sharma asked Apr 24, 2017
1,078 views
Cache size = 512KB ; Tag size = 7, Find out main memory size and tag directory. Given it is 8-way set associative .