what is computer L1, L2, L3 cache, how processor L1, L2, L3 cache works
Home About Us Reference Product Service Sitemap

What is computer L1, L2, L3 cache, how processor L1, L2, L3 cache works?


L1, level 1 and L2, level 2 cache are computer's CPU cache memory. If the computer processor can find the data it needs for its next operation in cache memory, it will save time compared to having to get it from random access memory. L1 cache is usually built onto the microprocessor chip itself. For example, the Intel MMX microprocessor comes with 32 thousand bytes of L1. L2 cache memory is on a separate chip (possibly on an expansion card) that can be accessed more quickly than the larger "main" memory.

The use of cache memory stems from the fact that your main system RAM runs much slower than the CPU core. If the CPU had to wait for the slow main RAM for every new byte of instructions or data, it would be ridiculously slow. Ideally, you would have all your main RAM on the CPU chip itself, running at the same speed as the CPU's core, but that would be ridiculously expensive.

Since RAM tends to be accessed as chunks of instructions/data from adjacent addresses rather than individual bits scattered all over the place, designers add a relatively small amount of fast RAM as a "cache" to the CPU chip. Although the first time the CPU needs data, it has to wait for the slow main RAM, when that data finally arrives, a copy is saved in the cache. If the CPU next needs data from a nearby address, there is a high chance (~90%) that the data is in the cache, which means no delay in reading it into the CPU.

The bigger the cache, the more it can hold but the more expensive it is. Normally, current CPUs have a small primary L1 cache which runs at full CPU core speed with low latency and a secondary L2 cache with longer (slower) latency or slower speed, or both.

L1 cache sizes are typically on the order of 8-64K, while L2 cache sizes range from around 128K to 6MB or more. Today's mainstream CPUs have at least 2MB of L2 cache.

The bottom line is that L2 cache pretty much just acts as a buffer for the slow main RAM; as long as you have "enough", more doesn't make a big difference. A few MB is about "enough" these days. A popular L2 cache memory size is 1,024 kilobytes.

L3, Level 3, cache is specialized memory that works hand-in-hand with L1 and L2 cache to improve computer performance. L3 cache has typically been built into the motherboard, but some CPU models are already incorporating L3 cache. The advantage of having on-board cache is that it¡¯s faster, more efficient and less expensive than placing separate cache on the motherboard.

Difference between Li, L2, L3 cache

Basically, the L1 cache is the fastest, the L2 cache is somewhat slower, and the L3 cache is the slowest (compared to other components in the computer, they're all very past, slow is relative).

If a PC can get a task done in the L1 cache, it does. If not, it trades it to the L2 cache, which takes a little longer but can do more at one time. If the L2 cache can't, the L3 cache works too.

Why not just have a big L1 cache? The L1 cache is extremely expensive. So the L1/L2/L3 system makes for great (not optimal, if you had a really big L1 cache it'd be faster) performance that doesn't cost an arm and a leg.

©1994 - 2010 Edusoftmax Inc. All rights reserved. Questions? Comments?    Visitors: