Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0797310B2 - Sort processing device - Google Patents
[go: Go Back, main page]

JPH0797310B2 - Sort processing device - Google Patents

Sort processing device

Info

Publication number
JPH0797310B2
JPH0797310B2 JP6543087A JP6543087A JPH0797310B2 JP H0797310 B2 JPH0797310 B2 JP H0797310B2 JP 6543087 A JP6543087 A JP 6543087A JP 6543087 A JP6543087 A JP 6543087A JP H0797310 B2 JPH0797310 B2 JP H0797310B2
Authority
JP
Japan
Prior art keywords
comparison
unit
units
transfer
data
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
JP6543087A
Other languages
Japanese (ja)
Other versions
JPS63231526A (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.)
NTT Inc
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 JP6543087A priority Critical patent/JPH0797310B2/en
Publication of JPS63231526A publication Critical patent/JPS63231526A/en
Publication of JPH0797310B2 publication Critical patent/JPH0797310B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、文字列や数値データを対象としたソート処理
装置に係り、特に比較転送ユニットの1次元アレイ構造
からなるソート処理装置の改良に関する。
The present invention relates to a sort processing device for character strings and numerical data, and more particularly to an improvement of a sort processing device having a one-dimensional array structure of a comparison transfer unit. .

〔従来の技術〕[Conventional technology]

ソート処理は、与えられたデータの集まりを所定の規則
に基づいて並び替える処理をいう。電子計算機における
ソート処理とは、数値あるいは文字列として与えられた
データが、計算機内部では“0"あるいは“1"の二値符号
で表記されている事から、二値符号の持つ数値的意味に
もとづいて、昇順(小さいものから大きいものへの順)
あるい降順(大きいものから小さいものへの順)にデー
タを並びかえることである。
The sort process is a process of rearranging a given set of data according to a predetermined rule. 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 Based on the ascending order (smallest to largest)
It is to rearrange the data in descending order (from largest to smallest).

一般に、ソート対象とするデータをレコードと称し、レ
コードはデータ相互の比較を行って大小関係を判定する
キー部と比較を行わない部分とに分けることができる。
このレコードを、文字列や正整数(符号なし整数)に限
定した場合には、二進符号を表されたレコードのキー部
を上位桁ほど優位性を持たせて比較することによって、
ソート処理を行うレコード相互の大小関係を決定でき
る。
In general, the data to be sorted is called a record, and the record can be divided into a key part that compares data with each other to determine a magnitude relation and a part that does not compare.
When this record is limited to a character string or a positive integer (unsigned integer), by comparing the key part of the record represented by the binary code with the superiority in the higher digits,
It is possible to determine the size relationship between the records to be sorted.

従来、このようなソート処理を高速に実行する専用のソ
ート処理装置として、本出願人は、データ相互の比較に
よる大小関係の判定とデータの転送を並列に行う構成の
ものを提案した(特開昭60-81640号公報参照)。第4図
はかかるソート処理装置の構成図である。本装置は、比
較の対象となるデータを保持するための第1のメモリ10
1および第2のメモリ102、比較器103、該比較器103によ
って得られた判定結果を保持するためのフラグレジスタ
104および転送回路105からなる比較転送ユニット100を
複数個、一次元接続した構成となっている。各ユニット
装置100では、第1、第2のメモリ100、102及び比較器1
03、転送回路105をiビット幅で構成され、第1、第2
のメモリの容量をi×jビットすることにより、i×k
(k≦j)ビットの長さを持つレコードを、Nレコード
(N≦2×ユニット数)までソート出来る。このソート
処理に要する時間は、以下に説明する動作原理にしたが
って、レコードの入出力時間(2×kNステップ)に等し
い。
Conventionally, the present applicant has proposed, as a dedicated sort processing device for performing such sort processing at high speed, a configuration in which determination of a magnitude relation by comparison of data with each other and data transfer are performed in parallel (Japanese Patent Application Laid-Open No. 2000-242242). (See Sho 60-81640). FIG. 4 is a block diagram of such a sort processing device. The device includes a first memory 10 for holding data to be compared.
1st and 2nd memory 102, comparator 103, flag register for holding the judgment result obtained by the comparator 103
A plurality of comparison transfer units 100 each composed of 104 and a transfer circuit 105 are one-dimensionally connected. In each unit device 100, the first and second memories 100 and 102 and the comparator 1
03, the transfer circuit 105 is configured with an i-bit width, and the first and second
Of the memory capacity of i × j bits, i × k
Records having a length of (k ≦ j) bits can be sorted into N records (N ≦ 2 × number of units). The time required for this sort processing is equal to the record input / output time (2 × kN steps) according to the operation principle described below.

第5図は、第4図のソート処理装置の動作原理図であ
り、1例として0から9までの一桁の数値データのう
ち、3,6,5,2,4,1の6個のレコードを降順にソートする
場合の動作を示している。即ち、この例は、一桁の数値
をiビットとして、1レコード=iビット,k=1,N=6
である。
FIG. 5 is an operation principle diagram of the sort processing apparatus of FIG. 4, and as an example, out of the one-digit numerical data from 0 to 9, 6 of 3,6,5,2,4,1 The operation when sorting records in descending order is shown. That is, in this example, one record is i bits, 1 record = i bits, k = 1, N = 6
Is.

ソート処理を行うにあたって、全てのユニット100の第
1のメモリ101および第2のメモリ102の内容を初期設定
する。降順ソートの場合には、初期値としてデータの最
小値である0を設定する。ソート処理は、順次レコード
を入力する入力操作と、順次レコードを出力する出力操
作とからなる。各ユニット100では、一回の入力操作で
データ(iビット)の右方向への転送と2個のデータ間
での比較とを同期して行う。この場合、転送されるデー
タは第1および第2のメモリ101,102に保持された2個
のデータのうち小さい方である。この時、データの転送
と同期して1個のレコードを該ソート処理装置に入力
し、最左端のユニットの第1のメモリ101あるいは第2
のメモリ102のいずれのうち転送によって空になった方
のメモリに保持する(T1〜T7)。
When performing the sorting process, the contents of the first memory 101 and the second memory 102 of all units 100 are initialized. In the case of descending sort, 0 which is the minimum value of data is set as an initial value. The sorting process consists of an input operation for inputting sequential records and an output operation for outputting sequential records. In each unit 100, the transfer of data (i-bit) to the right and the comparison between two data are performed in synchronization with one input operation. In this case, the transferred data is the smaller one of the two data held in the first and second memories 101 and 102. At this time, one record is input to the sort processing device in synchronization with the data transfer, and the first memory 101 or the second memory of the leftmost unit is input.
It is held in one of the memories 102, which becomes empty by the transfer (T1 to T7).

ソート対象とする6個のレコードの入力が完了した時点
で、出力操作によって順次データを隣接する左側のユニ
ットに転送する。この時、転送するデータはユニット内
の2個のデータのうち大きい方であり、最左端のユニッ
トからソート済みのレコード列が降順に出力される。最
右端のユニットには初期値と同じ0を入力する(T7〜T1
2)。
When the input of the six records to be sorted is completed, the output operation sequentially transfers the data to the adjacent left unit. At this time, the data to be transferred is the larger of the two data in the unit, and the sorted record string is output from the leftmost unit in descending order. Enter 0, which is the same as the initial value, in the rightmost unit (T7 to T1
2).

本ソート処理装置を用いて降順にソートする場合には、
初期設定として、全ユニット100の第1および第1のメ
モリ101及び第2のメモリ102に、データの最大値9を設
定しておき、入力操作時には、各ユニットで比較した2
個のデータのうち、大きい方を右方向に転送し、出力操
作時には、各ユニットで比較した2個のデータのうち小
さい方を左方向に転送する。
When sorting in descending order using this sort processing device,
As an initial setting, the maximum value 9 of the data is set in the first and first memories 101 and the second memory 102 of all units 100, and when the input operation is performed, the comparison is performed in each unit.
Of the two pieces of data, the larger one is transferred to the right, and during the output operation, the smaller one of the two pieces of data compared in each unit is transferred to the left.

次に、第4図のソート処理装置において、1レコードの
長さが一度に比較転送できるiビットを越える場合(1
<k≦j)の動作例を第6図に示す。第6図は、アルフ
ァベット1文字をiビットで表現するとして、それぞれ
2文字の長さ(k=2)からなる4個のレコード(N=
4)ab,de,ca,bdを2個のユニット(ユニット0,ユニッ
ト1)を使用して降順にソートする場合を示している。
第6図において、m1とm2は、それぞれ各ユニットの2個
のメモリ101,102、fはフラグレジスタ104である。個々
のレコードを1ビット単位のk個のデータに分割して大
小比較し、それまでの比較が等しくて、初めて大小関係
が決まった時にその値を比較結果としてフラグレジスタ
に設定する。第6図では、メモリm1の値とメモリm2の値
を比較して、メモリm2の値が小さい時に、比較結果は1
としてフラグレジスタfに設定される。
Next, in the sorting apparatus of FIG. 4, when the length of one record exceeds i bits that can be compared and transferred at one time (1
FIG. 6 shows an operation example of <k ≦ j). In FIG. 6, assuming that one character of the alphabet is represented by i bits, four records (N = 2) each having a length of two characters (k = 2) are shown.
4) Shows a case where ab, de, ca, bd are sorted in descending order using two units (unit 0, unit 1).
In FIG. 6, m1 and m2 are two memories 101 and 102 of each unit, and f is a flag register 104. Each record is divided into k pieces of data in 1-bit units, and the magnitude comparison is performed. When the comparison up to that time is equal and the magnitude relation is determined for the first time, the value is set in the flag register as the comparison result. In FIG. 6, the value of the memory m1 is compared with the value of the memory m2, and when the value of the memory m2 is small, the comparison result is 1
Is set in the flag register f.

第6図(A)は入力操作時の動作であり、ユニット0で
は、フラグレジスタf=0であればメモリm1の内容を、
f=1であればメモリm2の内容を、右方向に隣接するユ
ニット1に向けて出力する。一方、第6図(B)は出力
操作時の動作であり、ユニット1では、フラグレジスタ
f=1であればメモリm1の内容を、f=0であればメモ
リm2の内容を左方向に隣接するユニット0に向けて出力
し、同様に、ユニット0では外部に出力する。なお、こ
のような1レコードの長さがiビットを越える場合の動
作は、先の特開昭60-81640号公報に詳述されている。
FIG. 6A shows the operation at the time of input operation. In the unit 0, if the flag register f = 0, the contents of the memory m1 are
If f = 1, the contents of the memory m2 are output to the unit 1 adjacent to the right. On the other hand, FIG. 6B shows the operation at the time of the output operation. In the unit 1, if the flag register f = 1, the contents of the memory m1 are adjacent to each other in the left direction, and if f = 0, the contents of the memory m2 are adjacent to each other in the left direction. To the unit 0, and similarly, the unit 0 outputs to the outside. The operation when the length of one record exceeds i bits is described in detail in Japanese Patent Laid-Open No. 60-81640.

