Hardware Secrets
Home | Camera | Case | CE | Cooling | CPU | Input | Memory | Mobile | Motherboard | Networking | Power | Storage | Video | Other
Content
Articles
First Look
Gabriel's Blog
News
Reviews
Tutorials
Main Menu
About Us
Awarded Products
Compare Prices
Datasheets
Dictionary
Download
Drivers
Forums
Links
Manufacturer Finder
Newsletter
On The Web
RSS Feed
Test Your Skills
Twitter
Newsletter
Subscribe today!
Search




Recommended
The Winn L. Rosch Hardware Bible, 6th Edition (2 Vol. Set)
The Winn L. Rosch Hardware Bible, 6th Edition (2 Vol. Set), by Winn L Rosch (Que), starting at $2.31
Home » CPU
How The Memory Cache Works
Author: Gabriel Torres
Type: Tutorials Last Updated: September 12, 2007
Page: 4 of 9
$ Check REAL-TIME pricing for Intel Core 2 Quad Q9550 Processor BX80569Q9550 - 2.83GHz 12MB Cache 1333MHz FSB Yorkfield Quad-Core Retail Socket 775 with Fan $.
TigerDirect: $269.99 Buy.com: $249.99
Newegg: $259.99 Amazon: $269.99

Meet The Memory Cache

On Figure 2 you can see a basic block diagram from a generic single-core CPU. Of course the actual block diagram will vary depending on the CPU and you can read our tutorials for each CPU line to take a look on their real block diagram (Inside Pentium 4 Architecture, Inside Intel Core Microarchitecture and Inside AMD64 Architecture).

How a CPU Works
click to enlarge
Figure 2: Basic block diagram of a CPU.

The dotted line on Figure 2 represents the CPU body, as the RAM memory is located outside the CPU. The datapath between the RAM memory and the CPU is usually 64-bit wide (or 128-bit when dual channel memory configuration is used), running at the memory clock or the CPU external clock (or memory bus clock, in the case of AMD processors), which one is lower. We have already taught you how to calculate the memory transfer rate on the first page of this tutorial.

All the circuits inside the dotted box run at the CPU internal clock. Depending on the CPU some of its internal parts can even run at a higher clock rate. Also, the datapath between the CPU units can be wider, i.e. transfer more bits per clock cycle than 64 or 128. For example, the datapath between the L2 memory cache and the L1 instruction cache on modern processors is usually 256-bit wide. The datapath between the L1 instruction cache and the CPU fetch unit also varies depending on the CPU model – 128 bits is a typical value, but at the end of this tutorial we will present a table containing the main memory cache specs for the CPUs available on the market today. The higher the number the bits transferred per clock cycle, the fast the transfer will be done (in other words, the transfer rate will be higher).

In summary, all modern CPUs have three memory caches: L2, which is bigger and found between the RAM memory and the L1 instruction cache, which holds both instructions and data; the L1 instruction cache, which is used to store instructions to be executed by the CPU; and the L1 data cache, which is used to store data to be written back to the memory.
 
L1 and L2 means “Level 1” and “Level 2”, respectively, and refers to the distance they are from the CPU core (execution unit). One common doubt is why having three separated cache memories (L1 data cache, L1 instruction cache and L2 cache).

Making zero latency static memory is a huge challenge, especially with CPUs running at very high clock rates. Since manufacturing near zero latency static RAM is very hard, the manufacturer uses this kind of memory only on the L1 memory cache. The L2 memory cache uses a static RAM that isn’t as fast as the memory used on the L1 cache, as it provides some latency, thus it is a little bit slower than L1 memory cache.

Pay attention to Figure 2 and you will see that L1 instruction cache works as an “input cache”, while L1 data cache works as an “output cache”. L1 instruction cache – which is usually smaller than L2 cache – is particularly efficient when the program starts to repeat a small part of it (loop), because the required instructions will be closer to the fetch unit.

This is rarely mentioned, but the L1 instruction cache is also used to store other data besides the instructions to be decoded. Depending on the CPU it can be also used to store some pre-decode data and branching information (in summary, control data that will speed up the decoding process) and sometimes the L1 instruction cache is bigger than announced, because the manufacturer didn’t add the extra space available for these extra pieces of information.

On the specs page of a CPU the L1 cache can be found with different kinds of representation. Some manufacturers list the two L1 cache separately (some times calling the instruction cache as “I” and the data cache as “D”), some add the amount of the two and writes “separated” – so a “128 KB, separated” would mean 64 KB instruction cache and 64 KB data cache –, and some simply add the two and you have to guess that the amount is total and you should divide by two to get the capacity of each cache. The exception, however, goes to CPUs based on Netburst microarchitecture, i.e. Pentium 4, Pentium D, Pentium 4-based Xeon and Pentium 4-based Celeron CPUs.

