JPH0666050B2 - Sort processing method - Google Patents

Sort processing method

Info

Publication number
JPH0666050B2
JPH0666050B2 JP59163519A JP16351984A JPH0666050B2 JP H0666050 B2 JPH0666050 B2 JP H0666050B2 JP 59163519 A JP59163519 A JP 59163519A JP 16351984 A JP16351984 A JP 16351984A JP H0666050 B2 JPH0666050 B2 JP H0666050B2
Authority
JP
Japan
Prior art keywords
data
input
output
identifier
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP59163519A
Other languages
Japanese (ja)
Other versions
JPS6142031A (en
Inventor
哲司 佐藤
伸生 津田
忠通 川田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP59163519A priority Critical patent/JPH0666050B2/en
Publication of JPS6142031A publication Critical patent/JPS6142031A/en
Publication of JPH0666050B2 publication Critical patent/JPH0666050B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はソート処理方法に関し、特に大量のデータを短
時間で昇順あるいは降順に並びかえることを可能とする
ソート処理方法に関する。
The present invention relates to a sort processing method, and more particularly to a sort processing method capable of rearranging a large amount of data in ascending order or descending order in a short time.

〔従来技術〕[Prior art]

ソートとは、与えられたデータの集まりを所定の順序に
従って並び替える処理である。電子計算機におけるソー
ト処理とは、数値あるいは文字列として与えられたデー
タが、計算機内部では“0"あるいは“1"の二値符号で表
記されている事から、二値符号の持つ数値的意味にもと
づいて、与えられたデータを相互に比較し、それぞれの
データの大小関係によって、昇順(小さいものから大き
いものへの順)あるいは降順(大きいものから小さいも
のへの順)にデータを並びかえることである 従来、このようなソート処理を、メモリ装置と、中央演
算装置(CPU)を中核として構成した汎用の電子計算機
で実行する場合には、メモリ装置と中央演算装置の間の
データ転送や比較が逐次処理であることや、一度に2個
のデータ間の比較しか出来ない等の理由により、ソート
処理で対象とするデータ数が大量の場合には、処理に要
する時間が極めて長くなるという問題があった。
Sorting is a process of rearranging a given set of data in a predetermined order. The sort process in an electronic computer means that the data given as a numerical value or a character string is represented by a binary code of "0" or "1" inside the computer, so the numerical meaning of the binary code has First, compare the given data with each other and rearrange the data in ascending order (smallest to largest) or descending order (largest to smallest) depending on the size relation of each data. Conventionally, when such sort processing is executed by a memory device and a general-purpose computer having a central processing unit (CPU) as a core, data transfer and comparison between the memory device and the central processing unit are performed. When the number of data to be sorted is large, it is necessary for the processing because of the sequential processing and the fact that only two data can be compared at a time. But there is a problem that becomes extremely long.

かかるソート処理時間に関する問題を解決する従来装置
として、専用のソート処理装置を用いて、比較による大
小関係の判定と、データの転送を並列に行って高速化を
図る方法がある。第2図に該ソート処理装置に用いるソ
ート回路の構成例を示す。本回路は、比較の対象となる
データを保持するための第1のメモリ1および第2のメ
モリ2、比較器3、該比較器3によって得られた判定結
果を保持するためのフラグレジスタ4および入出力回路
5からなるユニット6の複数個を一次元接続した構成を
有している。本回路では、データ相互の比較と転送を複
数のユニットで同時に実行できるため、以下に説明する
動作原理にしたがって、データ数に比例する時間でソー
ト処理を行うことができる。
As a conventional apparatus that solves the problem related to the sort processing time, there is a method of using a dedicated sort processing apparatus to determine the magnitude relationship by comparison and transfer data in parallel to increase the speed. FIG. 2 shows a configuration example of a sort circuit used in the sort processing apparatus. This circuit includes a first memory 1 and a second memory 2 for holding data to be compared, a comparator 3, a flag register 4 for holding the determination result obtained by the comparator 3, and It has a configuration in which a plurality of units 6 each comprising an input / output circuit 5 are one-dimensionally connected. In this circuit, data can be compared with each other and transferred simultaneously by a plurality of units, so that the sorting process can be performed in a time proportional to the number of data according to the operation principle described below.

第3図は、第2図のソート回路の動作原理図であり、一
例として、0がら9までの一桁の数値データのうち、3,
6,5,2,4,1の6個のデータを降順にソートする場合の動
作を示している。なお、第3図では、第2図における第
1のメモリ1および第2のメモリ2とフラグレジスタ4
のみを簡略に示しており、他の回路は省略してある。
FIG. 3 is an operation principle diagram of the sorting circuit shown in FIG. 2, and as an example, out of the one-digit numerical data up to 0 to 9,
It shows an operation in the case of sorting six pieces of data of 6,5,2,4,1 in descending order. In FIG. 3, the first memory 1 and the second memory 2 and the flag register 4 in FIG.
However, other circuits are omitted.

ソート処理を行うにあたって、はじめに全てのユニット
の第1のメモリ1および第2のメモリ2の内容を初期設
定する。この際、降順にソートする場合には、データの
最小値として0を設定し、昇順にソートする場合には、
データの最大値として9を設定する。第3図は降順にソ
ートする場合であり、第1および第2のメモリ1,2には
0を設定してある。本回路では、順次データを入力する
入力操作と、順次データを出力する出力操作とでソート
処理を行うが、一回の入力操作で各ユニットでは、デー
タの右方向への転送と2個のデータ間での比較とを行
う。この場合、転送されるデータは第1および第2のメ
モリ1,2に保持された2個のデータのうちの小さい方で
ある。この時、データの転送と同期して1個のデータを
ソート回路に入力し、再左端のユニットの第1のメモリ
1あるいは第2のメモリ2のいずれかのうち、転送によ
って空になった方のメモリに保持する。(T1〜T6) この入力操作を繰り返して6個のデータの全ての入力が
完了した時点で、今度は出力操作によって順次データを
隣接する左側のユニットに転送する。この時、転送する
データはユニット内の2個のデータのうち大きい方であ
り、最右端のユニットには0を入力する。(T7〜T12) 以上、入力操作の繰り返しによってデータが順次入力さ
れ、データの入力が完了した段階で出力操作を実行する
ことにより、最大値から順次データが降順に取り出され
る。ここで説明したソート処理の一例では、6個のデー
タの並べかえが3個のユニットを用いることによって、
6回の入力操作と6回の出力操作とで行えることから、
一般に第2図のソート回路では、1回の入力操作と1回
の出力操作とを1サイクルとすると、データ数に等しい
入力サイクルおよび出力サイクル数で昇順あるいは降順
のソート処理が行える。
When performing the sorting process, first, the contents of the first memory 1 and the second memory 2 of all units are initialized. At this time, when sorting in descending order, 0 is set as the minimum value of data, and when sorting in ascending order,
Set 9 as the maximum value of the data. FIG. 3 shows a case of sorting in descending order, and 0 is set in the first and second memories 1 and 2. In this circuit, sort processing is performed by an input operation of sequentially inputting data and an output operation of sequentially outputting data. In each unit, data is transferred to the right and two pieces of data are transferred in each unit. Compare with each other. In this case, the data to be transferred is the smaller of the two data held in the first and second memories 1,2. At this time, one piece of data is input to the sort circuit in synchronization with the data transfer, and one of the first memory 1 and the second memory 2 of the leftmost unit which has become empty due to the transfer. Hold in memory. (T1 to T6) When this input operation is repeated and all six pieces of data have been input, the output operation sequentially transfers the data to the adjacent unit on the left side. At this time, the data to be transferred is the larger of the two data in the unit, and 0 is input to the rightmost unit. (T7 to T12) As described above, the data is sequentially input by repeating the input operation, and the output operation is executed when the data input is completed, so that the data is sequentially extracted from the maximum value in the descending order. In the example of the sorting process described here, the rearrangement of 6 pieces of data is performed by using 3 units.
Since it can be done with 6 input operations and 6 output operations,
Generally, in the sorting circuit of FIG. 2, if one input operation and one output operation are regarded as one cycle, ascending or descending sort processing can be performed with the number of input cycles and the number of output cycles equal to the number of data.

本ソート回路を電子計算機の周辺装置(ソート処理装
置)として使用する場合には、電子計算機のメモリ等に
予め保持してあるソート対象のデータを電子計算機のデ
ータ転送路を介してソート処理装置に順次入力し、次い
でソート処理がなされたデータを同じくデータ転送路を
介して元のメモリ等に順次格納する。この場合、データ
の転送時間と重畳して比較による大小判定を行うなどに
より、ほぼデータの転送時間でソート処理を行なうこと
ができ、ソート処理に要する時間を大幅に短縮すること
が可能となる。
When this sort circuit is used as a peripheral device (sort processing device) of an electronic computer, the data to be sorted, which is held in advance in the memory of the electronic computer, is sent to the sort processing device via the data transfer path of the electronic computer. The sequentially input data and the sorted data are sequentially stored in the original memory or the like via the data transfer path. In this case, the sorting process can be performed almost in the data transfer time by superimposing the data transfer time and the comparison to determine the size, and the time required for the sorting process can be significantly reduced.

以上説明した第2図のソート回路では、1ユニット当り
2個のデータを取り込むためL個のユニットを一次元に
接続した場合には、一度に最大2L個までのデータのソー
トが可能である。しかし、このようなソート回路を電子
計算機の周辺装置として設ける場合には、予めソート処
理で対象とするデータ数の上限を想定して、これに見合
う十分大量のユニットを設けておく必要があり、ソート
処理装置の規模が大型になり不経済となるという問題が
あった。また、いったんユニット数を決定してソート処
理装置を構成してしまうと、許容されるデータ数をこえ
るソートは本ソート処理装置では行えない問題があっ
た。このため、従来は極めて大量のデータのソートが必
要な場合には、データ全体をソート処理装置でソート処
理できる程度の規模に分割した後に、それぞれをソート
処理装置でソートし、全体を汎用計算機上のCPU装置を
用いてソフトウェアの手段によってマージ(併合)する
マージ・シート法と呼ばれるソート方法がとられてき
た。
In the sorting circuit of FIG. 2 explained above, in order to take in two data per unit, when L units are connected in one dimension, a maximum of 2L data can be sorted at one time. However, when such a sort circuit is provided as a peripheral device of an electronic computer, it is necessary to preliminarily assume an upper limit of the number of target data in the sort process and provide a sufficiently large number of units corresponding to this. There is a problem that the size of the sort processing device becomes large and uneconomical. Further, once the number of units is determined and the sort processing device is configured, there is a problem that the sort processing device cannot perform sorting exceeding the allowable number of data. Therefore, in the past, when it was necessary to sort an extremely large amount of data, after dividing the entire data into a size that can be sorted by the sort processing device, each was sorted by the sort processing device and the entire data was sorted on a general-purpose computer. A sorting method called the merge sheet method has been adopted in which the CPU device of the above is used to merge by software means.

一般に、いくつかのデータがある規則にもとずいて並べ
られたデータ列をストリングと称している。マージ・ソ
ート法では2個以上のストリングを1個のストリングと
してマージする。この時、一度にマージできるストリン
グ数をマージ・ウェイ数という。いまストリング数が16
個あったとすると、マージ・ウェイ数が2ならば、スト
リング数は、16個から8個,4個,2個,1個と減少してい
き、ソート処理が終る。一回のマージ操作では、マージ
・ウェイ数と等しい数のデータを相互に比較し、比較の
結果にもとづいて、全てのデータを並べかえるために移
動する。上記の例では、このマージ操作を4回行ってお
り、何回のマージ操作を必要とするかは、ストリング数
mとマージ・ウェイ数kの関係からlogkmで与えられ
る。したがって、m個のストリングに予めソートされた
全体でN個のデータをマージするためには、N×logkm
回のデータの移動が必要となる。
Generally, a data string in which some data are arranged according to a certain rule is called a string. In the merge sort method, two or more strings are merged as one string. At this time, the number of strings that can be merged at one time is called the number of merge ways. Now there are 16 strings
If the number of merge ways is 2, the number of strings decreases from 16 to 8, 4, 2, 1 and the sorting process ends. In one merge operation, the same number of pieces of data as the number of merge ways are compared with each other, and all the pieces of data are moved to be rearranged based on the result of the comparison. In the above example, this merge operation is performed four times, and the number of merge operations required is given by logkm from the relationship between the number of strings m and the number of merge ways k. Therefore, in order to merge N pieces of data presorted into m pieces of strings, N × logkm
It is necessary to move the data once.

一般に、汎用の計算機では1台のCPU装置で比較を行う
ために、マージ・ウェイ数kは2である。このため、汎
用計算機に、専用のソート処理装置を付加した場合であ
っても、データ数が極めて大きく、ストリング数mも大
きい大量のデータをソート処理する場合には、複数回の
マージ操作が必要となり、膨大な処理時間が必要となる
という問題があった。したがって、今日、データベース
を対象とした情報処理技術の進展に伴ってソート処理で
対象とするデータの件数はますます増大する傾向にあ
り、かかる従来技術の問題を解決した、極めて膨大なデ
ータ数にも柔軟に対処できる処理能力の高いソート処理
装置が望まれている。
Generally, in a general-purpose computer, the number of merge ways k is 2 because one CPU device performs comparison. For this reason, even when a dedicated sort processing device is added to a general-purpose computer, when a large amount of data and a large number of strings m are sorted, a plurality of merge operations are required. Therefore, there has been a problem that a huge amount of processing time is required. Therefore, the number of pieces of data targeted for sort processing tends to increase more and more with the progress of information processing technology for databases today. There is a demand for a sort processing device having a high processing capacity that can deal flexibly.

〔発明の目的〕[Object of the Invention]

本発明の目的は、上記従来技術の問題点を除去し、デー
タベース等の極めて大量のデータを対象としたソート処
理に適するソート処理方法を提供することにある。
An object of the present invention is to eliminate the above-mentioned problems of the prior art and to provide a sort processing method suitable for sort processing on an extremely large amount of data such as a database.

〔発明の構成および作用〕[Structure and Action of Invention]

本発明のソート処理装置は、昇順もしくは降順にソート
済みの複数のデータ列を格納するメモリ手段と、初期操
作では前記複数のデータ列からそれぞれ最小もしくは最
大のデータを取り出し、通常操作では前記複数のデータ
列のうちの1個のデータ列を選択して該データ列中の最
小もしくは最大のデータを取り出し、該取り出したデー
タに、当該データの属するデータ列を識別する識別子を
付加してソート手段へ入力する入力処理手段と、前記入
力処理手段から入力された複数個の識別子付データを格
納でき、該格納データのうちから最小もしくは最大のデ
ータを抽出し、識別子を付加して出力するソート手段
と、前記ソート手段から出力された識別子付データから
識別子を切り出すとともに、該切り出した識別子あるい
はその関連情報を、次に選択すべきデータ列を決定する
ために前記入力処理手段へ与える出力処理手段とを有す
ることを特徴とするものである。以下、本発明の一実施
例について詳細に説明する。
The sort processing apparatus of the present invention includes a memory means for storing a plurality of data strings sorted in ascending order or a descending order, and a minimum or maximum data from each of the plurality of data strings in the initial operation, and the plurality of data strings in the normal operation. One of the data strings is selected, the minimum or maximum data in the data string is taken out, an identifier for identifying the data string to which the data belongs is added to the taken out data, and the data is sorted. Input processing means for inputting, a plurality of data with identifiers input from the input processing means, a sorting means for storing the minimum or maximum data from the stored data, adding an identifier and outputting An identifier is cut out from the data with an identifier outputted from the sorting means, and the cut out identifier or its related information is It is characterized in that an output processing means for providing to said input processing means to determine a data sequence to be selected. An embodiment of the present invention will be described in detail below.

第1図は本発明の一実施例にかかるソート処理装置の構
成図である。同図において、7はソート回路、8は制御
回路、9は入力レジスタ、10は出力レジスタ、11はバン
クアドレス発生回路、12はソート入出力切り換え回路、
13は読み出しアドレス発生回路、14は書き込みアドレス
発生回路、15はバッファメモリ、16はアドレス切り換え
回路、17はデータ切り替え回路、18は切り替え制御線
(ST)、19はバンクアドレス線(BA)、20はI相信号線
(I)、21はII相信号線(II)、22は状線制御線(IN
T)、23は入力制御線(PUSH)、24は出力制御線(PO
P)、25は入出力制御線(PUP)、26はデータ入出力線
(DIO)である。
FIG. 1 is a block diagram of a sort processing apparatus according to an embodiment of the present invention. In the figure, 7 is a sort circuit, 8 is a control circuit, 9 is an input register, 10 is an output register, 11 is a bank address generation circuit, 12 is a sort input / output switching circuit,
13 is a read address generation circuit, 14 is a write address generation circuit, 15 is a buffer memory, 16 is an address switching circuit, 17 is a data switching circuit, 18 is a switching control line (ST), 19 is a bank address line (BA), 20 Is the I-phase signal line (I), 21 is the II-phase signal line (II), 22 is the line control line (IN
T), 23 is an input control line (PUSH), 24 is an output control line (POSH)
P), 25 are input / output control lines (PUP), and 26 is a data input / output line (DIO).

