Computing History · Early Computing
Carry Propagation in the Difference Engine No. 2
How a figure wheel registers that a carry is owed without performing it, how the latched warnings are serviced by staggered carry arms, and what the two-phase cycle costs in timing.
The Difference Engine No. 2 stores a number as a vertical stack of 31 figure wheels, one wheel per decimal digit. To produce the next entry of a table, the machine adds one difference column into the column above it, an operation the Science Museum technical description calls giving-off. Addition runs digit by digit, and any figure wheel that passes from 9 to 0 has generated a carry into the decade above.
A carry that cannot finish where it starts
A design that completed each carry immediately would carry a variable-length dependency chain inside the addition. The steps needed to finish a column would depend on how many 9s stood in the way, and a long run would hold up the rest of the cycle. The documented design refuses that. Nothing is carried during giving-off. A wheel that wraps records that a carry is owed, and the debt is collected later, in a separate phase.
That split organizes the mechanism. Arming and servicing become two events with a whole phase between them: a latch that can hold one bit, an arm schedule that polls the latches in order, a second rotation of the carry axis to cover the one place the order wraps, and a reset axis that clears the latches before the next addition. The cost is paid in parts rather than in unpredictable latency.
The arithmetic that drives these additions, the tabulation of successive differences, is described in finite differences as a mechanical method. Its shape is all that matters here: each step adds one column into the next, so a table entry costs a giving-off for each difference column in use, and every giving-off can leave warnings behind.
Arming: a nib rotates the claw into the warned notch
Each figure wheel carries an external nib on its barrel. One carry lever serves each digit position, and the lever has three limbs: a curved warning claw and two escapement horns. Claw and horns sit in different horizontal planes, and the lever spans two digit positions, so the horns act on the figure wheel one position above the one whose nib moved the claw.
When a wheel passes from 9 to 0 during giving-off, its nib pushes the curved claw outwards. The push rotates the carry lever out of an unwarned V-notch and into a warned V-notch, where a sprung detent lever holds it. A lever in the warned notch means exactly one thing: a carry into the next higher decade is owed.
The latch has two properties that matter. It is set by the same motion that produces the wrap, so arming happens inside giving-off, with no phase of its own. And it holds without any continuing force, because the detent presses into the V and the lever does not spring back when the nib withdraws. After a giving-off pass over all 31 positions, the column holds latched warnings rather than pending operations. Nothing has been carried, and nothing is in an indeterminate state.
Locks withdraw and the horns enter the tooth plane
The carry phase opens with two preparations. The locks withdraw from the left-hand figure wheels, freeing them to receive a carry, and the warning axis lowers so the escapement horns enter the plane of the upper figure wheel teeth.
The horns do different work depending on which notch the lever occupies. On an unwarned lever the cutaway horns drop over and engage the upper wheel, locking it against derangement while the sweep passes over. Arming the lever rotates the horns so that the right-hand one is poised in the gap between two teeth of that upper wheel, ready to nudge it forward one unit when its carry arm sweeps past. An unwarned lever is passed over in silence; the arm’s lozenge and the lever’s lozenge do not meet.
The arms are mounted on the carry axis in a helical arrangement. Their vertical separation matches the pitch of the figure wheel columns, so each arm meets exactly one lever. Their angular pitch is 22.5 degrees, with one exception: the gap between the 15th and 16th arms is 45 degrees. The source gives two fouling conditions between arm and lever as the reason, so the doubled gap is a clearance decision rather than an arithmetic one. It also means the poll is not uniform: the 45-degree gap leaves a longer interval between the 15th and 16th arms than between any other adjacent pair, and the axis completes two rotations per carry action rather than one.
Successive carry polls one position at a time
As the carry axis rotates, each figure wheel in the stack is polled in turn, starting from the lowest, in what Babbage called successive carry. Unwarned levers are not touched: their horns are already locking the wheel above, and the sweep passes over them.
A warned lever, when its arm arrives, nudges the upper wheel by one unit. The nudged wheel can itself pass from 9 to 0; when it does, a new warning is armed on the lever above and that lever is polled later in the same sweep, because its arm sits further along the helix. This is secondary carry, or domino carry. The ripple is not a chain of dependent waits but a sequence of latches set slightly ahead of the arms that service them. The extreme case is the least significant digit being given off into a column in which every figure wheel reads 9, where each carry arms the next warning just before the corresponding arm arrives.
One point in the schedule breaks that pattern. A warning set by the fifteenth figure wheel is not reached by the first rotation. The source states that the first rotation services the warnings latched during giving-off in both the upper and lower sections of the figure wheel axis, that the second pass services the warning set by the fifteenth wheel, and that the double rotation is what propagates carries that result from carries.
A model makes the deferral concrete. It is a simplification: it flattens the helix into monotone index order, reproducing the ripple without a second rotation.
WHEELS = 31
def give_off(upper, lower):
"""Add lower into upper digit by digit. Carries are only recorded."""
warned = [False] * WHEELS
for i in range(WHEELS):
total = upper[i] + lower[i]
upper[i] = total % 10
if total >= 10 and i + 1 < WHEELS:
warned[i + 1] = True # debt recorded, not paid
return warned
def sweep(upper, warned):
"""Poll positions from least significant upward, as the arms do."""
for i in range(WHEELS):
if not warned[i]:
continue
warned[i] = False
upper[i] = (upper[i] + 1) % 10
if upper[i] == 0 and i + 1 < WHEELS:
warned[i + 1] = True # secondary carry, armed ahead of its arm
return warned
A column of 31 nines given off against a lower column holding a single 1 leaves 31 zeros and no outstanding warnings in the model; the carry out of the top wheel is dropped, since the model has no wheel above it to receive one. That ripple is what domino carry exists to produce. What the model cannot show is the cost. In the hardware a warning on the fifteenth wheel is not reached during the first rotation, and the axis turns twice to cover it.
Two windows in a fifty-unit cycle
The calculating cycle is divided into 50 time units, each 7.2 degrees of a 360-degree revolution. Carry levers are in the same plane as the carry arms only during the intervals from 81 to 168 degrees and from 261 to 348 degrees of the revolution. Each interval is 87 degrees, a little over twelve time units, so the carriage mechanism is reachable for under half of every turn.
Outside those windows no arm can reach a lever, whatever position the carry axis occupies. That fixes the correctness condition: every warning must be armed before a window opens, and every lever must be back in the unwarned notch before the next addition begins. The reset axis, which Babbage’s timing diagram calls the Unwarning Axis, handles the second part; its circular motion drives the levers against reset stops.
The trade appears in those numbers. A chain completed inline would take as long as the run of 9s demanded, with no fixed bound. This machine charges a fixed cycle of two phases, two rotations of the carry axis, and a population of latches to maintain, poll, and reset. The worst case is bounded, and on a run of one or two carries the fixed machinery buys nothing over an inline ripple.
False warnings, the disconnected detent, and a drafting problem
The levers are not locked. Whenever the figure wheels are stationary the carry levers can be moved by hand from the unwarned notch to the warned one, and at certain points in the cycle from warned to carried, so a false warning can be set that the sweep will dutifully service by adding a unit that was never owed. The sprung detent pressing into the V-notches discourages that but does not prevent it. A carry lever can also be pushed into a fourth detent position, disconnected, which blocks propagation past that wheel and splits the 31-digit column into two sections, each usable for a separate calculation: a cycle counter, an automatically incremented argument, or a second polynomial tabulated at the same time. In that position the escapement horns lock the unused wheels, and the separation is silent in its failure: no part of the cycle reports that the boundary exists.
Four lever transitions are documented in the mechanism: nib to claw for arming, the carry-arm sweep for carrying, the detent support arm and reset stops for returning to unwarned, and the hand-set disconnected position. The first three are driven by the cycle; only the fourth is set by hand, and it is the one no phase of the cycle undoes.
There is also an unresolved reading of the drawings. The modern interpretation found that with the figure wheels drawn rotating clockwise during addition, the warning limb would foul the outer nib. The Science Museum account assumes instead that the left-hand figure wheel rotates anticlockwise during giving-off, and describes the conflict as a probable drafting error rather than a settled reading of the drawings. The mechanism above works under the assumed direction; under the drawn one, claw and nib collide. A reconstruction from drawings is an argument about what the drawings mean; this one has an open edge.
The Analytical Engine plans take a different route to the same problem, naming a look-ahead scheme, anticipating carriage, and moving the sequencing of operations into a chain of cards, as described in the Store, the Mill, and barrel control. The Difference Engine keeps its carry knowledge in the position of a lever and its schedule in the geometry of a helical axis. Where the schedule lives is the real difference between the two machines.
References
- Charles Babbage's Difference Engine No. 2: Technical Description — Doron D. Swade; Science Museum, London, 2020
- Charles Babbage's Difference Engine No. 2: User Manual — Doron D. Swade; Science Museum, London, 2020
- The Engines — Computer History Museum, Babbage Engine exhibit
- The Origins of Digital Computers: Selected Papers, 3rd edition — Brian Randell (ed.); Springer-Verlag, 1982