-2

My friend wants to buy the last i9 processors for his PC, I told him thats a wast of money, that all the components of a computer have to run on the same frequency and processors are much more evolved than RAM memories.

If the RAM runs at 1Ghz (just saying) and the processor at 2Ghz the the hole computer will run at 1Ghz.

He says thats not true anymore but when I ask him what has changed he dont know what say.

So, can anyone clarify us? Maybe provide a few sources too

Thank you.

BorisD
  • 97
  • 1

2 Answers2

7

all the components of a computer have to run on the same frequency

That's simply not true. Your computer would run at 60 Hz - that's the refresh rate of your monitor.

CPUs have internal cache which is significantly faster than RAM due to its proximity and technology used. It's way more expensive to produce cache and increasing its amount increases latency, so we can't put gigabytes of cache on a CPU, but modern CPUs have a few dozen MB of cache. It's even split into three levels. Lower levels are smaller but blazing fast, higher levels have more capacity but also more latency.

Processors try to operate on cache rather than RAM as much as possible due to its speed advantage. Programs are written with cache in mind too. The more recently some part of RAM was accessed, the more likely it's to be present in L1 (level 1) cache. When there's data that seems more relevant, previous values are moved to L2, then to L3, and only then to RAM. Similarly, if some data has to be read, the CPU will first check if it's present in L1 cache, then L2, L3, and only then RAM.

This description is a very simplified model, in reality there's much more going on due to the need to coordinate separate caches for CPU cores etc., but that's enough for the sake of answering your question.

Now, when CPU is waiting for data from higher-level cache or RAM, it won't idle. Its clock is completely independent from RAM's clock and it will still tick. It will try to execute following operations if they don't depend on result of current operation or even make an educated guess of the result and try to work ahead based on that guess. All that to avoid wasting time waiting for RAM.

You also seem to be assuming that RAM will deliver data every clock cycle. That's not the case. RAM modules have a number of latency parameters known as timings, with CL (CAS latency) timing combined with module's clock frequency being the most important ones. Clock/CL can be used as a rough performance indicator useful for comparison of modules of the same type (eg. DDR4 vs DDR4), with higher values being better. For example a 2400 MHz CL15 module is better than 2666 MHz CL18 module despite having lower clock frequency, because 2400M÷15=160 M operations/second and 2666M÷18≈148 M operations/second.

It's true that some clocks of some components run in sync. In particular, the IF interconnect in Ryzen processors runs at RAM speed. In 1st gen Ryzens one could overclock IF by increasing RAM clock at the cost of higher RAM latency (so that overall RAM performance is maintained and higher clocks can be reached even with cheaper modules). Newer Ryzens and Intels don't benefit that much from high-frequency RAM.

Going for higher RAM clocks makes a lot of sense if you want to squeeze more performance out of an integrated GPU. If you're going for a dedicated GPU and non-Ryzen 1xxx CPU, it doesn't make that much of a difference. Buying a CPU clocked higher than RAM definitely makes a lot of sense.

gronostaj
  • 58,482
3

Definitely not. The CPU frequency is the speed at which it operates and its cycles advance. Instructions take a number of cycles but they are pipelined and super-scalar so multiple instructions are simultaneous in-flight and at each cycle of the CPU frequency something gets done.

Memory frequency is the speed of the how fast memory can be accessed. Timings are pretty complicated for memory but it certainly cannot run as the speed of the CPU and it does not have to. First, nowadays memory is banked into channels so that you get more out in the same clock by accessing multiple modules to get twice or 4-times more data on each cycle, depending if it is dual channel and quad channel.

Additionally, there are at two levels of cache on the CPU, with 3 being more common now. This is ultra-fast memory which is built into the chip with progressively faster speed and smaller sizes. L1 is extremely fast but smaller than L2 which is smaller than L3. This lets the CPU work on data that can be accessed much faster than memory is capable.

The same logic applies to a hard disk. Disks are much slower than memory, so getting the data is much slower initially when its on disk but the same data in memory can be read much faster by the CPU because memory is much faster. When part of that data is copied from memory to the L3 cache and the L2 and finally the L1 cache, the CPU can access it very close to maximum speed.

CPU have exceeded the speed of memory decades ago and it would not make sense to sell CPUs with 4Ghz or more if they could not run faster than memory. You can get an idea of where this comes from at Wikipedia here and here. The different scaling factor were invented precisely to take advantage of components that run at different speeds. High performance software is written in consideration of all different speeds and maximizes the work done at higher-speeds. Once the CPU finishes all it can do with the data in its L1 cache, it brings some from the L2 and so on, until the disk or network. There is always a slowest link which places a limit on how fast computation starts.

Itai
  • 3,387