Difference Engine

The Difference Engine is a calculating machine which could do mathematical computations in an automatic way. It was designed by CharlesBabbage circa 1812 but never completed. An early prototype of the Difference Engine was built by 1822, and Babbage, with the help of the British government, started work on the full machine in 1823. It was intended to be steam-powered and fully automatic, unlike other mechanical calculating machines that required manual operation.

The DifferenceEngine is not a GeneralPurposeComputer, although the calculations that it performed can be parameterized. Babbage's AnalyticalEngine, if it had been completed, would have been what we now consider a computer. It would have run stored programs that had conditional logic and iteration. (See: ComputerDefinition)

The London Science Museum (http://www.sciencemuseum.org.uk/) has built a working Difference Engine and a printer for that engine based on Babbage's designs. It is an impressive piece of machinery and well worth seeing first hand if you are interested in early computer technology. If you cannot visit in person, their web site has a good online exhibit about Babbage and his engines (http://www.sciencemuseum.org.uk/on-line/babbage/index.asp).

In 1837, CharlesBabbage described the AnalyticalEngine, which was to be a mechanical digital computer. Amazingly, it anticipated virtually every aspect of contemporary computers.

A section of TheDifferenceEngine:


I believe it was called that because it was based on the principle of differences. Consider successive differences of N^3:

  N  N^3  Diff1 Diff2  Diff3
  1  1
  2  8      7
  3  27     19     12
  4  64     37     18     6
  5  125    61     24     6
  6  216    91     30     6
You can see that the 3rd difference is a constant, 6. If we read the table from right-to-left, we can calculate successive cubes just by adding; by accumulating various running totals in various registers. Example C code might look like:

int cube = 64;
int reg1 = 37;
int reg2 = 18;
int reg3 = 6;
for (int i = 4; i < 100; ++i) {
 printf( "Cube of %d is %d\n", i, cube );
         reg2 += reg3;
 reg1 += reg2;
         cube += reg1;
}
to print powers up to 100 using only addition. Addition is important because it is easy to do with cogwheels (much easier than multiplication or division). To add 3 to 4 you just rotate the wheel 3 notches and then rotate it another 4 notches.

The differences principle works with any finite integer power, and also with sums and products. So a cogwheel machine can evaluate successive terms of any function provided we can express it as a power series: f(x) = a1 + a2*x + a3*x^2 + a4*x^3 + ... and we know what initial values to give to the registers (corresponding to the power series constants a1, a2 etc).

This makes a Difference Engine quite a versatile beast. It can be used to calculate log, sine and cosine tables and various other formula important to navigation and commerce.


I'm inventing a Sameness Engine. Only the next generation will "get it" and I'll be in all the Computers 101 textbooks.


See also the book TheDifferenceEngine and another mechanical contrivance, the CurtaCalculator.


EditText of this page (last edited May 7, 2014) or FindPage with title or text search