JPS6278627A - Sorting processor - Google Patents

Sorting processor

Info

Publication number
JPS6278627A
JPS6278627A JP21890385A JP21890385A JPS6278627A JP S6278627 A JPS6278627 A JP S6278627A JP 21890385 A JP21890385 A JP 21890385A JP 21890385 A JP21890385 A JP 21890385A JP S6278627 A JPS6278627 A JP S6278627A
Authority
JP
Japan
Prior art keywords
data
transfer
input
circuit
sorting
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.)
Pending
Application number
JP21890385A
Other languages
Japanese (ja)
Inventor
Tetsuji Sato
哲司 佐藤
Nobuo Tsuda
津田 伸生
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 JP21890385A priority Critical patent/JPS6278627A/en
Publication of JPS6278627A publication Critical patent/JPS6278627A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To perform the input of data through an end of a sorting processor and the output of data through the other end in parallel with each other, by supplying the record after giving an identifier to a comparison/transfer circuit. CONSTITUTION:A comparison transfer circuit 10 contains a 1-dimensional array of plural comparison/transfer units 6. An identifier adding circuit 11 is provided to the input/output part of the circuit 10 to give an identifier that identifies whether the record to be sorted is supplied from the unit 6 at the most left or right end. Thus the record containing an identifier is supplied to the circuit 10 via the circuit 11. As a result, it is possible to carry out an operation to supply the record to be sorted to the unit 6 at an end, an operation to deliver the sorting result through the unit 6 at the other end and the comparison and the transfer of each unit 6 synchronously with each other.

Description

【発明の詳細な説明】 〔産業−[〕の利用分野〕 本発明は、文字列や数値データタ対象としたソート処理
装置に係り、特に複数の比較転送ユニットの1次元アレ
イ構造からなるソート処理装置において、データの入出
力回路の構成に関する。
[Detailed Description of the Invention] [Industry - Field of Application] The present invention relates to a sort processing device for character strings and numerical data, and particularly to a sort processing device having a one-dimensional array structure of a plurality of comparison and transfer units. , relates to the configuration of a data input/output circuit.

〔従来の技術〕[Conventional technology]

ソートとは、与えられたデータの集まりを所定の順序に
従って並び替える処理である。電子計算機におけるソー
ト処理とは、数値あるいは文字列として与えられたデー
タが計算機内部では110 IIあるいは“1″の二値
符号で表ル;されている事から、二値符号の持つ数値的
意味にもとづいて、与えられたデータを相互に比較し、
それぞれのデータの大小関係によって、H順(小さいも
のから大きいものへの順)あるいは降順(大きいものか
ら小さいものへの順)にデータを並びかえることである
Sorting is a process of rearranging a given set of data in a predetermined order. Sorting processing in electronic computers is because data given as numerical values or character strings is expressed inside the computer as a binary code of 110 II or "1", so it is difficult to understand the numerical meaning of the binary code. Compare the given data with each other based on
This is to rearrange the data in H order (order from smallest to largest) or descending order (order from largest to smallest) depending on the size relationship of each data.

一般に、ソート対象のデータを1ノコードと利;シ、レ
コードはデータ相77の比較を行って大小関係を判定す
るキ一部と比較を行わない部分とに分けることができる
。このレコードを、文字列や正整数(符号なし整数)に
限定した場合には、二進符号で表わされたレコードのキ
一部を上位桁はど優位性を持たせて比較することによっ
て、ソート処理を行うレコード相互の大小関係を決定で
きる。文字列やIF整数以外のたとえば実数等であって
も適当な変換処理によって、文字列あるいは正整数と同
様に、大小関係を損なオ〕ずにソー1−することができ
る。
Generally, the data to be sorted can be divided into one code and record, and a part in which the data phase 77 is compared to determine the magnitude relationship, and a part in which no comparison is made. If this record is limited to character strings or positive integers (unsigned integers), by comparing the key part of the record expressed in binary code, giving priority to the upper digits, It is possible to determine the size relationship between records to be sorted. Even if it is a real number or the like other than a character string or an IF integer, it can be sorted through appropriate conversion processing without compromising the magnitude relationship, just like a character string or a positive integer.

従来、このようなソート処理を、メモリ装置(メモリ)
と中央演算装置(cpU)を中核として構成した汎用の
電rHI算機で実行する場合には、メモリとCP tJ
間のデータ転送やCPU内での比較が逐次処理であるこ
と、一度に2個のデータ間の比較しか出来ないこと等の
理由により、ソート処理で対象とするレコード数が大獣
の場合には、処理に要する時間が極めて長くなるという
問題があった。
Conventionally, such sorting processing was performed using a memory device (memory).
When executed on a general-purpose electric rHI computer configured with a central processing unit (cpU) as the core, memory and CP tJ
If the number of records to be sorted is large due to reasons such as data transfer between data transfers, comparisons within the CPU being sequential processing, and the ability to compare only two pieces of data at a time, However, there was a problem in that the time required for processing was extremely long.

か\るソート処理時間に関する問題を解決する従来技術
として、専用のソート処理装置を用いて、データ相互の
比較による大小関係の判定と、データの転送を並列に行
って高速化を図る方法が、例えば、特願昭58−188
368号に提案されている。
As a conventional technique to solve the problem of sort processing time, there is a method that uses a dedicated sort processing device to compare data to determine the size relationship and to transfer data in parallel to increase speed. For example, patent application 1988-188
No. 368.

第6図は従来技術のソート処理装置(以下ではソータと
称する)の構成図である。本ソータは、比較の対象とす
るデー、りを保持するための第1のメモリ1および第2
のメモリ2)比較器3、該比較器によって得られた判定
結果を保持するためのフラグレジスタ4および入出力回
路5からなるユニット6の複数個を一次バコ接続した構
成を有している。本ソータでは、データ相互の比較と転
送を複数のユニットで同時に実行できるため、以下に説
明する動作原理にしたがって、レコード数に比例する時
間でソート処理を行うことができる。
FIG. 6 is a block diagram of a conventional sorting processing device (hereinafter referred to as a sorter). This sorter has a first memory 1 and a second memory for holding data to be compared.
The memory 2) has a configuration in which a plurality of units 6 each consisting of a comparator 3, a flag register 4 for holding the determination result obtained by the comparator, and an input/output circuit 5 are linearly connected. In this sorter, mutual comparison and transfer of data can be performed simultaneously in multiple units, so that sorting processing can be performed in a time proportional to the number of records according to the operating principle described below.