第6図に示したように、メモリ容量がi×jの比較転送
ユニットを2個で構成されたソート処理装置では、j=
2の場合、1文字をiビットして、長さ2文字(k=
2)の4個(N=4)のレコードを、16ステップ(=2
×k×N)でソートできる。なお、上記の手順の中で,
比較器による比較動作はレコードの転送と同期して行
え、比較結果をフラグレジスタに移動する操作は、レコ
ードの転送と比較動作に比べて十分短い時間で処理する
ことが出来る為、ステップ数の算出では無視できるとし
てある。第6図で、カッコで示した部分がこれを意味し
ている。
As shown in FIG. 6, in the sort processing device having two comparison transfer units each having a memory capacity of i × j, j =
In the case of 2, 1 character is i-bit to have a length of 2 characters (k =
2) 4 records (N = 4), 16 steps (= 2
× k × N) can be sorted. In the above procedure,
The comparison operation by the comparator can be performed in synchronization with the transfer of records, and the operation of moving the comparison result to the flag register can be processed in a time sufficiently shorter than the transfer of records and the comparison operation. Then it can be ignored. In FIG. 6, the part in parentheses means this.

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

上記従来技術のソート処理装置によれば、レコード数に
等しい入出力操作回数と出力操作回数でソート処理が行
える。また、1レコードの長さが一度に比較転送できる
iビットを越える場合には、個々のレコードをiビット
単位のk個のデータに分割し、k回の入力/出力操作に
よって、1レコードの処理を行うことができる。従っ
て、i×k(k≦j)ビットまでの長さのレコードをレ
コード数に比例する時間でソートできる。
According to the above-described sort processing device of the prior art, sort processing can be performed with the same number of input / output operations and output operations as the number of records. When the length of one record exceeds i bits that can be compared and transferred at one time, each record is divided into k pieces of data in i bit units, and one record is processed by k input / output operations. It can be performed. Therefore, records having a length up to i × k (k ≦ j) bits can be sorted in a time proportional to the number of records.

一方、ソート可能なレコード長は、比較転送ユニット内
のメモリ容量によって決定されることから、ソート対象
とするレコードを長くするためには、比較転送ユニット
内のメモリ容量を予め大きく設けておかなればならな
い。比較転送ユニット内のメモリ容量を大きくした場合
には、レコード長が短いソート処理時のメモリ使用効率
が低下することから、レコード長に関係なく比較転送ユ
ニットのメモリを有効に活用することは困難であった。
On the other hand, since the sortable record length is determined by the memory capacity in the comparison transfer unit, in order to lengthen the records to be sorted, a large memory capacity in the comparison transfer unit must be set in advance. I won't. If the memory capacity in the comparison transfer unit is increased, it is difficult to effectively use the memory of the comparison transfer unit regardless of the record length, because the memory usage efficiency at the time of sort processing with a short record length decreases. there were.

本発明の目的は、比較転送ユニット内のメモリ容量に制
限されることなく、レコード長の長いレコードを高速に
ソートできるソート処理装置を実現することにある。
An object of the present invention is to realize a sort processing device that can sort records having a long record length at high speed without being limited by the memory capacity in the comparison transfer unit.

〔課題を解決するための手段及び作用〕[Means and Actions for Solving the Problems]

本発明は、比較転送ユニットの1次元アレイ構造からな
るソート処理装置に於て、ソート対象とするレコードの
長さに応じて、該レコードを複数の比較転送ユニットに
分割した格納し、該レコードを分割して格納した各比較
転送ユニットをあたかも一つの比較転送ユニットと見做
して、その比較・転送処理を連動させて行うことを特徴
とする。
According to the present invention, in a sorting apparatus having a one-dimensional array structure of comparison transfer units, the records are divided into a plurality of comparison transfer units and stored according to the length of a record to be sorted, and the records are stored. It is characterized in that each comparison and transfer unit that is divided and stored is regarded as one comparison and transfer unit, and the comparison and transfer processing is performed in conjunction with each other.

本発明に基づくソート処理装置では、複数の比較転送ユ
ニットを連動して動作させることから、比較転送ユニッ
ト単体では扱うことが出来ない程長いレコードであって
も、該レコードを複数の比較転送ユニットに分割して格
納することによってソートすることが出来る。更に、複
数の比較転送ユニットを比較器の幅が広がる方向に連動
させることによって、一度に比較・転送するデータの幅
を拡張することも可能であり、ソート処理装置のスルー
プットの向上、及び、ソート処理装置の使用環境に合わ
せて一度に入力/出力するデータの処理幅を適合させる
ことが出来る。
In the sorting apparatus according to the present invention, since a plurality of comparison transfer units are operated in conjunction with each other, even if the record is too long to be handled by the comparison transfer unit alone, the record is stored in the plurality of comparison transfer units. Sorting can be done by dividing and storing. Further, the width of the data to be compared / transferred at a time can be expanded by linking a plurality of comparison / transfer units in the direction in which the width of the comparator expands, thereby improving the throughput of the sort processing device and sorting. The processing width of data input / output at one time can be adapted according to the usage environment of the processing device.

〔実施例〕〔Example〕

以下、本発明の一実施例について図面により説明する。 An embodiment of the present invention will be described below with reference to the drawings.

