# CPU and clock rate

As I understand it, CPUs generate electrical pulses using a quartz crystal. The rate the pulses are generated (taking into account various multipliers) give the processing speed which all components run off (2, 3, 4 GHz etc).

Does this mean that these electrical pulses drive all the components in the CPU? i.e. is the clock rate the input of electricity for the CPU where transistors are switched on and off (potentially) at the clock rate? So a clock rate of 3GHz means that transistors can be switched on and off 3 billion times a second? Or have I interpreted it wrong?

Also, when the quartz crystal generates this electrical pulse, what happens to it exactly and what does it do?

Actually, the clock cycle wont tell the speed at wich a single transistor can switch, but, how much time it does take for a signal to travel the slowest/longest path. A single cmos transistor on a modern cpu can switch at speeds much higher than the clock used on the cpu, but, the clock is not based only on transistor switching speed but on signal travel times. Thats the whole point of dividing the cpu into shorter stages (pipelining), to decrease the length that the signal must pass before finishing the execution of a certain task. That length versus speed of electron flow will determine the longest propagation delay and so will limit the max clock of the system.

Essentially, yes - these electrical pulses drive all the components in the CPU. These days, a crystal reference drives a PLL that can multiply the reference up. Thus you don't have a 3GHz crystal in your PC!

This is the basis of "synchronous logic" - circuits which are synchronized by a clock signal. Ideally every transition in the circuit is simultaneous but in reality there are delays and set up times that limit the maximum speed the circuit can run at. To limit these issues, the clock signal is distributed carefully throughout the system - designers use simulation to analyse the timing.

There are such things as asynchronous circuits but I'd say all modern CPUs are synchronous circuits with a global clock.

• Thanks carveone. What sort of input does the crystal receive - is it DC or AC? From reading up on the web I know the CPU voltage regulator changes the main input voltage of the computer to the desired input voltage the CPU wants I just don't know what this voltage input is? Some sources I read seem to say the crystal oscillator has an AC input but then I have found that quartz crystals also use a DC input and give an AC output. Commented Aug 22, 2014 at 19:03
• It might be worth noting that the transistors can switch faster than the clock, that the clock is used at the latch points (e.g., between pipeline stages).
– user15426
Commented Aug 22, 2014 at 20:49
• A crystal acts like an RLC circuit with a precise resonant frequency. On the PIC I'm using, the crystal is part of the feedback loop of an inverter. So it's fed a 1-0-1-0-1...etc square wave. So DC and AC ;-) The 10101... sequence matches the crystal frequency after a certain period (the startup time). I'm afraid I'm not a mathsy person but I suppose if you are to compare a crystal to a tuning fork, you keep having to strike the fork for it to keep ringing. That's as much as I know! Commented Aug 24, 2014 at 15:30