第7図は第6図のソータの動作原理図であり、−例とし
て0かへ9までの−・桁の数値データのうち、3,6,
5,2,4..1の6個のレコードを降順にソートする
場合の動作を示している。第7図では、第6図における
第1のメモリ1および第2のメモリ2とフラグレジスタ
4のみを簡略に示しており、他の回路は省略しである。
Fig. 7 is a diagram showing the operating principle of the sorter shown in Fig. 6, in which numerical data of digits 3, 6,
5, 2, 4. .. This shows the operation when six records of 1 are sorted in descending order. In FIG. 7, only the first memory 1, second memory 2, and flag register 4 in FIG. 6 are simply shown, and other circuits are omitted.

ソート処理を行うにあたって、はじめに全てのユニット
の第1のメモリ1および第2のメモリ2の内容を初期設
定する。こ−では、降順にソートする場合の例であり、
この場合にはデータの最小値である0を初期値として設
定する。本ソータは、順次レコードを人力する操作と、
順次レコードを出力する出力操作とでソート処理を行へ
。−・回の入力操作で各ユニットでは、データの右方向
への転送と2個のデータ間での比較とを行ろ。この場合
、転送されるデータは第1および第2のメモリ】2,2
に保持された2個のデータのうち小さい方である。この
時、データの転送と同期して1個のレコードをソータに
入力し、最左端のユニツl−の第1のメモリ1あるいは
第2のメモリ2のいずれかのうち転送によって空になっ
た方のメモリに保持する。(−i”1〜1゛6) この人力操作を繰り返して6個のレコード全てを入力し
た段階で、今度は出力操作によって順次データを隣接す
る左側のユニットに転送する。この時、転送するデータ
はユニッ1−内の2個のデータの)も大きい方であり、
最右端のユニツ1−には初期値と同じ値であるOを入力
する。(1゛7・〜T以−1−1入力操作の繰り返しに
よってデータを順次入力し、データの入力が完了した段
階で出力操作を実行することにより、最大値から順次ソ
ー1〜済みのレコードを降順に取り出すことができる。
In performing the sorting process, first, the contents of the first memory 1 and the second memory 2 of all units are initialized. This is an example of sorting in descending order.
In this case, 0, which is the minimum value of data, is set as the initial value. This sorter is capable of manually sorting records sequentially.
Sort processing into rows with an output operation that outputs records sequentially. - In each unit, transfer data to the right and compare two pieces of data using input operations. In this case, the data to be transferred is stored in the first and second memories ]2,2
This is the smaller of the two data held in . At this time, one record is input to the sorter in synchronization with the data transfer, and either the first memory 1 or the second memory 2 of the leftmost unit l- is emptied by the transfer. to be kept in memory. (-i"1 to 1゛6) When all six records have been input by repeating this manual operation, the data is sequentially transferred to the adjacent left unit by the output operation. At this time, the data to be transferred is the larger one of the two data in unit 1-,
The rightmost unit 1- is input with O, which is the same value as the initial value. (From 1゛7・~T-1-1 By repeating the input operation, input the data sequentially, and execute the output operation when the data input is completed, the records that have been sorted from 1 to Can be retrieved in descending order.

こ\で説明したソート処理の例では、レコード数に等し
い入力操作回数と出力操作回数でソート処理が行える。
In the example of the sorting process described here, the sorting process can be performed with the number of input operations and the number of output operations equal to the number of records.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

第6図のソータを用いて4順にソートする場合には、初
期設定として、全ユニットの第1のメモリおよび第2の
メモリに、データの最大値として9を設定しておき、入
力操作時には、各ユニッ1−で比較した2個のデータの
うち、大きい方を右方向に転送し、出力操作時には、各
ユニットで比較した2個のデータのうち、小さい方を左
り向に転送すること\なる。したがって、本ソータでは
、降順ソートの場合と4順ソー1への場合では、各ユニ
ットに初期設定する値を変りイしなければなIコ)ない
問題と、入力操作時および出力操作時の転送データの大
小を逆にしなければならない問題とがあった。
When sorting in four orders using the sorter shown in Fig. 6, the maximum value of data is set to 9 in the first memory and second memory of all units as an initial setting, and at the time of input operation, Of the two pieces of data compared in each unit, the larger one is transferred to the right, and during output operation, the smaller one of the two pieces of data compared in each unit is transferred to the left. Become. Therefore, in this sorter, there is a problem that the initial values for each unit must be changed between descending sort and 4-order sort 1, and transfer during input and output operations. There was a problem in which the size of the data had to be reversed.

第6図のソータは、1回のソー1−処理によってユニッ
ト数の2倍のレコードまで、はソテータの転送速度をソ
ートできる。ユニット数の2倍を超えるような大量レコ
ードをソーI−する場合、本ソータを繰り返し使用し部
分的にソー1−シた後に、マージ操作によって全体をソ
ートする方法が特願昭59−163519号に提案され
ている。【ッかしながら、本ソータを繰り返し使用した
場合には、第7図に示したように入力操作と出力操作を
順次行オ)なければならないことから、入力操作時間と
出力操作時間の和が必要となる。この時、比較転送ユニ
ットを1次元アレイ接続したソータの1端からデータ1
入出力していることから、入出力を行っている端から離
れたユニツ1−では、本来必要としない初期値どうしの
比較と転送を行っている。
The sorter shown in FIG. 6 can sort up to twice the number of units of records by one sorting process at a transfer rate of the sorter. When sorting a large number of records that exceed twice the number of units, Japanese Patent Application No. 59-163519 discloses a method in which this sorter is repeatedly used to partially sort the records, and then the whole is sorted by a merge operation. has been proposed. [However, if this sorter is used repeatedly, input operations and output operations must be performed sequentially as shown in Figure 7, so the sum of input operation time and output operation time is It becomes necessary. At this time, data 1 is sent from one end of the sorter to which the comparison transfer unit is connected in a one-dimensional array.
Since input/output is being performed, unit 1-, which is far from the end where input/output is being performed, performs comparison and transfer of initial values that are not originally required.

したがって、1回のソート処理では、処理時間内で平均
してはゾ半分のユニットが無駄な動作をしていることに
なり、本ソート処理装置を用いて繰り返しソート処理を
行う場合には、ユニツ1〜の実効的な稼働率が約1−/
2に低下してしまう問題が生じる。
Therefore, in one sorting process, on average, half of the units operate in vain during the processing time, and when performing repeated sorting processes using this sorting processing device, the unit The effective utilization rate of 1~ is approximately 1−/
A problem arises in which the number decreases to 2.

本発明の目的は、ソート処理装置の一方の端からのデー
タ入力と他jjの端からのデータ出力とを同期して並列
に行うことによってスループッ1へを改善し、連続的に
昇順あるいは降順にソー1−するソート処理装置を提供
することにある。
An object of the present invention is to improve the throughput to 1 by synchronizing and parallelizing the data input from one end of the sort processing device and the data output from the other end, so that data can be processed continuously in ascending or descending order. An object of the present invention is to provide a sort processing device for sorting.

〔問題点を解決するための手段及び作用〕本発明は、比
較転送ユニットの1次元アレイ構造からなる比較転送回
路の入出力部に、最左端あるいは最右端のユニットのい
ずれかの側からソート対象のレコードを入力したかを識
別する識別子を付与する識別子材Zi一手段を設ける。
[Means and effects for solving the problem] The present invention provides sorting targets from either the leftmost or rightmost unit in the input/output section of a comparison and transfer circuit having a one-dimensional array structure of comparison and transfer units. An identifier material Zi means is provided for providing an identifier for identifying whether a record has been input.

本識別子付与手段によって識別子を付与したレコードを
比較転送回路に入力することにより、一方の端のユニッ
1−にソート対象レコードを人力する操作と、他方の端
のユニットからソート結果を出力する操作と、各ユニツ
1−の比較ど転送操作とを同期して行うことが可能にな
る。
By inputting records to which an identifier has been assigned by the present identifier assigning means to the comparison and transfer circuit, it is possible to manually input the records to be sorted into the unit 1- at one end, and output the sort results from the unit at the other end. , comparison and transfer operations of each unit 1- can be performed synchronously.

さらに、本発明はソー1−処理装置の入出力部にビット
反転手段製膜け、該ピノ1−反転手段を制御しながらソ
ート対象レコードの入出力を行うことによって、連続す
るソート処理の入力操作と出力操作を並列して行い、か
つ連続するソート処理の間で昇順あるいは降順のソー1
一方向を任意に設定できる構成としたことである。
Further, the present invention provides a bit reversing means in the input/output section of the saw 1 processing device, and inputs/outputs records to be sorted while controlling the pin 1 reversing means, thereby performing input operations for continuous sort processing. and output operations in parallel, and between successive sort operations, sort 1 in ascending or descending order
The structure is such that one direction can be set arbitrarily.

〔実施例〕〔Example〕

第1図は、本発明の一実施例を説明するソー[・処理装
置の全体構成図である。本実施例では、レコード長の長
いデータをソートするために、レコードを複数のデータ
に分割し、分割したデータを嚇位として入力操作あるい
は出力操作を行う場合を示す。図中、1〜4は第6図と
同じであり、7は転送データの切替回路、8はレジスタ
A、9はレジスタB、10は比較転送回路、11は識別
子付与回路、12はビット反転回路である。
FIG. 1 is an overall configuration diagram of a saw processing apparatus for explaining an embodiment of the present invention. In this embodiment, in order to sort data with a long record length, a record is divided into a plurality of pieces of data, and an input operation or an output operation is performed using the divided data as a command. In the figure, 1 to 4 are the same as in FIG. 6, 7 is a transfer data switching circuit, 8 is a register A, 9 is a register B, 10 is a comparison transfer circuit, 11 is an identifier assignment circuit, and 12 is a bit inversion circuit. It is.

比較転送回路10は、複数個の比較転送ユニット6の1
次元アレイ構造からなり、各々の比較転送ユニットが同
期してレコード間の比較とレコードの転送を行うことに
よって、レコードの並べ替えを行う回路である。比較転
送ユニット6は、ユニットの内部に2個のレコードを格
納するメモリA1、メモリB 2を有し、格納した2個
の【ノコードの大小関係を比較器;3で判定し、判定結
果を格納するフラグレジスタ4の内容により切替口!!
87を制御することによって、2個のレコードのいずれ
か一方をその大小関係に基づいて右方向あるいは左方向
に転送する機能を有する。
The comparison and transfer circuit 10 includes one of the plurality of comparison and transfer units 6.
This circuit has a dimensional array structure and rearranges records by synchronously comparing and transferring records between each comparison and transfer unit. The comparison and transfer unit 6 has a memory A1 and a memory B2 for storing two records inside the unit, and a comparator 3 determines the magnitude relationship between the two stored records, and stores the determination result. Switching port depending on the contents of flag register 4! !
87, it has a function of transferring either one of the two records to the right or to the left based on the size relationship.

第2図(、)は識別子材it回路11の具体的構成を示
す。図中の13は制御端子CI、14は制御端子C2,
15は人力論理値を反転して出力するインバータ回路、
16はCMO8回路に構成するPチャネル1−ランジス
タ、17は同じくNチャネルトランジスタである。本回
路では、制御端子CI、C2の論理値を組み合わせて設
定することにより、出力端子Y)をハイインピーダンス
2)論理値を組み合オ)せて設定することにより、出力
端子りをハイインピーダンスZ、論理値0,1のいずれ
かに設定できる。第2図(b)に制御端子C1、C2と
出力端子I)の論理値の関係を示す。
FIG. 2(,) shows a specific configuration of the identifier material IT circuit 11. As shown in FIG. In the figure, 13 is the control terminal CI, 14 is the control terminal C2,
15 is an inverter circuit that inverts and outputs the human logic value;
16 is a P-channel 1-transistor configured in the CMO8 circuit, and 17 is also an N-channel transistor. In this circuit, by setting the logical values of the control terminals CI and C2 in combination, the output terminal Y) can be set to high impedance. , can be set to either logical value 0 or 1. FIG. 2(b) shows the relationship between the logical values of the control terminals C1 and C2 and the output terminal I).