第1図は本発明のソート処理装置の一実施例の構成図
で、(1)はソート処理装置全体の構成図、(2)は一
つのユニット群の構成図である。図中、11は第4図で示
した一つの比較転送ユニット100と同一構成であり、本
実施例では、4個の比較転送ユニットで一つのユニット
群を構成している。各ユニット群内の4個のユニット
は、U0からU3の識別名を有する。更に、G0からG3の識別
名を有する4個のユニット群でソート処理装置全体10を
構成する。従って、本実施例のソート処理装置は、G0-U
0からG3-U3までの16個の比較転送ユニット11で構成され
る。ユニット群内の12は、双方向データ転送を行うバス
の転送経路を切替えるための転送切替回路である。ソー
ト対象となるレコードの入出力は、データ入出力端子PA
とPBを介して行い、PA及びPBは、それぞれ一つの比較転
送ユニット11のデータ処理幅と等しいiビット幅のLと
Hからなる。
FIG. 1 is a configuration diagram of an embodiment of a sort processing device according to the present invention, (1) is a configuration diagram of the entire sort processing device, and (2) is a configuration diagram of one unit group. In the figure, 11 has the same structure as one comparison transfer unit 100 shown in FIG. 4, and in this embodiment, four comparison transfer units constitute one unit group. The four units in each unit group have identifiers U0 to U3. Further, the entire sort processing apparatus 10 is composed of four unit groups having the identification names G0 to G3. Therefore, the sorting apparatus of this embodiment is G0-U
It consists of 16 comparison and transfer units 11 from 0 to G3-U3. Reference numeral 12 in the unit group is a transfer switching circuit for switching a transfer path of a bus for bidirectional data transfer. Input / output of records to be sorted is done by data input / output terminal PA.
PA and PB are composed of L and H each having an i-bit width equal to the data processing width of one comparison transfer unit 11.

比較転送ユニット11は、第4図に示したように、第1、
第2のメモリ101、102及び比較器103、入出力回路105を
iビット幅で構成し、第1、第2のメモリ101,102の容
量をそれぞれi×jビットとする。この時、ソート対象
とする各レコードをiビット幅のデータにk分割して、
1レコード当りk(k≦j)回の比較と転送処理を繰返
すことによって、第4図に示した比較転送ユニットの固
定的な一次元配列によって、1レコードが最大i×jビ
ットの長さを持つ複数のレコードをレコードの入出力時
間でソート出来る(第6図)。本発明では、この比較転
送ユニット11を複数個、連結及び/又は結合して連動さ
せることで、ソートできるレコード長の上限の拡大、お
よび/又は、ソート処理速度すなわちソートに要するス
テップ数の結減を実現するものである。
As shown in FIG. 4, the comparison and transfer unit 11 includes the first,
The second memories 101 and 102, the comparator 103, and the input / output circuit 105 are configured with an i-bit width, and the capacities of the first and second memories 101 and 102 are i × j bits. At this time, each record to be sorted is divided into k data of i-bit width,
By repeating the comparison and transfer processes k times (k ≦ j) per record, one record has a maximum length of i × j bits by the fixed one-dimensional array of the comparison transfer unit shown in FIG. You can sort the multiple records you have by the input / output time of the records (Fig. 6). In the present invention, by connecting and / or combining a plurality of the comparison transfer units 11, the upper limit of the record length that can be sorted is expanded and / or the sorting processing speed, that is, the number of steps required for sorting is reduced. Is realized.

第1図の実施例は、上記の機能を有する比較転送ユニッ
ト11を比較器の幅を拡張する方向に最大2ユニット連動
でき、また、メモリの深さを拡張する方向に最大4ユニ
ット連動できる構成を示したものである。以下では、比
較転送ユニットの比較器の幅を拡張する方向に複数ユニ
ットを連動せしめることを結合と称し、比較転送ユニッ
トのメモリの容量を拡張する方向に複数ユニットを連動
することを連結と称する。
In the embodiment shown in FIG. 1, the comparison transfer unit 11 having the above-mentioned function can be interlocked with a maximum of two units in the direction of expanding the width of the comparator, and can be interlocked with a maximum of four units in the direction of expanding the depth of the memory. Is shown. Hereinafter, interlocking a plurality of units in the direction of expanding the width of the comparator of the comparison transfer unit is referred to as coupling, and interlocking a plurality of units in the direction of expanding the memory capacity of the comparison transfer unit is referred to as coupling.

第2図は第1図に示した本ソート処理装置におけるデー
タ転送経路を示したものである。
FIG. 2 shows a data transfer path in the present sorting apparatus shown in FIG.

第2図(1)は、比較転送ユニットの連結を行った場合
のデータ転送経路である。この時、形成されるデータ経
路は、図中の太実線で示すように、16個の比較転送ユニ
ット11を1次元アレイ上に縦続接続した次の1種類であ
る。
FIG. 2A shows a data transfer path when the comparison transfer units are connected. At this time, the data path to be formed is the following one type in which 16 comparison transfer units 11 are cascade-connected on the one-dimensional array as shown by the bold solid line in the figure.

PA:L→G0:U0→G0:U1……G3:U3→PB:L 連結の場合、1回の比較・転送処理は従来と同じくiビ
ット単位である。ただし、連結対象の複数の比較転送ユ
ニットごとに(実施例では最大4ユニット)、各々をあ
たかも一つのユニットのごとく連動して動作せしめるこ
とにより、単一の比較転送ユニットでは扱うことができ
ない長いレコードであっても、連動して動作する複数の
縦続接続の各ユニットに分割して格納でき(即ち、比較
転送ユニットのメモリ容量が拡張)、ソート対象のレコ
ード長を拡大できる。
PA: L → G0: U0 → G0: U1 ... G3: U3 → PB: L In the case of concatenation, one comparison / transfer process is performed in i-bit units as in the conventional case. However, a long record that cannot be handled by a single comparison transfer unit is obtained by operating each of the plurality of comparison transfer units to be concatenated (maximum 4 units in the embodiment) as if they were linked together. Even in this case, the data can be divided and stored in each unit of a plurality of cascade connections that operate in conjunction (that is, the memory capacity of the comparison transfer unit is expanded), and the record length to be sorted can be expanded.

