+ All Categories
Home > Documents > A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY...

A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY...

Date post: 22-Jan-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
7
A FISCHERTECHNIK BINARY ADDER THOMAS P ¨ UTTMANN Abstract. Binary arithmetic is one of the core concepts in modern comput- ers. We construct a 4-bit binary adder using fischertechnik. The adder is specifically designed for education: it can be built in a couple of minutes, works reliably without any adjustment, and the required parts are cheap. History. There are different ways to assign names to numbers and to write them down symbolically. Today we mostly use the decimal system. Positioning systems like the decimal system have two advantages. First, even big numbers can be written down with just a few symbols. Hence, reading and writing are not prone to error. Second and related, the system provides us with systematic names for numbers that can be used for efficient oral communication. The number 3421, for example, can be written with just four digits despite its size and has the systematic name three thousand four hundred twenty one. Mechanical calculators used the decimal system almost exclusively. The first such machines were independently invented by Wilhelm Schickard (1592–1635) and Blaise Pascal (1623–1662) in the first half of the seventeenth century. Of great importance were the contributions of Gottfried Wilhelm Leibniz (1646–1716) who in particular invented the step drum for mechanical multiplication in 1673. It is well-known that Leibniz discovered the binary representation of numbers. The binary system uses only two digits, 0 and 1. The numbers are subsequently written as 0, 1, 10, 11, 100, 101, 110, and so on. Among all positioning systems the arithmetic operations addition, subtraction, multiplication, and division are easiest in the binary system. The binary representation of a given number, however, is longer than its representation in any other positioning system. The binary repre- sentation of 3421, for example, is 110101011101 and needs twelve digits instead of four. One says that 3421 is a 12 bit number. Bit simply stands for binary digit. Figure 1. Excerpt from Leibniz’ treatise De progressione Dyadica It is much less known that Leibniz also already proposed the first mechanical computer based on the binary system. In his three page draft De progressione Dyadica from 1679 he described a binary adder and multiplier where rolling balls fall through holes in tilted planes, see [1],[2]. In 1971 a concrete machine was designed by Ludolf von Mackensen on basis of Leibniz’ sketches. This machine was built by the Deutsches Museum in Munich. Another machine was designed and This paper is an English version of [4]. I would like to thank Michel Wermelinger for many valuable comments and suggestions that helped to improve the text. 1
Transcript
Page 1: A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY ADDER THOMAS PUTTMANN Abstract. Binary arithmetic is one of the core concepts in modern

A FISCHERTECHNIK BINARY ADDER

THOMAS PUTTMANN

Abstract. Binary arithmetic is one of the core concepts in modern comput-

ers. We construct a 4-bit binary adder using fischertechnik. The adder isspecifically designed for education: it can be built in a couple of minutes,

works reliably without any adjustment, and the required parts are cheap.

History. There are different ways to assign names to numbers and to write themdown symbolically. Today we mostly use the decimal system. Positioning systemslike the decimal system have two advantages. First, even big numbers can bewritten down with just a few symbols. Hence, reading and writing are not proneto error. Second and related, the system provides us with systematic names fornumbers that can be used for efficient oral communication. The number 3421, forexample, can be written with just four digits despite its size and has the systematicname three thousand four hundred twenty one.

Mechanical calculators used the decimal system almost exclusively. The firstsuch machines were independently invented by Wilhelm Schickard (1592–1635) andBlaise Pascal (1623–1662) in the first half of the seventeenth century. Of greatimportance were the contributions of Gottfried Wilhelm Leibniz (1646–1716) whoin particular invented the step drum for mechanical multiplication in 1673.

It is well-known that Leibniz discovered the binary representation of numbers.The binary system uses only two digits, 0 and 1. The numbers are subsequentlywritten as 0, 1, 10, 11, 100, 101, 110, and so on. Among all positioning systems thearithmetic operations addition, subtraction, multiplication, and division are easiestin the binary system. The binary representation of a given number, however, islonger than its representation in any other positioning system. The binary repre-sentation of 3421, for example, is 110101011101 and needs twelve digits instead offour. One says that 3421 is a 12 bit number. Bit simply stands for binary digit.

Figure 1. Excerpt from Leibniz’ treatise De progressione Dyadica

