- seconds
- instructions
- machine cycles
- programs
- dollars

10

or equivalently 10

One particular unit that often confuses people is the Hertz (abbreviated "Hz"), a common unit of frequency. A Hertz is technically 1 divided by a second, but what people usually mean is 1 "cycle" per second, whatever a "cycle" is. For example, a radio station broadcasting at 93.9 MHz is producing a signal that oscillates 93,900,000 times per second, and a 300 MHz processor has a clock that pulses 300,000,000 times per second.

The electrical side of the course uses different units:

- seconds, a unit of time
- electrons
- Joules, a unit of energy (= 1 kg m
^{2}/sec^{2}) - Coulombs, a unit of charge (a certain, very large, number of electrons)
- Amperes, a unit of current (= 1 Coulomb/second)
- Volts, a unit of electrical potential (= 1 Joule/Coulomb)
- Ohms, a unit of resistance (= 1 Volt/Ampere)
- Watts, a unit of power (= 1 Joule/sec = 1 Volt * 1 Ampere)

When I lived in Canada, somebody told me the joke "Canada has the most efficient postal system in the world. Where else can you send a letter for only a penny a day?" [Canada Post at the time charged something like 40 cents to mail a first-class letter.]Whether we're trying to send a letter arriving as soon as possible for as little money as possible, or buy a computer that gets the job done as soon as possible for as little money as possible, we need a sensible way to balance cost with time. Miles per gallon is a good way to measure a car's fuel efficiency, because we want to travel a lot of miles and burn as few gallons of gas as possible; doubling both means you've gone on a longer trip, but your efficiency rating should be the same. By contrast, cents per day is a bad way to measure a postal service's efficiency, because you'd really like to decrease

Let's say we want large values of our measurement to indicate a "good"
computer, combining cost with speed. We choose a unit that increases as
the amount of work (measured in, say, instructions) increases, so we'd
better have instructions in the numerator; on the other hand, the more
seconds the computer takes, the *worse* it is on this measure, so
seconds had better be in the denominator. Dollars are likewise "bad",
so we put them in the denominator too. Thus we're forced to something
like "instructions / (dollars * seconds)". We might then try some
real-world examples -- say, a computer that executes 3000000
instructions in 0.1 seconds and costs 4000 dollars, coming to
7500 instructions per dollar-second -- and conclude that these numbers
were too large to handle conveniently, especially as computer
performance improves in the future. So we would perhaps decide to scale
the unit by a factor of a thousand, getting

7.5 * 10^{3} instructions / (dollars * seconds)

which is in exactly the unit described above. (I called it "MIPS
per kilobuck" not only to illustrate the prefixes, but also because
people often use MIPS and kilobucks by themselves, so it's easy for
people to understand dividing one by the other.)

This first rule of thumb gives rise to the more specific

2 hours + 15 seconds =

2 hours * (3600 seconds/hour) + 15 seconds =

7200 seconds + 15 seconds = 7215 seconds

Why am I justified in multiplying part of the equation by 3600 seconds/hour? Because 3600 seconds

If, on the other hand, they're in units that *cannot* be
converted into one another, like seconds and instructions, then their
sum and difference are meaningless and you're probably doing something
wrong by even *wanting* to add or subtract them.

In a well-knownIt's a good cartoon, but anybody who knows his units (as Einstein certainly did) couldn'tFar Sidecartoon, Albert Einstein is staring puzzledly at a blackboard on which are the equations "E=mc^{3}", "E=mc^{4}", etc. successively crossed off, while a cleaning lady clears his desk and says something like "That's better, got that all squared away. Yessirree, all squared away."

Mass (the

1 erg = 1 g * cm

1 joule = 1 kg * m

In other words, energy is measured in g*cm

Which is not to say that the equation "E=mc

(35 miles) / (0.5 hours) = 70 miles/hour.

We all know that miles/hour is a reasonable unit; so is miles/gallon. What if you multiplied your speed by your gas mileage? The result would be measured in miles

(3.5 million instructions) / (5 million instructions/second)

= 0.7 seconds

after cancelling the instructions in numerator and denominator. Again, we're treating units essentially like variables. (Note that the number of cycles per instruction wasn't actually used in the calculation at all.)

If you guessed wrong, and *multiplied* the number of
instructions by the number of instructions per second, you'd wind up
with an answer measured in instructions^{2}/second, not in
seconds, so you'd know you had done something wrong.

- Subtract Speed
_{Y}from Speed_{X}, producing an answer like "Machine X is 4.5 MIPS faster than Machine Y". This is technically correct, but not particularly useful, especially when you say it to your boss who doesn't know a MIPS from his elbow.

(Actually, all too many students have started with the wrong units and wound up with answers like "Machine X is 8 seconds faster than Machine Y", which is*utterly*meaningless! This sort of comparison makes sense only if you're talking about a single task which one machine performs in 8 seconds less than the other one does. For a different task, or a larger or smaller version of the same task, it provides no useful information at all.) - Divide Speed
_{X}by Speed_{Y}. Since both speeds are in exactly the same units, the units cancel and we're left with just a number like 1.3, interpreted as "Machine X is 1.3 times faster than Machine Y" or "Machine X is 30% faster than Machine Y". This sort of answer is really much more helpful: if your speed figures are truly representative of machine performance, it tells you that*any*task you choose to run will finish 30% faster on Machine X than on Machine Y.