第2図(2)は、2個の比較転送ユニットを結合した場
合のデータ転送経路である。この場合のデータ転送経路
は、図中の太実線で示すローバスト側で太破線で示すハ
イバイト側の次の2種類である。なお、ローバイト側、
ハイバイト側のそれぞれのデータ処理幅はiビットであ
る。
FIG. 2 (2) shows a data transfer path when two comparison transfer units are combined. In this case, the data transfer paths are the following two types on the robust side shown by the thick solid line and the high byte side shown by the thick broken line in the figure. On the low bite side,
Each data processing width on the high byte side is i bits.

PA:L→G0:U0→G0:U3……G3:U3→PB:L ローバイト側 PA:H→G0:U1→G0:U2……G3:U2→PB:L ハイバイト側 実施例の2結合の場合、ローバイト側とハイバイト側の
各々、2個の比較転送ユニットが並列に動作するため
(即ち、比較転送ユニットの比較器の幅が拡張)、1回
の比較・転送処理は2×iビット単位であり、ソート処
理速度を1/2に短縮できる。
PA: L → G0: U0 → G0: U3 …… G3: U3 → PB: L Low byte side PA: H → G0: U1 → G0: U2 …… G3: U2 → PB: L High byte side Example 2 In the case of combination, two comparison transfer units on the low byte side and two comparison transfer units on the high byte side operate in parallel (that is, the width of the comparator of the comparison transfer unit is expanded), so that one comparison / transfer process is performed twice. × It is a unit of i bits, and the sort processing speed can be reduced by half.

第3図は、第1図に示した16個の比較転送ユニット11を
結合及び連結する場合に実現される動作モードを示した
図である。図中の( )はユニットの連結状態を示し、
[ ]はユニットの結合状態を示している。また( )
及び[ ]内のHLは、レコードを比較転送ユニットに分
割して入力する際のハイバイト側とローバイト側を示し
ている。ユニットの連結と結合は、比較転送ユニットの
接続を変更する、すなわち、ユニット間の接続を転送切
替回路を介して、可変構造としておき、ソートするレコ
ードの長さや要求されるソート処理性能に応じて接続関
係を変更してデータ転送路を形成することで容易に実現
できる。モード1は、第4図の従来技術に対応し、レコ
ードを単純に各々の比較転送ユニットに格納することか
ら、最大i×jビット(j=k)の長さを持つレコード
を16レコードソートできる。モード2は、2個の比較転
送ユニットを1組として連結した場合であり、ソート可
能な最大レコード長はモード1の2倍に拡張される。以
下、モード5までは、順次連結する比較転送ユニットの
数を2倍づつ拡張した場合であり、モード5ではモード
1に比較してソート可能な最大レコード長を16倍とでき
る。
FIG. 3 is a diagram showing an operation mode realized when the 16 comparison transfer units 11 shown in FIG. 1 are combined and connected. () In the figure shows the unit connection state,
[] Indicates the unit connection state. Also( )
Also, HL in [] indicates the high byte side and the low byte side when the record is divided and input into the comparison transfer unit. Concatenation and combination of units changes the connection of the comparison transfer unit, that is, the connection between units is made a variable structure through the transfer switching circuit, and according to the length of records to be sorted and the required sort processing performance. This can be easily realized by changing the connection relationship and forming the data transfer path. Mode 1 corresponds to the prior art of FIG. 4, and since the records are simply stored in each comparison transfer unit, 16 records having a maximum length of i × j bits (j = k) can be sorted. . Mode 2 is a case where two comparison transfer units are connected as one set, and the maximum record length that can be sorted is extended to twice that of mode 1. In the following, up to mode 5, the number of comparison transfer units that are sequentially connected is expanded by a factor of 2. In mode 5, the maximum record length that can be sorted can be increased by 16 times compared to mode 1.

モード6からモード9までは、2個の比較転送ユニット
を結合した上でユニットの連結を行う例である。モード
6は、単に2個のユニットを1組として結合した場合で
あり、データ転送処理の幅を2倍に拡張したことから、
ソート処理のスループットを2倍に拡張できる。この
時、ソート可能な最大レコード長は、1レコードが2分
割されて2個のユニットに並列に入力されるため、モー
ド1の場合の2倍である。モード7からモード9は、2
個のユニットを結合するモード6を基本として、更にユ
ニットの連結を行う場合であり、モード6と同じソート
処理スループット(モード1の2倍)で、最大レコード
長がモード6を基本として2倍づつ拡張することができ
る。
Modes 6 to 9 are examples in which two comparison and transfer units are combined and then the units are connected. Mode 6 is a case where two units are simply combined as one set, and the width of the data transfer process is doubled,
The throughput of sort processing can be doubled. At this time, the maximum record length that can be sorted is twice that in the case of mode 1 because one record is divided into two and input into two units in parallel. Mode 7 to Mode 9 are 2
This is a case in which units are further connected based on mode 6 in which individual units are combined, and the maximum record length doubles based on mode 6 with the same sort processing throughput as mode 6 (twice that of mode 1). Can be extended.

