Computing History · Early Computing
The Analytical Engine Store, Mill, and Barrel Control
How a planned 1830s engine separated storage from arithmetic, sequenced operations from punched cards, and used a studded barrel as a microprogram store.
A column of figure wheels can hold a number by staying parked, or combine two numbers by driving a gear train and taking the result off the far end. Charles Babbage’s Analytical Engine, conceived in 1834 after construction of Difference Engine No. 1 had stalled, gave those jobs separate mechanisms and names. The Store held numbers and intermediate results; the Mill did the arithmetic, with the four operations including direct multiplication and division. The Computer History Museum describes that split as the structure that dominated later electronic design: memory separated from processor, serial operation in a fetch-execute cycle, separate input and output.
Two mechanisms built from the same parts
Both halves are the same stock: columns of figure wheels, ten positions per wheel, carrying apparatus beneath. A Store column holds one number of up to fifty digits. The Mill holds a small fixed set of axes: two ingress axes for arguments, an egress axis for results, and primed axes for the high half of a hundred-digit value. Fifty digits was the standard because two fifty-digit numbers multiply to a hundred-digit product, which the Mill divides back down.
The split buys density at the cost of a data path. A Store that multiplied in place would need product gearing on every column; a Mill that held values would need as many axes as the Store has columns. One small arithmetic mechanism leaves the Store a grid of passive columns and the Mill a handful of driven shafts.
Store size depends on the plan. Britannica gives 1,000 numbers of fifty digits and notes that this exceeded the storage of any computer built before 1960. The Bodleian Library’s account of Lovelace describes a Store of a hundred fifty-digit numbers. Babbage wrote of places for only a thousand constants, adding that ten or a hundred times that number would be possible. The best-known plan, Plan 25, is dated August 1840.
Ingress axes, egress axes, and the run-up lever
A variable card moves one operand into the first ingress axis, a second card moves the other into the second, the Mill adds, and a third card writes the result into a named column. Multiplication leaves the low fifty digits on the egress axis and the high fifty on the primed egress axis. Division takes a hundred-digit dividend split across the first ingress axis and the primed ingress axis, returning the quotient on the primed egress axis and the remainder on the main egress axis.
The hard part is the carry. Babbage drew twenty or thirty plans for carrying the tens, concluded successive carriage could never be fast enough, and arrived at anticipating carriage, which predicts a carry chain and completes it in one movement. He claimed nine units of time for the addition and one for the carriage on numbers of any length: his estimate, not a measurement. The Mill needed the trick in harder form than the Difference Engine did, because its results were twice as wide as its arguments (the Difference Engine carry mechanism).
The run-up lever is the Mill’s report, and the only state control can test. Documented conditions for setting it are a sum that overflows the fiftieth place or differs in sign from its first argument, a subtraction that borrows past zero, division by zero, and a quotient longer than fifty digits; multiplication never sets it.
The barrel as a fixed micro-operation store
Multiplication is not one mechanical event: two fifty-digit numbers require a sequence of partial-product additions with the working position shifted between them, and the Mill steps through them under control. Babbage took the control from musical automata. A barrel in the manner of a bell-tower carillon carries studs screwed into its surface; as it rotates the studs lift sprung levers at the right moments, so one revolution replays one fixed pattern. Barrels held what would now be called microcode: the sub-operations that make up multiplication or division.
A barrel is cheap to run and expensive to change. Its capacity is its circumference: a program of n control events needs n stud positions. Babbage’s first concept used a hierarchy of barrels with the top level holding the user’s program; re-programming meant screwing in thousands of studs, and the barrel’s size capped program length. In 1836 he replaced that level with Jacquard punched cards, removing the ceiling and, in the museum’s phrasing, making a clear separation between hardware and software.
What survives is a fixed sequence inside the arithmetic unit. A barrel cannot test a condition: its pattern is identical on every revolution, so it cannot skip a step because a sum went negative, nor repeat a group an unknown number of times. Babbage’s micro-level control did use interacting state machines, so internal sequencing was not one rigid drum; but which operation runs next, and how often, moved out to the cards. The barrel says how to multiply; the cards say what to multiply and when.
Three card streams and the transfer that fires the arithmetic
Three card kinds, each with its own reader. Operation cards select one of the four arithmetic operations and hold that selection until another replaces it. Variable cards name a Store column, say which Mill axis the value goes to or comes from, and whether the column is zeroed. Number cards carry a constant, one column of ten hole positions per digit plus a sign position.
The formats justify separate machinery. An operation card needs about four holes; a variable card a column number from 0 to 999 plus the axis and the zeroing flag; a number card fifty digit columns. Because every column of every card needs its own sensing apparatus, one reader per type simplified the build. The operation card performs nothing itself; it sets the Mill’s mode. The first variable card loads the first ingress axis and clears the primed ingress axis. The second variable card loads the second ingress axis, and that transfer fires the arithmetic, because the Mill now holds both arguments. Store cards then read the egress axis back into named columns. Dividing 10,000 by 28 leaves 357 in one column and 4 in another. The model below follows those card semantics and nothing else; it is not a model of the gearing.
LIMIT = 10 ** 50 # fifty digits per axis
class Mill:
def __init__(self):
self.mode = None # set by the last operation card, persists
self.first = None # first ingress axis
self.primed = 0 # high half of a hundred-digit dividend
self.egress = 0
self.primed_egress = 0
self.run_up = False # the one bit of state control can test
def load_primed(self, value):
self.primed = value # primed variable card, after the first argument
def load(self, value):
"""A variable card arrives. The second arrival fires the operation."""
if self.first is None:
self.first = value
self.primed = 0 # first argument clears the primed axis
return
a, b = self.first, value
if self.mode == 'add':
self.egress = a + b
self.run_up = not 0 <= self.egress < LIMIT # sign folded in
elif self.mode == 'sub':
self.egress = a - b
self.run_up = self.egress < 0 or abs(self.egress) >= LIMIT
elif self.mode == 'mul':
p = a * b
self.egress, self.primed_egress = p % LIMIT, p // LIMIT
elif self.mode == 'div':
if b == 0:
self.run_up = True
else:
q, r = divmod(a + self.primed * LIMIT, b)
self.primed_egress, self.egress = q, r
self.run_up = q >= LIMIT
self.first = None # ready for the next pair
Each operation card requires three variable cards, two for arguments and one for the destination of the result, so a program’s card count is four times its operation count before constants. The readers must be kept in step, and how one card type commands the reading of another is the joint the documents leave least clear.
Backing the chain to make a loop
A chain of cards can do what a barrel cannot: the read position is a variable. Combinatorial cards, working with index cards, advance or back the chain, corresponding to the jump and loop instructions of later machines. Babbage wrote that mechanical means had been provided for backing or advancing the operation cards to any extent, and that any number of courses might be possible at once.
His example was root extraction by successive approximation in nine stages: count the possible roots, bound the largest, substitute descending powers of ten until the sign of the result changes, then fix each digit in turn while transforming the equation after each one. Two stages loop with a trip count unknown when the cards are punched. The chain is backed to repeat a substitution and advanced past a group when the sign change arrives, read from the run-up lever.
The same chain let the Engine hold more constants than the Store. Babbage had the machine punch its own number cards: a table of logarithms could be computed and punched by the Engine, then handed back by an attendant when the machine stopped and rang a bell for a tabular value, and the Engine rejected a wrong card with a louder bell and a stop. A card is a data medium here rather than an instruction medium, and the lineage runs to the tabulators that read cards as records a generation later (Hollerith card encoding). Relay machines a century later kept the same division of labour: a program on an external medium and a fixed internal sequence per operation (the Zuse Z3).
Why the drawings were never built
Scale is the first answer. A Store of a thousand columns of fifty-digit wheels is fifty thousand digit wheels, each with its own carry apparatus, before the Mill, three card readers, printer, punch, and stereotype apparatus are counted. The 1830 design of Difference Engine No. 1, calculating with sixteen digits and six orders of difference, called for about 25,000 parts; work stopped in 1832 after a dispute with the engineer Joseph Clement, and funding was cut in 1842.
Precision compounded the cost. Babbage’s scaling argument is that an engine built for n digits works at k times that precision in k squared times the time, and that m columns of n digits used at kn digits hold only m/k values. Doubling the working precision quarters the Store’s effective capacity and multiplies multiplication time by four.
The economics were those of hand-fitted work. Babbage converted his coach-house and stables into workshops, hired draftsmen to keep drawings ahead of the work, and considered raising his chief assistant’s salary to a guinea a day when railway work tempted the man away. No complete Engine was built in his lifetime; a small experimental piece was under construction when he died in 1871, and many experimental assemblies survive with a comprehensive archive of drawings and notebooks.
The unresolved part is the control handshake. Three readers, each with its own format and motion, must be coordinated so the right variable cards arrive with the right operation card, and the published accounts never specify the mechanism. Not the arithmetic, which the drawings show in detail, but that protocol is what a builder would have had to settle first.
References
- The Engines — Computer History Museum, Babbage Engine exhibit
- Charles Babbage's Analytical Engine, 1838 — Allan G. Bromley; IEEE Annals of the History of Computing, Vol. 20 No. 4, 1998
- The Analytical Engine: 28 Plans and Counting — Computer History Museum blog
- Analytical Engine — Encyclopaedia Britannica
- The Origins of Digital Computers: Selected Papers, 3rd edition — Brian Randell (ed.); Springer-Verlag, 1982
- Passages from the Life of a Philosopher — Charles Babbage; Longman, Green, Longman, Roberts, and Green, 1864