Processors based on Netburst microarchitecture don’t have a L1 instruction cache, instead they have a trace execution cache, which is a cache located between the decode unit and the execution unit, storing instructions already decoded. So, the L1 instruction cache is there, but with a different name and a different location. We are mentioning this here because this is a very common mistake, to think that Pentium 4 processors don’t have L1 instruction cache. So when comparing Pentium 4 to other CPUs people would think that its L1 cache is much smaller, because they are only counting the 8 KB L1 data cache. The trace execution cache of Netburst-based CPUs is of 150 KB and should be taken in account, of course.

Pages (9): « 1 2 3 [4] 5 6 7 8 9 »
Print Version | Send to Friend | | Bookmark Article | Comments (0)

Related Content
  • Penryn Core New Features
  • nVidia Tesla Technology
  • Inside Intel Nehalem Microarchitecture
  • Core 2 Duo, Core 2 Quad, Phenom X3 and Phenom X4: Which One is the Best USD 200 CPU?
  • Everything You Need to Know About the CPU C-States Power Saving Modes

  • Recommended Deal.
    Power Supply VX450W 450W ATXAmazon.com Corsair CMPSU-450VX 450-Watt VX Series 80 Plus Certified Power Supply compatible with Core i7 and i5 Electronics


    Amazon: $73.89 Wal-Mart: $89.98
    Newegg: $64.99 TigerDirect: $79.99

    RSSLatest News
    IN WIN LAN Party in Southern California
    November 20, 2009 - 12:37 PM PST
    Patriot Announces PS-100 SSD Series
    November 19, 2009 - 7:30 AM PST
    Antec Launches TPQ-1200 PSU
    November 18, 2009 - 11:30 AM PST
    AMD/ATI Launches Radeon HD 5970
    November 18, 2009 - 10:18 AM PST
    OCZ Launches Colossus SSD Series
    November 17, 2009 - 1:39 PM PST
    NZXT Unleashes Tempest EVO Mid-Tower Case
    November 17, 2009 - 1:06 PM PST
    nVidia Launches GeForce GT 240
    November 17, 2009 - 10:18 AM PST
    Arctic Cooling Announces Accelero TWIN TURBO PRO VGA Cooler
    November 16, 2009 - 11:46 AM PST
    PowerColor Announces PLAY! HD5770 Video Card
    November 13, 2009 - 12:51 PM PST
    G.Skill Announces Falcon II SSD Series
    November 11, 2009 - 3:31 PM PST
    .:: More News ::.

    RSSLatest Content
    Ultra X4 500 W Power Supply Review
    Seagate Barracuda XT 2 TB Hard Disk Drive Review
    Nintendo Wii Fit Plus Review
    AMD ATI Chips Comparison Table
    nVidia Chips Comparison Table
    Gigabyte G41M-ES2L Motherboard
    Netflix on Playstation 3 Review
    CM Storm Sentinel Advance Mouse Review
    Titan Skalli CPU Cooler Review
    Nexus RX-6300 630 W Power Supply Review
    Gigabyte P55-UD6 Motherboard
    Nintendo Wii Review
    SilverStone Grandia GD04 Case Review
    Can We Trust the 80 Plus Certification?
    NZXT Gamma Case Review

    Our Most Popular Articles
    Maximum CPU Temperature
    1,078,391 views
    How to Find Out Your Motherboard Manufacturer and Model
    706,353 views
    nVidia Chips Comparison Table
    679,215 views
    Connecting Two PCs Using a USB-USB Cable
    593,525 views
    How To Correctly Apply Thermal Grease
    562,538 views
    AMD ATI Chips Comparison Table
    560,183 views
    ATI Radeon X1300 Pro Review
    487,958 views
    ATI Radeon X1600 XT Review
    477,125 views
    How To Perform a BIOS Upgrade
    394,578 views
    Sempron vs. Athlon XP
    338,541 views

    Latest Threads in Our Forums
    Dell Inspiron 6000 Powers but will not boot...
    by Merman
    Ultra X4 500 W Power Supply Review
    by Merman
    IN WIN LAN Party in Southern California
    by Hardware Secrets Team
    Getting A Hard Copy
    by Trevorrross
    Am I Making The Right Choice?
    by need2know
    Is it available to mount the Zalman cooler?
    by Olle P
    dsl modem prob
    by Sherry
    Seagate Barracuda XT 2 TB Hard Disk Drive Review
    by Hardware Secrets Team
    Overclocking a dell xps 410
    by 6dracing
    How to recover mp3's, pdf & chm files, applications from formated harddrive partition
    by tomahawk 1705
    .:: Visit Our Forums ::.


    © 2004-9, Hardware Secrets, LLC. All rights reserved.
    Advertising | Legal Information | Privacy Policy
    All times are Pacific Standard Time (PST, GMT -08:00)