以上説明した実施例では、16個の比較転送ユニットから
なるソート処理装置に於て、データ転送幅を拡張する方
向に最大2ユニットを結合し、データを格納するメモリ
量を拡張する方向に最大16ユニットを連結する場合を示
したが、全体のユニット数が16個以外の場合であって
も、本実施例と同様にユニット間の接続構造を可変とす
ることによって、データの転送処理幅及びソートできる
レコードの最大長を拡張できる。更に、ユニットを結合
・連結する個数を本実施例以外の値とすることによっ
て、データ転送処理幅及び最大ソート可能なレコード長
を所望の値まで拡張できる。一方、本実施例では、結合
・連結の基本とする比較転送ユニットのデータ処理幅を
iビット=1バイトとして示したが、これ以外の値であ
っても、本実施例と同様にユニットの結合・連結を行う
ことが出来る。
In the embodiment described above, in the sort processing apparatus including 16 comparison transfer units, maximum 2 units are combined in the direction of expanding the data transfer width and maximum 16 units in the direction of expanding the amount of memory for storing data. Although the case where the units are connected has been shown, even when the total number of units is other than 16, by changing the connection structure between the units as in the present embodiment, the data transfer processing width and the sorting are performed. You can extend the maximum record length that you can. Furthermore, by setting the number of units to be connected / connected to a value other than that in this embodiment, the data transfer processing width and the maximum sortable record length can be expanded to desired values. On the other hand, in the present embodiment, the data processing width of the comparison transfer unit, which is the basis of merging / concatenating, is shown as i bits = 1 byte, but if the value is other than this, the unit combining is performed in the same manner as in the present embodiment. -Can be connected.

次に、一例として第3図のモード2(2連結)及びモー
ド6(2結合)の場合の具体的な動作例を示す。ただ
し、説明の簡単化のため、2個の比較転送ユニット(ユ
ニット0,ユニット1)で一つのユニット群を構成し、ユ
ニット群は2組(ユニット群G0,ユニット群G1)で構成
されるとする。
Next, as an example, a specific operation example in the case of mode 2 (two coupling) and mode 6 (two coupling) of FIG. 3 will be shown. However, for simplification of description, it is assumed that two comparison transfer units (unit 0, unit 1) constitute one unit group, and two unit groups are constituted (unit group G0, unit group G1). To do.

第7図は、比較転送ユニットを連結したレコード長を拡
大する場合の動作例であり、(A)は入力操作時の動
作、(b)は出力操作時の動作である。先の第6図の例
では、k=2すなわち英文字2文字からなるレコードを
ソートする場合を示したが、第7図は、それぞれ2個の
比較転送ユニットを連結し、2組のユニット群により、
英文字4文字(k=4)からなる4個(N=4)のレコ
ード(abcd,defg,acdf,abef)をソートする場合を示
す。なお、1文字はiビットとし、個々の比較転送ユニ
ットの各メモリの容量はi×2(j=2)とする。フラ
グレジスタへの比較結果の設定は第6図の例と同一であ
るが、ユニット群を形成する2個のユニット(ユニット
0とユニット1)を連動して動作させる。すなわち、ユ
ニット0のメモリm1にユニット1のメモリm1が連結さ
れ、同様にユニット0のメモリm2にユニット1のメモリ
m2を連結動作させるために、連動しているユニット群に
フラグレジスタFを用意して(第7図ではユニット1の
フラグレジスタを利用するとしている)、Fの値によっ
てレコードの転送を制御する。入力操作時には、F=0
であればメモリm1側の内容を、F=1であればメモリm2
側の内容を右方向に隣接する比較転送ユニットに向けて
出力する。一方、出力操作時は、F=1であればメモリ
m1側の内容を、F=0であればメモリm2側の内容を左方
向に隣接する比較転送ユニットに向けて出力する。
FIG. 7 is an operation example in the case of expanding the record length in which the comparison transfer units are connected, (A) is an operation during an input operation, and (b) is an operation during an output operation. In the example of FIG. 6 described above, a case where k = 2, that is, a record consisting of two alphabetic characters is sorted is shown. In FIG. 7, two comparison transfer units are connected to each other, and two sets of unit groups are connected. Due to
The case where four (N = 4) records (abcd, defg, acdf, abef) consisting of four alphabetic characters (k = 4) are sorted is shown. Note that one character has i bits, and the capacity of each memory of each comparison transfer unit is i × 2 (j = 2). The setting of the comparison result in the flag register is the same as in the example of FIG. 6, but two units (unit 0 and unit 1) forming the unit group are operated in conjunction. That is, the memory m1 of the unit 0 is connected to the memory m1 of the unit 1, and similarly, the memory m2 of the unit 0 is connected to the memory m2 of the unit 0.
A flag register F is prepared for a group of interlocked units (in FIG. 7, the flag register of the unit 1 is used) in order to operate the connection of m2, and the transfer of records is controlled by the value of F. During input operation, F = 0
If so, the contents of the memory m1 side, if F = 1, the memory m2
The contents on the side are output to the adjacent comparison transfer unit in the right direction. On the other hand, at the time of output operation, if F = 1, the memory
If the content on the m1 side is F = 0, the content on the memory m2 side is output to the comparison transfer unit adjacent in the left direction.

第7図に示したように、複数の比較転送ユニットをメモ
リの容量が増える方向に連結することで、単一の比較転
送ユニットではソートできない長さのレコードをソート
することができる。この時のソートに必要なステップ数
は、一度に転送できるデータ幅が第6図の単一ユニット
でのソートと同一(iビット)であるから、レコード長
が長くなった分だけ増大し、第7図の例では32ステップ
(=2×k×N)を要している。
As shown in FIG. 7, by connecting a plurality of comparison transfer units in the direction of increasing the memory capacity, it is possible to sort records of a length that cannot be sorted by a single comparison transfer unit. The number of steps required for sorting at this time is the same as the sorting in a single unit in Fig. 6 (i bits) because the data width that can be transferred at a time is the same. In the example of FIG. 7, 32 steps (= 2 × k × N) are required.

