# An interesting thought about the speed of computers...

If you have a computer with a 2 GHz processor, and you sit about two feet from your monitor, then your computer can perform four calculations/operations in the time it takes light to travel from your monitor to your eye.

Depending on which processor you’re talking about, that number might be even higher - the latest Intel Core 2 Duo can perform twenty calculations in the same time period.

Someone’ll probably be along to correct my maths, but I work out many more than that:

c=3x10[sup]8[/sup]ms[sup]-1[/sup]

Say you sit 0.6m from your monitor;
0.6/3x10[sup]8[/sup]=6x10[sup]-9[/sup]=6ns is the time the light takes to reach you

In that time, your trust 2GHz processor is working away;
2GHz = 2x10[sup]9[/sup]Hz
t=1/f
=1/(2x10[sup]9[/sup])
=5x10[sup]-11[/sup]s
=0.5ps

(Time for light to reach you)/(time for one operation)=6ns/0.5ps=120 Operations

I actually did the working out because I thought four operations sounded like too much compared to the mighty speed of light, but I’m working out a good thirty times as many…is my working correct? I just did a hefty, evil Maths exam today (for Aero Eng), it’s kinda refreshing to do sums with numbers in again…

That must be why my computer always wins when we play hide and seek.

0.6/3x10[sup]8[/sup]=2x10[sup]-9[/sup], not 6x10[sup]-9[/sup]
1/(2x10[sup]9[/sup])=5x10[sup]-10[/sup], not 5x10[sup]-11[/sup]

2x10[sup]-9[/sup]/5x10[sup]-10[/sup]=4

That’s assuming that your processor is completing one instruction for every clock pulse. Is that actually true?

Yes, in general. In fact, most processors can perform more than one instruction per clock - that’s why the modern 2.6 Ghz Intel Core processors are faster than the 3.6 Ghz Pentium 4’s from a few years ago.

And I intentionally said ‘calculation/operation’ instead of ‘instruction’, anyway.

Eh, sort of.

Every instruction in a computer goes through several stages. The instruction itself has to be fetched from memory, then all of the operands associated with the instruction have to be fetched (i.e. if you are adding A and B together you need to go get A and B from memory too). Then the instruction is executed (this is where the processor actually figures out what A+B is). And, finally, the processor has to actually do something useful with the result, like store it somewhere.

In general, a clock pulse in a computer means one piece of data can move from one piece of hardware to another. If something takes several steps to do, it can’t all be done in one clock. Modern computers use a thing called “pipelining” to speed things up though. There’s one set of hardware that does the instruction fetching, another that does the decoding, another that does the executing, etc. It’s one big long “pipe” of hardware for the data to go through.

So, it starts out with one instruction being fetched. Then, while that instruction is being decoded, another instruction gets fetched. Then the first instruction is executed while the second instruction is decoded and a third instruction gets fetched. Once the pipeline gets filled up, there’s one instrcution at every stage along the pipe. Each instruction takes several clocks to finish, but on average, one instruction pops out the end of the pipe on every clock, so it is effectively executing one instruction per clock.

Actual processors are a bit more complicated than that, but that’s the basic idea.

OK. No matter how many times I did that, I didn’t see that mistake. Just checked it again and see what you mean. Feel silly now.