< Previous  Up ^  Next > 
The Difference Engine is based on gears called 'figure wheels', each representing a digit (or figure) from 0 to 9. The figure wheels are stacked in eight columns, each column representing a complete number. The Difference Engine has 31 figure wheels in each column and 8 columns in all for a total of 248 figure wheels.
Results transfer mechanism  Figure wheel axles (8)  Figure wheels (8 * 31) 
Printing and stamping wheels  Hand crank  
Stereotyping table movement  Levers and racks  Cams 
This is a front view of the Engine. The top part in the middle is where the figure wheels are, 31 of them in each of the 8 axles. To the right, the hand crank provides all power to the Engine through bevel pinions to the vertical axle that holds the cams. The profile of the cams provide the movement to most of the parts of the Engine through horizontal bars that run across the section below the figure wheels. There, several levers and racks turn the back and forth movement (left to right, as seen on this image) of the the bars to the up and down or angular movement for the different parts of the Engine.
To the left, the stereotyping mechanism also receives movement from the hand crank through an axle that runs all the length of the Engine, near the base. It has three main sections. The lower one moves the table that holds the stereotyping plates so the results can be printed in several combinations of columns and rows per page. The middle section contains the print and stamping wheels which receive the results from the transfer mechanism on top. In between the printing wheels and the printing table lies the actual pans that hold the soft material on which the stamping is done.
This is a view from the top. To the right is the hand crank which moves, through a couple of bevel pinions, the stack of cams which in this image, lie under the big gear to the right. In the middle there is the main calculating section, with the eight axles holding the figure wheels. There are several other gears, levers and arms in this section, which are not shown here. To the left, the printing and stereotyping mechanism 
The stereotyping mechanism was not built by the Museum since it has a similar number of parts as the calculating section with less repetition of parts. It won't be covered in this pages.
So, the Difference Engine can only store 8 numbers at a time. How can it work with so little? Lets look at the table we used previously.
X  f(x)  diff1  diff2 

1  6  9  4 
2  15  13  4 
3  28  17  4 
4  45  21  4 
5  66  25  4 
6  91  29  4 
7  120  33  4 
8  153  37  4 
Notice that each row can be calculated from the row immediately before. You don't need to remember the values on the row before that one, you only need to remember one row at a time. Moreover, to calculate the 28 in the 3rd row (see cells in yellow), you add the 15 and the 13 in the row above and then you can discard the 15 since it is not going to be used any further. You still need to hold the 13, since it is used to make the 17 just below it, but once that is done, it can also be discarded. The Engine actually makes the addition right on the number column, it doesn't use any auxiliary device, the figure wheels are not just for storage but they are used to do the process.
Furthermore, you don't need to do the calculations on one cell at a time, you can do a whole row in two steps, once for the even columns, one for the odd columns.

Order of calculation 
In this table, the cells have been colored to show the sequence in which they are calculated. All cells with the same background color can be calculated at the same time. The order of calculation is shown at right, from top to bottom. This means that to calculate a full row, instead of requiring as many steps as columns, all can be done in two steps. This also affects the setup of the Engine, since instead of loading it with a full row to start from, (in this example, the row for x=1: 2, 1, 3, 4, 1) you would set it up with the yellow and light blue diagonal (7, 11, 7, 5, 1).
All the operation is controlled by a series of cams that engage and disengage, turn and hold the various gears and levers in the Engine. There are just two sets of 7 pairs of conjugate cams each, half a turn apart from one another, one for the odd cycle, one for the even cycle. If the process could not be broken into two cycles, the design of the Engine would have been far more complicated.
If all the numbers involved in the calculation are positive, the full 31 digits can be used, otherwise, the most significant figure wheel can be used to represent the sign and half a digit, for a range from 5000 ... 000 to + 4999 ... 999. This is similar to what is done in binary processors.
Imagine you have just two columns (numbers) with two figure wheels (digits) each. The second column is set at 01. What is the number you have to set at the first column so that when added to the second column gives zero? Any such number could be considered 1, since 1 + (1) equals 0. So, what is that number? 99!. If you add 99 to 01 it results in 100, but since you only have two figure wheels, the hundred gets dropped and you end up with 0. A similar process produces all negative numbers, you just have to subtract the absolute value of a number from the number one higher than the maximum you can represent (in this example you can represent 99, so one more is 100). Usually you have to establish a limit on what you consider positive an what negative, and that is usually set at half way. Thus, numbers with the most significant digit in the range 0 through 4 are positive, those in the range 5 through 9 are negative. No further mention of this technique for negative numbers will be done, since it is a well known numerical trick and is not particular to the Engine.
The Engine operates all on integers, there is no decimal part or exponential notation. Calculations are scaled to fit within integers. For example, the sine function has values in between 1 and 1, with one half simetrical to the other, thus, you can use the 31 digits to represent that many decimal digits for the positive part of it. This is a technique not unknown to modern computers. Though the speed of current digital processors compensates for it, integers are still much faster to process than floating point numbers and if there is a large number of calculations to be made, such as in image processing, where you have to repeat the same calculation for each image pixel, it is much faster if the program does it in integer arithmetic.
The final column of the Engine, that represents the desired output, is directly coupled to the printing mechanism. The model at the Science Museum does not have the printing mechanism. It has been furnished with a portable computer that reads the position of the figure wheels on that column and can verify the results, display them as a graph or process them in various ways.
< Previous  Up ^  Next > 