第8図は、複数の比較転送ユニットを結合動作させソー
ト処理速度、すなわち、ソートに要するステップ数を削
減する場合の動作を、第7図と同じ4個のレコードを用
いた降順ソートの例を示したものである。第7図の比較
転送ユニットの連結との違いは、連結がメモリの容量を
増やす方向に比較転送ユニットを縦続接続していたのに
対し、結合では一度に比較転送できるデータの幅を増や
す方向、即ち、単一ユニットではiビットであったデー
タ転送の幅を、第8図に示すように、例えば2個のユニ
ットと結合して(2×i)ビットに拡張したことであ
る。従って、4文字からなるレコードを2文字づつ2回
の転送操作で入力することができる。第8図で、(A)
は入力操作の動作、(B)は出力操作時の動作である。
FIG. 8 shows an example of a descending sort using the same four records as FIG. 7, showing the operation when a plurality of comparison transfer units are combined and the sort processing speed, that is, the number of steps required for sorting is reduced. It is shown. The difference from the concatenation of the comparison transfer units in FIG. 7 is that the concatenation connects the comparison transfer units in the direction of increasing the memory capacity, whereas the connection increases the width of data that can be compared and transferred at one time. That is, the width of data transfer, which is i bits in a single unit, is expanded to (2 × i) bits by combining with two units as shown in FIG. Therefore, it is possible to input a record consisting of four characters, two characters by two transfer operations. In Figure 8, (A)
Is an input operation operation, and (B) is an output operation operation.

第8図に示した2ユニットの結合の例の場合、2個のユ
ニットが並列動作の論理的に1個のユニットとして振る
舞い、第7図のユニットの連結では32ステップを要して
いたソート処理時間が1/2の16ステップで実現できるこ
とがわかる。
In the case of the example of combining two units shown in FIG. 8, two units behave logically as one unit in parallel operation, and the sorting process that requires 32 steps in the unit connection of FIG. It can be seen that it can be realized in 16 steps with half the time.

以上、具体例として、1回のデータ転送の幅iビット、
メモリm1,m2の容量i×2(j=2)ビットの比較転送
ユニットを2個用い、連結動作させることで、i×4ビ
ット長のレコードをソートできること、さらに、それら
を結合動作させることで、ソート処理時間を1/2に削減
できることを示した。これら連結および結合によるユニ
ットの連動は、複数のユニットを用いて論理的なユニッ
トを形成することが基本であり、論理ユニットを形成す
る際のユニット接続の方向がメモリを増やす方向である
か、あるいは、データ転送路を拡大する方向であるかの
違いである。したがって、転送切替回路により比較転送
ユニット間の接続が可変構造としておくことによって、
複数の比較転送ユニットからなる論理的なユニットをレ
コード長やソート処理速度に応じて形成することが可能
となる。特に、専用ハードウェア化されたソート処理装
置では、レコード長が短い場合でも長い場合でも、備え
られたハードウェアが有効に機能して十分に高い性能を
達成することが重要であり、例えばユニットの連結を用
いると、短いレコードはユニット単独でソートを行な
え、長いレコードは複数のユニットを連結してソートす
るので、単にレコード長に対するハードウェア的な制限
を緩和するだけでなく、ハードウェアを有効に利用する
と言う点でも極めて有効に機能する。即ち、短いレコー
ドは多数を、より長いレコードは少ない個数を一度にソ
ートできるソート処理装置を実現することができる。
As described above, as a specific example, the width of one data transfer is i bits,
By using two comparison transfer units each having a capacity of i × 2 (j = 2) bits of the memories m1 and m2 and performing a concatenation operation, records of i × 4 bit length can be sorted, and further, by combining them, , Showed that the sort processing time can be reduced by half. The interlocking of units by these connection and coupling is basically to form a logical unit by using a plurality of units, and the direction of unit connection when forming a logical unit is to increase the memory, or The difference is whether the data transfer path is to be expanded. Therefore, by making the connection between the comparison transfer units variable by the transfer switching circuit,
It is possible to form a logical unit including a plurality of comparison transfer units according to the record length and the sort processing speed. In particular, in a dedicated hardware sort processing device, it is important that the provided hardware effectively functions and achieves sufficiently high performance regardless of whether the record length is short or long. With concatenation, short records can be sorted by a single unit, and long records can be sorted by concatenating multiple units, which not only eases the hardware limitation on the record length but also enables hardware. It also works extremely effectively in terms of utilization. That is, it is possible to realize a sort processing device capable of sorting a large number of short records and a small number of longer records at a time.

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

以上説明したように、本発明のソート処理装置では、ソ
ート処理時のデータ転送幅及び最大レコード長等のソー
ト処理条件に基づいて、1次元アレイ上に配置した比較
転送ユニットの接続構造を変更できる構成としたことに
よって、使用環境、特にデータ転送処理幅や要求される
ソート処理性能に応じたソート処理装置を容易に実現す
ることが出来る。更に、本発明に基づくソート処理装置
をLSI化した場合には、比較転送ユニットの接続構成で
外部使用条件を吸収できることから、外部使用条件に依
存せずに繰返し単位となる比較転送ユニットを設計でき
ること、及びLSI化したソート処理装置の適用範囲が広
がる利点がある。
As described above, in the sort processing device of the present invention, the connection structure of the comparison transfer unit arranged on the one-dimensional array can be changed based on the sort processing conditions such as the data transfer width and the maximum record length during the sort processing. With the configuration, it is possible to easily realize the sort processing device according to the usage environment, particularly the data transfer processing width and the required sort processing performance. Further, when the sort processing device according to the present invention is implemented as an LSI, the external transfer condition can be absorbed by the connection configuration of the comparison transfer unit, so that the comparison transfer unit serving as a repeating unit can be designed without depending on the external use condition. , And the advantage that the range of application of the sort processing device made into an LSI is expanded.

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