第3図(a)はビット反転回路12の具体的構成を示す
。図中の18はピッl−反転動作を制御する反転制御端
子CA、19は排他的論理和をとるF ORゲーi−で
ある。なお、本図ではピッ1へ反転回路のみを示し、デ
ータの双方向転送を実現するための切替回路は省略しで
ある。本回路におはるデータ入出力端−F l’l 1
.、 トo (7)関係は、第3図(b)に示すように
制御端子CΔが論理値Oの時には非反転、論理値1の時
には反転動作である。
FIG. 3(a) shows a specific configuration of the bit inversion circuit 12. In the figure, 18 is an inversion control terminal CA for controlling the pill inversion operation, and 19 is a FOR gate i- which takes an exclusive OR. In this figure, only the inversion circuit for pin 1 is shown, and the switching circuit for realizing bidirectional data transfer is omitted. Data input/output terminal for this circuit - F l'l 1
.. , t o (7) As shown in FIG. 3(b), when the control terminal CΔ has a logic value O, the operation is non-inverted, and when the control terminal CΔ has the logic value 1, the operation is inverted.

第2図(a)および第3図(a)は、第1図番こ示すソ
ー1〜処理装(6の左端のデータ入出力部に設けた識別
r付r、p回路とビット反転回路であるが。
Figures 2(a) and 3(a) show the identification r and p circuits and bit inverting circuits provided in the data input/output section at the left end of the saws 1 to 6 shown in Figure 1. Yes, but.

右端のデータ入出力部に設ける回路も同様である6次に
、第1図の双方向ソート処理装置の動作を説明する。
The same applies to the circuit provided in the data input/output section at the right end.6 Next, the operation of the bidirectional sort processing apparatus shown in FIG. 1 will be explained.

第4図は6個のレコードからなる3組のレコード列を連
続してソートする場合の例である。本例は、第;)図に
示したビット反転回路が非反転動作の場合、すなわち反
転制御端子CAを論理値0に設定した場合である。同図
では、比較転送回路10を構成する3個のユニットのメ
モリとメモリの内容だけを模式的に示しており、比較転
送回路内の他の回路および入出力部に設けた識別子材#
−j回路11、ビット反転回路12け省略しである。ソ
ート対象とするレコード列は、“5,3,2,9゜1 
、7 II ; “6,4,8,2,7,3” : ”
4゜3.8,4,2.6”の3組で、第1、第3番目の
レコード列を降順にソートし、第2番[1の1ノコ一ド
列を昇順にソートする。
FIG. 4 is an example in which three sets of record strings each consisting of six records are successively sorted. In this example, the bit inverting circuit shown in FIG. In the same figure, only the memories of the three units constituting the comparison and transfer circuit 10 and the contents of the memories are schematically shown.
-j circuit 11 and bit inversion circuit 12 are omitted. The record column to be sorted is “5, 3, 2, 9゜1
, 7 II; “6, 4, 8, 2, 7, 3”: ”
4° 3.8, 4, 2.6'', the first and third record strings are sorted in descending order, and the second one-note string of [1] is sorted in ascending order.

(1)初期状態(To):  比較転送回路10は、左
端からのレコードの入出力に対してそのレコードを降順
にソーl−する場合を想定し、第6図の従来のソート処
理装置の説明で述べたように、各ユニット(:3個のユ
ニット)6では、格納された2個のレコードのうち小さ
いレコードを右方向に転送し、大きいレコードを左り向
に転送する。1ソート処理を行う前に、各ユニツ1−6
のメモリAIとメモリB2をともにA110に初期設定
する。図中で、x−y(x+yは整数)で示した名メモ
リの内容は、Xが比較転送回路の左右のいずれの端から
レコードを入力したかを示す識別子、yがレコート本体
の値を示している。図では、説明の都合で識別子とレコ
ード本体を分離して表示しているが、各ユニット6では
識別f−もレコード本体に含めて同時に比較と転送を行
う。
(1) Initial state (To): Assuming that the comparison and transfer circuit 10 sorts the records in descending order for the input/output of records from the left end, the explanation of the conventional sorting processing device shown in FIG. As described above, in each unit (3 units) 6, of the two stored records, the smaller record is transferred to the right, and the larger record is transferred to the left. 1 Before performing the sorting process, each unit 1-6
The memory AI and memory B2 are both initialized to A110. In the figure, the content of the name memory indicated by x-y (x+y is an integer) is an identifier where X indicates which end of the comparison/transfer circuit, left or right, the record was input from, and y indicates the value of the record body. ing. In the figure, the identifier and the record body are shown separately for convenience of explanation, but in each unit 6, the identification f- is also included in the record body and comparison and transfer are performed at the same time.

(2)右方向転送(Tl 〜T6):  第1組の6個
のレコードを入力する。この時、入力する個々のレコー
ドには、左方向からの入力であることを示す識別−f−
、II I 11を付与する。したがって、最初の入力
レコードである5は“l−5”と表示しである。比較転
送回路10に入力したレコードは、各ユニット6で相〃
に比較して小さい方を右方向に転送する。第1組のレコ
ード列の入力が完了した状態がr6である。
(2) Rightward transfer (Tl to T6): Input the first set of six records. At this time, each input record has an identification -f- indicating that the input is from the left.
, II I 11. Therefore, the first input record, 5, is displayed as "l-5". The records input to the comparison and transfer circuit 10 are compared in each unit 6.
Transfer the smaller one to the right. The state in which input of the first set of record strings is completed is r6.

(3)左方向転送(r7〜’I’12):  左方向か
らの入力が完fした段階で、左ti向に転送する。この
時、各ユニッ1−6では2個のレコードの比較を行い、
その結東大きい方のレコードを左方向に転送する。この
操作で、比較転送回路10の左端から第1組の1ノニI
・−ド列を降順にソート・シて順次出力し、右端からは
第2組のレコード列を順次入力する。右端から人力する
レコードには、識別子410 !+を付与する。
(3) Left direction transfer (r7 to 'I'12): When the input from the left direction is completed f, transfer is made to the left direction ti. At this time, each unit 1-6 compares two records,
Transfer the larger record to the left. With this operation, the first set of 1 noni I from the left end of the comparison and transfer circuit 10 is
- Sort and output the record strings in descending order, and sequentially input the second set of record strings from the right end. The record manually entered from the right end has the identifier 410! Give +.

(4)右方向転送(’I’ 13−T 18)  : 
 (3’)に示した左方向転送が完了した段階で、今度
は右り向に転送する。 この時、各ユニッ1へ6では、
(2) (7) 右方向転送時と同様に、2個のレコー
ドの比較を行い、その結果小さい方のレコードを右方向
に転送する。この操作で、比較転送回路10の右端から
第2組のレコード列を昇順にソートして順次出力し、左
端からは第3紹のレコード列を順次入力する。この時、
左端から入力する第:3組のレコードには、(2)の場
合と同様に識別f−tt 1. ITを付与して比較転
送回路10に入力する。
(4) Rightward transfer ('I' 13-T 18):
When the leftward transfer shown in (3') is completed, the rightward transfer is now performed. At this time, in each unit 1 to 6,
(2) (7) As in the case of rightward transfer, two records are compared, and the record with the smaller result is transferred rightward. With this operation, the second set of record strings are sorted in ascending order from the right end of the comparison and transfer circuit 10 and are sequentially output, and the third introduction record string is sequentially input from the left end. At this time,
The third set of records input from the left end has the identification f-tt 1. as in the case of (2). It is given IT and inputted to the comparison and transfer circuit 10.

(5)左方向転送(TI9〜R24):  (4)の右
方向転送が完了した段階で、今度は左方向に転送する。
(5) Leftward transfer (TI9 to R24): When the rightward transfer in (4) is completed, the leftward transfer is now performed.

この時、各ユニット6では、(3)の左方向転送時と同
様に、2個のレコードの比較を行い、その結果大きい方
のレコードを左方向に転送する。
At this time, each unit 6 compares the two records in the same manner as in the case of leftward transfer in (3), and transfers the larger record to the left.

この操作で、比較転送回路1.0の左端から第3組のレ
コード列を降順にソー1〜して順次出力する。
With this operation, the third set of record strings from the left end of the comparison and transfer circuit 1.0 are sorted 1 to 1 in descending order and outputted sequentially.

本ソート処理の例ではソート対象レコードが3組である
から、最後の左方向転送時の入力は、本来必要としない
ソート対象レコードの入力であるから、識別子110 
ITを付り7した文字列であればよい。
In this example of sort processing, there are three sets of records to be sorted, so the input at the time of the last leftward transfer is the input of a record to be sorted that is not originally required, so the identifier 110
Any character string with IT and 7 will suffice.

図の例では、最後の右端からの人力として、〇−〇″と
しである。
In the example in the figure, the human power from the last right end is 〇-〇''.

以1−1(1)から(5)に示した右方向転送と左方向
転送の繰り返しによって、(3)の左方向転送で第1組
のレコード列を降順にソートした結果が得られ、(4)
の右方向転送で第2組のレコード列を昇順にソートした
結果が得られ、(5)の左方向転送で第:3組のレコー
ド列を降順にソートした結果が得られる。
By repeating the rightward transfer and leftward transfer shown in 1-1 (1) to (5) below, the result of sorting the first set of record strings in descending order in the leftward transfer in (3) is obtained, and ( 4)
The result of sorting the record strings of the second set in ascending order is obtained by the rightward transfer in (5), and the result of sorting the record strings of the third set in descending order is obtained by the leftward transfer of (5).

本例に示すように、比較転送回路10に識別子を付与し
てレコードを入力することによって、左右いずれかの端
子からソート結果を出力する操作と、次のソート対象レ
コードの入力操作を並列に行うことが可能となる。
As shown in this example, by assigning an identifier to the comparison and transfer circuit 10 and inputting the record, the operation of outputting the sort result from either the left or right terminal and the operation of inputting the next record to be sorted are performed in parallel. becomes possible.

第5図は、第1図に示した双方向ソート処理装置を用い
て、3組のレコード列を全て降順にソートする場合の例
である。本例は、比較転送回路10の両端に設けたビッ
ト反転回路12のうち、左側が非反転動作、右側が反転
動作の場合である。
FIG. 5 shows an example in which all three sets of record strings are sorted in descending order using the bidirectional sort processing device shown in FIG. In this example, of the bit inverting circuits 12 provided at both ends of the comparison and transfer circuit 10, the left side performs a non-inverting operation and the right side performs an inverting operation.

また、第5図では、比較転送回路1.0と右側のビット
反転回路12のみを模式的に示している。ソート対象と
するレコード列は、第4図の説明の場合と同じであり、
“5,3,2,9,1.7”;”6,4,8,2,7.
3” ; “4,3,8,4゜2.6”の3組である。
Further, in FIG. 5, only the comparison transfer circuit 1.0 and the bit inversion circuit 12 on the right side are schematically shown. The record columns to be sorted are the same as in the explanation of Figure 4,
“5, 3, 2, 9, 1.7”; “6, 4, 8, 2, 7.
3”; There are three sets: “4, 3, 8, 4°2.6”.

本例では、ビット反転回路12を制御することによって
、第4図の場合とはゾ同様の動作で、全てのレコード列
を降順にソートすることができる。
In this example, by controlling the bit inverting circuit 12, all the record strings can be sorted in descending order with the same operation as in the case of FIG.

(1)初期状態(’[”O):  比較転送回路10は
、第4図と同様に各ユニツ1−6で2個のレコードのう
ち小さいレコードを右方向に転送し、大きいレコードを
左方向に転送するように設定する。初期設定も同様に、
各ユニット6のメモリA 、1とメ干りB2をともにA
 、1 ] 0とする。
(1) Initial state ('[”O): Similar to FIG. 4, the comparison transfer circuit 10 transfers the smaller record of the two records to the right in each unit 1-6, and transfers the larger record to the left. Set to transfer to.Same as the initial settings,
Memory A, 1 and memory B2 of each unit 6 are both A
, 1 ] is set to 0.

(2)右方向転送(Tl〜T6):  第1組の6個の
レニー ドに、左方向からの入力であることを示す識別
子II 1. ITを付与して、比較転送回路10の左
端から入力する。左方向からの入力では、ビット反転回
路12は非反転状態であり、入力レコードがそのま賢比
較転送回路1,0の入力となる。第1組のレコード列の
入力が完了した状態が1゛6である。
(2) Rightward transfer (Tl to T6): Identifier II indicating that the input is from the left to the first set of six Renids 1. IT is given and inputted from the left end of the comparison and transfer circuit 10. When input from the left, the bit inverting circuit 12 is in a non-inverting state, and the input record becomes the input to the wise comparison and transfer circuits 1 and 0 as is. The state in which input of the first set of record strings is completed is 1-6.

(3)左方向転送(T7〜T12):  第2組の6個
のレコードに、右方向からの入力であることを示す識別
子II OITを付与して、比較転送回路10の右端か
ら入力する。1右方向からの入力では、ビット反転回路
12によって入力レコードは反転した状態で比較転送回
路10に入力する。この操作で、比較転送回路10の左
端から第1組のレコード列を降順にソートして順次出力
し、右端からは第2組のレコード列を順次入力する。
(3) Leftward transfer (T7 to T12): The six records of the second set are given an identifier II OIT indicating that they are input from the right, and are input from the right end of the comparison and transfer circuit 10. 1 When input from the right direction, the input record is inverted by the bit inversion circuit 12 and input to the comparison and transfer circuit 10 . With this operation, the first set of record strings are sorted in descending order from the left end of the comparison and transfer circuit 10 and are sequentially output, and the second set of record strings are sequentially input from the right end.

(4)右方向転送(1”13〜T18):  (3)に
示した左h゛向が完rした段階で、今度は右方向に転送
する。第3組の6個のレコードに、左方向からの入力で
あることを示す識別子1111+を付与して、比較転送
回路10に入力する。左方向からの入力では、ビット反
転回路12は非反転状態であり、入力レコードはそのま
一比較転送回路IOに入力する。この操作で、比較転送
回路10の右端からは、ビット反転した第2組の1ノ=
1−ド列が昇順に出力される。この出力を再度ビット反
転して出力することによって、レコードの大小関係が逆
転して降順にソートされた結果が得られる。この出力と
並行して、左端から第73紹の17コ一ド列を順次入力
する。この時、左端から人力する第3絹のレコードは、
(2)の場合と同様に識別子LL i I+を付与して
入力する。
(4) Right direction transfer (1"13 to T18): When the left direction shown in (3) has been completed, this time it is transferred to the right direction. It is given an identifier 1111+ indicating that the input is from the left direction, and is input to the comparison and transfer circuit 10. When the input is from the left direction, the bit inversion circuit 12 is in a non-inversion state, and the input record is compared and transferred as it is. Input to the circuit IO. With this operation, from the right end of the comparison transfer circuit 10, the bit-inverted second set of 1 =
The 1-code string is output in ascending order. By inverting the bits of this output again and outputting it, the magnitude relationship of the records is reversed and a result is obtained in which the records are sorted in descending order. In parallel with this output, the 17-code string of the 73rd introduction is sequentially input from the left end. At this time, the third silk record, which is manually produced from the left end,
As in the case of (2), the identifier LL i I+ is assigned and input.

(5)左方向転送(T 19−T24)  :  (4
)の右方向転送が完了した段階で、今度は左方向に転送
する。この操作で、比較転送回路10の左端から第3組
のレコード列を降順にソートした順次出力する。
(5) Left direction transfer (T19-T24): (4
) has been transferred to the right, it is now transferred to the left. With this operation, the third set of record strings are sorted in descending order from the left end of the comparison and transfer circuit 10 and are sequentially output.

以上(1)から(5)に示した右方向転送と左方向転送
の繰り返しによって、(3)の左方向転送で第1組のレ
コード列を降順にソー1−した結果が得られ、(4)の
右方向転送で第2組のレコード列を降順にソートした結
果が得られ、(5)の左方向転送で第3組のレコード列
を降順にソートした結果が得られる。
By repeating the rightward transfer and leftward transfer shown in (1) to (5) above, the result of sorting the first set of record strings in descending order in the leftward transfer of (3) is obtained, and (4) The result of sorting the second set of record strings in descending order is obtained by the rightward transfer in ), and the result of sorting the third set of record strings in descending order is obtained by the leftward transfer of (5).

以上の説明では、第1図の比較転送回路10を構成する
ユニット6の動作として、右方向に小さいレコードを転
送し、左方向に大きい1ノコードを転送する場合の例を
示したが、比較転送回路10が、右方向に小さい1ノコ
ードを転送し、左jj向に大きいレコードを転送する様
に構成した場合にも、左端(右端)からの人力と右端(
左端)からの出力を並行して行う双方向ソー1〜が可能
である。その際、比較転送回路10の両端に設けたビッ
ト反転回路12を制御することによって、■順あるいは
降順のソート方向を設定できる。
In the above explanation, an example was shown in which the unit 6 constituting the comparison and transfer circuit 10 in FIG. 1 transfers a small record to the right and a large 1 code to the left. Even if the circuit 10 is configured to transfer a small 1-node code to the right and a large record to the left, the human power from the left end (right end) and the right end (
A bidirectional saw 1~ that performs output from the left end) in parallel is possible. At this time, by controlling the bit inverting circuits 12 provided at both ends of the comparison and transfer circuit 10, the sorting direction of {circle around (2)} order or descending order can be set.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明のソーl−処理装置は、複
数の比較転送ユニットの1次元アレイ構造の比較転送回
路、及び識別子付与回路とビット反転回路からなり、ソ
ー1一対象レコードに識別rを付与して比較転送回路に
入力することによ−〕で、比較転送回路の転送操作と同
期して、レコードの入力とソート結果の出力を並列に行
うことができる。さらに、ビット反転回路を制御しなが
らソート対象レコードの入出力を行うことによって、ソ
ート処理を連続に、かつ連続するソート処理の昇順/降
順を任意に設定できる。これにより、本ソート処理装置
を繰り返して使用して大獣なレコードをソートする場合
には、従来のソー1へ処理装置と比較して実効的な稼働
率を約2倍向上できる利点がある。
As explained above, the source processing device of the present invention includes a comparison and transfer circuit having a one-dimensional array structure of a plurality of comparison and transfer units, an identifier assigning circuit, and a bit inverting circuit. By adding and inputting it to the comparison and transfer circuit, record input and sort result output can be performed in parallel in synchronization with the transfer operation of the comparison and transfer circuit. Furthermore, by inputting and outputting records to be sorted while controlling the bit inversion circuit, the sorting process can be performed continuously, and the ascending/descending order of the successive sorting processes can be arbitrarily set. As a result, when this sorting processing device is used repeatedly to sort large records, there is an advantage that the effective operating rate can be improved approximately twice as compared to the conventional saw 1 processing device.

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

第1図は本発明の一実施例であるソー1−処理装置の構
成図、第2図は第1−図に示した識別手付Lj回路の構
成と動作を説明する図、第3 tq l:1第1図に示
したビット反転回路の構成と動作製説明する図、第4図
および第5図は第1図に示したソー用−処理装置の動作
説明図、第6図は従来のソー1〜処理装置の構成図、第
7図は第6図に示した従来のソー1〜処理装置の動作原
理図である。 1・・・第1のメモリ、 2・・・第2のメモリ、3・
・比較器、 4・・フラグレジスタ、5・・・入出力回
路、  6・・・ユニツ1−17・・・切替回路、8・
・・レジスタA、9・・・レジスタB、  10・・・
比較転送回路、11・・識別子付与回路、  12・・
ビット反転回路。 (’) −−−−J 第3図 い) トドトド   ト   ト 〜    の    寸   1    ト   へt
tfll! h    p    t−t−t−ト)−ノ7ラク″″
[ジズタ4 ″′才2〆七ジ2
FIG. 1 is a block diagram of a saw 1-processing device which is an embodiment of the present invention, FIG. 2 is a diagram illustrating the configuration and operation of the identification hand Lj circuit shown in FIG. 1, and 3rd tq l: 1 A diagram explaining the configuration and operation of the bit inverting circuit shown in FIG. 1, FIGS. 4 and 5 are diagrams explaining the operation of the saw processing device shown in FIG. 1, and FIG. FIG. 7 is a diagram showing the operating principle of the conventional saw 1 through the processing device shown in FIG. 1... first memory, 2... second memory, 3...
- Comparator, 4... Flag register, 5... Input/output circuit, 6... Units 1-17... Switching circuit, 8...
...Register A, 9...Register B, 10...
Comparison transfer circuit, 11...Identifier assignment circuit, 12...
Bit inversion circuit. (') ----J Figure 3) Dimensions of 1.
tfll! h p t-t-t-to)-ノ7rak''''
[Jizuta 4 ″′sai 2〆nanji 2

Claims (2)

【特許請求の範囲】[Claims] (1)2個のデータを保持するメモリと、該メモリに保
持されたデータ間の大小関係を判定する比較器と、該比
較器による大小関係にもとづいて、該2個のデータのい
ずれか一方を転送するための転送回路とを少なくとも有
する比較転送ユニットの1次元アレイからなり、該1次
元アレイの一端からデータを入力して並べ換え、該並べ
換えを行ったデータを該1次元アレイの一方の端から出
力するソート処理装置において、前記1次元アレイにデ
ータを入出力する際に、前記比較転送ユニットの最左端
あるいは最右端のいずれの側から入力したデータである
かを識別するための識別子をデータに付与する識別子付
与手段を設け、該識別子付与手段によって識別子を付与
して、前記比較転送ユニットの最左端あるいは最右端の
いずれか一方からデータを入力することにより、連続す
るソート処理の出力操作と入力操作を重畳して処理でき
るように構成したことを特徴とするソート処理装置。
(1) A memory that holds two pieces of data, a comparator that determines the magnitude relationship between the data held in the memory, and one of the two pieces of data based on the size relationship determined by the comparator. data is input from one end of the one-dimensional array and rearranged, and the rearranged data is transferred to one end of the one-dimensional array. When inputting and outputting data to the one-dimensional array, the sorting processing device that outputs data from An identifier assigning means is provided, and the identifier assigning means assigns an identifier, and by inputting data from either the leftmost end or the rightmost end of the comparison transfer unit, continuous sorting processing output operations and A sorting processing device characterized in that it is configured to be able to process input operations in a superimposed manner.
(2)特許請求の範囲第1項記載のソート処理装置にお
いて、さらに2値表示されたソート対象データの各々の
ビットを反転あるいは非反転とするビット反転手段を設
け、前記識別子付与手段によって識別子を付与すると共
に、該ビット反転手段を制御してソート対象データのビ
ットを反転して1次元アレイにソート対象データを入出
力することにより、連続するソート処理間でソート方向
を昇順あるいは降順に独立に設定できるように構成した
ことを特徴とするソート処理装置。
(2) The sorting device according to claim 1 further includes bit inverting means for inverting or non-inverting each bit of the data to be sorted that is displayed in binary values, and the identifier assigning means is used to assign an identifier to the sorting device. At the same time, by controlling the bit inverting means to invert the bits of the data to be sorted and input/output the data to be sorted to a one-dimensional array, the sorting direction can be independently set in ascending or descending order between successive sorting processes. A sorting processing device characterized in that it is configured to be configurable.
JP21890385A 1985-10-01 1985-10-01 Sorting processor Pending JPS6278627A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21890385A JPS6278627A (en) 1985-10-01 1985-10-01 Sorting processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21890385A JPS6278627A (en) 1985-10-01 1985-10-01 Sorting processor

Publications (1)

Publication Number Publication Date
JPS6278627A true JPS6278627A (en) 1987-04-10

Family

ID=16727117

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21890385A Pending JPS6278627A (en) 1985-10-01 1985-10-01 Sorting processor

Country Status (1)

Country Link
JP (1) JPS6278627A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02308325A (en) * 1989-05-24 1990-12-21 Fujitsu Ltd Tag tournament sort processing method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59123048A (en) * 1982-12-28 1984-07-16 Toshiba Corp Sorting processor
JPS59153239A (en) * 1983-02-18 1984-09-01 インタ−ナシヨナル ビジネス マシ−ンズ コ−ポレ−シヨン Sorter

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59123048A (en) * 1982-12-28 1984-07-16 Toshiba Corp Sorting processor
JPS59153239A (en) * 1983-02-18 1984-09-01 インタ−ナシヨナル ビジネス マシ−ンズ コ−ポレ−シヨン Sorter

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02308325A (en) * 1989-05-24 1990-12-21 Fujitsu Ltd Tag tournament sort processing method

Similar Documents

Publication Publication Date Title
US6728743B2 (en) Modulo remainder generator
KR0125623B1 (en) Data processor and data processing method
EP0361525B1 (en) Single chip microcomputer
US7350054B2 (en) Processor having array of processing elements whose individual operations and mutual connections are variable
US5268856A (en) Bit serial floating point parallel processing system and method
WO2003048924A1 (en) Galois field linear transformer
Lipu et al. Exploiting parallelism for faster implementation of Bubble sort algorithm using FPGA
JPH0216619B2 (en)
Yang Design of fast connected components hardware
JP3196637B2 (en) Sort processor and sort processing device
JPS6278627A (en) Sorting processor
JPS6142031A (en) Sorting processor
US5192882A (en) Synchronization circuit for parallel processing
US5572198A (en) Method and apparatus for routing in reduced switch matrices to provide one hundred percent coverage
CN1180427A (en) System for performing arithmetic operations with single or double precision
US3571580A (en) Device for determining least significant {37 one{38 {0 in a binary word
JPH01220528A (en) Parity generator
CN110647665A (en) Super-parallel comparison method and system
JPS6237739A (en) Sorting processor
JPS59123048A (en) Sorting processor
JP2564881B2 (en) Bit string comparison method
EP0208458A2 (en) A data stack for data processors
JPH02230320A (en) Data processor
JPS63231526A (en) Sort processor
JPS62257536A (en) Data flow processor