m m ML ■ m ■ m ft s ^H ■ 19 '*&«# Nil Mil iraffiiili HHffilli Hill BHBISISBSqS bmBSHUs! Hffi Bffl ffl ffl BBOBoB ma ■moDtSO WX ml fie RE V "i ><8a IB I I ft hi hkh«i SB] Kmhh&iHhe HHHi HHHSB ram R» H ■ ■ HE B ih! >3«J^i)l»*3 #ww 83 1! EHIfrUHOi/f V BnfiSraRKfifl HSR Hmni S818BB8 mao Bm «ra v/,. ?5Vi rar 99 rai he arena mm ■ ■ « JbcrSS Emfi ■HH 09188 SB ■ ■H iHSnul LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN 510. 84 IJKor "0.698- 702. Cod. £. t The person charging this material is re- sponsible for its return to the library from which it was withdrawn on or before the Latest Date stamped below. Theft, mutilation, and underlining of books are reasons for disciplinary action and may result in dismissal from the University. UNIVERSITY OF ILLINOIS LIBRARY AT URBANA-CHAMPAIGN ^f* 1 recti L161 — O-1096 Digitized by the Internet Archive in 2013 http://archive.org/details/programmanualnor698cull D IV • " 7 UIUCDCS-R-75-698 *f PROGRAM MANUAL: NOR NETWORK TRANSDUCTION BASED ON CONNECTABLE AND DISCONNECTABLE CONDITIONS (Reference Manual of NOR Network Transduction Programs NETTRA-G1 and NETTRA-G2) by February 1975 J.N. Culliney uiucdcs-r-75-698 PROGRAM MANUAL: NOR NETWORK TRANSDUCTION BASED ON CONNECTABLE AND DISCONNECTABLE CONDITIONS (Reference Manual of NOR Network Transduction Programs NETTRA-G1 and NETTRA-G2) by J.N. Culliney February 1975 Department of Computer Science University of Illinois at Urb ana-Champaign Urbana, Illinois 6l801 This work was supported in part by the National Science Foundation under Grant No. GJ-40221. 510.24- oo.k<3?-70^ cop 2- 11 ABSTRACT This paper explains the operation and usage of two FORTRAN computer programs, NETTRA-G1 and NETTRA-G2, developed for NOR-network transduction ( trans formation and r eduction ). Existing (non-optimal) NOR-gate networks and their required output functions are given to the programs as input. The programs, in general, add, change, and/or delete connections in the network in an effort to reduce the cost of the network (defined in terms of numbers of gates and connections) as much as possible. Gates are examined individually; their input connections and potential input connections are evaluated under certain conditions of connectability and disconnectability in order to effect the changes in network configuration and thus reduce network cost. These programs are only two out of a whole system of programs, designated by the name "NETTRA" (for NETwork TRAns duct ion), which implement different NOR-network transduction procedures. The theoretical basis for the algorithms implemented by NETTRA-G1 and -G2 is detailed in earlier reports ([l] and [2]). Ill ACKNOWLEDGMENT The author is greatly appreciative of Prof. S. Muroga for his discussions and guidance relating to the preparation of this paper, and also, for his careful reading and valuable suggestions for the improvement of the original manuscript. The author is also indebted to H. C. Lai and Y. Kambayashi upon whose related research much of the work reported herein depends. This work was supported in part by the National Science Foundation under Grant No. GJ-40221. IV TABLE OF CONTENTS 1. INTRODUCTION 1 2. A GENERAL NETWORK TRANSDUCTION PROCEDURE TO REMOVE NON-SPECIFIC GATES 3 3. A SPECIALIZED NETWORK TRANSDUCTION PROCEDURE TO REMOVE A SPECIFIC GATE 21 k. MAJOR FUNCTIONS OF COMMON SUBROUTINES 37 5. INPUT DATA SETUP lj-1 5.1 Input Data Card Format k-5 5.2 Restrictions on Problem Size 56 5.3 Examples of Input Data Setup 56 REFERENCES 69 APPENDIX: PROGRAM LISTINGS 70 1. INTRODUCTION This manual is intended to instruct the reader in the use of the FORTRAN programs ! NETTRA-G1' and 'NETTRA-G2'. These programs realize the algorithms described in detail in [l], and this manual will assume a knowl- edge of those definitions and algorithms in [l] as well as a knowledge of the general description of network transduction procedures presented in [2]. NETTRA-G1 and -G2 are only two out of a whole system of programs developed at the University of Illinois by the research group led by Prof. S. Muroga. The generic name 'NETTRA' (for NETwork TRAnsduction) designates the whole collection of programs comprising the system. All of the programs in the NETTRA system either transform or assist in transforming networks of interconnected NOR gates realizing various functions of their respective sets of input variables. ly these transformations, a large, non-optimal network of NOR gates realizing one or more various functions can often be reduced to a smaller, less expensive (in terms of the number of required gates and interconnections, for example), near-optimal network realizing the same functions (s). In general, such a transformation could involve a complete reorganization of the network: the addition and/or deletion of gates; the addition and/or deletion of connections among gates; and /or the substitution of certain connections for various others. The procedures realized by NETTRA-G1 and NETTRA-G2 can accomplish any of these changes, with the exception of adding gates to the network. The procedures realized in the programs NETTRA-G1 and -G2 are more complex than those appearing in [3] and require more computer time to execute. However, they are more powerful also, and they can often reduce a network when it is impossible to do so by those other procedures. The programs, NETTRA-PG1, -PI, and -P2 described in [3], though, are more efficient than NETTRA-G1 and -G2 when first applied to large, far- from-optimal networks. NETTRA-G1 and -G2 are most useful when applied to more nearly optimal networks where it is fairly difficult to achieve a further reduction of the network. As can be seen later, NETTRA-G1 and -G2 are quite similar programs, sharing the same major subroutine in fact; but they realize significantly different transformation procedures. The next two sections, Sections 2 and 3, discuss the two programs in greater detail and present some examples of the effectiveness of their transformations. This is followed, in Section h, by a description of the functions of the subroutines which support the subroutines actually realizing the procedures. Section 5 outlines the preparation of input for the two programs. Finally, in the appendix, a complete listing of each of the FORTRAN programs, NETTRA-G1 and NETTRA-G2 is given. 2. A GENERAL NETWORK TRANSDUCTION PROCEDURE TO REMOVE NON- SPECIFIC GATES This and the following section will discuss, respectively, the NOR-network "transduction" (transformation and r eduction ) procedures realized by the FORTRAN programs designated NETTRA-G1 and NETTRA-G2. These programs realize procedures which are strictly network reduction procedures. In other words, when they are applied in an attempt to transform a network, the cost of the network will he either reduced or unchanged - it will never be increased. The input to either of these programs is a description of a particular NOR network under consideration. This description (explained in detail in Section 5) consists of a set of various network parameters. The output of both programs is a description of the "transformed" network (if a transformation was possible). As opposed to the procedure to be discussed in Section 3, the procedure discussed in this section does not attempt to remove specific gates from a network. A calculation is made, during which, usually, the network connection pattern is altered and unnecessary gates are recognized and removed from the network. Due to certain "orderings" which are needed in the procedure to perform selection decisions, there is a definite "preference" to remove certain gates from the network rather than certain others; but the procedure definitely does not focus its power on attempting the removal of a specific gate. As a by-product of the calculation, compatible sets of permissible functions are generated. This information is necessary for the further Refer to [l] for definitions of unfamiliar terminology. application described in Section 2.2 of [3]. The entire NETTRA-G1 program requires ikh K bytes of core storage, about 59 K being occupied by the actual program instructions and about 85 K by the stored data (compiled by FORTRAN H (OPT 2) compiler). The following subroutines, written in FORTRAN IV for the IBM 360/75, consititute the program NETTRA-G1: MAIN, PROCII, CONCCO, ELANDO, MINK, RNONES, SUBNET, and OUTPUT. Two system-supplied timing routines, STIMEZ and KTIMEZ are also assumed to be available, but if they are not, their use can be omitted from the program, or another suitable timing routine sub- stituted, without harming the procedure itself. The functions of the support subroutines, MAIN, CONCCO, ELANDO, MINI2, RNONES, SUBNET, and OUTPUT, will be discussed in Section h. The general organization of the program NETTRA-G1 is shown in Fig. 2.1. An arrow from block i to block j represents the fact that the subroutine represented by block i calls the subroutine represented by block j. 2.1 Flowchart of the Subroutine Realizing the Pr ocedure Although NETTRA-G1 is composed of eight subroutines, the logic realizing the transduction procedure is essentially embodied in just one subroutine: PROCII (for PROCedure II, a name assigned during the development of the program). The following discussion of PROCII will assume a general knowledge of the information contained in [l]. Explanations of the purposes of the variables and arrays appearing in the subroutine can be found in the program listing of PROCII in the appendix. It is, however, convenient to define some of the variables at this point in order to discuss the flowchart of PROCII which appears in Figc. 2.1.1 and 2.1.2. OUTPUT MAjjj v PROCII SUBNET i < EIANDO »- 1 RNONES •w ^- CONCCO ?-- MINI2 Fig. 2.1 General organization of the program NETTRA-G1. N is the number of external variables, n, if only uncomplemented variables are allowed as inputs. If both complemented and uncomplemented are available (i.e., n variables and their n complements) then N is equal to 2n. Note that this is strictly the representation internal to the program; for input-output purposes (as described in Section 5) N and n are always equal. R is the number of gates specified by the input data to the program. It includes all gates declared to be present by the input data, even though some of them may be isolated (i.e., not connected to other gates in the network). Internally , the program represents the gates 1, 2, ..., R by the labels N + 1, N + 2, . . . , N + R. (External variables are labeled 1, 2, . . . , N internally. ) NR is equal to the sum N + R. It is often convenient to treat both external variables and gates in a similar manner. External variables being labeled 1, 2, . . . , N and gates being labeled N + 1, . . . , N + R (internally), the number N + R is frequently required. GORDER is an array containing a certain ordering of the various gate and external variable labels. In other words, in the locations GORDER(l), G0RDER(2), ..., GORDER(NR) are stored the numbers 1, 2, ..., NR in a certain order. The ordering represented by the array GORDER satisfies the following criterion: for every gate or external variable, i, which feeds another gate, j, gate j precedes gate i in the ordering (for this to be possible, the network is assumed to be loop-free). [ALL is a two-dimensional array used to store the intermediate and final calculated compatible sets. GSMALL entries are initialized to "don't-cares" at the beginning of the procedure; upon termination of the algorithm, the determined compatible sets can be read directly from GSMALL. For simplicity, sometimes just the words "compatible sets" will be used to denote compatible sets of permissible functions. GSMALL(i, j) contains (or rather, will contain by the end of the th procedure) the j component of the vector representing the compatible set of permissible functions for gate or external variable i. In block 1 of the flowchart (Fig. 2.1.1), an ordering of gates and external variables is determined and stored in the array GORDER. Also, at approximately this point in the program, initial values are assigned to many of the arrays and variables which will be used later. Block 2 simply initializes a counter, the variable GCOUNT, used in the program loop consisting of blocks 3, ^, 1, &, and 9« Block 3 increments the counter, GCOUNT. The program loop formed by blocks 3, k, 7, 8, and 9 executes once for each value of GCOUNT: 1, 2, 3, • • • • When GCOUNT is incremented beyond the value NR, it is detected in block k . This is a sign that the algorithm has finished, having scanned every gate in the network, and the program enters block 5. Otherwise, the program proceeds to block "J. In block 5 the algorithm has essentially finished. A subroutine (MINI 2) is called which quickly searches for and removes certain redundant connections which may still remain in the network (for example, certain new connections that might have been added unnecessarily in block 9). The removal of such connections does not cause a change in the output functions of the network. At the end of every transformation there are certain "house- keeping" chores which must be performed: updating or restoring values in arrays and variables. This task is done in block 6 . This is followed by a return to the calling subroutine (MAIN). Fig. 2.1.1 Generalized flowchart of PROCII. START FORM GORDER 5 TRY TO REMOVE REDUNDANT CONNECTIONS YES UPDATE ARRAYS RETURN GCO = GORDER (GCOUNT] INITIALIZE COUNTER: GCOUNT = INCREMENT COUNTER: GCOUNT = GCOUNT + 1 ADD CONNECTABLE FUNCTIONS, REMOVE ANY UNNECESSARY INPUTS, AND UPDATE GSMALL OF ALL GATES FEEDING GCO In block 7 , the variable GCO is assigned the label (of a gate or external variable) contained in the (GCOUNT) position of the ordering stored in the array GORDER. GCO becomes the name of the gate (or external variable) about to be examined by the program. If GCO happens to be either an external variable or an isolated gate, no action needs to be taken. In such a case block 8 sends control back to block 3« Otherwise, the program continues to block 9« Block 9 performs many functions and is actually quite complex. So block 9 is detailed in Fig. 2.1.2 as consisting of sub-blocks 10 through 23. In these blocks the program focuses its attention on gate GCO and its inputs. During the previous part of the calculation, the output requirement (i.e., the set of permissible functions ) of gate GCO (0, 1 or *) has already been determined for each of the 2 possible combinations of external variable values. Whenever the required output (i.e., GSMALL component) of GCO is a 1 for a certain input vector, all of the immediate successors of GCO (i.e., the gates and /or external variables which feed GCO) must have an output of 0. Also, whenever the required output of GCO (i.e., GSMALL component) is a 0, at least one of its immediate successors must have an output of 1. If the re- quired output of GCO is * for some input vector, the outputs of its immediate successors are unrestricted. In block 9> it is the positions of the 0's in the permissible function vector of GCO which are of foremost importance. Due to the nature of A set of permissible functions for a gate I is represented by a 2 -dimensional vector [stored in (GSMALL(l, J), J = 1, 2, ..., 2 n )], (f^, ..., f' 2 '), where f (j) = f ( x x x ) for j - 1 = 2 n_1 x n + 2 n " 2 x + ... + x . Each coordinate 1 ' Z J ' n 1 2 n is a 0, 1, or *. If *'s are used, then the vector represents the set of all functions which are obtained by assigning or 1 to each * in all possible ways. 10 Fig. 2.1.2 Detail of block 9 of PROCII flowchart. 10 11 START ELIMINATE NON- ESSENTIAL INPUTS, ORDER OTHERS (IN A "LIST L") BY DECREASING NUMBERS OF ESSENTIAL l'S 13 REPLACEMENT FEASIBLE? 19 SEARCH LIST C FOR AN APPROPRIATE EFFECTIVELY CON- NECTABLE GATE OR EXTERNAL VARIABLE, EFFCON yk:; UPDATE GSMALL FOR TILL TRY TO REPLACE AN ELEMENT, TH, FROM LIST L WITH AN ELEMENT, P, FROM LIST C 15 DISCONNECT TH FROM GCO, CONNECT P 22 RE- EVALUATE LIST L AND REMOVE EFFCON FROM LIST C 21 LIST ALL CONNECTABLE FUNCTIONS (IN A "LIST C") BY DECREASING NUMBERS OF O'S (IN GCO) COVERED, ELIMINATE ANY SMALLER THAN OTHERS CONNECT EFFCON TO GCO 4-^> REMOVE P FROM LIST C AND TH FROM LIST L REORDER LIST L GO TO 11 NOR gates, a 1 appearing on any of the input lines to a gate will cause a output of that gate. Such a 1 is called a cover of that 0, and the is said to be covered by that 1. Although a output may be covered by several l's (appearing on different input lines), only a single cover is actually required to guarantee the output. Block 10 actually represents two steps. The first step is the elimination of non-essential inputs of GCO. Checking the immediate predecessors to GCO, the number of 1 covers for each component of the permissible function vector is determined and stored. Some components have only a single 1 cover. In such a case, the single 1 covering the is called an essential 1 . Any input line (connection) carrying an essential 1 for some input vector cannot be disconnected from GCO without causing the actual function of GCO to be outside the set of permissible functions for GCO. However, the input connections to GCO which do not carry essential l's are redundant and are removed from the network in the first step of block 10. The removal of these redundant input connections must be done serially though since removing any input to a gate might cause new essential l's to be created. The remaining inputs to GCO all have essential l's. They are ordered in a list L, (realized by an array named "LISTL" in the program) such that the input represented by LISTL(i) has at least as many essential l's as the input represented by LISTL(i+l). This is the second step of block 10. In block II , first a search is made for all gates and external variables which are effectively connectable to GCO. (The original inputs to GCO are prohibited from being considered effectively connectable to GCO. ) If one of these effectively connectable functions, call it A, covers every of GCO covered by another effectively connectable function, say B, then B is Refer to [l] for definitions of unfamiliar terminology. 12 eliminated from the collection of (effectively connectable) functions (i.e., A is greater than or equal to B in every component corresponding to a position of a in the permissible function vector of GCO). Those remaining effectively connectable functions are ordered in a list C, (realized by an array named "LISTC" in the program) such that the function represented by LISTC(i) covers at least as many O's of (the permissible function vector of) GCO as the function represented by LISTC (i+l). If the program is unable to detect any effectively connectable functions (i.e., if list C is empty), control goes to block 23 and then to block 3« Otherwise the program proceeds to the major program loops in block 9, consisting of blocks 13 through 22. Block 12 tests for an empty list C. Block 13 seeks an element, P, from list C which can be directly substituted for an element, TH, from list L, such that the substitution would not cause the actual function of GCO to be outside its set of permissible functions. Furthermore, this TH and P are also selected in such a manner that TH is the first element in list L which can be replaced by an element in C and that P is the first element in list C which can re- place that TH. Block lk tests if a feasible replacement has been found. If no replacement is possible, control passes to block 19 . If, however, a suitable P and TH were chosen, blocks 15 through 18 perform the actual exchange of P for TH as an input of gate GCO. First TH is disconnected from GCO in block 15 . Also this block connects the new input, P, to GCO. In this case, an "element" is actually the function realized by a gate i-l variable. 13 Block l6 removes P from the list C of effectively connectable functions and TH from the list L of inputs to GCO. If list L becomes empty by the removal of TH ( block 17 test), the program has replaced all of the original inputs to GCO by new ones, and the program moves to the next step of the procedure in block 23. Otherwise the program goes to block 18 where the elements of list L are reordered by decreasing numbers of essential l's. This is necessary since, by the addition of P to GCO, some previously essential l's may have become non-essential. From here, the program returns to block 13 to search for another replacement P. Block 19 is reached when it is no longer possible to replace an element of list L with an element of list C as an input to GCO. Here, the program first searches for an element of list C which can cover at least one of (the permissible function vector of) GCO which is currently covered by an essential 1 belonging to one of the original inputs to gate GCO. If such an input is found, it is assigned the label EFFCON and the program proceeds to block 21. If no EFFCON can be chosen, this implies that there can be no further replacements of original inputs to GCO by elements of list C. In this case, the program searches list C one last time looking for elements which cover at least one of GCO which is currently covered only by the remaining original inputs to GCO (i.e., which is not covered by any of the newly connected functions). The group of elements satisfying this criterion are connected to GCO, and control goes to block 23. Block 20 was discussed as part of block 19. In block 21 the selected EFFCON is connected to GCO. This connection requires the reordering of list L and the removal Ik of EFFCON from list C. This is done in block 22 . The program then returns to block 13 to try again to find an element of list L which can be replaced by an element of list C. This may now be possible although it was impossible before the connection of EFFCON to GCO. In block 23 the covering assignments are made for the gates still feeding GCO. In other words , for each component of the permissible function vector of GCO, one of the gates, . GI (feeding GCO), producing a 1 cover for that is selected. Gate GI is then required to produce a 1 out- put for that component, and this requirement is actually a restriction on the set of permissible functions for GI. This requirement is recorded th (assuming the in question appears as the j component of the permissible th function vector of GCO) by forcing the j component of the permissible function vector of GI to be a 1 (i.e., the value 1 is stored in the location GSMALL (GI, j)). Although other 1 covers (from other gates feeding GCO) may exist for that same output, they are not "required" in the same sense as the 1 cover provided by the selected gate. After all of the required 1 outputs of gates feeding GCO have been selected and stored (in GSMALL), the required outputs of the immediate predecessors (actually, external variables feeding GCO can be, and are, ignored) are determined and stored by inserting O's into GSMALL in the appropriate locations. It is an easy task to find the locations of these required O's. If l's appear in GSMALL (GCO, J.,), GSMALL (GCO, j 2 ), ..., 'ALL (GCO, j, ) [i.e., in the j , j , . . . , j components of GCO's permissible function vector], then O's must be required in GSMALL (p , j-.), ..., GSMALL (p x , j k ); GSMALL (p 2 , j^, ..., GSMALL (p 2 , j R ); ...; the is found to be covered by an external variable, no 1 cover is select' 15 GSMALL (p^j, J 1 ), . .., {V p O k ), where p 1 , p , . . . , p^ are the labels of the immediate predecessors of GCO. The completion of block 23 also means the completion of block 9j and execution of the program moves into block 3 of Fig- 2.1.1. 2.2 Example for NETTRA-G1 Fig. 2.2.1 shows partially the printout obtained from NETTRA-G1 for a typical example. The original network produces a single output function and consists of 25 gates and 105 connections. Five independent, uncomplemented variables are available as inputs to the network. This information appears at the beginning of the output (Fig. 2.2.1 (a)). This is followed by a complete truth table (b) showing the output of every gate in the original network for every possible input combination. Note it is gate 1 which realizes the output function of the network. Next appears a description of the configuration of the network (c). Each gate is listed along with the gates and/or external variables which are its inputs. The level numbers, also to be seen in (c), will be discussed in Section 5«3« The truth table (note that the outputs for disconnected gates are shown as all l's) and network configuration for the transformed network resulting from the action of NETTRA-G1 are shown in (d) and (e), respectively. The derived network consists of 1.1 gates and 38 connections. If NETTRA-G1 were applied to this new network, a third network of 10 gates and 36 con- nections would be obtained. 16 Fig. 2.2.1 Printout for a Network Transformed by NETTRA-G1. **** 5 VAR. , EXAMPLE HEX=FF68A1F3 NUMBER OF VARIABLES = 5 NUMBER OF FUNCTIONS = 1 COST COEFFICIENT A = 100 B = 1 — - UNCOMPLEMENTED VARIABLES X — FUNCTION NO. 1. 11111111011010001010000111110011 ORIGINAL NETWORK COST = 25105 (a) Heading information and network parameters. IT TRUTH TABLE XI =00000000000000001111111111111111 X2'= 0000000011111111 0000000 11111111 X3 =00001 111000011110000111100001111 Xk =00110011001100110011001100110011 X5 =0101010101010101010 10101010 10101 1=111111110110100010100001111. 10011 2=10000000000000000000000000000000 3=00000000100000000000000000000000 1+=11110000000000000000000000000000 5=11000000110000000000000000000000 6=10100000101000000000000000000000 7=00000000000100000000000000000000 8=10101010000000000000000000000000 9=10001000100010000000000000000000 10 =00000000000000100000000000000000 11 =11111111000000000000000000000000 12 =00000000000101110000000000000000 13 =11000000000000000000000000000000 Ik =10000000000000001000000000000000 15 =00000000000000000100000000000000 16 = 1 1 1 1 17 =00000000000000000101000000000000 18 =1100110000000000000000000 0, 000000 19 =00000000000000000100110000000000 20 =10001000000000000000000000000000 21 =00000000000000000000101000000000 22 = 10000000100000001000000010000000 23 =00000000000000000000100000001000 2h =11000000110000001100000011000000 25 =00000000000001000000110000001100 (b) Truth table for original network. 18 GATE .. LEVEL FED BY 1 /I/ 3 7 10 12 15 17 19 21 23 25 2 / 3/ XI X2 X3 X4 X5 3 1*1 XI X3 xk X5 2 k 1 3/ XI X2 X3 5 /3/ XI X3 xk 6 /3/ XI X3 X5 7 /2/ XI X3 k 5 6 8 /3/ XI X2 X5 9 /3/ XI Xk X5 10 /2/ XI X5 6 8 9 11 / 3/ XI X2 12 1*1 XI 5 8 9 11 13 1 3/ XI X2 X3 X4 Ik /3/ X2 X3 Xk X5 15 /2/ X2 X3 Xk 13 14 16 /3/ X2 X3 X5 17 /2/ X2 X3 k 13 16 18 /3/ XI X2 Xk 19 /2/ X2 xk lk 18 20 1 31 XI X2 Xk X5 21 1 2/ X2 X5 8 lk 16 20 22 /3/ X3 Xk X5 23 /2/ xk X5 9 20 22 2k /3/ X3 Xk 25 /2/ xk 9 18 20 24 Configuration of original network. 19 NETWORK DERIVED BY PROCII TIME ELAPSED = ikk CENTISECONDS TRUTH TABLE XI =0000000000000000111111 1111111111 X2 =00000000111111110000000011111111 X3 =00001111000011110000111100001111 Xh =00110011001100110011001100110011 X5 =01010101010101010101010101010101 1=11111111011 -0 10001010 '0 00111110011 2 = 11111111111111111111111111111111 3=00000000100000000000000000000000 ^=11111111111111111111111111111111 5=111111111. 11111111111111111111111 6=11111111111111111111111111111111 7=11111111111111111111111111111111 8=11111111111111111111111111111111 9=100010001000100000 00000000000000 10 =11111111111111111111111111111111 11 = 111111110000 0000000000000000000 12 =00000000000101110000000000000000 13 =11111111111111111111111111111111 Ik =11111111111111111111111111111111 15 =ii-i liiiiiiiiiiniiiiiiiiii i 11111 16 =10100000101000001010000010100000 17 =00000000000000000101000000000000 18=111111 llllllllllllllllllllllllll 19 =11111111111111111111111111111111 20 =111111111111111111' 11111111111111 21 = 00000000000000000000101000000000 22 =10101010101010101010 101010 101010 23 =11111111111111111111111111111111 2k =11000000110000001100000011000000 25 =00000000000001000000110000001100 (d) Truth table for transformed network. 20 GATE .. LEVEL FED BY 1 /I/ 3 12 17 21 25 2 /I/ 3 /2/ XI X3 X^ X5 11 k /I/ 5 /I/ 6 /!/ 7 /V 8 /I/ 9 /3/ XI Xk X5 10 /I/ 11 /3/ XI X2 12 /2/ xi 9 11 16 24 13 /I/ lk /I/ 15 /V 16 /3/ X3 X5 17 /2/ X2 X3 11 22 18 /I/ 19 /I/ 20 /I/ 21 /2/ X2 X5 11 16 2k 22 /3/ X5 23 /I/ 2k /3/ X3 xk 25 / 2/ xk 9 11 2k * A NETWORK DERIVED BY PROCII COST = 11038. Configuration of transformed network. 21 3. A SPECIALIZED NETWORK TRANSDUCTION PROCEDURE TO REMOVE A SPECIFIC GATE The procedure about to be discussed here attempts to remove specific gates from a network, in contrast to the procedure just described. Actually, this procedure, realized by the program NETTRA-G2, consists of many applications of a smaller procedure which attempts (upon each application) to remove a specific gate from the network. NETTRA-G2 consists of the following subroutines written in FORTRAN IV for the IBM 360/75: MAIN, PROCIV, PROCII, MINI2, CONCCO, ELANDO, RNONES, SUBNET, and OUTPUT. Two system-supplied timing routines, STLMEZ and KTIMEZ are also assumed to be available, but if they are not, their use can be omitted from the program, or another suitable timing routine substituted, without harming the procedure itself. The functions of the support subroutines MAIN, CONCCO, ELANDO, MINI2, RNONES, SUBNET, and OUTPUT will be discussed later in Section k. The entire NETTRA-G2 program requires lU6 K bytes of core storage, about 6l K being occupied by the actual program instructions and about 85 K by the stored data (compiled by FORTRAN H (OPT 2) compiler). Fig. 3«1 shows the general organization of the program NETTRA-G2. It is identical to the organization of NETTRA-G1 (Fig. 2.1) except for the insertion of the new subroutine PROCIV. As in Fig. 2.1, an arrow from block i to block j indicates that the subroutine represented by block j is called by the subroutine represented by block i. 3.1 Flowchart of the Subroutines Realizing the Procedure Although the procedure realized by NETTRA-G2 is quite different from that realized by NETTRA-G1, both of these programs use the subroutine 22 MAIN riTFPT 5TTTT1 Uul rv± w PROCIV MINI2 SUBNET 1 ' i i PROCII ELANDO 1 f RNONES OUINL ou Fig, 3-1 General organization of the program NETTRA-G2. PROCII to execute the main parts of the transformations. In NETTRA-G2, however, a new subroutine, PROCIV (for PROC edure IV , a name assigned during the development of the program), has been added to control the application of PROCII to the network. PROCIV is a very simple subroutine. Its flowchart is shown in Fig. 3-1.1. Block 1 of Fig. 3.1.1 calls MINI2 (a subroutine described in detail 23 START CALL PROCII, FOCUSING ON REMOVAL OF GATE PORDER(I) CALL MINI2 TO COMPUTE PERMISSIBLE FUNCTION VECTOR FOR EACH GATE 1 = 1+1 1=0 COUNT THE NUMBER OF l'S IN THE PERMISSIBLE FN. VECTOR FOR EACH GATE ORDER GATES IN AN ARRAY "PORDER" BY INCREASING NUMBERS OF l'S IN PERMISSIBLE FUNCTION VECTORS Fig. 3-1.1 Flowchart of PROCIV. in [3]) to compute a permissible function vector for each gate. During this process some gates may be removed, but this probably will not happen unless the network contains a sufficient amount of redundancy. In any case, the purpose of calling MINI2 at this point is mainly to determine a set of permissible function vectors. Block 2 then counts the number of l's appearing in the permissible function vector of each gate. This 2k information is used in block 3 to make an ordering of gates based on in- creasing numbers of l's in the respective permissible function vectors of the gates. The ordered gate labels are stored in the array POKDER (such that POKDER(l) is a gate which has the least number of l's in its per- missible function vector, and POKDER(R) is a gate which has the greatest number). Blocks h, 5> 6, and 7 form a loop which repeatedly calls a special version of PROCII (the subroutine's characteristics are modified by specifying a certain parameter during the call to that subroutine). PORDER(l), P0RDER(2), ... PORDER(R) are attempted to be removed from the network by the special PROCII - one gate, PORDER(l), upon each loop through block 7. Each time PROCII is called specifying a particular gate, PORDER(l), the subroutine attempts the removal of that specific gate. The meaning of this will become clearer during the discussion of the flowchart of the "modified" PROCII. The reason for creating the ordering PORDER is to try to remove the more easily removable gates (gates with more l's in their permissible function vectors are, in general, more essential to the network and thus are more difficult to remove) first, before they become more deeply entangled (e.g., by using their outputs as new connections to enable the removal of some other gate(s)) in the network. In the following discussion of the modified PROCII (let it be referred to as PROCII-M to distinguish it from the regular PROCII ) a general knowledge of the information contained in [l] will once again be assumed. Fig. 3* 1*2 presents a diagram of a general multiple- output network [note the possibility that some of the network outputs of subnetwork T may be used ac inputs to S (see gate drawn in dotted lines)] to be 25 transformed by PROCII-M in an attempt to remove the gate labeled "J". (Arrows have been added only to indicate the direction of signal propagation through the connection lines.) Notice that all of the gates on every path from gate J to an output gate are contained in subnetwork S; every other gate in the network, besides J itself, is in subnetwork T. This distinction of whether each gate belongs to T or S is also made by the program itself when PROCII is modified to PROCII-M. Fig. 3«1«2 Generalized network for the application of PROCII-M. /'"/ x. network outputs network outputs n Generally PROCII-M operates in much the same way as PROCII, except: (l) while gates in T (and external variables) may be connected to gates in S (or T) during the transformation, gates in S are not permitted to be 26 connected to any other gates; (2) covering of zeroes in gates of subnetwork T is not considered; (3) whenever there is a choice between the removal of a non-essential connection from a gate in T (or from an external variable) and one from a gate in S, the connection from the gate in S is removed; and (k) during the assignment of covering l's (e.g., during block 23 of Fig. 2.1.2) external variables and gates in T are preferred covers. These modifications tend to push some of the burden of logic from subnetwork S to subnetwork T. In turn, this tends to reduce the necessity of gate J - hopefully until it is no longer needed at all. If this point can be reached, gate J may be removed from the network. The above k differences are achieved by the following program modifications respectively: {1} In block 11 of the flowchart of PROCII (see Fig. 2.1.2) only external variables or the outputs of gates in T are allowed to become connectable functions. {2} In block 8 (see Fig. 2.1.1), if GCO is found to be a gate in sub- network T, control of the program is sent back to block 3« If GCO is not in T, the regular tests (to see if GCO is an external variable or isolated gate) are then made. {3} Blocks 10 and 18 (Fig. 2.1.2) are the only parts of the program which eliminate non-essential inputs to each GCO. This is done in both blocks by calling the subroutine ELANDO. So difference (3) is effected by having By specifying a certain parameter, covering of zeroes for gates in T can also be effected. As previously mentioned, these modifications are built into the program and are trigered by the specification of the appropriate parameter during the call of PROCII . No reprogramming is required. 27 ELANDO first remove non-essential connections from gates in S to GCO. If any non-essential connections remain, they are then removed in the usual order (as in the normal PROCIl). ik) Block 23 (Fig. 2.1.2) makes the covering assignments. In choosing covers for zeros of GCO, block 23 prefers covers in the following general order: (a) external variables; (b) gates in subnetwork T; (c) gates in subnetwork S. Obviously, covers of type (a) or (b) place no requirements on the gates of subnetwork S. This ordering, calculated in block 1 of Fig. 2.1.1 just after the determination of GOKDER, is stored in the array ROKDER. While the ordering of GORDER is still used in blocks 1 and 7 of the flowchart (Fig. 2.1.1), the ordering of RORDER replaces that of GORDER in making the covering assignments in block 23 (in Fig. 2.1.2). The ordering in this RORDER is divided into 3 groups of ordered gates (and external variables). The first group, stored in memory locations RORDER(l), ..., RORDER(k), is an order- ing of all of the gates in T and all of the external variables (actually, the external variables are ignored in the use of this ordering although they do appear). The second group contains an ordering of all the gates in S. This group can be found in locations RORDER(k+l), ..., RORDER(NR-l). Finally, the third group consists of only a single gate, J. It is stored in RORDER(NR), The overall preference of gates decreases from RORDER(l) through RORDER(NR). After covers consisting of external variables have been assigned wherever possible, this preference ordering is employed to select covers for the remaining uncovered components of GCO's permissible function vector. Actually there are several different orderings for assigning covers which are available to the user. Only one of these will be described in detail here. 28 If it is desired by the user, he has the option of also carrying out the usual calculations (i.e., calculation of permissible function vectors, rearrangement of inputs, removal of redundant connections, etc.) for the gates of subnetwork T. This is accomplished by specifying a certain para- meter while calling PROCTl(-M). This parameter blocks the modification {2} discussed above. This might result in the removal of extra connections (and possibly, extra gates), but the necessary computation time is increased. The user should experiment to find whether or not this option is more suit- able for solving his class of problems. 3.2. Examples for NETTRA-G2 As mentioned at the end of the previous section, with NETTRA-G2 the user has the option of allowing calculations (permissible function vectors, etc.) to be performed for all gates in the network for every POKDER(l) rather than just for gates in subnetwork S (with respect to the particular PORDER(l)). Examples both with and without this option will be given in this section. Beginning from the same initial network (Fig. 3.2.1), Fig. 3.2.2 and 3«2. 3 show the results using NETTRA-G2, respectively, without and with the option. The initial network, as documented by the printout displayed in Fig. 3*2.1 (a), utilizes 26 gates and 104 connections to produce a single 5-variable output function. Only uncomplemented variables are available as inputs to the network. The output from NETTRA-G2 next shows the complete truth table for all of the gates of the original network (Fig. 3*2.1 (b)). This is followed by a description of the network's configuration (Fig. 3*2.1 (c)). Every 29 Fig. 3.2.1 Initial Printout Describing a Network to be Transformed by NETTRA-G2. ******* 5 VARIABLE, 1 OUTPUT TEST NETWORK NUMBER OF VARIABLES = 5 NUMBER OF FUNCTIONS = 1 COST COEFFICIENT A = 100 B = 1 — UNCOMPLEMENTED VARIABLES X — FUNCTION NO. 1. 10000101100011101100000111001011 ORIGINAL NETWORK COST= 26lOk (a) Heading information and network parameters, 30 TRUTH TABLE Xl=00000000000000001111111111 111111 X2 =00000000111111110000000011111111 X3 = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Xk =00110011001100110011001100110011 X5 =01010101010101010101010101010101 1=100001011000111011000001110 0. 1011 2=10000000000000000000000000000000 3=01000000000000000000000000000000 ^=011100000000 0000000 0000000 000 5=00001000000000000000000000000000 6=00101010000000000000000000000000 7 = 10000000100000000000000000000000 8=01000000010000000000000000000000 9 = 00100000001000000000000000000000 10 =11111111000000000000000000000000 11 =11001100110011000000000000000000 12 =10101010 10 1010100000000000000000 13 =00000000000100010000000000000000 Ik =11000000000000001100000000000000 15 =00110000000000000011000000000000 16 = 1 1 17 =00001000000000000000 100000000000 18 =11001100000000000000000000 00000 19 =00000000000000000000 110000000000 20 =00101010000000000010101000000000 21 =10000000100000001000000010000000 = 00100000001000000010000000100000 23 =1100000011000000 1100000011000000 2k =00110000001100000011000000110000 :10001000100010001000100010001000 26=00000000000000000000010000000100 (b) Truth table for original network. 31 GATE .. LEVEL FED BY 1 /I/ 3' ^ 5 689 2 /3/ XI X2 X3 Xk X5 3 /2/ XI X2 X3 Xk 2 k /2/ XI X2 X3 2 5 /2/ XI X2 Xk X5 2 6 /2/ XI X2 X5 2 7 /3/ XI X3 xk X5 8 /2/ XI X3 x^ 7 9 /2/ XI X3 X5 2 7 10 /3/ XI X2 11 /3/ XI X^ 12 /3/ XI X5 13 /2/ XI 10 11 12 Ik /3/ X2 X3 Xk 15 /2/ X2 X3 Ik 16 /3/ X2 X3 Xk X5 17 /2/ X2 Xk X5 16 18 /3/ XI X2 X^ 19 /2/ X2 Xk Ik 16 18 20 /2/ X2 X5 2 16 21 /3/ X3 xk X5 22 /2/ X3 X5 21 23 /3/ X3 Xk 2k /2/ X3 23 25 /3/ xk X5 26 /2/ Xk 11 lit 18 23 25 9 13 15 17 19 20 22 2k 26 (c) Configuration of original network. 32 Fig. 3.2.2 Transformed Network Obtained by NETTRA-G2 Without Option (see text). NETWORK DERIVED BY PROCIV TIME ELAPSED= 217 CENTISECONDS TRUTH TABLE XI = 00000000000000001111111111111111 X2 =00000000111111 110000000011 111111 X3 = 1 1 1 1 1 1 1 1 1 1 1 1 01 1 1 1 xk =00110011001100110011001100110011 X5 =0 101010101010101010101010 1010101 1=10000101100011101100000111001011 2=11111111111111111111111111. 111.1 11 3=11111111111111111111111111111111 If = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 11 1 1 1 1 1 5=11111111111111111111111111111111 6 = 11111111111111111111111111111111 7=10101010101010101010101010101010 8=01010000010100000000000000000000 9 = 11111111111111111111111111111111 10 =11111111000000001111111100000000 11 =11111111111111110000000000000000 12 =11111111111111111111111111111111 13 =00000000000100010000000000000000 Ik = 11111111111111111111111111111111 15 = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 r 1 1 1 1 1 16 =11000000110000001100000011000000 17 = 1111111 111111 1111 1111111 1111 11 11 18 = 11111111111111111111111111111111 19 = 11111111111111111 111. 1111 11111111 20 =00101010000000000010101000000000 21 = 11111111111111111111111 111111 111 11111111 11111111111111111111 1111 11001100110011001100110011001100 : 1 1 1 1 1 1 1 1 11111111111111111111111111111111 = 00000000000000000000010000000100 (a) Truth table for transformed network. 33 GATE . . LEVEL FED BY 1 /I/ 8 13 20 2k 26 2 /!/ 3 /V k /I/ 5 /V 6 /I/ 7 /3/ X5 8 /2/ XI X3 7 9 /I/ 10 / 3/ X2 11 1 3/ XI 12 /I/ 13 /2/ XI 7 10 23 Ik /I/ 15 /I/ 16 /3/ X3 xk 17 /I/ 18 /!/ 19 /I/ 20 /2/ X2 X5 16 21 /I/ 22 /I/ 23 /3/ xk 24 /2/ X3 16 25 ' /!/ 26 /2/ x4 7 11 16 * A NETWORK DERIVED BY PROCIV COST= 11027 (t>) Configuration of transformed network. 3^ Fig. 3»2.3 Transformed Network Obtained by NETTRA-G2 With Option (see text). NETWORK DERIVED BY PROCIV TIME ELAPSED = 320 CENTISECONDS TRUTH TABLE XI =000000000000000011111. 111. 11 111111 X2 =00000000 11111111000000001 11 11 111 X3 =0000 1111000011110000111100001111 Xh =001 10011001 100 11001100 1100110011 X5 =0 1010 101010101010 1010101010 10101 1=1000010 1100011101100000111001011 2=11111111111111111111111111111111 3=11111111111111111111111111111111 k = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 5=11111111111111111111111111111111 6=11111111111111111111111111111111 7=101010101010 101010 1010 1010 101010 8=010100000 10100000000000000000000 9=11111111111111111111111111111111 10 =11111111000000001111111100000000 11 =11001100110011000000000000000000 12 =11111111111111111111111111111111 13 =00000000000100010000000000000000 Ik =11111111111111111111111111111111 15 =11111111111111111111111111111111 16 = 11000000 110000001100000011000000 17 =11111111111111111111111111111111 18 =11111111111111111111111111111111 19 =11111111111111111111111111111111 20 =001010100000000000 10101000000000 21 =1111111111111111 1111111. 1111111. 11 22 =11111111111111111111111111111111 23 =11111111111111111111111111111111 .00110000001100000011000000110000 11111111111111111111111111111111 = 00000000000000000000010000000100 (a) Truth table for transformed network. 35 GATE . . LEVEL FED BY 1 /!/ 8 13 20 2k 26 2 /!/ 3 /!/ k '/!/ 5 /I/ 6 /I/ 7 /3/ X5 8 /2/ XI X3 7 9 /I/ 10 /3/ X2 11 /3/ xi xh 12 /V 13 /2/ xi 7 10 11 ill /I/ 15 /I/ 16 /3/ X3 xh 17 /I/ 18 /I/ 19 /I/ 20 / 2/ X2 X5 16 21 /I/ 22 /I/ 23 /I/ 21+ /'2/ X3 16 25 /I/ 26 /2/ x4 7 11 16 * A NETWORK DERIVED BY PROCIV COST= 10027. • (b) Configuration of Transformed Network. 36 gate is listed accompanied by a list of the gates and/or external variables which are its inputs. If NETTRA-G2 is used without the option just discussed (i.e., when PROCIV calls PROCII for gate PORDER(l), calculations are carried out only for GCO € S(PORDER(l))), the final result would be as shown in Fig. 3.2.2. The truth table for the transformed network appears in Fig. 3*2. 2(a) (re- member that outputs for disconnected gates are shown as all l's). The required computation time for the transformation, 2.17 seconds, is also recorded. Fig. 3*2. 2(b) contains a description of the corresponding net- work consisting of 11 gates and 27 connections. However, if NETTRA-G2 is used with the option (i.e., when PROCIV calls PROCII for gate PORDER(l), calculations are carried out for every gate GCO in the network), the printed results would appear as in Fig. 3*2. 3« Again, Fig. 3«2.3( a ) shows the truth table corresponding. to the transformed network, and Fig. 3- 2. 3(b) presents a description of the network's config- uration. Note that in this case, the computation time has increased to 3.20 seconds while the network size has been further reduced to 10 gates and 27 connections. 37 k. MAJOR FUNCTIONS OF COMMON SUBROUTINES The subroutines realizing the 2 procedures presented in Sections 2 and 3 share the support of the following seven subroutines whose principal functions will be discussed in this section: MAIN, CONCCO, ELANDO, MINI2, OUTPUT, RNONES, SUBNET. Complete program listings of these seven subroutines can be found in the appendix along with the listings of the subroutines realizing the previously described procedures. The functions of the common subroutines are as follows: MAIN : This subroutine repeatedly reads in groups of input data which include information about the given networks, e.g., the number of external variables, whether or not the complements of variables are also available as input variables, the number of output functions, the number of NOR gates, the list of connections, and the truth table of the output functions (see Section 5 for details). Using this information, MAIN constructs the incidence matrix, INC$MX, for the network. INC$MX is a two-dimensional array whose arguments represent gates or external variables. An array element INC$MX(A1, A2) > 1 indicates a connection from Al to A2; an array element INC$MX(A1, A2) < indicates the absence of a connection from Al to A2. Next, subroutine SUBNET is called to calculate the level of each gate and to make lists of predecessors and successors (i.e., which gates precede which and which gates succeed which). MAIN then prints out the truth table and the constructed incidence matrix of the original network by calling the subroutine OUTPUT. Finally the desired transduction procedure is applied to the network by calling the subroutine (s) realizing the transformation. The configuration 38 of the transformed network is stored in INC$MX, replacing the original net- work. Then MAIN prints the results of the transduction procedure, i.e., the elapsed time for the transformation, the new incidence matrix, and the new truth table. CONCCO : During the execution of subroutine PROCII (which is involved in both of the transduction procedures described in this manual) sometimes a gate P (or a gate EFFCON) must be connected to a gate GCO (see blocks 15 and 21 of Fig. 2.1.2). Calling CONCCO (GCO, CCO) connects gate CCO to gate GCO and updates most of the arrays which are involved. Subroutine CONCCO has a second entry point, CNCCO. Calling CNCCO (GCO, CCO) has the same effect as calling CONCCO (GCO, CCO), except the call to CNCCO bypasses the update of the array INPTCV. ELANDO : This subroutine, when called specifying the necessary argument GATE (e.g., CALL ELANDO( GATE)), eliminates non-essential (redundant) input connections to gate GATE and orders the remaining connections in a list L according to decreasing numbers of essential l's. This process, used in blocks 10 and 18 of the flowchart for PROCII, was discussed in detail in Section 2.1. If all of the input connections to a gate GATE are already known to be essential or if the non-essential connections are not to be removed, a call to ELANDO 's entry point, ORDERL(GATE), will perform just the ordering function, making no attempt to search for and remove non-essential inputs to GATE (as in block 22 of PROCII, Fig. 2.1.2). 39 MINI2 : MINI2 is a subroutine which realizes a pruning procedure (i.e., it transforms a network strictly by removing connections). In NETTRA-G1 and NETTRA-G2, it is used as a fast "clean-up" procedure to remove some of the redundant connections remaining after the main transformations have finished, MINI2 is described in some detail in [3]. OUTPUT : This subroutine may be entered at five different points by a call to either OUTPUT, PAGE, LIKE, TRUTH, or CKT. OUTPUT assigns mnemonic names to external variables and gates for the purpose of achieving a readable print-out. PAGE ejects one page on the printer. LINE skips a specified number of lines on the print-out sheet. The number is specified by the argument in the call (e.g., "CALL LINE(5)" skips 5 lines). TRUTH prints out the truth table of the network currently stored in INC$MX. CKT prints out the network configuration. RNONES : Whenever an input TH is removed from a gate GCO, much work must be done to update the several arrays and variables involved. The bulk of this updating is performed by a call to this subroutine, CALL RNONES (GCO, TH, FLAG). The parameter FLAG (=0, 1, or 2) is necessary since this sub- routine is called from several different points in the program whose updating requirements differ slightly. The value of FLAG during the call to RNONES determines which particular variables and arrays will be updated. ko SUBNET: This subroutine may be entered at three different points by a call to either SUBNET, UNNECE, or PVALUE. SUBNET generates detailed information on the topology of the network stored in INC$MX: (l) It calculates the level of each gate in the network. Level 1 is assigned to gates having no output connections (thus all gates which have been removed from the netv/ork will be assigned level l). (2) It lists all immediate successors and immediate predecessors for each gate. (3) It calculates the successor matrix which is stored in a two- dimensional array, SUC$MX. The value of SUC$MX(A1, A2) indicates the existence or non-existence of a path from gate (or exteral variable) Al to gate A2. UNNECE disconnects certain types of obviously unnecessary connections in the network and updates the above information (discussed in (l), (2), and (3))- The connections removed from the given network are those existing in no paths from the external variables to the output gates. PVALUE calculates the actual truth table for the entire network stored in INC$MX. hi 5. INPUT DATA SETUP In order to fully understand the description of the setup of the input data cards, certain preliminary explanations are necessary. The purpose of network transductions is to reduce the cost of a network which realizes a certain function (or functions) or to alter the network in such a way as to allow another transduction to eventually accomplish such a reduction. This cost, C, is formally defined by the weighted sum of the number of gates, R, and the number of connections , I, of a particular network, i.e., C=AXR + BXI where weights A and B are arbitrary non-negative numbers. Suppose the original network which is to be transformed produces m output functions of n variables. Let Xp, I = 1, . . . , n, be the external variables and f , h = 1, . . . , m, be the output functions. Before a transformation can be performed on a network by a program, a description of that network must be input to the program. In the case when all of the output functions are completely specified (i.e., no "don't cares"), specifying only the interconnection pattern of the network is sufficient. But if one or more of the output functions is not completely specified, then the user must also provide the truth table (truth tables for all output functions are condensed into a single table) of the problem. Providing the truth table to the program consists of two steps, t A "connection" refers to either a connection from an external variable or an interconnection between two gates. k2 namely the specification of external variables, and the specification of output functions. • The method of specifying the output functions depends directly upon the method chosen to specify the external variables. External variables may be specified in either of two ways, (a) an implicit specifi - cation of external variables , or (b) an explicit specification of external variables , (a) In the case of implicit specification of external variables, the user specifies the number n of external variables along with a parameter which indicates whether or not the uncomplemented variables are available. Reading the value n along with the parameter, the program internally generates the entries of external variables of an ordinary truth table, that is, a truth table which consists of 2 input vectors, as shown in Fig. 5.1. In this truth table, the input vectors are arranged according to the order such that an integer j expressed in a binary representation (x . ..x ) increases, where x is the most significant digit and x is the least significant digit. For example, the truth table for a function of three variables is shown in Fig. 5.2. The implicit specification of external variables is used for logical design problems in which the output functions have relatively few don ' t-care terms . h3 The uncomplemented variables The complemented variables The output functions : X x. : X V- m x 1 ' X • • -A. • • . x. -0 . x; -0 x n n f° f J 2 n -1 2 n -l . x -2 n -l . x -2 n -l 1 J ,2 n -l i 2 n -l f f d f m m m These entries exist only in the case of logical design problems where the complemented variables are available as external inputs. Fig. 5.1 The truth table of output functions of n variables x l 1 1 1 1 X 2 1 1 1 1 x 3 1 1 1 1 *1 1 1 1 1 (O *2 1 1 1 1 *3 1 1 1 1 oj JO 7 f n f n f. 1 1 1 These entries exist only in the case of logical design problems where complemented variables are available as input variables . Ig. 5.2 The truth table of a function of three variables, hh (b) In the case of explicit specification of external vari- ables, the user specifies the entries of external variables of the truth table using additional cards called < external -vari- able-card > s. The explicit specification of external variables is used in the case of logical design problems where output functions have many don't-care terms. Suppose that the output functions are defined for a subset of input vectors of the entire truth table of Fig. 5.1. Let x J , j = j , j ..., j denote these input vectors. The user can 'condense' the truth table of Fig. 5.1 into another table shown in Fig. 5.3. only [X input vectors The uncomplemented variables The complemented variables C h x l • • • • • • X I n h X n c — -h x l x i ( '■ • • • • X X n f l f i • • • • • • f m J l f - 1 m X, X Or) . c n J 2 1 * x x^ x l *\ _J 2 X n ' x^ » • A. n J These entries exist only in the case of logical design problems where the complemented variables are avaiable as external inputs . IN m Fig- >»'" A 'condensed' truth table having only the input vectors x^, j = 'V' for which the out Put functions are defined. >1» h5 Using < external-variable-card > s, the user can set up internally the table of Fig. 5.3 in place of Fig. 5.1. 5.1 Input Data Card Format For each separate problem, a set of input data cards must be t submitted which consists of the following : (i) < heading -card > (ii) < problem-parameter-card > (iii) < external-variable-card > s I > omitted for (iv) < output -function-card > s J certain cases (v) < connection-description-card > s Both (i) and (ii) will always consist of only a single card, but (iii), (iv), and (v) may each consist of several cards. Furthermore, types (iii) and (iv) are omitted if all output functions are completely specified, and (iii) need only be prepared in the case of the explicit specification of external variables for the truth table. Following is a description of the formats for each type of input card, (i), (ii), (iii), (iv) and (v): (i) < Heading -card > This is the first card of the input deck for a problem. This card may contain any alphanumeric information, in columns 1~80, which may be used for the identification of the problem, but none of the information on this card will be used in the actual computation, This information will be printed on the first page of the output. t The current implementations of the NETTRA programs accept only heading, problem-parameter, and connection-description cards. Eventually it is hoped that these programs will be modified to accept all of the options described in this section. 1+6 (ii) < Problem-parameter-card > This card specifies the nature of the problem the user wants to solve. There are 7 fields in which to specify the parameters with characters and numerals „ These fields are as follows: Cols. 1~U: An integer, N, which is right- justified. This number, N, represents the number of external variables, n, of the output functions. Be sure to punch n (rather than 2n) for N in the case of both complemented and uncomplemented variables available . Cols. 5~8: An integer, M, which is right-justified. This number, M, is the number of output functions, m, to be realized simultaneously. Therefore, of course, M will also be the number of output gates in the network. Cols. 9~12: An integer, R, which is right-justified. This number, R, specifies the number of gates which are included in the network. For various reasons, the user may wish to input networks in which one or more of the gates are "isolated" (i.e., are not connected to any other gates). This is permissible as long as these "isolated" gates are also included in the total number of gates, R. Cols. 13~l6: An integer, A , which is right -justified. The number A is the value of the non -negative weight for the number of gates in the cost function. (See Table 5.1.1, 'Typical combinations of values A and B for different network reduction problems ' . ) ^7 Cols. 17~20: An integer, B , which is right- justified. The number B is the value of the non -negative weight for the number of connections in the cost function. (See Table 5.1.1.) Col. 2k: A blank 'b , + , or one of the characters, 'C, 'X', 'Y', •IT or T. The 'b' or 'C parameter represents an implicit specification of both the external variables and an implicit specification of the output functions (in this case, the output functions will be calculated from the connection pattern of the network). The 'X' or 'Y' parameter indicates an implicit specification of external variables only . The 'U' or 'V parameter indicates an explicit specification of external variables . (See summary of these symbols in Table 5.1.2) The 'b' or 'X' parameter specifies that only uncomplemented external variables are available for the network. The 'C or 'Y' parameter specifies that both uncomplemented and complemented vari- ables are available for the network. If the user specifies the 'b', 'X', 'C r , or 'Y r parameter, the program sets up the truth table by generating a set of 2 input vectors (x , ..., x ), for j = 0, ..., 2 -1, in the case of a 'b ' or 'X' parameter, or (x , ..., x , x , ..., x J ) for o = 0, ..., 2 -1, in the case of a 'C or 'Y' parameter. The 'b' or ' C parameters should be used for problems in which the output functions contain no don't-care terms. For such problems, the preparation of the < external-variable-card > s and the < output- function-card > s can be dispensed with since the program can calcu- late completely all output functions using only a description of the t A 'b' stands for a blank (i.e., no character punched). UQ Network Reduction Problem Values of A and B reducing the number of gates only. A = 1 and B = reducing the number of gates primarily, then reducing the number of connections secondarily. A = 100 and B = 1 reducing the number of connections only. A = and B = 1 reducing the number of connections primarily, then reducing the number A = 1 and B = 100 of gates secondarily. reducing the sum of the number of gates and the number of connections. A = B = 1 Table 5.1.1 Typical combinations of values A and B for different network reduction problems. Most of the programs in the NETTRA system are oriented toward this reduction problem, so the user will probably find this combination of A and B the most useful. h9 uncomplemented variables only available both complemented and uncomplemented variables available 'b' •c *X' , Y , ■U' •V' implicit specification of external variables and output functions implicit specification of external variables explicit specification of external variables Table 5.1.2 Possible symbols for column 2k of < problem-parameter-card >. 50 connection pattern of the network (provided by the s ) „ Similarly, the 'X' or 'Y' parameter implies the use of a complete truth table (i.e., 2 input vectors for n external variables) inside the program. Since from this information the program can easily generate the truth table entries for the external variables, as just mentioned, the < external -variable -card > s are unnecessary. The m < output-function-card > s, however, must still be prepared. The 'U' parameter specifies that only uncomplemented external variables are available for the network. The 'V parameter specifies that both uncomplemented and complemented variables are available for the network. In either case, the 'U' or the 'V parameter, the user must prepare n < external -variable-card > s and m < output- function-card > s. The program sets up the truth table by reading these < external-variable-card > s and < out put -function -card > s. Cols. 25~28: An integer, NEPMAX, which is right-justified. This parameter is omitted for all NETTRA programs except those involving "error-compensation" routines. In the cases where NEPMAX is required, a further discussion of this parameter can be found elsewhere in the manual. The abbreviation NEPMAX is a mnemonic for "maximum number of error positions", and the default is (n - 1 ) NEPMAX =2 , where n is the number of external variables. (iii) < External-variable-card > s In combination with the 'U' or 'V parameter in column 2k of the < problem-parameter -card >, the n < external-variable -card > s specify the entries of external variables of the truth table of 51 Fig. 5.3. Each card contains the binary representation of external variable x„, i.e., {xp , x , 2 , . .., xJ^ ), starting from column 1 of the card. The maximum number of bits in a binary representation is limited to 32. (This means the maximum number of input vectors is 32.) If the actual number of bits is less than 32, then a termination symbol '/' (slash) is put on the right of the right-most bit of the binary representation on the first < external-variable- card >. The remaining columns after the termination symbol '/ ' in the first card, as well as the same columns in the following cards, may contain any alphanumeric information which may be used for identification. This information will not be printed on the output pages . In the case of the 'V parameter, the program generates the binary representations corresponding to complemented variables by taking negations of the entries of the < external-variable-card > s. Therefore the user must not provide < external-variable-card > s representing the complemented variables, x«. If one of the parameters 'b', 'C, 'X', or 'Y' appears in column 2k of the < problem-parameter -card >, the user does not prepare < external- variable-card > s. (iv) < Output -function -card > s The m < output -function-card > s specify the set of m output functions to be realized simultaneously. Each card contains the binary representation of one output function f , starting from column 1 of the card. A symbol '*' is used to denote don't-care terms, if any. The maximum number of bits in a binary representation is limited to 32. 52 The actual number of bits must be 2 in the case of an implicit specification of external variables , or must be the same as defined by. the < external-variable-card > s in the case of an explicit specification of external variables. The remaining columns, up to column 72 (inclusive), may contain any alphanumeric information which may be used for identification. This information will not be printed on the output pages. If either the 'b' or 'C parameter appears in column 2k of the < problem-parameter-card >, the < output -function-card > s must be omitted . (v). < Connection-description-card > s In the present version of the program, 9 cards (some of which may be just blank cards) are required. Each of these cards is divided into l6 fields of 5 columns each (i.e., columns 1~5> 6~10, 11-15, ..., 71~75, 76~80). Beginning with the first field of the first card, continuing through the succeeding fields of that card and through the fields of as many additional cards as necessary (up to a maximum of 9, total), the expressions (explained in the next paragraph) C , Cp, CL, ..., are punched right- justified in their respective fields. Each gate of the network is labeled uniquely by assigning it one of the integers 1, 2, ..., R, such that the output gates receive t For many uses, the user will probably find that these 9 cards far exceed his needs, and may thus be inconvenient. In such a case, the number of required cards may be easily adjusted by making the obvious changes in two statements (A READ statement and a DO statement) following the comment card "C**** READ IN NETWORK INFORMATION AND SET UP INC$MX *****" i n subroutine MAIN. 53 the labels 1, 2, . .., m. The names XI, X2, ..., Xn are assigned to the external variables x_ , x , ..., x (and the names Yl, Y2, .... Yn 1' 2' ' n v ' ' ' to the complemented external variables x , x , ..., x , if appropriate). Now, for each connection of the network (i.e., including both the connections from external variables to gates and connections from gates to other gates), a h character expression, C, is formed, to represent that connection as follows: to represent a connection from gate GI to gate GJ, the numeric label GI is inserted into the first two character positions of C. and the numeric label GJ is inserted into the second two positions (e.g., the C. for a connection from gate 9 to gate 5 would be "0905"); to represent a connection from external variable XI to gate GJ, the alphanumeric label XI is inserted into the first two character positions of C. and the numeric label GJ into the second two positions (e.g., the C. for a connection from external variable x to gate 10 would be "X310"). Every connection of the network must be represented by a C., although there are no restrictions on the order in which the connec- tions (i.e., C.'s) are punched onto the input cards. t At the time of writing, the programs have not yet been changed to recognize this new labeling system. The old labels are simply: 1, 2, ..., n, for external variables x , x^, ..., x^ (and n + 1, n + 2, ..., 2n for the complemented variables x , x^, . .., x n , if they are permitted in the problem); n + 1, n + 2, „.., n + m for the m output gates of the network (2n + l, 2n + 2, ..., 2n + m if complemented variables are included); and finally n + m+1, n + m + 2, ..o, n + R (2n + m+l, 2n + m+2, ..., 2n + R) for the non-output gates of the network. ^ These five groups of cards, (i), (ii), (iii), (iv) and (v) in the correct order constitute the necessary description for a single problem. In order to solve several problems during the same computer run, the descriptions for the desired problems are just arranged serially. See Fig. 5«1«1 f° r an example of the sequencing of all cards for the execution of a NETTM program using typical JCL statements for the IBM 360/75. 55 The Program r k. The Input Data Cards \ //ID ... // EXEC FORT //FORT. SYS IN DD* FORTRAN PROGRAM SUBROUTINES /* // EXEC LKED // EXEC GO //GO.SYSIN DD * \ < heading -card > . \ < problem-parameter-card > f < external-variables -card > s r < output-function-card > s -\ The first problem C< connection-description-card > s f< heading -card > z r a c r The second problem f< heading -card > c E c The last problem Fig . 5.1.1 Input card sequence for the execution of a typical NETTRA program. 56 5.2 Restrictions on Problem Size In order to fit the programs into a finite amount of space, some restrictions on the size of an acceptable problem are required: 1. The number t of input vectors in the truth table is 32 or less. 2. The number n of external variables. Because of t < 32, n is 5 or less in the case of completely specified functions. In the case of incompletely specified functions, however, any n < 20 is acceptable if only uncomplemented variables are avail- able, or n < 10 if both uncomplemented and complemented variables are available, provided that the truth table is defined by the < external -variable-card > s. 3. The number R of gates. The number of gates, R, may not exceed ^0-n in the case of only uncomplemented variables available (a 'b', 'X', or 'U' parameter). In the case of both uncomplemented and complemented variables available (a 'C, 'Y' or 'V parameter), the limit is lowered to U0-2n. All of these limitations are essentially imposed by the array sizes in the programs as presently written. To loosen the restrictions is mainly a task of increasing array dimensions appropriately. 5.3 Examples of Input Data Setup The following examples will illustrate, for the general program in the NETTRA system, various possible input data card setups complying with the directions given in Section 5.1. 57 Example 1 ; A two output network of four variables shown in Fig. 5.3.1. Assume the two output functions are f = CCEF and f = 3BBB and only uncomplemented variables are available. Furthermore, assume it is desired to reduce the number of gates primarily and the number of connections secondarily (see Table 5.1.1). From this description, the < problem-parameter-card > must contain the following values : Cols. l~k k, the number of external variables Cols. 5~8 2, the number of output functions Cols. 9~12 8, the number of gates in the original network Cols. 13~l6 100, the value of A Cols. 17~20 1, the value of B Cols. 2h 'b', uncomplemented variables only available and implicit specification of both the external variables and the output functions Cols. 25~28 'b', since the NEPMAX parameter is unrelated to the program to be used Fig. 5.3.2 shows the setup of data cards used to specify the network in Fig. 5.3.1 as input for the program. Notice that in forming the C. , the four uncomplemented variables are represented by the labels XI, X2, X3, XU; the two output gates by the numbers 1, 2; and the remain- ing gates, by the numbers 3, h, 5? 6, 7 5 8. This manner of labeling is t For convenience, the output functions are expressed in hexidecimal notation. When the numbers in this notation are expanded into binary, they represent the output vectors as they appear (i.e., in the same left-to-right order) in the complete truth table described earlier and pictured in Fig. 5.1. ++ This assumption is implicit in most of the transduction procedures and their implementations which comprise the NETTRA system. 58 Fig . 5.3.1 Network to be transformed in Examples 1 and 2, 59 OO o OJ pq H PQ CO oo o i H II X s' E-- o o _H- H X o t~ p o & CO g' «' OJ 1 oo 1 X 1 LT\ 1 o o oo o • • « 1 • • II • • LT\ 1 -H- -=J- o \s 3- oo a- cm t- o 33 -4- OO On O E5 on oo t>- 5 on c— ph novo i no ir\ jJr EH oo-=t- o 3 oo oo «, OO OJ 1 OO H 1 oo O _=r 1 OJ o\ o M OJ OO M3 ps OJ c— o OJ MD j^ OJ LT\ OO E-i OJ -=f O W OJ oo vo B OJ OJ i OJ H OJ o H ON oo o H a H 00 H i 3 H t- W i H H\D O g H IT\ OJ o H _=t" o H > H OO LT\ i H OJ CO j- H H 1 O UN H O I I EH O OO O t- -=t- OJ 1 i O VO 1 g O LT\ H 1 o j- O -=!■ O O OO OO 1 O OJ 1 OJ O H • « • 1 i a i a o •H •H .« -P -P c O Ph crt CD •H 05 H c ^ nri ^J (3 O U co 3 CO o 0) o c *d O ^H •H cti ■d -P CJ h >d CJ 1 I ^ U d Kl O a3 H W *H 0) 0) d & •d Ph H CU H & £ c •rl C CD > •H bO H CD -P •H O CD Ph co O -P co •d a3 I o & •p CO CD H £> •H co CO OJ o OO •H Ph 6o strictly required by the instructions for preparing the < connection- description-card > s (see Section 5.1). The heading card in Fig. 5.3.2 will simply be read by the program and printed character for character onto the output page as an identifica- tion of the particular problem. Below that, the number of variables, number of functions, and the cost coefficients, A and B, will be printed (all with appropriate labels). Also, immediately following will be a statement of what types of external variables are permitted (i.e., either just uncomplemented variables or both complemented and uncomplemented) along with their generic names: X - for uncomplemented variables Y - for complemented variables or U - for uncomplemented variables V - for complemented variables if external variables were implicitly specified if external variables were explicitly specified For example, if both X and Y appear as generic names (as would occur in the case of an implicit specification of external variables with both complemented and uncomplemented variables available) then the external variable names which appear on subsequent output pages will be XI, X2, . . . , Xn and Yl, Y2, . . . , Yn. Or, if both U and V appear as generic names (as would occur in the case of an explicit specification of external variables with both complemented and uncomplemented variables available) the external variable names which appear in the output will be Ul, U2, ..., Un (for the uncomplemented variables) and VI, V2, ..., Vn (for the complemented variables). It should be noted, however, that the letters J and V, as used as replacements for X and Y (respectively) in the 61 naming of external variables (e.g. Ul, VI instead of XI, Yl), appear strictly on the output pages of the program - they are not used internally in the program and they must not appear in the variable names punched on the < connection-description-card > s by the user. They are intended only as an aid to the user so that, at a glance at the transformed network in the output, he can easily distinguish whether the external variables were implicitly or explicitly specified for that particular problem. Following the statement of whether only uncomplemented or both complemented and uncomplemented external variables are employed, the user will find next on the output page the cost of the original network which was input to the program. This is the cost which was defined in the beginning of Section 5. The cost will be followed by a truth table (generally in the same form as Fig. 5.1) showing the outputs (0 or l) of all of the gates in the network for every external variable input combination (i.e., combina- tions of 0's and l's) of interest. Finally, below the truth table will be printed a description of the network submitted as input. This is for documentation purposes, and it is also much more readable than the network description which appeared on the < connection -description-card > s. In this description, each gate is listed along with the names of the gates and external variables which feed it. Also, to assist the user in sketching the network from its description, the level of each gate in the network is included (gates which do not feed other gates are assigned to level 1, all other gates are assigned level numbers such that each gate is in a level one 62 higher than the highest level gate directly fed by it). All of the information just described will be printed before the execution of the transduction actually begins. This will be followed, begin- ning at the top of a new output page, by the network(s) actually obtained as a result of the computation. First the complete truth table of the transformed network will be printed, followed by a network con- nection description of the form just described above. Finally, the cost of the new network will be calculated and printed. In this example, it was assumed that there were no "don't-cares" in the output functions implicitly specified by the input, thus no < external-variable-card > s or < output-function-card > s were included. In the next example, however, < output-function-card > s will be required in order to specify some of the components of the output functions as "don't-cares". Example 2 : The two output network of four variables shown in Fig. 5.3.1. This is the same network used in Example 1, but this time the output functions are not assumed to be completely specified. Let f = ' H001**01*10*lll ' and f g = ' 0*-*110111*111011 ' be the required functions. Also, suppose that both complemented and uncomplemented variables are desired to be available during the transduction. Again the problem is to reduce the number of gates primarily and the number of connections secondarily. For this problem, the following values must appear on the < problem-parameter -card >: Coir;. l~i+ k, the number of external variables Cols. 5~8 2, the number of output functions 63 Cols. 9~12 Cols. 13-16 Cols. 17-20 Col. 2k 8, the number of gates in the original network 100, the value of A 1, the value of B Y, indicative of an implicit specification of external variables and the availability of both complemented and uncomplemented variables Fig. 5-3-3 shows the setup of the data cards corresponding to this problem. Notice the differences and similarities to the data cards shown in Fig. 5-3-2. The < problem-parameter-card > differs only in column 2k. The < external-variable-card > s are missing in both Fig. 5-3-2 and Fig. 5-3-3 since the external variables are implicitly specified for both problems. The < output- function-card > s, however, appear in Fig. 5o3»3 but not in 5-3-2 since they are necessary to specify "don't- care" components which do not occur in the completely specified output functions of Example 1. In both cases, though, the < connection-description- card > s are identical since the original networks are identical. By allowing "don't-care" terms in .the output functions, and by allowing the use of both complemented and uncomplemented variables (even though the original network employed only uncomplemented variables), the restrictions during the transduction process are loosened (compared to what they were for Example l), perhaps permitting a network of t In the case of NETTRA-PG1, -PI, and -P2, it is useless to specify Y rather than X in column 2k for this example. Since the original network uses only uncomplemented variables, to these programs which perform "pruning" procedures (i.e., procedures which are incapable of adding new connections) the availability of complemented variable is not meaningful. 64 CO o D- On H H H O O ON O 00 O t>- O V£) O LT\ O -=f 8 m CM O H CO o 0J X H CO H o O H H X H H t- * o H 9 o t- H o H CO O v£> II O oo & X J ir\ H O H oo CM H H >< 1 W * O IT\ EH EH H O «aj <; * fr- i 3 i H O J" g s % o fe PH p£] VO, M « 1 1 H 1 oo H H o i PQ H i 3 M I M CM Pi" H H O O g O o H H >, IT\ H * t H O CO Jt, H H i H * * I *\ O H H I EH J- H H O CM 1 1 O 1 Eh H H H 1 p O H o J- O, OO 1 o 1 1 H 1 corresponds to the output of gate 1 and the second < output -function-card > corresponds to the output of gate 2. This must hold true for every problem in which < output-function-card > s are included; the gates labeled 1, 2, ..„, m must correspond to the output functions specified on < output-function- card > s 1, 2, ..., m, respectively. Of course, the printed output of the program will be in the same format described in Example 1. Example 3 - The three output network of six variables shown in Fig. 5.3.^-. The outputs are again assumed to be incompletely specified. In fact, only the following 11 input combinations are specified out 6 of a possible 6k ( = 2 ) : x l 00000000001 X 2 00000001110 x 3 00000000011 \ 00001110001 X 5 00110010110 x 6 01010101100 F l 001100*0000 F 2 11*1110110* 11000001000 66 H £ OJ OO VO X K * H PO -=f ?s ?s ?s H OJ LT\ rS r*S **S H & C •H id 0) S Ph o Ch 03 C ctf in -P (D & o -p M U o % -P OO (3D ■H 67 Additionally, only uncomplemented variables are assumed to be available, and the problem is to reduce the number of gates primarily and the number of connections secondarily. For this example, the following parameters appear on the < problem-parameter-card >: Cols. l~k 6, the number of external variables Cols. 5 ~ 8 3 5 the number of output functions Cols. 9 ~ 12 11, the number of gates in the original network Cols. 13~l6 100, the value of A Cols. 17-20 1, the value of B Col. 2k U, indicative of an explicit specification of external variables and the availability of only uncomplemented variables Fig. 5*3.5 shows a possible setup of the data cards corresponding to this example. Notice that in this example, the s are included, whereas in the two previous examples they were omitted. Although this problem is not too realistic (none of the 3 functions is actually a 6-variable function), it demonstrates the input data preparation to be used in cases where many external variables are present and a high percentage of "don't care" terms exist. Again, the printed output from the program will follow the same format described in Example 1. 68 H on H £1 H O O ON O 00 O r- O vO O LTN o j- O PO Q C\J O H 69 REFERENCES [l] Y. Kambayashi and J.N. Culliney, "NOR network transduction procedures based on connectable and disconnectable conditions (Principles of NOR network transduction programs NETTRA-G1 and NETTRA-G2 ) , " to appear as a Report, Dept. of Comp. Sci., Univ. of 111., Urbana, 111. [2] Y. Kambayashi and S. Muroga, "Network transduction based on permissible functions (General principles of NOR network transduction NETTRA programs)," to appear as a Report, Dept. of Comp. Sci., Univ. of 111., Urbana, 111. [3] H.C. Lai and J.N. Culliney, "Program manual: NOR network pruning procedures using permissible functions (Reference manual of NOR network transduction programs NETTRA-PG1, NETTRA-P1, and NETTRA- P2)," Report No. UIUCDCS-R-7I+-686, Dept. of Comp. Sci., Univ. of 111., Urbana, 111., Nov. 197^. 70 APPENDIX: Program Listings Following are the listings of the FORTRAN programs NETTRA-G1 and NETTRA-G2. These programs realize, respectively, the transduction procedures discussed in Sections 2 and 3« Since NETTRA-G2 differs just in two subroutines from NETTRA-G1, only those two subroutines are listed for NETTRA-G2: MAIN (differs only slightly from MAIN in NETTFA-Gl) and PROCIV (not contained in NETTRA-Gl). Explanations of variables used in the programs can be found in the listings themselves. c r -****»*.******************************************* ******* *********************** r * pppp RRRR 000 GGG RRRR A M M p p R R G G R R A A KM MM o P R G R R A A M M M M pppp RRRR G GG RRRR AAAAA M M M p R R G G R R A A M M p R R ooc 1 ( SGG R R A A M M C N N EEEEE TTTTT TTTTT RRRP A GGG 1 * C NN N E T TRRAA GG11 * CNNNE T TRRAA G 1 * C N NN EEE T T RRRR AAAAA XXXXX G GG 1 * CN'NE T TRRAA GG1 * C N N EEEEE T T R R A A GGG 111 * r * r * (3************4. *********** ******************************************************* r c IMPLICIT INTEGEP*4(A-T,V-Zt$) , REAL(U) Gl OOOIO C EDITION BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBPBBBBBBRBBBBBG1 00020 C NO^E: ALL CQfMCN VARIBLES MIGHT NOT BE USED IN THIS PROGRAM. Gl 00030 Gl 00040 VARIABLES: Gl 00050 POINTS TO A •COLUMN* OF PCTAB. FOR EACH 'ROW THE ENTRY Gl C0060 IN THIS COL. TELLS GATE WHERE FN. IS REALIZED. Gl 00070 POINTS TO A 'COLUMN* OF P0TA8. FOR EACH •ROW THE ENTRY Gl 00080 IN THIS COL. TELLS HOW MANY CONNECTIONS MUST BE ADDED. Gl 00090 POINTS TO A 'COLUMN 1 OF POTAB. FOR EACH 'ROW' THE ENTRY Gl 0010C IN THIS COL. TELLS THE NUMBER OF l-ERRORS CREATED IF THIS Gl 00110 ROW IS USED. Gl 00120 POINTS TO A 'COLUMN' OF POTAB. FOR EACH 'ROW' THE ENTRY Gl 00130 IN THIS COLUMN TELLS THE PREFERENCE WEIGHT. Gl 00140 WEIGHT FOR NO. OF GATES IN COMPUTING COST FUNCTION. Gl 00150 WEIGHT FOR NO. OF CONNECTIONS IN COMPUTING COST FUNCTION. Gl 00160 COST OF NETWORK - A MEASURE OF NETWORK SIZE. Gl 00170 RECORDS NO. OF ESSENTIAL 1«S IN EVERY INPUT TO CURRENT GC0G1 00180 (POSITIONS IN ESS1S CDRRES. TO GATES NOT FEEDING GCO ARE Gl 00190 IGNORED) . Gl 00200 POINTS TO LAST ELEMENT IN F$l. Gl 00210 LISTS (CCNSECUTIVELYJ POSITIONS OF DESIRABLE 1«S (FOR Gl 00220 COVERING) IN A CCNNECTIBLE FUNCTION. Gl 00230 LABEL OF A PARTICULAR GATE. Gl 00240 GLEVEL(GI) TELLS WHICH LEVEL OF THE NETWORK Gl IS IN. Gl 00250 STORES INTERMEDIATE AND FINAL CALCULATED CSPF'S. Gl 00260 HLISTCItJI GIVES NAME OF I-TH GATE (OR EX. VAR . ) IN NET- Gl 00270 WORK LEVEL J. Gl 00280 LIST OF 0-COCRDINATES IN CSPFE OF THE GATE UNDER Gl 00290 CCNSIDERATION. Gl 00300 LIST OF 0-ERROR-COCRDI NATES IN CSPFE OF THE GATE UNDER Gl 00310 CONSIDERATION. Gl 00320 LIST OF 1-COORDINATES IN CSPFE OF THE GATE UNDER Gl 00330 CONSIDERATION. Gl 00340 c COMMON c SGT: c r $LTH: C c $NOE: /• c c $PW: r p A: c R: r COST: c ESSIS: r c F iUBl: r F$l: C Gl: c GLEVEL: *■ GSMALL: c HLIST: r c IDXO: C C IDXOE: r C IDXl: C c I OX IE c c I FLAG c INC$MX c c INPTCV c r IPATH C r IPRED c c I SUCC c JFLAG c KEYA r C KEYB r ^ c KFLAG r LEVM r r LGLIS T c c LIP c LIP'ED r LT STC c r C r c c r : r r C c c c c r ■ LISTL LI SUCC LMTS2: LPOTAb M: N ME P max: MM: NT NN2: NQS: NGSl: NGS1SV: NOS2: ' . ] T 1 S v N JO NC06! NOl NClEi MR N?N2 IS PLC: LIST OF 1-ERRCR-COORDINATES CONSIDERATION. SAME AS EYEFLG IN SUBROUTIN INC$MX(GI,GJ)>0 MEANS THERE (OR EX. VAR.) GI TO GATE GJ LISTS FOR EACH CORRESPONDS HAVE A «1 # IN THE POSITION IPATH(GI)=1 MEANS GATE GI I TO AN OUTPUT GATE. OTHERWl IPRED(I,GJ) GIVES THE NAME A LIST OF GATES AND EX. VAR ISUCC(I.GJ) GIVES THE NAME SAMF AS JAYFLG IN SUBROUTIN A FLAG INDICATING IF ANY ER PERFORMED. A FLAG INDICATING BEEN COMPENSATED. SAME AS KEIFLG IN PROCII. NUMBER OF LEVELS IN THE NET ASSIGNED LEVELS JUST LIKE G LGLIST(J) TELLS NO. OF GATE NETWORK. NUMBER OF PREDECESSORS FOR LIPPFD(GI) TELLS NO. CF IMM ORDERED LIST CF CONNECTIBLE DECREASING NO. CF O'S IN GC ORDERED LIST OF GATES AND E GCC AND WHICH HAVE NOT YET DECREASING NO. OF ESSENTIAL LISUCC(GI) TELLS NO. OF IMM EX. VAR.) GI. UPPER LIMIT CF THE NUMBER FOR GATE Git LPOTAB(GI) PHI CONCERNING GI . NUMBER OF NETWORK OUTPLT GA NUMBER CF EXTERNAL VARIABLE FOR ERROR COMPENSATION PROG FtfPOR POSITIONS OCCUR WHEN PROGRAM SKIPS ATTEMPT TO CO REMOVAL. VALUE CAN BE SPEC TO CNE HALF OF N2 BY DEFAULT. SUM OF N PLUS M SU M CF NM PLUS 1. PRODUCT OF N AND N2 . IN CSPFE OF THE GATE UNDER G G E PROCII. G EXISTS A CONNECTION FROM GATE G . INC$MX(GI,GJ)=0 IF NCT. G G ENTRY OF F$l, HOW MANY INPUTSG INDICATED BY F$l. G S ON A PATH FROM A CERTAIN GATEG SE IPATH(GI) =0. G OF THE I-TH GATE OR EX. VAk. ING G G G G G G G G G G G G THE GATE UNDER CCNS I DERAT IC N. G EDIATE PREDECESSORS OF GATE GI.G INPUTS TO GCO. ORDERED BY G COVERED. G X. VAR. WHICH ORIGINALLY FED G BEEN DISCONNECTED. ORDERED BY G 1 • S . G ECIATE SUCCESSORS CF GATE (OF G G G G G G r, G G G . FEEDING GJ. OF THE I-TH GATE FED BY GJ . E PROCII. ROR COMPENSATION HAS BEEN IF ANY PRIMARY 0-ERPOR-COORDI NAT ES HAS WORK (NOTE EX. VAR. ARE ALSO ATESI. S AND EX. VAR. IN LEVEL J OF F ELEMENTS IN SET S2. NTS TO LAST ROW OF PuTAB TES. S (OR INPUT FNC.) AVAILABLE. RAMS. IF MORE THAN NEPMAX A PARTICULAR GATE IS REMOVED, MPENSATE FOR THAT GATE'S NUMBER LF ELEMENTS IN SET NUMBER CF ELEMENTS IN SET NIJMREF n F ELEMEN X S IN SET RPLCF. NUMBER CF ELEMENTS IN SET NUMBER OF ELEMENTS IN SET NUMBER OF ELEMEN T S IN SET OPLCF. NUMBER OF ACTIVE ELEMENTS NUMBER OF ACTIVE ELEMENTS NUMBER OF ACTIVE ELEMENTS NUMBER OF ACTIVE ELEMENTS SU M OF N PLUS ». IUCT OF NP AND N2 . NBPLC(I) STOPES THF NUMBER Ml: SUM uF N PLUS 1 IFIEO BY USERt OTHERWISE EQUAL G G G G G G G G G G G G G G G G G G G G G G S. S 1. SI BEFORE ENTERING SUBROUTINE S2. Tl BEFORE ENTERING SUBROUTINE IN ARRAY ICXO. IN ARRAY IDXOE. IN ARRAY IDX1. IN ARRAY IDX1E. OF ELEMENTS IN KPLCd,*) FOP 1=1,2. N2: NUMBER OF DIFFERENT INPUT COMBINATIONS TO BE CONSIDERED Gl 00960 (USUALLY 2 TO THE POWER N). Gl 00970 ORIGIN: 0RIGIN(GI)=1 MEANS Gl ORIGINALLY CONNECTED TO GCO. Gl 00980 OPIGIN(GI)=0 MEANS Gl DID NOT FEED GCO ORIGINALLY. Gl 00990 P$: P$(l,~) CONSECUTIVELY LISTS OUTPUTS OF EVERY EX. VAR. AND Gl 01000 EVERY GATE (FOR EVERY INPUT COMBINATION): P$(l,l),..., Gl 01010 P$(itN2J FOR FIRST EX VAR; P$( 1 ,N2*1 ) , . . ., P $( 1. 2*N2) FOP Gl 01020 SECOND EX VAR; ... ; P$< 1 ,N*N2 + l ) , . . .♦ P$(l t N*N2+N2 ) FOR Gl 01030 FIRST GATE; ETC. P$(2,~) IS USED AS WORK SPACE FOR Gl 01040 CALCULATIONS ASSOCIATED WITH P$(l,-). Gl 01050 PCO: FOR ERROR COMPENSATION PROCEDURES. PCO IS THE GATE Gl 01060 REMOVED FROM ORIGINAL NETWORK TO OBTAIN CURRENT ALTERED Gl 01070 NETWORK. Gl 01080 PJINTA: NOT USED. Gl 01090 PDINTC: POINTS TO LAST ELEMENT IN LISTC. Gl 01100 PCINTL: POINTS TO LAST ELEMENT IN LI STL. Gl OHIO POINTR: POINTS TO LAST ELEMENT IN RNECl (IN SUBROUTINE SUBSTI). Gl 01120 POTAR: POSSIBLE OUTPUT TABLE. HOLDS INFORMATION ABOUT ALL Gl 01130 COMBINATIONS OF CONNECTIONS TO FORM NEW (AND HOPEFULLY Gl 01140 USEFUL) FUNCTIONS. 01 01150 PPOTA^: FOR GATE Gl, PPOTAB(GI) POINTS TO FIRST OF A SEOUENCE OF Gl 01160 ROWS OF POTAB CONCERNING Gl . Gl 01170 R: NUMBER OF GATES IN THE NETWORK (EXCLUDES EX VAR, ALSO - Gl 01180 NOTE SOME OF R GATES MAY BE ISOLATED). Gl 01190 PPLC: RPLCd,*) STORES THE SELECTED GATE'S IP GATES WHICH HAVE Gl 01200 ERROR-COORDINATES OF WEIGHT 2 OR ABOVE. Gl 01210 RPLC(2,*) STORES THE SELECTED GATE'S IP GATES WHICH HAVE Gl 01220 AT LEAST ONE ERROR-COORDINATE OF WEIGHT 1. Gl 01230 RSCONN: LIST OF CONNECTIONS ADDED TO A NETWORK (IN CODED FORM). Gl 01240 PTCCNN: LIST OF CONNECTIONS REMOVED FROM A NETWORK (CODED FORM). Gl 01250 S: NO. OF CONNECTIONS ADDED TO A NETWORK. POINTS TO LAST Gl 01260 ENTRY IN RSCONN. Gl 01270 SETS: SET S CONSISTING OF INPUTS OF THE GATE UNDER CONSI DERATI0NG1 01280 WHICH ARE TO BE REPLACED IF POSSIBLE. Gl 01290 SETSl: SET SI CONSISTING OF ELEMENTS OF SET S WHICH CAN BE Gl 01300 REPLACED BY ELEMENTS IN SET S2. Gl 01310 SETS2: SET S2 CONSISTING OF FUNCTICNS WHICH ARE CANDIDATES FOR Gl 01320 REPLACING ELEMENTS IN SET S. Gl 01330 SETTl: SET Tl CONSISTING OF ESSENTIAL ONES COVERED BY ELEMENTS ING1 01340 SET SI. Gl 01350 STS: STARTING ELEMENT OF SET S. Gl 01360 SUCtMX: SUC$MX(GI,GJ)>0 MEANS GATE GJ IS A SUCCESSOR OF GATE Gl. Gl 01370 SUC$MX(GI,GJ)=0 IF NOT. Gl 01380 SU^P: SUM OF ALL ACTIVE INPUTS OF THE GATE UNDER CONSIDERATION. Gl 01390 SU M S2: SUM OF ALL ACTIVE ELEMENTS OF SET S2. Gl 01400 T: NUMBER OF CONNECTIONS REMOVED FROM A NETWORK. POINTS TO Gl 01410 LAST ENTRY IN RTCONN. Gl 01420 TIME: USED TO STORE AMOUNT OF ELAPSED COMPUTATION TIME. Gl 01430 JNAME: MNEMONIC NAMES FOP EXTERNAL VARIABLES AND GATES. Gl 01440 VF$U3l: POINTS TO LAST ELEMENT IN VF$1. Gl 01450 VF$l: SIMILAR TC F$l , EXCEPT THIS LISTS JUST COMPONENT P0SITI0NSG1 01460 (OF O'S IN CSPF VECTOR OF GCO) COVERED ONLY BY REMAINING Gl 01470 ORIGINALLY CONNECTED INPUTS TO GCO. Gl 01480 Gl 01490 Gl 01500 Gl 01510 COMMON NEPMAX Gl 01520 COMMON N , M , A , B Gl 01530 1 , R , N2 , Nl , NR Gl 01540 2 , NM , KFLAG , JFLAG , COST Gl 01550 3 , LEVM , NRN2 , NM1 , NN2 Gl 01560 COMMON ISUCC(40,40) t LISUCU40) , IPRED(40,40) t LIPRED<40) Gl 01570 1 t INC$MX(40,40) , SUC$MX(40,40) t P$(2,1280) , UNAME(40) Gl 01580 2 ♦ GLEVEK40) t LGLIST(40) , HL1 ST (40, 40) , TIME Gl 01590 COMMON T , RTCONN(IOO) , S t RSCCNN(IOO) Gl 01600 COMMON IFLAG ,P0INTA ,ESS1S(40) ,F$1(32) Gl 01610 1 ,F$UR1 ,INPTCV(32) ,LISTC(40) ,POINTC Gl 01620 2 ,LISTL(40) .POINTL ,0R!GIN(40) ,IPATH(40) Gl 01630 3 ,P0INTR ,VF$1(32) ,VF*UB1 , GSMALL ( 40, 32 ) Gl 01640 CCMMON P0TAB(200,42),PPOTAB(40) ,LP0TAB(40) ,NRPLC(2I Gl 01650 1 ,RPLC(2,40) ,IDX0(32> ,I0X0E(32) ,10X1(32) Gl 01660 ?. ,IDX1E(32) ,SUMP(32) ,SETT1(32) ,N0T1 Gl 01670 3 .SETSH40) ,N0S1 ,SETS(40) ,NOS Gl 01680 4 ,STS ,SUMS2(32) ,SETS2(200) ,NCS2 Gl 01690 5 ,LIP ,N00E ,KEYA ,KEYB Gl 01700 6 ,NO0 ,N01 ,N01E , $GT Gl 01710 7 ,$LTH ,$PW ,$N0E ,GI Gl 01720 COMMON N0T1SV ,N0S1SV ,LMTS2 Gl 01730 (DIMENSION CNTLIS(144),UGATE(40),UHEAD(20) Gl 01740 DATA K0UNT5 /O/, UBLANK/' •/ Gl 01750 990 OEAD( 5, 1000,END=5C0) UHEAD, N, M, R, A, B, UC, NEPMAX Gl 01760 C NEPMAX IS THE MAXIMUM ALLOWABLE NUMBER OF EPRCR POSITIONS Gl 01770 1000 F';RMAT(20A4/5I4,A4, 14) Gl 01780 KEVXC = 61 01790 IF (UC.NE. UBLANK) KEYXC=1 Gl 01800 CALL PAGE Gl 01810 CALL LINE(IO) Gl 01820 K1UNT5=K0UNT5+1 Gl 01830 P^INT 2, KOUNT5 Gl 0184C 2 FORMAT (20X,'*** OPTIMAL NOP NETWORK *** » , 50X , • PR08L EM NO . = ',14 ) Gl 01850 CALL LINE(4) Gl 01860 PRINT 1005, UHEAD Gl O1870 1005 FORMAT (25X t 20A4) Gl 01880 CALL LINE<4) Gl 0189C PRINT 10, N,M,A,B Gl 01900 10 FTPMAK 30X, 'NUMBER OF VARIABLES = ',14 // Gl O1910 1 30X, 'NUMBER OF FUNCTICNS =',14 // Gl O1920 2 30X,»CCST COEFFICIENT A =«,I4// G 1 01930 3 47X, '3 =',I4) Gl 01940 CALL LINE(I) 31 01950 IFKEYXC.NE.O) GO TO 25 Gl 01960 P^INT 21 Gl 019 7C ^1 f=..R M AT( 1H0.29X,' UNCOMPLEMENTED VARIABLES X •) Gl 01980 GO TQ 30 Gl 01990 2 5 CCNTINUE Gl 02000 PRINT 2 8 Gl 20 10 2d F~RMAT(1H0,29X, • BOTH COMPLEMENTED AND UNCC MPLEMENT ED VARIABLESG1 O2O20 1 X, Y • ) Gl O2O30 30 CONTINUE Gl 02040 C*-LL LINE(5) Gl 02050 ->*«*«- SET UP EXTERNAL VARIABLES ***** Gl 02060 N2*2**N Gl 02070 IF( NFPMAX.EO.O )NEPMAX = N2/2 Gl 02080 H = N*N2 Gl 02090 J = \? Gl 02100 L= 1 Gl O2110 T ■ ) Gl 02120 - 1011 11=1, N Gl 02130 J = J/2 Gl 02140 L=L*2 Gl O2150 I Gl O2160 L I L L = 1 , L G 1 02 I 71 SN=-SN V=(l*SN)/2 Gl 02180 00 1009 JJ=1,J SI 02190 1=1+1 Gl 02200 P$(l, I) = V Gl 02210 IF(KEYXC.N6.0)P$(1, I+H|=l-V G1 °2220 1009 CONTINUE Gl 02230 1010 CONTINUE Gl 02240 1011 CONTINUE Gl 02250 IF(KEYXC.NE.O) N=N+N G1 02260 Nl=N+l Gl 02270 NM=N«-M Gl 02280 NM1 = NM«-1 Gl 02290 NN2=N*N2+1 Gl 02300 NR = N«-R 51 02310 NRN2=NR*N2 Gl 02320 CALL CUTPUT(INC$MX,KEYXC) G1 02330 e ""%ErD°,Mi: ETH c°i: T K L !r oR,uTioN and set up in " m * ***" " sins 1001 F0RMAT(16I5) Gl 02360 DO 1115 GI=l f NR Gl 02370 DC 1115 GJ=1,NR Gl 02380 1115 INC$MX(GI,GJ)=0 Gl 02390 DO 1120 1=1,144 Gl 02400 ITEM=CNTLIS(I ) Gl 02410 IF( ITEM.EQ.O) GO TO 1119 Gl 02420 GI=ITEM/100 Gl 02430 GJ=ITEM-100*GI Gl 02440 INC$MX(GI,GJ)=1 31 02450 GO TO 1120 Gl 02460 1119 C0ST=A*R+B*{ 1-1) Gl 02470 GC TO 1130 Gl 02480 1120 CONTINUE Gl 02490 1130 CONTINUE Gl 02500 CALL SURNET Gl 02510 CALL PVALUE Gl 02520 CALL LINEJ4) Gl 02530 PRINT 1140, COST Gl 02540 1140 F0RM4T(20X,' ORIGINAL NETWORK COST-'. 15) G1 02550 CALL LINE(4) ' 15 ' Gl 02560 CALL TRUTH(P$ t l) Gl 02570 CALL LINE(4) Gl 02580 CALL CKT(INC$MX,GLEVEL) G1 02590 c Gl 02600 C*»*** ENTRy REDUNDANCY CHECK ***** Gl 02610 S = Gl 02620 T = Gl 02630 CALL UNNECE Gl 02640 GATES = M Gl 02650 C = Gl 02660 DO 4 Gl = l t NR Gl 02670 C * C ♦ LISUCC(GI) Gl 02680 IF(GI.LE.NM)GOT04 Gl 02690 IF(LISUCC(GIJ.GT.0)GATES=GATES«-1 G1 027 00 4 CONTINUE Gl 02710 OLDCST = A*GATES ♦ B*IC) G1 02720 T=0 Gl 02730 5=0 Gl 02740 INITIALIZE TIMER TO 10 MINUTES G1 °2750 CALL STIMF2(60000) Gl 02760 TIME = KTIMEZ(O) Gl 02770 Gl 02780 c**** 3916 3915 36 105 37 320 500 C r w C r r C C PROCEDURE NTCD (PROCII) CALL PR0CIK3, 1,0,0) CALL FOR ELAPSEC TIME TIME = KTIMEZ(O) - TIME CALL LINE(4) PRINT 3915 F0RMAT(20X,'TIME ELAPSED =•,18,' CENT IS ECONDS • ) F0RMAT(20X, 'NETWORK DERIVED BY PROCII') PRINT 3916, TIME CALL LINE(4) CALL TRUTH(P$,1) CALL LINE(4) CALL CKTl INC$MX,GLEVEL) ******************** ****************q GATES C = DO 36 C = C I F ( G I , = M GATES + 1 GI = 1,NR ♦ LISUCC(GI) .LE.NH) GO TO 36 IF< LISUCC( GI ) .GT.OI GATES = CONTINUE NEWCST = A*GATES ♦ B*C IF(NEWCST.LT.0LDCST)G0 TO 37 PRINT 105 FJRMATdH ,10X,'N0 REDUNDANCY FOUND.') GO TO 990 CALL LINE(3) PRINT 320, NEWCST F0PMAT(9X,'* A NETWORK DERIVED BY PR0CII'/9X,' CO ST= ' , I 5, ' . • ) GJ TO 990 STOP END SUBROUTINE CCNCCO(GCO,CCO) EDITION AAAAAAAAAAAAA/ AAAA AA AA AAA AA AAAAAAA/ A THIS SUBROUTINF CONNECTS INPUT, CCO A GATE GCC. SOME ARRAYS ARE ALS (CONCCO = CCNNECT CCO) IMPLICIT INTEGER*4( A-T,V-Z,$) , REAL DEFINITIONS OF 'COMMON' VARIABLES C CTDWN, I, J,X,Y ARE JUST TEMPORARY VA , CHOSEN UPDATED (UJ AN BE FOU RIABLES U AAAAA IN BL AAAA/SAAAAAAAAAA OCK 25, TO ND IN SED I CO WM ON NEPMAX COMMON N , 1 , R , 2 v NM , 3 , LEVM , COMMON ISUCC(40,40) , 1 , INCSMX( 40,40) , 2 , GLFVEL(40) , COMMON T , COMMON I FLAG 1 ,F$UB1 2 ,USTL(40) M N2 KFLAG NPN2 LISUCCI40) SUC$MX(40,4 , LGLIS T (40) , RTCCNN(IOO) ,POINTA ,INPTCV( 32) ,PCINTL ,VFtl( 32) 0) 3 .POINTR ■^MON P0TAB(200,42 ),PPCTAB(40) 1 ,PPLC(2,40> , 10X0(32) , A , Nl , JFLAG , NM1 , IPRED , P$(2, , HL1ST , S ,ESS1S( ,LISTC( , OR I GIN ,VF$UB1 ,LPOTAB ,I0X0E( (40,4 1280) (40,4 40) 40) (40) (40) 32) MAIN PROGRAM N THIS SUBRCUTI , B , MR , COST , NN2 , LIPRED(40) , UNAME(40) , TIME , PSCCNNdOO , F $ It 3 2 I ,POINTC , IPATH(40) ,GSMALL(40,3 ,NRPLC(2) ,IDX1(32 ) 0) 0) **G1 0279C GI 02800 GI 0281C GI 0282C GL 0283C GI 02 84C GI 0285C GI 0286C GI 0287C GI 0288C GI 02890 GI 0290C GI 0291C 51 0292C GI 0293C GI 02940 GI 02 95C GI 0296C GI 0297C GI 0298C GI 0299C GI 03000 GI 0301C GI 03020 GI 03030 GI 0304C GI 03050 GI 0306C GI 0307C GI 0308C GI 0309C GI 0310C AAG1 031 1C GI O3120 GI 0313C GI 0314C GI 0315C -"* 1 J 1 0316C GI 0317C GI 0318C GI 0319C GI 0320C NEG1 0321C GI 0322C GI 0323C GI 0324C GI 0325C GI 0326C GI 0327C GI 0328C GI 0329C GI 0330C ) GI 0331C GI 0332f GI 03?3f GI 0334C 2)G1 0335C GI 0336C GI 0337C 11 1 10 100 .SUMPC32I tNOSl »SUHS2( 32) ,N00E tNOl ,$PW N0T1SV 11 1 tSETTK32) ♦SETSC40) ,SETS2<200I tKEYA ♦ N01E ,$NOE ,N0S1SV GO TO 1 2 ,I0XIE(32> 3 ,SETS1(40» 4 .STS 5 tLIP 6 ,N00 7 ,$LTH COMMON X = (CC0-1)*N2 DO 11 J=1»F$UB1 I = F$l( J» IF(P$(2»X+I J.NE.DGO TO INPTCvm = INPTCV(I) + CONTINUE ENTRY CNCCO(GCO,CC0) USE OF THIS ENTRY POINT BY-PASSES UPDATE OF INPTCV UPCATE VF$i X = (CCO-1 ) * N2 CTDWN = VF$UB1 + 1 CTDWN = CTDWN - 1 IF(CTDWN.EQ.O) GO TO 2 IF(P$(2,VF$l(CTDWN)+X).EQ.O) DO 3 I = CTDWN, VF$UB1 VFSKI) = VF$1( 1*1) VF$UB1 = VFSUB1 - 1 G0T01 CONTINUE UPDATE INCSMX INC$MX(CC0,GCO) = UPDATE LISUCC AND X = LISUCC(CCO) DO 4 I=1,X IF(ISUCC< I,CCO).GT.GCO)GO TO 5 CONTINUE CONTINUE LISUCC(CCO) = X *- 1 DO 6 J = I , X Y = X-J+I+l ISUCC(Y,CCO»= ISUCC(Y-1,CC0) CONTINUE ISUCC(I,CCO) = GCO UPDATE LIPRED, IPRED X = LIPRED(GCO) DO 8 I=1,X IF(IPREC(I,GCO).GT.CCO)GO TO 9 CONTINUE I = X ♦ 1 LIPRED(GCO) = X + 1 DO 10 J=I,X Y = X-J + I + 1 IPRED(Y,GC01 = IPREDU-1,GCC) CONTINUE IPRED(I,GCO) = UPDATE SUCSMX CALL SUCCES UPDATE INPTCV RETURN ENID ,NOTl ,NOS »N0S2 tKEYB »$GT tGI ,LMTS2 1 ISUCC CCO Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl SI Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl SI Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl SI Gl Gl Gl Gl Gl Gl Gl SI Gl Gl SI Gl 03380 03390 03400 03410 03420 03430 03440 03450 03460 03470 03480 03490 03500 03510 03520 03530 03540 03550 03560 03570 03580 03590 03600 03610 03620 03630 03640 03650 03660 03670 03680 03690 03700 03710 03720 03730 03740 03750 03760 03770 03780 03790 03800 03810 03820 03830 03840 03850 03860 03870 03880 03890 03900 03910 03920 03930 03940 SUBROUTINE ELANDO(GATE) Gl 03950 EDITION AAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGI 03960 THIS SUBROUTINE IS TO ELIMINATE NCN-ESSENTI AL INPUTS TO GATE "GATE" AND TO ORDER THE REST IN "LISTL" ACCORDING TO DECREAS- ING NUMBER OF ESSENTIAL CNES. (ELANDO = ELIMINATE AND ORDER) IMPLICIT INTEGER*4(A-T,V-Z,$), REAL(U) DEFINITIONS OF •COMMON' VARIABLES CAN BE FOUND IN MAIN PROGRAM VARIABLE DEFINITIONS: MAXl: MAXIMUM NUMBER OF ESSENTIAL L'S BELONGING TO ANY PREDECESSOR OF 'GATE' . NUMIN: NUMBER OF INPUTS TO GATE SAVE: NAME OF \ PREDECESSOR OF •GATE*. •GATE'. G G G G G G CTDCWN, I t J f SAVE,X,Y,Z,XX,XY,YY ARE USED AS JUST TEMPORARY VAPIABLEG SG MAX G G NEP N COMMON COMMON 1 f 2 , N 3 , L COMMON I 1 » I 2 , G COMMON T COMMON ! 1 ,FSUB 2 ,LIST 3 tPOIN COMMON P ,RPLC , IDX1 .SETS ♦ STS ,LIP ,NCO , tLTH CO M MGN ELIMINATE Y = X = NUMIN = LI IF( IPATHIG SPECIAL IN CONNECTION IS IN S. NUMIN = LI DO 10 I = SAVE ■ IPR IF( IPATHIS IF (ORIGIN I IP(ESS1S(S C4LL RNONE L = (SAVE- D013 I = 1 , F IF ( INPTCV( IF(P$( 2,L* XX = LIPRE Ml* J»l t X , M , N2 M , KFLAG EVM , NRN2 SUCC(40,40> , LISUCC(40) NCSMX( 40,40) , SUC$MX(40,40) LEVEL(40I , LGLISTJ40) , RTCCNN(IOO) FLAG ,POINTA 1 ,INPTCV(32) L140) ,PCINTL TR ,VF$1(32) OTA 1(200,42) ,PPCTA8(40> (2,40) ,10X0(32) E(32) ,SUMP(32) 1(40) ,N0S1 ,SUMS2( 32) ,NOOE ,N01 ,$PW NJT1SV , NON-ESSEN. INPUTS FIRST A Nl JFLAG NMl IPRED(40,40) P$( 2,1280) HLIST(40,40) S ,ESS1S( 40) ,LISTC(40) , OR I GIN (40) ,VF$UB1 ,LP0TAB(40) ,IDX0E(32) , SETT 1(32) ,SETS(40) ,SETS2(200) ,KEYA ,N01E ,$NOE NCS1SV , B , NR , COST , NN2 , LIPRED(40) , UNAMEUO) , TIME , RSCONN(IOO) ,F$1(32) ,PCINTC , IPATH(40) ,GSMALL(40,32 ,NRPLC(2) ,IDX1(32) ,N0T1 ,NOS ,N0S2 ,KEYB ,$GT ,GI ,LMTS2 PRED(GATE) ATE) .EQ.0.0P.KFLAG.NE.2 STRUCTICNS FOR PROCIV S FROM SUBNETWORK S(GCO PRED(GAT E) 1 ,NUMI N E0( I, GATE ) AVE) .EQ.O > GO TO 10 SAVE) .EQ.O) GO TO 10 AVE ) .NE.OI GO TO 10 S(GATE,SAVE,l ) 1)*N? iU"l FHIIII .NE.l IGC T013 FU< I ) J.NE.1IG0 TP13 D(GATE) x ) GC TO 1 (I. E.t KFLAG = 2) : PREFER ) FOR FIRST REMOVAL IF GATE XY = IPRED(J,GATE) YY = (XY-i)*N2 IF(P$(2,YY+F$1(I )).NE.1)G0 T014 ESSIS(XY) = ESS1S(XY)+1 GO TO 13 14 CONTINUE 13 CONTINUE GO TO 9 10 CONTINUE 1 IF(X.E0.NUMIN)G0 TO 2 X = X ♦ 1 Y = Y ♦ 1 SAVE = IPRED(Y,GATE) IFIORIGINJ SAVE).EQ.O)GOT01 IF(ESS1S(SAVE).NE.0) GO TO 1 IF HERE. " SAVE " IS A NON-ESSEN. CALL RNCNES(GATE,SAVE, 1) Y = Y - 1 FINISH UPDATE OF ESS1S (RNONES Z = (SAVE-1»*N2 00 3 I=1,F$UB1 IF(INPTCV(F$1( I) ).NE.1)G0 TO 3 IF(P$(2»Z+FS1( I) ).NE.1)G0 TO 3 XX = LIPRED(GATE) DO 4 J=i,XX XY = IPREDU.GATE) YY = , SUC$MX(40,40), P$(2, 12801 » UNAME(40) Gl 05780 2 t GLEVELI40) t LGLISTI40) , HLIST(40,40) t TIME Gl 05790 COMMON T t RTCONN(IOO) » S , RSCONNdOOl Gl 05800 COMMON IFLAG ,POINTA »ESS1S(40) ,F$1(32) Gl 05810 1 ,F$UBl f INPTCV(32) ,LISTC(4C) tPOINTC Gl 05820 2 ,LISTL(40) tPOINTL t 0RIGIN(40) ,IPATH(40) Gl 05 830 3 ,POINTR ,VF$1(32) ,VF$UB1 »GSMALL(40,32)G1 05840 COMMON P0TAB(200,42),PPOTAB(4O) ,LP0TAB(40) ,NRPLC(2) Gl 05850 1 ,RPLC(2,40) ,IDX0<32) ,IDX0E(32) ,10X1(32) Gl 05860 2 ,IDX1E(32I ,SUMP(32) ,SETT1(32) tNOTl Gl 05870 3 ,SETS1(40) ,N0S1 .SETSC40I ,NOS Gl 05880 4 ,STS ,SUMS2(32) ,SETS2(2001 ,N0S2 Gl 05890 5 tLIP ,NOOE ,KEYA tKEYB Gl 05900 6 tNOO tNOl ,N01E ,$GT Gl 05910 7 , $LTH ,$PW »$NOE ,GI Gl 05920 COMMON NOTiSV ,N0S1SV ,LMTS2 Gl 05930 DIMENSION TIPRED(40) ,T2PRED (40 >, GORDER (401 , F$0 (32 ) , MARKED(40) Gl 05940 DIMENSION USED(40» ,T0RDER(40) Gl 05950 IMPROV = Gl 05960 T = SI 05970 OPOER GATES IN GORDER Gl 05980 EFLAG = Gl 05990 CO TO 63 Gl 06000 THIS ENTRY POINT FOR CALCULATION OF GORDER ONLY Gl 06010 ENTRY FORMGO Gl 06020 EFLAG = I Gl 06030 CONTINUE 01 06040 COUNT = Gl 06050 DO 1 I=1,LEVM Gl 06060 NMINLV = LGLIST( I) Gl 06070 IF(NMINLV.EQ.0)G0T01 Gl 06080 DO 2 J=l, NMINLV Gl 06090 COUNT = COUNT + 1 Gl 06100 GORDER(COUNT) = HLIST(J,II 01 06110 CONTINUE Gl 06120 CONTINUE Gl 06130 IF(EFLAG.EQ.IIRETURN Gl 06140 CALCULATE NUMBER OF OUTPUTS OF EACH GATE Gl 06150 (THE ARRAY •USED' IS USED HERE JUST TEMPORARILY) Gl 06160 DO 51 I=N1,NR Gl 06170 TCOUNT = Gl 06180 DO 52 J=1,NR Gl 06190 IF( INC$MX(I,J).EQ.1ITC0UNT = TCOUNT ♦ 1 Gl 06200 CONTINUE Gl 06210 TCOUNT NOW CONTAINS THE NUMBER OF OUTPUTS GF GATE I Gl 06220 USED( I ) = TCOUNT Gl 06230 CONTINUE Gl 06240 MOST = Gl 06250 DO 53 I =N1,NR Gl 06260 IF(USED( I) .GT.MCSTIMOST = USED(I) Gl 062 70 CONTINUE Gl 06280 DO 56 1= 1,N Gl 06290 TORDER(I) = I Gl 06300 TPOINT = Nl Gl 06310 MOST = MOST ♦ 1 Gl 06320 MOST = MOST - 1 Gl 06330 IF(MOST.LT.O)GO TO 54 Gl 06340 DO 55 1=1, NR Gl 063 50 II = GORDER(I> Gl 06360 IF( II.LE.N)GO TO 55 Gl 063 70 IF(USED( II ).NE.MOST)GO TO 55 Gl 06380 57 58 59 i 62 TrjRDER(TPOiMT) = TPOINT = TPOINT 55 CONTINUF GO tq 50 54 CONTINUE INITIALIZE GS^AL DO 4 I=N1,NM X = ( 1-1 »*N2 DO 4 J=1,N2 Y = P$( 1,X+J) IF(Y.fcQ.O)GSMALL IFtY.EQ. 1) GSMALL IF(Y.EQ.-l )GSMAL 4 CONTINUE EF LAG = GO TO 5 7 ENTRY INITGS EFLAG = 1 00 3 1=1, NR USED( 11=0 IF ( I .LT.N1 >G0 TO !F| I.GT.NMJ GO T GO to 3 O: 59 J = 1,N2 GSMALL ( I , J)= rr !\{TINUE DO o2 I = N1,NM USED! I ) = 1 CONTINUE INITIALIZATION 00 34 I=1,NR GATE = GCRDER(I) IF( GATE.LT.N1 )G0 XX= LIPKEO(GATE) IF( XX.LQ.0JG0T03 FtlJRl = FJUBO = DO 35 J=1,N2 C:MDrsjT = GSMALL( It (COMPNT.EO.O)G IP(COMPNT.LT.O)G IF(COVP\T.GE.100 FtUBJ = FtURO ♦ F$C(F$ueO) = J GO TO 3 5 36 IF( C°MPN T .LE.-10 FtUBl = FSUBl ♦ Ftl(F$URl > = J 35 CONTINUE IF( P$U8l .EO.O)GO Dl 33 K=1,XX FEEDGT = IPREDJK X = (FEFOGT-l)*N HO 3 9 L=l,FitJAl Y = FUILI IF(PK l,X*Y) .LF. IF(GSMALL( FEEOGT !F(GSMALL( GATE,Y !i=CGSMALL(GATE,Y . ,"&LI (GATE,Y) ■ TO 39 II ♦ 1 (I, J) = -100 (I , J) = 1 L(I,J)=0 58 58 TO 34 GATE, J ) TO 35 TO 36 0> GO TO 1 35 00) GO TG 35 I TO 34 ,GATE) 2 0)G0 TO 39 ,Y) .GT.1000)GOT039 ) .EQ.-200)G0T039 ).EQ.-100)G0 TO 40 -200 g: is j G' g: Gl g; g: g: s: G] g: 5] Gl g: g: g: G! G] 51 Gl g: G g: g: 40 GSMALL(GATE,YJ « -FEEDGT 39 CONTINUE 38 CONTINUE 00 60 K=1,XX 60 MARKED! IPRED(K,GATE )l « 00 41 K=1,F$UB1 X = GSMALL(GATE,F$1(K) ) IF(X.E0.-100)G0 TO 41 IF(X.EQ.-200)G0T041 X = -X GSMALL(*X,F$1(K) ) = l USED( XI = 1 IF(MARKED(X).EQ-l)G0T04l MARKEO(XJ = 1 00 42 L=l,F$UBO Y = GSMALL = I CONTINUE DO 18 1=1, X Y = (TIPREDt I )-l)*N2 DO 19 J=1,F$UB1 Q = FSKJ) IF(P$( l,Y*-Q).NE.l )G0 TO 19 I=( INPTCV(O).LE.O) GO TO 20 INPTCV(Q) = INDTCV(Q) ♦ 1 GO T3 19 IF( IMPTCV(0).LT.O)GO TO 21 INPTCVO) = -T1PPED1I \ GO TO 19 INPTCV(O) = 2 CONTINUE CTNTINUE MARK ESSENTIAL l'S DO 2? I = l,F$U8i Q = INPTCV(F$1 (I )) IF(Q.GE.O)GO TO 22 ) ESSIS(-Q) ♦ 1 ESSlSt-l CONTINUE SELECT = «ESTSL = DO 45 L=1,X = T1PRED(L J IF ( INC$MX(0,GCO) .E(J.0)G0T045 !» : SELECT = Q IF(U5ED(C» .EQ.l JGCT045 IF( 9ESTSL.NE.0)GOT045 8ESTSL = Q CONTINUE IF( SELECT. ED. 0)G0 TO 47 = SELECT IF ( 8ESTSL.NE.0)0 = BESTSL IF HERE, GATE HAS NO ESSENTIAL l'S - REMOVE IT ! JCSMX 1CGC0J = T » T «• 1 UPDATE ESS1S r = (0 - 1 )*N2 DO 24 J=1,F$U81 V = FS1 ( J) IF . g: g: J g: g: g g; g; G G G G g: G G G g: g: g: G g: g: r+ • GO TO 214 Gl DO 162 I = ltNR Gl lb? RDROER(I) = GORDER(I) Gl GO TO 3 Gl 214 00 215 I = 1,NR Gl 215 RORDER(I) = GORDER ( NR+l-I ) Gl GOTO 3 Gl 161 IPHSP1 = IPOS +1 Gl DO 163 I = IP0SP1,NR Gl 163 RORDERd - IPOS) = GORDER(I) Gl J = NR - IPOS Gl 02 169 I = 1,IP0S Gl 169 R3RDERU + I) = GORDER(I) Gl C Gl C SECTION 3, CALCULATE Fill Gl C Gl 3 LAST=N2*NR Gl DO 104 I=1,LAST Gl 104 p$( 2,1 )=P$(1,I ) Gl C INITIALIZE GSMALL FOR OUTPUT GATES Gl 00 53 I=M, NM Gl X=(I-1)*N2 Gl DD 53 J=1,N2 Gl Y = P$ (2,X+J) Gl IF(Y.EQ.O) GSMALLIItJ) = -100 Gl IF(Y.EO.l) GS M ALL(I,J) = 1 Gl IFCY.EQ.-ll GSMALLIItJ) =0 Gl 53 C3N T INUE Gl C Gl C SECTION 4, INITIALIZE COUNTER TO LOOP CNCE FOR EACH GATE Gl C (51 4 GCOUNT=0 Gl C Gl C SECTION 5, INCREMENT COUNT Gl C Gl 5 GC0UNT=GC0UNT+1 Gl Gl C SECTION 6, ARE ALL GATES EXHAUSTED? Gl C Gl 6 IF(LFLAG.EQ.1.AND.GC0UNT.EQ.IP0S)G0T07 51 IF (GC0UNT.GT.NP)G0T07 Gl GCO = GCPDER(GCCL'NT) r ,l IF( r.CC .LE.N) GO TO 33 Gl C Gl C SECTION 11, CALCULATE G(GCO) Gl Gl 11 X = N2*(GC0-l ) Gl 00 190 1=1, N 2 Gl r ■ GSMALLCGCOtl J Gl !<= ( Y.EU. 3) P$(2,X*I ) = -1 Gl 190 IF Gl Gl Gl Gl Gl Gl Gl Gl Gl 31 Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl 31 Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl 31 Gl GC0G1 Gl Gl Gl 31 Gl Gl Gl Gl Gl Gl 11840 11850 11860 11870 11880 11890 11900 11910 11920 11930 11940 11950 11960 11970 11980 11990 12000 12010 12020 120 30 12040 12050 12060 12070 12080 12090 12100 12110 12120 12130 12140 12150 12160 12170 12180 12190 12200 12210 12220 12230 12240 12250 12260 12270 12280 12290 12300 12310 12320 12330 12340 12350 12360 12370 12380 12390 12400 12410 12420 12430 12440 D: 89 J=1,F$UB1 Gl 1245C Z = FS1 (J) Gl 12^60 IF(PS(2, Y«-Z).E0.1)INPTCV(Z)=INPTCV(Z) + 1 Gl 12WC 89 CONTINUE Gl 12480 57 CONTINUE Gl 1249C : INITIALIZE 0RIGIN140) Gl 12500 DO 150 1=1, NR Gl 1251C IFI INC$MX( I,GCC).EQ.O)GO TO 151 Gl 1252C ORIGIN(I) = 1 Gl 12530 3C Tl 150 Gl 1254C 151 naiGlN( I ) = Gl 1255C 150 CCNTINUE Gl 12560 C Gl 1257C C SECTION 15, LIST NUMBER OF ESSENTIAL CNES IN EACH INPUT TO GCO Gl 1258C C Gl 1259C 15 DO 59 I = 1,F$UB1 Gl 1260C 59 ESTEMP( I )=0 Gl 12610 X = LIt>°ED(r,CO ) 31 12620 DO 172 J = 1,X Gl 1263C XY=I D RED( J, GCO) Gl 1264C Y=N2*(XY-1 J Gl 1265C 00 56 I=1,FSUB1 Gl 1266C Z=F$ll I ) Gl 1267C TEMP=PS(2,Y+Z ) Gl 1268C IF(TEMP.LE.0)GCT056 Gl 1269C TEST=ESTEMP(I ) Gl 1270C !F(TFST.LT.0)GCTO56 Gl 1271C IF(TEST.GT.0)GOT058 Gl 1272C ESTEMPt I )=XY Gl 1273C GO T3 56 Gl 1274C 58 ESTEMPd )=-l Gl 1275C 56 CONTINUE Gl 1276C 172 CONTINUE Gl 1277C DO 60 1 = 1, X Gl 1278C 60 ESS1S( IPRED(I,GCO))=0 Gl 1279C DO 61 I=1,F$UB1 Gl 1280C Y=ESTEMP(I ) Gl 1281C IF( Y.LE.0 1GO TO 61 Gl 12 82C C SS1S(Y)=ESS1S(Y)«-1 Gl 1283C 61 CONTINUE Gl 1284C C Gl 1285C SECTION 16, ELIMINATE N3N-ESSENT I AL INPUTS ANC ORDER OTHERS (IN Gl 1286: C "LISTL") BY DECREASING NUMBER OF ESSENTIAL CNES Gl 1287C C Gl 1288C 16 CALL ELANDO(GCC) Gl 1289C C Gl 1290C : SECTION 17, LIST ALL CONNECTIBLE INPUTS TO GCO (IN LISTC) IN ORDERG1 1291C r OF DECREASING NUMBER OF ZEROS IN G(GCO) COVERED. DO MOT LIST Gl 1292C C ANY SMALLER THAN OTHERS. Gl 1293C r Gl 1294C C SEARCH FOP CONNECTIBLE INPUTS THAT CCVEk AT LEAST CNE Gl 1295C 17 POI1TOO Gl 1296C IF(KFLAG.EQ,3)GOT032 Gl 1297( 00 71 1 = 1, NR Gl 1298C C GATE I ^ST NOT BE A SUCCESSOR OF GATE GCO Gl 1299; IF ( S'JCSMXIGCO, I ) .CT.OJGCTC71 Gl 1300( C. GATE I «^UST NOT FEED (NOW OR PREVIOUSLY) GATE GCO Gl 130K IF {'}INCtM( I, GCO) .GT .0)GOTC71 Gl 1302( Y=N2*l 1-1 ) Gl 1303( C GATE I MUST HAVE ALL THE NECESSARY O'S Gl 1304( DO 72 J = 1,F1UB0 Gl 1305( NOT AN OUTPUT GATE ) JGOT071 CANNOT BE ON IN LISTC I IF(P$(2,F$0(J H-YI.NE.0)G0T07l 72 CONTINUE GATE I MUST COVER AT LEAST ONE IN GCO DO 73 J = l,F$UBl I F ( P $ ( 2 t F$L U I *Y ) . E Q. 1 )G0TC74 73 CONTINUE GOT071 74 CONTINUE GATE I MUST NOT BE ISOLATED IF IF(LISUCC( IJ.EQ.O.AND.U.GT.NM IF PROCIV IN EFFECT, CCNNECTIBLE PATH FROM GATE IFLAG TO OUTPUT IF(KFLAG.EQ.2.AND.IPATH< I) .EQ.1IGOT071 TRY TC PLACE GATE NUMBER INTO CORRECT POSITION ZFLAG = 1 11 = (I-1)*N2 IFJP0INTC.NE.OIGOTO75 CASE WHEN LISTC IS EMPTY ZFLAG = POINTC = 1 LISTC(1»= I CALCULATE NUMBER OF ZEROS IN G(GCO) COVERED BY 75 CVD = DO 77 J=l,F$UBl IF(P$(2,F$l(J)+ZZ).NE.l) GOT07 7 CVD= CVD+-1 77 CONTINUE COVERDi I ) = CVD IF(ZFLAG.EQ.0IGOTO71 INSERT = THROWN = DO 76 JJ=1, POINTC J = JJ - THROWN TEST IF ENTRY IS .GT. OR .LT. NEW INPUT Y= COVERD*N2 IF< INSERT.NE.0)G0T078 IFtY.LE.CVDHNSERT = J 78 CONTINUE IF(CVD.LE.Y)GO TO 79 TEST HERE IF VECTOR CORRES. TO J IS SMALLER THAN VEC. CORRES. TC DO 81 K=1,F$U81 IF(PS(2(Z+F$1(K) ).GT.P$(2,ZZ+F$1(K) ) IGO TO 76 81 CONTINUE IF( INSERT. NE. J )GO TO 82 IF HERE, WE CAM SIMPLY EXCHANGE I WITH J INSERT = -1 LISTC(J) = I GO TO 76 82 TEND = POINTC-THROWN-1 IF (TEND.EQ.0JGCTO2O0 DO 83 K=J,TEND 83 LIS T C(K)= LISTC(K-t-l) 200 THROWN = THROWN ♦ 1 GO TO 76 TEST HERE IF VEC. CORRES. TO J IS .EQ. TO VEC. CORRES. TO I 79 IF(CVD.LT.Y)GO TO 80 00 84 K=1,F$UB1 IF(P$( 2,Z + Ftl(K) ).NE.P$(2,ZZ*F$1(K) ))G0 TO 76 84 CONTINUE IF HERE, VECTORS FOR I AND J ARE IDENTICAL, CNLY INSERT IF I IS Gl Gl Gl Gl Gl Gl Gl Gl Gl SI Gl Gl Gl Gl Gl Gl Gl Gl SI Gl Gl Gl Gl Gl Gl SI SI SI SI SI SI ;i Gl Gl Gl Gl Gl SI Gl SI IG1 Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl 31 SI SI Gl Gl Gl Gl Gl 31 Gl 13060 13070 13080 13090 13100 13110 13120 13130 13140 13150 13160 13170 13180 13190 13200 13210 13220 13230 13240 13250 13260 13270 13280 13290 13300 13310 13320 13330 13340 13350 13360 13370 13380 13390 13400 13410 13420 13430 13440 13450 13460 13470 13480 13490 13500 13510 13520 13530 13540 13550 13560 13570 13580 13590 13 600 13610 13620 13630 13640 136 50 13660 C GATE AND J IS EX. VAR. IF( I.LE.N.QR.LISTCC J).GE.N1)G0 TO 71 LISTCt J J = I GOT071 C TEST HERE IF VECTOR CCRRES. TO J LARGER THAN VEC. COPRES. TO I 80 DO 35 K=li FSUBl I«= ( PS ( 2,Z*F$1(K) ).LT.PS(2,ZZ+F$1(K) ))G0 TO 76 6b CONTINUE C IF HERE, WE CAN THROW OUT I GO tt 71 76 CONTINUE POINTC = PCINTC - THROWN C NOW INSERT NEW INPUT INTO LISTC IF( INSERT.LT.OIGO TO 71 IF( INSERT. GT.O)GO TO 36 C IF HERE, ADD NEW INPUT TO END OF LISTC POINTC = POINTC + 1 LlSTC(POINTC)=I GO TO 71 C SHIFT AND INSERT 86 POINTC = POINT*" + 1 DO 87 J=INSERT f POINTC JJ = PCINTC-(J-INSERT) 87 LISTC( JJ+1)=LISTC( J J> LISTC( INSERT! = I 71 CONTINUE IF(P0INTC.EQ.0)G0T032 C C SECTION 13, SELECT TOP ELEMENT, (CALL IT "TH") FROM LISTL r 18 IFJPOINTC.EQ.OIGOTO 32 T H = LISTL(l) SUBL = 1 r C SEC T ION 19, SEARCH LISTC FOR A REPLACEMENT FOR TH r r LIST ESSENTIAL CNES OF TH 19 P0INTT=0 Y = (TH-1)*M2 DO 90 1=1, FSUBl X = F$l( I ) IF( PJPTCV(X) .NE.l JG0TC90 I (Z (P$(2,Y + X» .NE. IJG0T090 POINTT = POINTT+l THFSS(POINTT) = X 90 CONTINUE C MOW SEARCH LISTC DO 91 1=1, POINTC C IF CURRENT ELT. OF LISTC BEING CHECKED HAS FEWER COVERING l'S C TH HAS ESSENTIAL l'S, THEN NO REPLACEMENT, P, CAN BE FOUND C REMAINDER OF LISTC- SO SKIP TO SECTION 21 IF( C3VER0(LI STCI I ) ) . LT . POI NTT ) GO TO 21 V = N2*(LISTC( I • — 1 ) 00 92 J=l, POINTT X = THESS(J) IF(PM2,Y«-X).NE.l JG0T091 92 '.3N T INUE IF HFPE, GATE (OR EX. VAR.) LISTC(I) IS A REPLACEMENT, P, FOR P = LI STC( I > GO TO 2 3 91 C'J'INUE Gl 13670 Gl 13 680 Gl 13 690 Gl 13700 Gl 13710 Gl 13720 Gl 13730 Gl 13 740 31 13750 Gl 13760 Gl 13770 Gl 13780 Gl 13 790 31 13800 Gl 13810 Gl 13820 Gl 13830 Gl 13840 Gl 13850 Gl 13860 Gl 13370 Gl 13880 31 13890 Gl 13900 Gl 13910 Gl 13920 Gl 13930 Gl 139 40 Gl 139 50 Gl 13960 Gl 13 970 Gl 13980 Gl 13990 Gl 14000 Gl 14010 Gl 14020 Gl 14030 Gl 14040 Gl 14050 Gl 14060 Gl 140 70 Gl 14080 Gl 14O90 Gl 14100 Gl 14110 Gl 1412C Gl 14130 31 1414C THANG1 1415C IN 31 1416C Gl 1417C Gl 14180 Gl 1419C 31 1420C 1421C Gl Gl 1422C Gl 1423C TH Gl 1424C 31 1425C Gl 1426C 31 142 7( GO TO 21 SECTION 23, A REPLACEMENT (CONNECT I BLE FN.), P, HAS BEEN FOUND TO REPLACE TH (CURRENTLY AN INPUT TO G(GCO) - SO DISCONNECT TH 23 CALL RNONES(GCO,TH, 2) SFCTITN 30, CONNECT RFPLACEMENT GATE, P, TO GCO 30 CALL CNCCC(GCO.P) IF(PCINTL.EO.O) GO TO 24 UPCATE ESS1S AND INPTCV DO 118 I=1,F$UB1 C = F$1(I ) X = (TH-1)*N2 Y = (P -D+N2 IF(P$(2,C*X).EQ.1)GC Tn H9 IF( P$12,C+Y) .EO. IIGO TO 120 IF HERE, NO CHANGE NEEDFO FOR COMPONENT C GO TO 118 120 INPTCV(C) = INPTCV(C)+1 IF{ INPTCV(C).GT.2)G0 TO 118 DO l?l J=1,P0INTL Z = (LISTH J)-l)*N2 IF(P$(2,Z+C).NE.1)G0 TO 121 ESS1SILISTLU)) = ESS1S(LISTL( J)) - 1 GO TO 118 121 CONTINUE 119 IF(Pf(2,C + Y) .EO.DGC Tn 122 IF{ INPTCV(C ).GT.1)G0 T^ 118 DC 123 J=1,P0INTL Z = (LISTL(J)-1I*N2 IF(P$(2, Z+C) .NE.DGO tc 123 ESS1S(LIS T L(J) ) = FSS1S(LISTL( J))+l GO to 118 123 CONTINUE 122 INPTCV(C) = INPTCV(C) ♦ 1 118 CONTINUE SECTION 24, IS LISTL F^PTy ? 24 IFIPCINTL.FC.OIGO TO 32 IF MOT rM PTY , c,l TO SECTION 29 SECTION 29, P^nRriER LISTL 29 CALL FLAND n (fCO) SECTION 31, PEM^VP P FRCM LIS T C 31 POINTC = PlINTf - 1 IF(POIN T C.LE.O) GO T n 131 DO 129 I=1,F0INTC IF(LIS T C(I) .NE.P) GOTO 129 C0MRRFS5 LISTC, OVERWRITING ENTRY p DO 130 J=I,PCINTC LISTC(J) = LISTC(J+l) 130 CONTINUE GO TO 131 129 CONTINUE 131 CONTINUE RETURN T C SECTION 18 Gl 14280 Gl 14290 Gl 14300 Gl 14310 Gl 14320 Gl 14 3 30 Gl 14340 Gl 14350 Gl 14370 Gl 14375 Gl 14380 Gl 14 39C ni 14400 Gl 14410 Gl 14420 Gl 14430 Gl 14440 Gl 14450 Gl 14460 Gl 14470 Gl 14480 Gl 14490 Gl 14500 Gl 14510 Gl 14520 Gl 14530 Gl 14540 Gl 14550 Gl 1456D Gl 1^570 Gl 14580 Gl 14590 Gl 14600 Gl 1 4 i 10 Gl 14620 Gl 14630 Gl 14640 Gl 14650 Gl 14-S6 Gl 146 70 Gl 14680 Gl 14690 Gl 14 70^ Gl 14710 Gl 14720 Gl 14730 Gl 14740 Gl 14750 Gl 14760 Gl 14770 Gl 14780 Gl 14790 Gl 14800 Gl 14810 Gl 14820 gi 14830 Gl 14840 Gl 14850 Gl 14860 Gl 1487C Gl 14880 c r SECTION 21 c 21 IF( POINTL GO TO 22 c c SECTION 22 GO T3 18 ARE WE AT BOTTOM OF LISTL ? EQ. SUBL ) GO TO 25 SELECT NEXT LOWER ELEMENT IN LISTL AS NEW Z2 SUBL = SUBL ♦ 1 th = LISTL( SUBL) GO TO 19 r C SECTION 25, SEARCH LISTC FOR EFFECTIVELY CCNNECTIBLE FN. r 25 IF ( PDINTC.FQ.OJGO TO 32 IF( VFSUB1.EO.O) GOT032 COUNT = 137 IFIC3UNT.EQ.PGINTOG0 TO 138 COUNT = COUNT + 1 CCO = LISTC(COUNT) X=(CCO-l) * N2 DO 139 !=1,VF$UB1 IF(PS(2,VF$l( I)«-X).EQ.l)GO TO 140 139 CONTINUE GO TO 137 140 CONTINUE C DOES CCO COVER ANY ESSENTIAL ONES ? DO 141 I=l,VF$UBl IF UNPTCViVFtK I) I.NE.1IGC TO 141 IF(P$( 2,VF$l( I)-i-X).EQ.l)GO TO 142 141 CONTINUE GC T T137 142 CONTINUF C CChNECT CCO EFFCQN = CCO GO T3 27 138 CONTINUE C IF HERE, NO ESSENTIAL l'S COULD BE COVERED - SO CONNECT CONNECTIVE ONE AT A TIME UNTIL NO MORE CAN BE ACDED. C TO SECTION 32 (SINCE NO MOPE ORIGINAL INPUTS CAN BE COUNT = 144 IF(COUNT.EQ.PCINTC)GO TO 32 COUNT = COUNT + 1 CCO = LISTC(COUNT) X = (CCO-1 ) * N2 00 145 I=1,VFSUR1 IF( PS(2,VF$1( I )«-X).EQ.l)GC TO 146 l<*b CONTINUE GO TH 144 146 CONTINUE C CCNNECT CCC, UPDATE ARRAYS (INCLUDING VF$1) CALL CCNCCO(GCCCCO) GO TO 144 r SECTIONS 27 AND 28 - CONNECT EFFCCN AND UPCATE ARRAYS r r UPDATE ESS1S 27 X = (CC0-1»*N2 15b 11=1, FSUB1 1 = F 1 1 ( IT ) Gl 1489C Gl 1490C Gl 1491C Gl 1492C Gl 14930 SI 1494C Gl 1495C H Gl 1496C Gl 14970 Gl 1498G Gl 1499C Gl 1500C Gl 1501C ., "EFFCCN"G1 1502C Gl 1503C Gl 1506C Gl 1505C Gl 1506C Gl 1507C Gl 1508C Gl 1509C Gl 15100 Gl 15110 Gl 1512C Gl 15130 Gl 151 40 Gl 1515G Gl 1516C Gl 1517C Gl 1518C Gl 1519C Gl 1520C Gl 1521C Gl 1522C Gl 1523C Gl 1524C Gl 1525C Gl 1526C EFFECTIVE Gl 1527C . THEN GO Gl 1528C ELIMINATED. Gl 1529C Gl 1530C Gl 1531C Gl 1532C Gl 1533C Gl 1534C Gl 1535C Gl 1536C Gl 1537C Gl 1538C Gl 1539C Gl 1540C 1541C Gl Gl 1542C Gl 1543C Gl 1544C Gl 1545C Gl 1546C Gl 1547( Gl 1548( Gl 1549( AN ESSENTIAL ONE 156 155 154 152 153 IF(P$(2,X+I) .NE.DGO TO 155 IF< INPTCVl I). NE.DGO TO 155 IF HERE, SOME GATE WILL LOSE Y = LIPRED(GCO) DO 156 J=1,Y XY = IPRED(JtGCO) Z = (XY-D * N2 IF(PS(2 f Z+I). NE.DGO TO 156 ESSIS(XY) = ESSIS(XY) - I GO TO 155 CONTINUE CONTINUE CALL CONCCO(GCO,EFFCCN) ALTHOUGH SOME ARRAYS ARE UPDATED BY PREVIOUS CALL, WE MUST ALSO UPDATE: ESS1S,LISTL,PCINTL,LISTC,P0INTC UPDATE LISTCPOINTC Y = POINTC DO 152 1=1, Y IFCLISTCd ).NE.CCO)GO TO 152 POINTC = POINTC - 1 IFU.GT. POINTC) GO TO 153 DO 154 J=I, POINTC LISTC(J) = LISTCU + 1) CONTINUE CCN T INUE CONTINUE UPDATE LISTL,POINTL CALL ORDERL(GCO) GO TO 18 32 158 157 170 SECTION 32 TO GCO - UPDATE GSMALL'S FOR THOSE GATES STILL CCNNECTED FORCE NECESSARY ZEROS IN GSMALL X = LIPPED(GCO) DD 157 J=1,X Y = IPREO(J,GCC) 03 158 II=1,F$UB0 I = F$0( II ) GSMALL(Y,I) =-100 CONTINUE CONTINUE CHOOSE NECESSARY ONES ACCORDING TO RORDER POINT = DO 170 I = l,NR Y = RORDER( I) IF( INC$MX(Y,GCO).EQ.O) GO TO 170 POINT = POINT + 1 ORDERP(POINT) = Y CONTINUE NOTE NOW POINT = LIPRED(GCO) DO 159 KK=1,F$UR1 K = F$1(KK) GOTO( 11111,22222,33333,44444,55555) ,JFLAG VERSION 1 : 1) NEW 21 OLD PICK1 = PICK2 = D3 173 J=l, POINT Y = ORDERPt J) IF(P$(2t(Y-L)*N2+K).NE.L) GO TO 173 IF(GSMALL( Y,K) .GE.l ) GO TO 159 Gl 15500 Gl 15510 Gl 15520 Gl 15530 Gl 15540 Gl 15550 31 15560 Gi 15570 Gl 15580 31 15590 Gl 15600 Gl 15610 Gl 15620 Gl 15630 Gl 15640 Gl 15650 Gl 15660 Gl 15670 31 15680 31 15690 31 15700 Gl 15710 31 15720 Gl 15730 Gl 15740 Gl 15750 Gl 15760 Gl 15770 Gl 15780 Gl 15790 Gl 15800 3 1 15810 Gl 158 20 Gl 15830 Gl 15840 Gl 15850 Gl 15860 Gl 15870 Gl 15880 Gl 15890 Gl 15900 Gl 15910 31 15920 Gl 15930 31 15940 Gl 15950 Gl 15960 31 15970 31 15980 Gl 15990 31 16000 Gl 16010 Gl 16020 Gl 16030 Gl 16040 Gl 16050 31 16060 Gl 16070 Gl 16080 31 16090 Gl 16100 IF( PICK1.NE.0) GO TO 173 IFIPICK2.EQ.O) PICK2 = Y IFtnRIGINCYI.EO. 01 PICK! = Y 173 CONTINUE IF(PICKl.EQ.O) GO TO 188 GSMALLCPICKlfK) = I HO TO 159 188 GSMALLCPICK2,K) = 1 GO TO 159 C VERSION 2 : 1) NG ♦ NEV 21 OEV 3) OG 22222 PICK1 = PICK2 = PICK 3 = DO 175 J = 1, POINT Y = OPDERPIJ) IF(P$C 2 ( CY-1)*N2+K).NE.1I GO TO 175 IF(GSMALL(Y,K) .GE.l ) GO TC 159 IF! PIC Kl.NF.O) GO TO 175 IFCORIGINl Y) .NE.O) GO TO 207 PICK1 = Y GO TO 175 207 IF(°ICK2.NE.O) GO TO 175 IF(Y.GT.N) GO TO 208 PICK2 = Y GG TO 175 2C8 IF(PICK3.E0.3) PICK3 = Y 175 CONTINUE 176 209 IF(PICKl.EO.O) GO TO GSMALLCPICK1,KI = 1 GO T3 159 17b IF C PICK2.EQ.0) GO TO GS"ALLIPICK2,K> = 1 GO TO 159 209 GSN'ALL(PICK3,K ) = 1 GO T 159 r VERSION 3 : 1) NEV 33333 PICK1 = PICK 2 = PIC<3 = TK^t = DO 177 J=l, POINT 2) OEV 3) NG 4) OG Y = OKDERP( OC INT«-1-J) IF (P$(2, (Y-l)*N2*-K) .NE.l) GO TO 177 IFIGSMALLC Y,KI .GE.ll GO TO 159 [FCY.GT.NJ GO TO 178 IFCORIGINl Y).NE.O> GO TO 179 PIC.Kl = Y GO T) 177 179 PIC? = Y 50 TO 17 7 1 7 6 I c C ORIGIN (Y). NE.O) GO TO 210 PICK3 = Y GO TO 177 210 PICK* = Y 177 CONTINUE CHOICE = PICK1 IP IC40K.E.NE.0) GC TO 211 CHOICE = PICK? IFlCHniCE.NE.O ) GO TO 211 CHOICE = PICK3 IPICHOICE.NE.OI GO TO 211 Gl 16110 Gl 16120 Gl 16130 31 16140 Gl 16150 Gl 16160 Gl 16170 Gl 16180 Gl 16190 Gl 16200 Gl 1621C Gl 16220 16230 Gl Gl 16240 Gl 16250 Gl 16260 Gl 16270 Gl 162 80 Gl 16290 Gl 16300 Gl 16310 Gl 1632C Gl 16330 Gl 16340 Gl 16350 Gl 16360 Gl 16370 Gl 16380 Gl 16390 Gl 16400 Gl 16410 Gl 16420 51 16430 Gl 16440 Gl 16450 51 16460 Gl 16470 Gl 16480 Gl 16490 Gl 16500 Gl 16510 Gl 1652C Gl 16530 Gl 16540 Gl 16550 Gl 16560 Gl 16570 Gl 16580 Gl 16590 51 16600 Gl 16610 Gl 16620 Gl 16630 Gl 16640 Gl 16650 Gl 16660 Gl 1667C 1668C Gl Gl 1669C Gl 1670C Gl 16 710 211 C CHOICE = PICK4 GSMALL GO PICK1 = Y GO TO 180 PICK3 = Y GO TO 180 IF(ORIGIN( Y) PICK2 = Y GO TO 180 PICK4 = Y CONTINUE CHOICE = PICK1 IFJCH0ICE.NE.01 CHOICE = PICK2 IFJCH0ICE.NE.01 CHOICE = PICK3 IF call subnet call pval'je 00 to 10 10 SFCTICN 10 RETURN END END CF PROCEDURE II (PROCII) 31 Gl Gl 31 31 31 31 Gl Gl 31 Gl 31 Gl Gl 31 Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl 31 Gl 31 3 1 Gl Gl 31 Gl 31 C r C c r r C r C C C C r C r SUBROUTINE RNONES(GCO,TH, FLAG! EDITION A/ AAA* 4Mf AAAAAAAAAl AA AA A/ A AAAA AA AAA AAAAAAAAAAAAAAAAAAAA THIS SUBROUTINE PERFORMS NECESSARY UPDATES WHEN AN INPUT TH IS REMOVED FROM A GATE GCC ARRAY "ESSIS" IS ONLY PARTIALLY UPDATED (SO MUST BE COMPLETED BY CALLING SECTION OF PROGRAM). (&NONES = REMOVE NON-ESSENTIAL INPUT) IF FLAG = 0, SKIP UPDATE OF L I STL , PO INTL , INPTC V IF FLAG=1, SKIP LISTL UPOATE, IF FLAG=2, DO NOT SKIP IMPLICIT INTEGER*4( l-T f V-Zi i ) , REAL(U) DEFINITIONS OF 'CCMMCN' VARIABLES CAN BE FOUND IN MAIN PROGRAM. I,J,X ARE USED AS JUST TEMPORARY VARIABLES. COMMON NEPMAX COMMON fi 1 . R I , NM 3 , LEVM t M t N2 , KFLAG , NRN2 t A i Nl » B , NR , JFLAG , COST , NM1 , NN2 COMMDN ISUCC<40,40) , LISUCCC40) , IPRED(40,40) , LIPRED(40) 1 , INC*MX(40,40lt SUC$MX(40,40), Pl(2,1280) , UNAMEC40) Gl AA31 Gl Gl Gl Gl 31 Gl Gl 31 Gl Gl 31 Gl Gl Gl Gl Gl 31 Gl 31 31 Gl Gl 2 t GLEVEL<40) COMMON T COMMON IFLAG 1 ,F$UBl 2 ,LISTL(40) 3 ,POINTR , LGLISTUO) , RTCCNN(IOO) ,PO!NTA ,INPTCV(32) , POINTL ,VF$1<32) COMMON POTAB(200,42),PPOTAB(40) 1 ,RPLC<2,40) ,IDX0<32) 2 ,IDX1E<32) ,SUMP<32) 3 ,SETS1(40I tNOSl 4 ,STS ,SUMS2J32) 5 ,LIP ,NOOE 6 , NOO tNOl 7 ,$LTH ,$PW COMMON N0T1SV UPDATE INC$MX INC$MX(TH,GCO)=0 UPDATE LISUCC AND ISUCC X = LISUCC(TH) DO 93 1 = 1, X IF( ISUCCl I,TH) .EQ.GC0)G0T094 93 CONTINUE 94 X = LISUCC(TH) - 1 LISUCC(TH) = X IF( I.GT.XJG0T0129 DO 95 J = I,X ISUCC( J,TH) = ISUCC(J-*1,TH) 95 CONTINUE UPDATE LIPRED AND IPRED 129 X = LIPRED(GCO) DO 98 1=1, X IFUPREC(I,GC0).EQ.TH)G0 TO 8 98 CONTINUE 8 X=X - 1 LIPRED(GCO) = LIPRED(GCO) - I IF( I.GT.XJGOT092 DO 99 J = I,X IPRED< J,GCO)=IPRED(J*l,GCO) 99 CONTINUE UPDATE SUC$MX 92 CALL SUCCES IF(FLAG.EQ.0)GOTO177 UPCATE LISTL AND POINTL IP(FLAG.EQ.l)GOT0l28 D3 105 1=1, POINTL IF(LISTL(I).EQ.TH)GO TO 107 105 CONTINUE 107 POINTL* POINTL - 1 DO 108 J=I, POINTL LISTH J)=LISTL< J+l) 108 CONTINUE UPDATE INPTCV 128 X = ( TH-1)*N2 DO 110 I = l,F$UBi IF(Pi(2,X+F$l( I) ).LE.0)G0T0110 INPTCV (F$l( I» ) = INPTCV (F$l( I) )-l LIO CONTINUE RECORD THE DI SCCNNECTI CN 177 RETURN END , HLIST(40,40) , S ,ESS1S<40) ,LISTC«40) ,0RIGINC40) ,VF$UB1 ,LP0TAB(40) ,I0X0E(32I ,SETTi(32) ,SETS<40) ,SETS2(2O0l ,KEVA ,N01E ,$N0E ,N0S1SV , TIME , RSCGNNU ,F$U32) ,POINTC ,IPATH(40) ,GSMALLC40 ,NRPLC(2) ,10X1(32) ,N0T1 ,N0S ,N0S2 ,KEYB ,$GT ,GI ,LMTS2 00) Gl Gl Gl Gl GL ,32)G1 Gl Gl Gl Gl 31 Gl 31 Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl Gl 17920 17930 17940 17950 17960 179 70 17980 17990 18000 18010 18020 18030 18040 18050 18060 18070 18080 18090 18100 18110 18120 18130 18140 18150 18160 18170 18180 18190 182 00 18210 18220 18230 18240 18250 18260 18270 18280 18290 18300 18310 18320 18330 18340 18350 18360 18370 18380 18390 18400 18410 18420 18430 18440 18450 18460 18470 18480 18490 18500 18510 SUBROUTINE SUBNET Gl 18520 IMP L ICI T INTEGER*4(A-T,V-Z,$) f REAL(U) Gl 18530 r Gl 18540 C DEFINITIONS OF 'COMMON' VARIABLES CAN BE FOUND IN MAIN PROGRAM. Gl 18550 r Gl 18560 COMMON NEPMAX Gl 1857C CCMNJN N t M f A , B 51 18580 1 , R » N2 , Nl , NR Gl 18590 2 , N M , KFLAG t J FLAG , COST 31 18600 3 . LEVM , NRN2 , NM1 , NN2 51 18610 CG"M(?N ISUCC(40t40) , LISUCC140) , IPRED(40,40) , LIPPEC140) Gl 1862C 1 t !NC$MX(40, 401 , SUC$MX(40,40), P$(2fl280) , UNAME(40) Gl 18630 2 , GLEVELC4-0) , LGLIST140) , HLIST(40,40) , TIME Gl 18640 COMMON T , RTCCNNUOO) t s , RSCONNllOO) Gl 18650 COMMON I FLAG , POINT* ,ESS1S(40) tF$l( 32) 51 18660 1 ,FSUB1 ,INPTCV(32) ,LISTC<40) ,PCINTC Gl 1867G 2 •LISTLUO) ,PCINTL ,0RIGIN(40) ,IPATH(40> 51 18680 3 ,POINTR ,VF$1<32) ,VF$UB1 ,GSMALL(40, 32)51 18690 COMMON P1TAB(200, 42 1 ,PP0TA8(40) ,LP0TAB(40) tNPPLC(2) Gl 18700 1 ,RPLC (2,40) , 10X0(32) ,IDXOE( 32) ,IDX1( 32) Gl 18710 2 ,IDX1E(32) ,SUMP132) ,SETT1 (32) ,N0T1 Gl 18720 3 ,SETSi(40) ,N0S1 ,SETS(40) »N0S 51 18730 4 ,STS ,SUMS2(32) ,SETS2(2C0) ♦ N0S2 51 18 740 b ,LIP ,NOOE , KEYA ,KEYB 51 1875C 6 ,NOO iNOl ,N01E ttGT 51 18760 7 , S L TH ,$PW , $NOE , G J * * 1 $ 51 16770 Cj^MuN N0T1SV rNOSl SV ♦LMTS2 51 18780 DIMENSION X(40),LX(40, 2),OUTO(40) Gl 18790 r EN T RY PC E SUC Gl 18800 1 CONTINUE Gl 18810 00 10 GI=1,NR 31 18820 LS=0 Gl 18830 LP = Gl 18843 DO 5 GJ=l t NR 51 18850 IF( INCSMX = GJ Gl 1892C 5 CONTINUE 31 18930 LI SUCCIGI )=LS 51 18940 LIPREO(GI )=L° 51 1895C 10 CONTINUE 51 18960 r Gl 189 70 ENTRY SUCCES Gl 18980 DO 21 GI=1,NR Gl 18990 00 21 GJ=1,NR Gl 19000 SUClMXJGI, GJ ) = Gl 19010 21 CONTINUE Gl 19020 DO 30 GJ=N1,NR Gl 19030 00 22 GS=1,NR Gl 19040 X(5S) =0 51 19050 22 CONTINUE 51 19060 X( r .J > = 1 51 19070 L0 = 1 Gl 19080 LX< 1 , 1)=GJ Gl 19090 V = l 51 19100 2i CTMINUE 51 19110 26 28 30 V = l-V SW0=1+V SW1*2-V L1=0 00 28 LL«i,L0 GM=LX(LL,SW0) LIP=LIPRED(GMI IF(LIP.EQ.O) GO TO 28 00 26 LP=1,LIP GP«IPRED(L«>,GH» IF(X(GP).GT.O ) GO TO 26 SUC*MX1GP,GJ)*1 L1=L1+1 LX(L1,SW1)=GP X LIP=LIPRED(GJ) IF(LIP.EQ.O) GO TO 60 DO 55 LP=1,LIP GP=IPPED(LP,GJ ) OUTO(GP) =0UT0(GPI-1 55 CONTINUE 60 CONTINUE LEVM=LEV GO TO 45 c c c GLEVEL(GJKGT.O) GO TO 50 ENTRY PVALUE DO 100 L=NN2,NPK2 P$(1,L)=1 100 CONTINUE LEV=LEVM 110 CONTINUE L0=LGLIST(LEV) 00 130 L = l,L0 Gl 19120 Gl 19130 Gl 19140 Gl 19150 Gl 19160 Gl 19170 Gl 19180 Gl 19190 Gl 19200 Gl 19210 31 19220 Gl 19230 Gl 19240 Gl 19250 Gl 19260 Gl 19270 Gl 19280 Gl 19290 Gl 19300 Gl 19310 Gl 19320 Gl 19330 Gl 19340 Gl 19350 31 19360 Gl 19370 Gl 19380 Gl 19390 Gl 19400 Gl 19410 Gl 19420 Gl 19430 Gl 19440 Gl 19450 Gl 19460 31 19470 Gl 19480 Gl 19490 31 19500 Gl 19510 Gl 19520 Gl 19530 Gl 19540 Gl 19550 3 1 19560 Gl 19570 Gl 19580 Gl 19590 Gl 19600 Gl 19610 Gl 19620 Gl 1963C Gl 19640 Gl 19650 Gl 19660 31 19670 Gl 19680 Gl 19690 Gl 19700 Gl 19710 Gl 19720 GI=HLIST(L,LEV) LIS=LISUCC(GI) BSGI=(GI-ll*N2 LJTH=0 DC 115 JTH=l,N2 IF(P$(1,BSGH-JTH).EQ.0) LJTH=LJTH+1 X(L JTH)=JTH 115 CONTINUE IF(LJTH.EO.O) GO TO 130 DO 125 LS=1,LIS CS=ISUCC(LS t GI ) RSGS=(GS-1)*N2 DO 120 LJ=1,LJTH P*( 1 ,X< LJ)+BSGS)=0 120 CONTINUE 125 CONTINUE 130 CONTINUE LFV=LFV-1 IFILEV.GE.2I GO TO 110 RE T U»N GO TC 115 C C C ENTRY RSTRCTtKEYRST I KEYRST=0 IF(LEVM.GT.LMAX)GO TO 160 DO 150 GI=N1,NR IF (LI PRFD(GI) .GT.FANIN)GO TO 160 IF(LISUCC(GI ) .GT.FANOUTJGO TO 160 150 CONTINUE RE T UR\ 160 KEYRST=1 SFTijRN ENTRy UNNECE C***** this ENTRY DISCONNECT ALL GATES FRCM C T° OUTPUT GATES ***** TS=T DC 209 GI=NM1,NR IF(GLEVEL(GI ) .EQ.l ) GO TO 207 03 ?05 GJ=N1,NM IF(£!lC$ M X(GI,GJ).GT.OI GO TO 209 205 CTNTINUE C***** r,I IS REDUNDANT ***** 207 CONTINUE LIP=LIPRED(GI ) IF(LIP.EQ.O) GC TO 206 3C 203 LI = 1,L IP GK = IPRED(LI ,GI ) IF( INC $MX( GK,GI ) .LE.OI GO TO 203 T=T*1 RTCONN(T) =100*GK+GI INC SMX(GK,GI 1 = 203 CfNTINUF 206 LIS=LISUCCIGI) IF(LIS.EQ.O) GC T3 209 DO 204 LI=l,LIS GK=ISUCC(LI ,GI) IP ( lNCiMX(GI,GK I -LE.OI GO TO 204 T=T*1 RTC0NN(T)=100*GI*GK WHICH THERE IS NO PATH s; g: 3: G] g: g: G] g: G g: \j G Gl G 5 Gl G G g: •j , Gl G] G Gl r* - •J . Gl G INC$MX(GI ,GK)=0 204 CONTINUE 209 CONTINUE IF(T.GT.TS) GO TO i RETURN END Gl SI 31 Gl Gl Gl 20340 20 350 20360 20370 20380 2 03 90 pppp RRRR ooc i GGG RRRR A M M D p R R G G R R A A M M MM p R R G R R A A M M M M oppp RRRR G GG RRRR AAAAA M M M p R R a G G R R A A M M p R R ooc ! GGG R R A A M M c r C r r r C C r C c c r r N N cEEEE TTTT TTTTT RRRR A GGG 222 CNNNE T T RRAA GG22 C N N N E T TRRAA G 2 C N NN EEE T T RRRR AAAAA XXXXX G GG 2 CNNE T TRRAA GG2 C N N EEEFE T T RRAA GGG 22222 C C r***** ******* 4******** ************************************** ******************* r IMPLICIT INTEGEP*4( A-T,V-Z,$) , REAL(U) G2 00010 EDITION 8t 1 BBBPPPBPBBBBB8BBBBBBBBBBBBBBBBSBBBBBBB3BBBBBBBBBBBBBBBBBG2 C0020 NOTE: ALL COMMON VARIBLES MIGHT NOT BE USED IN THIS PROGRAM. G2 00030 G2 00040 VARIABLES: 32 00050 POINTS TC A 'COLUMN' OP POTAB. FOR EACH 'ROW THE ENTRY G2 00060 IN THIS CCL. TELLS GATE WHERE FN. IS REALIZED. G2 00070 P°lNTS TO A 'COLUMN' OF POTAB. FOR EACH 'ROW THE ENTRY 32 00080 IN THIS COL. TELLS HOW MANY CCNNECTICNS MUST BE ACDED. G2 00090 POINTS TO A 'COLUMN' OF POTAB. FOR EACH 'ROW' THE ENTRY G2 OCiOC IN THIS CCL. TELLS THE NUMBER OF 1-ERRORS CREATED IF THIS G2 001 10 P3W I S HSEO. G2 0012C POINTS TO A 'COLUMN' OF POTAB. FOR EACH 'ROW' THE ENTRY G2 00130 IN THIS COLUMN TELLS THE PREFERENCE WEIGHT. G2 00140 WEIGHT por no. OF GATES IN COMPUTING COST FUNCTION. G2 00150 WEIGHT FQR NO. OF CONNECTIONS IN COMPUTING COST FUNCTICN. G2 00160 COST OF NETWORK - A MEASURE OF NETWOPK SIZE. G2 00170 RECORDS NO. OF ESSENTIAL l'S IN EVERY INPUT TO CURRENT GCOG2 00180 POSITIONS IN ESS1S CORRES. TO CATFS NOT FEEDING GCP ARF G2 00190 T ON0RED) . G2 00200 POINTS TO LAST ELEMENT IN F$l. G2 00210 LISTS (CONSECUTIVELY* PCSITICNS OF DESIRABLE l'S (FOR ft 2 00220 COVERING) IN A CCNNECTIBLE FUNCTION. G2 00230 LABEL OF A PARTICULAR GATE. 32 OO240 GLEVEL(GI) TELLS WHICH LEVEL OF THE NETWORK GI IS IN. G2 00250 STORES INTERMEDIATE AND FINAL CALCULATED CSPF'S. G2 00260 HLISTU.J) GIVES NAME OF I-TH GATE (OP EX. VAR . ) IN NET- 32 C0270 ^PK LEVEL J. G2 00280 LIST OF O-COGROINATES IN CSPFE OF THE GATE UNDER C-2 00290 CONSIDERATION. G2 00300 LIST ^F O-ERROR-COCPDINATES IN CSPFE CF THE GATE UNDER ft2 00310 CONSIDER ATION. 32 00320 LIST n P 1-COOROINATES IN CSPFE OF THE GATE UNDER ft2 C0330 CCNSIDERATION. G2 00340 C COMMON r IZ T : r- - SLTH: r C $NOE: r c r $PW: r r A: r R: r COST: C ESS1S: r C ~ FSU U : c F$l: c C GI : r GLEVEl: ' G S M ft L I. : r HLIST: C r IUXO: c c IDXOE: r c [0X1 : IOXIE: IFLAO: INCiMX: INPTCV: IPATH: IPRED: ISUCC: JFH6: KEYA: KEYB: KFLAG: LEVM: LGLIST: LIP: LIPPED: LISTC: LISTL: L ISUCC; LMTS2: LPOTAB: M: Ni NEPM4X: NM NM1 NN2 NCS NOS1 N1S1SV N0S2 NOT1 NOT1SV NOO NOOE NOl NOIE NR NRN2 YRPLC Nl LIST OF 1-ERROR-COORDI NATES IN CSPFE OF THE GATE UNDER G2 CONSIDERATION. G2 SAME AS EYEFLG IN SUBROUTINE PROCII. G2 INCSMX(GI,GJ)>0 MEANS THERE EXISTS A CONNECTION FROM GATE G2 (OR EX. VAR.) GI TO GATE GJ. INC$MX(GI ,G J 1=0 IF NOT. G2 LISTS FOR EACH CORRESPONDING ENTRY OF F$l, HOW MANY INPUTSG2 HAVE A «l« IN THE POSITION INDICATED BY F$l. G2 IPATH(GI)=1 MEANS GATE GI IS ON A PATH FROM A CERTAIN GATEG2 HAS BEEN IF ANY PRIMARY 0-ERROR-COORDINATES HAS EX. VAR. ARE ALSO IN LEVEL J OF TO AN OUTPUT GATE. OTHERWISE IPATH(GI) = 0. IPRED(I,GJ) GIVES THE NAME OF THE I-TH GATE OR EX. VAR. A LIST CF GATES AND EX. VAR. FEEDING GJ. ISUCC(I,GJ) GIVES THE NAME OF THE I-TH GATE FED BY G J . SAME AS JAYFLG IN SUBROUTINE PPOCII. A FLAG INDICATING IF ANY ERROR COMPENSATION PERFORMED. A FLAG INDICATING BEEN CCMPENSATED. SAME AS KEIFLG IN PROCII. NUMBER OF LEVELS IN THE NETWORK (NOTE ASSIGNED LEVELS JUST LIKE GATES1. LGLIST(J) TELLS NO. OF GATES AND EX. VAR. NETWORK. NUMBER CF PREDECESSORS FOR THE GATE UNDER CONSIDERATION. LIPRED(GI) TELLS NO. OF IMMEDIATE PREDECESSORS CF GATE ORDERED LIST OF CONNECTIBLE INPUTS TO GCO. ORDERED BY DECREASING NO. OF O'S IN GCO COVERED. ORDERED LIST OF GATES AND EX. VAR. WHICH ORIGINALLY FED GCO AND WHICH HAVE NOT YET BEEN DISCONNECTED. ORDFRED eY DECREASING NO. OF ESSENTIAL l'S. LISUCC(GI) TELLS NO. OF IMMEDIATE SUCCESSORS OF GATE (OR EX. VAR.) GI. UPPER LIMIT OF THE NUMBER OF ELEMENTS IN SET S2. FOR GATE GI, LPOTAB(GI) POINTS TO LAST ROW OF POTAB CONCERNING GI . NUMBER OF NETWORK CUTPUT GATES. NUMBER CF EXTERNAL VARIABLES (OR INPUT FNC.) AVAILABLE. FOR ERROR COMPENSATION PROGRAMS. IF MORE THAN NEPMAX ERROR POSITIONS OCCUR WHEN A PARTICULAR GATE IS REMOVED, PROGRAM SKIPS ATTEMPT TO COMPENSATE FOR THAT GATE»S REMOVAL. VALUE CAN BE SPECIFIED BY TO ONE HALF OF N2 BY DEFAULT. SUM OF N PLUS M SUM OF NM PLUS 1. PRODUCT OF N AND N2 . USER, OTHERWISE EQUAL NUMBER CF ELEMENTS IN SET NUMBER CF ELEMENTS IN SET NUMBER OF ELEMENTS IN SET RPLCF. NUMBER OF ELEMENTS IN SET NUMBER OF ELEMENTS IN SET NUMBER OF ELEMENTS IN SET RPLCF. NUMBER OF ACTIVE ELEMENTS NUMBER OF ACTIVE ELEMENTS NUMBER OF ACTIVE ELEMENTS NUMBER OF ACTIVE ELEMENTS SUM OF N PLUS R. PRODUCT OF NR AND N2 . NRPLC(I) STORES THE NUMBER SUM OF N PLUS 1. S. SI. SI BEFORE ENTERING SUBROUTINE S2. Tl. Tl BEFORE ENTERING SUBROUTINE IN IN IN IN ARRAY ARRAY ARRAY ARRAY ICXO. IDXOE. I 0X1. IOXIE. CF ELEMENTS IN RPLCCI,*) FOR 1-1,2. G2 ING2 32 G2 G2 G2 G2 S2 S2 G2 G2 52 G2 G2 G2 GI.G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 32 G2 32 G2 G2 32 G2 32 32 32 32 32 32 32 52 52 32 32 52 32 52 52 32 52 62 52 00350 00360 00370 00380 00390 00400 00410 00420 00430 00440 00450 00460 00470 00480 00490 00500 00510 00520 00530 00540 00550 00560 C0570 00580 00590 00600 00610 00620 00630 00640 00650 00660 006 70 00680 00690 C0700 00710 00720 00730 00740 00750 00760 00770 00780 00790 00800 00810 00820 00830 00 840 00850 00660 00870 00880 00890 009 00 00910 00920 00930 00940 00950 N2: NUMBER OF DIFFERENT INPUT COMBINATIONS TO BE CONSIDERED G2 00960 (USUALLY 2 TO THE POWER Nl. G2 00970 ORIGIN: ORIGINIGI1-1 MEANS GI ORIGINALLY CONNECTED TO GCO. G2 00980 ORIGIN(GI>=0 MEANS GI OID NOT FEED GCO ORIGINALLY. G2 00990 P$: P$(l,-» CONSECUTIVELY LISTS OUTPUTS OF EVERY EX. VAR . AND G2 O1C00 EVERY GATE (FOR EVERY INPUT COMBINATION): P$(l,l),..., G2 oioic PS(1,N2) FOR FIRST EX VAR; P $( I, N2 + L ),..., P 1(1 , 2*N2) FOR G2 01020 SECOND EX VAR; ... ; P$ ( 1 f N*N2*l > t .. ., P$ ( 1 t N*N2+N2 ) FOR G2 01030 FIRST GATE; ETC. P$(2»-> IS USED AS WORK SPACE FCP G2 01040 CALCULATIONS ASSOCIATED WITH P$(l,-). G2 01050 PCO: FOR ERROR COMPENSATICN PROCEDURES. PCO IS THE GATE G2 01060 REMOVED FROM ORIGINAL NETWORK TO 08TAIN CURRENT ALTERED G2 01070 NETWORK. 32 01080 POINTA: NOT USED. G2 01090 P3INTC: POINTS TQ LAST ELEMENT IN LISTC. G2 01100 POINTL: POINTS TO LAST ELEMENT IN LISTL. G2 OHIO POINTR: POINTS TO LAST ELEMENT IN RNEC1 (IN SUBROUTINE SUBSTI). G2 01120 P0TA8: POSSIBLE OUTPUT TABLE. HOLDS INFORMATION ABOUT ALL G2 01130 COMBINATIONS OF CONNECTIONS TO FORM NEW I AND FOPEFULLY G2 01140 USEFUL) FUNCTIONS. G2 01150 PPOTAB: FOR GATE GI , PPOTAB(GI) POINTS TO FIRST OF A SEQUENCE OF G2 01160 ROWS OF oQTAB CCNCERNING GI . G2 01170 R: NUMBEP OF GATES IN THE NETWORK (EXCLUDES EX VAR, ALSO G2 oneo NOTE SCME OF R GATES MAY BE ISOLATED). G2 01190 R D LC: PPLCClf*) STORES THE SELECTED GATE'S IP GATES WHICH HAVE G2 01200 ERROR-COORDINATES OF WEIGHT 2 OR ABOVE. G2 O1210 R°LC(2,*) STORES THE SELECTED GATE'S IP GATES WHICH HAVE G2 01220 \T LEAST ONE ERROR-COORDINATE OF WEIGHT 1. G2 01230 RSCONN: LIST OF CONNECTIONS ADDED TO A NETWORK (IN CODED FORM). G2 01240 RTCC ^N: LIST OF CONNECTIONS REMCVED FROM A NETWORK (CODED FORM). G2 01250 S: NO. OF C3NNECTICNS ADDEC TO A NETWORK. POINTS TO LAST G2 01260 ENTRY IN RSCONN. G2 01270 SETS: SET S CONSISTING OF INPUTS OF THE GATE UNDER CONS I CEP AT ICNG2 01280 WHICH ARE TO BE REPLACED IF POSSIBLE. 32 O1290 SETSl: SET si CONSISTING OF ELEMENTS OF SET S WHICH CAN BE G2 01300 REPLACED BY ELEMENTS IN SET S2. G2 O1310 SETS2: SET S2 CONSISTING OF FUNCTIfNS WHICH ARE CANDIDATES FOR G2 01320 REPLACING ELEMENTS IN SET S. G2 01330 SETTi: SET Tl CONSISTING OF ESSENTIAL ONES COVERED BY ELEMENTS ING2 01340 SET SI. 32 O1350 STS: STARTING ELEMENT OF SET S. G2 01360 SJCSMX: SUCSMX(GI,GJ)>0 MEANS GATE GJ IS A SUCCESSOR OF GATE GI. G2 O1370 SUC$MX(GI,GJ)=0 IF NOT. G2 01380 SUMP : SUM OF ALL ACTIVE INPUTS CF THE GATE UNDER CONSIDERATION. G2 01390 SUMS2: SUM OF ALL ACTIVE ELEMENTS OF SET S2 . G2 01400 T: NUMBER CF CCNNECTICNS REMOVED FROM A NETWORK. POINTS TC G2 01410 LAST ENTRY IN PTCONN. G2 01420 TIME : USED TO STORE AMOUNT OF ELAPSED COMPUTATION TIME. 3 2 01430 JNAME : MNEMCNIC NAMES FCP EXTERNAL VARIABLES AND GATES. G2 O1440 VF$u^l: POIMTS TO LAST ELEMENT IN VF$1. G2 O1450 VFS1 : SIMILAR TC F$l, EXCEPT THIS LISTS JUST COMPONENT POSITICNS32 01460 (OF O'S IN CSPF VECTOR OF GCO) COVERED ONLY BY REMAINING G2 01470 ORIGINALLY CCNNECTED INPUTS TO GCO. G2 O1480 G2 O1490 r.2 01500 G2 O1510 C3MMON MEPMAX G2 O1520 COMMON N , M , A , B 02 01530 1 , M2 , Nl , NR 32 01 540 2 NM , KFLAG , JFLAG , COST 3 2 01553 J LEVM , NPN2 , NMl , NN2 G2 01560 COMMON ISUCC(40,40) 1 , INCSMX<40,40) 2 , GLEVEH40) COMMON T COMMON IFLAG 1 ,F$UB1 ,LISTL(40) ,POINTR , LISUCCC40) i SUC$MX<40,40) , LGLIST(40) , RTCONN(IOO) ,POINTA ,INPTCV<32) ,POINTL ,VFtl( 321 IPRED(40,40) P$(2 ,1280) HLIST(40,40) S COMMON P0TAB(200,42),PPQTAB(40) ,RPLC(2,40) , IDX1E(32) ,SETS1(40) ,STS ,LIP ,N00 , $LTH COMMON ,ESS1S(4C) ,LISTC(40) ,0RIGIN(40) ,VF$UB1 ,LP0TAB<40) ,IOXOE(32) ,SETTl(32) ,SETS<40) ,SETS2(200) ,KEYA ,N01E ,$NOE ,N0S1SV • LIPRED140) G2 , UNAME(40) G2 , TIME G2 , RSCCNNUOO) G2 ,F$1(32I G2 .POINTC G2 ,IPATH(40) G2 ,GSMALL(40,32)G2 ,NRPLC(2) ,10X1 (32) ,NCTl ,NOS ♦ N0S2 ,KEYB ,$GT tGI LMTS2 ,IDX0(32) , SUMP (32) ,N0S1 ,SUMS2( 32) ,N00E ,N01 ,$PW NOUSV DIMENSION CNTLIS(144),UGATE(40),UHEAD(20) DATA K0UNT5 /O/, UBLANK/' •/ 990 READ(5,1000,ENO=500) UHEAD, N, M, R, A, B, UC, NEPMAX NEPMAX IS THE MAXIMUM ALLOWABLE NUMBER OF ERRCR POSITIONS 1000 FORMAT (20A4/ 5 14, A4, 14) KEYXC=0 IF(UC.NE.UBLANK) KEYXC=1 CALL PAGE CALL LINE( 10) K0UNT5 = K0UNT5*1 PRINT 2, K0UNT5 2 F0RMAT(20X, •*** OPTIMAL NOR NETWORK *** • ,50X , • PRCBLE CALL LINE(4) PRINT 1C05, UHEAO 1005 F09MAT(25X,20A4) CALL LINE(4) PRINT 10, N,M,A,8 10 FORMAT (30X, 'NUMBER M N0.= • ,14 ) 30X,» NUMBER OF VARIABLES OF FUNCTIONS COEFFICIENT A •B TO 25 2 30X, •COST 3 47X, CALL LINE(l) IF(KEYXC.ME.O) GO PRINT 21 21 FHRMAT( lHO^X, 1 GO TO 30 25 CONTINUE PRINT 28 28 FOPMAT ( 1H0,29X, • 1 X, Y • ) 30 CONTINUE CALL LINEI5) C***** SET UP EXTERNAL VARIABLES N2=»2**N IF(NEPMAX.EQ.O)NEPMAX = N2/2 H=N*N2 J = N2 L= 1 1=0 03 1011 11 = 1, N J = J/2 L = L*2 SN= 1 00 1010 LL=i,L — i = i -* = I 14 14 // // 14// 14) UNCOMPLEMENTED VARIABLES BOTH COMPLEMENTED AND UNCOMPLEMENTED ***** G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 G2 3 2 G2 32 G2 G2 G2 G2 G2 32 G2 G2 32 G2 32 32 G2 G2 G2 G2 G2 G2 VARIABLESG2 G2 G2 G2 G2 G2 G2 G2 G2 32 32 G2 32 3 2 32 G2 01570 01580 01590 01600 01610 01620 01630 01640 01650 01660 01670 01680 01690 01700 01710 01720 01730 01740 01750 01760 01770 01780 01790 01800 01810 01820 01830 01840 01850 01860 01870 01880 01890 01900 01910 01920 01930 01940 01950 01960 01970 01930 01990 02000 02010 02020 02030 020 40 02050 02060 02070 02080 02090 02100 02110 02120 02130 02140 02150 02160 02170 SN=-SN G2 02180 V=(H-SN)/2 S2 0219D 00 1009 JJ = 1,J G2 02200 I«I*1 G2 02210 P$(lf I) = V 32 02220 IF(KEYXC.NE.O)P$(ltI + H) = l-V 32 02230 1009 CONTINUE G2 O2240 1010 CCNTINUE 32 02250 1011 CONTINUE G2 02260 IF(KEYXC.NE.O) N=N+N G2 02270 N1=N*1 32 02280 NM = N>M G2 02290 NM1 = NM + 1 G2 02300 NN2=N*N2+1 32 02310 NR = N+R G2 O2320 NRN2 = NR*N2 32 02330 CALL OUTPUT(INC$MX,KEYXC> 32 02340 C***** READ IN NETWORK INFORMATION AND SET UP INC*MX ***** G2 O2350 READ 1001, CNTLIS 32 02360 1001 F0RMATU6I5) G2 O2370 DO 1115 GI = 1,NR G2 02380 00 1115 GJ=l,NR 32 02390 1115 INCSMX(GI,GJ)=0 G2 02400 DO 1120 1=1, 144 32 O2410 ITEM=CNTLIS(I ) 32 O2420 IF{ ITEM.EQ.O) GO TO 1119 G2 02430 GI=ITEM/100 32 02443 GJ = ITEM-100*GI 32 02450 INC$MX(GI ,GJ)=1 G2 02460 GO TO 1120 32 02470 1119 C0ST=A*R+8*(I-1> G2 0248C GO TO 1130 G2 02490 1120 CONTINUE G2 0250C 1130 CONTINUE G2 02510 CALL SUBNET G2 O2520 CALL PVALUE G2 0253C CALL LINE(4) G2 O2540 PRINT 1140, COST G2 O2550 1140 FORMAT(20X,» ORIGINAL NETWORK COST = », 15) G2 0256C CALL LINE<4) G2 0257C CALL TRUTH(P$,1) 32 0258C CALL LINE14) G2 0259C CALL CKT( INCSMX,GLEVEL) G2 0260C 3 2 0261C :*«*»* ENTRY REDUNDANCY CHECK ***** 32 0262C S = 32 0263C T = 52 0264C CALL UNNECE G2 0265C GATES = M 32 0266C C = G2 0267C DO 4 GI = 1,NR 32 0268C C ■ C ♦ L IStJCC ( GI ) G2 0269C IFIGI.LE.NMIGOTfl* 32 O270C IF(LISUCC(GI) .GT.0)GATES=GATES*1 G2 027K 4 CONTINUE G2 0272C OLDCST = A*GATES ♦ B*(C) 52 0273( T=0 G2 0274C 5«0 G2 02 75( C INITIALIZE TIMER TO 10 MINUTES G2 02 76( CALL STIMFZ(60000» 32 0277i time ■ KTIMFZI 0) 32 0278( 3916 3913 36 105 37 320 500 PROCEDURE PROCIV CALL PR0CIVC3) CALL FOR ELAPSED TIME TIME * KTIMEZ(O) - TIME CALL LINE(4> PRINT 3915 F0RMAT(20X,'TIME ELAPSED =•,18,' CENTIS ECCNDS ' I F0RMAT(20X, •NETWORK DERIVED BY PROCIV 1 ) PRINT 3916, TIME CALL LINEC4) CALL TRUTH(P$,1) CALL LINE(4) CALL CKT(INC$MX,GLEVEL) GATES C = DO 36 C = C IFCGI. = M 36 GATES = GATES + 1 TO 37 GI = 1,NR ♦ LISUCC(GI > ,LE.NM) GO to IF( LISUCCIGI ) .GT.O) CONTINUE NEWCST = A*GATES ♦ 8*C IF(NEWCST.LT.OLDCST)GO PRINT 105 FOPMATUH ,10X,«N0 REDUNDANCY FOUND.') GO TO 990 CALL LINE(3) PRINT 320, NEWCST F0RMAT(9X,«* A NETWORK DERIVED BY PR0CIV/9X,' COST=' GO T3 990 STOP END SUBROUTINE PROC IV( VERS IN ) EDITION CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC IMPLICIT INTEGER*4(A-T,V-Z) , REAL(U) DEFINITIONS OF •COMMON' VARIABLES CAN BE FOUND IN MA ECTIONS IN NETWORK AFTER CALLING ECTIONS IN NETWORK BEFORE CALLING ECTIONS REMOVED BY MINI2. ONSECUTIVE TIMES PROCII HAS BEEN GATE. S IN NETWORK AFTER US FOR APPLICATION S CN ITS REMOVAL ). S REMOVED BY MINI2. S IN NETWORK BEFORE CALLING A SUB RETURNED BY MINI2 INDICATING WHE (=1) OR NOT (=0) . SSIBLY) NEW NETWORK DERIVED BY MI OF •!• CGMPCNENTS IN CSPF VECTOR VES THE NUMBER OF 'i« CCMPCNENTS VARIABLE DEFINITION CA: NO. OF CCNN CB: NO. OF CONN CCNNS: NO. OF CONN CQUNTP: NUMBER OF C REMOVING A GA: NO. OF GATE GATE: GATE OF FOC CONCENTRATE GATES: NO. OF GATE GB: NT. OF GATE IMPROV: A PARAMETER SUCCESSFUL NEWCST: COST OF (PO CNECNT: COUNTS NO. ONES: ONES(GI) GI VECTOR PORDER: AN ORDERING ING NUMBERS VEPSIN: VERSION OF ASSIGNING C CALLING A SUBR OF PROCEDURE { OF GATES (NO EX. VARS.) ACCORDIN OF 1«S IN THEIR CSPF VECTORS. A PARTICULAR ORDERING TO BE USED OVERS. G2 02790 G2 02800 G2 02810 G2 02820 G2 02830 32 02840 G2 02850 02 02860 3 2 02 8 70 G2 02880 G2 02 8 90 G2 02900 G2 02910 32 02920 G2 02930 G2 02940 32 02950 G2 02960 G2 02 9 70 32 02980 G2 02990 G2 03000 32 03010 G2 03020 32 03030 32 03040 G2 03050 ',15, '.•) 32 03060 32 03070 32 03080 32 03090 32 03100 CCCCCCCCCCCCCCC 03110 G2 03120 G2 03130 IN PROGRAM. G2 03140 G2 03150 32 03160 MINI2. G2 03170 MINI2. G2 03180 G2 03190 CALLED WITHCUTG2 03200 32 03210 OUTINE. G2 03220 I.E., PROGRAM G2 03230 G2 03240 G2 03250 ROUTINE. G2 03260 THER IT WAS G2 03270 G2 03280 NI2. G2 03290 OF SOME GATE. G2 03300 IN GI 'S CSPF G2 03310 32 03320 G TO INCREAS- G2 03330 G2 03340 BY PROCII IN G2 03350 G2 03360 G2 033 70 I , J,MAX,MIN,PSUB ARE USED AS JUST TEMPORARY VARIABLES. HOW TO INCREASE CAPACITY OF SUBROUTINE. DIMENSION: ONESl X ) ♦ PORDERU ) - X EQUAL TO MAX NUMBER OF GATES PLUS EXTERNAL VARIABLES. COMMON COMMON 1 , 2 3 ♦ COMMON 1 ♦ 2 , COMMON COMMON 1 i 2 , 3 ♦ COMMON 1 2 3 4 5 6 7 NEPMAX N p NM LEVM ISUCC(40,40) INC$MX(40,40 GLEVEL(40) T IFLAG F$UB1 LISTL140) POINTR POTAB(200,42 RPLC(2,40) IDX1EJ32) SETSU40) STS LIP NOO $LTH COMMON , M f N2 , KFLAG , NRN2 , LISUCC<40) ), SUC$MX<40,40 , LGLISTI40) ♦ RTCCNNUOO) ,POINTA ,INPTCV(32) ,POINTL ,VF$1( 32J ),PP0TAB(40) ,IDX0(32) , SUMP( 32) ,N0S1 ,SUMS2(32) ,NOOE ,N01 ,$PW N0T1SV t A t Nl , JFLAG , NMl , IPRED<40,40> ), P$(2,1280) , HLIST<40,40) , S ,ESS1S(40) ,LISTC(40) ,CRIGIN(40) ,VF$UB1 ,LP0TAB(40) , IDX0E(32) .SETTK 32) ,SETS<40) ,SETS2(200) ,KEYA ,N01E ,$NOE ,NGS1SV , 32 G2 G2 G2 G2 32 G2 G2 32 G2 G2 G2 G2 •VERSIN' INDICATES THE ORDERING TO BE USED IN CALL VERSION = 3 OR 5 RECOMMENDEDf BUT VERSION = 1,2, DIMENSION 0N£S<40) ,PORDER<40) G^ = M CB = DG 2 I = 1,NR CB = CB ♦ LISUCC( I) IF{ I.LE.NM) GO TO 2 IF(LISUCC< I ).GT.O) GB = GB + 1 2 CONTINUE 1 CALL *INI2(IMPRCV) IF( IMPPOV.NE.OI GO T3 1 GA = M CA » DD 3 I = 1, MR CA = CA ♦ LlSUCCd ) IF( T .LE.NM) GC TO 3 IF(LISUCC(I I.GT.O) GA = GA ♦ I 3 CCNTINUE GATES = GB - GA CONNS = CB - CA PRINT 1000, GATES, CONNS 1000 F}«MAT< 5X, 16, • GATES AND', 16, • IN 1 2 DURING INITIALIZATION FOR IF (CONNS .EQ.OI GC TO 4 CALL L I N E < 4 ) PRINT 1001 1001 F0RMAT(20X, 'NETWORK DERIVED BY CALL LINE( 4) CALL TRUTH(P$,1) CALL LINE ( 4) CALL CKTI INCSMX,GLEVEL) CCNNECTIONS PROCI V) HAVE BEEN MIM2 AS PART OF PROC t B , NR , COST , NN2 , LIPRED(40) , UNAME(40) , TIME G2 , RSCONN(IOO) G2 ,FS1(32) G2 ,PCINTC G2 , IPATH(40) G2 ,GSMALL(40,32»G2 ,NRPLC(2) G2 ,10X1(32) G2 tNOTl G2 ,NCS G2 ,N0S2 G2 ,KEYB G2 , $GT f,2 ,GI r,2 LMTS2 G2 G2 TO PROCI I G2 R 4 ALSO GOOD G2 G2 32 32 G2 32 32 G2 G2 3 2 G2 32 3 2 32 32 G2 G2 32 G2 ft 2 3 2 REMOVED BY MIG2 32 G2 G2 32 IV) G2 G2 32 32 G2 03380 03390 O3400 O3410 O3420 03430 3440 O3450 03460 O3470 O3480 03490 03500 O3510 03520 03530 03540 03550 O3560 O3570 03580 03590 03600 03610 03620 03630 O3640 03650 03660 03670 03680 03690 03700 03710 03720 33730 03740 03750 03760 03770 O3780 O3790 03800 O3810 03820 O3830 O3840 O3850 03860 03870 03880 038)0 03900 03910 03920 03930 03940 03950 03960 03970 03980 NEWCST = A*GA ♦ B*CA PRINT 1002, NEWCST 1002 F0RMAT(9X,«* A NETWORK DERIVED BY La*,I6t*.*l MINI2 STEP OF COUNT THE NUMBER OF 1«S IN THE C SPF VECTOR FOR E 4 MAX = DO 5 I = N1,NR ONECNT = DO 6 J = 1»N2 IF(GSMALL( I f Jl .LE.OIGO TO 6 ONFCNT = ONECNT «■ 1 6 CONTINUE IF (ONECNT. GT.MAX1MAX»0NECNT PNESC I ) = ONECNT 5 CONTINUE MAX = MAX + 1 MIN = -1 PSU8 = 1 7 MIN = MIN ♦ 1 IF(MIN.EQ.MAX) GO TO 8 DO 9 I = N 1 , NR IF(ONES( I ).NE.MIN)G0 TO 9 PORDERtPSUBJ = I PSU9 = PSU8 ♦ 1 9 C3NTINUE G0T07 8 CONTINUE 1 = 1 COUNTR = CALCULATE GB , THE NUMBER OF GATES BEFORE CALLING G3 = M DO 10 J = l,NR IF(J.LE.NM) GO TO 10 IF(LISUCCUI.GT.O) GB = GB «■ 1 10 CONTINUE 11 IF(I.GT.R) I = 1 GATE = PORDER(I) IF(GATE.LE.NM) GO TO 12 CALL PP0CII(VERSIN,2,GATE,1) CALCULATE GA, THE NUMBER OF GATES AFTER CALLING GA = M DO 13 J = 1,NR IF( J.LE.NM)GO TO 13 IF(LISUCC( J).GT.O) GA = GA ♦ 1 13 CONTINUE IF(GA.EQ.GB) GO TO 12 COUNTR = I = I ♦ 1 GB = GA GO TO 11 12 COUNTR = COUNTR ♦ 1 1 = 1 + 1 IF(COUNTR.GE.R) RETURN GO T3 li END PR0CIV , /9X,« EACH GATE PRCCII PROCII 32 03990 G2 04000 COST G2 04010 G2 04020 G2 04030 G2 04040 G2 04050 G2 04060 S2 04070 G2 040 80 G2 04090 G2 04100 G2 04110 G2 04120 G2 04130 G2 04140 32 04150 32 04160 G2 04170 G2 04180 G2 04190 G2 04200 32 04210 G2 04220 G2 04230 G2 04240 G2 04250 G2 04260 32 04270 G2 04280 32 042 90 G2 04300 G2 04310 32 04320 G2 043 30 32 04340 32 04350 G2 04360 32 04370 G2 04380 32 04390 G2 04400 G2 04410 G2 04420 G2 04430 G2 04440 32 04450 G2 04460 G2 04470 G2 04480 32 04490 32 04500 32 04510 32 04520 G2 04530 *********************************************************** * * * * * NETTRA-G2 ALSO REQUIRES THE FOLLOWING SUBROUTINES: * * * + * * CONCCO, ELANDO, MINl2t OUTPUTt PROCII, RNONES, * * * * AND SUBNET * * * * * * (IDENTICAL TO SUBROUTINES OF THE SAME * * NAMES LISTED FOR NETTRA-G1) * * * * * *********************************************************** C DATA |1. Report No. UIUCDCS-R-75- UBLIOGRAPHI HEET Title amJ Subtitle ; PROGRAM MANUAL: NOR NETWORK TRANSDUCTION BASED ON CONNECT- ^BLE AND DISCONNECTABLE CONDITIONS (Reference Manual of NOR Network Transduction Programs NETTRA-G1 and NETTRA-G2) Author(s) j.N. Culliney Performing Organization Name and Address Department of Computer Science University of Illinois at Urbana-Champaign Urbana, Illinois olSOl 5. Supplementary Notes I Sponsoring Organization Name and Address ional Science Foundation l300 G Street, N.W. Washington, D.C. 20550 3. Recipient's Accession No. 5. Report Date February 1975 6. 8. Performing Organization Rept. No. 10. Project/Task/Work Unit No. 11. Contract/Grant No. NSF GJ-i+0221 13. Type of Report & Period Covered Technical 14. 6. Abstracts This paper explains the operation and usage of two FORTRAN computer programs, TRA-G1 and NETTRA-G2, developed for NOR-network transduction ( trans formation and re daction ) . ixisting (non-optimal) NOR-gate networks and their required output functions are given to the programs as input. The programs, in general, add, change, and /or elete connections in the network in an effort to reduce the cost of the network defined in terms of numbers of gates and connections) as much as possible. Gates are examined individually; their input connections and potential input connections are evaluated under certain conditions of connect ability and disconnectability in order to effect the changes in network configuration and thus reduce network cost. These programs are only two out of a whole system of programs, designated by the name "NETTRA" (for NETwork TRAns duct ion), which implement different NOR-network -nsduction procedures. 7. Key Words and Document Analysis. 17a. Descriptors Logic design, logic circuits, logical elements, programs (computers). 7b. Identifiers/Open-Endtd Terms Computer-aided-design, permissible functions, network transduction, network trans- formation, redundant networks, near-optimal networks, NOR, NAND, CSPF, program manual, NETTRA-G1, NETTRA-G2. 7c. COSATI Field/Group 5. Availability Statement Release unlimited 19. Security Class (This Report) UNCLASSIFIED 20. Security Class (This Page UNCLASSIFIED 21. No. of Pages 22. Price >RM NTIS-35 (10-70) USCOMM-DC 40329-P71 . ■ . tfifO HH «|f *H »w iiP''i V H JiiiRi hiss mEA awflSftS ilil iaffilffl W mSm MM HRA?lH&94lBtt1IMH«Nl{l*BctiBntM ^jss IJnfl wffi $fl ■Hi HHHKffi»&8G mi raltm SeiiSHB II £11 lull HI IH m al 1811%! Stt3 !«UQi ■ S§£@ii3 m mm H HI IMS