JPH061432B2 - Data alignment device - Google Patents
Data alignment deviceInfo
- Publication number
- JPH061432B2 JPH061432B2 JP9639885A JP9639885A JPH061432B2 JP H061432 B2 JPH061432 B2 JP H061432B2 JP 9639885 A JP9639885 A JP 9639885A JP 9639885 A JP9639885 A JP 9639885A JP H061432 B2 JPH061432 B2 JP H061432B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- memory
- byte
- input
- comparison
- 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 - Lifetime
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/22—Arrangements for sorting or merging computer data on continuous record carriers, e.g. tape, drum, disc
- G06F7/32—Merging, i.e. combining data contained in ordered sequence on at least two record carriers to produce a single carrier or set of carriers having all the original data in the ordered sequence merging 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)
- Time-Division Multiplex Systems (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Description
【発明の詳細な説明】 〔発明の属する技術分野〕 本発明はデータ集合をデータ値の小さい順もしくは大き
い順に並べ換えるデータ整列装置に関する。Description: TECHNICAL FIELD The present invention relates to a data sorting device that sorts a data set in ascending or descending order of data values.
一般にデータ整列装置は、2つの整列済みデータ部分集
合を併合し、該整列済みデータ部分集合に含まれるデー
タ数を1,2,4,……と倍々に大きくしていく比較ユ
ニットを複数個、縦続に接続した構成となっている。従
来のデータ整列装置は、比較ユニットの構成により二種
類に大別することができる。以下、A方式およびB方式
と呼ぶことにする。Generally, a data sorting device merges two sorted data subsets and multiple comparison units that double the number of data included in the sorted data subsets to 1, 2, 4, ... It is configured to be connected in cascade. The conventional data alignment device can be roughly classified into two types according to the configuration of the comparison unit. Hereinafter, they will be referred to as the A system and the B system.
初め第6図乃至第8図によりA方式のデータ整列装置に
ついて説明する。First, an A-system data alignment device will be described with reference to FIGS.
第6図はA方式の装置構成例を示す図であり、10はデ
ータ整列装置、20は装置1のデータ入力端子、30は
装置1のデータ出力端子、40−1〜40−Uは比較ユ
ニットである。各比較ユニットは、入力端子601から
入力される整列済みデータ部分集合の一方を格納するメ
モリ603、該メモリ603と同じ大きさを持ち、入力
端子601からの整列済みデータ部分集合の他方を格納
するメモリ604、メモリ603,604へのデータの
読み書きを行う読出し/書込み回路605、メモリ60
3のデータの1バイトを格納するレジスタ606、メモ
リ604のデータの1バイトを格納するレジスタ60
7、レジスタ606と607に格納されているデータの
値を比較する比較器608、比較結果によりレジスタ6
06,607のいずれか一方に格納されているデータを
出力端子602に転送する経路を確立するマルチプレク
サ609からなる。こゝで、メモリ603と604の大
きさは、比較ユニット40−1では1個のデータ、40
−2では2個のデータ、40−3では4個のデータ、4
0−Uでは2U-1個のデータを格納できる大きさを有し
ている。FIG. 6 is a diagram showing a device configuration example of the A system, 10 is a data alignment device, 20 is a data input terminal of the device 1, 30 is a data output terminal of the device 1, and 40-1 to 40-U are comparison units. Is. Each comparison unit has a memory 603 that stores one of the sorted data subsets input from the input terminal 601, has the same size as the memory 603, and stores the other of the sorted data subsets from the input terminal 601. Memory 604, read / write circuit 605 for reading / writing data from / to memories 603 and 604, memory 60
Register 606 for storing 1 byte of data of No. 3 and register 60 for storing 1 byte of data of memory 604
7, a comparator 608 for comparing the values of the data stored in the registers 606 and 607, a register 6 according to the comparison result
It comprises a multiplexer 609 that establishes a path for transferring the data stored in either 06 or 607 to the output terminal 602. Here, the size of the memories 603 and 604 is one data in the comparison unit 40-1.
-2 for 2 data, 40-3 for 4 data, 4
0-U has a size capable of storing 2 U-1 data.
第6図の比較ユニット40−3におけるデータ部分集合
対の併合処理例のタイムチャートを第7図に示す。第7
図は、各々1バイトのデータが4個から成るデータ部分
集合対2組の併合処理を示したものである。第7図にお
いて、700はデータ対の比較処理、701はメモリ6
03から1バイト読み出してレジスタ606に格納する
処理、702はメモリ604から1バイト読み出してレ
ジスタ607に格納する処理、703はレジスタ606
と607に格納されているデータの値を比較して、比較
結果に従い、一方のレジスタ内のデータをマルチプレク
サ609で選択して出力端子602から比較ユニット4
0−4に転送すると同時に、比較ユニット40−2から
入力端子601を経由して、データの1バイトをメモリ
603あるいは604に書き込む処理を示している。7
04は1バイトの大きさを持つデータである。705−
1と706−1は入力端子601から順次入力される1
番目の整列済みデータ部分集合対であり、707−1は
該データ部分集合対に対する併合後の整列済み出力デー
タ部分集合である。同様に、705−2と706−2は
2組目の整列済み入力データ部分集合対、707−2は
該データ部分集合対に対する併合後の整列済み出力デー
タ部分集合である。FIG. 7 shows a time chart of an example of merge processing of the data subset pairs in the comparison unit 40-3 of FIG. 7th
The figure shows the merging process of two data subset pairs each consisting of four 1-byte data. In FIG. 7, reference numeral 700 is a data pair comparison process, and 701 is a memory 6.
A process of reading one byte from 03 and storing it in the register 606, a process 702 of reading one byte from the memory 604 and storing it in the register 607, and a process 703 of the register 606.
And the value of the data stored in 607 are compared, and the data in one register is selected by the multiplexer 609 according to the comparison result, and the data is output from the output terminal 602 to the comparison unit 4
A process of writing one byte of data to the memory 603 or 604 from the comparison unit 40-2 via the input terminal 601 at the same time of transferring to 0-4 is shown. 7
04 is data having a size of 1 byte. 705-
1 and 706-1 are sequentially input from the input terminal 601 1
The seventh sorted data subset pair, and 707-1 is the sorted output data subset after merging with respect to the data subset pair. Similarly, 705-2 and 706-2 are the second sorted input data subset pair, and 707-2 is the sorted output data subset after the merging for the data subset pair.
第7図の例について、比較ユニット40−3における処
理の様子を示すと第8図の通りである。第8図におい
て、「∧」、「∨」は各々レジスタ606,607のデ
ータの方が小さいことを示し、「×」は比較しないこと
を示している。800はメモリ603,604中のデー
タ部分集合の区切りを示し、800−1はデータ部分集
合705−1と705−2の区切り、800−2はデー
タ部分集合706−1と706−2の区切りを示す。時
刻は第7図の時刻及び処理701,702,703に対
応している。With respect to the example of FIG. 7, the processing state in the comparison unit 40-3 is shown in FIG. In FIG. 8, “∧” and “∨” indicate that the data in the registers 606 and 607 are smaller, and “x” indicates that they are not compared. Reference numeral 800 denotes a partition of the data subsets in the memories 603 and 604, 800-1 is a partition of the data subsets 705-1 and 705-2, and 800-2 is a partition of the data subsets 706-1 and 706-2. Show. The time corresponds to the time and processing 701, 702, 703 in FIG.
ところで、A方式のデータ整列装置では、第6図に示す
様に、メモリ603,604へのデータの読出し/書込
み回路が1つしかないため、読み・書きが逐次的にしか
できない。このため、第7図に示すように、1バイトの
処理についてメモリへの読み・書きで3処理が必要とな
る。また、メモリ603,604のいずれかのデータ部
分集合が全て出力し終えないと、次のデータ部分集合の
入力を行うことができない。第7図の例では、データ部
分集合705−1と706−1を各々メモリ603,6
04に入力後、そのうちのデータ部分集合705−1が
出力し終える時点で、次のデータ部分集合705−2の
入力を開始している。このため、データの値によって
は、第7図に示すように、データ部分集合の入力に時間
の空きができる。これら2つの理由から、A方式は処理
時間が遅いという欠点があった。By the way, in the A-system data alignment device, as shown in FIG. 6, since there is only one data read / write circuit for the memories 603 and 604, reading / writing can be performed only sequentially. Therefore, as shown in FIG. 7, three processes are required for reading / writing to / from the memory for the process of 1 byte. Also, the output of the next data subset cannot be performed until all the data subsets of the memories 603 and 604 have been output. In the example of FIG. 7, the data subsets 705-1 and 706-1 are stored in the memories 603, 6 respectively.
After the data is input to 04, when the output of the data subset 705-1 is completed, the input of the next data subset 705-2 is started. Therefore, depending on the value of the data, there is a vacancy in the input of the data subset, as shown in FIG. For these two reasons, the method A has a drawback that the processing time is slow.
次に第9図乃至第11図によりB方式のデータ整列装置
について説明する。Next, a B-system data alignment device will be described with reference to FIGS.
第9図はB方式の装置構成例を示す図であり、データ整
列装置10が比較ユニット40−1〜40−Uを縦続接
続した構成をとることは第6図と同様である。各比較ユ
ニットは、入力端子901から入力される整列済みデー
タ部分集合を格納するメモリ903、1データ分の大き
さを持つメモリ904、メモリ903の読出し/書込み
回路905、1バイトの大きさを持つレジスタ906,
907,910,レジスタ906と907に格納されて
いるデータの値を比較する比較器908、レジスタ90
6と907のいずれか一方のデータをデータ出力端子9
02に転送する経路を選択するマルチプレクサ909か
らなる。メモリ903の大きさは、第6図の場合と同様
に、比較ユニット40−1では1個のデータ、40−2
では2個のデータ、40−3では4個のデータ、40−
Uでは2U-1個のデータを格納できる大きさを有してい
る。FIG. 9 is a diagram showing a device configuration example of the B system, and the data alignment device 10 has a configuration in which the comparison units 40-1 to 40-U are connected in cascade, as in FIG. Each comparison unit has a memory 903 for storing a sorted data subset input from the input terminal 901, a memory 904 having a size of 1 data, a read / write circuit 905 of the memory 903, and a size of 1 byte. Register 906
907 and 910, a comparator 908 for comparing the values of the data stored in the registers 906 and 907, and a register 90
Data output terminal 9 outputs either data 6 or 907.
It is composed of a multiplexer 909 for selecting a route to be transferred to the H.02. The size of the memory 903 is the same as in the case of FIG.
2 data, 40-3 4 data, 40-
U has a size capable of storing 2 U-1 pieces of data.
第10図は第9図の比較ユニット40−3におけるデー
タ部分集合対の併合処理例を示すタイムチャートであ
る。第10図において、1000はデータ対の比較処理
であり、1001と1002の2つの処理に分けられ
る。処理1001は次の〜のいずれかの動作とレジ
スタ906,907のいずれか一方のデータを比較結果
よりマルチプレクサ909で選択してデータ出力端子9
02へ出力する動作を同時に行う処理であって、から
の動作は次の通りである。FIG. 10 is a time chart showing an example of merging processing of data subset pairs in the comparison unit 40-3 of FIG. In FIG. 10, reference numeral 1000 denotes a data pair comparison process, which is divided into two processes 1001 and 1002. In the process 1001, the multiplexer 909 selects one of the following operations from the data of one of the registers 906 and 907 by the multiplexer 909, and the data output terminal 9
This is a process of simultaneously performing the operation of outputting to 02, and the operation from is as follows.
データ入力端子901からデータを入力し、メモリ
904経由でレジスタ907に格納する。Data is input from the data input terminal 901 and stored in the register 907 via the memory 904.
データ入力端子901からデータを入力し、レジス
タ910に格納する。Data is input from the data input terminal 901 and stored in the register 910.
の動作に加え、メモリ903からデータの1バイ
トを読み出し、レジスタ906に格納する。1 byte of data is read from the memory 903 and stored in the register 906.
の動作に加え、レジスタ906のデータをレジス
タ907に格納する。In addition to the above operation, the data in the register 906 is stored in the register 907.
処理1002は、レジスタ910のデータをメモリ90
3に格納すると同時に、レジスタ906と907のデー
タの値を比較器908で比較し、比較結果を得る処理で
ある。1003は1バイトの大きさを持つデータを示
す。1004は一方の整列済み入力データ部分集合、1
005は他方の整列済み入力データ部分集合、1006
は併合後の出力データ部分集合で、1004−1と10
05−1を併合した結果が1006−1であり、100
4−2と1005−2を併合した結果が1006−2で
ある。A process 1002 stores the data in the register 910 in the memory 90.
In this processing, the values of the data in the registers 906 and 907 are compared with each other in the comparator 908 at the same time as being stored in No. Reference numeral 1003 indicates data having a size of 1 byte. 1004 is one sorted input data subset, 1
005 is the other sorted input data subset, 1006
Is the output data subset after merging.
The result of merging 05-1 is 1006-1, which is 100
The result of merging 4-2 and 1005-2 is 1006-2.
第10図の例について、比較ユニット40−3における
処理の様子を詳細に示したのが第11図である。第11
図では、データの大きさが1バイトのため、使用しない
メモリ904は省いてある。1100はメモリ903中
のデータ部分集合の区切りであって、1100−1はデ
ータ部分集合1004−1と1005−1の区切り、1
100−2はデータ部分集合1004−1と1004−
2の区切り、1100−3はデータ部分集合1005−
1と1004−2,1100−4はデータ部分集合10
04−2と1005−2の区切りを示す。1101はメ
モリ903内で1つのデータ部分集合に含まれるデータ
をつなぐポインタを示す。時刻は、第10図の時刻及び
処理1001,1002に対応している。FIG. 11 shows the details of the processing in the comparison unit 40-3 for the example of FIG. 11th
In the figure, since the data size is 1 byte, the unused memory 904 is omitted. 1100 is a partition of a data subset in the memory 903, 1100-1 is a partition of the data subsets 1004-1 and 1005-1, 1
100-2 is a data subset 1004-1 and 1004-
2 division 1100-3 is a data subset 1005-
1 and 1004-2 and 1100-4 are the data subset 10
The division between 04-2 and 1005-2 is shown. Reference numeral 1101 denotes a pointer that connects data included in one data subset in the memory 903. The time corresponds to the time and processes 1001 and 1002 in FIG.
第10図に示すように、B方式のデータ整列装置では、
データ部分集合の入出力に時間の空きが生じないため、
処理時間の高速化が達成できるが、制御が非常に複雑で
ある欠点を有している。すなわち、第10図における処
理1001の場合、処理の分けが多い。また、メモリ9
03内には最大3つのデータ部分集合が格納され、デー
タ管理が繁雑である。第10図の例では、時刻9のデー
タ入力時点では、メモリ903にデータ部分集合100
4−1,1004−2,1004−3のデータが格納さ
れている。As shown in FIG. 10, in the B-system data alignment device,
Since there is no time for input / output of the data subset,
Although the processing time can be shortened, it has a drawback that the control is very complicated. That is, in the case of the process 1001 in FIG. 10, there are many processes. Also, the memory 9
Up to three data subsets are stored in 03, and data management is complicated. In the example of FIG. 10, at the time of data input at time 9, the data subset 100 is stored in the memory 903.
Data of 4-1, 1004-2 and 1004-3 are stored.
本発明の目的は、制御が容易で、しかもデータ整列時間
の短縮を図ることができるデータ整列装置を提供するこ
とにある。An object of the present invention is to provide a data alignment device that can be easily controlled and can shorten the data alignment time.
本発明は、データ整列装置の各比較ユニットに各々2つ
のメモリを設け、比較ユニットに入力されるデータを2
つのメモリに同時に複写して格納し、これらメモリのデ
ータを用いて併合処理を行うことを特徴とするものであ
る。According to the present invention, each comparison unit of the data alignment device is provided with two memories, and two data are input to the comparison unit.
One of the features is that the data is copied and stored in one memory at the same time, and the merge processing is performed using the data in these memories.
第1図は本発明によるデータ整列装置の構成例を示す図
である。第1図において、データ整列装置10は複数の
比較ユニット40−1〜40−Uを縦続接続した構成を
とる。20は装置10の1バイト幅データ入力端子、3
0は同じく装置10の1バイト幅データ出力端子であ
り、101は比較ユニットの1バイト幅データ入力端
子、102は同じく比較ユニットの1バイト幅データ出
力端子である。各比較ユニット40−1〜40−Uは、
入力端子601から入力される一方の整列済みデータ部
分集合を格納するメモリ103、他方の整列済みデータ
部分集合を格納するメモリ104、メモリ103,10
4へのデータの読み書きを各々行う読出し/書込み回路
105−1,105−2、メモリ103のデータの1バ
イトを格納するレジスタ106、メモリ104のデータ
の1バイトを格納するレジスタ107、レジスタ106
と107に格納されているデータの値を比較する比較器
108、レジスタ106と107のいずれか一方のデー
タを出力端子102に転送する経路を選択するマルチプ
レクサ109、比較器108から比較結果信号を受け取
り、それに基いて当該比較ユニットの各部を制御する制
御回路110からなる。メモリ103と104の大きさ
は、比較ユニット40−1では1個のデータ、40−2
では2個のデータ、40−3では4個のデータ、40−
Uでは2U-1個のデータを格納できる大きさを有してい
る。FIG. 1 is a diagram showing a configuration example of a data alignment device according to the present invention. In FIG. 1, the data alignment device 10 has a configuration in which a plurality of comparison units 40-1 to 40-U are connected in cascade. 20 is a 1-byte wide data input terminal of the device 10, 3
Reference numeral 0 is a 1-byte width data output terminal of the device 10, 101 is a 1-byte width data input terminal of the comparison unit, and 102 is a 1-byte width data output terminal of the comparison unit. Each of the comparison units 40-1 to 40-U includes
The memory 103 that stores one sorted data subset input from the input terminal 601, the memory 104 that stores the other sorted data subset, and the memories 103 and 10.
4, read / write circuits 105-1, 105-2 for respectively reading and writing data, register 106 for storing 1 byte of data in memory 103, register 107 for storing 1 byte of data in memory 104, register 106.
And a comparator 108 for comparing the values of the data stored in 107 and 107, a multiplexer 109 for selecting a route for transferring the data of one of the registers 106 and 107 to the output terminal 102, and a comparison result signal from the comparator 108. , And a control circuit 110 for controlling each part of the comparison unit on the basis thereof. The sizes of the memories 103 and 104 are one data in the comparison unit 40-1, 40-2.
2 data, 40-3 4 data, 40-
U has a size capable of storing 2 U-1 pieces of data.
第2図は、第1図における各比較ユニットでの処理状態
の遷移を示した図であって、200から205は状態、
206は遷移の方向を示している。各状態200〜20
5は書込み処理と読出し処理とからなる。FIG. 2 is a diagram showing transitions of processing states in each comparison unit in FIG. 1, and 200 to 205 are states,
206 indicates the direction of transition. Each state 200-20
Reference numeral 5 includes a writing process and a reading process.
今、併合する2つの整列済みデータ部分集合を、比較ユ
ニット40−i(i=1,2,…U)に入力される順に
各々R,Sとし、Sに続いて入力される整列済みデータ
部分集合をTとする。200の状態Aは次の処理より成
る。Now, the two sorted data subsets to be merged are respectively R and S in the order in which they are input to the comparison unit 40-i (i = 1, 2, ... U), and the sorted data portions input subsequent to S are input. Let T be the set. State A of 200 comprises the following processing.
書込み処理:データ入力端子101よりRのデータ
を1バイト入力し、メモリ103と104に複写して格
納する。Writing process: One byte of R data is input from the data input terminal 101, copied and stored in the memories 103 and 104.
読出し処理:何もしない。 Read processing: Do nothing.
Rの全データを入力し終えるまで状態Aを繰り返し、そ
の後、201の状態Bに遷移する。状態Bは次の処理か
ら成る。The state A is repeated until all the data of R are input, and then the state B of 201 is entered. State B consists of the following processing.
書込み処理:データ入力端子101よりSのデータ
を1バイト入力し、メモリ103あるいは104のどち
らか一方に格納する。Writing process: One byte of S data is input from the data input terminal 101 and stored in either the memory 103 or 104.
読出し処理:メモリ103からRまたはSのデータ
の1バイトを読み出してレジスタ106に、メモリ10
4からSまたはRのデータの1バイトを読み出してレジ
スタ107に各々同時に格納し、レジスタ106と10
7に格納されているデータの値を比較器108で比較し
て、比較結果を制御回路110に通知する。Read processing: One byte of R or S data is read from the memory 103 and stored in the register 106 in the memory 10.
One byte of S or R data is read from 4 and stored in the register 107 at the same time.
The value of the data stored in 7 is compared by the comparator 108, and the comparison result is notified to the control circuit 110.
Sの先頭の1バイト目についてのみ状態Bを処理する。
Sに残りのデータがある場合は状態Cに、ない場合は状
態Eに遷移する。203の状態Cは次の処理から成る。State B is processed only for the first byte at the beginning of S.
If there is remaining data in S, transition to state C, and if not, transition to state E. State C 203 includes the following processing.
書込み処理:データ入力端子101よりSのデータ
を1バイト入力し、全Rが格納されていない方のメモリ
に格納する。同時にレジスタ106と107のいずれか
一方を制御回路110からの指示に従い、マルチプレク
サ109で選択し、該データをデータ出力端子102に
出力する。Writing process: One byte of S data is input from the data input terminal 101 and stored in the memory in which all Rs are not stored. At the same time, one of the registers 106 and 107 is selected by the multiplexer 109 according to the instruction from the control circuit 110, and the data is output to the data output terminal 102.
読出し処理:状態Bの読出し処理と同様である。 Read process: The same as the read process of state B.
Sの全データを入力し終えるまで状態Cを繰り返す。メ
モリ103とメモリ104に格納されているRとSのい
ずれか一方の最終データの最終バイトが次処理で出力さ
れるならば状態Eへ、そうでなければ状態Dへ遷移す
る。204の状態Dは次の処理から成る。State C is repeated until all the data of S are input. If the final byte of the final data of either R or S stored in the memories 103 and 104 is output in the next process, the state E is entered, and if not, the state D is entered. State D 204 includes the following processing.
書込み処理:データ入力端子101よりTのデータ
を1バイト入力し、メモリ103と104に複写して格
納する。同時に、レジスタ106と107のいずれか一
方を制御回路110からの指示に従い、マルチプレクサ
109で選択し、該データをデータ出力端子102に出
力する。Write process: One byte of T data is input from the data input terminal 101, copied and stored in the memories 103 and 104. At the same time, one of the registers 106 and 107 is selected by the multiplexer 109 according to the instruction from the control circuit 110, and the data is output to the data output terminal 102.
読出し処理:状態Bの読出し処理と同様である。 Read process: The same as the read process of state B.
メモリ103とメモリ104に格納されているRとSの
いずれか一方の最終データの最終バイトが次の処理で出
力される状態まで状態Dを繰り返し、その後、状態Eに
遷移する。205の状態Eは次の処理から成る。State D is repeated until the last byte of the final data of either R or S stored in memory 103 or memory 104 is output in the next process, and then state E is entered. The state E of 205 includes the following processing.
書込み処理:データ入力端子101よりTのデータ
を1バイト入力し、メモリ103あるいはメモリ104
のうち、RまたはSが全て出力されている側のメモリ
か、この処理で出力される側のメモリとは反対のメモリ
に格納する。同時にレジスタ106と107のいずれか
一方を制御回路110からの指示に従い、マルチプレク
サ109で選択し、該データをデータ出力端子102に
出力する。Write process: One byte of T data is input from the data input terminal 101, and the memory 103 or the memory 104
Of these, R or S is stored in the memory on the side where all are output, or the memory opposite to the memory on the side where this processing is output. At the same time, one of the registers 106 and 107 is selected by the multiplexer 109 according to the instruction from the control circuit 110, and the data is output to the data output terminal 102.
読出し処理:メモリ102からRまたはSが残って
いれば、RまたはSのデータの1バイト、残っていなけ
ればTのデータの1バイトを読み出し、レジスタ106
に格納すると同時にメモリ104からメモリ103と同
様にデータの1バイトを読み出しレジスタ107に格納
する。(こゝで、比較は行わず、制御回路110は次処
理でRまたはSのデータの格納されているレジスタから
データを出力するように指示する)。Read process: If R or S remains from the memory 102, 1 byte of R or S data is read, and if not, 1 byte of T data is read, and the register 106 is read.
At the same time, the 1-byte data is read from the memory 104 and stored in the register 107 as in the memory 103. (Here, the comparison is not performed, and the control circuit 110 instructs to output the data from the register storing the R or S data in the next process).
残っているRまたはSの最終データの最終バイトが次処
理で出力される状態、すなわち、Tのすべのデータを入
力し終えるまで状態Eを繰り返し、その後、状態Cに遷
移する。こゝで、Tは次の併合されるデータ部分集合対
のRに等しい。The state E is repeated until the last byte of the remaining R or S final data is output in the next process, that is, the state E is repeated until all the data of T is completely input, and then the state C is entered. Here, T is equal to R of the next merged data subset pair.
第2図の状態遷移処理は各比較ユニットで同時に行われ
る。なお、各比較ユニットの制御回路110に例えばマ
イクロプロセッサを用いることにより、上記処理は容易
に実現可能である。The state transition process of FIG. 2 is performed simultaneously in each comparison unit. The above processing can be easily realized by using, for example, a microprocessor for the control circuit 110 of each comparison unit.
第3図は本発明による処理例を示すタイムチャートであ
り、この例では、比較ユニット40−1,40−2,4
0−3により、1バイトの大きさのデータ8個の整列を
行っている。第3図において、300は1バイトの処
理、301は書込み処理、302は読出し処理、303
は1バイトデータ、304は整列済みデータ部分集合、
305は第2図の状態を示している。また、処理300
に要する時間を1時刻としている。FIG. 3 is a time chart showing a processing example according to the present invention. In this example, the comparison units 40-1, 40-2, 4 are shown.
By 0-3, 8 pieces of data having a size of 1 byte are aligned. In FIG. 3, 300 is a 1-byte process, 301 is a write process, 302 is a read process, 303
Is 1-byte data, 304 is a sorted data subset,
305 shows the state of FIG. Also, process 300
The time required for is 1 hour.
第3図の例について、第1図の比較ユニット40−1,
40−2,40−3内でのデータの動きを詳細に示す
と、第4図のようになる。第4図において、400はデ
ータの流れ、401は第2図で示した状態、402は比
較結果、403はデータ部分集合の区切りを示すもので
ある。比較結果は、「V」がレジスタ106に格納され
ているデータの値がレジスタ107に格納されているデ
ータの値よりも大きいことを、「∧」が小さい、「‖」
は等しい、「×」は比較しないことを意味している。Regarding the example of FIG. 3, the comparison unit 40-1 of FIG.
Details of the movement of data within 40-2 and 40-3 are as shown in FIG. In FIG. 4, 400 is a data flow, 401 is the state shown in FIG. 2, 402 is a comparison result, and 403 is a delimiter of a data subset. The comparison result indicates that “V” is larger than the data value stored in the register 107, that is, “∧” is small, “‖” is small.
Are equal, and "x" means do not compare.
第3図はデータの大きさが1バイトの例であるが、本発
明はデータの大きさが任意の場合について容易に拡張で
きる。データの大きさをLバイトとする時、比較ユニッ
ト40−i(i=1,2,3,…U)の処理開始時刻を
(2i-1−1)L+i時刻とし、2データの比較は次の
ようにすればよい。すなわち、大きさLバイトの2デー
タがKバイトまで同じ値を持っている時、Kバイトまで
の出力はレジスタ106,107の任意の一方とし、次
比較バイトは各データの次バイトとする。K+1バイト
目で2データの大小が判定すると、K+1バイトからL
バイトまでは、データ全体の値の大小により出力する。
次に比較するデータは、その前で最終まで出力したデー
タの次のデータと、途中までしか出力しなかったデータ
であり、各々データの先頭バイトから比較を開始する。Although FIG. 3 shows an example in which the data size is 1 byte, the present invention can be easily extended to the case where the data size is arbitrary. When the data size is L bytes, the processing start time of the comparison unit 40-i (i = 1, 2, 3, ... U) is (2 i−1 −1) L + i time, and the comparison of two data is performed. You can do the following: That is, when two data of size L bytes have the same value up to K bytes, the output up to K bytes is any one of the registers 106 and 107, and the next comparison byte is the next byte of each data. When the size of 2 data is judged at the K + 1 byte, the data is transferred from K + 1 byte to L
Up to bytes are output according to the size of the entire data.
The data to be compared next is the data next to the data output to the end before that, and the data that was only output halfway, and the comparison is started from the first byte of each data.
第5図は、大きさ4バイトの2個のデータの比較ユニッ
ト40−1での整列処理例を示すタイムチャートであっ
て、501は書込み処理、502は読出し処理、503
は4バイトのデータ、504は整列済みデータ部分集
合、505は第2図の状態を示している。FIG. 5 is a time chart showing an example of alignment processing of two data of 4 bytes in the comparison unit 40-1, where 501 is a writing process, 502 is a reading process, and 503.
Indicates 4-byte data, 504 indicates a sorted data subset, and 505 indicates the state of FIG.
一般にN個のデータの整列は「log2N」台の比較ユニッ
トを用いることにより、LN+L・2「log2N」「log2
N」−L時刻で処理できる。In general, N pieces of data are aligned by using “log 2 N” comparison units, and LN + L · 2 “log 2 N” “log 2
It can be processed in N "-L time.
以上説明したように本発明では、1つの比較ユニットに
同一構成のメモリを2つ備えることにより、1つのメモ
リには最大2つのデータ部分集合しか存在せず、かつ、
メモリ内のデータは入力順に順番に並べることができる
ため、メモリ管理が容易になり、また、状態遷移の技分
れが最大2つしかないので、制御も容易になる利点があ
る。さらに、2メモリへのデータの複写及び2メモリか
らの同時データ読出しにより、1バイトの比較処理をメ
モリへの書込み、読出しの2処理で行え、かつ、データ
間の処理の中断がないため、整列時間が短かいという利
点がある。As described above, according to the present invention, since two memories having the same structure are provided in one comparison unit, only one data subset at maximum exists in one memory, and
Since the data in the memory can be arranged in the order of input, the memory management becomes easy, and since there are only two state transition techniques at maximum, the control becomes easy. Furthermore, by copying data to 2 memories and reading data simultaneously from 2 memories, 1-byte comparison processing can be performed in 2 processings of writing and reading to the memory, and there is no interruption of processing between data. The advantage is that the time is short.
第1図は本発明によるデータ整列装置の一実施例の構成
図、第2図は第1図における比較ユニットの処理状態の
遷移を示す図、第3図は本発明による処理例を示すタイ
ミング図、第4図は第3図の処理例の詳細な動作を示す
図、第5図は本発明による別の処理例を示すタイミング
図、第6図は従来のデータ整列装置の第1の構成例を示
す図、第7図は第6図の処理例を示すタイミング図、第
8図は第7図の処理例の詳細な動作を示す図、第9図は
従来のデータ整列装置の第2の構成例を示す図、第10
図は第9図の処理例を示すタイミング図、第11図は第
10図の処理例の詳細な動作を示す図である。 10…データ整列装置、40−1〜40−U…比較ユニ
ット、101…データ入力端子、102…データ出力端
子、103,104…メモリ、105−1,105−2
…読出し/書込み回路、106,107…レジスタ、1
08…比較器、109…マルチプレクサ、110…制御
回路。FIG. 1 is a configuration diagram of an embodiment of a data alignment device according to the present invention, FIG. 2 is a diagram showing transitions of processing states of a comparison unit in FIG. 1, and FIG. 3 is a timing diagram showing a processing example according to the present invention. 4, FIG. 4 is a diagram showing the detailed operation of the processing example of FIG. 3, FIG. 5 is a timing diagram showing another processing example according to the present invention, and FIG. 6 is a first configuration example of a conventional data alignment device. FIG. 7, FIG. 7 is a timing chart showing the processing example of FIG. 6, FIG. 8 is a diagram showing the detailed operation of the processing example of FIG. 7, and FIG. 9 is a second diagram of the conventional data alignment device. The figure which shows the structural example, 10th
FIG. 11 is a timing chart showing the processing example of FIG. 9, and FIG. 11 is a diagram showing detailed operation of the processing example of FIG. 10 ... Data alignment device, 40-1 to 40-U ... Comparison unit, 101 ... Data input terminal, 102 ... Data output terminal, 103, 104 ... Memory, 105-1, 105-2
... Read / write circuit, 106, 107 ... Register, 1
08 ... Comparator, 109 ... Multiplexer, 110 ... Control circuit.
Claims (1)
ユニットで並列的に、前段から入力される整列済みデー
タ部分集合を2組ずつ整列して併合し、該併合結果の整
列済みデータ部分集合を後段に出力して、データ集合を
データ値の小さい順もしくは大きい順に並べ換えるデー
タ整列装置において、各比較ユニットは、前段から入力
される整列済みデータ部分集合を格納する1対のメモリ
と、各メモリから読み出されたデータを格納する1対の
レジスタと、前記レジスタのデータ値を比較する比較器
と、前記レジスタのいずれか一方のデータを後段に出力
するマルチプレクサと、前記比較器の比較結果にもとづ
いて前記マルチプレクサを制御するとゝもに、前記メモ
リの読み書きを制御し、前段から入力されるデータを2
つのメモリへ複写して格納し、一方のメモリ内のデータ
の併合中、データ部分集合がなくなると他方のメモリ内
の複写データを破棄する制御回路とを具備してなるデー
タ整列装置。1. A plurality of comparison units are connected in cascade, and in each comparison unit, two sets of aligned data subsets input from the preceding stage are aligned and merged, and the aligned data portion of the merged result. In a data sorting device that outputs a set to a latter stage and rearranges the data set in ascending or descending order of data values, each comparison unit includes a pair of memories for storing the sorted data subset input from the preceding stage. A pair of registers for storing the data read from each memory, a comparator for comparing the data values of the registers, a multiplexer for outputting the data of one of the registers to the subsequent stage, and a comparison of the comparators. When the multiplexer is controlled based on the result, the read / write of the memory is controlled, and the data input from the previous stage is controlled by 2 times.
A data alignment device, comprising: a control circuit for copying and storing the data in one memory, and discarding the copied data in the other memory when the data subsets are exhausted while merging the data in one memory.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9639885A JPH061432B2 (en) | 1985-05-07 | 1985-05-07 | Data alignment device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9639885A JPH061432B2 (en) | 1985-05-07 | 1985-05-07 | Data alignment device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS61255434A JPS61255434A (en) | 1986-11-13 |
| JPH061432B2 true JPH061432B2 (en) | 1994-01-05 |
Family
ID=14163854
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP9639885A Expired - Lifetime JPH061432B2 (en) | 1985-05-07 | 1985-05-07 | Data alignment device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH061432B2 (en) |
-
1985
- 1985-05-07 JP JP9639885A patent/JPH061432B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS61255434A (en) | 1986-11-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0047440A1 (en) | Shift circuit | |
| EP0225763B1 (en) | CRC calculation machine and method for CRC calculation | |
| JP3515591B2 (en) | A parallelized magnitude comparator that compares a binary number to a fixed value | |
| JPH01251383A (en) | Reading circuit for polyphase memory array | |
| KR920003176B1 (en) | Control data regenerating device for sort processor | |
| JP3380329B2 (en) | Digital data arbitration device | |
| US4387294A (en) | Shift register-latch circuit driven by clocks with half cycle phase deviation and usable with a serial alu | |
| JPH061432B2 (en) | Data alignment device | |
| SU1007099A1 (en) | Number sorting device | |
| JPH0233175B2 (en) | ||
| JPS62154140A (en) | Merge processor | |
| JPH0512011A (en) | Pipeline circuit | |
| JPH02103632A (en) | Arithmetic processor | |
| JPS63231526A (en) | Sort processor | |
| JPS62156749A (en) | Interruption signal generation circuit | |
| JPH0628151A (en) | Parallel latch circuit for serial data | |
| JPH03233724A (en) | Repetitive processing control system | |
| JPH04282704A (en) | Sequence controller | |
| JPS62154136A (en) | Data arranging device | |
| JPH01189723A (en) | Merging sorter | |
| JPH05289888A (en) | Interruption processing circuit | |
| JPS63149726A (en) | Comparing unit skip system for data aligning device | |
| JPH05127799A (en) | Input/output port circuit | |
| JPS63274215A (en) | Analog/digital converter | |
| JPH03282618A (en) | Data processing circuit |