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




Recommended Book
The Winn L. Rosch Hardware Bible (6th Edition)
By Winn L Rosch
Que
Price: $0.94

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 Duo Retail Boxed E7200 Processor - 2.53GHz, 3MB Cache, 1066MHz FSB, 45nm Wolfdale E700 Boxed Processor $
ZipZoomfly.com: $119.00 TigerDirect.com: $119.99
Newegg.com: $119.99 Dell: $159.99
CompUSA.com: $119.99 Dell Small Business: $159.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
  • VIA C7-M Processor
  • Inside Pentium 4 Architecture
  • All Pentium 4 Models
  • How Chips are Manufactured
  • Intel Fab18 Factory Tour in Kiryat Gat, Israel

  • Recommended Deals
    AMD Athlon 64 3500+, 2.2 GHz (ada3500dik4b) OEM / Unboxed Processor


    ZipZoomfly.com: $59.99 Circuitcity: $579.99
    AMD Athlon™ 64 X2 6000+, 3.0 GHz (ADX6000CZBOX) Boxed Processor


    Amazon: $92.00 Newegg.com: $92.00
    eBay: $105.00 Circuitcity: $579.99
    AMD Athlon™ 64 3000+, 2.0 GHz (ada3000box) AMD Processor in a Box (PIB)


    ZipZoomfly.com: $105.00 Circuitcity: $579.99
    Intel Core™2 Quad Q6600, 2.40 GHz (BX80562Q6600) Boxed Processor


    ZipZoomfly.com: $188.50 Newegg.com: $189.99
    Dell: $299.99 CompUSA.com: $184.99
    TigerDirect.com: $184.99 Circuitcity: $2199.99

    RSSLatest News
    Transcend Launches T5 Flash Memory
    October 3, 2008 - 11:50 AM PST
    Thermaltake Announces BigTyp14 Pro CPU Cooler
    October 3, 2008 - 11:28 AM PST
    A-Data Announces Triple-Channel DDR3 kits for Core i7 Processors
    October 3, 2008 - 11:17 AM PST
    EVGA Launches nForce 790i SLI FTW Mainboard
    October 3, 2008 - 11:07 AM PST
    GlacialPower Launches 650 W PSU
    October 2, 2008 - 9:56 AM PST
    Manufacturers Launch Radeon HD 4550 and HD 4350 Cards
    October 1, 2008 - 9:51 AM PST
    AMD/ATI Launches Radeon HD 4550 and HD 4350
    September 30, 2008 - 9:25 AM PST
    Buffalo Announces DDR3-2400
    September 29, 2008 - 8:00 AM PST
    OCZ Launches HydroFlow Processor Water Block
    September 26, 2008 - 11:52 AM PST
    Noctua Launches Four Server CPU Coolers
    September 25, 2008 - 11:52 AM PST
    .:: More News ::.

    RSSLatest Content
    Kingwin Mach 1 ABT-700MA1S 700 W Power Supply Review
    Thermaltake V9 Case Review
    OCZ Dominatrix Gaming Mouse Review
    Rosewill Wind Ryder RZLS142-AP Case Review
    AeroCool AeroRacer Pro Case Review
    iPod Touch 2nd Generation Review
    Olympus SP-570UZ Digital Camera Review
    Zalman ZM600-HP 600 W Power Supply Review
    Tagan A+ Curbic Case Review
    Everything You Need to Know About The Motherboard Voltage Regulator Circuit
    Inside Atom Architecture
    ECS A790GXM-A Black Series Motherboard Review
    AMD ATI Chips Comparison Table
    All Core 2 Models
    All Celeron Models

    Our Most Popular Articles
    Maximum CPU Temperature
    791,916 views
    nVidia Chips Comparison Table
    492,813 views
    AMD ATI Chips Comparison Table
    435,780 views
    ATI Radeon X1300 Pro Review
    419,634 views
    ATI Radeon X1600 XT Review
    413,847 views
    How to Find Out Your Motherboard Manufacturer and Model
    403,321 views
    Connecting Two PCs Using a USB-USB Cable
    362,179 views
    How To Correctly Apply Thermal Grease
    346,778 views
    Sempron vs. Athlon XP
    283,830 views
    Sempron 3400+ Review
    274,611 views

    Latest Threads in Our Forums
    Need advices with a 512 kbps internet connection
    by Gamer Z
    creative x fi elite pro spdif output
    by Gamer Z
    Budget Gaming PC
    by Gamer Z
    Everything you Need to Know About ATA-66, ATA-100 and ATA-133 Hard Disks
    by aopen
    Recovering Hard Disks with Bad Blocks
    by aopen
    Anatomy of a Hard Disk Drive
    by aopen
    need subject about pcb for hardisk --mr Gabriel Torres
    by aopen
    Kingwin Mach 1 ABT-700MA1S 700 W Power Supply Review
    by C.Gajo
    Mobo faulty
    by Gabriel Torres
    Transcend Launches T5 Flash Memory
    by Hardware Secrets Team
    .:: Visit Our Forums ::.


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