Search This Blog

07 April 2008

we dont need no steeeenkin electricity

Oh yes, clicking is good.

This one's the best: Andrew Carol's recreation of Charles Babbage's 19th century clockwork & crank Difference Engine, in LEGO. Here's his own account of the amazing thing.

At top, an introduction to Logic Gates.

In the Real World and inside our computers and iPods, we encounter Logic Gates as electronic physical devices (often so tiny that even powerful microscopes can't see them) which convert Inputs of either Logical 1 or 0 (not numbers) into Outputs, also 1s and 0s, according to the Logical definitions of NOT, OR and AND.

These definitions are closely related to the way we use the words "not, or, and" in Natural Language, but they're precisely defined in Boolean Algebra to eliminate any of the ambiguity or fuzziness common to everyday Natural Language.

These ideas date to the invention of Boolean Algebra by the Anglo-Irish mathematician/logician George Boole (1815–1864). As such they pre-date or barely tickle the infancy of the human use of electricity.

The explosion of electronic digital computers and technology which practically defines civilization in our lifetime makes it difficult, if not impossible, to imagine digital computing, or any kind of computing, without electricity and electronics.

But Logic Gates are wholly independent of electricity, electronics, or any particular physical kind of implementation. They're pure pencil-and-paper ideas -- and as such have zealously and jealously been guarded by university philosophy departments, who have the historical claim to their invention -- wholly ignored or considered useless by scientists and engineers for nearly a century.

The TinkerToy digital computer that plays a mean game of tic-tac-toe (in the UK, noughts and crosses) is just one example of digital logic that doesn't use electricity. And somewhere, somebody made a digital logic computing system out of garden hoses and water. A lot of experimenters play around with more dainty hydraulics to compute digitally without electricity.

But this one's the best. This guy used LEGO to re-create Charles Babbage's amazing 19th-century brass and steel crank and clockwork general-purpose digital computer called The Difference Engine. Babbage never got his crazy machine to work in his lifetime, but London's Science Museum finally built a working model, and once a year they crank the thing up and actually compute some mathematical tables on mirror-image backwards printing plates, so they're all ready to be printed on paper -- completely error-free.

Babbage concentrated on designing and building the hardware. His associate Ada Lovelace (the poet Lord Byron's daughter) wrote the world's first algorithms and software for it.

In Babbage's day, the scientific and industrial world ran on books of printed mathematical tables -- log tables, trig tables, etc. They were filled with errors -- wrong numbers. The functions were computed by human beings, by pencil and paper or with the help of mechanical adding machines, and then another level of errors crept in when printers set the tables into type by hand.

The errors could be very dangerous. A steam engine with an error in its design could explode, or -- and this happened very often -- an error in navigational tables could send a navy or commercial ship to its doom, with the loss of hundreds of sailors.

I studied calculus when computers were still very rare and hard to get your hands on, but Hewlett-Packard finally invented the hand-held scientific calculator, and Texas Instruments followed with its own a few months later. That pretty much extincted 450 years of giant books of mathematical tables. Now you could get your answers just by punching a few buttons on a gizmo you could carry on your belt. And if you'd punched in the correct number, you had an ironclad guarantee that the calculator would spit back the correct answer -- to precision far greater than the precision in books of tables. So the steam engine wouldn't blow up, the airplane wouldn't fall out of the sky, the ship would sail safely into port.

Babbage dreamed about a way to compute and print the tables automatically, with no human beings involved, and thus eliminate the sources of the notorious and dangerous errors. The most advanced technology of his day that might possibly do the job was clockwork technology, already in clever use for machines that could add, subtract and multiply.

But here's Babbage's Difference Engine all over again, again with no electricity or electronics -- in LEGO! The numerical outputs are those little odometer digit devices, how very thoughtful of LEGO to sell them. They must have known somebody wanted to build something more scientifically interesting than a Merry-Go-Round or a model of the Petronas Towers.

In the first half of the 20th century, the ignored and forgotten plaything of the philosophy department, Boolean Algebra, came to life because of the pressures of telephone networks, which were dependent on human beings (almost all women telephone operators) to connect phone calls. There was some crude electromechanical automation to connect local phone calls, but telephone networks had reached a dead end for how much they could grow and respond to new demands unless the switching could be automated and get rid of most of those phone operators.

Claude Shannon, a graduate student at (GO BLUE!) the University of Michigan, was the first to realize that Boolean Algebra could be married to Binary Arithmetic (where 1 + 1 = 10) in such a way that simple electronic switches (using tubes/valves, then later transistors) could automatically control other switches, an unlimited number of switches turning themselves on and off in useful ways and telling other switches -- 1000 miles away -- what to do.

In the Logic Gate diagram, P and Q aren't numbers. They're propositions which can be either TRUE or FALSE.

As a shorthand, we write


For example,

P = Hillary Rodham Clinton is a kangaroo.

Q = Elephants fly.

It's absolutely NOT necessary or important to find an elephant or a Hillary Rodham Clinton to verify whether, in Real Life, elephants fly or Hillary hops. This system has nothing to do with Real Life.

It's all about the logical implications and consequences of related propositions. It's all about what the Truth or Falsehood of one proposition means for other propositions logically linked to the first proposition.

P can be either True = 1 or False = 0.

If we say, for the sake of argument, that P = 1, then we know for certain that Hillary Rodham Clinton will not be the next President of the United States, because the Constitution only allows human beings to be president.

(An amendment to the Constitution could change this. Fans of California Governor Arnold Schwarzenegger want the Constitution changed to permit the Austrian-born action movie star to run for president. And nine years ago, Australian voters almost elected Skippy the Bush Kangaroo to be Prime Minister.)


From the April 2006 issue of Spectrum, a publication of the IEEE (Institute of Electrical and Electronics Engineers).

Mr. Babbage, Meet Mr. LEGO

Andrew Carol, a software developer for Apple Computer Inc., Cupertino, Calif., and a self-described "engineering fiend," had for years been enamored of the idea of building a 19th-century difference engine out of LEGO pieces. One of the earliest conceptions of a mechanical computer, a difference engine is a machine for solving polynomial equations. (For those of you who have forgotten, those are equations such as f(x) = Ax^2 + Bx + C.) Initially, he took the most famous example as inspiration, Charles Babbage's Difference Engine No. 2, which was sketched out in 1822 but finally built only in 1991, at the London Science Museum.

"That's what held me up," Carol says. Engine No. 2 relies on lots of vertical rods for translating information between the machine's components. The plastic LEGOs were too soft for the task. But Babbage's earlier design, No. 1, while more complex, works with gears, and Lego has gears aplenty. Once Carol had managed to get a key component working — a mechanical adder that retains the numbers being added — it took him three months to build his own, all-LEGO, difference engine (

In the photo, Carol's engine has just calculated 121, or 11 2 [top row], and on the next turn of the gears, the 2 at the bottom will add to the 21 in the middle, and the result will add to the 121 at the top to yield 144, or 122.

Next up for Carol is a stab at a more programmable kind of 19th-century computer called an analytic engine.


abbas said...

yea yea i'm gonna be buying a lego mindstorm this summer.

Vleeptron Dude said...

Wait wait! Not so fast! Tonight or tomorrow I'm gonna post about an equally amazing computer made out of MECCANO (which has recently swallowed what remained of North America's Erector Set). With the usual incredible images.

This sucker was actually used during World War II to compute for the British Air Force bouncing-sphere bombing raid on the Ruhr dams, immortalized in the movie "The Dam Busters." (I've heard they're making a new version, starring young hunks of today.)

It's about the Boffins. It's all about the Boffins.