Valid bit on Memory, specifically on Cache.

Thread Starter

FreddoAvishi

Joined Mar 8, 2019
36
Hi ,
why do we need Valid bit on block of memory? I know that if Valid bit=0 then it's like data isn't relevant .. if valid=1 then data of the block is relevant .. but how's that help the processor?! if I grab the data from Main memory to cache, then the grabbed data is always available ... and it's relevant .. so it's like valid bit=1 always and just at first transaction the valid bit of the block would be 0.

thanks alot
 

Papabravo

Joined Feb 24, 2006
14,375
You have a fixed amount of cache memory. If you have new data for the cache, then some old data must discarded. This happens in multiple steps:
  1. The block is marked invalid
  2. The block is updated with new data
  3. The block is marked valid
What is your alternative for doing it?
 
Top