第1図は本発明の一実施例のソート処理装置の構成図、
第2図は第1図の実施例のデータ転送路の構成を示す
図、第3図は第1図の実施例の動作モードを示す図、第
4図は従来のソート処理装置の構成図、第5図は第4図
に示したソート処理装置の動作原理を示す図、第6図は
従来の具体的な動作例を示す図、第7図は本発明の連結
の具体的な動作例を示す図、第8図は本発明の結合の具
体的な動作例を示す図である。 10……ソート処理装置、11……比較転送ユニット、12…
…バス切替回路、13……ユニット群。
FIG. 1 is a block diagram of a sort processing apparatus according to an embodiment of the present invention,
FIG. 2 is a diagram showing the configuration of the data transfer path of the embodiment of FIG. 1, FIG. 3 is a diagram showing the operation mode of the embodiment of FIG. 1, and FIG. 4 is a configuration diagram of a conventional sort processor. FIG. 5 is a diagram showing an operation principle of the sort processing apparatus shown in FIG. 4, FIG. 6 is a diagram showing a concrete operation example of the conventional art, and FIG. 7 is a concrete operation example of connection of the present invention. FIG. 8 is a diagram showing a concrete operation example of the combination of the present invention. 10 …… Sort processor, 11 …… Comparison transfer unit, 12…
… Bus switching circuit, 13 …… Unit group.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】2個のデータを格納する第1および第2の
メモリと、該第1および第2のメモリに保持されたデー
タ間の大小関係を判定する比較器と、該2個のデータの
いずれか一方を転送するための転送回路とを少なくとも
有する比較転送ユニットが複数個の1次元アレイからな
るソート処理装置において、 前記複数個の比較転送ユニットを、2個あるいはそれ以
上の比較転送ユニットを1組とする任意の組にグループ
分けする手段を設け、 ソート対象レコードを、前記1組を構成する各比較転送
ユニットに分割して与え、当該各比較転送ユニットを連
動して動作せしめることを特徴とするソート処理装置。
1. A first and a second memory for storing two pieces of data, a comparator for judging a magnitude relation between the data held in the first and the second memory, and the two pieces of data. In a sort processing device having a plurality of one-dimensional arrays, each of which has at least a transfer circuit for transferring one of the plurality of comparison transfer units. A means for grouping into arbitrary groups having one set is provided, and the sort target record is divided and given to each comparison transfer unit constituting the one set, and each comparison transfer unit is operated in conjunction. Characterizing sort processing device.
【請求項2】特許請求の範囲第1項記載のソート処理装
置において、1組を構成する各比較転送ユニットを並列
接続とし、当該各比較転送ユニットを並列に連動して動
作せしめることを特徴とするソート処理装置。
2. A sort processing apparatus according to claim 1, wherein each comparison transfer unit constituting one set is connected in parallel, and each comparison transfer unit is operated in parallel. Sort processing device.
【請求項3】特許請求の範囲第1項記載のソート処理装
置において、1組を構成する各比較転送ユニットを縦続
接続とし、当該各比較転送ユニットの第1および第2の
メモリ全体をそれぞれ第1および第2のメモリとして、
該各比較転送ユニットを連動して動作せしめことを特徴
とするソート処理装置。
3. The sort processing device according to claim 1, wherein each comparison transfer unit constituting one set is connected in cascade, and the entire first and second memories of each comparison transfer unit are respectively connected to each other. As the first and second memories,
A sorting apparatus characterized in that each of the comparison and transfer units is operated in conjunction with each other.
JP6543087A 1987-03-19 1987-03-19 Sort processing device Expired - Fee Related JPH0797310B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6543087A JPH0797310B2 (en) 1987-03-19 1987-03-19 Sort processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6543087A JPH0797310B2 (en) 1987-03-19 1987-03-19 Sort processing device

Publications (2)

Publication Number Publication Date
JPS63231526A JPS63231526A (en) 1988-09-27
JPH0797310B2 true JPH0797310B2 (en) 1995-10-18

Family

ID=13286871

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6543087A Expired - Fee Related JPH0797310B2 (en) 1987-03-19 1987-03-19 Sort processing device

Country Status (1)

Country Link
JP (1) JPH0797310B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3152466B2 (en) * 1991-04-04 2001-04-03 三菱電機株式会社 Sorting device and sorting method

Also Published As

Publication number Publication date
JPS63231526A (en) 1988-09-27

Similar Documents

Publication Publication Date Title
US6728743B2 (en) Modulo remainder generator
US5621908A (en) Parallel sorting system to reduce the amount of communication between processing devices
US5548775A (en) System and method for adaptive active monitoring of high speed data streams using finite state machines
JP3026962B2 (en) Word string compression circuit
US4945518A (en) Line memory for speed conversion
EP0444911A1 (en) Integrated high speed synchronous counter with asynchronous read-out
EP0049039B1 (en) Data processing apparatus for processing sparse vectors
US5974411A (en) N-way processing of bit strings in a dataflow architecture
US6618804B1 (en) System and method for rearranging bits of a data word in accordance with a mask using sorting
KR920003176B1 (en) Control data regenerating device for sort processor
JP3196637B2 (en) Sort processor and sort processing device
JPH01283625A (en) Solid wiring circuit for sorting data
US5511189A (en) Data sorting apparatus capable of detecting completion of data sorting early and sorting method therefor
JPH0666050B2 (en) Sort processing method
JPH0797310B2 (en) Sort processing device
JPH0482082A (en) Semiconductor memory device
Armstrong et al. A serial sorting machine
KR0172508B1 (en) Bit Serial Digital Sorter
JPS627579B2 (en)
JPS627578B2 (en)
JP4158264B2 (en) Sort / merge processing device and sort / merge circuit
JP2000322236A (en) Sorting device
JPS5965352A (en) Sorting device
EP0468505A2 (en) Barrel shifter
JPH06164417A (en) Encoding device

Legal Events

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