Manual / Guide · 1965
Digi-Comp II Instruction Manual
The original Digi-Comp II manual: counting, adding, multiplying, complementing, subtracting and dividing with marbles.
Manual / Guide · 1965
The original Digi-Comp II manual: counting, adding, multiplying, complementing, subtracting and dividing with marbles.
INSTRUCTION MANUAL DIGI-CDMP JI® MECHANICAL BINARY DIGITAL COMPUTER It ' s more fun than you think when you think for fun TABLE OF CONTENTS Foreword. Chapter 1 Chapter 2 PAGE ........................................... , ..... 1 About your DIGI-COMP II. . . . . . . . . . . . . . . .... . . . . . . .. 2 Checking out your DIGI·COMP II . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 New Operations Check List. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Chapter 3 Binary Counting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 Binary to Decimal Number Conversion . . . . . . . . . . . . . . . . . . . . . . . 11 Chapter 4 Arithmetic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Count & Clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Addition & Multiplication. . . . . . . . . . . . . . . . . . . . . . . .16 Subtraction & Division. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 Compiler Language . . . DIGI-TRAN . . . . . . . . . . . . . . . . . . . . . . . .18 DIGI-TRAN Commands . . . . . . . . . . . . . . . . . . : . . . . . . . . . . . . . . 18 Chapter 5 The Accumulator Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Speeding up DIGI-COMP II Operation . . . . . . . . . . . . . . . . . . . . . . . . 20 More About Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 The Octal System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Binary to Decimal Conversion Using Octal. . . . . . . . . . . . . . . . . . . . . 22 Decimal to Binary Using Octal. . . . . . . . . . . . . . . .22 Chapter 6 The MQ (Multiplier Quotient) Register. . . . .23 and The Distributor Chapter 7 The Memory Register and Addition. . . . . . . .25 Rules of Binary Addition. . . . . . . . . .. 28 Chapter 8 Multiplication of Binary Numbers. . . . . . . . . . . .. .29 Multiplying and Shifting. . . . . . . . . . . . . . . . . . . . . .30 Multiply-Add Operation .. , . . . . . . . . . . . . . . . . . . .31 Converting Decimal Binary Automatically. . . . . . . . . . . . . . . . .31 .33 Chapter 9 Complement Arithmetic and Subtraction. . . . . . . . . . . . . . . . . . Negative Numbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 Chapter 10 Division of Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . ' . 040 How to Handle Remainders. . . . . . . . . . . . . . . . . . . . .. .41 Chapter 11 Binary Fractions. . . . . . . . . . . . . . . . . . . . . . . . . . . .. .43 Chapter 12 Summary of Information Necessary . . . . . . . . . . . . . . . . . . . . . . . . . .46 to Operate DIGI-COMP II Chapter 13 Special Problems and Applications for DIGI-COMP II . . . . . . . . . . . . . 49 . .49 Computing Areas. . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculating the Weight of Air . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 The Principle of Archimedes . . . . . . . . . . . . . . . . . . . . . . . . . . . . .49 Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Summing Infinite Series. . . . . . . . . .. .. . . . . . . . . . . . . . . . 51 The Population Explosion. ; . . . . . . . . . . . . . . . . . . .. 53 Area of a Circle. . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 Random Number Generation. . . . . . . . . . . . . .55 .. . . . . . .56 Simulation. . . . . . . . . . . . . .. An Accounting Problem. . . . . . . . . . . . . . . . .57 Ballistic Missile Calculations. . . . . . . . . . . .58 Programs for Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Chapter 14 How to Program Your DIGI-COMP II . . . . . . . . . . . . . . . . . . . . . . . . . 63 Problems on a Commercial Electronic Digital Computer Differences between "DIGI-TRAN and FORTRAN". . . . . . . . . . . . . . . 63 eee~ FOREWORD I r---~·e HOW TO USE THIS INSTRUCTION MANUAL There are, of course, many ways to use the material in this manual with your DIGI-COMP II. After you have assembled DIGI-COMP II we suggest the following possibilities for starting out. Note the binary-decimal conversion table on your Programmers Card. I. BEGINNERS A. Read through Ch~pter 1. B. Learn how to INITIALIZE your DIGI-COMP II using the NEW OPERATIONS Check List in Chapter 2, Page 5. C. Work out the five TESTS in Chapter 2, from Page 6 to Page 8. D. Learn how to read your DIGI-COMP II in binary and decimal numbers in Chapter 3. E. Learn how to COUNT, CLEAR, ADD, MULTIPLY, SUBTRACT and DIVIDE from Chapter 4. F. Learn to understand the COMPILER Language codes in Chapter 4. G. Review the OPERATING INFORMATION given in Chapter 12. H. Try to do Problems 1, 2, 3, 4, 5, and 13 of Chapter 13. 1. You will then no longer be a beginner and can go back and after reviewing Chapters 3 and 4, study the operation in more detail from Chapters 5 through 10. This should help you do problems 6, 7, 8, 9, 10, 11, 12, 14, and 15. J. If you haven't already done so, try our DIGI-COMP I, and learn more about computer machine organization, and logic. II. INTERMEDIATE A. B. C. D. E. Go through Chapters 1, 2, 3 and 4 thoroughly. Review the rules for binary addition of Chapter 7, Page 26. Review the OPERATING INFORMATION of Chapter 12. Try a few problems of Chapter 13, perhaps 1, 2,3,4,5, 6, 7 and 13. Review Chapters 5 through 11 and try doing the rest of the problems of Chapter 13. F. Review Chapter 14 on electronic computer FORTRAN Language. G. TRY our DIGI-COMP I with its Advanced Manual. III. ADVANCED A. Simply go right through the Manual from Chapter 1 through 14. Do related problems of Chapter 13 as mentioned above. B. Try our DIGI-COMP I with its Advanced Manual and you will have fairly covered most of the basic theory of organization and operation of Digital Computers. - 1- CHAPTER 1 ABOUT YOUR DIGI-COMP II DIGI-COMP II is an educational computer which actually works in a manner analogous to an electronic digital computer. It performs a surprising number ( but of course not all ) of the operations performed by the electronic computer, but in a visible and mechanical manner rather than electronically. As an educational device the primary purpose of DIGI-COMP II is to show how a computer works in binary arithmetic by mechanical simulation. To explain how a computer works, considerable attention must be devoted to an understanding of the binary number system. The operation of a computer, its logical design and many other important underlying concepts may be much better explained and understood by the aid of this mechanical model. Chief among the benefits of this approach is that no understanding of electronic circuitry is demanded. The various operations that DIGI-COMP II performs are executed in slow motion as compared with an electronic machine. Where the electronic computer requires only a few millionths of a second to complete an operation, DIGI-COMP II requires a few seconds to complete the same task. Thus, the speed of the electronic computer has been reduced by a factor of a million to one. This enables the person operating DIGI-COMP II to comprehend what is happening as it occurs. Further, the programming of DIGI-COMP II will be developed using computer languages similar to those in use in electronic computers. You may recognize words like FORTRAN or COBOL as languages used in many computers. Because DIGI-COMP II is a real binary digital computer its languages will be of the same type but, of course, specialized for it. As a climax to this Instruction Manual, in Chapter 14 you will be shown how to convert your DIGI-COMP II language to the IBM Computer FORTRAN language so that if you should have available an IBM computer of the models stated, you will actually be able to insert simple problems into it with no further help required!!! All of the computer language words used in this Manual are summarized and defined at the end of this Manual, and on your programmers card. In DIGI-COMP II an electronic current impulse is simulated by a rolling ball. The ball rolls down an inclined surface under the force of gravity in an exposed manner. Thus, gravity provides the source of power for DIGI-COMP II rather than an electrical power supply. In the course of its journey the ball is directed by guides ( which simulate the wires which guide electrons in the electronic computer) to the entry points of successive binary digital logic elements. The ball upon entering a logic element "questions" or "interrogates" it for its "state" and possibly changes its "state" in the process of going through it. 1+ • • IX- 2- o The logic elements in DIGI-COMP II simulate "FLIP-FLOP" circuits in an electronic computer. These elements are simply pivoted levers which have two possible positions. In entering the element from the top the ball is directed to exit along one of two possible paths according to the present setting of the element. The path of the ball out of the element is determined by the setting of the element and reveals the setting of the element. This is the sense in which the ball "interrogates" or questions the element as to its prior state. The "state", of course, refers to its left or right setting. Thus, a single ball in its trip from the INPUT GUIDE at the top of the exposed surface to the COLLECTOR GUIDE at the bottom may take anyone of many possible paths, questioning and changing the settings or states of the logic elements in the process. If the desired operation is only partially completed by the ba 11 when it reaches the bottom it will be automatically directed to "gate" or trigger a successor ball from the top. This successor will in turn travel down the surface by a different path and gate still another successor ball if required, which will behave in like manner, etc., until the entire operation is complete. The machine will then shut itself off by directing the last ball to by-pass the gating mechanism. The operation of DIGI-COMP II can be entirely automatic or manual. With appropriate settings your DIGI-COMP II can be made to: 1. Count out a specified number of balls. 2. Count in binary arithmetic. 3. Add. 4. Multiply. 5. Multiply and add. 6. Obtain either the "l's" or "2's" complement. 7. Subtract. 8. Divide. 9. Zero or clear. 10. Overflow. 11. Halt. + • IX • Moreover, all of these operations may be performed either in a "MANUAL" or an "AUTOMATIC" mode. In the AUTOMATIC mode only a single pull of the START switch is required to complete any of the operations enumerated, but in the MANUAL mode the START switch must be pulled once for each machine cycle. Thus, the MANUAL mode permits a further slowing down of the machine for demonstration purposes if desired. Your DIGI-COMP II operates in the Binary Number System. You will learn much about this important base two numbering system while using DIGI-COMP II. Indeed, the manner in which virtually all electronic computers work is intimately related to this binary or base two system. - 3- en INPUT GUIDE MULTIPLY ~ ~_ _- - - - - - - - DISTRIBUTOR MQ OR MULTIPUEIV'\.. ,\__ QUOTIENT REGISTER ~/ 02......... , (CONTAINS 100 ,/ ~ \ FOR MULTIPLY OR I 011 FOR DIVIDE). ~ 1 \ ~ \~ \) COUNT! '~""\) 03 \ ~_~_ _ 01--'1"----___ /~/M11 l I ",' ~I I . \::'~ I " CLEAR ~ . I 02 I~ I .lo~ I I <0 I . I 03 I I (Q... O. I §)l I I '1. Dr L__ ~ ":'~' _ CF1 , ~~ , ACCUMULATOR REGISTER (CONTAINS 0000000) J Y ~M2~0 0 l - - - - A1 'WE I \.. .O·,,,,~·) I T1 <~ "~/_~ - A2 0 J ~II ~ol .~ M3 "-.. I I \":5~ : T2 Dr • A3 I\) A4 I~ - "- 1 <O'~T' I'O!' ~~-LT3 ~:4 1"-.0 ,l ~-1-:J (..-:0'\ ! ' ~~T4 MEMORY REGISTER (CONTAINS 1101) A5 I~ ~~ \y~ I T5 A61~ 1<2:~~ ~IT6 I OVERFLOW ~ -~ Idb\-h ! ~I ~---~ COMPLEMENT ~:2 NOT:E~:""""""""~ REGISTERS ARE READ FROM BOTTOM TO TOP TO CORRESPOND TO READING THE BINARY NUMBER FROM LEFT TO RIGHT. ~'(I raul I ::II--~· I COLLECTOR GUIDE - 4- START CHAPTER 2 CHECKING OUT YOUR DIGI-COMP II Now that you have assembled DIGI-COMP II let us identify its basic parts and test them to be sure they operate properly. Figure 1 shows the top of the computer and identifies the three binary number "registers" by name. They are the "ACCUMULATOR" REGISTER, the "M-Q" REGISTER and the "MEMORY" REGISTER. These three registers are each comprised of a number of logic elements. One of the functions of these registers is to hold or "remember" binary numbers used in calculations. All of the arithmetic performed by the computer occurs in either the ACCUMULATOR or the M-Q REGISTER. The MEMORY REGISTER "remembers" a number but this number is not changed during the course of calculation. Each of these registers is comprised of binary "logic elements". A register may contain a number having as many binary digits, or "bits", as the REGISTER has logic elements. Specifically, the ACCUMULATOR may contain any 7 bit number; the M-Q REGISTER any 3 bit number; and the MEMORY REGISTER any 4 bit number. Binary numbers will be explained in more detail later by actually operating DIGI-COMP II and noting what they represent. Before describing the use of the three REGISTERS, let us first check them out to see if they are working properly. As with an electronic computer, if the machine is to know what we want it to do, all of the switches must be set correctly. This is called "initializing" the computer. To help you remember how to do it, the following check list has been developed. Also, the outline of each "switch" or "flip-flop" in its correct normal position has been printed on the face of your DIGI-COMP II. At the beginning of a new operation you will be instructed to, "INITIALIZE" the computer. This means to follow the instructions given in the "New Operation Check List" below performing all the steps that need to be performed. If the elements to be reset are already in their correct position then no change need be made, of course. NEW OPERATIONS CHECK LIST 1. Be sure that Tl, T2, T3, T4, TS and T6 are to the left. 2. Be sure that CFl is to the left and that CF2 is to the right. 3. Set flip-flops Dl, D2, D3, in the DISTRIBUTOR to the right as shown in Figure L 4. Set all the Control Switches to their "normal positions" according to the following table ( Figure 1 also shows the control switches in their normal positions ). Normal Positions of Control Switches Switch Name Setting Positions MULTIPLY CLEAR COUNT COMPLEMENT OVERFLOW A-M OFF OFF OFF OFF RUN AUTO left left left right left left 5. Place all of the balls ( or a sufficient number) in the INPUT GUIDE at the top of the computer. - 5- If the computer is "INITIALIZED" properly and if it is operated correctly and without error, it will never actually be required to change any settings in Step 1. In Step 4 it will be noticed that the "normal" position of all switches that have ON and OFF positions is OFF. Notice also that the normal position of every switch is to the left except the COMPLEMENT SWITCH, which is to the right. Flip-flops 01, 02, 03 mentioned in Step 4 will have to be initialized after every operation in which the MUL TIPL Y SWITCH is ON. Otherwise, they will remain initialized correctly and need only be checked but not actually changed. In each of the Experiments to follow, frequent requests will be made that the computer be "INITIALIZED" according to the New Operation Check List. WHEN THE INITIALIZE COMMAND IS GIVEN YOU SHOULD SET ALL OF THE SWITCHES ACCORDING TO THIS CHECK LIST. e TEST 1 First, "INITIALIZE" your DIGI-COMP II as described in the new operation Check List given on Page 4. Next, turn all the flip-flops (AI, A2, A3, A4, AS, A6, A7 ) in the ACCUMULATOR REGISTER to the right. The vertical column of numbers is always read. So the accumulator is now read 1111111. ( You may not know what this means yet, but it will become clear very shortly). Next, turn the "COUNT" switch to the "ON" ( right) position and the "AM" switch to "MANUAL" ( right) position. Pull the start switch and see what happens. A ball should be triggered from the top, roll down past the "MULTIPLY" switch to the "CLEAR" switch and inside the "COUNT" switch. It should then go down through the ACCUMULATOR and change each "One" ( 1 ) to a "Zero" ( 0 ) before coming out the bottom and being caught in the COLLECTOR GUIDE. If it doesn't work, it is probably because you didn't initialize DIGI-COMP II properly. Go back and try it again. If the marble jammed, look carefully at it and see if you can figure out why. Wiggle that flip-flop back and forth until it is nice and free, then set them all back to "one" ( 1 ) and try again. Now, be/ore you go on to the next test let us start learning how to "talk" to your computer in a language both of you can understand. In communicating with computers programmers develop a special language or shorthand to save time. For DIGI-COMP II we can write the program for Test 1 using our own special language. This is called a machine' la1/guagc. 1. INITIALIZE 2. A = 1111111 3. COUNT = ON 4. AM = MANUAL Sa START If you compare this program to the instructions for Test 1, you should begin to understand what each step means. To be sure you understand each command in the program, see your programmer's card for a complete list of possible commands and their definitions, -6- • • TEST 2 In performing Test II, try setting all the switches correctly just by looking at the program below. 1. INITIALIZE 2. A = 1111111 3. CLEAR = ON 4. AUTO = MANUAL S. START If you did this correctly you should have first set the switches and flip-flops as directed in the New Operation Check List (Page 4). (The "COUNT" SWITCH should have been turned OFF. ) Next, you should have turned all the ACCUMULATOR flip-flops to the right ( 1 ) position. The third step was to turn the "CLEAR" switch to the right ( on ) position. Fourth, to turn the "AM" switch to "MANUAL". Now, when you pull the START SWITCH the marble should go down the guide, to the right of the "MULTIPLY" switch, then go to the left of the "CLEAR" switch, drop to the lower level and change all the ACCUMULATOR flip-flops to "zero". If it didn't work you should check the switch settings again. If only some of the flip-flops were changed to zero, wiggle the ones that did not flip. If they all changed to zero but the marble didn't come out the RETURN GUIDE, check the assembly instructions to be sure it is in correctly . • • TEST 3 • 1. 2. 3. 4. INITIALIZE A = 0000000 AM = MANUAL START If you followed the program correctly and your computer is assembled properly, the marble should have turned all of the ACCUMULATOR MODE T1, T2, T3, T4, TS, T6 FLIP-FLOPS to the right. If it didn't change them all wiggle the ones that didn't change. Now leave everything as is and start another ball. It should change the ACCUMULATOR to all "ones" ( 1 ). Starting a third marble will cause all of the ACCUMULATOR MODE FLIP-FLOPS to turn back to the left. ( Again if they don't all turn back, wiggle the ones that don't ). • • TEST 4 •• 1. INITIALIZE 2. AM = MANUAL 3. C = ON 4. Manually take a marble and place it in the guide just above the "COMPLEMENT" SWITCH. Let it roll down the guide into the COMPLEMENT SWITCH. Notice that the ball first goes out of the COMPLEMENT SWITCH to the right. Next, it was directed out of CF2 to the left and simultaneously "flipped" CF2 to the opposite position. Then the ball was guided to enter the AM SWITCH which further directed it to the left. Repeat Step 4 several times. A peculiar result may now be noted. Although the first ball exited from CF2 to the left, the second ball exited to the right. Moreover, each successive ball alternated between the left and right exit out of CF2. The element called CF2, is a simple "FLIP-FLOP" called the "second complement FLIP-FLOP" in DIGI-C OMP II. It is used as part of the necessary circuitry to complement the ACCUMULATOR but this will be explained in more detai1later. What should be noticed now is its FLIP-FLOP behavior. - 7- Each successive ball entering CF2 can be imagined to be asking it the question, "Are you set to the right or to the left?" If the answer is "to the right", the ball flips it to the left and exits to the left. The next ball asks the same question but gets a different answer. CF2 responds that its setting is "to the left". In this case the ball will flip it to the right an d exit to the right. This FLIP-FLOP cycle will repeat over and over as long as it is questioned. This questioning action of a ball in DIGI-COMP II, or an electrical impulse in a digital computer, is referred to as "INTERROGATING " the Logic Element for its binary "state". In DIGI-COMP II the "state" is the element's right or left setting, whereas in an electronic computer it may be one of two voltage levels, an "ON" or "OFF" condition or a magnetized or unmagnetized condition of a circuit element. It is called "BINARY" state because there are only two possible states. In an electronic computer millions of impulses interrogate and activate electronic FLIP-FLOPS in a second of operation! • • TEST 5 •• • 1. INITIALIZE 2. AM = MANUAL 3. C = OFF 4. Repeat Step 4 of Test 4 again several times. This time the ball will not be directed by the COMPLEMENT SWITCH to enter CF2. Instead the COMPLEMENT SWITCH will cause it to leave to the left and by-pass CF2 without interrogating and without flipping CF2. However, it should be clear that the ball is still questioning or interrogating the COMPLEMENT SWITCH this time, as indeed it was before. The logical relationships between the COMPLEMENT SWITCH and FLIP-FLOP CF2 can be illustrated by what is known as a flow chart. The ball may be imagined to begin at the top and ask the questions indicated in each box. The answer that it obtains from the box determines which of the two paths it follows on its way out. ON OFF C OFF ON HALT HALT START Thus the ball starting from the top asks the COMPLEMENT SWITCH a question and depending on the answer goes one of two ways, either to AM or to CF2. Similarly it asks the other Logic Elements questions and each time does one of two things depending on the answer, and then is directed to another logic element. Flow charts of the type shown in Figure II are frequently used by computer people to display the logical relations between various elements and conditions. - 8- In DIGI-COMP II switches such as the COMPLEMENT SWITCH and AM are only changed by the operator but FLIP-FLOPS like CF2 are changed by the machine process. Each of these binary logic elements may therefore be considered to store or memorize a "bit" or "binary digit" of information by virtue of its setting. Machines like DIGI-COMP II are frequently called "finite state" machines because there is a finite or limited number of states that the machine can take on. Electronic computers work in a manner analogous to DIGI-COMP II. Instead of balls, electronic impulses in the form of voltage level changes are used but the net result is the same. One cannot see the voltage level in a transistorized circuit flip from one value to another or the magnetic field in a tiny iron doughnut called a "core" reverse itself, but these reversals do occur and in a manner entirely similar to the mechanical flipping of the FLIP-FLOP elements in DIGI-COMP II, but of course these changes occur millions of times faster. - 9- CHAPTER 3 BINARY COUNTING BINARY TO DECIMAL NUMBER CONVERSION QUESTIONS: 1. 2. 3. 4. 5. 6. How do computers count in binary? How do "carries" take place in counting? How much is each bit position of a binary number worth? How does the Auto Manual Switch work? How maya binary number be changed to its decimal value? How maya decimal number be changed to its binary value? EXPERIMENT I: BINARY COUNTING ( Consult Figure 1 to identify Logic Elements) 1. 2. 3. 4. 5. INITIALIZE AM = MANUAL A = 0000000 COUNT = ON START A ball will be triggered from the INPUT GUIDE to roll down the surface and add one into the ACCUMULATOR REGISTER. When the ball has reached the COLLECTOR GUIDE the ACCUMULATOR will read: 1 o o o o o o 6. Repeat Step 5 another 6 times writing each successive accumulator reading down. By recording each number obtained we get the following binary numbers: Number Binary number obtained in the ACCUMULATOR or times START switcb was pulled 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 0 0 1 J 1 - 10 - 0 0 0 0 As a design convenience binary numbers are represented vertically in the ACCUMULATOR in DIGI-COMP II. However, it is customary to express binary numbers horizontally, rather than vertically, when writing them down. To write these numbers horizontally from left to right we write them to correspond with reading the ACCUMULATOR in DIGI-COMP II from bottom to top. Therefore, these same numbers would be more customarily expressed as, 1 2 3 4 S 6 7 0000001 0000010 0000011 0000100 0000101 0000110 0000111 or or or or or or or 1 10 11 100 101 110 111 ( If you stand on the right side, which is the side the START SWITCH is on, you can see that you will read the ACCUMULATOR as an ordinary binary number. ) 7. Pull the START switch once more and observe the "carries" that take place as one is added to 7. That is as, 0000111 + 0000001 becomes 0001000 Notice that Al flips to "0" and the ball is carried to the entry of A2. Then A2 flips to "0" and the ball goes to A3. Then A3 flips to "0" and the ball goes to A4. Next, however, A4 is a "0" rather than a "I" and so no carry to AS takes place. Instead, the ball leaves the ACCUMULATOR without affecting it further. EXPERIMENT II: 8. AM = AUTO 9. START The ninth ball will change the ACCUMULATOR TO 9 = 0001001 and will then be directed by the AM Switch to roll under the START SWITCH. This automatically triggers the next ball. ( If the ball should ever happen to pass under the START SWITCH without triggering another one, just pull it manually. ) Now we can watch the automatic action of the computer as it counts. Every few seconds another ball is triggered from the supply at the top automatically and it adds one to the ACCUMULATOR in binary. To stop the automatic counting it is only necessary to turn the AM Switch back to the Manual position. To re-start the automatic operation turn AM back again to Auto and Pull the START SWITCH. BINARY TO DECIMAL NUMBER CONVERSION Let us stop for a minute and learn how to read out the numbers of the registers. It is very simple to read out the decimal number held in each register in binary numbers. 1. Note that in the middle of each FLIP-FLOP read out there is a small number which you used during assembly to know where each Read-Out Indicator went. 2. To read a register, simply add the values of these small numbers up for each place there is a 1, but do not add those . numbers where there is a O. For example, to read out the ACCUMULATOR register in the following case the numbers to be read are shown to the right of the column. - 11 - So the decimal number in the ACCUMULATOR is 86. Note that only when a 1 is up do we include the value of that FLIP-FLOP toward the total. o o "p. 2 .'\'0'. 4 ""y, . . 1-.' "p SO) '-_~ _~6__'j" o 16 o +64 86 To be sure we understand, another example is, \..0 '\,0. '.';"0 2 ",". "'-.0 !Sal .:.--'~ -:.~. :,_,,0: So the number in this example is 35. Later when you learn about binary numbers you will be able to both read and set in binary numbers without the aid of the little decimal numbers on each FLIP-FLOP. " ';;"(i, . -'-:-~ The MQ and MEMORY REGISTERS are read the same way. For example, for the MEMORY REGISTER - 0 0 32 +0 35 o +8 13 and similarly for the MQ Register. There are several methods of converting back and forth between binary and decimal numbers. The easiest type of conversion method to learn is a table. Take out your programmer's card and you will see such a Table. Program DIGI-COMP II as follows and you will see how this table is made. 1. INITIALIZE 2. COUNT = ON 3. A = 0000000 4. START Be sure to put all of the ba11s in the INPUT GUIDE. Each ba11 coming down through the ACCUMULATOR will add one to it. As each additional ba11 comes down through the ACCUMULATOR, compare the readout with the next number in the Table. ( If you get confused, the number of ba11s at the bottom should be the same as the Decimal number in the Table. ) With this Table it is possible to convert from binary to decimal or from decimal to binary simply by looking up the desired number and getting its equivalent. From the Table you wi11 notice that the binary numbers 1, 10, 100, 1000, 10000, 100000 and 1000000 correspond to the base ten numbers 1, 2, 4, 8, 16, 32, and 64. Each successive one of these numbers is twice as large as its predecessor and for reasons which will be explained later, they represent consecutive powers of two. In decimal or base ten the numbers 1, 10, 100, 1000, 10000, 100000 have an entirely different meaning than in binary, of course. Each of these numbers is ten times its predecessor in base ten. You have learned that in decimal numbers, 683 actua11y means: 6 one hundreds + 8 tens + 3 ones. - 12 - Therefore, 683 can be written as: 683 = 600 + 80 or 683 = ( 6 x 100 ) + ( 8 x 10 ) or 683 = ( 6 x 10 x 10 ) + ( 8 x 10 ) or + ( 8 x 10 f) 683 = ( 6 x 10 2 ) +3 +(3x1) +(3x1) + ( 3 x 10 0 ) ( Any number raised to the power to zero is equal to one, thus 10 0 = 1. ) In the number 683 the digit 6 is in the "hundreds" position - the digit 8 is in the "tens" position - and the digit 3 is in the "ones" or "unit" position. In other words we may say that each digit in any decimal number is a different power of ten depending on the position of the digit within the number. \\'hat will each position in the binary number system mean? In the binary system we have only two symbols ( 0 and 1 ). Therefore, EACH POSITION REPRESENTS A DIFFERENT POWER OF TWO ( 2 ). That is, they are 2 0, 2 1, 2 2, 2 3, and so on. 110 An example of a binary number is: This number is read: "ONE, ONE, ZERO." The meaning of this binary number can be written as in the following example: 110 = ( 1 x 22) + ( 1 x 21 ) + ( 0 x 20 ) or 110 = ( 1 x 2 x 2 ) +( 1x2) + ( 0 xl) or 110 = ( 1 x 4 ) +( 1x2) + ( 0 xl) or 110 = 4 +2 +0 Given a binary number such as 0110101 we may express it as: 0100000 + 0010000 + 0000100 + 0000001 = 0110101 32 + 16 + 4 + 1 = S3 This gives us a convenient way to convert any binary number to a decimal number without even using the table. We merely write down the powers of two beginning from right to left above the binary number to be converted and sum those powers that correspond to "I" bits in the given number. Using the same example, 1 32 4 2 64 16 8 - - - - - - - - - ------------------------------0 ( 0 0 1 1 1 1 )2 0 + 32 + 16 + 0 + 4 + 0 + 1 = S3 The same technique can be used to read a binary number in the ACCUMULATOR REGISTER of DIGI-COMP II and mentally convert it to decimal to better understand the result. Beginning with the top bit of the ACCUMULATOR and proceeding down we consider that the bit positions are worth 1, 2, 4, 8, 16, 32, 64 ( these are the small numbers printed on the readout indicators for easy reference. We suggest that you cover them with a small piece of tape to make you learn faster. ) Wherever the bit is a "1" we sum this corresponding number but wherever it is a "0" we do not. Suppose, on the other hand, we are given a decimal number, such as 74, and wish to express it in binary. We begin by putting down the numbers 1, 2, 4, 8, 16, 32, 64 in a string as before, but this time we start from the bottom of the list and ask: Can we subtract 64 from the number? If the answer is "yes", perform the subtraction obtaining a remainder and place a "I" in the last or bottom digit. If "no", place a "0" and consider the number to be the remainder. Next, can we subtract 32 from the remainder? If "yes", place "1" in the second from last digit and perform the subtraction. If "no", place a "0" and consider the present number to be the remainder. Proceed in like fashion until the complete number is changed to binary. For example, to convert 74 to binary we begin with Step 1 at the bottom and proceed upward as follows: - 13 - Step 1 begin Step 2 Step 3 Step 4 Step 5 Step 6 Step 7 74-64 = 10 10-32 10-16 10-8 = 2 2-4 2-2 == 0 0-1 cannot be subtracted cannot be subtracted cannot be subtracted cannot be subtracted Place 1 in 7th position Place 0 in 6th position Place 0 in 5th position Place 1 in 4th position Place 0 in 3rd position Place 1 in 2nd position Place 0 in 1st position Therefore, o 1 o 1 o o 74 = = ( 1001010 ) 1 This result can, of course, be checked by binary to decimal conversion or by checking the conversion Table on your programmer's card. That is, Number Worth if "I" 0 1 0 1 0 0 1 1 2 4 8 16 32 64 Sum 0 2 0 8 0 0 + 64 74 ( which checks) Summarizing, to convert a binary number to decimal we begin at the bottom of the register ( left of the number) and subtract from the given decimal number. Each time we can subtract one of the numbers 64, 32, 16, 8, 4, 2, 1 we place a "1" bit in the corresponding position, and each time we cannot subtract, we place a "0" bit in the position. The remainder from the subtraction is carried forward each time the subtraction can be performed, but otherwise the last remainder obtained is carried forward. QUESTIONS: 1. What is the binary equivalent of 63? 2. What is the binary equivalent of ll2? 3. What is the decimal equivalent of 1l01l01? 4. What is the decimal equivalent of 10010ll? To check your answers consult the binary decimal conversion Table on your programmer's card. The binary numbers you have obtained by counting on DIGI-COMP II are exactly the same as those used in most large scale electronic computers except they may have a different number of bits. Numbers of this nature are stored in MEMORY REGISTERS and used in Arithmetic Registers for calculation. Professional programmers who must work closely with the computer become very familiar with these numbers and are able to convert from binary to decimal and vice versa quite readily while they are in the process of checking out the program which they have written. - 14 - CHAPTER 4 ARITHMETIC OPERATIONS The front panel of DIGI-COMP II has a chart printed on it which is meant to serve as a reminder for doing the basic arithmetic operations. COUNT: In Chapter 3 we did some counting. To get more practice in counting and using the front panel chart, put 15 marbles in the INPUT GUIDE and Program DIGI-COMP II as follows: 1. INITIALIZE 2. A = 0000000 3. COUNT = ON 0001 0010 00 I I 0100 0101 Now look at the front panel switch setting chart and compare each switch position for the COUNT OPERATION with those you programmed into the computer. They should be the same. Now, pull the START SWITCH and DIGI-COMP II will count until all the marbles have come down. You should have ( 0001111 ) in the ACCUMULATOR now. CLEAR: Now program DIGI-COMP II according to the following: 1. INITIALIZE 2. A = 0001111 3. CLEAR = ON 4. AM = MANUAL 5. START o o o o o o o The ACCUMULATOR should have been cleared to 0000000 with one marble. Again, you should compare your switch settings with those called for on the front panel chart for the CLEAR operation. - 15 - ADDITION: In addition of two numbers the method is to put ( 001 ) in the MQ REGISTER+ ( always use the upper set of 01 numbers on the MQ FLIP-FLOPS except when reading out the answer to a problem in division ), one number to be added in the MEMORY REGISTER and the other number in the ACCUMULATOR. The answer will appear in the ACCUMULATOR. If we wish to add 13 to 71, for example, put the binary equivalent of 13 which is ( 1101 ) in the MEMORY REGISTER ( M ) and the binary equivalent of 71 which is ( 1000111 ) in the ACCUMULATOR REGISTER. In the languagilOf DIGI-COMP II, the command M = 1101 means 0 I0 I + I0 I I 10000 "Ente,!: ;n the MQ REGISTER". ( Do not fo'get, unle,. told othe,w;se, always use the upper set of numbers on the Indicators of the MQ REGISTER. ) With this as a background the program for this problem would be as follows: 1. INITIALIZE 2. MUL TIPL Y = ON 3. A = 1000111 4. M = 1101 5. MQ = 001 6. START What should the ACCUMULATOR have when you finish? If you set everything up properly the ACCUMULATOR should read 1010100. Now try a problem yourself. The Program is the same; just change the numbers in the MEMORY and ACCUMULATOR REGISTERS. Write the Program for adding 15 to 112. If you do it correctly the answer should be ( 1111111 ). Make up some of your own addition problems. They can be any two numbers whose sum is less than 128, with one of the numbers less than 16. When you do it check your answer by decimal to binary conversion to be sure it is correct. MULTIPLICATION: To multiply two numbers, put one of them in the MQ REGISTER and the other in the MEMORY REGISTER. The answer will appear in the ACCUMULATOR REGISTER. x As an example let us multiply 4 times 13. To do this, set up DIGI-CpMP II as follows: 1. INITIALIZE 2. MULTIPLY = ON 3. A = 0000000 4. M = 1101 5. MQ = 100 6. START X 110 0110 o II 10010 If you did it correctly the answer should have been ( 0110100 ). Now try to multiply 3 times 15. The Program is the same as above except that M = 1111 and MQ = OIl. If you do it correctly, the answer should be ( 0101101 ). Again you should make up some of your own problems and work them. The number in the MQ REGISTER must be 7 or less and the number in the MEMORY REGISTER must be 15 or less. Work out the answer in decimal arithmetic and convert it to binary to check your answer. - 16 - oII - SUBTRACTION: The general method used by DIGI-COMP II, and most electronic computers, is called complement and add. The technique is to put the smaller of the two numbers in the ACCUMULATOR REGISTER, perform the operation on it and add the larger number to it. The answer will appear in the ACCUMULATOR. In performing the COMPLEMENT operation DIGI-COMP II will take four marbles and shut off. Then you change the switches to the ADD mode and start again. To subtract 4 from 12 the program is as follows: 1. INITIALIZE 2. COMPLEMENT = ON 3. A = 0000100 4. M = 1100 5. MQ = 001 6. START 7. PAUSE* 8. MUL TIPL Y = ON 9. COMPLEMENT = OFF 10. START 110 I 01 - 10 I I I 01 I I 10 The number in the ACCUMULATOR should be ( 0001000 ). Now subtract 14 from 15. The program is the same as above except that A = ( 0001110 ) and M = 1111. The answer should be ( 0000001 ). Try some problems yourself. Since the smaller number goes in the ACCUMULATOR it shouldn't be larger than 14 because the MEMORY REGISTER will not hold numbers larger than 15. *The PAUSE command means that you should pause until the computer has completed its automatic cycle. DIVISION: Division is performed in DIGI-COMP II and in most electronic computers by repeated subtractions. Basically the technique used is to place the Dividend in the ACCUMULATOR and the Divisor in the MEMORY REGISTER. The Dividend is then complemented and added to the contents of the MEMORY REGISTER repeatedly. The answer will then appear in the LOWER set of numbers in the MQ REGISTER. As an example, the program for dividing 25 by 5 is as follows: 1. INITIALIZE 2. MQ = 111 3. A = 0011001 4. M = 0101 • 5. COMPLEMENT = ON 6, START 7. COMPLEMENT = OFF • 8. MUL TIPL Y = ON 9. OVERFLOW = HALT 10. START Note that Steps 7, 8, 9 and 10 should be performed only after the complement operation is completed. The answer ( quotient) should appear in the LOWER set of numbers in the MQ REGISTER. It should be 101. Division gets more complicated if the divisor does not go into the dividend an even number of times. Because remainders and therefore binary fractions are involved these are discussed