Studying for the A+, Network+ or Security+ exams? Get over 2,600 pages of FREE study guides at CertiGuide.com!|
Join the PC homebuilding revolution! Read the all-new, FREE 200-page online guide: How to Build Your Own PC!
NOTE: Using robot software to mass-download the site degrades the server and is prohibited. See here for more.
Find The PC Guide helpful? Please consider a donation to The PC Guide Tip Jar. Visa/MC/Paypal accepted.
|Take a virtual vacation any time at DesktopScenes.com - view my art photos online for FREE in either Flash or HTML!|
Tired of the boss? Ever wanted to be an independent freelancer? Not sure how to get started?
The all-new Online Freelancing Guide can help. Tons of useful info, and it's free! Join the online freelancing revolution today.
Primary (Level 1) Cache and Cache Controller
All modern processors incorporate a small, high-speed cache right on the chip, to hold recently-used data and instructions from memory. A computer science principle called locality of reference states that if the processor recently referred to a location in memory, it is likely that it will refer to it again in the near future. Using a cache to hold recently used memory values saves the processor from going to memory each time to reload them. This provides a significant performance boost, because main memory is many times slower than the processor's cache.
The cache on the processor is called primary (or level 1) because it is the cache closest to the processor. Each time the processor requests information from memory, the cache controller on the chip uses special circuitry to first check if the memory data is already in the cache. If it is, then the system is spared a (time consuming) access to the main memory. Most computers also use a secondary (or level 2) cache, to catch some of the recently used data that doesn't fit in the smaller primary cache.
A full explanation of the value of caching, the principles behind it, the different levels of caching in a PC, and caching protocols and technologies, can be found in the section that discusses the secondary cache. The principles of operation of the primary and secondary caches, in terms of cache mapping, write policy etc. are pretty similar. The actual technology used for primary and secondary caches are of course different, as are their sizes and speeds.
The typical processor primary cache ranges in size from 8 KB to 64 KB, with larger amounts on the newer processors. Older processors (386 class and earlier) in fact have no primary cache at all. These caches are very fast because they run at the full speed of the processor and are integrated into it. In addition, most primary caches are set associative, which improves the chances of getting a "hit" on the cache.
There are two different ways that the processor can organize its primary cache: some processors have a single cache to handle both command instructions and program data; this is called a unified cache. Others have separate data and instruction caches. In some cases the capabilities of the data and instruction caches may be slightly different. For example, on the Pentium the data cache can use the write-back write policy, whereas the instruction cache is write-through only. Overall the performance difference between integrated and separate primary caches is not significant.
Note: Sometimes a unified
cache can be called an integrated cache. Don't confuse this use of the phrase with
the use of the same phrase to refer to the integrated secondary cache of the Pentium Pro
processor. In the second context "integrated" means that the PPro's secondary
cache is in the same package as the chip itself.