It is much less known that Leibniz also already proposed the first mechanicalcomputer based on the binary system. In his three page draft De progressioneDyadica from 1679 he described a binary adder and multiplier where rolling ballsfall through holes in tilted planes, see [1],[2]. In 1971 a concrete machine wasdesigned by Ludolf von Mackensen on basis of Leibniz’ sketches. This machine wasbuilt by the Deutsches Museum in Munich. Another machine was designed and

This paper is an English version of [4]. I would like to thank Michel Wermelinger for manyvaluable comments and suggestions that helped to improve the text.

1

Page 2: A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY ADDER THOMAS PUTTMANN Abstract. Binary arithmetic is one of the core concepts in modern

2 THOMAS PUTTMANN

Figure 2. The binary adder

built in 2004 by Erwin Stein and Gerhard Weber, respectively. It is on permanentdisplay at the Leibniz exhibition of the University of Hannover, Germany, see [2].

In the 1960s John Thomas Godfrey had a different idea to use rolling balls forbinary arithmetic using ball flip-flops instead of tilted planes with holes. He filedhis patent in 1965 under the title Binary Digital Computer, see [3]. Besides thedescription of ball flip-flops the patent contained two ingenious concrete educationaltoys Digicomp II and Dr. Nim. They were sold by the company E.S.R., Inc. forseveral years.

My binary adder. I developed this fischertechnik binary adder primarily for myown classroom activities. The aim was to construct a device that invites childrento play with it, works reliably without adjustment, and has few parts. It shouldbe possible for anybody to build the adder on the basis of the pictures and theparts list in Table 1. The rare Angular blocks 60◦ with three grooves (31918) at thetop of the flip-flops can be substituted by the common Angular blocks 60◦ (31010).One just needs to cut off the two pins. The number labels can be downloaded fromhttp://www.math-meets-machines.de/binary/BinaryDigits.pdf.

An arithmetic overflow is signaled by a bicycle bell. Bicycle bells can easily bemounted on Wheels 23. They can add an acoustic level to almost any marble run.It is of course also possible to omit the bicycle bell. In this case one can close theleft hand side of the adder symmetrically to the right side by a Mounting plate 6×1.

I would like to note that Holger Howey built a fischertechnik binary adder in2010 or earlier. It was on display at an exhibition in Munster, see http://www.

ftcommunity.de/details.php?image_id=29309.

Structure. The essential parts of the adder are the four toggle flip-flops. Eachflip-flop can take one of two stable states. If it is tilted to the left, we call thestate of the flip-flop 0, if it is tilted to the right, we call it 1. The four flip-flopsform the addition unit. The total state of the additon unit is composed of the fourindividual states of the flip-flops from the left to the right. Hence, the total stateof the addition unit is given by a four digit binary number.

Above each flip-flop there is a Building block 15 with a red Mounting plate.These four blocks form the input register. Each bit of the input register is 1 if thereis a ball on the Building block 15, otherwise it is 0.

Page 3: A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY ADDER THOMAS PUTTMANN Abstract. Binary arithmetic is one of the core concepts in modern

A FISCHERTECHNIK BINARY ADDER 3

Figure 3. View from the right

1× 31016 Winch drum1× 31034 Metal axle 305× 31918 Angular block 60◦, 3 grooves7× 31981 Angular block 15◦

4× 32064 Building block 15 with bore9× 32879 Building block 30

13× 32881 Building block 151× 32985 Base plate 258 × 1861× 36333 Rail1× 36581 Wheel 232× 37237 Building block 52× 36293 Angle grider 1208× 38236 Mounting plate 1 × 1 yellow8× 38240 Building block V15 corner1× 38244 Mounting plate 6 × 1 red8× 38246 Mounting plate 1 × 1 red4× 38414 Plastic axle 402× 38423 Angular block 10 × 15 × 15

10× 144262 ball1× bicycle bell

Table 1. Required parts

Counting. We first reset the adder by pushing all four flip-flops manually into the0 state. The total state of the adder is hence 0000. Now we push balls from theupper block one by one. The total state of the adder changes with every ball. Thesubsequent states are 0001 after the first ball (see Figure 6), 0010 after the secondball, 0011, 0100, and so on until the fifteenth ball where the total state is 1111. Thedevice thus assigns a systematic symbolic expression to each number between zeroand fifteen. In other words, the device counts. Counting is nothing but assigningnames to numbers subsequently in a reproducible way.

Page 4: A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY ADDER THOMAS PUTTMANN Abstract. Binary arithmetic is one of the core concepts in modern

4 THOMAS PUTTMANN

Figure 4. Attaching the bicycle bell

Figure 5. Structure

Figure 6. Toggling a flip-flop

Page 5: A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY ADDER THOMAS PUTTMANN Abstract. Binary arithmetic is one of the core concepts in modern

A FISCHERTECHNIK BINARY ADDER 5

Figure 7. Adding 0110 to 0101

Addition. If this is your first acquaintance with binary numbers it is useful to freeyourself for the moment from the decimal system. For this purpose we will still usethe common names One, Two, Three, ... of numbers but no other symbols than 0and 1.

Suppose we want to calculate Five + Six with the binary adder. We could firstpush five balls from the top block and then six. This would clearly yield the binaryrepresentation of the sum. In calculations with larger numbers, it takes way toomuch time to count the balls during each arithmetic operation. It is much fasterto use the binary representations Five = 0101 and Six = 0110 that we alreadyobtained when we were counting the balls initially. We first reset the adder, put0101 into the input register and transfer it to the addition unit by pushing the ballsfrom their blocks. Then we put 0110 into the input register and add it to 0101 bypushing again the balls from their blocks, see Figure 7. The result is 1011, i.e. thebinary representation of the number Eleven.

How the adder works. In order to understand why and how the adder works,we first recall the mathematical definition of the binary representation of a number.A positive integer N between Zero and Fifteen is written as

N = a · Two · Two · Two + b · Two · Two + c · Two + d

= ((a · Two + b) · Two + c) · Two + d,

where each of the four digits a, b, c and d is either 0 or 1. For the number Five, forexample, we have

5 = 0 · Two · Two · Two + 1 · Two · Two + 0 · Two + 1

= ((0 · Two + 1) · Two + 0) · Two + 1

and hence Five has the binary representation 0101 that we obtained above whenwe were counting the balls.

The first question we would like to address is: Why does our machine alwaysshow the binary representation of a number N between Zero and Fifteen after Nballs are pushed one by one from the upper block?

When a ball falls into a flip-flop, the state of the flip-flop toggles, see Figure 6. Ifthe state of the flip-flop is 0 previously, it changes to 1 and the ball leaves the adder

Page 6: A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY ADDER THOMAS PUTTMANN Abstract. Binary arithmetic is one of the core concepts in modern

6 THOMAS PUTTMANN

without any further effect. If the state of the flip-flop is 1 previously, it changes to0 and the ball is guided to the next flip-flop below.

When N balls fall one by one through a flip-flop that is initially 0, its final stateis 0 if N is even and 1 if N is odd. This is precisely the d in the mathematicaldefinition of the binary representation of the number N given above. Moreover,N/Two (rounded down) balls are transfered to the next flip-flop below. This num-ber N/Two rounded down is (a · Two + b) · Two + c. The final state of the secondflip-flop is c and a · Two + b balls are passed to the next flip-flop. The final stateof this third flip-flop is b and a balls are passed to the final flip-flop. All in all thestate of the addition unit is the binary representation abcd of N provided that N isless than Sixteen. The sixteenth ball resets the addition unit and rings the overflowbell.

Example. Reset the machine and insert Eleven balls through the top gate. Thefirst flip-flop finally is in state 1 since Eleven is an odd number. Five balls aretransferred to the second flip-flop. This again is finally in state 1 since Five is anodd number. Two balls are transferred to the third flip-flop. This third flip-flopis finally in state 0 since Two is even. One ball falls into the fourth flip-flop andchanges its state to 1. Hence, the binary representation of Eleven is 1011.

The second question we would like to address is: Why do we obtain the binaryrepresentation of the sum of two numbers if we enter the binary representations ofboth numbers into the adder?

Suppose we have two numbers N1 and N2 and their binary representations

N1 = a1 · Two · Two · Two + b1 · Two · Two + c1 · Two + d1,

N2 = a2 · Two · Two · Two + b2 · Two · Two + c2 · Two + d2.

We obtain the binary representation of the sum N1 + N2 by adding the digits atcorresponding positions and taking possible carries into account. Essential here isthe bookkeeping of the carries. Every flip-flop is a 1-bit adder:

