But what is 3 Ghz referring to? This is referring to the clock rate.
The clock on a computer is not the same as the clock on the wall, which is used to tell time. A computer clock is more like a metronome, which keeps the beat for musicians to play music.
A clock changes its value from 0 to 1 every period. We use the letter T to designate the period. This signal repeats over and over again. Perhaps you remember, from a course in calculus, about sine waves. This wave repeats once per period. The difference between a sine wave and a clock is that a sine wave is curved. It gradually increases than decreases.
A clock's signal is squarish in shape.
Related to the period of the clock is the frequency. Frequency is defined as 1/T, and has units of s-1.
When you hear clock rates, it's usually given by its frequencies. Thus, 2 Ghz means 2 x 109 cycles per second. A cycle is a signal for a single period. The period for this clock is 1/2 x 109 which is 5 x 10-10 seconds, which is half a nanosecond, which is a really, really short period of time.
To give you an idea of how short this time is. Imagine that everyone in the world sang exactly one note, and exactly one person sings at a time. Suppose each note lasts one nanosecond. It would take 6 seconds to complete (assuming 6 billion people in the world).
As you can see the clock signal has a positive slope from 0 to 1 and a negative slope from 1 to 0. This slope has been exaggerated so you can see it better. Normally, it wouldn't be quite so angled.
There are a few key features of a clock:
Each positive clock edge appears once per clock period. Each negative clock edge appears once per clock period.
Must a clock always do this? The answer is no. We could have a clock where it stays 1 for 3T/4 (three quarters of a period) and 0 for T/4 (one quarter of a period), or any fraction x and T - x where x < T.
If you're only using the positive edge, then it doesn't matter how long the signal stays at 1 or 0, since you only use the edge. However, if you want to use both positive and negative edges, then you're going to have to consider when you want the edges to occur.
Begin to move your finger to the right, but trace out the signal. Your finger should move from 0 to 1, and back again.
If you happen to trace over the positive edge once a second, and you're steadily moving to the right (not going faster or slower) then the period is 1 second, and the frequency is 1 Hz.
Tracing the signal with your hand gives you a better "feel" for how a continuous signal behaves. Usually, computer science majors have a more difficult time with this (unless you really like calculus or are in engineering) because we deal with quantities that are discrete, rather than continuous.
At any point in time, someone can ask you the current value of the signal.
If we use the "pipe" analogy, we can think of this signal alternating between pumping red soda (for 0) and green soda (for 1).
To give you an analogy, imagine a music conductor tapping a beat with a baton (a stick) at regular intervals. Suppose you are playing a piano, and you're told to play a new note each time he taps his baton. Thus, how fast the conductor taps the baton controls how often you play notes.
Similarly, the rate at which the positive clock edge appears controls how fast a sequential logic device can change outputs.
It turns out that by using a clock, we can design a CPU more easily than if we don't use a clock. This is primary reason to use a clock.