2
$\begingroup$

In all computer architecture books we study that Cache memory could be divided into 3 levels (L1,L2 and L3) and its very beneficial to do so. Why don't we use the same approach in case of main memory (RAM). Is there any particular reason that we avoid this?

$\endgroup$
1
  • $\begingroup$ I'm not sure what you are hinting to. Explicitly handling memory with different access time has been tried (some DSP and microcontrollers have internal and external memories for instance, and there is the whole set of NUMA multiprocessor architectures). The advantage of using cache is that they relieve the programmer of the task of handling the memory structure, allowing a cleaner hardware software interface and providing performance improvement for existing programs. $\endgroup$ Mar 20 '13 at 12:15
4
$\begingroup$

Cache memory levels are inherently a "subdivision" of main memory (RAM). To speed up the access of RAM, the cache was created using the notion of "The Principle of Locality". Frequently in programs, memory is accessed in locations that are close (local) to previously accessed locations, so it benefits to keep sections of data stored in nearby cache instead of going all the way to the hard drive. Also, cost has historically been a factor. Cache memory is more expensive than memory space on a hard drive, etc. Keep in mind, the landscape of computer memory models is always changing, and it is likely that other methods will be used in the future to speed up memory access. I think the current trend is to move away from mechanical storage devices with moving parts, hence the SSD's.

$\endgroup$
1
  • 2
    $\begingroup$ Note: cache size is not determined by just a cost factor: whatever the price you can pay, there is a limit on the amount of memory you can access in a small number of cycles. $\endgroup$ Mar 20 '13 at 16:01
1
$\begingroup$

What do you need for a cache? You need two things: One kind of memory that is faster and more expensive, and another kind of memory that is slower and cheaper. Why do we need this? If you had no faster memory then you would just use the cheaper one. And if faster memory wasn't more expensive, you would just use the faster one.

And the problem is that right now there is no RAM that would be significantly cheaper and slower than the RAM that you would put into a computer. Therefore no two levels of RAM.

The M1 processors seem to use technology that can access a moderate (16 GB) amount of RAM at very high speed. There is a chance that future versions would use these 16 GB of RAM like a cache for larger amounts of RAM at usual speeds.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.