Patent GB-1104975-A (GB)
Title: Compiling system
IPC: G06F9/45
Filed: 1965-08-05
Abstract: 1,104,975. Electric digital calculators. INTERNATIONAL BUSINESS MACHINES CORPORATION. 5 Aug., 1965 [13 Aug., 1964], No. 33588/65. Heading G4A. A compiler system accepts parentheses-free mathematical expressions, e.g. in the Reverse Polish notation in which the operators follow the related operands. Read-in.-Initially the expression is passed serially by character into a word register, each word position having A, B, C, D, E and F fields and receiving one character from the expression. In the case of a data character, the character (which represents the memory address storing the data) is placed in the B-field and zero placed in the A-field. In the case of an operator character, the character is placed in the A-field and the B-field receives a result address from a counter (Fig. 6, not shown) which is incremented by one on detection of each operator character. The last character of the expression is an " end " character which is put in the A-field. First pass.-The word register is then scanned from the beginning of the expression until the " end " character is detected. When a zero is detected in the A-field, the associated data address in the B-field is entered into a push-down memory together with an associated " level count " of zero. When an operator is detected, the addresses in the top two positions of the push-down memory are entered into the C and D fields of the operator's word register position, and the associated level counts are compared, the larger being incremented by one in a " level counter " and inserted in the push-down memory together with the contents of the B-field, and also in the E-field. The information mentioned from the top two positions of the push-down memory is deleted from the latter. Thus the E-field finally contains indications of how early given operations can be performed, given that some use as operands the results of other operations. Second pass.-The word register is then scanned in the reverse direction, a flip-flop t (Fig. 5B, not shown) having been set to zero. At each word position, the level count field of an input register associated with the pushdown memory is stored in the F-field. In addition, if a zero is detected in the A-field (indicating data) and the flip-flop is at one, the flip-flop is set to zero. In the case of data with the flip-flop at zero or of an operator, a push-up cycle occurs. Further, in the case of an operator, the level count field of the pushdown input register is decremented by one in the level counter and returned to the input register (after a push-down cycle if the flip-flop was at one), after which a push-down cycle occurs and the flip-flop is set to one unless already at one. Thus generally, as the word register is scanned, the push-down memory is pushed up until an operator is detected when the flip-flop is set to one and push-down then occurs until data is detected when the flip-flop is set to zero, &c. At the end of the pass, the F-field contains indications of how late given operations can be performed without holding up other operations using their result as operands. Routing operations to processors.-The A, B, C and D fields of those word locations of the word register which contain an operator are routed to individual independent processors for computation in increasing numerical order, the " number " of an operator for this purpose consisting of the F-field as high order digit and the E-field as low order digit. Each operation is assigned to the first processor which is ready at the time (Fig. 7A, not shown). The addresses of the two operands are decoded (Fig. 7B, not shown) and if this indicates one is the result of another operation, execution is delayed until a ready bit is detected in the result storage location (Fig. 8, not shown). Results storage.-Intermediate and final results are shown as stored in a set of results registers (Fig. 9, not shown) common to all the processors, but a part of the main memory may be used instead. Modifications.-The F-fields relating to data could be used to control operand fetches, it is mentioned. Forward Polish notation is also mentioned.