What is Cache memory?

CACHE Memory

Cache memory is placed in between the CPU and the main memory. It is faster than the main memory. Hence access time is much less than that of the main memory. The access time of a cache memory is 15-25 nanoseconds (ns) whereas that of the main memory is 80 ns. One nanosecond =109  second. The cache memory stores the data and instructions which are to be immediately executed. It is used to reduce average access time for address, instructions or data which are normally stored on the main memory. Thus it increases the operating speed of the system. Cache memory is much costlier than the main memory. From economical considerations, the size of cache memory is usually smaller than that of the main memory. Sometime cache is used to store only instructions. One such type of cache is used in 68020 processor. It has 256 bytes instruction cache, which allows it to pre-fetch instructions from the main memory and store them in the cache during the period when the system bus would otherwise be idle. The microprocessor 68020 has both 256 bytes instruction cache and 256 bit data cache.

What is cache memory, cache memory, types of cache memory

The high speed memory used for the Cache purpose is very costly, The reason why is not used as the main memory, The information frequently required by the processor is kept in the cache memory by the Cache controller. This Cache controller ensures that the data required by the processor in the next memory access is available in the cache memory. This improves the speed of the computer very much because if the required data is in the cache memory it is made available to the CPU without any wait state. When the required data is available in the cache it is called a hit. In case of a cache hit the processor immediately reads or writes the data in the data cache line. The proportion off accesses that result in a cache hit is known as the hit rate and is a measure of the effectiveness of the cache. When the required data is not available in the cache memory it is called a miss. In case of cache miss, most caches allocate new entry, which comprises the tag just missed a copy of the data from the memory. The reference can then be applied to the new entry just as in case of a hit. Misses are comparatively slow because they require data to be transferred from the main memory. This transfer incurs a delay, since the main memory is slower than cache memory.

The performance of the cache depends upon following

  •  Speed and size of the cache memory.
  • The logic used to read data around the main memory area read by the CPU.
  •  The logic used to guess next required data by the processor.

Levels of Cache

1)      Level 1 (L1) Cache

Level 1 cache is built into the actual processor core. It is a piece of RAM, typically 8, 16, 20, 32, 64 or 128 KB size which operates at the same clock frequency as the rest of the CPU.

2)      Level 2 (L2) Cache

The level 2 cache is normally much larger and unified ,such as 256, 512 or 1024 KB. The purpose of an L2 cache is to constantly read in slightly larger quantities of data from the RAM, so that these are available to the L1 cache.

 


Comments

Popular posts from this blog

Difference between Compiler and Interpreter

Linux File System

History of Computers