# How is CPU clock rate maintained?

I was reading an article Clock rate from wikipedia which has to say that:

The clock rate typically refers to the frequency that a CPU is running at. The clock rate of a CPU is normally determined by the frequency of an oscillator crystal.

So, i'm wondering if I have 1 GHz clock rate (or processor speed?) what will be the frequency of oscillator crystal? It can't be just same as the clock rate?

-

Quartz crystals can vibrate at different frequencies.

Quartz crystals are manufactured for frequencies from a few tens of kilohertz to tens of megahertz

Source

So, motherboard manufacturers will pick a crystal that vibrates at a suitable frequency and then pass that through some electronics to multiply it up to the desired clock speed for the CPU.

There's a section in the Wikipedia article that lists the commonly used crystal frequencies

-
I have one question, Does a clock rate limits the actual speed of CPU which is why it is overclocked to acheive higher speed? Or is just a measure of number of instructions per seconds? – Sryia Jan 19 '12 at 12:30
@Sryia - CPU's are rated at the clock speed that gives optimal performance. Overclocking simply pushes the CPU to (or beyond) it's design tolerances which is risky – ChrisF Jan 19 '12 at 12:34

The oscillator is simply a very constant component (normally a Quartz crystal with some attached electronics) which will put out some form of time signal that the system can use. So say the oscillator "oscillates" once every 20ms (completely arbritrary) then the system knows exactly how long 20ms is and can calculate things up from that.

So for example a 1Ghz cpu does 1000000000 cycles per second, now if you wanted to sync that with the oscillator you would divide it all down; so 20ms is 0.02 seconds so the CPU know to keep at a clock speed of 1Ghz it must do 20000000 (20M) cycles every time the oscillator "ticks".

-

No it is not. The crystal is a timing mechanism. The cpu cycles in sycnh with the crystal. A simple example is to look at the widely loved Arduino Protoyping kit

It runs at 16mHz(mega; one is 8mHz), but you can over clock it to 32mHz, or under clock it to 8mhZ

On the mega the crytal is 16mhz to mathc the clock speed just because its cheap enough to do it. But to over clock it you say Crystal speed * 2 = 32mhz.

So each CPU cycle @ 32mhz = 0.5 crystal oscillation .

Understanding the basics and going up to 1ghz, 2ghz is a much more complex situation. TO achieve clocks speeds like this other in-between components needed to made. That is why you can set multipliers in your BIOS to set the cycle speed of your processor. And at this level you are multiplies the bus speed and not crystal. The actual bus speed is determined by the components that include crystal.. which could likely be 32khz or 32mhz(old ISA Bus) or anything else, depending on what bus you need.

So RAM bus, Graphics BUS , CPU BUS, they all run at their respective cycle speeds.

In motherbaords it is much more complex than the examples i used.

-