以上の構成において、ソート回路7が最小値あるいは最
大値を抽出するためのソート手段を構成し、入力レジス
タ9とソート入出力切り替え回路12、読み出しアドレス
発生回路13とが入力処理手段を構成し、出力レジスタ10
とバンクアドレス発生回路11、書き込みアドレス発生回
路14とが出力処理手段を構成している。
In the above configuration, the sorting circuit 7 constitutes a sorting means for extracting the minimum value or the maximum value, and the input register 9, the sorting input / output switching circuit 12 and the read address generating circuit 13 constitute an input processing means, Output register 10
The bank address generating circuit 11 and the write address generating circuit 14 constitute an output processing means.

ソート回路7は、本実施例では、第2図に示したソート
回路と同一構成の回路が適用してある。本回路では、ユ
ニット数をL個とした場合にはL≧k/2(L,k:整数)
の関係にあるk個のデータのソート処理が行える。ただ
し本発明では、このソート回路を従来技術のように、k
回の入力操作を繰り返し、次にk回の出力操作を繰り返
すことによりk個の非整列データを昇順もしくは降順に
並べ替える手段として用いるのみならず、順次1個のデ
ータが更新されるk個のデータの組から、その組のうち
最小あるいは最大のデータを順次に抽出する手段として
用いる点が異なる。すなわち、第2図のソート回路で
は、第3図で説明したように、昇順あるいは降順にソー
ト処理を行う手順でk個のデータに対するk回の入力操
作を行った場合には、データを入力した入出力端子に最
も近いユニット内に最小もしくは最大のデータが保持さ
れている。このため、この後1回の出力操作を行うこと
により、この最小あるいは最大のデータを抽出できる。
このような1回の出力操作により格納されているデータ
のうちの最小もしくは最大のデータを抽出できる原理
は、すでに行った入力操作の回数、出力操作の回数、入
力操作と出力操作の組み合わせ方には依存せず、ソート
回路内にデータが存在する限り保証されている。したが
って、このソート回路を前記のような最小あるいは最大
のデータを抽出する手段として用いるには、k個のデー
タに対するk回の入力操作をあらかじめ行った後に、出
力操作と入力操作とを交互に繰り返すことにより行え
る。なお最小のデータあるいは最大のデータのいずれを
抽出するかは、ソート処理を行う向きが昇順であるか降
順であるかによって、あらかじめ設定しておく。
In this embodiment, as the sorting circuit 7, a circuit having the same configuration as the sorting circuit shown in FIG. 2 is applied. In this circuit, when the number of units is L, L ≧ k / 2 (L, k: integer)
The k pieces of data having the relationship of can be sorted. However, in the present invention, this sorting circuit is k
Not only is it used as a means for rearranging the k non-aligned data in ascending or descending order by repeating the input operation once, and then repeating the output operation k times. The difference is that it is used as a means for sequentially extracting the minimum or maximum data from a set of data. That is, in the sorting circuit of FIG. 2, as described in FIG. 3, when k times of input operation is performed on k pieces of data in the procedure of performing the sorting process in ascending order or descending order, the data is input. The minimum or maximum data is stored in the unit closest to the I / O terminal. Therefore, the minimum or maximum data can be extracted by performing one output operation thereafter.
The principle of extracting the minimum or maximum data of the stored data by one output operation is based on the number of input operations already performed, the number of output operations, and the combination of input operation and output operation. Is not dependent and is guaranteed as long as the data exists in the sort circuit. Therefore, in order to use this sort circuit as a means for extracting the minimum or maximum data as described above, after performing k input operations on k data in advance, output operations and input operations are alternately repeated. It can be done by It should be noted that whether to extract the minimum data or the maximum data is set in advance depending on whether the direction for performing the sorting process is ascending order or descending order.

