Workings · the stepped drum

How a 1948 pocket calculator subtracts by adding

Its crank turns one way only, and every turn of it adds. Lift the crank a notch and the same turn takes away. Here is how, on a few columns of the machine that you can work by hand.

A drum with a staircase of teeth

The machine is a black cylinder that fits in one hand, 53 mm across and 85 mm high, with eight sliders down its side, a ring of number wheels on top and a crank in the middle. It was made from 1948 until 1972.

A Leibniz stepped drum (or Leibniz wheel) is a cylinder bearing teeth of nine different lengths, an idea Gottfried Wilhelm Leibniz had in 1673.1 Inside this machine, one stepped drum sits on the crank’s shaft. Unrolled flat, its teeth form a staircase of ten layers: layer 0 has no teeth, layer 1 has one tooth, and each layer adds one more down to nine teeth at layer 9.

Beside the drum stands a shaft for each slider, with a small gear that slides up and down it. Pushing the slider to a digit moves the gear to that layer. When the crank takes the drum round once, as many teeth pass the gear as its layer has, and each tooth turns the gear one step. The shaft takes that turning up to a number wheel on top, so the wheel moves on by the digit you set.

3

Setting 3 · the wheels read 0

Fig. 1 One column. Drag the gear to a layer, then drag the crank or press Turn once. The wheel moves on by as many teeth as meet the gear. Each turn adds the setting again, which is also how the machine multiplies: 3 × 4 is four turns.

The eight shafts stand in a ring round the one drum, each a little further round than the last, so the drum reaches them one after another. One drum serves all eight digits; the desk machines before it had a drum for every digit.1

Carrying the one

A wheel has only ten digits. When it goes from 9 to 0 it owes the wheel above one more, as you carry a one on paper.

The machine remembers that debt with a carry lever. As a wheel passes from 9 to 0, it sets the lever of the wheel above. Later in the same turn, after the drum’s teeth have all gone by, the drum pays it: the wheel above moves on by one. If that wheel was showing 9, it passes to 0 in its turn and sets the next lever, so a carry ripples upward a place at a time, all within one turn of the crank.

500

Setting 5 · the wheels read 97

Fig. 2 97 + 5. The lamp under a wheel lights when a carry is on its way to it, and goes out when the carry is paid. The units wheel passes 9 to 0 while the teeth are still going by; paying the tens takes it from 9 to 0 too, and that sets the hundreds. Drag the crank slowly through the middle of the turn to watch it.

Subtracting with a crank that turns one way

The obvious way to subtract is to turn the wheels backward and borrow instead of carry. That needs the whole train of gears to run in reverse and a second way of passing a ten along. This crank cannot turn backward at all: a ratchet stops it. Instead, the machine subtracts by adding a different number, one that comes to the same thing.

On paper it goes like this. Take 139 − 78, and pretend the machine has only three wheels. Write 78 as 078 and take each digit from 9. That gives 921, the nines’ complement of 078. Add it to 139, add one more, and look at the three wheels.

The leading 1 has no wheel to go on, so it is lost. The three wheels read 061.

It works because 921 + 1 is 922, the tens’ complement of 078 (1000 − 78). Adding 1000 − 78 and dropping the overflow 1000 off the top of the register comes to the same thing as subtracting 78. Forming the nines’ complement digit by digit needs no borrowing either: each digit is 9 minus that digit, on its own.2

The second staircase

To add the tens’ complement mechanically, the drum carries a second set of teeth shifted half a layer above the first. Between the layers of the addition staircase sits a staircase that runs the other way: nine teeth where the first has none, none where it has nine. Lift the crank a notch at its stop and the drum rises half a layer, so every gear meets the complement set. A slider at 7 now meets 2 teeth (9 − 7), and a slider at 0 meets 9 teeth (9 − 0). When lifted, the drum also gives one tooth more at the units place, turning the nines’ complement into the tens’ complement.2

The real machine has eleven result wheels, not three, so the complement fills them with 9s all the way up, and the 1 that falls off the top falls off the eleventh. You never see it go.

870

Setting 78 · all eleven wheels read 00000000139

Fig. 3 139 − 78. Press Lift crank, then turn. The gears meet the red teeth, the complement, and the units lamp stays lit for the one extra until it is paid. At each stop the line under the figure reads all eleven wheels. Then turn once more.

Below zero

Turn Fig. 3 once more and it takes 78 from 61. The eleven wheels read 99999999983. That is 100000000000 − 17: the machine has no minus sign, so it shows a negative number as its complement. To read it, take it from 1 followed by eleven zeros, and you get 17 below zero. A run of 9s along the top is the sign that a result has gone below zero.

Your computer subtracts the same way, in base 2: flip every bit of the number to take away, add one, and let the carry out of the top fall off. It is called the two’s complement, and the negative numbers inside a phone are stored in it.2

Who put it in a pocket

The stepped drum is old. After Leibniz, it drove the arithmometer, the first calculating machine made in numbers, from 1851.1 Those machines sat on desks, with a drum for each digit.

The pocket machine came from Curt Herzstark, an engineer in Vienna, who had its design finished by 1938 and could not make it after the annexation of Austria. Sent to Buchenwald in 1943, he was put to drawing it for the camp’s factory, and by the liberation in 1945 he had drawn the whole construction again from memory.3 Its trick was to put the digits’ shafts round a single drum, and the complement staircase on the same drum, so that one crank turning one way could add and subtract.

The figures are drawn flat and not to scale: the drum is unrolled, and only one to three of its eight columns are shown. They run the engine our app runs, ported to JavaScript, so every wheel stands where the crank’s angle puts it. In that engine the extra one goes in as a carry into the units wheel, and when in the turn each part moves is partly our estimate; neither has been checked against the factory drawings.

We built the whole machine for iPhone, at its real size: Stepdrum →

Eight sliders, the carriage, the clearing lever and the crank. Twist the shell to glass and watch these carries pass through the movement.

Sources

  1. Wikipedia, “Leibniz wheel”: the stepped drum (1673) and the arithmometer (sold from 1851). en.wikipedia.org/wiki/Leibniz_wheel
  2. Wikipedia, “Method of complements”: the nines’ complement, adding one and dropping the leading 1, the drum that shifts to a row of complement teeth and one extra, and the two’s complement in computers. en.wikipedia.org/wiki/Method_of_complements
  3. Wikipedia, “Curt Herzstark”: the design by 1938, Buchenwald from 1943, the drawings redone from memory by 1945. en.wikipedia.org/wiki/Curt_Herzstark