The data that are frequently used goes in the cache memory...
Random Access
It takes a long time, in computer time, for the CPU to retrieve stuff out of RAM while running a program. So to speed things up cache was built. Cache holds a small part of the program you are working with and it is easy and fast for the CPU to retrieve it from cache. Cache is memory and it holds data for the CPU.
memory cache
memory
Memory hold data that is been processed by the computer Memory also holds data that is waiting to be processed by the computer It also holds data that has been processed by the computer
The data is held by RAM(random access memory) or primary memory when it's being processed.
MAIN MEMORY
The data found in the cache is called cache data. It typically consists of recently accessed or frequently used instructions or data that are stored in a smaller and faster memory area for quicker access by the processor.
delay to access the data in cache in context of processor's speed. Time to access the requested data in cache , at that time processor have to wait .. is called cache latency.
In a two-way set associative cache system, the cache is divided into sets, with each set containing two cache lines. When data is requested, the system first checks the set where the data should be located. If the data is found in the cache, it is a cache hit and the data is retrieved quickly. If the data is not in the cache, it is a cache miss and the system fetches the data from the main memory and stores it in one of the cache lines in the set, replacing the least recently used data if necessary. This design allows for faster access to frequently used data while still providing some flexibility in managing cache space.
Cache memory is the high speed memories which are repeatedly requested by the Cache client (CPU). Whenever the requested data from the cpu is present in the cache, it directly supply the data and is known as cache hit(fast) and when the data is not accessible in cache then cache access the block of the main memory and feed to the CPU and it is termed as cache miss (slow).