I've seen circuit level implementations of ALU's before, but how are NOT/AND/ADD performed mechanically?
4 Answers
Babbage's arithmetic unit (ALU) for the Analytical Engine was originally called the mill. It wasn't constructed out of binary logic gates (AND, OR, NOT). Instead it works on the basis of counting gear teeth and escapements.
The mill is essentially an entire Difference Engine designed to be mechanically controllable/programmable (rather than needing humans to set the input gears to the correct number). The Difference Engine is much more primitive than what we would call a "calculator" today. It is bascially a mechanical abacus. Only, instead of beads it represents numbers by the rotation of gears.
I haven't tried building one so can't quite tell you the exact detail of how it works but in general it works like this:
Two rows of input gears are spun to set it to two numbers.
The gears are connected together in such a way that when you rotate them one "cycle" both will rotate another row of output gears to produce a result. Note that a "cycle" literally means what it means - there is a crank on one end of the machine that you rotate with your arms one round to get the result.
The operation can either add the sum of the input gears or it can subtract one input from another.
That's all it can do, nothing else.
Given that it can do addition and subtraction, and given that we can calculate multiplication by repeated addition and division by repeated subtraction, we can perform any calculation.
In reality Babbage optimized his mill to do more than simply add or subtract (though, the machine can indeed do that). The gears are stacked on top of each other with the output of each stage being used as input for the next stage to calculate polynomials (somehow, I don't know the details). So you can arrange the output rows to represent multipliers in a polynomial equations and you can cycle the mill x
number of times to get the result for f(x)
. But that's more to do with the Difference Engine. The mill for the Analytical Engine could do less specialized calculations.
So Babbage didn't design his "logic" the way a digital designer would design a circuit. He designed it the way a Swiss watch maker would design a complex feature for a handcrafted watch (moon phase display for example).
-
$\begingroup$ This page describing a build of a Lego Difference Engine has some details describing how the adders work: acarol.woz.org/difference_engine.html $\endgroup$ Apr 23, 2015 at 2:09
If your "mechanical" means real mechanical logic gates, this you tube clip may help you: https://www.youtube.com/watch?v=XBqleRTjDno&app=desktop.
This clips shows how to build a half adder with LEGO: https://www.youtube.com/watch?v=5X_Ft4YR_wU
-
4$\begingroup$ Please add some more information to your answer. At the moment, it's just a couple of links to YouTube so it will become worthless if the videos get taken down. $\endgroup$ Apr 22, 2015 at 23:30
Mechanical arithmetic existed before Babbage. That's the "easy" part. The hard part is implementing a mechanical control unit. That's why the Analytical Engine was so ahead of its time.
a video of a working version built in 2008 in the Computer History Museum, at: http://www.computerhistory.org/babbage/
-
2$\begingroup$ Please add some more information to your answer. At the moment, it's just a link that will become worthless if the video disappears. We don't like link-only answers -- we don't want to be just a link farm. Instead, you should summarize the main ideas or insights that you learned from that video in your answer. $\endgroup$– D.W. ♦Nov 14, 2015 at 5:48