One level sorting network4628483Abstract A sorting network is disclosed for sorting N records, N being greater than two, into a total order in accordance with the values of keys associated with each of the records. This sorting network includes as many two-input comparators as are required to compare, substantially at the same time, each of the keys of the records with each of the keys of the other records. Each comparator provides an indication as to the relative values of the two compared keys. A decoder network responds to these indications to determine therefrom the proper order of the records, and gates each of the input records onto an output line corresponding to the proper location of that record in the total order. In the disclosed embodiments, the records are comprised of binary data including plural bits. Embodiments are disclosed for sorting serially by bit and in parallel at least two bits at a time. Claims What is claimed is: Description BACKGROUND AND FIELD OF THE INVENTION
TABLE I
______________________________________
N: 1 2 3 4 5 6 7 8 . . .
Unit Delays:
-- 1 3 3 5 5 6 6 . . .
______________________________________
These delay times, although quite short by human standards, are quite large in comparison to the amount of time required for individual computer operations, and become rapidly larger when these sorting modules are used in iterative, repetitive operations to sort large files of records. Consequently, it would be desirable to provide a system for sorting N records, which did not engender more than a single unit delay, regardless of N. One Level Sorting Network FIG. 3 illustrates in block diagram form the general approach taken in accordance with the teachings of the present invention to provide a sorter system capable of hardware sorting of N input records, while requiring no greater than a one-unit delay time, again using the term "unit time" as defined above. In FIG. 3, the N input records are again applied serially to N input lines. For convenience of description and illustration, these lines are not shown separately. Instead a bus 52 represents these N input lines, each carrying its associated records X.sub.1 -X.sub.n. A number of comparators, each similar to the comparator 16 of FIG. 1 are provided. Each of these comparators has two of the N records applied to its two inputs. As illustrated in FIG. 3, comparator 54 will compare input records X.sub.1 and X.sub.3. Similarly, comparators 56, 58 and 60 will respectively compare record X.sub.1 with each of records X.sub.3, X.sub.4 and X.sub.5. Each comparator will latch its outputs into an appropriate one of two states, depending upon the relative magnitudes of the keys associated with the compared records. Enough comparators must be provided so that each of the input records is compared with each of the other input records. From number theory, then, the number of comparators required to perform this will be N(N-1)/2; i.e., a combination of N items, taken two at a time. Since the outputs of these comparators completely describe the relative magnitudes of each pair of input records, it is necessary only to examine these outputs to determine the total order of all of the input records. To this end, the outputs of the various comparators are supplied to a number of decoder circuits 64, 66, . . . 68. In general, N of these decoder circuits will be provided, each one corresponding with an associated order of record (i.e., first highest, second highest, etc.). Since N different records are provided, then N different decoders will be required. As illustrated in FIG. 3, each of the decoders 64, 66, etc., will include gates 70, 72, . . . 74, each of which will be enabled to pass a corresponding one of the N records when the output lines of the various comparators 54, 56, 58, etc. have a certain form. If, for example, the output lines of the comparators indicate that in each comparison of record X.sub.1 with every other record, the record X.sub.1 appeared as the larger of the two records, then record X.sub.1 is the first highest of the N records, and should appear on output line H.sub.1. In this event, gate 70 will be enabled and the record X.sub.1 will be gated to gate 70 and on to the output line H.sub.1 by the OR gate 76. In general, the gate for whichever of the records has the greatest key will be enabled to pass that record to output line H.sub.1 by the OR gate 76. Obviously, only one of the AND gates 70, 72, 74 will be enabled at any given time. Similarly, decoder 66 will include AND gates for decoding those conditions under which each of the various input records is the second highest record, and will gate the appropriate one of these records onto the output line H.sub.2. Each of the N decoders will include similar circuitry, up to and including the Nth decoder 68 which will also include AND gates and will gate the lowest of the N records onto the output line L. As a general matter, an input record X.sub.i will be Kth highest if K-1 of the keys of the other records are greater than the key associated with record X.sub.i, and N-K keys are smaller. It is the function of each of the record gates to determine the existence of this condition for the associated record. FIG. 4 illustrates one form which the ith record gate for the kth decoder could take. In this embodiment, the record gate includes a plurality of AND gates 77, an OR gate 78 for combining the outputs of all of AND gates 77, and another AND gate 79 which will be enabled to pass the X.sub.i th record whenever the output of OR gate 78 is high. The inputs to gates 77 are derived from comparator outputs. Each of the comparators comparing record X.sub.i with another of the N records will have one or the other of its inputs connected to an input line, for each of AND gates 77. Since there are N-1 of these comparators, then each of AND gates 77 will have N-1 inputs. Of these N-1 inputs, K-1 will be derived from the comparator outputs carrying high signals when the key to record X.sub.i is smaller than the key to the record with which it is being compared, whereas the remaining inputs to the AND gate will be derived from those comparator outputs carrying high signals when the key to record X.sub.i is greater than the key to the record with which it is being compared. Consequently, all of the inputs to a given one of the AND gates 77 will be high only when the key to record X.sub.i is smaller than the keys to K-1 of the other records, but greater than the remaining ones. As brought out above, however, this is precisely the condition in which the record X.sub.i is the kth highest of the records. In this event, the high signal then appearing at the output to the respective AND gate 77 will pass through OR gate 78 and enable the passage of record X through AND gate 79. Each of AND gates 77 will have a different combination of the two outputs of all of the X.sub.i comparators as inputs thereto, selected consistent with the constraints described previously, to cover a different instance in which record X.sub.i is the kth highest of all N records. AND gates 77 will be numerous enough to cover all possible combinations of comparator outputs wherein the key to record X.sub.i is indicated to be smaller than K-1 of the other keys and greater than the remaining keys. Consequently, if the record X.sub.i is the kth highest record, then the output of one of the AND gates 77 will be high, thereby enabling the passage of record X.sub.i through AND gate 79. FIG. 5 illustrates one specific example of a three input line sorter module employing the general concepts of the invention illustrated in FIG. 3. In FIG. 5, three comparators 82, 84 and 86 are required to compare each of the input records with each of the other input records. Comparator 82 compares input records A and B, comparator 84 compares input records A and C, and comparator 86 compares input records B and C. The various outputs of the three comparators 82, 84 and 86 are directed to the three decoder circuits 88, 90 and 92 for appropriate control in the gating of the three input records onto the three output lines. Decoder 8 includes three AND gates 94, 96 and 98, each corresponding to one of the record gates 70, 72, etc. of FIG. 3. AND gate 94 will be enabled when the output AB of comparator 82 is high, indicating that record A has a key which is greater than record B, and the AC output of comparator 84 is high, indicating that the key of record A is also greater than the key of record C. When this occurs, then record A is the greatest of the three, and is enabled to pass to the OR gate 100 via the AND gate 94. Of course, in this circumstance, AND gates 96 and 98 will be disabled by the signals appearing on one or more of their inputs. AND gate 96, for example, will be disabled by the low signal appearing on output BA of comparator 82, and AND gate 98 will be disabled by the low signal appearing on output line CA of comparator 84. In similar manner, gate 96 will be enabled to pass record B when the outputs BA and BC of the comparators are high, indicating that record B has the greatest key. AND gate 98, on the other, will be enabled when the outputs CA and CB of the comparators are high, indicating that record C has the greatest of the three keys. In any event, one of the three AND gates 94, 96, 98 will be active, and the other two will be disabled, hence one of the three input records (the greatest) will be gated to the output line H. The third decoder module 92 operates in a similar manner, gating one of the three input records through a corresponding one of three AND gates 102, 104, 106. The outputs of these gates are joined by an OR gate 108. The A record will be gated via AND gate 102 if both output lines CA and BA are high, indicating that the key of record A is lower than the key of both records B and C. Similarly, AND gate 104 will pass record B in the event that outputs AB and CB are high, indicating that the key of record B is smaller than the keys of both records A and C. Finally, AND gate 106 will gate record C onto the output line L if the comparator outputs AC and BC are high, indicating that the key of record C is smaller than the keys of both records A and B. The second decoder 90 is somewhat more complicated than the decoders 80 and 92, in that each of the records may be the middle record in either of two cases. For example, record A will be the middle record if comparator output lines BA and AC are high, or if comparator lines CA and AB are high. In either case, the key associated with record A will be intermediate the keys associated with the other two records. The two AND gates 110 and 112 decode these two conditions, and correspond with the A gate for this decoder. Similarly, AND gates 114 and 116 represent the B gate for decoder 90, whereas AND gates 118 and 120 represent the C gate for decoder 90. As with the other two decoders, only one of the AND gates 110-120 will be enabled at any given time, hence only one of the three input records will be gated to the output via the OR gate 122. It can be seen both in the specific example illustrated in FIG. 5, and in the more general illustration of FIG. 3, that the number of input lines to this comparator module may be extended indefinitely without substantially increasing the delay time of the module. In all cases, regardless of N, the delay time will approximate the unit delay time. Thus, the approach illustrated in FIGS. 3 and 4 accomplishes the desired result of increasing the speed with which the sorting operation may be accomplished. FIG. 6 illustates one form which the comparators used in the circuitry of FIGS. 3 and 4 could take. This comparator is essentially the same as that set forth in the previously referenced patent to O'Connor, and it is set forth herein for completeness, and only as an example of one form which this comparator circuit may take. In FIG. 6, the two records to be compared (X.sub.1 and X.sub.2) are applied respectively to input lines 130 and 132. A NAND gate 134 monitors the bits of the two input records 130 and 132 and provides a low output signal whenever both are high. The low output of NAND gate 134 disables two AND gates 136 and 138, preventing the outputs thereof from rising to a high level. In the event that one or both of the bits of the records applied to the lines 130 and 132 is low, however, then the output of NAND gate 134 will shift to a high level, thereby enabling both AND gate 136 and AND gate 138. Therefore, if a high level is present upon one (and only one) of the input lines 130 and 132 that high level will be gated to the output of the corresponding AND gate 136 and 138. This high level signal will then trigger one of two RS flip-flops 140 or 142. These two flip-flops 140 and 142 will have initially been placed in a reset condition by a reset signal applied to a reset line 144, prior to the application of the records to the input lines 130 and 132. When reset, the Q output is low and the Q output is high. Consequently, flip-flop 142 will have been placed in an initial condition wherein the output X.sub.1 X.sub.2 is high and the output X.sub.2 X.sub.1 is low. Additionally, since the Q output of flip-flop 140 is high, and AND gate 146 coupling the output of AND gate 138 to the set input of flip-flop 142 will be enabled. If a high logic signal first appears at the output of AND gate 138, then this high signal will set flip-flop 142, changing the state of its output (i.e., the Q line will go high and the Q line will drop low). Flip-flop 142 will then remain in this condition until reset by a reset signal applied to reset line 144 prior to the application of the next records to be sorted thereto. If the high level first appears at the output of AND gate 136, however, then flip-flop 140 will instead be set, thus disabling AND gate 146 and preventing any further positive levels from being transmitted to the set input of flip-flop 142 from AND gate 138. Consequently, flip-flop 142 will thereafter remain in a reset condition, wherein the X.sub.1 X.sub.2 output is high and the X.sub.2 X.sub.1 output is low. To once again summarize the operation of this circuit, then, after being reset by the reset signal supplied to line 144, the two records will be applied bit by bit, the most significant bit first, to the input lines 130 and 132. If the two bits presented thereto are both high, then the comparator will be disabled by NAND gate 134. When a high level appears at one input and not at the other input, the high level will be transmitted to the output of the corresponding AND gate 136 or 138 and will either set flip-flop 142, or will lock flip-flop 142 into a reset condition by disabling AND gate 144 through the setting of flip-flop 140. Whether flip-flop 142 is set or reset will depend upon which of the inputs the high level first appeared on, and hence will directly reflect which of the two keys is the greater. FIG. 7 illustrates in broad block diagram form one manner in which an N line sorter in accordance with the teachings of the present invention could be used in a data processing system. In this figure, the data, control and address busses of the data processing system are represented at 150. These busses are connected to input and output buffers 152 and 154, respectively, which convert the words provided in parallel along the bus 150 into the serial form required by the sorter 156. One form which the input buffer could take is illustrated in FIG. 8. In this figure, it will be seen that N different parallel-input, serial-output record buffers 158, 160 . . . 162 are provided. Each of these record buffers comprises S different word buffers 164, 166, 168 . . . 170, each of which has sufficient capacity to store a single one of the words presented along the bus 150. In practice, each of these record buffers will be loaded one word at a time in parallel from the bus 150. After all of the records are loaded into the word buffers, the N line sorter 156 (FIG. 7) will be reset by a signal applied to its reset input. Appropriate clock signals will then be applied in synchronism to each of the record buffers, shifting the parallel loaded records in the record buffers out to the N line sorter module 156 one bit at a time, and in synchronism with one another. Of course, as stated previously, the records will be loaded so that the key will be shifted into the sorter 156 first, with the most significant bit leading. The N line sorter 156 will then connect each of the input lines X.sub.1 -X.sub.n to an appropriate one of the output lines H.sub.1 -L, with the connections being determined by the magnitude of the keys associated with the individual records, in the manner which has been described previously. The records will thus be sorted and will appear on the N output lines to be shifted into the output buffer 154. The output buffer 154 may take any appropriate conventional form, and generally will be similar to the input buffer, shown in FIG. 8, except that the words will be serially shifted in, rather than out, and that they will be read out onto the bus 150, rather than being loaded therefrom in the fashion of the input buffers 152. When a file to be sorted includes more than N records, the data processing arrangement may be programmed so as to sort these records N at a time in a conventional iterative sequence. If it is desired to provide entirely hardware (as opposed to software) sorting of a large number of input records through use of sorters having fewer input lines, than the N line sorter modules which have been described hereinbefore may be cascaded in a form which is much similar to the form in which two line sorter modules have been cascaded in the past. FIG. 9 illustrates the example in which four line sorters are cascaded to provide sorting of eight different input records. It will be seen from FIG. 9 that five different four line sorters 172, 174, 176, 178 and 180 are required to perform this sorting function. Of course, the FIG. 9 embodiment is somewhat disadvantageous as compared to an eight line, one level sorting module as could be constructed as in accordance with the general teachings of the FIG. 3 embodiment, in that three unit delays are required to sort the input records, as opposed to only a single delay for the embodiment of FIG. 3. This embodiment does have the advantage, however, of achieving the sorting of eight input records with somewhat diminished complexity as compared to that which will be required with the eight line, one level sorter embodiment. It should be noted that the FIG. 9 embodiment is faster than an embodiment wherein the four line sorting modules 172-180 each comprised a number of cascaded two line sorting modules such as shown in FIG. 2B, since the four line sorting modules of FIG. 2 includes three unit delays as opposed to the one unit delay required by the four line, one level sorting modules 172-180 of FIG. 9. It will in general be recognized that any N line, one level sorting module in accordance with the teachings of the present invention may be cascaded with plural other modules in a fashion completely analogous to that of two line sorting modules so as to achieve simultaneous sorting of a larger number of input records than are provided for by that N line, one level sorter module, by itself. In the embodiments which have heretofore been described, the records are sorted serially by bit, i.e., at any given time only one bit of each record is being compared with the corresponding bit of each other record. The sorting operation need not take place in this serially by bit fashion, however. Instead, sorting may be accomplished serially by byte, or even by word. Since, in these cases, more than one bit of each record will be compared at any given time with the corresponding bits of the other records, the sorting will take place at a much faster pace than in the serially by bit embodiment. The circuitry is, however, correspondingly more complex. The general configuration of an embodiment for sorting records serially by byte would have the same general configuration as illustrated in FIG. 3. The comparators 54, 56, 58, 60 . . . 62 would, however, in this event compare bytes, rather than bits. Also, the gates 70, 72, . . 74, 76 would, of course, function to gate the records by byte, rather than by bit. In this embodiment, as in previous embodiments, the comparators 54, 56, 58, 60 . . 62 would be reset prior to the initiation of a sorting function. Thereafter, the records would be presented along the bus 52, with a corresponding byte of each record being presented along this bus at any given time. As before, the records will be presented key first, with the most significant byte leading. The comparators will compare the magnitudes of the two bytes presented at the input, and will provide an output indicating which of the two is the greater. As with the FIG. 3 embodiment, it will be expedient if the comparator provides two outputs which are the logic inverse of one another. FIG. 10 broadly illustrates the form which one of the comparator 54, 56, 58, 60 . . . 62 would take. In this figure, the lines designated A.sub.1 -A.sub.8 will carry the eight bits of the byte then being presented of record A, with the lines designated B.sub.1 -B.sub.8 carrying the corresponding bits of the byte of record B then being presented. A.sub.1 and B.sub.1 will be the most significant bits, A.sub.2 and B.sub.2 the second most significant bits, etc. Bit comparator circuits 200-214 each compare corresponding bits of the two records. Each of the comparators 200-214 includes two comparator outputs AB and BA for indicating the relative magnitudes of the bits presented thereto. Thus, if input A.sub.1 has a high value and input B.sub.1 has a low value, then output line AB will be high and output BA will be low. Similarly, if the input line B.sub.1 has a high logic level applied thereto when input line A.sub.1 is low, then the output line BA will be high, whereas output line AB will be low. Both of the output lines AB and BA, however, will be low when the two input signals are equal (i.e., both high or both low). In addition, each of the bit comparator circuits 200-214 includes an enable input and an enable output. The various output lines AB and BA of each comparator circuit will respond as described above only if the enable input into that comparator circuit is at a high logic level. If that enable input is at a low logic level, however, the outputs will be forced into a low logic level. The enable output generated by each bit comparator circuit 200-214 will be at a high logic level only if the enable input into that comparator circuit is also at a high logic level, and the two inputs into that bit comparator circuit are equal. Because of this, if any one of the enable lines E.sub.1 -E.sub.8 is at a low logic level, then all succeeding enable lines will also be low. Hence, if the enable input E.sub.1 into comparator circuit 200 is at a low logic level, then all of the other enable lines E.sub.2 -E.sub.8 will also be at a low logic level, hence all of comparator circuits 200-214 will be disabled and all of the outputs AB and BA will be forced into a low logic level. The various AB and BA outputs are gated to two RS flip-flops 220 and 222 which respectively serve the same function as flip-flops 140 and 142 in the two input comparator circuit of FIG. 6. Thus, flip-flop 222 provides outputs identifying which of the two input bytes is greater, whereas flip-flop 220 operates to disable the comparator circuit from changing states when a comparison is decided. Prior to the initiation of a sorting operation, a pulse will be applied along a reset line 228 to the reset inputs of both flip-flops 220 and 222. Consequently, flip-flop 222 will be reset into a state where its Q output (line BA) is low, and its Q output (line AB) is high. Similarly, the Q output of flip-flop 220 will be reset to a high logic level, thereby providing an enabling input (high logic level) into the enable input E.sub.1 of comparator 200. In operation, the comparator of FIG. 10 functions in much the same way as the comparator of FIG. 6, with the comparison determination depending upon the time sequence in which high logic level signals are applied to the set inputs of flip-flops 220 and 222. If a high level signal is first applied to the set input of flip-flop 220, then the Q output thereof will shift to a low logic level, thereby disabling the comparison circuit and preventing a high level signal from appearing at the set input of flip-flop 222. Flip-flop 222 is thereby locked into the state in which it was initially reset, i.e., indicating that the input byte A has a greater magnitude than the input byte B. If a high level signal appears initially at the set input to flip-flop 222, however, then the outputs AB and BA will exchange states, whereby the output BA is now at a high level, indicating that the record B has the greater key. As before, the flip-flop 222 will remain locked in this state until reset by a pulse applied to the reset line 228 at a subsequent time, just prior to the application of the first bytes of the keys of the next records to be sorted. To understand this better, consider the example utilized to describe FIG. 1. Thus, presume that the byte applied to lines A.sub.1 -A.sub.8 is "11000001", and the byte applied to input lines B.sub.1 -B.sub.8 is "11001001". In this case, bit A.sub.1 and B.sub.1 are equal, hence the high enable signal will descend from comparator 200 to comparator 202. Bits A.sub.2 and B.sub.2 are also equal, however, hence the enable signal will descend once more to comparator 204. Since the third and fourth bits of bytes A and B are similarly equal, the enable signal will descend through comparator circuits 204 and 206 and will be applied to comparator 208. The fifth bits of the two bytes are not equal. Consequently, the enable signal generated by comparator 208 will remain low, thus disabling comparator 210, 212 and 214. Also, the output line BA of comparator circuit 208 will shift to a high logic level, since the fifth bit of the B byte is greater than the fifth bit of the A byte. This high signal will be transmitted through OR gate 226 to the set input of flip-flop 222, thereby setting this flip-flop into the state indicating that the record B has the greater key of the two records. Flip-flop 222 will then remain in the set condition until reset just prior to the initiation of another sorting operation. FIG. 11 illustrates one form which each of the comparators 200-214 could take. In this figure, the NAND gate 230 and the AND gates 232 and 234 serve essentially the same functions as NAND gate 134 and AND gates 136 and 138, respectively, serve for the comparator of FIG. 6. Thus, the output of NAND gate 230 will drop to a low logic level when both inputs are high, disabling the transmission of these high logic levels to the output lines of the comparator. A third input into each of the AND gates 232 and 234 is connected to the enable output from the preceding bit comparator stage. Thus, unless this enable input is high, the outputs from this comparator will be forced to a low logic level. The remaining circuitry, comprised of OR gate 236, NAND gates 238 and AND gate 240, generate the enable output signal used to control the next succeeding comparator circuit. OR gate 236 will provide a low logic level output only when both input signals are at a low logic level. The output of OR gate 236 and the output of NAND gate 230 are joined in a NAND gate 238, which functions as an OR gate with negated inputs. Thus, the output to gate 238 will be at a high logic level only if one of the two inputs thereto is at a low logic level, i.e., only if the inputs A.sub.n and B.sub.n to the comparator circuit are both high (in which case the output of NAND gate 230 will be at a low logic level) or both low (in which case the output of OR gate 236 will be at a low logic level). Gate 240 "ands" the output of gate 238 with the enable input from the preceding stage, thereby disabling the application of an enable signal to a subsequent stage unless the enable input to that stage is also high. As stated previously, the record gates used in the decoders 64, 66 . . . 68 (FIG. 3) must also operate to gate eight bit bytes, rather than a single bit at a time, as in previous embodiments. FIG. 12 broadly illustrates one form which the record gates could take in a three line sorter module, such as that shown in FIG. 5, but for sorting records by byte. In this figure, the circuit 242 corresponds to the X.sub.1 gate 70 of FIG. 3. This circuit 242 includes eight AND gates 244-258 which serve to effectively pass or block the eight bits of one byte of a record being sorted (in FIG. 12, record A). These AND gates 244-258 are controlled by a gate control circuit 260. Gate control circuit 260 has for its input the outputs of each of the comparators which compare the byte of each record with the byte of each other records. Based upon these comparator outputs, the gate control 260 determines whether or not the record being serviced by those AND gates is the Nth highest record. If it is, then the output of gate control circuit 260 will shift to a high logic level, enabling all of AND gates 244-258 and permitting the A record byte to be transmitted to the H.sub.n output via OR gates 262-276. Similarly, if gate control 260 determines that record A is not the Nth highest record, then the output thereof will be at a low logic level, disabling all of gates 244-258 and preventing the A record from being transmitted to OR gates 262-276. The OR gates 262-276 combine the outputs of each of the record gates (such as the record gate 242) for all N records. In FIG. 12, OR gates 262-276 are illustrated as having three inputs, thereby being, in this example, specifically adapted for the situation in which the sorter sorts three records simultaneously. One input to each of the OR gates 262-276 is derived from the output (B') of the B record gate, whereas the third input to each of the OR gates 262-276 is derived from the outputs (C') of the C record gate. In a system for sorting N records serially by byte, each of the decoders such as decoder 64, 66 . . . 68 of FIG. 3 will include N record gates 242 and one set of OR gates such as OR gates 262-276. Each OR gate will have N inputs, one derived from each of the N record gates 242. In each decoder, one and only one of the record gates would be enabled at any given time, thereby permitting only a single one of the N records to be gated to the output H.sub.n of that decoder. Since there are N gate control circuits for each decoder, and there are N decoders, there will be a total of N.sub.2 gate control circuits. For the situation in which three records are to be sorted serially by byte, nine different gate control circuits must be provided. For exemplary purposes, FIG. 13 illustrates these nine different gate control circuits. The three gate control circuits for the first highest decoder will each comprise only a single AND gate 278, 280 and 282. Similarly, the three gate control circuits used in the third highest decoder will each comprise only a single AND gate 284, 286 and 288. The gate control circuits for the second highest decoder will have a more complicated form, however. This is because, as described previously, there are two different conditions under which each of the records may be the second highest record. As illustrated in FIG. 13, each of these three gate control circuits comprises two AND gates 290, 292; 294, 296; and 298, 300; together with a corresponding OR gate 302-306 for joining the outputs of the corresponding two AND gates. The manner of selection of the input signals for the various logic gates of the gate control circuits has been described previously in the description of the circuitry of FIG. 5, and will not be repeated herein. Terminology When used hereinafter in connection with three input sorters such as the sorter of FIG. 5, the term "initial state"(S.sub.O) should be understood to refer to the state of the sorting circuitry after reset. The term "first-level state" (S.sub.11 -S.sub.16), on the other hand, should be understood to refer to the state of the circuitry when the highest record or lowest record has been identified but the relative order of the other two records has not yet been determined, while the term "second-level state" (S.sub.21 -S.sub.26) should be understood to refer to the state of the circuitry after the relative order of all three records has been finally determined. Thus, as the three records are serially presented, the circuitry proceeds from an initial state to a first-level state, and then to a second-level state. The circuit remains in the second-level state until reset prior to the presentation of the next records. The "state" of the FIG. 5 sorter is indicated by the logic values of the flip-flops 140, 142 (FIG. 6) associated with each of the three comparators 82, 84, and 86. The initial state, six first-level states, and six second-level states are represented by the outputs of the flip-flops as follows:
______________________________________
STATE TABLE
A:B A:C B:C
(82) (84) (86)
F/F F/F F/F F/F F/F F/F
State 140 142 140 142 140 142 ABC
______________________________________
S.sub.0.sub.
0 0 0 0 0 0 000 or 111
S.sub.11
0 0 0 1 0 1 001
S.sub.12
0 1 0 1 0 0 011
S.sub.13
0 1 0 0 1 0 010
S.sub.14
0 0 1 0 1 0 110
S.sub.15
1 0 1 0 0 0 100
S.sub.16
1 0 0 0 0 1 101
From-To
S.sub.21
X 1 X 1 X 1 011-X01
001-01X
S.sub.22
X 1 X 1 1 0 010-0X1
011-X10
S.sub.23
X 1 1 0 1 0 010-1X0
110-01X
S.sub.24
1 0 1 0 1 0 110-10X
100-X10
S.sub.25
1 0 1 0 X 1 100-X01
101-1X0
S.sub.26
1 0 X 1 X 1 101-0X1
001-10X
______________________________________
X = don't care.
Although the invention has been described with respect to preferred embodiments, it will be appreciated that various rearrangements and alterations of parts may be made without departing from the spirit and scope of the present invention, as defined in the appended claims.
|
Same subclass Same class Consider this |
||||||||||
