JPS6054043A - Sort processor - Google Patents

Sort processor

Info

Publication number
JPS6054043A
JPS6054043A JP16114083A JP16114083A JPS6054043A JP S6054043 A JPS6054043 A JP S6054043A JP 16114083 A JP16114083 A JP 16114083A JP 16114083 A JP16114083 A JP 16114083A JP S6054043 A JPS6054043 A JP S6054043A
Authority
JP
Japan
Prior art keywords
register
data
sorting
circuit
processing
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
JP16114083A
Other languages
Japanese (ja)
Inventor
Shigeaki Okuya
茂明 奥谷
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP16114083A priority Critical patent/JPS6054043A/en
Publication of JPS6054043A publication Critical patent/JPS6054043A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/22Arrangements for sorting or merging computer data on continuous record carriers, e.g. tape, drum, disc
    • G06F7/24Sorting, i.e. extracting data from one or more carriers, rearranging the data in numerical or other ordered sequence, and rerecording the sorted data on the original carrier or on a different carrier or set of carriers sorting methods in general

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Complex Calculations (AREA)

Abstract

PURPOSE:To perform the processing in a high speed by constituting a sort processing into a private hardware which makes a pipeline processing possible. CONSTITUTION:Element data (b) inputted to an S1 register 13 of a sort circuit 8 and element data (a) set beforehand in an S2 register 15 are compared with each other by a comparator 16. If the comparison result is (a)>(b) in case of sorting in the ascending order, data (b) is sent to an S3 register 18, and data (a) is returend to the S2 register again, and data are transposed. If the comparison result is (a)<=(b), it is judged that data (a) and (b) are arranged in the ascending order, and data (b) is sent to the S2 register 15, and data (a) is fed to the S3 register 18, and the comparator 16 leaves always larger data in the S2 register 15 and transfers smaller data to the S3 register to feed it to a vector register VR3. Consequently, when four element data in a vector register VR0 are allowed to pass the sort circuit 8, element data having a maximum value is transmitted last and is stored in a rightmost stage 10-3 of a vector register VR3.

Description

【発明の詳細な説明】 〔発明の技術分野〕 本発明は、データ処理装置に設けられるソート処理器に
関し、特にパイプライン処理可能なハードウェア構成の
高速ソート処理器に関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field of the Invention] The present invention relates to a sorting processor provided in a data processing device, and particularly to a high-speed sorting processor having a hardware configuration capable of pipeline processing.

〔技術の背景〕[Technology background]

複数のデータを降順あるいは昇順に並べかえるいわゆる
ソート処理は、従来ソフトウェアで行なわれていた。ソ
ート手法にはいくつかの種類があり、その1例として、
本発明と関連する隣接交換ソート・法について説明する
So-called sorting processing, which arranges multiple pieces of data in descending or ascending order, has conventionally been performed using software. There are several types of sorting methods; one example is
A neighbor exchange sorting method related to the present invention will be described.

第1図はソートされるデータの1例であシ、レコード1
乃至4のそれぞれにある4個のデータDATAI乃至4
が、それぞれのデータに含まれているキーKEYI乃至
4にしたがってソートされるものとする。図示の例では
、KEY 1乃至4のそれぞれの値は、4.3.1.2
であり、これを昇順にソートい1.2.3.4の順にデ
ータを並べ替える処理が行なわれる。
Figure 1 is an example of sorted data, record 1
4 pieces of data in each of DATAI to 4
are sorted according to keys KEYI to 4 included in each data. In the illustrated example, each value of KEY 1 to 4 is 4.3.1.2
The data is sorted in ascending order and the data is rearranged in the order of 1.2.3.4.

なお、説明の便宜上、KEY”α〃の内容(値)亀β〃
を〔β〕αのように表わす。したがって、第1図に示す
データ群の場合、キーは、印1、凹2、l:L13、I
214 と聚わされる・■ まず、KEYIとKEY2
の内容を読み出し、比較して、昇順に並んでいる場合は
そのまま、そして昇順に並んでいない場合は相互を入れ
替える。
For convenience of explanation, the content (value) of KEY”α〃
is expressed as [β]α. Therefore, in the case of the data group shown in FIG. 1, the keys are mark 1, depression 2, l:L13, I
214 ・■ First, KEYI and KEY2
Read the contents of , compare them, and if they are arranged in ascending order, leave them as they are, and if they are not arranged in ascending order, exchange them.

