UNIVERSITY OF ILLINOIS LIBRARY AT URBANA-CHAMPAIG.N Mow v efore «» taS*K bo "-°wJd ffs? J ^en renewing by nhrvn. • L162 MocWv UIUCDCS-R-79-979 UILU-ENG 79 1728 A MANUAL OF SIMPL A LOGIC NETWORK SIMULATOR FOR PLATO by Sadahiro Isoda Elyas Farzan-Kashani July 1979 A MANUAL OF SIMPL A LOGIC NETWORK SIMULATOR FOR PLATO BY SADAHIRO ISODA ELYAS FARZAN-KASHANI DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF ILLINOIS AT URB ANA-CHAMPAIGN URBANA, ILLINOIS 61801 July 1979 Digitized by the Internet Archive in 2013 http://archive.org/details/manualofsimpllog979isod Introduction This is a user's manual of SIMPL, a logic network simulator for PLATO. SIMPL is a program which can interactively simulate logic networks, based on the computer-based education system, PLATO. SIMPL has the following facilities: i) Constructing any network consisting of gates (AND, OR, NOT, NAND, NOR, or XOR) and input terminals, ii) Supplying input value sequences to input terminals, iii) Assigning initial values to gates, iv) Showing timing charts for specified gates and input terminals. SIMPL is quite easy to use even for a novice, because the user, following messages from SIMPL, can use it almost by means of touching the screen. Screen Figure 1 shows what the screen looks like initially. The screen consists of the following four parts: i) an array of 15 commands at the top, ii) a message area, iii) a two-dimensional array of locations for gates or input terminals, and iv) a blank space to be used for displaying timing charts at the bottom. -1- and or not ► nanc nor ■xor » inpt cnct gat« cnct dis n P t P at€ thouier val inti val as chrtchrt re frsVi bcrn Ulhich command ? 11 12 13 14 15 16 17 21 22 23 24 25 26 27 31 32 33 34 35 36 37 41 42 43 44 45 46 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 Fig. 1 The initial screen -2- How to place gates In order to place a gate at a particular location, the user first touches one of the six commands on the left half of the command array. For example, he touches the command "and". Then SIMPL writes the message ""and" at which location?" just under the array of commands. The user touches the location where he wants to place the AND gate, and then an AND gate appears there. If the user wants to place another gate of the same type (namely an AND gate) at any other location, he does not have to touch the command "and" again. He has only to touch the location where he wants to place a gate. If he wants to place a gate of a different type from the one just placed, he has to touch the corresponding command before touching a location . How to place input terminals The user follows the same procedure as for placing gates, with the difference that he touches the command "inpt" (input). How to place connections In order to connect gates (or an Input terminal and a gate) , the user first touches the command "cnct" (connect). Then SIMPL displays the message "Connect from which gate or input?". The user then touches the origin (i.e., the gate or input terminal from which he wants a connection to be drawn), and SIMPL makes the gate or input terminal blink and displays the next message "From gate xx to which gate?". The user then touches the destination (i.e., the gate to which he wants a connection to be drawn) , and SIMPL draws a connection. If he wants to place another connection, he does not have to touch the -3- command cnct . He has only to touch the origin and destination. How to supply input value sequences to input terminals The user touches the command "inpt-val-seq" (input value sequence) , and then the message "Which input?" appears. He touches the input terminal to which he wants to supply an input value sequence. The message "Press 0, l,z(constant 0) or u(constant 1)." appears, and a time axis for a timing chart also appears at the bottom of the screen. If he wants to supply the sequence "0110001100011...", he presses the "0" and "1" keys in this order. Every time he presses "0" or "1", a corresponding line segment which is part of the entire timing chart is drawn on the time axis. He has to specify an input sequence 27 bits long, "z" and "u" are for level input i.e., if an input terminal takes a constant value of "0" or "1", the user has only to press "z" or "u" only once, respectively, instead of pressing "0" or "1" 27 times. The user can also press "z" or "u" after pressing "0" or "1" any number of times. If he wants to supply another input value sequence to any input terminal, he does not have to touch the command "inpt-val-seq" again. He has only to touch the input terminal to which he wants to supply an input value sequence, and then press "0", "1", "z", or "u" keys. How to assign initial values to gates If the user wants to analyze a sequential network, he has to assign initial values to gates. First the user touches the command "gate-intl-val" (gate initial value), and then the message "Touch gates for initial value 1." appears. Then he touches those gates to which he wants to assign an initial -4- value of "1". The gates left untouched are given an Initial value of "0". Hov to show timing charts Now the user is ready to show timing charts of the network he has just constructd. He touches the command "show-chrt" (show chart). Then the message "Which gate or input?" appears. He touches a gate or an input terminal, and then a timing chart appears at the bottom of the screen. At most six timing charts can be shown on the screen at a time. They are arranged in a two-dimensional array with three rows and two columns, as illustrated in Fig. 11. The first chart is shown in the first row of the left column, the second in the second row of the left column, and so on. When the seventh chart is to be displayed, the first one is erased and replaced by the seventh one. Example If you are to analyze how a flip-flop network (Fig. 2a) performs when the J and K inputs are kept at "1" and the clock pulse duration is two or three (Fig. 2b), do the following: 1. Sign-on and start "SIMPL". The initial screen appears (Fig. 1). 2. Touch the command "nand", and then locations 23, 43, 25, and 45. 3. Touch the command "inpt", and then location 31 (Fig. 3). (The input terminal just placed is for the clock input. Any other input terminals need not be created, since J and K inputs are kept at "1" and only NAND gates are used.) 4. Touch the command "cnct", and then locations 31 and 23. A connection is now drawn between these two locations (Fig. 4). -5- 5. Draw other connections by touching appropriate locations (Fig. 5). 6. Touch the command "inpt-val-seq", and then location 31. A time axis appears at the bottom of the screen (Fig. 6). 7. Press the clock pulse sequence "0110001100011...", to analyze the case when the clock pulse duration is two. A timing chart for the input terminal is now drawn (Fig. 7). 8. Touch the command "gate-intl-val" , and then locations 23, 43, and 25. 9. Touch the command "show-chrt", and wait for a while. The message "Now calculating." is shown (Fig. 8). 10. When the calculation is finished, the message "Which gate or input?" appears. Touch locations 25 and then 45. Now two timing charts appear next to the one for the input terminal (Fig. 9). 11. Next, analyze the case when the clock pulse duration is three. Touch the command "inpt-val-seq", and then location 31. Then press "0111000111000111..." (Fig. 10). 12. Touch the command "show-chrt", and then locations 25 and 45 (Fig. 11). We now have a set of timing charts showing oscillation. 13. We can conclude that the performance of the network with J=K=1 is stable when the clock pulse duration is two but becomes unstable when the clock pulse duration is three. -6- Fig. 2a A J-K flip-flop Clock Fig. 2b Clock pulse sequences duration: 2 duration: 3 i i i i -7- and or not nanc nor xor >] inpt jat< cnct dis cnct ^^shouer val seq inti val as| chrt chrt re frsH scrn "inpf at which location? 11 12 13 14 15 16 17 21 22 24 26 27 32 33 34 35 36 37 41 42 44 46 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 Fig. 3 After placing four NANP gates and an input terminal -8- and or not ► nanc nor xor )] inpt cnct jat« cnct dis ^^•^hojeras val SSL intl val cnrx cnrx re frsh 5crn Connect from which gate or input ? 11 12 13 14 15 16 17 21 22 24 26 27 32 33 34 35 36 37 41 42 44 46 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 Fig. 4 After drawing the connection from the input terminal at location 31 to the NAND gate at location 23 -9- nptftat«L intl and or TX>t ► •xor )] inpt rmv cnct jat« enct dis val seq val how eras chrt chrt re frsli scm Connect from which gate or input ? 11 12 13 M 15 16 17 21 22 41 42 A 24 ^ 44 m 32 33 34 35 26 27 36 37 46 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 Fig. 5 After drawing all the necessary connections -10- and or not ► nanc nor xor » inpt {ate cnct dis cnct in P^ at€ Whoufcr val 222 intl val AS cnr*t chrt re frsh 5CTTI Press B, 1,2 (constant V) or u (constant 1) .> 11 12 13 14 15 16 17 21 22 41 42 ft ^ 24 44 A 32 33 34 35 26 27 36 37 46 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 131 |_ Fig. 6 After touching the command "inpt-val-seq" , and then the input terminal at location 31. (A time axis i31 is now drawn.) -11- and or not $ ► xor )] inpt jat« cnct dis cnct i nptftat^T val 2S2 inti val how eras cVift cnr~t re frsr, 5CTT1 lib i ch i nput ? 11 12 13 14 15 16 17 21 22 & 24 41 42 ^ 44 A 32 33 34 35 26 27 36 37 46 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 3iin n n n n r Fig. 7 After pressing "0110001100011...". (The timing chart for the clock is now drawn.) -12- intl and or not ► nanc nor •xor inpt rmv {ate cnct dii cnct inpi val *sa val thou eras cHrt cnrt re frsH scm Now calculating. 11 12 13 M 15 16 17 21 22 A 24 41 42 ^ 44 A 32 33 34 35 26 27 36 37 46 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 -3i n n n n n.r Fig. 8 After touching the command "show-chrt" -13- nptftateE inti and or TX>t nanc nor ■xor » inpt gat« cnct dis Cnct val seq val how eras chrt chrt r« fr»H 5CTT1 Which gate or input? 11 12 13 14 15 16 17 21 22 41 42 A ^ 24 44 A 32 33 34 35 26 27 36 37 46 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 i3iin r-j n n n r g25l I- I I ■ , , I. ■ , ■ ■ 1 — g*5 1 I ■ - I 1 I I Fig. 9 After touching the gates at locations 25 and 45. (Two timing charts, g25 and g45 appear next to the chart 131.) -14- and or not ► nanc nor xor » inpt jat« cnct dis cnct ^^^hoZEra^ val 2sa m intl val chrt cnrt re frsh scrn Wh i ch i nput ? 11 12 13 14 15 16 17 21 22 41 42 ft 32 33 ^ 24 44 M 34 35 26 36 46 27 37 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 i3iin n n n n r i3iin m r~ i r~ i r gzsl 1 i i i i *«5 I I I I » I Fig. 10 After touching the command "inpt-val-seq" again, and then pressing "0111000111000111...". (A timing chart for the new clock pulse appears.) -15- and or not nanc nor xor >] inpt gate enct dis enct ^*™ shower val seq inti val chrt enrt re frsH 5crr Uhich gate or input? 11 12 13 14 15 16 17 21 41 22 32 42 A 33 1 6n 24 34 44 A 35 26 36 46 27 37 47 51 52 53 54 55 56 57 61 62 63 64 65 66 67 i3iin n rn n n r j 3 iii— i r~ i m i— i r- j25i — i i 1 i 1_ g25 m .nnjinnnnnn.nn. ««* i_ rm i i i g*5 1 nnnn nnnnnnn Fig. 11 After touching the command "show-chrt", and then the two gates at locations 25 and 45. (We now know the outputs of the flip-flop oscillate when the clock pulse duration is three.) -16- Other commands SIMPL also has two other commands which are not explained in the above text. They are the command "eras-chrt" (erase charts) for erasing all the timing charts shown on the screen, and the command "re-f rsh-scrn" (refresh screen) for erasing the whole screen and displaying the initial screen again. Limitations i) There can be at most 42 gates or input terminals on the screen, ii) The maximum number of input connections to a gate, i.e., the fan-in, is six. Note The user must not forget to assign initial values to gates when he deals with sequential networks. If he forgets to assign an initial value of "1" to gate 25 in step 8 of the example, he will get an oscillatory result. -17- APPENDIX A Program Description This is a brief description of the internal structure of the program, SIMPL. It describes the dynamic structure of the program, outlines the module structure, and discusses about the usage of the student variables. This is only an introduction to the internal structure of the program. For further information, read the program listing in APPENDEX B. -18- State transition diagram The dynamic structure of SIMPL Is described by the state transition diagram in Figure A.l. In this figure each round node represents a stable state in which SIMPL writes a message (shown inside the node) on the screen and then waits for inputs from the user. Each square node represents a transitory state in which SIMPL does the action (shown inside the node) . -19- ***! Assign initial value "1" ^ *T location Touch the gates for initial .value "1" Which input? Display a timing chart ~K IF ** location Which gate o input? ~K Which command cnct ± Connect from which gate? Press 0,1, z, or u 0,1, z,u Erase charts Start ±- Initialize screen nand,nor, xor,inpt At which location? location Place a gate or an input terminal location Draw a connection location .\L Draw a timing chart From gate xx to .which gate? * When a command is fed, the control is transfered directly to the state corresponding to the command. ** When the timing chart is not completed. *** When the timing chart is completed. Fig. A.l State Transition Diagram -20- Module structure The program consists of a main routine ("main"), six major subroutines ("gates", "connect", "inpvseq", "gtinitl", "calcul", and "chart"), and some low-level subroutines (Fig. A. 2). -21- main gates connect inpvseq upper lower flash gtinitl calcul chart setinp axes plot select f indpth f indinp drawl Fig. A. 2 Module Structure -22- Usage of student variables In the PLATO system each program can use at most 150 student variables namely nl through nl50. Student variables are the only resource that can be used as working storage in each program. When we develop a large program, 150 student variables may not be sufficient and we may have to use some of them for more than two purposes. The necessity of multiple use of student variables may make the use of modular structure difficult, but we can overcome this problem by observing these two rules: i) Variables that are local to a subroutine are defined in it, thus localizing such variables, ii) The lowest-level subroutines use the student variables nl through nlO, the second lowest-level subroutines use nil through n20, and so on. n31 through nl50 are used as global variables. Future developments The following functions are to be added to SIMPL: i) to remove gates, input terminals or connections. (This function will be convenient when the user wants to erase part of a network drawn on the screen.) ii) to store network structure information in a file, or to retrieve it from the file. (This function will be convenient when large networks are to be simulated more than once.) -23- APPENDIX B Program Listing -24- 1 CMAhTST »oATES F NOT(ZRETUWN) AT 1215 WHITE +L0ADING CHARACTERS, PLEASE BE PATIENT CHAkSET tbATES Af 1215 EHASE 40 imUIF EFINt ARRAYtALL(lsO)«Nl 2 i 5 6 7 fl 9 lu 11 12 DEFINE ARRAY f NTwi\(42)«Nto7 SS N€7 TO NIOi 13 ARRAYSEbV,TYPEU2)*N6'tl»4 1* 1 -AND »2»0Ri 3-NOT ,4-NAND*5»N0R .6«E0R U * BITS 5.6 ARE EMPTY 15 A9RAYSEGV,GINPT(42)BNb7,7t36 16 AHRAYSEGV,F (42)«w67»43»l6 17 4 BIT 60 IS EMPTY 18 % 19 ARRAY, GATE(42)=Nl09 4$ iM09 TO N150 2 j % 21 SLGMENT»LASTV=N4ltl 44 LASTV(I) MEANS THE LAST 22 <> VALUE PLOTTED FOR I-TH GRARh 23 t 2h S_GMENT»0RG|_STXsi\42,1Q 5$ 18 ELEMENTS! 3 WORDS 25 ScGMENT»ORGlSTY=N45,10 44 LOCATION OF ORIGINS OF CHARTS 20 % N42 TO N47 27 L 2d T0UCHXsN48 44 aZTOUCH*. ZTCUCHX/Y ARE COPIED TO TOUCHX/Y 29 E I.M ORDER TO ADJUST THE DIFFERENCE BETWEEN TOUCH-INPUT AND KEY-INPUT 30 TGUCHY=N49 $$ =ZTOUCHY 31 TJUCHVaN50 44 RtGlON NUMdEF OF TOUCH INPUT 32 * 33 CHARTN=N5l 44 CURRENT CHART NUMBER 34 * 35 C,iMDCHFsN53 *j COMMAND CHANGE FLAG, tTHIS IS 1 36 i WHEN COMMAND IS TOUCHED WHILE PROCESSING OTHER COMMAND. 37 1 33 K£YINPT«N54 Si KEYINPTsl MEANS KEY-INPUT 39 J 4J Sr.GMENTF»TEMP0 = N57,lf 16 44 TEMPLATE TO ACCESS tiF*t 41 SEGMENTf TtMPF»N5/f 1 4£ StGMENTP *TEMPG=N5b,i,36 $4 TEMPLATE TO ACCESS ♦»GlNPT't't 43 SrGMENTtTEMP=N58*fa 44 J 45 R = N59 44 RO« NUMbER OF LOCATION 46 I THE RESULT OF TOUCH INPUT IS STORED IN *»Rtt 47 CsN60 $4 COLUMN NUMBER OF LOCATION 48 RC=N61 Si SEQUENCE NUMbER OF LOCATION 49 $ 50 I CONSTANTS 51 DtFINE MAXb=42 52 INPC0DE=7 53 MAXFAN=6 -25- 54 DcLAYsl S$ DELAY TIME FOR WE GATE. NOW CONSTANT, 55 MAXD=6 4i MAXIMUM NUMBER OF CHARTS TO BE DISPLAYED 56 » 57 MSWHERE=405 i$ START LOCATION OF MESSAGE 58 * LINES 4 AND b ARE USED FOR .MESSAGES. 59 MSLNGTH=60 Sk MESSAGE MAXIMUM LENGTH 60 $ 61 H£IGHT=12 i$ HEIGHT OF GRAR> 62 MAXT=27 *$ LENGTH OF CHART 63 TAU=8 %% UNIT LENGTH OF TliKE AXIS b<* % MAJOR CHANGE. SUPPRESS KEY-iNPUT FACILITY. BUT IT COMES 65 i INTO EFFECT ONLY BY TOGGLING LIKES FROM •♦♦,..# TO 66 % ===...= DOWN BELOW. 6 7 UNIT MAING 68 BACrvl vlAlNo 69 ElKmSE 7q DO SCREEN 7i CALC ALLr»U ** CLEARS ALL THE STCCENT VARIABLES 72 CA L C CHARTNrW SS INITIALISE CURRENT CHART NUMBER 73 CALC C.viMDCHFr»0 $* INITIALIZE COMMAND CHANGE FLAG 74 CALL ORGLSTXUMORGLSTX^^ORGLSTX (3)«*0 75 CA L C O3GL.STXU)r»ORGLSTX(5)r»0RGLSTX (6)r»256 76 CALL 0RGLSTY(l)r»0RGLSlY(4)r»32 77 CALL ORGLSTY (2)r»0RbLSTY(5)r»l6 78 CALL ORGLSTY(3)r»OHGLSTY(6)r»0 79 I 80 CALL KEYINPTrfO 82 »D0 PPPMSG 83 »WRITE tPRESS *iK*» IF KEY INpUT t OTHERWISE PRESS *N*E*XtT. 84 *aruow *HERE*2 b5 *LONG 1 8b »SPECS .NJOOKNO 87 ^ANSWER K 88 »CALC KEYlNPTr»l 89 *OK 90 »CALL r\EYlNPTr»u 91 »ENUARROW 92 4 ========== 93 30TU MAIN 9^ I 95 UNIT MAIN 96 inhibit erase 97 BAClU MAINO 98 SACK MAIN 99 IF CMMDCHF=1 $* COMMAND CHANGE FLAG IS 1 WHEN 100 J COMMAND IS TOUCHtD WHILE PROCESSING OTHER COMMANDS. 101 . CALC CMMDCHFr.0 102 . BRANCH 1LMMDCH 103 END1F 104 lUMAlN 105 DO PRpMSG 106 *RITE taHlCH COMMAND f/ 107 DO GtTCMLN 106 lLi'iMUCH 109 IF TOUCHV-<7 110 . DO GATES 111 ELSEIF T0UCHV=8 112 . DO PRPmSG 113 . WRITE tSORRY, t, REMOVE GATEt, IS NOT IMPLEMENTED, 114 . PAUSE 2 115 ELSEIF T0UCHv=9 llo . DO CONNECT 117 ELSLIF TOUCHV=10 lid . DO PRPMSG 119 • WRITE *SORRY, + .DISCONNECT* t IS NOT IMPLEMENTED. 120 . PAUSE 2 121 ELSEIF TOUCMV=ll ii INPUT VALUE SECUENCE FOR INPUT TERMINALS 122 . DO InPVSEQ 123 fLSEIF 10UCHV=12 ii SET GATE INITIAL VALUE 12* . DO GTINITL 12b ELSEIF T>JUCHV = 13 126 . DO CALCUL 127 . DO Chart 12fc? ELStIF T0UCHV=14 Si ERASE C h AwTS 12V . AT 0,32 130 . ERASE 64,3 131 . CALC ChARTNr»l 132 ELSEIF T0UCHV=15 $S REFRESH SCREEN 133 . JJMP MAINO 134 ENUIF 135 BRANCH 1UMAIN 13b fj-^i* 137 UNIT MAINENU 138 UNIT SCREEN SS LEVEL 1 139 S SETS UP INITIAL SCREEN 140 DEFINE SCRI=N1 141 SCRR=N2 142 SCRC=N3 143 DEFINE UNT=32 144 RORIG1N C»464 145 RBOX C,0ibilf47i-2 146 OUTO lBOXEND»SCRIr»l»lb 147 PDRmW UNT#SCRlt47»UNT#SCKIfO 14H IrtOXtNU 149 » 150 RAT 7,12 151 WRITE >AND 152 RmT UNT*6»12 153 wRIIE >0 + RR 154 RAT 2JNT*10»12 155 WRITE >1P -27- m A 3JNT*b»12 *R ITE >AN1 WA 4JNT*6»12 *r< [TE >OtRQ RA 5UNT*t>il2 A H LTh >234 wA 6UNT*S»t 12 *ik lit >9C ■i* wA' 4.2b i'j R lit A.vjD RA U-MT*8,2B H H LlL CR ;AND>»i0tRR> f >IP>»>ANli,>0tRQ>,>234>t>BC 1UGATE 260 UNIT CONNECT $S LEVEL 3 261 DEFINE R0=N2l SS ROW NUMBER OF ORIGINATING GATE 262 C0=N22 i$ COLUMN NUMBER OK 'ORIGINATING GATE 263 PC0= r >'23 $S> SEQUENCE NUMBER CF ORIGINATING GATE -29- 264 265 266 267 268 269 270 271 272 273 274 275 276 277 276 279 280 281 282 263 264 285 26b 287 268 269 290 291 292 293 294 295 29b 297 296 299 3C0 301 302 303 304 305 306 3C7 306 309 310 311 312 313 314 315 316 317 316 319 320 DEFINE. QUCON DO aRITE. DO IF EMDIF CALL CALC CA L C CALC CALC 1UCUN DO WRITE aRITEC WRITE DO DO IF ENDIF CALC IF ENDIF 2UCON IF $ i ZTX=N24 S$ X-COOHDINATE OF CPIGINATING GATE ZTY«N25 $$ Y HPATHN«N28 SS HORIZONTAL PATH NUMBER 1NPUTN«N27 SS INPUT LINE NUMBER FOR TARGET GATE PRPMSG tCONNECT FROM WHICH GATE OR INPUT */ GETLCTN TYPE(RC)=0 DO PRPMSG WRITE tTHERE IS NO GATE THERE ♦. PAUSE 2 BRANCH 0UCON ZTXr*TOUCHX ZTYr^TOUCHY R0r»R C0r»C PCO^RC PRPMSb tFROM TYPE(RC0)-7» GATEf INPUT -•OSfRO-'l-.OStCO-.l TO *HICH OTE ♦/ FLASH(R0,C0,TYPE(RC0)) SS FLASH THE SOURCE GATE GETLCTN 1YPE(RC>=0 $OR$ TYPE(RC)>6 DO PRPMSo aRITE tTHERE IS NO ^?ATE TiFERE t. FAUSE 2 BRANCH 1UCON TEMPGr»GlNPT(RC) ( TEMP ( 1 ) =RC0 ) SORS ( TEMP < 2) »RCC ) SORS ( TEMP (3) ««C0 ) SORS ( TEMP ( 4) «RCQ > SORS «RC0> SORS ( TEMP (*>«*C0) DO PRPMSG WRITE *THIS CONNECTION HAS ALREADY BEEN DRAWN*. FAUSE 2 BRANCH OUCON F>RC SELEC THREE DO IF SS ORIGINATING GATE IS UPPER THAN DESTINATION T A PAIR OF INPUT AND F*TH FROM THE UPPER INPUTS AND THE OPpER EIGHT PATHS UPP£.R(INPUTN»HPATHN) $$ FIRST PRIORITY HPATHN=-1 SELECT A PAIR OF INPLT AND PATH FROM THE LOWER THREE INPuTS AND EIGHT PATHS DO IF ENDIF LOWER ( INPUTS tHPATHN) hPATHN*-! DO PRPMSG WRITE *NO AVAILABLE PAUSE 2 BRANCH OUCON SS SECOND PRIORITY INPUT OR PATH, ENDIF ELSE -30- 321 322 323 324 325 32b 327 328 329 330 331 332 333 334 335 33b 337 338 339 3*0 3*1 ORIGINATING DO IF GATE IS LOWER LOWER(lNPUTNtHPATHN) HPATHN»-1 ENDIF DO IF t ENOIF UPPER (iNPUTNtHPATHN) hpATHN«-x UO PRRHSG WRITE *NO AVAILABLE PAUSE 2 BRANCH OUCON INPUT OR PATH. ENDXF t RECORD THE SELECTED INPUT CALC TEMPGr*GlNPT(RC) CALC TtMP(lNPUTN)r^RCO CALC GlNPT(RC)f»TEMPG $ RECORD THE SELECTED PATH DO RCRDPTH(HPATHN) S DKAk CONNECTION DO DRAWCNN BRANCH OUCON LINE. 342 3*3 3«+4 34b 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 36b 369 370 UNIT LOWER(IMPUTNthPATHN) *S LEVEL 2 S FINDS AN INPUT LINE OUT OF THE UPFER THREE $ A HORIZONTAL PATH OUT OF THE UPPEF EIGHT. DO FINDPTH(I.HPATHN) DO PlNDlNPdtlNPUTN) IF HPATHn=-1 $OR$ INPUTN=-1 CALC lNPUTNr>-l CALC HPATHNr»-i AND END1F UNIT DO DO IF ENDIF OPPER(INPUTN»MPATHN) *$ LEVEL 2 F INDPTH(9,HPATHN) FINUINP(4,INPUTN) lNPUTNs-1 $ORi HPATHN S -1 CALC INPUTNr*-l CALC HPATHNS-1 UNIT FINDINP(N1, INPUTN) $* LEVEL 1 $ FIND AN AVAILABLE INPUT TO GATE(RC) i FROM THE LOWER THRcE WHEN ttLCFUt* IS % FROM THE UPPER THREE WHEN ttLCFUti IS DEFINE L0RU=N1 $$ 1 OR 4, 1 MEANS LOWERt CALC TEMPGr»GlNPT(RC) IF TEMP(LORU)=0 . CALC INPUTN^LURU ELSEIF TEMP(LORU*1)=0 CALC INPUTNr»LURU*l ELSEIF TEMP(LORU*2)xO MEANS UPPER. -31- 37 1 . CALC lNPuTNr»LUKU*2 21e>. FlSl 373 . CALC INPUTN*-! 374 END IK 375 i jtiiiS&l* 37b UNI1 FlNiUPTH(NltHPATHN) ** LEVEL 1 37 7 DlFXNl STaRK = N1 378 f F'INu AN AVAILABLE PATH bET*c.LN COLLMN-C AND COLUMN-CO j7^ f> STAR1C=1 OR 9. 1 MEANS LO*ER, 9 iNEANS UPPER, 3Ml DEF IML FPPC s N2tFPRCl=N3tFPHC2 a N4 3F1 hPATHX=Nb 3fc^ IF ClPUi»F(FPRC) 3>hd If 1EMPF (hPATHX) -=o j c 3 . t^ArgCH IFPNb j9<+ ENOIF 3 c b 2FPLOUP JVC CALL i-PATHt^hp^THX 397 URAuCh 1FPOUT 3^0 jFPi.o j99 lrPLUOH hi,u Call hPATHNi»-l 401 IFPlUI <♦ f / £ !":•> » -Ms * li i) i } j> 4GJ UNIT rCROPTH(MPATHN) 4C4 % SLTb tfiPAThNt f -Th BIT OF FS$$$S 443 U.JIT FLASH(NliN2tN3) $$ LEVEL 1 444 DEFINE FLR«NltFLC=N2tFLX=N3 445 MODE ERASE 446 AT 64FLC-27i464-64FLR-8 447 WRITEC FLX, i • >AND>, >0*RR>f >IP*i *AN1> •>0tRQ^ f >234i t >BC 448 MODE WRITE 449 AT 64FLC-27»464-64FLR-8 45u WRITEC FLX»»tiANDJt>0tRR> f >lP^ f >ANl>t>0tRQ>f>234i t iBC 451 MODE ERASE 452 AT 64FLC-27i464-64FLR-8 453 WRITEC FLX,t.>ANDi»>0*RR>,>lP*.>ANl>t>0*RQfct*234fc t >BC 454 MODE WRITE 455 AT 64FLC-27i464-64FLR-8 456 WRITtC FLXt »t>AND*i£0tRR>,>lPS t *ANl>i>0tRQfct*234>,>BC 457 UNIT 458 DEFINfc. 459 460 461 DO 462 WRITE 463 S CL 464 DOTO 465 IF 466 • 467 ENDIF 468 9END 469 DOTO 470 DOTO 471 IF CALCUL *$ LEVEL 1 ANO 2 ARRAY, GINPTL(6)«N11 SS Nil TO N16. 6-MAXFAN IT»Nl,I6«N2f II»N3iCGINHTW«N4tCTYPE»N5iRESULT«N6 SEGMENT iCGINPT«N4i 6 PRPMSG tNOW CALCULATING* CLEARS GATE EXCEPT THE FIRST BIT AND EXCEPT INPUT TERMINALS 9ENDf IIr*l?MAXG TYPE(II)-«>1 SAND* TYPE(II)-*1 $ANDi TYPE(RC)-*<7 CALC VARGTNr»RC DO PRPmSG WRITE tTHERE IS NO C (CONSTANT 1). 577 OOTU lENDtSVWtMAXT 578 lwRNGv 579 AHROw NSWHERE+41 560 LONG 1 561 SPECS IVOOKNO 562 ANSWER C 563 CALC VARVr»b 56^ ANSWER 1 565 CALC VAPVr^l 566 ANSwER I 5t7 CALC VARVr»2 568 ANSwF.R 569 CALL VARVr»3 590 OK 591 CALL VARVr»-l 592 ENPAKROw 593 AT NiSwHERE*43 594 ERmSL 1 595 IF VARV<0 596 • BRANCH 1WRNGV 597 ELSEIF \»ARV-*<1 59a . LO SETvAL 59s> ELSL 6C0 • CALC VARVr»VARV-2 601 . LQTO 2ENU»SVlf»SVltMAxT 6C2 . HO SETVAL 603 . 2ENU 604 . tRANCH 9ENU 605 ENDIF 606 1END 6C7 9LNU 6C8 DO 1NCCHRT iS INCREASE CHaRTN EY ONE 6C9 HRANCH 1AGAIN 610 i 611 UNIT SETVAL $3> LEVEL 2 612 CALC GATE(RC)r»GATE(RC) SUNlONS (VARV $CLS$ 60-SVI) 613 DO DRAwl (VARVtSVI) 614 SiSiiaiiSS 615 UNIT GTINITL 3>$ LEVEL 2 616 $ SlTS INITIAL VALUES OF GATES 617 DEFINE SI I=NH 61b DOTu 2END»SIIr»i,MAXG 619 IF 1YPE(SII)->1 $ANU$ TYPE (SI I ).-<6 620 . CALC GATE(SII)r»0 621 END IF 622 3ENL- 623 ONEAT 624 DO FRPMSG 625 WRITE ''TOUCH OATES WITH INITIAL VALUE 1« 626 INEaT 627 DO CETLCTN 626 IF 1YPE(RC)=0 S»OR3> TYPE(RC)->7 -36- 029 • l-U PKPnbb 630 • VRITE tTHAT lb NOT A GATE, G31 • PAUSE 2 632 • BRANCH OnEXT o?3 END IF 634 CALL GATE(RC)r»01 JCLS* 59 635 AT MSWHERE*35 636 EKAbE 30-(MSwhERE-lNT(MSWHEHE/100)*lOO) 63 7 Af MStoHERE+35 638 WHITE C-.OSfR-»l-«OStC-»l OK 63V BRANCH 1NEXT 64u 1SETEND 64 1 * fciis 642 UNIT AXES(N2»N3»N4) *$ LEVtL 1 643 DEFINt AXI0N=N2»L0CX=N3»L0CY=N4 6^4 DEFINE AXI=NbtAXR0rt=N6tAXC0L=N7 645 4 646 * AXIbN t? LOCATION OF INETWORK, INPUT VARIABLE OR GATE 047 I LOCXiLOCY t| LOCATION IN FINE GRID 646 $ HEIGHT AND TAU AHE DEFINED IN THE MAIN UNIT 649 R0RIG1N LOCX»LOCY 650 RAT C»0 651 ERAbE 32 652 R«T Cfl 653 CaLL AXR0Wi»INT((aXIGN-1)/7)*1 654 CALC AXCOLr»AXlGN-AXRO"*7*7 655 IF TYPE (AXlGN)-.> 667 UNIT L'RAwl (N2»N3) i$ LEVEL. 1 666 $ CHARTN SPECIFIES THE CURRENT NUKEER OF THE CHART. 669 DEFINt DRV=N2 $i VALUE 10 BE PLOTTED 670 CRT*N3 JS TIME SEGMENT ( DPT-1 LASTV IS DEFINED IN THE MAI* UNIT 674 CALC DRXr»TAU* IDRT-l) 675 CALL DRYr»HEIGHT*DRV 676 IF DRV ■»« LASTV (CHARTN) iANDS CFT «•■ 1 677 • RuRAW DhXtHEIGhT-DRYlDHXt-CPYlSKIPiDRX+ltHEIGHT-DRYlORX^ltORY 676 ENDIF 679 RDPAW DRX,DRY;DRX*TAU t DRY|SKlp;OR)ltORY*l|DRX*TAUfDRY*l -37- 680 CALC LAS1V (ChARTN)r»DRV bfc 1 *3>^it>iS)iJS 6fc2 UNIT FRPMSO 663 m1 K5WHERE 684 ERASE hSLNOTh»2 66$ AT KSWHERE 68b Saiifc 687 UNIT FKPMS62 686 Al KSI«HERE*100 689 ERA^c I^SLNGTH 69u Al l«.SwriERE*100 691 Sit^J* 692 UNIT l.MCCHRT ±$ INCREASE CHART TIMBER BY ONE b93 CALL CHARTNr»CHARTN*l 694 18 CmARTN=7 695 . CALC CHARTNr»l 696 ENOIF b97 i5>t>ia> 69d UNI 1 C-ETlCTN i$ LEVEL 1 b99 S> 6cT F, C, RL OF LOCATION 7C0 DlFIML CTWHER8=N9 7C1 DO GETCMLN 7(2 if- iouchv-.>i sands iouchv-.'«>l*t 724 UNIT GcTKEY 7?5 CALC GTWriEREr*MSWhLRE+i00 726 ARROW CtTwHLkE -38- 7c7 Tcti 7?9 73u 721 722 733 734 73b 736 737 738 739 !**{) 741 742 7«J 744 74b 7Ab 747 748 7<*9 75u 751 752 753 MATCH NO PAJbC tiMUARkO* IF EUSLIF • ELSEIF • tMUIF DO CALL CALL !t> » i> i S T0UChV,8ACK,AND,0R,N0T»NAND*^0R»X0R»lNPT» (KMV GATE,RMVGATE,RMV) » CNCT. (DIS.DIS CNCT»DISCNCT) t (INPT VAL»INP1VAL) ♦ (GATE INTL VAL.bATEINjLVAL.IiNTL VAL » INTLVAL »GATE INTLiGATEINTL) ♦ (SHOW CHRTtbHOWCHRTiSHOW CHAF T » CHART t SHOWCHART) » (ERAS GATE AREA, ERaSGATEAREA t ERAS GATE)**** 11, 12, 13, 14, lb, 16,17, 21, 22, 2J, 24, 2b, 2b, 27, 31, 32, 33, 34, 3b, 36, 37, 41, 42, 43*44,45, 40*47. bl, 52,53,54, 5b, 5b, 57, 6l,b2,b3,04,65,6fa,67,bACKl r S70Pl TOUCHVsU SS tbtAtCtK JUMP MAIN TOUCHV = t»0 iS *BtA + C*Kl JUMP MAINO TOUCHV=bl S$ tStTtOtRl JUMP MAlNtND KODIFY 10UCHXr*64*C-lb 10UCHY(»464-64*R 754 755 756 75 7 756 759 76U 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 UiJl I % ACCE % i i> ENAtsLL PAUSE 1UIFL KEYTYPE GETTCH PI A TOUCH TOUCH PANEL INPUT*! TOUOHV*0 t» tBtAtCtK 1-.±*> 797 UNIT MODIFY 798 CALC FCr»TOUCHV-l7 799 CALC Pr»INT( (RC-1)/7)*1 800 CALC Cr»RC-7^(R-l) 8C1 $a>$ifc bC2 CSTOP" -40- BIBLIOGRAPHIC DATA SHEET 1. Report No. UIUCDCS-R-79-979 3. Recipient's Accession No. 5. Report Date July 24, 1979 4. Title and Subtitle A manual of SIMPL: A logic network simulation for PLATO 6. ' Sadaniro Isoda and Elyas Farzan-Kashani 8. Perfotming Organization Rept. No - UIUCDCS-R-79-979 9. Performing Organization Name and Address Department of Computer Science University of Illinois U-C Urbana, Illinois 61801 10. Project/Task/Work Unit No. 11. Contract /Grant No. 12. Sponsoring Organization Name and Address 13. Type of Report & Period Covered Technical 14. 15. Supplementary Notes 16. Abstracts This is a user's manual of SIMPL, a logic network simulator for PLATO. SIMPL is a program which can interactively simulate logic networks, based on the computer- based education system, PLATO. SIMPL enables the user to construct any network con- sisting of logic gates (AND, OR, NOT, NAND, NOR, or XOR) and input terminals, to sup- ply input value sequences to input terminals, to assign initial values to gates, and to show timing charts for any gates of the network. SIMPL is quite easy to use even for a novice, because the user, following mes- sages from SIMPL, cna use it almost by means of touching the screen. 17. Key Words and Document Analysis. 17a. Descriptors computer-based education, interactive simulation, logic network, logic simulation, PLATO, terminal, touch panel 17b. Identifiers/Open-Ended Terms 17e. COSATI Field/Group 18. Availability Statement unlimited FORM NTIS-35 00-70) 19.. Security Class (This Report) UNCLASSIFIED 20. Security Class (This Page UNCLASSIFIED 21- No. of Pages 22. Price USCOMM-DC 40329-P71 M 1 2 1980 FEB 20