次に、第1図に示した本発明実施例のソート処理方法の
動作を、第4図を参照して説明する。本ソート処理装置
のソート処理の過程は、初期ソート段階とマージ段階と
から成る。この切り替えは、切り替え制御線(ST)18に
よって行い、ST18が論理レベルで“1"の場合には初期ソ
ート段階であり、“0"の場合にはマージ段階である。
Next, the operation of the sorting method of the embodiment of the present invention shown in FIG. 1 will be described with reference to FIG. The sort process of this sort processing apparatus includes an initial sort stage and a merge stage. This switching is performed by the switching control line (ST) 18, and when ST18 is "1" in the logical level, it is the initial sort stage, and when it is "0", it is the merge stage.

はじめに、初期ソート段階(ST=“1")について説明す
る。初期ソート段階では、外部から与えられるソート対
象の非整列データをソート回路7で部分的にソートして
ストリングを形成し、バッファメモリ15に格納する処理
を行う。この際、非整列データは外部からデータ入出力
線(DIO)26を介して順次与えられる。このデータを入
力レジスタ9およびソート入出力切り換え回路12を介し
て、ソート回路7に順次入力する。ソート回路7では、
第3図に示したように、複数回の入力操作と複数回の出
力操作を繰り返すことにより、ソート済みデータ列すな
わちストリングを出力する。このストリングをソート入
出力切り替え回路12と出力レジスタ10を介して、バッフ
ァメモリ15に格納する。この時のバッファメモリ15の書
き込みアドレス(ADW)は、書き込みアドレス発生回路1
4によって生成する。
First, the initial sort stage (ST = “1”) will be described. In the initial sorting stage, the sorting circuit 7 partially sorts non-sorted data to be sorted from outside to form a string and stores the string in the buffer memory 15. At this time, the unaligned data is sequentially applied from the outside via the data input / output line (DIO) 26. This data is sequentially input to the sorting circuit 7 via the input register 9 and the sorting input / output switching circuit 12. In the sorting circuit 7,
As shown in FIG. 3, a sorted data string, that is, a string is output by repeating a plurality of input operations and a plurality of output operations. This string is stored in the buffer memory 15 via the sort input / output switching circuit 12 and the output register 10. At this time, the write address (ADW) of the buffer memory 15 is the write address generation circuit 1
Generated by 4.

以上のように、初期ソート段階では、第3図に示した従
来技術のソート処理に於ける操作と同様の操作を本ソー
ト処理装置で行うことにより、バッファメモリ15内に複
数個のストリングを得ることができる。第4図のバッフ
ァメモリ15内の三角形は、この初期ソート段階で得られ
た個々のストリングを示しており、この図ではk個のス
トリングを得られた場合を示している。
As described above, in the initial sort stage, the same sort of operation as in the sort process of the prior art shown in FIG. 3 is performed by this sort processing apparatus to obtain a plurality of strings in the buffer memory 15. be able to. The triangles in the buffer memory 15 of FIG. 4 show the individual strings obtained in this initial sorting stage, which is the case where k strings have been obtained.

次に、マージ段階(ST=“0")について説明する。マー
ジ段階では、次に説明する初期操作と通常操作とを行う
ことにより、バッファメモリ15に格納しているk個のス
トリングをソート回路7を用いてマージし、データ入出
力線(DIO)26からソート済みのデータとして出力する
処理を行う。はじめに初期操作では、バッファメモリ15
に与えられたk個のストリングのそれぞれから最小ある
いは最大のデータを取り出し、取り出されたk個のデー
タを入力レジスタ9を介して、k回の入力操作によって
ソート回路7に入力する。最小のデータを取り出すか最
大のデータを取り出すかは、昇順にソートするか降順に
ソートするかで決める。次の通常操作では、ソート回路
7に入力されたk個のデータから1回の出力操作によっ
て、最小あるいは最大のデータ1個をマージ結果として
出力する。この際出力データは、前記と同様に昇順なソ
ートするか降順にソートするかで、最小のデータを出力
するか最大のデータを出力するかを決め、ソート入出力
切り替え回路12および出力レジスタ10を介してデータ入
出力線(DIO)26からソート済みのデータとして外部に
出力する。次に、マージ結果として出力したデータが含
まれていたストリングから次の最小あるいは最大のデー
タを取り出しソート回路7へ入力し、ソート回路7内に
残っている(k−1)個のデータと合わせてk個のデー
タ間で2回目の最小あるいは最大のデータを取り出す操
作を行う。以上の操作を、順次マージ結果を出力しなが
らk個のストリングの全てのデータが無くなるまで繰り
返すことにより、マージン操作が完了する。
Next, the merge stage (ST = “0”) will be described. In the merging step, the k strings stored in the buffer memory 15 are merged by using the sort circuit 7 by performing the initial operation and the normal operation described below, and the data input / output line (DIO) 26 Performs processing to output as sorted data. Introduction In the initial operation, the buffer memory 15
The minimum or maximum data is extracted from each of the k strings given to, and the extracted k data is input to the sorting circuit 7 via the input register 9 by k times of input operation. Whether to extract the smallest data or the largest data is determined by sorting in ascending order or descending order. In the next normal operation, one minimum or maximum data is output as a merge result from the k pieces of data input to the sorting circuit 7 by one output operation. At this time, the output data is sorted in ascending order or descending order in the same manner as described above, and it is determined whether the minimum data or the maximum data is output, and the sort input / output switching circuit 12 and the output register 10 are set. The data is output to the outside from the data input / output line (DIO) 26 as sorted data. Next, the next minimum or maximum data is extracted from the string that contained the data output as the merge result and is input to the sorting circuit 7 and combined with the (k-1) data remaining in the sorting circuit 7. Then, the second minimum or maximum data is extracted from the k pieces of data. The margin operation is completed by repeating the above operation until all the data in the k strings are output while sequentially outputting the merge result.

以上の通常操作を繰り返し行うにあたっては、ソート回
路7へ入力するデータに、いずれのストリングから取り
出したデータであるかを識別するための識別子を前記の
入力処理手段によってあらかじめ付加しておき、ソート
回路7から出力された最小あるいは最大のデータの識別
子を前記の出力処理手段によって参照することにより、
次に入力すべきデータをいずれのストリングから取り出
せば良いかを決定することができる。この識別子は、少
なくともk個のストリングのいずれであるのかを判別す
ることができればよく、2進表現をした場合には、log2
kビットとなる。この2進表現した識別子をバンクアド
レスと称する。
When the above normal operation is repeatedly performed, an identifier for identifying from which string the data is extracted is previously added to the data input to the sorting circuit 7 by the input processing means, and the sorting circuit By referring to the identifier of the minimum or maximum data output from 7 by the output processing means,
It can be determined from which string the data to be entered next should be retrieved. This identifier only needs to be able to discriminate which one of at least k strings, and when it is expressed in binary, log 2
It becomes k bits. This binary representation of the identifier is called a bank address.

次に、バンクアドレスの付与方法について説明する。初
期操作では、バンクアドレスは初期値として0から(k
−1)までのk個のアドレスをバンクアドレス発生回路
11で生成し、入力レジスタ9によってソート対象データ
に付与し、入力操作によって、バンクアドレスが付与さ
れたk個のデータが、ソート入出力切り替え回路12を介
してソート回路7に入力される。出力時には、ソート回
路7からバンクアドレスが付与されたデータがソート入
出力切り替え回路12を介して出力レジスタ10に格納され
る。このデータからバンクアドレス(すなわち識別子)
を切り出して読み出しアドレス発生回路13に与えること
によって、この読み出しアドレス発生回路13で、バッフ
ァメモリ15内の次に読み出すべきデータのアドレスを決
定する。この時、出力レジスタ10に得られた識別子以外
のデータ(本来ソートしようとしているデータ)は、デ
ータ切り替え回路17を介して、データ入出力線(DIO)2
6から出力する。この時、出力されたデータは、昇順あ
るいは降順にソートされている。
Next, a method of assigning a bank address will be described. In the initial operation, the bank address is initialized from 0 to (k
-1) up to k addresses for bank address generation circuit
The data generated at 11 and added to the sort target data by the input register 9 and k data to which the bank address is added by the input operation are input to the sort circuit 7 via the sort input / output switching circuit 12. At the time of output, the data to which the bank address is assigned from the sort circuit 7 is stored in the output register 10 via the sort input / output switching circuit 12. Bank address (ie identifier) from this data
Is cut out and supplied to the read address generation circuit 13, so that the read address generation circuit 13 determines the address of the data to be read next in the buffer memory 15. At this time, the data other than the identifier obtained in the output register 10 (the data originally intended to be sorted) is transferred via the data switching circuit 17 to the data input / output line (DIO) 2
Output from 6. At this time, the output data is sorted in ascending order or descending order.

次に、マージ段階に於ける本ソート処理装置各部の動作
を詳細に説明する。本ソート処理装置は、I相、II相の
信号による同期回路で全体が構成されており、I相、II
相からなる1サイクルで1つのデータを並びかえる。第
1図の20,21がそれぞれI相、II相のクロック線であ
る。22は状態信号線であり、この状態信号線22によって
初期操作状態と通常操作状態とを設定する。状態信号線
22を論理レベルで“1"に設定すると初期操作状態とな
り、初期ソート段階とマージ段階の初期操作に於いて、
ソート回路7にデータを連続して格納する動作または昇
順あるいは降順に連続してデータを抽出する動作のいず
れかを行うことができる。状態信号線22が論理レベルで
“0"の時は、データの入力操作と出力操作を交互に行い
ながらマージする通常操作状態である。
Next, the operation of each part of this sort processing apparatus in the merge stage will be described in detail. This sort processing device is entirely composed of a synchronizing circuit based on I-phase and II-phase signals.
One data is rearranged in one cycle consisting of phases. Reference numerals 20 and 21 in FIG. 1 denote I-phase and II-phase clock lines, respectively. Reference numeral 22 is a state signal line, and the state signal line 22 sets an initial operation state and a normal operation state. Status signal line
When 22 is set to “1” at the logical level, it is in the initial operation state, and in the initial operation of the initial sort stage and the merge stage,
Either the operation of continuously storing data in the sorting circuit 7 or the operation of continuously extracting data in ascending or descending order can be performed. When the state signal line 22 is "0" at the logic level, it is a normal operation state in which data input operation and output operation are alternately performed and merged.

第5図は、ソート回路7に連続してデータを格納する初
期操作の動作を示すタイムチャートである。連続してデ
ータを格納する場合には、バンクアドレスは、直前のバ
ンクアドレスからインクリメント等の処理によって一意
に決定できるため、同図に示すように、バンクアドレス
の計算→読み出しアドレスの計算→データの読み出しの
手順に従ってソート回路7へのデータの格納を1サイク
ルの間に2回実行できる。これにより、kウェイのマー
ジソートを行うために初期操作で実施するk個のデータ
のソート回路7への格納は、k/2サイクルで完了す
る。
FIG. 5 is a time chart showing the operation of the initial operation of successively storing data in the sorting circuit 7. When data is stored consecutively, the bank address can be uniquely determined from the immediately preceding bank address by processing such as incrementing. Therefore, as shown in the figure, calculation of bank address → calculation of read address → data Data can be stored in the sorting circuit 7 twice in one cycle according to the reading procedure. As a result, the storage of the k pieces of data in the sorting circuit 7 performed in the initial operation for performing the k-way merge sort is completed in k / 2 cycles.

第6図は、ソート回路7にデータの入力処理と出力処理
を交互に行う通常操作のタイムチャートである。出力処
理によって、ソート回路7から抽出されたデータからバ
ンクアドレスを切り出し、次に入力するデータのバンク
アドレスとする。このバンクアドレスに基づいて読み出
しアドレスを決定し、バッファメモリ15からデータを読
み出してソート回路7に入力する。
FIG. 6 is a time chart of a normal operation in which the sorting circuit 7 alternately performs data input processing and data output processing. By the output processing, the bank address is cut out from the data extracted from the sorting circuit 7 and is set as the bank address of the next input data. A read address is determined based on this bank address, data is read from the buffer memory 15 and input to the sort circuit 7.

次に、本ソート処理装置各部の詳細な回路構成を示す。Next, a detailed circuit configuration of each section of the present sorting apparatus will be shown.

第7図は、第1図に示した制御回路8の詳細図である。
図中の、27はリセット信号線(RST)、28はORゲート、2
9はANDゲート、30はインバータ、31はアップダウンカウ
ンタ、32はフリップフロップ回路である。アップダウン
カウンタ31は、現在ソート回路7に格納されているデー
タの数を示し、ソート回路7に対する入力操作の回数お
よび出力操作の回数によってカウンタ値が増減する。そ
の結果として、現在ソート回路7に格納されているデー
タの数が0個であることもしくはk個であることを検出
して、フリップフロップ回路32をセットするかあるはリ
セットする。フリップフロップ回路32の出力であるPUP
信号25によってソート入出力切り替え回路12を制御し、
データの入出力方向を決定する。
FIG. 7 is a detailed diagram of the control circuit 8 shown in FIG.
In the figure, 27 is a reset signal line (RST), 28 is an OR gate, 2
9 is an AND gate, 30 is an inverter, 31 is an up / down counter, and 32 is a flip-flop circuit. The up / down counter 31 indicates the number of data currently stored in the sorting circuit 7, and the counter value increases or decreases depending on the number of input operations and the number of output operations to the sorting circuit 7. As a result, it is detected that the number of data currently stored in the sort circuit 7 is 0 or k, and the flip-flop circuit 32 is set or reset. PUP which is the output of the flip-flop circuit 32
The sort input / output switching circuit 12 is controlled by the signal 25,
Determine the data input / output direction.

第8図は第1図に示したソート入出力切り替え回路12の
詳細図である。図中の点線枠内は、1ビット分だけを示
しており、33はトライステートバッファゲートである。
PUP信号25が論理レベルで“1"の場合は入力操作時であ
り、入力レジスタ9のデータをソート回路7の入力とす
る。一方、PUP信号25が論理レベルで“0"の場合は出力
操作時であり、ソート回路7の出力データを出力レジス
タ10に格納する方向にデータの流れを切り替える。
FIG. 8 is a detailed diagram of the sort input / output switching circuit 12 shown in FIG. Only one bit is shown in the dotted frame in the figure, and 33 is a tri-state buffer gate.
When the PUP signal 25 has a logical level of "1", it is during an input operation, and the data of the input register 9 is used as the input of the sort circuit 7. On the other hand, when the logical level of the PUP signal 25 is "0", it is during the output operation, and the data flow is switched to the direction in which the output data of the sort circuit 7 is stored in the output register 10.

第9図は第1図に示したバンクアドレス発生回路11の詳
細図である。図中の34はカウンタであり、初期操作にお
いて連続的なバンクアドレスを発生する。出力レジスタ
10から切り出したバンクアドレスとカウンタ34で生成し
たアドレスとの切り替えは、状態信号線22によって行
う。
FIG. 9 is a detailed diagram of the bank address generating circuit 11 shown in FIG. Reference numeral 34 in the figure is a counter, which generates continuous bank addresses in the initial operation. Output register
Switching between the bank address cut out from 10 and the address generated by the counter 34 is performed by the status signal line 22.

第10図および第11図はそれぞれ第1図のアドレス切り替
え回路16およびデータ切り替え回路17の詳細図である。
これらの回路では、共に切替え制御線(ST)18によって
アドレスおよびデータそれぞれの切り替えを行う。
10 and 11 are detailed diagrams of the address switching circuit 16 and the data switching circuit 17 of FIG. 1, respectively.
In both of these circuits, the switching control line (ST) 18 switches between address and data.

第12図は第1図の読み出しアドレス発生回路13の詳細図
である。本回路は、2個のカウンタ35および36と多ビッ
トのシフト回路37、多ビットの加算回路38から構成され
ている。カウンタ35は、k個のストリングのそれぞれに
対して何番目のデータを次に取り出すかのアドレスを設
定するためのカウンタであり、このアドレスをバンク内
アドレスと称する。カウンタ36はデータの読み出しアド
レスの内でバンクアドレスより上位のビットのアドレス
を発生するためのカウンタである。多ビットのシフト回
路37は、カウンタ36の出力とバンクアドレス(BA)とを
任意の位置にシフトし、このシフト回路37の出力を、多
ビットの加算回路38によってバンク内アドレスと加えて
読み出しアドレス(図中のADR)とする。これにより、
2のべき乗の単位でストリングを構成するデータ数を可
変とすることができる。先に説明した処理ソート段階で
は、多ビットのシフト回路37によってバンクアドレスを
読み出しアドレスの最下位ビット側に移動することによ
って、初期バンクアドレスを用いて、連続するメモリ領
域をアクセスする。
FIG. 12 is a detailed diagram of the read address generation circuit 13 of FIG. This circuit is composed of two counters 35 and 36, a multi-bit shift circuit 37, and a multi-bit adder circuit 38. The counter 35 is a counter for setting an address of which number of data is to be extracted next for each of the k strings, and this address is called an in-bank address. The counter 36 is a counter for generating an address of a bit higher than the bank address in the data read address. The multi-bit shift circuit 37 shifts the output of the counter 36 and the bank address (BA) to an arbitrary position, and the output of this shift circuit 37 is added to the in-bank address by the multi-bit adder circuit 38 to obtain the read address. (ADR in the figure). This allows
The number of pieces of data forming a string can be made variable in units of powers of two. In the processing sort stage described above, the multi-bit shift circuit 37 moves the bank address to the least significant bit side of the read address to access the continuous memory area using the initial bank address.

第13図は、第1図の書き込みアドレス発生回路14の詳細
図である。この回路はカウンタ39で構成されており、初
期ソート段階では、POP信号と同期して得られるマージ
結果としてのデータを順次連続してバッファメモリ15に
格納するための書き込みアドレスを発生する。
FIG. 13 is a detailed diagram of the write address generation circuit 14 of FIG. This circuit is composed of a counter 39, and in the initial sort stage, a write address for storing the data as a merged result obtained in synchronization with the POP signal sequentially and continuously in the buffer memory 15 is generated.

以上説明した本実施例のソート処理装置はカウンタと切
替回路および簡単なANDゲート、ORゲートなどから構成
されているため,バイポーラトランジスタやMOSトラン
ジスタなど、従来既知の回路手段を用いて構成できる。
The sort processing device of the present embodiment described above is composed of a counter, a switching circuit, simple AND gates, OR gates, etc., so that it can be constructed using conventionally known circuit means such as bipolar transistors and MOS transistors.

以上説明した本発明の実施例では、同一ソート手段を用
いて、初期ソート段階とマージ段階とでデータ全体のソ
ート処理を行う構成を示したが、初期ソート段階を行う
ソート手段とマージ段階を行うソート手段の双方を具備
する構成とすること、あるいはマージ段階のみを行うよ
うに構成することも可能である。
In the embodiment of the present invention described above, the same sort means is used to perform the sorting process of the entire data in the initial sort stage and the merge stage. However, the sort unit and the merge stage that perform the initial sort stage are performed. It is also possible to adopt a configuration that includes both sort means, or to perform only the merge step.

また、本実施例では、1回のマージ操作によってk個の
ストリングを1個のストリングとする場合を示したが、
ソート対象となるデータを十分に格納できるだけの容量
のバッファメモリ15および前記メモリ装置を備えること
によって、本ソート処理装置を用いた複数回のマージ操
作の繰り返しで、K個以上のストリングであっても容易
にソート可能な構成にできる。さらに、本ソート処理装
置を複数台用いて多段接続することによって、1台のソ
ート処理装置で繰り返しマージ操作をするよりも短時間
でソート処理を行うことができる。この場合には、複数
の前段のソート処理装置で得られたマージ結果すなわち
バッファメモリに格納したストリングを直接次段のソー
ト処理装置の入力とするように接続した複数台のソート
処理装置で順次マージ操作を行うことにより、マージ操
作を並列に実行できるため、全体のソート処理時間を短
縮できる。
Further, in the present embodiment, a case has been shown in which k strings are converted into one string by one merge operation.
By providing the buffer memory 15 and the memory device having a capacity sufficient to store the data to be sorted, even if there are K or more strings by repeating the merge operation a plurality of times using this sort processing device. It can be configured to be easily sorted. Furthermore, by connecting a plurality of the present sort processing devices in multiple stages, the sort processing can be performed in a shorter time than the case where the merge operation is repeatedly performed by one sort processing device. In this case, the merge results obtained by a plurality of sort processing devices at the preceding stage, that is, the strings stored in the buffer memory are directly merged by a plurality of sort processing devices connected so as to be directly input to the sort processing device at the next stage. By performing the operation, the merge operation can be executed in parallel, so that the total sort processing time can be shortened.

また本実施例では、k個のデータのうちから最大値ある
いは最小値を短時間で抽出する手段として第2図に示し
た従来技術によるソート回路を適用した場合を示たが、
最大値あるいは最小値を抽出する手段としては、連想メ
モリなどを適用することも可能である。
In the present embodiment, the case where the sorting circuit according to the prior art shown in FIG. 2 is applied as a means for extracting the maximum value or the minimum value from k pieces of data in a short time is shown.
An associative memory or the like can be applied as a means for extracting the maximum value or the minimum value.

また本実施例では、バッファメモリ15として、ランダム
アクセス可能なメモリを使用した場合を示したが、これ
以外にもストリングを保持し、最小値あるいは最大値か
ら順次データを読み出しあるいは書き込みできるシーケ
ンシャルアクセス可能なデータの保持手段を適用するこ
ともできる。また、本実施例のソート処理装置を計算機
の付属装置として接続する場合には、バッファメモリ15
を計算機のメインメモリ等と併用する構成も可能であ
る。
Further, in the present embodiment, the case where a randomly accessible memory is used as the buffer memory 15 is shown, but in addition to this, a string is held, and sequential access capable of sequentially reading or writing data from the minimum value or the maximum value is possible. It is also possible to apply various data holding means. When the sort processing device of this embodiment is connected as an auxiliary device of a computer, the buffer memory 15
It is also possible to use the computer together with the main memory of the computer.

また本実施例では、ソート回路7に入力するデータへの
識別子を付与する操作は、バッファメモリ15からデータ
を抽出した後に行う構成を例示したが、バッファメモリ
15へストリングとして格納する際にあらかじめ付与して
おく構成も容易に実施できる。
Further, in the present embodiment, the operation of assigning the identifier to the data input to the sort circuit 7 is illustrated after the data is extracted from the buffer memory 15.
It is also possible to easily implement a configuration that is given in advance when storing it in 15 as a string.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明のソート処理方法では、昇
順もしくは降順にソート済みの複数のデータ列を格納す
るメモリ手段と、初期操作では前記複数のデータ列から
それぞれ最小もしくは最大のデータを取り出し、通常操
作では前記複数のデータ列のうちの1個のデータ列を選
択して該データ列中の最小もしくは最大のデータを取り
出し、該取り出したデータに、当該データの属するデー
タ列を識別する識別子を付加してソート手段へ入力する
入力処理手段と、前記入力処理手段から入力された複数
個の識別子付データを格納でき、該格納データのうちか
ら最小もしくは最大のデータを抽出し、識別子を付加し
て出力するソート手段と、前記ソート手段から出力され
た識別子付データから識別子を切り出すとともに、該切
り出した識別子あるいはその関連情報を、次に選択すべ
きデータ列を決定するために前記入力処理手段へ与える
出力処理手段とをもって構成したことにより、従来技術
ではできなかった極めて大きなマージウェイ数によるマ
ージ操作がデータ数に比例する時間で実施することがで
きる。これとともに、同一ソート手段を用いて従来のソ
ート方法による初期ソートを併用できるようにしたこと
により、ソート対象であるデータ数が大量の場合でも少
ないマージ操作回数でデータ全体をソートできるため、
大量のデータを短時間でソートできる利点を有してい
る。また、データそのものに識別子(バンクアドレス)
を付与して扱うために、1個のストリングを構成するデ
ータ数の制限をなくすことができ、従来のソート処理装
置では扱うことの出来なかった極めて大量のデータであ
ってもソートできる利点がある。
As described above, in the sorting method of the present invention, the memory means for storing a plurality of sorted data strings in ascending or descending order, and the initial operation to extract the minimum or maximum data from the plurality of data strings, respectively, In a normal operation, one data string of the plurality of data strings is selected, the minimum or maximum data in the data string is extracted, and the extracted data is assigned an identifier for identifying the data string to which the data belongs. Input processing means for adding and inputting to the sorting means, and a plurality of data with identifiers input from the input processing means can be stored, the minimum or maximum data is extracted from the stored data, and an identifier is added. And outputting the sorted identifier, the identifier is cut out from the identifier-added data output from the sorting means, and the cut-out identifier Alternatively, since the related information is composed of the output processing means to be given to the input processing means for determining the data string to be selected next, the merge operation with the extremely large number of merge ways, which cannot be done by the conventional technique, can be performed. It can be carried out in a time proportional to the number of data. At the same time, the same sort means can be used together with the initial sort by the conventional sort method, so that even if the number of data to be sorted is large, the entire data can be sorted with a small number of merge operations.
It has the advantage that a large amount of data can be sorted in a short time. Also, the data itself has an identifier (bank address)
In order to handle an extremely large amount of data that cannot be handled by a conventional sort processing device, it is possible to sort the number of data making up one string. .

【図面の簡単な説明】[Brief description of drawings]

第1図は本発明の一実施例であるソート処理装置の構成
図、第2図は汎用計算機の周辺装置として使用する従来
のソート処理回路の構成図、第3図は第2図に示したソ
ート処理回路の動作原理図、第4図は第1図に示したソ
ート処理装置の動作原理図、第5図および第6図は第1
図のソート処理装置の動作説明用のタイムチャート、第
7図は第1図の制御回路の詳細図、第8図は第1図のソ
ート入出力切り替え回路の詳細図、第9図は第1図のバ
ンクアドレス発生回路の詳細図、第10図は第1図のアド
レス切り替え回路の詳細図、第11図は第1図のデータ切
り替え回路の詳細図、第12図は第1図の読み出しアドレ
ス発生回路の詳細図、第13図は第1図の書き込みアドレ
ス発生回路の詳細図である。 7……ソート回路、8……制御回路、9……入力レジス
タ、10……出力レジスタ、11……バンクアドレス発生回
路、12……ソート入出力切り替え回路、13……読み出し
アドレス発生回路、14……書き込みアドレス発生回路、
15……バッファメモリ、16……アドレス切り替え回路、
17……データ切り替え回路、
FIG. 1 is a block diagram of a sort processing device according to an embodiment of the present invention, FIG. 2 is a block diagram of a conventional sort processing circuit used as a peripheral device of a general-purpose computer, and FIG. 3 is shown in FIG. FIG. 4 is an operation principle diagram of the sort processing circuit, FIG. 4 is an operation principle diagram of the sort processing device shown in FIG. 1, and FIGS.
FIG. 7 is a detailed diagram of the control circuit of FIG. 1, FIG. 8 is a detailed diagram of the sort input / output switching circuit of FIG. 1, and FIG. FIG. 10 is a detailed diagram of the bank address generating circuit, FIG. 10 is a detailed diagram of the address switching circuit of FIG. 1, FIG. 11 is a detailed diagram of the data switching circuit of FIG. 1, and FIG. 12 is a read address of FIG. FIG. 13 is a detailed diagram of the generating circuit, and FIG. 13 is a detailed diagram of the write address generating circuit in FIG. 7 ... Sort circuit, 8 ... Control circuit, 9 ... Input register, 10 ... Output register, 11 ... Bank address generation circuit, 12 ... Sort input / output switching circuit, 13 ... Read address generation circuit, 14 ...... Write address generation circuit,
15 …… buffer memory, 16 …… address switching circuit,
17 ... Data switching circuit,

───────────────────────────────────────────────────── フロントページの続き (72)発明者 川田 忠通 東京都武蔵野市緑町3丁目9番11号 日本 電信電話公社武蔵野電気通信研究所内 (56)参考文献 特開 昭58−87630(JP,A) 実開 昭59−58852(JP,U) ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Tadamichi Kawada 3-9-11 Midoricho, Musashino-shi, Tokyo Inside Nippon Telegraph and Telephone Public Corporation Musashino Electro-Communications Research Laboratory (56) Reference JP-A-58-87630 (JP, A) Actual Development Sho 59-58852 (JP, U)

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】入力として与えられる昇順もしくは降順に
あらかじめソートされたk個(k>1)のデータ列から
最小あるいは最大のデータを取り出し、該取り出したデ
ータに当該データの属するデータ列を識別するデータ列
識別子を付加した識別子付データを後述するソート手段
に入力する入力手段と、 入力した前記識別子付データを記憶する2個の記憶回路
と、該記憶回路に格納している2個の識別子付データの
大小関係を判定する比較器と、該比較器の判定結果にも
とづいて前記2個の記憶回路のうち一方を選択し、該選
択された記憶回路に格納されている識別子付データを転
送するためのデータ入出力回路とを少なくとも有するユ
ニットL個(L≧k/2:整数)を1次元接続した構成か
らなり、該1次元接続したユニットの一端から順次行う
データの入力操作および出力操作に同期して、該ユニッ
トのそれぞれで並列に前記比較器による比較と前記デー
タ入出力回路による隣接ユニットへの転送を行うことに
より、前記k個の格納された前記識別子付データのうち
から1回の出力操作で最小もしくは最大のデータを選択
して出力するソート手段と、 該ソート手段から出力される識別子付きデータを識別子
とデータ部に分離し、該分離した識別子を前記入力手段
への出力とし、該分離したデータ部を出力する出力処理
手段と、 を具備するソート処理装置において、 初期操作では、前記入力手段を用いて、前記k個のデー
タ列からそれぞれ1個ずつ最大あるいは最小のデータを
取り出し、識別子を付与した識別子付データを前記ソー
ト手段に入力し、 通常操作では、前記ソート手段を用いて、最小あるいは
最大の識別子付データを選択して出力し、 前記出力手段によって、該出力された識別子付データか
ら識別子を切り出すとともに前記入力手段を用いて、該
切り出した識別子が指示するデータ列から次に前記ソー
ト手段に入力するデータを取り出すことを繰り返すこと
を特徴とするソート処理方法。
1. A minimum or maximum data is extracted from k (k> 1) data strings pre-sorted in ascending or descending order given as input, and the data string to which the data belongs is identified from the extracted data. Input means for inputting data with an identifier to which a data string identifier is added to a sort means described later, two storage circuits for storing the input data with the identifier, and two identifiers stored in the storage circuit. A comparator that determines the magnitude relation of data and one of the two storage circuits is selected based on the determination result of the comparator, and the data with an identifier stored in the selected storage circuit is transferred. Data input / output circuit for at least L units (L ≧ k / 2: integer) are connected in a one-dimensional manner, and the units are connected in order from one end of the one-dimensionally connected unit. In synchronization with the input operation and the output operation of the data to be performed, the comparison by the comparator and the transfer to the adjacent unit by the data input / output circuit are performed in parallel in each of the units, so that the k stored data are stored. Sorting means for selecting and outputting the minimum or maximum data from the data with an identifier in one output operation, and the data with an identifier output from the sorting means is separated into an identifier and a data part, and the separated identifier And an output processing means for outputting the separated data part as an output to the input means, and in an initial operation, the input means is used to output 1 from each of the k data strings. The maximum or minimum data is extracted one by one, and the data with an identifier provided with an identifier is input to the sorting means. The minimum or maximum identifier-added data is selected and output using a step, and the output unit cuts out the identifier from the output identifier-added data, and the input unit indicates the cut-out identifier. A sorting method, characterized in that the process of extracting the data to be inputted to the sorting means next from the data string is repeated.
JP59163519A 1984-08-03 1984-08-03 Sort processing method Expired - Fee Related JPH0666050B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59163519A JPH0666050B2 (en) 1984-08-03 1984-08-03 Sort processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59163519A JPH0666050B2 (en) 1984-08-03 1984-08-03 Sort processing method

Publications (2)

Publication Number Publication Date
JPS6142031A JPS6142031A (en) 1986-02-28
JPH0666050B2 true JPH0666050B2 (en) 1994-08-24

Family

ID=15775407

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59163519A Expired - Fee Related JPH0666050B2 (en) 1984-08-03 1984-08-03 Sort processing method

Country Status (1)

Country Link
JP (1) JPH0666050B2 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4962451A (en) * 1985-11-07 1990-10-09 International Business Machines Corporation Cache-effective sort string generation method
JPS6318434A (en) * 1986-07-10 1988-01-26 Nec Corp Data processor
JPS6426223A (en) * 1987-07-22 1989-01-27 Canon Kk Sequential array circuit
US5226135A (en) * 1987-09-25 1993-07-06 Hitachi, Ltd. Method for sorting vector data on the basis of partial vectors and vector processor
JPH07120264B2 (en) * 1987-12-28 1995-12-20 日本電信電話株式会社 Sort processing device
JPH01177122A (en) * 1988-01-07 1989-07-13 Hitachi Ltd Sort processor
JPH0312736A (en) * 1989-06-12 1991-01-21 Hitachi Ltd Method and device for processing merge
JPH0776906B2 (en) * 1989-06-30 1995-08-16 ディジタル イクイプメント コーポレーション Speed and memory control for classification accelerators
US5142687A (en) * 1989-06-30 1992-08-25 Digital Equipment Corporation Sort accelerator with rebound sorter repeatedly merging sorted strings
US5206947A (en) * 1989-06-30 1993-04-27 Digital Equipment Corporation Stable sorting for a sort accelerator

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5958852U (en) * 1982-10-12 1984-04-17 株式会社明電舎 data processing equipment

Also Published As

Publication number Publication date
JPS6142031A (en) 1986-02-28

Similar Documents

Publication Publication Date Title
US4053871A (en) Method and system for the iterative and simultaneous comparison of data with a group of reference data items
US5293616A (en) Method and apparatus for representing and interrogating an index in a digital memory
JP2007508653A (en) High-speed table lookup memory and low power consumption mechanism
GB1563620A (en) Multistage sorter with concurrent access to interstage buffer memories
JPH0666050B2 (en) Sort processing method
JPH0776910B2 (en) Classification accelerator using rebound classifier as merger
JPS60105039A (en) Collation system of character string
US8626688B2 (en) Pattern matching device and method using non-deterministic finite automaton
JPH0776908B2 (en) Classification Stable classification of accelerator
JP3027754B2 (en) Associative memory
JPH0315221B2 (en)
JPH04348472A (en) Numeric retrieving device and its method
JP2587447B2 (en) Sorting device
JPH07101382B2 (en) Margin processing device
JP2926803B2 (en) Sorting method
JPH07302187A (en) Data sorting method and sorter
JPH07120264B2 (en) Sort processing device
JPS5827240A (en) File storing system
JP3447180B2 (en) Data operation circuit
JPH0748309B2 (en) Symbol string matching memory and its cascade connection method
JPH0797310B2 (en) Sort processing device
JPS6144338B2 (en)
JPH02193279A (en) Sorting device
JPS63253431A (en) Retrieving system for data base of inverted structure
JPH10275105A (en) Data compressing method, data restoring method, processor and method for sorting and merging, and medium where programs of those methods are recorded

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees