Iconic Machines

Manual / Guide

Detailed Programming of the Digi-Comp I Experiments

Read the PDF ↗

E.S.R.'s supplementary booklet: Boolean algebra and detailed programming of the Digi-Comp I experiments.

Author
E.S.R., Inc.
Type
Manual / Guide
Credit
E.S.R., Inc.; copy from archive.org

← Back to the Reference Library

Detailed Programming of the Digi-Comp I Experiments

DETAILED PROGRAMMING OF THE ОІСІ-СОМР 1 EXPERIMENTS INTRODUCTION What to expect from this booklet. Chapter 1 —BOOLEAN ALGEBRA A simplified introduction to the principles of the computer algebra of binary numbers. Chapter2- EXPERIMENTS: Experiment 4 — BANK LOCK Make sure you understand how DIGI-CONP I works and leam how to write Boolean equations from the Coding Sheet. Experiment 5 - SEQUENTIAL BANK LOCK How to program DIGL-COMP I from Boolean equations. Experiment 7 — SPACE SHIP CHECK OUT Make doubly sure you understand how DIGI-COMP I works and practice writing Boolean equations from Coding Sheet. Experinent 3 — AUTOMATIC ELEVATOR The concept of memory and the difference between remembering und computing. Experiment 6 — HO-HUM Synthesizing, organizing and programming a problem. Experiment 10 — BINARY COUNTER Use of a Truth Table in writing a program, and applications of Boolean Algebra to simplify logic. Experiaent8- GUESS THE NUMBER Development ої а more complex truth table, Experiment 12 — BINARY NUMBER COMPARATOR The use of a comparator, how to modify а program fo improve the computers performance, and the use of the OR gate, Experinent 13 - BINARY ADDER How to design a Binary Adding Machine and a new technique of reducing Boolean algebraic equations. Experiment 14 — BINARY SUBTRACTOR The logical design of a binary subtracting machine using а Truth Table. Experiment 15 — BINARY MULTIPLIER The logical design of à binary multiplying machine using а Truth Table, An example of the simplicity of binary numbers. Experiment 11 — GAME OF NIM How to design a gane. playing machine, using the Flow Chart Method. How probabilities can determine the decision making process of a computer. APPENDIX Answers to Questions Blank Coding Sheets © 1966 ESR INC NOT TO BE COPIEDINWHOLE OR IN PART м 16 30 3 36 39 РА 48 50 INTRODU 10N This booklet bas been prepared because of the overubelming acceptance of DIG-COMP 1 and the many requests for details of the programming [or each problem in its Manual. 1t can be helpful to everyone who desires to know more about programming and computer logical design. An explanation of bow each of the programs for the experiments in the DIGI-COMP 1 Manual were derived will be given. In doing so, it should become apparent how to derive programs for original problems. The experiments given in the DIGI-COMP 1 Nanual will be presented here in the order of the complexity of writing the program. Although this is not the order of the DIGHCOMP 1 Manual, the experiments will retain the same numbers [or easy identification. The experiments will illustrate various techniques used in programming and in computer logical design. The objectives of each experiment are outlined in the Table of Contents, Chapter I BOOLEAN ALGEBRA Before we begin deriving the programs, a short course in Boolean Algebra is in order, Don't let that word scare you, for remember, the reason all digital computers use binary arithmetic is its simplicity, and Boolean Algebra is just the algebra of binary arithmetic, Оп Page 13 of the DIGI-COMP І Instruction Manual, the terms used are defined as follows: A-Tme -1 X False B-Tme (Ris read "Not A”) =1 False =0 — (Bis read “Not B”) C-Tue -1 C-False-0 (Cis read “Not С") The operations or connections between the terms are: The AND operation* is denoted by я dot, or multiplication відтік and the OR opcration* is denoted by a plus or addition sign.** (The dot is omitted for brevity in some cases, but it should be understood that a dot is implied when there is no sign between terms.) ‘These operations may be illustrated graphically by what is known ds а Venn Diagram, Circle A — дўнг Venn Diagram for Two Variables FIGURE 1 чіп formal logic the AND operation is called the INTERSECTION and the OR operation is called the UNION. **The dot and plus are used to denote the AND and OR operations simply because there are several rules of algebra which are similar to those of Boolean Algebra, However, you must remember that the dot is read AND and the plus is read OR. These do пої, in any sense of the word, mean multiply and add, All points inside the A' circle are represented by the variable A, and outside the "А" circle by the variable А (not A). АШ points inside the “B” circle are represented by the variable В, and outside the "В" circle by the variable B (not В). Where the two circles overlap, the points are in both the "А" circle AND the “B” circle. Thus the points in this area are designated А -В (A and B). ‘The points outside of both circles do not belong to either sot, and are therefore desig- nated А. B (not A and not В). ‘The points in A, but not in B are designated A - B (A and not B) and similarly the points in B, but not in A are designated A - B (not A and B). Another wey of looking at the Venn Diagram is illustrated in Figure 2. The points in either "А" circle OR "ВМ circle represent the OR operation (or UNION). and would be written A + B (A or B). Circle A Circle B. со FIGURE 2 The area which is in neither circle is written (A+B) (ead not A ог В). Now we are ready to develop the rules of Boolean Algebra using these Venn Diagrams. In Figure 1 notice that all points within the area A -B are the same as those within В.А, thus А-В-В:А 00 But also notice that points within the area A . B do лог equal the points within the area А.В. 5 in Figure 2, points within the area A + B are the same as points within the area B +A, thus А+В=В+А (2) It should be noted that the AND and OR functions are associative, That is: (-B)C=A@-C) (3) and (A+B)4C=A+B+0Q) (5 Also, each function is distributive with respect to the other. That is: AB+AC=A(B+C) (5) and (A+B)(A4C)=A+BC Q Equation (5) simply means that you can “factor” out a common term. Equation (6) defines the method for expanding а “binomial” in Boolean Algebra. In Table 1, on the following page, some sinple Boolean equations are presented with corresponding Venn Diagrams and DIGI-COMP coding sheets. Using the table we shall develop several useful Boolean relationships. At this point we shall discuss the connection between the equations and the Vena Diagrams. In Chapter П the connection between the equations and the Coding Sheet will be discussed, Table 1 Chart of Venn Diagrams and Digi-Comp Codes BOOLEAN EQUATION (9 VENN и Ге) К CoA % A C-B ке 2 ч) с-в |7907] © €) cae ANB (0 C=AB DIGI-COMP CODING SHEET i 165) [3] [C] фу 0) C=A+B () C-A«B M N (5) C= (B) + (A-B) (а) C = (АВ) «(A +B) @ c-o 2 15 ( Y тү. оо» — Note that а Venn Diagram for a function joined by the OR operation is just the super position (the union) of one diagram upon the other. (Any area shaded in either diagram is shaded in the joined diagram.) А Venn Diagram for a function joined by the AND operation is the Intersection of the two diagrans. (The only area shaded is that which was shaded in BOTH separate diagrams.) In Tabie 1, Equation (9) C = О, therefore, there are no points shaded in the Vena Diagram. The Venn Diagram for Equation (p) has all points shaded. Thus a point anywhere in the Diagram satisfies the equation which is denoted by C = 1. Look at Equations (a) and (b) and shade in the Venn Diagram below for the Equation CARA If you did it properly the entire diagram should be shaded in. Thus AtK=1 8) Now, look at Equation (i). In the Venn Diagram below, shade in the area C = А + B. (The area not shaded in the Table.) Comparing this Diagram to the one for Equation (Б), shows that the points in C are the same as those forС=А+ B, therefore X. B.XI © ‘This is an illustration of DeMorgan's Theorem, which states that any binary expression is equal to the negation of the expression obtained by changing all unions to intersections and vice versa, and by replacing each variable with its negation. Another example would be TDB NH 8 Р ß d00) Й — XE This can be verified by looking at the Venn Diagram of the negation of Equation (є) секти which is and comparing it to the diagram for Equation (1). Many similar relationships can be derived from the Venn Diagrams, These are very convenient in the simplification of the programs to be written later. Chapter Ii EXPERIMENTS EXPERIMENT 4 - BANK LOCK Each morning the president of the MONEY tank has to open the bank vault, It is a combination lock using binary numbers. This morning the president was surprised to find he couldn't remember the combination. Can you open the vault for him? Program DIGI-COMP as in the coding sheet below: & “Wed le e | BO fh al И ЧЕ d | и J "an STEP 1 - Use Front Panel Card 1. STEP 2 — You guess the binary combination and manually set the combination into the three flip-flops. STEP 3 — Cycle the clock ONCE If you see in the Read-Out, you have successfully opened the vault! If you do not see і try again! What is your chance of opening the vault on the first try? Your chance of guessing the right combination to open the vault was only 1 out of 8, but you should have gotten it the first try - did you? This experiment was presented to be Sure you understand how DIGI-COMP works. HE, Бій ese noel lly lord to pe: З овен yu ар Sold d, aai here wal: от tie SET stan ан PEE с CCC be free to move in when the clock was cycled. Now, set up the Flip-Flops to Read-Out Йand look at logic rods 2, 4 and 6. They are all free to move in when the clock is cycled, Try it To see how the Coding Sheet ties in with the Boolean Algebra equations, look at each logic rod individually. Logic Rod sl is connected to Clock Rod #1 which is а RESET Rod. If clock rod «1 is activated, it will move the A flip-flop to ZERO, because there is a clock tube on the A flip-flop in the #1 position. For Clock Rod slto be activated, Logic Rod #1 must be free to move in. For this logic rod to be free to move in, all three flip-flops must be in the "1" position. Now to put this in equation form: 10 Reset Awhen A= Land В - land C=1 ap Now we will replace each part of the sentence by its "short hend”? algebraic counterpart as follows: "Reset А" is replaced by " When’ is replaced by ЧА = 1 is replaced by ЧА" SAND” is replaced by "У" ^B = 1" is replaced by “B” E 1" is replaced by “С” Therefore, the sentence (11) may be replaced by the equation: XA. B. C (notice how the logic rod is operating as an AND gate) Now, to do the same thing for Clock Rod 92. If this rod is activated it will "SET" the А Flip-Flop to I. And this will happen only if Logic Rod є? moves in or if A= 1 AND B=OANDC 1. Using the same relations as before: AzA B-C Clock Rods »4 and #6 operate just like 22, except they set Flip-Flops B and C. The equations for them are then: Be sure you understand how these equations were derived from the Coding Sheet. This process, or the reverse of it, will be repeated in all Experiments to follow. Now, turn back to Table 1 of Chapter I, and study the relation between the Boolean Equations and the Coding Sheets for the equations. u EXPERIMENT 5 - SEQUENTIAL BANK LOCK To make it more difficult for anyone but the president of the bank to open the vault, a new type lock was installed. This lock requires wo binary numbers in a particular order to open it. Program DIGI-COMP according to the coding sheet. я E He 18 To operate DIGI-COMP: STEP 1— Use Front Panel Card I, STEP 2 - Make sue clock is all the way to the right. STEP 3 — Manually move all flip-flops to the right. (See $in the Read-Out.) o it in theAand B flip-flops, "—— STEP 5 - Cycle the clock ONCE. If the C flip-flop goes to “1” then the number you entered was correct and go to step б. If it stays at ЧО" try Steps 4 and 5 again, STEP 6 Guess the second binary number 0091 not | manually enter it in flip-flops A and В. sao t y and STEP 7 — Cycle the clock ONCE. If you see |in the Read-Out, you have opened the vault. If пої, щу Steps 5 and 6 again, This time what is your chance of opening the vault the first try? This problem is twice as hard as Experiment 4 to guess the right combination; but it isn't any harder to figure out the solution if you understand how DIGI-COMP works. To get ihe first number in the combination you should have noticed that il Logic Rod 6 were activated, а “1” would have appeared in the "С" Flip-Flop Now set the “A” Flip-Flop to “1” and Logic Rod 6 is free to move in. Thus, the first combination you should have picked was g. Now you want Flip-Flops А and B to be set to I. So look at Positions 2 and 4. What combination will let these Logic Rods move in? That's right — f. To do this problem in the more precise language of computers, you should write it in equation form: 12 Combination 1- Set C- A - B.C. Combination 2 — AC Notice how the three equations compare with the Coding Sheet. "SET C'' is programmed оп Logic Rod 6; "SET В” on Logic Rod 4, and “SET А" on Logic Rod 2. See how, as in Experiment 4, the Logic Rod acts as an AND Gate. (A and B and C must be in the proper position for it to be activated.) Logic Rods 1, 3 and 5 are for Resetting the flip-flops to zero, and Logic Rods 2, 4 and6 are for Setting the flip-flops to ONE. 1 а term has а BAR over it in the equation, (such as В) put а Logic Tube on the “F” ‘TAB of the В Flip-Flop. If а term DOES NOT have а BAR over it (such as С) put a Logic Tube on the '* ' TAB of the C Flip-Flop. Since positions 2, 4 and 6 are identical except for the location of the Clock Tubes the selection of a position for a particular AND function is ARBITRARY. That is, positions. 2, 4 and 6 could have been interchanged. (Since the EVEN numbered positions are for Setting to 1, and the ODD numbered positions are for Resetting to 0, THE EVEN AND ODD NUMBERED POSITIONS MAY NOT BE INTERCHANGED.) For instance, if we interchanged positions 2 and 6 the Coding Sheet would be: с Im" If you program DIGI-COMP according to this it will still operate in the same manner. 1з EXPERIMENT 7 - SPACE SHIP CHECK OUT (A Job For An Astronaut) This is the last moment before “blast off". It is time for you to make sure all the important parts (‘‘systems”) of your space ship are operating properly, You must now go through the final “check-out procedure”, If anything is wrong the launching will be canceled. ‘There ate three systems to bechecked: 1. Oxygen system, 2, Space-Ship controls. 3. Radio. To chock these systems the following questions are asked. They must be answered correctly to avoid a cancellation of the launch. 1. How much oxygen is flowing? 2. Is the “control stick" in the correct position? 3. To what frequency is your radio turned? All 3 answers have a nunerical value. These values will be checked one at a time with the values stored in DIG-COMP. If they check correctly the computer will indicate that the system is „4-0. K.,, I not, the computer will indicate e malfunction (not working properly). Program DIGI-COMP according to the coding sheet: 1 ul um fe [le “| d STEP 1 — Use Front Panel Card 1. STEP 2- Move all logic rods to INACTIVE (tum to the left) except Nos. 2 and 3. STEP3— Guess how much oxygen is flowing and manually move the flip-flops to the numerical value (anything from 000 to 111) M . — — STEP 4 - Cycle the clock ONCE. If the result is | in the Read-Out, then the system is operating -O K.,. If the result has а "0" ANYPLACE, then the system is NOT operating correctly. Move the flip-flogs and cycle the clock until you get the “A-O.K.” signal, 1. STEP 5 Repeat Steps 3 and 4 for the next two questions. For the second question move logic rod number 4 to the ACTIVE POSITION (tum to the sight). For the third question move logic rcd number 6 to the right. When all three systems are 4-0. K. you are ready for your interplanetary voyage. Try to blast off the FIRST try, It should be duck soup by now — if not, you'd better go back to Experiment 4 and start again. To write the Boolean Equations for this program, proceed in the same manner as Experiment 4, only now you should be able to just look at the program on the Coding Sheet and write the equations. To check yourself, see Page 48 for the equations. 15 EXPERIMENT 3 - AUTOMATIC ELEVATOR ‘The automatic elevator is a common example of automation which uses MEMORY. A simple sutomatic elevator is the two floor elevator. The automatic system is required to REMEMBER at which of the two floors it has stopped. In the elevator there are two buttons, one to tell the elevator to go to the Ist floor and the second to tell it to go to the 2nd floor. On each floor there is a button (CALL button) which you can push to tell the elevator to come to your floor. Imagine the CALL, button cn the Ist floor is the same as the button in the elevator directing it to the Ist floor. Also, the 2nd floor CALL button is the same as the 2nd fl button in the elevator, Put FRONT PANEL CARD II into place. On this card there is marked “UP-DOWN”. If the bottom flip-flop is at ‘‘1”, the elevator is directed to the 2nd floor, and if it is at "0", to the 1st floor. (Look at the Read. Outnext to UP-DOWN.) The floor at which the elevator is located is indicated by а “1” in the Read-Out by the floor. DIGECOMP can be used to show how this elevator works. PROGRAM DIGI-COMP according to the coding sheet. e Ще | ser dal ental dep "E debesti] H To operate DIGI-COMP: STEP 1 – Make sure logic and clock tubes are ONLY in the positions indicated on the coding sheet. STEP 2 - Make sure all LOGIC RODS are in the ACTIVE POSITION (turned to the right) and the CLOCK is all the way out (to the right), STEP З — Manually set the "up-down" flip-flop to “1” if you want to go up or to “0” if you want to go down. STEP 4 — Cycle the clock. This experiment is in the DIGI-COMP Manual to illustrate the concept of a MEMORY. DIGLCOMP does not really compute anything in this problem. It simply REMEMBERS which floor it is on, so that it knows which way to go when the button is pushed. тов how it io done, program DIGI-COMP єв in the Coding Shoot. Now, set the Bottom “C” Flip-Flop to zero. Notice that the first and fourth Logic Rods are not blocked and can be pulled in. Then the first Clock Rod sets the "А" Flip-Flop to zero and the fourth Clock Rod sets the “B” Flip-Flop to 1. 16 The second and third Logic Rods operate in a similar manner to take the elevator to the Second floor. We said before that DIGI-COMP wasn't computing in this experiment — it was memorizing. It remembers which floor it is to go to, but not which floor it is at, Seu tho РШЕ si Tae nt ha foe Wn gh Os oa lade — Wa you're already there! When you cycle the Clock the second and third Logic Rods are MIL ies (ore d e Now, we want to correct the situation and make the elevator operate more efficiently. To do this put Logic Tubes on the “F” pegs at the second and third positions on the “AY, Flip-Flop, Now put the elevator on tke first floor and push the second floor button J. The elevator moves to the second floor just as before. Cycle the clock again and nothing happens. Now the elevator is operating more efficiently. Set the "C" Flip-Flop to eto and cycle the Clock по you go back down, What woulg you do with the first and fourth positions to keep them from actuating when you have 5 Ty it, Now DIGI-COMP is COMPUTING - because it COMPARES where it wants to go with where it already is, and decides whether to go up, down, ог stay still, If you wish to become even more Sophisticated, we can use DIGICOMP to open the elevator door. To see how to do this, we must first determine when the door should be opened. That is, when you are where you want to be 1 or 9. So if we use Logic Rod 5 to ‘open the door on the second floor, set РІСЕСОМР to J and look at the T and F pegs in the nunber five position. Notice that if we program it by putting logic tubes as follows: The rod is free to move in and thus open the door. This is a good illustration of how the logic rod operates as an AND gate. A must = 1 AND B must =0 AND C must = 1 y For the door to be opened, Now you should be able to figure out how to make the sixth Logic Rod (AND GATE) open the door on the first floor. If you have trouble, turn to Page 48 for the complete program. Make sure you understand it before proceeding to the next Experiment, EXPERIMENT 6 - HO-HUM (Logical Riddle) In the Pacific Ocean there are two neighboring islands which few white men have seen If you were to take a trip and visit these islands you would find the natives of island HO always tell the truth while the natives of island HUM always tell falsehoods. As an outSider you cannot tell to which island any of the natives belong. When you visit the islands you see @ group of three natives standing around, and out of curiosity ask the first to which island he belongs. FIRST NATIVE'S ANSWER: BZV Pl. Since he doesn’t speak English, you cannot understand his answer. You ask his two friends: “What did he вау?”” SECOND NATIVE ANSWERS: He say he belong "НОМ". THIRD NATIVE ANSWERS: “No, first man say he belong НО." Riddle: To which island does the third native belong? To operate DIGI-COMP: STEP 1 - Put Front Panel Card Ш into the slots cn the Front Panel. STEP 2 — Make sure clock is all the way out (to the right). STEP 3 - Program DIGI-COMP accordingtothe coding sheet, (You may find it helpful to move some of the logic rods to the INACTIVE POSITION (turn to the left) when putting on logic tubes.) a в E: c з "Im 1 L | |с з 6, uf lc ad — = STEP 4 - Make sure logic rods 1, 4, 5 and 6 are in the ACTIVE POSITION (turn to the right). STEP 5 - With the Manual Input Tabs enter the answers of the second and third natives into the flip-flops indicated by the Front Panel Card. If the answer was HO enter а "1", if HUM. enter “0”. STEP 6 — Cycle the clock ONCE. The answer in the Read-Out will be “1” if the third native is from НО and “0” if he is from HUM. 19 Try entering other answers for the 2nd and 3rd Natives. DIGI-COMP will always correctly tell you from where the third native cones. To program а riddle of this sort, you must first fully understand the problem yourself. To do this you must break the problem down to its most simple form — this is called synthesizing a problem, There are four combinations of answers that you could get from the second and third Natives, 1. First, if the second Native answers HO and the third answers HUM, you know one of them is lying. But how do you determine which it is? To find the answer to this problem, you must remember the question you put to the natives, It was “which Island did he say he belonged to,” not “which island did he actually belong to.” And here lies the solution to the problem. If the first native was from HO, he would fell the truth and say he was from HO. If he was from HUM, he would lie aad still say he was from HO. Therefore, you know that the Native who said he said he was fron HUM was lying. Thus, in the first case, the third Native was from HUM. 2. If the second Native bad answered HUM and the third answered HO, then the second was lying and the third was from HO. 3. If they both had answered HUM, then they both lied so that the third was fron HUM. 4. If they both had answered НО, then they both told the truth so the third Native was fion HO. To program this, now that we understand the problem: let А = an answer of HO from the second Native B = an answer of HO from the third Native then A = an answer of HUM from the second Native B = an answer of HUM from the third Native Since the answer to the riddle should appear in the " "' Flip-Flop the above four statements can be translated into quations as follows: 1. The first set of answers we: Second Native: HO (enter a 1 in Flip-Flop A) Third Native: HUM (enter a 0 in Flip-Flop В) Since the third Native lied, we want the answer in C to be 0, when А - land B=0. So the first equation is: ResetC=A B 2. The second set of answers were: 20 Second Nati HUM (enter а 0 in Flip-Flop A) Third Native: HO (enter а 1 in Flip-Flop В) Since the third Native told the truth, we want the answer in C to be 1, when A = 0 and В = 1. So the second equation is: SetC=A-B 3. The third set of answers were: Second Native: HUM (enter a 0 in Flip-Flop A) Third Native: HUM (enter a 0 in Flip-Flop B) Since the third Native lied, we want the answer in C to be 0, when A - 0 ondB= 0. So the third equation is oco 4, The fourth set of answers were: (d 2 ache rama le ee © Purely Waa, Second Native: НО (enter a 1 in Flip-Flop задо » “at: Third Nati : HO (enter а 1 in Flip-Flop B) > рани ! 542 Be (oor) Since the Third Native told the truth, we want the answer in C to be 1, when A = 1 and В = 1. So the fourth equation is: SetC= Now, let's bring these four equations together and we're ready to program. 1 ResetC= AB— 2. SCC = KB. s > reports nels reja role ode А ы " „| | З е ЧЧ | d Ще = Notice how the equations lead directly to the program, just as in the previous experiments. In the first one, for instance, A means “put a logic tube on the "T" peg of Flip-Flop A”; B means “put a logic tube on the “Р” peg of Flip-Flop B” in Position 1. EASY, ISN'T IT? The same follows for equations 2, 3 and 4. You might wonder why we picked “and gates” 1, 4, 5 and 6. There is no special reason; you could program on any of the “and gates” as long as “and gates" 2, 4 and 6 are used for setting and 1, 3 and 5 are used for resetting. 2 EXPERIMENT 10 - BINARY COUNTER Binary counters are used in nearly all digital computers and automatic devices. There are many uses for these counters. ‘They may count events or things. For example, a binary counter is used to count tine so а computer will know when it has to do different operations. Binary counters can be used to autometically count candy bars being sent to the grocery store. You have already counted down to “blast off" a space ship. Now see if you can count up from U to 7 in binary. Try writing the count from 000 to 111. To check yourself, use DIG-COMP. Program DIGI-COMP as in the coding sheet. не DIGI-COMP: STEP 1 - Use Front Panel Card I. STEP 2—Make sure clock is out. Enter “0's into all 3 flip-flops. STEP 3 - Cycle the clock slowly a number of times. Look at the ReadOut and watch DIGI-COMP count! To program the Binary Counter, you would start with what is called a Truth Table. Truth Tables or other orderly arrays are always used by Computer Programmers. A Truth Table is just а display of rules that govern а particular problem. For the Binary Counter the Truth Table is just the Binary numbers from 0 to 7 written in order. BINARY NUMBER TRUTH TABLE елам. FueEeA mesa rore |0 |1 |2 | о | 1 |о |о % |1 | о |о |o | з |« | з | в | 7 | о | 1 |с | 1 | с | 1 | о |1 [о % fa fa jo |o |1 | 1 fa | 1 | о Now look at the Truth Table and see when you want to change the setting of each of the Flip-Flops. For example: 2 Flip-Flop А should be changed ftom0to 1 when AO end B= O and C= 0 A Oan B- landC0 A 058d B p88 CII bea B=1ondC1 These word statements can be shortened by writing them in the form of Boolean Algebra. То review the rules for this once more, remember that: 1. А stands for “the A flip-flop in the 0 position"', 2. А stands for “the A flip-flop in the 1 position", 3. Replace the word and by a multiplication sign (=) 4. Replace the word "ог"! by an addition sign (+) Then the four above statements for changing (setting) flip-flop A from 0 to 1 become — set A X BE RK EA B CH A.B.C See, it wasn't so hard! Next, we'll write the statements for resetting Flip-Flop A from 1 to 0. A land B= OandC=0 A=1andB=1andC=0 A-landB-O0sndC-l or A-landB- land C 1 Rewriting these equations in Boolean form as we did before: Reset A=A- B C4 A-B. CH AB CAE To reset B from 1 to 0 A 1 and B= Land C=0 A=1and h en C Writing these equations in Boolean form gives: Reset B A BC 23 ABC Now, we do the same thing for Setting В = 1 and get: SEA E UAB & And similarly: Reset C= B C Set CAB C Now, if we bring these six equations for setting and resetting all of the flip-flops together, we get: ) Reset AA B С+А.В.С+А: H Q) seta R. B.CR G) Reset B- A« CAB B. CA B. CA B 0 E 0 (9 set BA B CA (5) Reset C=A -B-C © SeC-A.B.C These are the six equations that together determine how DIGL-COMP is to be programmed. In these six equations, however, there are fourteen "АМО" functions (count them). But on DIGI-COMP there are only 6 “And Gates”. Fortunately, however, we can reduce these equations by ‘“factoriag’” out common terms in equation (1). (See Page 6.) Roset А=А(#-б+в.б+Н.с+в.с) A[B«B)C«(B«B)C] Ce =a) A Reset A = A Similarly, we find from equation 2, that: Seta =A (i S B CB CB O Set А = А by the same reasoning. 24 Now, let’s look at the B flip-flop — it’s easier. Reset A B CAE G 00 -ASBQ) We're almost done! Let's look at the six equations now. Compare them to the Coding Sheet and you'll see how it all fits together. If you're not absolutely sure how we did it, you'd better go back over he problem again. Remember, when there is no — over the letter, the logic tube goes on the “T” peg of the Flip-Flop, and when there is a — it goes on the “F” peg. А Reset A = xn вовка —.— & 3. Reset B=AВ 4. Set B = A B— 5 —]1 кл6. дн SetC=ABE By ИН Жа М "appe pee]: КЕ | app EA © edf ak а аніс 25 o КУ an]. a ub] dl. 15. EXPERIMENT 8 - "GUESS THE NUMBER” (A Logical Riddle) Here is a logical riddle to test your reasoning powers. Have a friend choose any number between 0 and 7, (0, 1, 2, 3, 4, 5, 6, 7). You are to find the number he chose from his answers to three questions. He will answer Yes ог No to each question. QUESTION 1: Is the number even? QUESTION 2: Is the number 0, 1, 2 or 3? i QUESTION 3: Add 10 (ten) to the number and divide the result by 6; is the remainder 0, 1, 2 or 3? (For example if the number із 5, then 5 + 10 = 15 and 15 divided by б is 2 plus a remainder of 3. The answer to the statement would be Yes. If the number is 7, then 7 + 10 = 17 and 17 divided Бу 6 is 2 plus a remainder of 5. The answer would be No.) Now try it: | STEP 1 — Put Front Panel Card IV in place. STEP 2 — Program DIGI-COMP according to the coding sheet. E thle Ts в € ТУТ uf Te [ele«d 6 IB ul fe STEP 3 - Make sure clock is all the vay out (to the right). STEP 4 — With the Manual Input Tab enter the answers to the three questions into the flip-flop indicated by the Front Panel. Enter a ЧИ if the answer was YES, Enter a “0” if the answer was NO. STEP 5 - Cycle the clock ONCE. The Read-Out will have the number your friend chose in the Binary System. If you played Guess the Number you no doubt tried to beat DIGI-COMP. But unless you're pretty quick, you couldn't keep up. Here is where you will learn a great lesson about computers. Even though DIGI-COMP PROBABLY Guessed the Number much faster than you did, in а few minutes you'll be able to tell DIGI-COMP how to do itl! Let us begin the solution by answering the three questions for each number from 0 to 7, and, again putting them in a Truth Table For instance, for a secret number of 0: 26 і ' QUESTION 1: Yes, it is even. QUESTION 2: Yes, it is less than 4. QUESTION 3: No, the remainder is not less than 4. Now we will fill out the Truth Table for all 8 secret numbers substituting 1 for Yes and 0 for No: SECRET NUMBER TRUTH TABLE imate ГО Flip-Flop А[в[е[а[ вГ с|лГвІс|А|вІсЇл | B]e|a| B|c|A| B|c|a| B]c Answers © 1100110101 (о|зоо |1|:оо ојојо Questions O Secret Number inBinary Form 000100 ALG LOLOL) 110100001111 Now, we will do the same thing we did in the Binary Counter. We look ata particular Flip-Flop and see when it is necessary to change it. First, for Flip-Flop A, we can see from the Table that it is necessary to reset it from 1 to 0 whenever the secret number is 0, 2, 4 or 6, That is, when the answers to he questions are: land В = 1 and C = 0 (Secret No, =0) A = Land B= 1 andC = 1 (Secret Мо =2) A = and B= O andC= 1 (SecretNo,=9) A = 1 andB= 0 andC = 0 (SecretNo.=6) Now, changing this, the same as before, into Boolean Algebraic Equations, gives: ResetA=ABC+ABC+ABC+ABG Again we will factor the equation, pulling out the common factor А. Reset A- A(BC «BC «BC 4 BO) And, just as in the binaty counter, since B and C can have eny value, Reset A = A Next, looking at the Tmth Table, we want to Set A =1, when the secret number is 1, 3, 5 or 7; that is when A = 0 and B = 1 aad C = 0 (Secret No. в A = 0 and B = 1 and C =I (Secret No. 3) 27 A = 0 and В O and C = 1 (Secret No. A = 0 andB = 0 and C = 0 (Secret No. Changing this to Boolean Algebra gives: SetA=ABC+ABC+ABC+ABC Set A(BC«BC«BC« BO) Set » Now, we shall look back et the truth table and see when B is changed from 1 to 0. Reset B= A BC 4 A BÉ (For 0 or1) Reset B= BG(AX) Reset B= ВС Set B (For 6 or 7) Set Next, to find when C changes: Reset C= A BC +A BC (For2 or 3) Reset C =BC (A+ A) Reset C= BC And for the last one — Set C= NAD set 25G To program DIGI-COMP, all we have to do is put logic plugs on the proper pegs, and we've built а machine that can outsmart almost anyone. 28 ‘The six equations are: 1, Reset A=A. 2. Set AA 3. Reset B= C 4. Set B=ВС емее А D 2 E 5 veji reje rejo veje rea = fete s 3 с " [ые m t T You can compare these six equations to the Coding Sheet just as before. 29 ree c EXPERIMENT 12 - BINARY NUMBER COMPARATOR All electronic digital computers have the capability to determine whether two binary numbers are equal ог not equal. On the basis of the answer (whether they are equal ог not equal) the computer can make decisions. It is this ability of the digitel computer to decide what it will do next, based on the comparison of two binary numbers which makes people say the computer “thinks”. The computer does not "think" since someone programmed it for each choice it could make. DIGLCOMP can be programmed to compare two binary numbers and determine if they are ‘equal ог not equal. To perform this experiment, program DIGI-CONP as in the coding sheet. ' 2 a з 5 s To operate DIGI-COMP: STEP 1 — Use Front Panel Card VI. STEP 2 — Make sure clock isout, Move the C flip-flop to "1". STEP 3 - Enter the first bits of the two numbers into flip-flops A and В (see example below). STEP 4 - Cycle the clock. If the two binary bits are equal, С will have a "1" in its ReadOut. If they are not equal, C will have "0" in its Read-Out, Stop when you see the first “0”. Repeat Steps 3 and 4 for the other bits of the two binary numbets. If at any time C is "0", then the two numbers are no! equal. FOR EXAMPLE: compare the two binary numbers A-10110——— enter these bits in A B-11110~<— enter these bits in В and ants thene two bits зы enter these two bits 3rd and so on. 30 You may think this is a very simple minded thing to-do — "all you have to do is look at the numbers, and you will see they are different," But you have forgotten something — computers are only machines — they can't look! To emphasize how powerful this operation is - because a computer can compare, it knows when it has the correct answer, even though it may not know how to get it, This is called an Iterative Process which is used very often in computers. To give you an idea how it works, if you give a computer а group of preset conditions, it will guess an answer and then test it on the conditions. Then it will guess another number which is more correct, and so on till it has the exact answer. То program the Comparator, we must first decide when to "сі the С Flip-Flop. AND WHEN TO RESET We want to SET C when A AND B ore the same, We want to RESET С when A AND В are different. But also we want to keep C = 0 if ANY two bits differ O.K., let's write the equations. We want to reset C if A and B are different, that is: whenA= 1 AND B=0 OR A-0ANDB 1 then, in equation form, this would be: Reset C=AB+AB Also, we want to Set C ifAand B are the same, that is when A =1AND B= 1 OR A=0ANDB=0 ‘Then in equation form, this would be: SetC=AB+AB This is fine for a start, but we've forgotten something, If there is a difference between the two nunbers being compared, we want to Reset C to “0” and LEAVE IT THERE. To satisfy this condition we shall put a logic tube on the T peg of the C Flip-Flop in both positions 1 and 2. Now if the C Flip-Flop is ever ЧО it will remain there, for the duration of the number being compared, because the setting Logic Rods (1 & 2) will be blocked by these two Logic Tubes. Thus the entire equation becomes: SetC=ABC+ABC 31 And the Program follows directly from these two equations. Reset C=AB+AB Set G ABC ABO рев| © «| p ор m З Here, as usual, we arbitrarily chose to program Reset C on Logic Rods 3 & 4. The only thing that matters is that since this isa Reset function, the Clock Rod which is activated by the Double Slider (OR GATE) is ODD (Position 1, 3, or 5). It should be clear now, if not before, where the OR GATE fits into the picture. In this case, the equations could not be simplified to remove the OR from the functions. за EXPERIMENT 13 - BINARY ADDER You have leamed how to add binary numbers in the chapter on e The Language of Computers’’. Now you will see how a digital computer adds two binary numbers. Remember, in addition, there can be а "сапу"! from the previous column. FOREXAMPLE: сапу 11 110 + 011 1001 The adder is a basic unit in all digital computers. Your DIGL-COMP can be programmed to operate as an adder which will work exactly as an adder in large electronic digital computers works. Program DIGI-COMP as in the coding sheet, ^ «| | = ГЕ 4l d lle То operate DIGI-COMP: STEP 1 - Use Front Panel Card VII. STEP 2— Make sure clock is out. Manually enter the first two binary bits to be added into the A and B flip-flops (see example). Make sure the С flip-flop is "ОМ, STEP 3 - Cycle the clock ONCE. A will remember the sum and C will remember the carry. STEP 4 - Copy the Read-Out of A onto a sheet of paper. This is the first bit of your answer. STEP 5 — Enter the second bit of the two numbers onto A and B.DO NOT TOUCH C (C remembers the сапу from the previous step). STEP 6 — Cycle the clock ONCE. Repeat Steps 4, 5 and 6 until you have added the two numbers. Remember to copy the carry after the last operation. EJ To program the Binary Adder: First make the usual Truth Table with all possible values for A, B and C (the carry). Add them up and see what should go into the А and C FlipFlops when DIGI-COMP is clocked. A plus B plus C = Ans. plus Carry O plus O plus 0=0plus O plus Oplus 1=1 phs O plus1 plusO= 1 plus 1 plus 0 plus 0=1pls 1 plus Oplus 1=0plus 1 plus 1 plus O=0pls Oplus 1 plus 1 0 pes 1plus 1 plus 1=1plus 0 0 0 0 1 1 1 1 Now, look at the answer column and see when the A plane should be Set to 1. You want to Set А when the answer is 1, or when: A= O'and В =0 and C A=0andB=landC=0 A= end B= andC= or A= 1 and R= 1 and C or putting this into Boolean Algebra: set AK. B. CAB. CAB CAB C To reduce this equation we shall use a new “trick” which is simple but not obvious. If you look at the last two tems in the equation (А. В.C + A. B C) the value of "А" ів 1, therefore since the A Flip-Flop must be in the 1 position for these to be activated there is no use in setting it to 1, and the equation reduces to: Set A e KB C «X B. C (which is programmed on the first two And Gates.) Similarly, if you do the work yourself, and you should be able to, you will find that: Reset A - A B. CA set C A Reset CN B. 34 B C If you have trouble, see Page 48 for the complete solution. Thus, the four equations are: (DSetAA E (2) Reset A A A.B. B. CA. B.C. @)SetC=A-B 0 Reset C =A- B ‘The Coding Sheet follows directly from these equations, Equation (2) Equation (1) Equation (4) Equation (3) EJ EXPERIMENT 14 - BINARY SUBTRACTOR Binary subtraction is as simple as binary addition. The rules for binary subtraction are: RULE 1: 1RULE2:1-0 RULE 3: 0 - 1=1 а "1" borrow. RULE 4: 0-0-0 RULE 5: 1- 1 and а "1" borrow = 1 with а “1” borrow, RULE 6: 1 - 0 and а “1” borrow = RULE 7; 0 - land a "1" borrow = O with а "1" borrow. RULE 8: 0 - 0 and a "17 borrow with