Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Difference engine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Operation == {{Unreferenced section|date=June 2017}} [[File:Difference engine.JPG|thumb|Fully operational difference engine at the [[Computer History Museum]] in [[Mountain View, California]]]] [[File:Babbage Engine Demonstration pt. 3.webm|thumb|The Mountain View machine in action]] The difference engine consists of a number of columns, numbered from '''1''' to '''''N'''''. The machine is able to store one decimal number in each column. The machine can only add the value of a column ''n'' + 1 to column ''n'' to produce the new value of ''n''. Column ''N'' can only store a constant, column 1 displays (and possibly [[Computer printer|prints]]) the value of the calculation on the current [[iteration]]. The engine is programmed by setting initial values to the columns. Column 1 is set to the value of the polynomial at the start of computation. Column 2 is set to a value derived from the first and higher [[derivative]]s of the polynomial at the same value of '''''X'''''. Each of the columns from 3 to ''N'' is set to a value derived from the <math>(n-1)</math> first and higher derivatives of the polynomial. <ref name="edinburgh1834">{{Cite journal|url=https://en.wikisource.org/wiki/Edinburgh_Review/Volume_59/Babbage%27s_Calculating_Engine |last=Lardner|first= D.|title=Babbage's Calculating Engine |journal=Edinburgh Review|date=July 1834|pages=263β327 |quote=In WikiSource and also reprinted in ''The works of Charles Babbage,'' Vol 2, p.119ff|access-date=October 11, 2022}}</ref> === Timing === In the Babbage design, one iteration (i.e. one full set of addition and [[Carry (arithmetic)|carry]] operations) happens for each rotation of the main shaft. Odd and even columns alternately perform an addition in one cycle. The sequence of operations for column <math>n</math> is thus:<ref name="edinburgh1834" /> # Count up, receiving the value from column <math>n+1</math> (Addition step) # Perform [[carry propagation]] on the counted up value # Count down to zero, adding to column <math>n-1</math> # Reset the counted-down value to its original value Steps 1,2,3,4 occur for every odd column, while steps 3,4,1,2 occur for every even column. While Babbage's original design placed the crank directly on the main shaft, it was later realized that the force required to crank the machine would have been too great for a human to handle comfortably. Therefore, the two models that were built incorporate a 4:1 reduction gear at the crank, and four revolutions of the crank are required to perform one full cycle. === Steps === Each iteration creates a new result, and is accomplished in four steps corresponding to four complete turns of the handle shown at the far right in the picture below. The four steps are: # All even numbered columns (2,4,6,8) are added to all odd numbered columns (1,3,5,7) simultaneously. An interior sweep arm turns each even column to cause whatever number is on each wheel to count down to zero. As a wheel turns to zero, it transfers its value to a sector gear located between the odd/even columns. These values are transferred to the odd column causing them to count up. Any odd column value that passes from "9" to "0" activates a [[carry (arithmetic)|carry]] lever. # This is like Step 1, except it is odd columns (3,5,7) added to even columns (2,4,6), and column one has its values transferred by a sector gear to the print mechanism on the left end of the engine. Any even column value that passes from "9" to "0" activates a carry lever. The column 1 value, the result for the polynomial, is sent to the attached printer mechanism. # This is like Step 2, but for doing carries on even columns, and returning odd columns to their original values. <!-- What happened to step #4?! --> === Subtraction === The engine represents negative numbers as [[Method of complements|ten's complements]]. Subtraction amounts to addition of a negative number. This works in the same manner that modern computers perform subtraction, known as [[two's complement]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)