■ KEY 1とKEY3について、■と同様に処理す
る。
■ For KEY 1 and KEY 3, process in the same way as ■.

I8、(イ)l 、l’:’D8、(2)。I8, (a) l , l':'D8, (2).

2≦ o、、[11,、(4)5.1214 ■ KEYlとKEY4について、■と同様に処理する
2≦o, , [11,, (4) 5.1214 ■ Process in the same way as ■ for KEYl and KEY4.

■ 右端に最大のキー値が移送される。次に、残りの3
@のキーについて、同様に昇順に並べかえる。まず、K
EY2とに、 E Y 3について処理する。
■ The largest key value is transported to the right. Next, the remaining 3
Similarly, rearrange the @ keys in ascending order. First, K.
EY2 and EY3 are processed.

■ KEY2とKEY4について同様に処理する。■ Process KEY2 and KEY4 in the same way.

(xis 、ra+□、(2)、1印。(xis, ra+□, (2), 1 mark.

Dos 、 045C3b l O+ ■ 右端に2番目に大きいキー値が移送される。Dos, 045C3bl O+ ■ The second largest key value is moved to the right end.

次に残りの2つのキーについて、同様に昇順に並べかえ
る。すなわち、KEY3と■ぐEY4について処理する
Next, the remaining two keys are rearranged in ascending order in the same way. That is, KEY3 and EY4 are processed.

山5、悶、1(3)2、(4)1 の ノート処理が完了し、4個のキーの昇順配夕1]〔
D3、(2)4、■4、(4)。
The note processing of Mountain 5, Agony, 1 (3) 2, (4) 1 is completed, and the ascending order of the 4 keys is 1]
D3, (2) 4, ■4, (4).

が得られ、そのキ一番号にしたがってデータあるいはレ
コードのソートされた配列がつくられる。
is obtained, and a sorted array of data or records is created according to the key number.

以上のソート処理においては、比較の回数が3+2+1
=6回となり、一般にはN個のデータについてN(N−
1)/2回の比較が必要になる。
In the above sorting process, the number of comparisons is 3+2+1
= 6 times, and generally N(N-
1)/2 comparisons are required.

さらに、1回の比較のために、従来の汎用計算機のプロ
グラムでは、 α、KEYのアドレス計算命令 り、KEYのロード命令 Cミ 比較命令 dl 比較結果に応じた処理を選択する分岐命令g、K
FiY交換のためのロード命令 f、繰り返しのための分岐命令 のように、多数の命令を必要とし、そのために処理時間
が多くかかるという問題があった。
Furthermore, for one comparison, in a conventional general-purpose computer program, α, KEY address calculation instruction, KEY load instruction Cmi, comparison instruction dl, branching instruction g, K to select processing according to the comparison result.
There is a problem in that a large number of instructions are required, such as a load instruction f for FiY exchange and a branch instruction for repetition, and therefore a large amount of processing time is required.

特に、たとえば商業関係などのデータ処理では、ソート
処理のウェイトが大きいため、その高速処理化が強く望
まれている。
In particular, in data processing for commercial purposes, etc., the weight of sorting processing is large, so there is a strong desire for faster processing.

〔発明の目的および構成〕[Object and structure of the invention]

本発明の目的は、従来、ソフトウェアによって行なわれ
ていたソート処理を専用ハードウェア化することにより
、処理の高速化を図ることにあり、そのための構成は、
第1、第2、第3の各l/レジスタ、第1のレジスタヘ
ソートすべきデータ配列中のデータ又はデータとその番
号を順次入力させる手段と、第1のレジスタへデータが
入力されるたびに第1のレジスタと第2のレジスタの定
められた部分の内容を比較する比較回路と、比較結果が
予め定められた第1または第2の値のいずれであるかに
より、第1の値の場合には、第1のレジスタ中のデータ
を第2の17ジスタヘ移しかつ第2のレジスタ中にあっ
た以前のデータを第3のレジスタへ移し、他方上記第2
の値の場合には、第1のレジスタ中のデータを第3のレ
ジスタへ移シかつ第2のレジスタ中にあった以前のデー
タはそのまま保持する手段と、第3のレジスタからデー
タを順次出力させる手段とからなるノート回路と、該ノ
ート回路から得られる出力データ配列中に未ノート部分
が含まれているか否かを検出し、未ソート部分が含まれ
ていることが検出された場合に、該出力データ配列を上
記ソート回路へ繰り返し入力させる手段とを有すること
を特徴としている。
An object of the present invention is to speed up the processing by converting the sorting process that was conventionally performed by software into dedicated hardware, and the configuration for this purpose is as follows:
means for sequentially inputting data in a data array to be sorted or data and its number into each of the first, second and third l/registers, and each time data is inputted into the first register; a comparison circuit that compares the contents of predetermined parts of the first register and the second register; If the data in the first register is moved to the second 17 register and the previous data in the second register is moved to the third register, while the second
In the case of a value of detecting whether an unsorted portion is included in the output data array obtained from the note circuit; and when it is detected that an unsorted portion is included; The present invention is characterized by comprising means for repeatedly inputting the output data array to the sorting circuit.

〔発明の実施例〕[Embodiments of the invention]

以下に、本発明の詳細を実施例にしたがって説明する。 The details of the present invention will be explained below based on examples.

第2図は、本発明の1実施例システムの構成図である。FIG. 2 is a configuration diagram of a system according to an embodiment of the present invention.

図中、1け主記憶装置、2はバッファ記憶装置、3けス
カシ・レジスタ、4はスカシ演算器、5はチャネル、6
はベクトル・レジスタ、7けソート処理器を示す。
In the figure, 1 digit main memory, 2 buffer storage, 3 digit spacing register, 4 digit spacing operation unit, 5 channel, 6
indicates a vector register and a 7-digit sort processor.

1乃至5は従来の汎用計算機の構成要素であり点線ブロ
ック内の要素6.7が本発明による付加部分である。ま
た、ベクトル処理装置に付加する場合には、パイプライ
ン型ベクトル演算器に並列に設けられる。
1 to 5 are components of a conventional general-purpose computer, and elements 6 and 7 in the dotted line block are added parts according to the present invention. Furthermore, when added to a vector processing device, it is provided in parallel to a pipelined vector arithmetic unit.

第3図は本実施例で使用されるソート命令の構成を示し
たものである。4バイト長命令であるが、第4バイトは
使用されない。OPは命令コード部、R・1は出力オペ
ランド・レジスタ番号、R21d:入力オペランド・l
/レジスタ番号表わす。
FIG. 3 shows the structure of the sort command used in this embodiment. Although it is a 4-byte long instruction, the 4th byte is not used. OP is the instruction code section, R・1 is the output operand register number, R21d: input operand・l
/Represents register number.

第4図は、ソート処理器の1実施例回路図である。図中
、6はベクトル・レジスタ、7はソート処理器、8はソ
ート回路、9はソート終了検出回路を示す。
FIG. 4 is a circuit diagram of one embodiment of the sorting processor. In the figure, 6 is a vector register, 7 is a sorting processor, 8 is a sorting circuit, and 9 is a sorting completion detection circuit.

ベクトル・レジスタ6は、V B、 OlV B、 i
、V B、 2、VR・3 で示す4(固の要素ベクト
ルレジスタと、入力I/レジスタ1、出力レジスタ12
で構成される。
Vector register 6 contains V B, OlV B, i
, V B, 2, 4 (fixed element vector register, input I/register 1, output register 12)
Consists of.

ベクトルレジスタV B、 0 乃至V El、 3 
のそれぞれはN段からなり、N1固の要素データあるい
はキーを格納することができるが、ここでは、説明を簡
単化スるため、N=4の場合について、4つの段10−
0.10−1.10−2.1o−3を示す。
Vector registers V B, 0 to V El, 3
each consists of N stages and can store N1-specific element data or keys, but here, to simplify the explanation, in the case of N=4, four stages 10-
0.10-1.10-2.1o-3.

ソート処理器7は、Sルジスタ13、セレクタ14、S
21/ジスタ]5、比較回路16、セレクタ17、S3
レジスタ18、S4レジスタ19、比較回路20、フラ
グ・ラッチ2Jで構成される。
The sort processor 7 includes an S register 13, a selector 14, an S
21/Jister] 5, comparison circuit 16, selector 17, S3
It is composed of a register 18, an S4 register 19, a comparison circuit 20, and a flag latch 2J.

次に、回路動作について述べる。Next, the circuit operation will be described.

第2図に示したソート命令が、入力オペランド参しジス
クR2としてベクトルレジスタVFI、0 全指定し、
出力オペランド・レジスタ■(,1としてベクトルレジ
スタVR・3を指定しているものとする。
The sort instruction shown in FIG. 2 specifies all vector registers VFI and 0 as input operand disk R2,
It is assumed that the vector register VR.3 is specified as the output operand register (, 1).

この1つのソート命令により、VROの4つの段10−
0乃至10−3から、4個の要素データが11i次読み
出され、出力レジスタ12を介してソート処理器7へ供
給される。ノート処理器7は)くイブライン形式でソー
ト処理を行ない、処理結果の4個の要素データを順次出
力する。これらの要素データは、入力レジスタ111F
r:介して、ベクトル−レジスタV It 3 の4つ
の段10−0乃至10−3へ順次書き込まれる。
This one sort instruction causes the four stages 10-
Four element data from 0 to 10-3 are read out in the 11th order and are supplied to the sorting processor 7 via the output register 12. The note processor 7 performs a sorting process in a square format, and sequentially outputs the four element data as a result of the processing. These element data are input to the input register 111F.
r: are sequentially written into the four stages 10-0 to 10-3 of the vector register V It 3 through the vector register V It 3 .

ソート回路8の動作は、次のように行なわれる。The sorting circuit 8 operates as follows.

Sルジスタ13に入力された9素データゝb″と、S2
レジスタ15にある以前の要素データNα〃とは、比較
回路16にνいて比較される。セレクタ14および17
は、比較回路16の比較結果により制御される。なお、
ここでは昇順ソートが行なわれるものとする。
The 9-element data "b" input to the S register 13 and the S2
The previous element data Nα in the register 15 is compared with the previous element data Nα in the comparison circuit 16. Selectors 14 and 17
is controlled by the comparison result of the comparison circuit 16. In addition,
Here, it is assumed that ascending order sorting is performed.

比較結果がα〉bの場合には、α、bが昇順配列に反し
ていることを示しているので、Sルジスタ13中のNb
1l はS3レジスタ18へ送られ、S2レジスタ15
中のXXα〃は再びS2レジスタ15へ戻される。すな
わち、順序を入れ替える交換処理が行なわれる。他方、
比較結果がαくbの場合には、α、bが昇順配列になっ
ていることを示しているので、Sルジスタ13中の%t
 /、 # ij 82レジスタ15へ移され、S2レ
ジスタ15にあつi SSα77 ハS3レジスタ18
へ順に送らレル。
If the comparison result is α>b, it means that α and b are against the ascending order arrangement, so Nb in the S register 13
1l is sent to S3 register 18, and S2 register 15
XXα〃 inside is returned to the S2 register 15 again. That is, an exchange process for changing the order is performed. On the other hand,
If the comparison result is α less b, it means that α and b are arranged in ascending order, so %t in the S register 13
/, # ij Moved to 82 register 15 and placed in S2 register 15 i SSα77 Ha S3 register 18
Send in order to Rel.

このように、比較回路16は、Sルジスタ13と82レ
ジスタ15の内容を比較して、常に大きい方を82レジ
スタ15に残し、小さい方はS3レジスタへ移して、ベ
クトル・レジスタVR3へ送出される。したがって、ベ
クトル・レジスタVR・0にある4個の要素データをノ
ート回路8へ通したとき、最大の値をもつ要素データが
最後に送出される。この最大の値をもつ要素データは、
ベクトル・レジスタVR,3の最右段10−3に格納さ
れる。
In this way, the comparison circuit 16 compares the contents of the S register 13 and the 82 register 15, and always leaves the larger one in the 82 register 15, moves the smaller one to the S3 register, and sends it to the vector register VR3. . Therefore, when the four element data in the vector register VR.0 are passed to the note circuit 8, the element data with the largest value is sent out last. The element data with this maximum value is
It is stored in the rightmost stage 10-3 of vector register VR,3.

次に、入力オペランド・レジスタI(2としてV f(
、3を指定し、たとえばV丁(・0を出力オペランド・
1/ジスタR1とするソート命令を実行する。
Then input operand register I(2 as V f(
, 3 and, for example, specify V (・0 as the output operand・
1/Execute the sort command to register R1.

これにより、2番目に大きい要素データを確定すること
ができる。
Thereby, the second largest element data can be determined.

次に、入力オペランド・レジスタR2としてVROe指
定し、出力オペランド・レジスタR1としてV )l、
 3を指定するソート命令を実行する。
Next, specify VROe as the input operand register R2, and specify VROe as the output operand register R1.
Execute a sort command that specifies 3.

これにより、残りの2個の要素データの配列を確定する
ことができる。
This allows the arrangement of the remaining two element data to be determined.

以上のように、ノートすべき4個の要素データを、繰り
返して3回、ノート回路8を通すことにより、完全なソ
ート処理が行なわれる。ソートの終了は、後述される。
As described above, complete sorting processing is performed by repeatedly passing the four element data to be noted through the note circuit 8 three times. The end of sorting will be described later.

ソート終了検出回路9を用いて制御される。It is controlled using a sort completion detection circuit 9.

第5図(α)、(b)、(c)は、ノートすべき4個の
要素データを従来例の説明で用いたキー印1 、I!1
2.0]3、■4 とした場合のソート回路の動作例を
示したものである。
FIGS. 5(α), (b), and (c) show four element data to be noted, key marks 1, I!, used in the explanation of the conventional example. 1
2.0]3, ■4 An example of the operation of the sorting circuit is shown.

第5図(a)は第1回目のソート処理、同図(b)は第
2回目のソート処理、同図(c)は第3回目のソート処
S2、S3の各レジスタの内容全光ゎしている。
FIG. 5(a) shows the first sorting process, FIG. 5(b) shows the second sorting process, and FIG. 5(c) shows the contents of each register in the third sorting process S2 and S3. are doing.

なお、最初と最後のキーに対して比較回路16を正しく
機能させるため、データの前には定数co−が、またデ
ータの後には定数69”がハードウェアにより設定され
る。
In order to make the comparison circuit 16 function correctly for the first and last keys, a constant co- is set before the data, and a constant 69'' is set after the data by hardware.

第5図(a) K示す第1回目のソート処理では、最大
のキー(4)、が最初にs31/ジスタがら出力され、
同図(b)の第2回目のソート処理では、2番目に大き
いキー■2が、最大のキー印、の次に83レジスタから
出方され、同図(c)の第3回目のノート処理では、3
番目に大きいキー1214が、キー(4)1、(:(1
2の次に83レジスタから出力される。すなわち、3回
の処理でソートが完了する。
In the first sorting process shown in FIG.
In the second sorting process shown in (b) of the same figure, the second largest key 2 is output from the 83rd register after the largest key mark, and in the third note processing shown in (c) of the same figure, So, 3
The largest key 1214 is key (4) 1, (:(1
After 2, it is output from register 83. In other words, sorting is completed in three processes.

一般に、N個のキーのソートの場合、N−1回ソート処
理を繰り返せばソートが完了する。しかし、第5図(b
)に例示されているように、もとのキー配列の一部ある
いは全部が既に昇順配列となっている場合には、N−1
回以下(第5図の例では2回)の処理でソートが完了す
る。
Generally, in the case of sorting N keys, sorting is completed by repeating the sorting process N-1 times. However, Fig. 5 (b
), if part or all of the original keyboard layout is already in ascending order, N-1
Sorting is completed in less than 1 times (2 times in the example of FIG. 5).

第4図におけるソート終了検出回路9は、上記のよう彦
ソートが早期に完了する場合にもこれを検出して、その
後の処理を停止し、処理時間の短縮する機能をもつ回路
である。この回路は、ソート回路8の83レジスタ18
から出力される要素データが全て昇順配列になっている
か否かを検出する。
The sort completion detection circuit 9 in FIG. 4 has a function of detecting the early completion of the Hiko sort as described above, and stopping the subsequent processing to shorten the processing time. This circuit consists of 83 registers 18 of sort circuit 8.
Detects whether all element data output from is arranged in ascending order.

S3レジスタ18から出力される要素データは順次S4
レジスタ19に格納される。比較回路20は、S4レジ
スタ19の内容六C〃と、次のステップで83レジスタ
J8から出力される要素データ5(dN とを比較し、
c’>clの場合、すなわち昇順でない配列の場合にフ
ラグ・ラッチ21をリセットする。フラグ・ラッチ21
は、繰り返しのはじめの初期設定で’ON/I 状態に
され、比較回路20によりリセットされない限り、ON
状態を保つ。
The element data output from the S3 register 18 is sequentially sent to the S4
It is stored in register 19. The comparison circuit 20 compares the content 6C of the S4 register 19 with the element data 5 (dN) output from the 83rd register J8 in the next step,
If c'>cl, that is, if the array is not in ascending order, the flag latch 21 is reset. Flag latch 21
is set to the 'ON/I' state by initial setting at the beginning of the repetition, and remains ON unless reset by the comparator circuit 20.
maintain condition.

したがって、全ての要素データ間に昇順関係が確立され
たか否かは、このフラグ・ラッチ21の値を調べること
により判り、これにもとづいて次のソート処理を実行す
るか否かを制御することができる。
Therefore, whether or not an ascending order relationship has been established between all element data can be determined by checking the value of this flag latch 21, and based on this, it is possible to control whether or not to perform the next sorting process. can.

ノート処理の繰怜返し制御は、ソフトウェアにより、あ
るいはマイクロプログラム制御により行なわせることが
できる。捷た、たとえば最大のキーを2個だけめるとい
うよう力処理の場合には、2回のソート処理で終了させ
るようにすることも可能である。
Iterative control of note processing can be performed by software or microprogram control. In the case of forced processing, such as selecting only the two largest keys, it is also possible to complete the sorting process twice.

なお、上述した例は、要素データあるいはキーによりノ
ートし、ノートした結果を要素データあるいはキーで出
力するものであったが、キ一番号を付加して処理し、処
理結果をキ一番号で出力するように変更することも一容
易である。
In addition, in the above example, a note is made using element data or a key, and the result of the note is output as element data or a key. It is also easy to change it to do so.

たとえば第5図の例では、キ一番号配列3.4.2、■
が出力される。この場合には、3.4.2.10番号順
にレコードを配列する処理を行々えば、l/コードのソ
ートができる。
For example, in the example shown in Figure 5, the key number arrangement is 3.4.2, ■
is output. In this case, the l/codes can be sorted by arranging the records in 3.4.2.10 numerical order.

々お、降順ノートについても、比較回路の論理条件が逆
になるだけで、同様に構成することができる。
Furthermore, descending notes can be constructed in the same way, just by reversing the logical conditions of the comparator circuit.

第6図は、ソート処理を更に高速化するため、第4図に
示されているソート回路8を縦続接続して連続並列処理
化し、繰り返し処理を不要にしたソート処理器の実施例
構成図である。
FIG. 6 is a block diagram of an embodiment of a sorting processor in which the sorting circuits 8 shown in FIG. 4 are connected in cascade to perform continuous parallel processing to further speed up the sorting process, thereby eliminating the need for repeated processing. be.

図中、22.23.24が3つの縦続接続されたソート
回路を弄わす。
In the figure, 22, 23, and 24 operate on three cascaded sorting circuits.

ソート回路22は、811 レジスタ25、セレクタ2
6、S12レジスタ27、比較回路28、セレクタ29
.813レジスタ3oがラナリ、ソート回路23は、セ
レクタ31.822レジスタ32、比較回路33、セレ
クタ34.823レジスタ35からなり、ソート回路2
4は、セレクタ36.832 レジスタ37、比較回路
38、セレクタ39.833 レジスタ40からなる。
The sorting circuit 22 includes 811 register 25, selector 2
6, S12 register 27, comparison circuit 28, selector 29
.. The sort circuit 23 consists of a selector 31, an 822 register 32, a comparison circuit 33, a selector 34, and an 823 register 35.
4 consists of selector 36,832 register 37, comparison circuit 38, selector 39,833 register 40.

また、レコード番号あるいはキ一番号(ID)発生用カ
ウンタ41が設けられている。
Further, a counter 41 for generating a record number or key number (ID) is provided.

々お、ソート回路23および24では、ソート回路22
における811 レジスタ25に相当するものが不要な
ため省略されている。
In the sorting circuits 23 and 24, the sorting circuit 22
The equivalent of register 25 in 811 is omitted because it is unnecessary.

各レジスタはキ一番号(ID)部とキ一部とを含み、こ
れらは一対となってレジスタ間を転送さり25に入力さ
れるとき、カウンタ41がら同時に供給される。
Each register includes a key number (ID) part and a key part, which are transferred as a pair between the registers and input to the counter 41 at the same time.

このような構成により、ソート回路220出カは、第4
図の例のようにベクトル・レジスタに一旦格納されるこ
となく、直ちにノート回路23において連続的に処理さ
れ、同様にソート回路23の出力は、ソート回路24に
より直ちに処理される。したがって、図示の回路では、
第7図に例示するように、4個のキーを1回通すだけで
パイプライン的に処理し、完全なソートを行なうことが
できる。
With this configuration, the output of the sorting circuit 220 is
As in the illustrated example, the data is not stored once in the vector register, but is immediately processed continuously in the note circuit 23, and similarly, the output of the sorting circuit 23 is immediately processed by the sorting circuit 24. Therefore, in the circuit shown,
As illustrated in FIG. 7, it is possible to perform pipeline processing and complete sorting by passing four keys only once.

N個のキーを1回の処理でノートするには、ノート回路
f、N−1岡だけ縦続接続すればよい。一般的には、M
個のソート回路を縦続したとき、N個のキーに対して少
なくとも(N−1)/M回たけ処理を繰り返せば、ソー
トを完了させることができる。繰り返し制御は第6図に
は省略されているが、第4図におけるのと同様に、ソー
ト終了検出回路を用いて行なうことができる。
In order to note N keys in one process, only note circuits f and N-1 circuits need to be connected in cascade. Generally, M
When N sorting circuits are connected in series, sorting can be completed by repeating the process at least (N-1)/M times for N keys. Although the repetitive control is omitted in FIG. 6, it can be performed using the sort completion detection circuit as in FIG. 4.

本実施例では、キーに対して常にキ一番号(ID)を伴
って処理されるため、処理結果として、キーおよびキ一
番号の一方あるいは両方を適宜利用することができ、た
とえばキ一番号を用いてレコードのソートを行なうこと
が可能である。
In this embodiment, since the key is always processed with the key number (ID), one or both of the key and the key number can be used as appropriate as a processing result. It is possible to sort records using

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

以上述べたように、本発明によれば、ノート処理がパイ
プライン形式で実行できるため従来方式にくらべてプロ
グラムが簡単化でき、またソート対象データの個数が多
い場合に特に高速処理化を図ることができる。
As described above, according to the present invention, since note processing can be executed in a pipeline format, the program can be simplified compared to the conventional method, and the processing speed can be particularly increased when there is a large number of data to be sorted. I can do it.

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

第1図はソートされるデータの1例を示す図、第2図は
本発明の1実施例システムの構成図、第3図はソート命
令の構成図、第4図はソート処理器の1実施例回路図、
第5図はその動作説明図、第6図は他の実施例回路図、
第7図はその動作説明図である。 図中、6はベクトルレジスタ、7はソート処理器、8は
ノート回路、9はソート終了検出回路、13if: s
i レジスタ、J、4はセレクタ、15ハS2レジスタ
、16は比較回路、17はセレクタ、18はS3レジス
タ、19はS4レジスタ、2oは比較回路、21はフラ
グ・ラッチを示す。 特許出願人 富士通株式会社 代理人弁理士 長谷用 文 廣 (外1名)才 5 図 千 6 図 Sfl (4)+ (3)2 (1〕ヨ〔2〕4S12
 (4)+ (4:L (’O+SI3 (3)2 (
D3 322 (3〕2 23 32 3B 闇 〔4〕1 〔2漏〔4〕。 (3)2Ca):z C4〕+ m3〔桟(a〕2C4〕+ C1〕3 C2〕4(3)2[4]。 〔1〕3ρ4ツ喝
Fig. 1 is a diagram showing an example of data to be sorted, Fig. 2 is a block diagram of a system according to an embodiment of the present invention, Fig. 3 is a block diagram of a sort command, and Fig. 4 is a diagram showing one implementation of a sort processor. Example circuit diagram,
Fig. 5 is an explanatory diagram of its operation, Fig. 6 is a circuit diagram of another embodiment,
FIG. 7 is an explanatory diagram of the operation. In the figure, 6 is a vector register, 7 is a sort processor, 8 is a note circuit, 9 is a sort end detection circuit, 13if: s
i register, J, 4 is a selector, 15 is an S2 register, 16 is a comparison circuit, 17 is a selector, 18 is an S3 register, 19 is an S4 register, 2o is a comparison circuit, and 21 is a flag latch. Patent Applicant Fujitsu Ltd. Representative Patent Attorney Fumihiro Hase (1 other person) 5 Figure 1000 6 Figure Sfl (4) + (3) 2 (1) Yo [2] 4S12
(4)+ (4:L ('O+SI3 (3)2 (
D3 322 (3) 2 23 32 3B Darkness [4] 1 [2 leak [4]. (3) 2Ca):z C4] + m3 [Beam (a] 2C4] + C1] 3 C2] 4 (3) 2 [4]. [1] 3ρ4 exclamation

Claims (2)

【特許請求の範囲】[Claims] (1) 第1、第2、第3の各レジスタと、第1のレジ
スタヘソートすべきデータ配列中ノテー ! 又は、デ
ータとその番号を順次入力させる手段と、第1のレジス
タヘデータが入力されるたびに第1のレジスタと第2の
レジスタの定められた部分の内容な比較する比較回路と
、比較結果が予め定められた第1または第2の値のいず
れであるかにより、第1の値の場合には、第1のレジス
タ中のデータを第2のレジスタへ移しかつ第2のレジス
タ中にあった以前のデータを第3の17ジスタヘ移し、
他方上記第2の値の場合には、第1のレジスタ中のデー
タを第3のレジスタへ移しかつ第2のレジスタ中にあっ
た以前のデータはそのまま保持する手段と、第3のレジ
スタからデータを順次出力させる手段とからなるソート
回路と、該ソート回路から得られる出力データ配列中に
未ソート部分が含まれているか否かを検出し、未ノート
部分が含まれていることが検出された場合に、該出力デ
ータ配列を上記ソート回路へ繰り返し入力させる手段と
を有することを特徴とするソート処理器。
(1) Notes on the first, second, and third registers and the data array to be sorted into the first register! Alternatively, means for sequentially inputting data and their numbers, a comparison circuit that compares the contents of predetermined portions of the first register and the second register each time data is input to the first register, and a comparison result. is a predetermined first or second value; if it is the first value, the data in the first register is moved to the second register; Move the previous data to the third 17th register,
On the other hand, in the case of the second value, there is provided means for moving the data in the first register to the third register and retaining the previous data in the second register; a sorting circuit comprising a means for sequentially outputting data, and detecting whether or not an unsorted portion is included in the output data array obtained from the sorting circuit, and it is detected that an unnote portion is included. and means for repeatedly inputting the output data array to the sorting circuit.
(2) 前記第1項記載のソート処理器において、ソー
ト回路が複数個縦続接続されていることを特徴とするソ
ート処理器。
(2) The sorting processor according to item 1, characterized in that a plurality of sorting circuits are connected in cascade.
JP16114083A 1983-09-01 1983-09-01 Sort processor Pending JPS6054043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16114083A JPS6054043A (en) 1983-09-01 1983-09-01 Sort processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16114083A JPS6054043A (en) 1983-09-01 1983-09-01 Sort processor

Publications (1)

Publication Number Publication Date
JPS6054043A true JPS6054043A (en) 1985-03-28

Family

ID=15729350

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16114083A Pending JPS6054043A (en) 1983-09-01 1983-09-01 Sort processor

Country Status (1)

Country Link
JP (1) JPS6054043A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0271327A (en) * 1988-09-06 1990-03-09 Nec Corp Sorting processor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0271327A (en) * 1988-09-06 1990-03-09 Nec Corp Sorting processor

Similar Documents

Publication Publication Date Title
US5349684A (en) Sort and merge system using tags associated with the current records being sorted to lookahead and determine the next record to be sorted
Falkoff Algorithms for parallel-search memories
US4053871A (en) Method and system for the iterative and simultaneous comparison of data with a group of reference data items
JP2790466B2 (en) Character string search method and apparatus
US5379420A (en) High-speed data searching apparatus and method capable of operation in retrospective and dissemination modes
US10372451B2 (en) Sequence alignment method of vector processor
EP0119319B1 (en) Sort mechanism for stored digital data
US5111465A (en) Data integrity features for a sort accelerator
US5142687A (en) Sort accelerator with rebound sorter repeatedly merging sorted strings
US5185886A (en) Multiple record group rebound sorter
EP0049039A1 (en) Data processing apparatus for processing sparse vectors
US4384343A (en) Firmware controlled search and verify apparatus and method for a data processing system
US5206947A (en) Stable sorting for a sort accelerator
JPS61210478A (en) Vector processing device
JPS6142031A (en) Sorting processor
JPS60105039A (en) Collation system of character string
JPS6054043A (en) Sort processor
US6240540B1 (en) Cyclic redundancy check in a computer system
US4839799A (en) Buffer control method for quickly determining whether a required data block is in the buffer
JP2745710B2 (en) String search method and apparatus therefor
Lee ALTEP—A cellular processor for high-speed pattern matching
JPH073655B2 (en) Organizing / editing processor
JP2508004B2 (en) Sort processing device
JPH0250258A (en) Vector processing device
Lin Perfectly overlapped generation of long runs for sorting large files