Patent GB-1214085-A (GB)
Title: Data processing systems
IPC: G06F7/24
Filed: 1968-10-07
Abstract: 1,214,085. Sorting data words. INTERNATIONAL BUSINESS MACHINES CORP. 7 Oct., 1968 [2 Nov., 1967], No. 47363/68. Heading G4M. Words from an input unit TA are sorted into an ordered sequence by a series of string ordering and merging operations, each string of ordered words being produced as a result of an internal computer operation and merge operations being performed externally on a set of N intermediate I/O units IU, e.g. discs or tapes. The computer may be a conventional multiprogrammed computer with a programme interrupt routine which is entered whenever a string ordering or merging operation is required. The sorting process utilizes five routines as follows:- Begin routine.-An initial string is written on each of N - 1 successive intermediate units IU-0 to IU-(M - 1), N being 5 in the example shown, and these strings are then merged on to the remaining unit IU-M. Starting with IU-M, an initial string is written on another N-1 consecutive units, in the same direction end around, and merged on to the remaining unit IU-(M-1), and the process is repeated until there is a merge string on all units except IU-0. An area of main storage labelled IU string count table is updated after each string is written to keep track of the number of strings in each unit IU, and is addressed by I and L counters which are stepped up and down to the current values of I, signifying the identity of the active unit IU, and L, signifying the level or number of strings in a unit. The data for the IU string count table is derived from an adder to which 1 is added whenever an initial string is written on a unit IU, and which adds words from the IU string count table corresponding to merge strings which are being group merged. At the end of the Begin routine, the Alpha routine is entered. Alpha routine.-A merge direction switch is turned OFF (see Machine test, for function). An initial string is written on N-1 consecutive units IU in the reverse order to the Begin routine (the I counter is decremented between strings), and the strings are merged on the remaining unit. The process is repeated starting with the unit holding the last merge string until a further merge string has been written on N-2 consecutive units in ascending order. In the first alpha routine units IU-2 to IU-M receive a second merge string in that order. The machine test routine is entered. Machine Test routine determines which routine is to follow and is entered on completion of an alpha, beta or gamma routine. The alpha routine is re-entered if the units IU hold strings only at the lowest level (L = 0). If any non-zero number of initial strings in the merge strings at the highest level is not equal to the number of initial strings in the merge string at the next lower level of the unit which does not contain a higher level merge string, the I and L counters are incremented and the Alpha routine reentered. The above comparison is effected by accessing the corresponding words from the IU string count table. If all the compared words are equal, the Beta or Gamma routine is entered depending on whether the merge direction switch is OFF or ON. Beta routine.-The merge strings compared in the machine test routine are merged on to a unit having no string at the compared levels L, (L-1), this unit being adjacent the unit I from which the lower level merge string was taken. The merge direction switch is turned ON. Gamma routine is similar to the Beta routine except that the group merge is effected on the unit on the other side of the unit I. The merge direction switch is turned OFF.