L1 vs. L2 Cache

Difference Between L1 and L2 Cache

The memory cache is a special memory used by the CPU (the Central Processing Unit) of a computer for the purpose of reducing the average time required to access the memory. The cache is relatively small and also a faster memory, which retains most often accessed data from main memory. When there is demand for memory read, the cache is checked to see if data exists in the cache. If this data is in the cache, so there is no need to access main memory (which takes longer time to be accessed), thus making the access time of memory smaller. Usually there are separate caches for data and instructions. The data cache is a typically mounted in a hierarchy of cache levels (multilevel caches as are sometimes called). L1 (Level 1) and L2 (Level 2) are the top most of the caches in the hierarchy of caches. L1 cache is the closest to main memory and this cache is checked first. The L2 cache is in the following line and is the second closest to the main memory. L1 and L2 differ in access speed, location, size and cost.

L1 cache

The L1 cache (also known as primary cache, or Level 1 cache) is the top most cache in the hierarchy of cache levels of a central processing unit. This is the fastest cache in the hierarchy. It has a smaller size and a smaller delay (zero wait – the state) because it is usually built in to the chip. SRAM (the Static Random Access Memory) is used for the implementation of L1.

L2 cache

The L2 cache (also known as secondary cache or Level 2 cache) is the cache that is next to the L1 cache hierarchy. L2 is usually accessed only if the sought data are not found in L1. L2 is usually used to build a bridge over the gap between the performance of the CPU and memory. L2 is usually used implementing a DRAM (Dynamic random access memory). Most times, L2 is soldered on the motherboard close to the chip (but not on the chip itself), but some CPUs like Pentium Pro have deviated from this standard.

What is the difference between L1 and L2 Cache?

Although both L1 are L2 are cache memories with key differences. L1 and L2 are the first and second cache in the hierarchy of cache levels. L1 has a smaller memory capacity than L2. Thus, L1 can be accessed faster than L2. L2 is accessed only if the requested data in not found in L1. L1 is usually deeply embedded in the chip, while L2 is soldered on the motherboard close to the chip. Thus, L1 is a very small delay compared to L2. Because L1 is performed using SRAM and L2 is performed using DRAM, L1 does not need the refreshment, while L2 has to be refreshed. If the caches are rigorously included, all data in L1 can be found in L2 as well. However, if the caches are exclusive, the same data will not be available in both L1 and in L2.


Category: VS  |  Tags: