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: $1.62

Home » CPU
How The Memory Cache Works
Author: Gabriel Torres
Type: Tutorials Last Updated: September 12, 2007
Page: 1 of 9
$ Check REAL-TIME pricing for Intel Core 2 Duo E8400, 3Ghz E8400 (53224) Boxed Processor $
TigerDirect.com: $179.99 Circuit City: $270.99
CompUSA.com: $179.99 ZipZoomfly.com: $168.90
Dell: $249.99 Buy: $172.99

Introduction

The memory cache is high-speed memory available inside the CPU in order to speed up access to data and instructions stored in RAM memory. In this tutorial we will explain how this circuit works in an easy to follow language.

A computer is completely useless if you don’t tell the processor (i.e. the CPU) what to do. This is done thru a program, which is a list of instructions telling the CPU what to do.

The CPU fetches programs from the RAM memory. The problem with the RAM memory is that when it's power is cut, it's contents are lost – this classifies the RAM memory as a “volatile” medium. Thus programs and data must be stored on non-volatile media (i.e. where the contents aren’t lost after your turn your PC off) if you want to have them back after you turn off your PC, like hard disk drives and optical media like CDs and DVDs.

When you double click an icon on Windows to run a program, the program, which is usually stored on the computer’s hard disk drive, is loaded into the RAM memory, and then from the RAM memory the CPU loads the program thru a circuit called memory controller, which is located inside the chipset (north bridge chip) on Intel processors or inside the CPU on AMD processors. On Figure 1 we summarize this (for AMD processors please ignore the chipset drawn).

How the CPU Works
click to enlarge
Figure 1: How stored data is transferred to the CPU.

The CPU can’t fetch data directly from hard disk drives because they are too slow for it, even if you consider the fastest hard disk drive available. Just to give you some idea of what we are talking about, a SATA-300 hard disk drive – the fastest kind of hard disk drive available today for the regular user – has a maximum theoretical transfer rate of 300 MB/s. A CPU running internally at 2 GHz with 64-bit internal datapaths* will transfer data internally at 16 GB/s – over 50 times faster.

* Translation: the paths between the CPU internal circuits. This is rough math just to give you an idea, because CPUs have several different datapaths inside the CPU, each one having different lengths. For example, on AMD processors the datapath between the L2 memory cache and the L1 memory cache is 128-bit wide, while on current Intel CPUs this datapath is 256-bit wide. If you got confused don’t worry. This is just to explain that the number we published in the above paragraph isn’t fixed, but the CPU is always a lot faster than hard disk drives.

The difference in speed comes from the fact that hard disk drives are mechanical systems, which are slower than pure electronics systems, as mechanical parts have to move for the data to be retrieved (which is far slower than moving electrons around). RAM memory, on the other hand, is 100% electronic, thus faster than hard disk drives and optimally as fast as the CPU.

And here is the problem. Even the fastest RAM memory isn’t as fast as the CPU. If you take DDR2-800 memories, they transfer data at 6,400 MB/s – 12,800 MB/s if dual channel mode is used. Even though this number is somewhat close to the 16 GB/s from the previous example, as current CPUs are capable of fetching data from the L2 memory cache at 128- or 256-bit rate, we are talking about 32 GB/s or 64 GB/s if the CPU works internally at 2 GHz. Don’t worry about what the heck “L2 memory cache” is right now, we will explain it later. All we want is that you get the idea that the RAM memory is slower than the CPU.

By the way, transfer rates can be calculated using the following formula (on all examples so far “data per clock” is equal to “1”):

Transfer rate = width (number of bits) x clock rate x data per clock / 8

The problem is not only the transfer rate, i.e. the transfer speed, but also latency. Latency (a.k.a. “access time”) is how much time the memory delays in giving back the data that the CPU asked for – this isn’t instantaneous. When the CPU asks for an instruction (or data) that is stored at a given address, the memory delays a certain time to deliver this instruction (or data) back. On current memories, if it is labeled as having a CL (CAS Latency, which is the latency we are talking about) of 5, this means that the memory will deliver the asked data only after five memory clock cycles – meaning that the CPU will have to wait.

Waiting reduces the CPU performance. If the CPU has to wait five memory clock cycles to receive the instruction or data it asked for, its performance will be only 1/5 of the performance it would get if it were using a memory capable of delivering data immediately. In other words, when accessing a DDR2-800 memory with CL5, the performance the CPU gets is the same as a memory working at 160 MHz (800 MHz / 5). In the real world the performance decrease isn’t that much because memories work under a mode called burst mode where from the second data on, data can be delivered immediately, if it is stored on a contiguous address (usually the instructions of a given program are stored in sequential addresses). This is expressed as “x-1-1-1” (e.g. “5-1-1-1” for the memory in our example), meaning that the first data is delivered after five clock cycles but from the second data on data can be delivered in just one clock cycle – if it is stored on a contiguous address, like we said.

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

Related Content
  • Inside Pentium 4 Architecture
  • All Pentium 4 Models
  • How Chips are Manufactured
  • Intel Fab18 Factory Tour in Kiryat Gat, Israel
  • Intel EM64T Technology Explained

  • Recommended Deals
    AMD Athlon™ XP 2800+, 2.8 GHz (AXDA2800BOX) Retail Processor


    ZipZoomfly.com: $106.99 TIMEOUT: $0.00
    Intel Core 2 Duo E6850, 3 GHz (BX80557E6850) Boxed Processor


    TECHONWEB: $211.32 TigerDirect.com: $204.99
    Buy.com: $192.99 Dell: $219.99
    CompUSA.com: $204.99 Amazon: $308.26
    AMD Athlon™ 64 3800 3800+, 2 GHz AMD Processor in a Box (PIB)


    Server Supply: $135.00 ZipZoomfly.com: $49.99
    Amazon: $90.49 Circuitcity: $629.96
    Zappos: $1026.00
    Intel Pentium® D 945, 3.40 GHz (HH80553PG0964MN) OEM / Unboxed Processor


    CompuVest: $101.25 Singlefeed: $3350.00
    Intel Core™2 Quad Q6600, 2.40 GHz (BX80562Q6600) Boxed Processor


    Dell: $329.99 ZipZoomfly.com: $193.50
    TECHONWEB: $207.03 Tech for Less: $176.76
    Circuit City: $259.99 Amazon: $2099.99

    RSSLatest News
    OCZ Launches "P45 Special" DDR2 modules
    August 7, 2008 - 7:26 AM PST
    AMD Launches 760 GX Chipset
    August 6, 2008 - 10:53 AM PST
    MSI Launches Gaming Notebooks
    August 5, 2008 - 7:53 AM PST
    Zotac Unveils Watercooled GeForce 9800 GTX+
    August 4, 2008 - 7:33 AM PST
    HIS Launches Radeon HD 4850 IceQ 4
    August 1, 2008 - 11:12 AM PST
    Thermaltake Launches RamOrd Memory Cooler
    August 1, 2008 - 9:57 AM PST
    Force3D Announces Radeon HD 4800 with Twin Turbo Cooler
    August 1, 2008 - 9:55 AM PST
    Arctic Cooling Launches Alpine 64 GT
    August 1, 2008 - 9:53 AM PST
    Spire Launches SilverBalze
    July 31, 2008 - 11:04 AM PST
    Gigabyte Unveils EP45-Extreme Motherboard Series
    July 31, 2008 - 9:31 AM PST
    .:: More News ::.

    RSSLatest Content
    All Athlon 64 Models
    Zalman GS1000 Case Review
    iPhone 3G Review
    Raidmax Aura Case Review
    How to Identify Japanese Electrolytic Capacitors
    Thermaltake Toughpower 1500 W Power Supply
    Razer Piranha Gaming Headset Review
    How to Use the SPDIF Output from Sound Blaster X-Fi Sound Cards
    nVidia Chips Comparison Table
    Small Adjustment to the Blog
    250 GB Hard Disk Drive Round-Up
    DLO TransDock Deluxe Review
    XFX GeForce GTX 260 640M XXX Video Card Review
    Sapphire HD 4870 Video Card Review
    Thermaltake BigWater 780e Water Cooler

    Our Most Popular Articles
    Maximum CPU Temperature
    750,075 views
    nVidia Chips Comparison Table
    466,657 views
    AMD ATI Chips Comparison Table
    416,507 views
    ATI Radeon X1300 Pro Review
    408,273 views
    ATI Radeon X1600 XT Review
    403,384 views
    How to Find Out Your Motherboard Manufacturer and Model
    367,109 views
    Connecting Two PCs Using a USB-USB Cable
    333,012 views
    How To Correctly Apply Thermal Grease
    318,625 views
    Sempron vs. Athlon XP
    276,502 views
    Sempron 3400+ Review
    266,075 views

    Latest Threads in Our Forums
    iPhone 3G Review
    by ouchast
    When to power up/down HD in external enclosure
    by Davidj
    XFX Overclocked GeForce 7600 GT (PV-T43G-UDD3) Review
    by phillypa800
    Help for my 1st custom build.
    by Gabriel Torres
    My first build help
    by Gabriel Torres
    Can't access my folder
    by Gabriel Torres
    OCZ Launches 'P45 Special' DDR2 Modules
    by Hardware Secrets Team
    Powerful Anti-virus
    by Earvin
    AMD Launches 760 GX Chipset
    by Hardware Secrets Team
    Microsoft Exchange changing last name
    by rektech
    .:: 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)