flip-flop in state 0 + ball from above = flip-flop in state 1,

flip-flop in state 1 + ball from above = flip-flop in state 0

+ carry ball to the next flip-flop.

The carries are evaluated stage by stage, so there is no need to distinguish full andhalf adders as in electronic circuits where all additions are done simultaneously.Let us inspect the sufficiently complex example Three = 0011 plus Seven = 0111:

0011 initial state of the addition unit

+ 0111 state of the input register

= 0100 second state of the addition unit

+ 0110 first stage carry balls

= 0010 third state of the addition unit

+ 1000 second stage carry ball

= 1010 final result

We assume here that the balls in the input register are pushed from the blockssimultaneously. The short duration of the whole process makes it difficult to observethe intermediate states and carry balls directly, but they can easily be seen in avideo when one stops the motion at the appropriate times (for example, in the videoproduced by the author, available at http://youtu.be/Iu5zdLlWUL0).

Page 7: A fischertechnik binary adder - math-meets-machines · 2015. 2. 2. · A FISCHERTECHNIK BINARY ADDER THOMAS PUTTMANN Abstract. Binary arithmetic is one of the core concepts in modern

A FISCHERTECHNIK BINARY ADDER 7

Subtraction and multiplication. The adder can be used to perform subtrac-tions and multiplications semi-automatically. In order to subtract Six from Eleven,we first enter Eleven = 1011 into the adder. The Six = 0110 is then entered comple-mentarily, i.e., one enters 1001. Finally, one adds 0001. This yields 0101+ overflow.The overflow is ignored. The result is hence 0101 = Five.

This procedure may appear strange at first glance. The explanation requires thetwo terms Ones’ complement and Two’s complement. The Two’s complement ofa number N between Zero and Fifteen is the number N ′ with N + N ′ = Sixteen.For example, the Two’s complement of Six = 0110 is Ten = 1010. If one adds theTwo’s complement N ′ of N to another number M , one adds in fact Sixteen −Nand hence obtains M − N+ overflow. If one ignores the overflow, subtraction ishence the same as adding the Two’s complement.

The Ones’ complement of a number is more evident from the binary represen-tation than the Two’s complement. It may be used to quickly obtain the Two’scomplement. In the Ones’ complement of a number N one simply complementsevery digit of the binary representation. For example, the Ones’ complement of Six= 0110 is 1001 = Nine. Clearly, every number and its Ones’ complement add up to1111 = Fifteen. Hence, the Ones’ complement plus 0001 is the Two’s complement.This completes the explanation of the procedure above.

In order to multiply Five = 0101 by Three = 0011 with our machine, one entersthe Three unchanged and then once more but shifted by two digits to the left (1100).This yields 1111 = Fifteen. The mathematical explanation is the distributive lawof arithmetic:

0101 · 0011 = (0100 + 0001) · 0011 = 1100 + 0011.

In order to multiply two arbitrary numbers N1 and N2 on our binary adder oneonly has to add shifted copies of N2. For every 1 in the binary representation ofN1 we have to shift the binary representation of N2 accordingly.

The usual procedure to devide two integer numbers in any positional systemrequires some form of comparison. If we would like to divide 1101 by 0100, forexample, we first have to check that 100 fits into the number 110 given by thefirst three digits of 1101. This gives us the first part 10 of the quotient. We thensubtract 1000 from 1101 and obtain 101. Since 100 fits into this difference oncemore, we get a second part 1 of the quotient. The quotient is hence 11 and theremainder is 1. Our binary adder could just be used for the subtractions in thisprocedure.

References

[1] Georgi Dalakov, Gottfried Leibniz, http://history-computer.com/[2] Erwin Stein, Die Leibniz-Dauerausstellung der Gottfried Wilhelm Leibniz-Universitat in Han-

nover, http://www.uni-hannover.de/fileadmin/luh/content/webredaktion/universitaet/geschichte/leibniz/leibnizausstellung.pdf, 2008.

[3] John T. Godfrey., Binary Digital Computer, US Patent 3,390,471, http://www.google.com/patents/US3390471

[4] Puttmann, T. Binaraddierer, ft:pedia 3/2014, 36–41, http://www.ftcommunity.de/ftpedia.

Ruhr-Universitat Bochum, Fakultat fur Mathematik, 44780 Bochum, Germany

E-mail address: [email protected]


Recommended