MECHANICA DYADICA

The first binary calculation device has been invented by Leibniz around 1700. Earlier he had made calculators which directly worked with the decimal number system (he was the first to build a machine that could multiply directly, that is, not by repeated addition), but later on he realized that the mechanics of a binary machine is much simpler. The problem, of course, is that it is hard for the user to recognize binary numbers. Therefore, Leibniz only described the `mechanica dyadica' on paper. Below you find an animated reconstruction of what he must have had in mind: a machine with registers which may be filled with a little marble. An empty register represents the number 0, and a register with a marble in it represents the number 1.
Instructions This is a simplified version for addition only. If you want to calculate the addition of two numbers, fill in the first by clicking the registers corresponding to the first number. For example, if you want to start with 111 (seven) click the right most three registers. Three marbles will show up on top of the registers. To fill them click the black bar on top of the register. The marbles then fall into the registers.

Choose the second that you want to add to the first in the same way. Then let them fall into the registers by clicking the black bar on top. The calculation is then performed. A marble that falls into an empty register will be held there by a small pin. One that falls into a filled register will bump the marble that lies there out of the register. The marble that just fell into the register jumps to its left neighbour register. In the picture on the right here you see how it works. This simple mechanics is enough to do a binary addition. Try to add 101 (five) to the earlier 111 (seven) and you'll find out that the result is 1100 (twelve).

The binary number system The binary number system works in principle the same as the decimal system, only the number of digits is limited to 0 and 1 instead of 0,1,2,...,9. The representation of the number 'two' is then 10, since our digits ran out. We do essentially the same thing as what we are used to once we arrive at the number `ten' in the decimal system. Then `three' is represented by 11. Now we are in the same situation as we are in at 'ninety nine' in the decimal system. So, 'four' is represented by 100. There is space again for the next three numbers:

five = 101
six = 110
seven = 111

Then eight will be 1000. And we repeat the procedure for the next seven numbers: 1001 = nine, 1010 = ten, 1011 = eleven, 1100 = twelve, 1101 = thirteen, 1110 = fourteen, 1111 = fifteen. Sixteen is represented by 10000, &c,&c.