- We already talked about “Storage Hierarchy” in the previous article in which we explained about the different types of memories and their characteristics. This article deals with the similar topic in which I am going to explain you about Cache Memory and Associative Memory.
- A cache is a smaller and faster memory that is used by the CPU to reduce the average memory access time.
- It stores the copies of the data which are most frequently used.
- It is a temporary storage area that provides easy and fast access of the data compare to main memory.
- When the CPU needs a particular piece of information, it first checks whether it is available in the cache or not. If so then the CPU reads from or writes to the cache.
- It is much faster than reading from or writing to main memory. Putting a copy of information under the assumption that we will need again soon.
- Most CPUs have at least three independent caches: one is instruction to speed up executable instruction fetch, second a data cache to speed up data fetch and store. Last is translation look-aside buffer which translates virtual address to physical address.
- Generally caching have the limited size so cached management is an important design problem. Careful selection of its size and a replacement policy can result in 80 to 99 % of all accesses from the case. It will increase the performance.
- Main memory can be viewed as a fast catch for secondary storage.
- Data transfer from cache to CPU and registers is usually a hardware function, with no o/s intervention.
Associative Memory
- Associative memory is a special type of computer memory which is used in very high speed searching applications.
- It is also known as content-addressable memory (CAM).
- In the standard memory RAM user provides a memory address and it returns the data stored to that location.
- While in a CAM user supplies a data word and it searches its entire memory to see whether that data word is stored anywhere in it.
- On success it returns a list of one or more storage memory addresses where the data was found. It reduces the searching time of item since data item is identified by its content rather than its address.
- CAMs are an outgrowth of RAM which is an integrated circuit that stores data temporarily.