JPS6237739A - Sorting processor - Google Patents

Sorting processor

Info

Publication number
JPS6237739A
JPS6237739A JP17576485A JP17576485A JPS6237739A JP S6237739 A JPS6237739 A JP S6237739A JP 17576485 A JP17576485 A JP 17576485A JP 17576485 A JP17576485 A JP 17576485A JP S6237739 A JPS6237739 A JP S6237739A
Authority
JP
Japan
Prior art keywords
sorting
data
descending
ascending
input
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
JP17576485A
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 JP17576485A priority Critical patent/JPS6237739A/en
Publication of JPS6237739A publication Critical patent/JPS6237739A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To apply both ordinal descending and ascending sorting processes, and to attain both ordinal descending and ascending multi-key sorting processes to each of plural keys by performing the control to decide the need for inversion of bits via a bit inverting means. CONSTITUTION:The input information supplied from an input data terminal 13 via a bit inverting circuit 10 is stored in a register A, etc. of a unit 6 of a descending sorting processor 15. Then this input information is compared with the advance information stored in a register 9 from a memory 2 by a comparator 3. Then a switching circuit 7 is controlled according to the contents of a flag register 4 which are set by the result of comparison of the comparator 3. The contents of a register 8 or the register 9 are transferred to the unit 6 at the next stage to undergo the ascending sorting process. The control signal applied to an inverse control terminal 11 is inverted to '1' from '0' through an exclusive OR gate of the circuit 10. Thus the input bit given through an input data terminal is also inverted. In the same way, the processor 15 performs a ascending sorting process. Thus both descending and ascending sorting processes are possible. Furthermore the multi-key sorting process is possible in both ordinal descending and ascending ways to each key if the multi-key control is applied to the circuit 10.

Description

【発明の詳細な説明】 (1)  発明の属する技術分野 本発明は、文字列や数値データを対象としたソート処理
装置に関し、特にソート対象データ相互、データ内の複
数の領域に対して昇順あるいは降順にソートするソート
処理装置の構成に関する。
DETAILED DESCRIPTION OF THE INVENTION (1) Technical field to which the invention pertains The present invention relates to a sort processing device for character strings and numerical data, and in particular, sorting target data for each other and for multiple areas within the data in ascending order or The present invention relates to a configuration of a sort processing device that sorts in descending order.

(2)従来の技術とその問題点 ソートとは、与えられたデータの集まりを所定の順序に
並び替える処理である。電子計算機におけるソート処理
とは、数値あるいは文字列として与えられたデータが、
計算機内部では“0”あるいは“1”の二値符号で表記
されている事から、二値符号の持つ数値的意味に基づい
て、与えられたデータを相互に比較し、それぞれのデー
タの大小関係によって、昇順(小さいものから大きいも
のへの順)あるいは降順(大きいものから小さいものへ
の順)にデータを並び変えることである。
(2) Conventional techniques and their problems Sorting is a process of rearranging a given set of data in a predetermined order. Sorting processing in electronic computers means that data given as numerical values or character strings is
Since the computer internally represents the binary code of "0" or "1", given data is compared with each other based on the numerical meaning of the binary code, and the magnitude relationship of each data is determined. This is to rearrange data in ascending order (from smallest to largest) or descending order (from largest to smallest).

一般に、ソート対象とするデータをレコー1:と称し、
レコードはデータ相互の比較を行って大小関係を判定す
るキ一部と比較を行わない部分とに分けることができる
。このレコードを、文字列や正整数(符号なし整数)に
限定した場合には、二進符号で表されたレコードのキ一
部を十位桁はど優位性を持たせて比較することによって
、ソート処理を行うレコード相互の大小関係を決定でき
る。
Generally, the data to be sorted is called record 1:
A record can be divided into a portion where data is compared to determine the size relationship and a portion where no comparison is performed. 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 with the tenth digit having an advantage, It is possible to determine the size relationship between records to be sorted.

文字列や正整数以外の例えば実数等であっても適当な変
換処理によって、大小関係を損なわないように文字列あ
るいは正整数に変換することができる。
Even if it is something other than a character string or a positive integer, such as a real number, it can be converted into a character string or a positive integer by an appropriate conversion process without impairing the magnitude relationship.

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

かかるソート処理時間に関する問題を解決する従来技術
として、専用のソート処理装置を用いて、データ相互の
比較による大小関係の判定と、データの転送を並列に行
って高速化を図る方法が、例えば、特願昭58−188
368号や特19n昭59−163519号に既知であ
る。
As a conventional technique for solving the problem regarding the sorting processing time, there is a method in which a dedicated sorting processing device is used to compare the data to determine the size relationship and to transfer the data in parallel to increase the speed. Patent application 1988-188
It is known from No. 368 and Special No. 19n Sho 59-163519.

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

第2図は、第1図のソート処理装置の動作原理図であり
、−例として、「0」から「9」までの−桁の数値デー
タのうち、r3J 、r6J 、r5J 。
FIG. 2 is a diagram showing the principle of operation of the sort processing device shown in FIG. 1. As an example, among numerical data of digits from "0" to "9", r3J, r6J, r5J.

r2j、r4J、rlJの、6個のレコードを降順にソ
ートする場合の動作を示している。第2図では、第1図
における第1のメモリ1および第2のメモリ2とフラグ
レジスタ4のみを簡略に示しており、他の回路は省略し
である。
The operation is shown when six records, r2j, r4J, and rlJ, are sorted in descending order. In FIG. 2, only the first memory 1, second memory 2, and flag register 4 in FIG. 1 are simply shown, and other circuits are omitted.

ソート処理を行うに当って、始めに本装置では、全ての
ユニットの第1のメモリ1および第2のメモリ2の内容
を初期設定する。ここでは、降順にソートする場合の例
であり、この場合にはデータの最小値である「0」を設
定する。本装置では、順次レコードを入力する入力操作
と、順次レコードを出力する出力操作とでソート処理を
行う。−回の入力操作で各ユニットでは、データの右方
向への転送と2個のデータ間での比較とを行う。この場
合、転送されるデータは第1および第2のメモリに保持
された2個のデータのうち小さい方である。この時、デ
ータの転送と同期して1個のレコードをソート処理装置
に入力し、最左端のユニットの第1のメモリ1あるいは
第2のメモリ2のいずれかのうち転送によって空になっ
た方のメモリに保持する。(Tl〜T6) この人力操作を繰り返して6個のレコード全てを入力し
た段階で、今度は出力操作によって順次データを隣接す
る左側のユニットに転送する。この時、転送するデータ
はユニット内の2個のデータのうち大きい方であり、最
右端のユニットには「0」を入力する。(T7〜T12
) 以上、入力操作の繰り返しによってデータが順次入力さ
れ、データの入力が完了した段階で出力操作を実行する
ことにより、最大値から順次ソート済みのレコードが降
順に取り出される。ここで説明したソート処理の例では
、レコード数に等しい入力操作回数と出力操作回数でソ
ート処理が行える。
In performing the sorting process, this apparatus first initializes the contents of the first memory 1 and the second memory 2 of all units. This is an example of sorting in descending order, and in this case, "0", which is the minimum value of data, is set. This device performs sorting processing using an input operation that inputs records sequentially and an output operation that outputs records sequentially. - times of input operations, each unit transfers data to the right and compares two pieces of data. In this case, the data to be transferred is the smaller of the two data held in the first and second memories. At this time, one record is input to the sort processing device in synchronization with the data transfer, and either the first memory 1 or the second memory 2 of the leftmost unit is emptied by the transfer. to be kept in memory. (Tl to T6) 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 of the two data in the unit, and "0" is input to the rightmost unit. (T7~T12
) As described above, data is input sequentially by repeating the input operation, and by executing the output operation when the data input is completed, records that have been sorted sequentially are retrieved in descending order starting from the maximum value. 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.

この従来のソート処理装置を用いて昇順にソートする場
合には、初期設定として、全ユニットの第1のメモリ1
および第2のメモリ2に、データの最大値として「9」
を設定しておき、入力操作時には、各ユニットで比較し
た2個のデータのうち、大きい方を右方向に転送し、出
力操作時には、各ユニットで比較した2個のデータのう
ち、小さい方を左方向に転送する。従って、この従来の
ソート処理装置では、降順ソートの場合と昇順ソートの
場合とでは、各ユニットの初期設定する値を変更する問
題と、入力操作時および出力操作時の転送データの大小
を逆にしなければならない問題があった。このため、−
次元接続した比較転送ユニットの制御回路が複雑になり
、ソート処理装置の回路規模の増大や、装置全体の動作
速度が低下する問題があった。
When sorting in ascending order using this conventional sort processing device, as an initial setting, the first memory 1 of all units
and “9” as the maximum value of the data in the second memory 2.
is set, and during input operations, the larger of the two pieces of data compared in each unit is transferred to the right, and during output operations, the smaller of the two pieces of data compared on each unit is transferred to the right. Transfer to the left. Therefore, in the case of descending sorting and ascending sorting, this conventional sort processing device has the problem of changing the initial setting value of each unit and reversing the size of transferred data during input operation and output operation. There was a problem that had to be solved. For this reason, −
The control circuits of the dimensionally connected comparison and transfer units become complicated, leading to problems such as an increase in the circuit scale of the sort processing device and a decrease in the operating speed of the entire device.

(3)発明の目的 本発明の目的は、ソート処理装置において、降順あるい
は昇順のいずれであってもソートできる構成とするとと
もに、レコード内に複数のキ一部を設け、入力操作およ
び出力操作と同期してビット反転手段を制御することに
よって、複数のキーのそれぞれに対して昇順あるいは降
順にソートするマルチキーソートが可能なソート処理装
置を提供することにある。
(3) Purpose of the Invention The purpose of the present invention is to provide a sort processing device with a structure that allows sorting in either descending or ascending order, and to provide a plurality of keys in a record so as to perform input and output operations. It is an object of the present invention to provide a sort processing device capable of performing multi-key sorting in which each of a plurality of keys is sorted in ascending order or descending order by synchronously controlling bit inverting means.

(4)発明の構成 (4−1)発明の特徴と従来技術との差異本発明は、ソ
ート処理器のデータ入出力部に、入力あるいは出力する
データのビットを制御によって反転するビット反転手段
を具備したことを最も主要な特徴とする。従来のソート
処理装置で降順ソートと昇順ソートを行うためには、−
次元接続した複数個のユニットの各々で初期設定するす
る値を変更し、さらに、入力操作時および出力操作時に
転送するデータの大小を変更するため、−次元接続した
比較転送ユニットの制御回路が複雑になり、ソート処理
装置の回路規模の増大や、装置全体の動作速度を制限す
る要因となっていた。
(4) Structure of the Invention (4-1) Features of the Invention and Differences from the Prior Art The present invention provides a data input/output section of a sort processor with bit inverting means for inverting bits of input or output data under control. The most important feature is that In order to perform descending sort and ascending sort with a conventional sort processing device, −
The control circuit of the -dimensionally connected comparison and transfer unit is complicated because the initial setting values for each of the multiple dimensionally connected units are changed, and the size of the data to be transferred during input and output operations is changed. This is a factor that increases the circuit scale of the sort processing device and limits the operating speed of the entire device.

本発明に基づくソート処理装置では、比較転送処理を行
うユニットを昇順ソートあるいは降順ソートのいずれか
一方に限定して実現することから、従来のソート処理装
置に比べて制御が闇路になり、この結果回路量の削減と
動作速度の向上が図れる。
In the sort processing device based on the present invention, since the unit that performs the comparison transfer processing is limited to either ascending order sorting or descending order sorting, the control becomes more complicated than in the conventional sort processing device. As a result, the amount of circuitry can be reduced and the operating speed can be improved.

さらに、従来のソート処理装置では、レコードを複数の
データに分割し、分割したデータに対する入力操作ある
いは出力操作の繰り返しによって、データ長が長いレコ
ードをソートするが、この入力操作および出力操作と同
期して該ビット反転手段を制御することによって、従来
のソート処理装置では実現することがほとんど不可能で
あった、レコード内に複数のキーを設定し、それぞれの
キーに対して降順あるいは昇順にソートするマルチキー
ソートを実現することが可能となった。
Furthermore, conventional sort processing devices sort records with long data length by dividing records into multiple pieces of data and repeating input or output operations on the divided data. By controlling the bit inverting means, multiple keys can be set in a record and the records can be sorted in descending or ascending order for each key, which was almost impossible to achieve with conventional sort processing devices. It has become possible to implement multi-key sorting.

(4−2)実施例 以下、本発明を実施例を参照して詳細に説明する。第3
図は、本発明の詳細な説明するソート処理装置の全体構
成図である。本実施例では、レコード長の長いデータを
ソートするために、レコードを複数のデータに分割し、
分割したデータを単位として入力操作あるいは出力操作
を行う場合を示している。図中の7は転送データの切替
回路、8はレジスタA、9はレジスタB、10はビット
反転回路、11は排他的論理和をとるEXORゲート、
12はビット反転回路を制御する反転制御端子、13と
14はソート対象データの入力端子と出力端子、15は
降順ソート処理器である。切替回路7とレジスタ8,9
で転送回路を形成する。
(4-2) Examples Hereinafter, the present invention will be explained in detail with reference to Examples. Third
FIG. 1 is an overall configuration diagram of a sort processing device for explaining the present invention in detail. In this example, in order to sort data with a long record length, the record is divided into multiple pieces of data.
This shows a case where an input operation or an output operation is performed using divided data as a unit. In the figure, 7 is a transfer data switching circuit, 8 is a register A, 9 is a register B, 10 is a bit inversion circuit, 11 is an EXOR gate that takes an exclusive OR,
12 is an inversion control terminal for controlling a bit inversion circuit; 13 and 14 are input terminals and output terminals for data to be sorted; and 15 is a descending sort processor. Switching circuit 7 and registers 8 and 9
form a transfer circuit.

降順ソート処理器15は、データの比較転送処理を行う
ユニット6の繰り返し構造からなり、降順ソート専用で
ある。従って、各ユニットではソート処理を行う際に、
第1のメモリであるメモリAと第2のメモリであるメモ
リBをともにオール“O″に初期設定する。ここで、オ
ール“O”とは、メモリの全ビットを理論値“0”に設
定することである。この時、フラグレジスタ4も同時に
理論値“O”に初期設定する。
The descending order sort processor 15 has a repeating structure of units 6 that perform data comparison and transfer processing, and is dedicated to descending order sorting. Therefore, when performing sorting in each unit,
Memory A, which is a first memory, and memory B, which is a second memory, are both initialized to all "O"s. Here, all "O" means setting all bits of the memory to the theoretical value "0". At this time, the flag register 4 is also initialized to the theoretical value "O" at the same time.

本降順ソート処理器における入力操作と出力操作は、転
送と比較の2つのフェーズからなる。入力操作における
転送フェーズでは、左方向からの転送データをレジスタ
AあるいはレジスタBにセントする。この時、メモリA
あるいはメモリB内の対応するデータを切替回路7を介
して右方向に送出するとともに、反対側のレジスタBあ
るいはレジスタAに対応するメモリからデータを読み込
む。比較フェーズでは、レジスタA及びレジスタBにセ
ットされた2個のデータを比較するとともに、レジスタ
A及びレジスタBのイ直をメモリAおよびメモリBに書
き込む。この転送フェーズと比較フェーズからなる入力
操作を繰り返してルーコードの入力が完了した段階で、
ルコード分の比較結果をフラグレジスタ4にセットする
。ルーコードの入力が完了したら、新たにセットしたフ
ラグレジスタの値に基づいて、次のレコードの入力を行
う。
The input and output operations in this descending sort processor consist of two phases: transfer and comparison. In the transfer phase of the input operation, transfer data from the left is sent to register A or register B. At this time, memory A
Alternatively, the corresponding data in memory B is sent to the right via the switching circuit 7, and data is read from the memory corresponding to register B or register A on the opposite side. In the comparison phase, two pieces of data set in register A and register B are compared, and the values of register A and register B are written to memory A and memory B. After repeating the input operation consisting of the transfer phase and the comparison phase and completing the input of the Lou code,
The comparison result for the code is set in the flag register 4. When the input of the roux code is completed, the next record is input based on the value of the newly set flag register.

全レコードの入力が終了した段階で、今度は出力操作を
行う。出力操作における転送フェーズでは、右方向から
の転送データをレジスタAあるいはレジスタBにセット
する。この時、メモリAあるいはメモリB内の対応する
データを切替回路7を介して左方向に送出するとともに
、反対側のレジスタBあるいはレジスタAに対応するメ
モリからデータを読み込む。出力操作における比較フェ
ーズは、入力操作と同じである。以上示したように、入
力操作時には、各ユニットでフラグレジスタ4の値に基
づいて切替回路7を制御して、レジスタA8およびレジ
スタB9の内で小さい方を右方向に転送する。出力操作
時には、入力操作時と同様に、フラグレジスタ4の値に
基づいて切替回路7を制御して、レジスタA及びレジス
タBの内で大きい方を左方向に転送する。これらの入力
操作の繰り返しと出力操作の繰り返しによって、降順に
ソートされた結果が得られる。
Once all records have been input, it's time to perform the output operation. In the transfer phase of the output operation, transfer data from the right direction is set in register A or register B. At this time, the corresponding data in memory A or memory B is sent to the left via the switching circuit 7, and data is read from the memory corresponding to register B or register A on the opposite side. The comparison phase in output operations is the same as in input operations. As described above, during an input operation, each unit controls the switching circuit 7 based on the value of the flag register 4 to transfer the smaller one of register A8 and register B9 to the right. During the output operation, the switching circuit 7 is controlled based on the value of the flag register 4, and the larger one of the registers A and B is transferred to the left in the same way as during the input operation. By repeating these input operations and output operations, results sorted in descending order are obtained.

第3図に示す、本発明実施例におけるソート処理装置で
降順ソートを行う場合には、反転制御端子12を論理値
“0”に設定し、昇順ソートを行う場合には、反転制御
端子12を“1”に設定する。
When performing descending order sorting in the sort processing apparatus according to the embodiment of the present invention shown in FIG. Set to “1”.

ビット反転回路10は、転送データの各ビットにEXO
Rゲートを負荷し、ビット毎に反転/非反転の制御を行
う。第4図は、EXORゲートの入出力関係を示した図
である。EXORゲートの出力は、2つの入力の排他的
論理和であるから、片方の入力を反転制御端子とすると
、他方の入力端子の反転/非反転を制御できる。
The bit inversion circuit 10 applies an EXO to each bit of the transfer data.
The R gate is loaded and inversion/non-inversion control is performed for each bit. FIG. 4 is a diagram showing the input/output relationship of the EXOR gate. Since the output of the EXOR gate is the exclusive OR of two inputs, if one input is used as an inversion control terminal, it is possible to control inversion/non-inversion of the other input terminal.

本ソート処理装置が、ソート対象とするデータは、文字
列あるいは正整数であるから、ビット反転を行うことよ
って、′1″の補数をとることになり、ビット反転操作
により、2個のデータの大小関係を逆転させることがで
きる。従って、入力データの各ビットを反転した後に、
降順ソート処理器15に入力し、得られた出力を再度ビ
ット反転することで昇順にソートできる。
Since the data to be sorted by this sorting processing device is a character string or a positive integer, by performing bit reversal, it takes the complement of '1''. The magnitude relationship can be reversed. Therefore, after inverting each bit of input data,
By inputting the data to the descending order sorting processor 15 and inverting the bits of the obtained output again, the data can be sorted in ascending order.

次に、本実施例に示すソート処理装置で、レコード内に
複数のキーを設定し、複数のキーのそれぞれに対して、
昇順あるいは降順にソートするマルチキーソートについ
て具体例を用いて説明する。
Next, in the sort processing device shown in this embodiment, multiple keys are set in the record, and for each of the multiple keys,
Multi-key sorting, which sorts in ascending or descending order, will be explained using a specific example.

第5図は、10進4桁の正整数を対象として、千の位を
降順に、百の位を昇順に、十の位、−の位を降順にソー
トする場合の例である。本例では、各数字を1バイトで
表わし、1バイト単位で比較と転送の入出力操作を行う
。反転制御信号Cは、各位の入出力操作と同期して、千
の位は論理値“0”、百の位は論理値“1”、十の位は
論理値“0”、−の位は論理値“0”を反転制御端子1
2から与える。この結果、入力レコードは、ビット反転
回路10によって、百の位のみがビット反転して補数と
なっている。図では、各桁を16進表示していることか
ら、ビット反転操作によって、1(2進表示でoooi
 >はE(2進表示で1110)に、2はDに、3はC
に変換されている。この反転処理後の各レコードを降順
ソート処理器15に入力し、降順にソートする。得られ
た結果を再度ビット反転回路10に入力し、反転制御信
号Cに基づいて百の位のみビット反転することによって
、各レコードのビットパターンを再現する。以上示した
ように、ソート対象データを複数に分割し、分割したレ
コードのそれぞれの入力操作あるいは出力操作と同期し
て、ビット反転手段を制御することによって、ソート対
象データ内に複数の領域を設定して、それぞれの領域に
対して他の領域とは独立に昇順又は降順にソートするこ
とにより容易にマルチキーソートを行うことができる。
FIG. 5 is an example of sorting 4-digit decimal positive integers in descending order of the thousands digit, ascending order of the hundreds digit, and descending order of the tens digit and - digit. In this example, each number is represented by one byte, and input/output operations such as comparison and transfer are performed in units of one byte. The inversion control signal C is synchronized with the input/output operation of each digit, and the thousands digit is a logical value "0", the hundreds digit is a logical value "1", the tens digit is a logical value "0", and the negative digit is a logical value "0". Invert logic value “0” control terminal 1
Give from 2. As a result, in the input record, only the hundredth place is bit-inverted by the bit inverting circuit 10 to become a complement number. In the figure, each digit is expressed in hexadecimal, so by bit reversal, it can be changed to 1 (oooi in binary).
> is E (1110 in binary notation), 2 is D, 3 is C
has been converted to Each record after this inversion processing is input to a descending order sorting processor 15 and sorted in descending order. The obtained result is input again to the bit inversion circuit 10, and only the hundreds digit is inverted based on the inversion control signal C, thereby reproducing the bit pattern of each record. As shown above, multiple areas are set within the data to be sorted by dividing the data to be sorted into multiple parts and controlling the bit inverting means in synchronization with the input or output operation of each of the divided records. Multi-key sorting can be easily performed by sorting each area in ascending or descending order independently of other areas.

本実施例では、降順ソート処理器15とビット反転回路
を組合わせた場合を示したが、昇順ソートのみを実行で
きる昇順ソート処理器を降順ソート処理器の代わりに用
いた場合でも、反転制御信号の論理値(0,1)を木実
側倒とは逆にすることによって、容易に昇順/降順ソー
トおよびマルチキーソートを行うことができる。
In this embodiment, the case is shown in which the descending sort processor 15 and the bit inverting circuit are combined, but even if an ascending sort processor that can only perform ascending sorting is used instead of the descending sort processor, the inversion control signal Ascending/descending sorting and multi-key sorting can be easily performed by reversing the logical value (0, 1) of ``total side''.

(5)発明の効果 以上実施例をもって説明したように、本発明のソート処
理装置では、降順あるいは昇順のいずれか一方にソート
できるソート処理器に対して、レコードを入力、出力す
る入出力部に、制御によってデータのビットを反転する
ビット反転手段を具備したことによって、降順あるいは
昇順のいずれであってもソート可能とするとともに、レ
コード内に複数のキ一部を設け、入力操作および出力操
作と同期してビット反転手段を制御することによって、
複数のキーのそれぞれに対して昇順あるいは降順にソー
トするマルチキーソートを実現したことである。
(5) Effects of the Invention As explained above with reference to the embodiments, the sort processing device of the present invention has an input/output unit that inputs and outputs records to a sort processor that can sort in either descending order or ascending order. By being equipped with a bit inversion means that inverts data bits under control, it is possible to sort in either descending or ascending order, and by providing multiple keys in a record, it is possible to perform input and output operations. By synchronously controlling the bit inverting means,
The goal is to realize multi-key sorting in which each of multiple keys is sorted in ascending or descending order.

従来のソート処理装置で降順ソートと昇順ソートを行う
ためには、−次元接続した複数個のユニットの各々で初
期設定する値を変更し、さらに、人力操作時および出力
操作時に転送するデータの大小を変更しなければならな
い。このため、ユニットの制御回路が複雑になり、ソー
ト処理装置の回路量が増加するとともに、処理速度を制
限する要因となっていた。本発明では、降順ソートある
いは昇順ソートのいずれかのソート処理器で十分である
から、ソート処理装置の回路量の削減と、処理速度を向
上できる利点がある。
In order to perform descending sort and ascending sort with a conventional sort processing device, it is necessary to change the initial setting values for each of the multiple units connected in the − dimension, and to change the size of the data to be transferred during manual operation and output operation. must be changed. For this reason, the control circuit of the unit becomes complicated, the amount of circuitry of the sort processing device increases, and this becomes a factor that limits the processing speed. In the present invention, since a sorting processor for either descending sorting or ascending sorting is sufficient, there are advantages in that the amount of circuitry in the sorting processing device can be reduced and the processing speed can be improved.

さらに、従来のソート処理装置では回路が複雑になり、
実現することが困難であったマルチキーソートをわずか
な付加回路で実現できる利点がある。
Furthermore, conventional sorting processing devices require complicated circuits.
This has the advantage that multi-key sorting, which has been difficult to achieve, can be achieved with only a small amount of additional circuitry.

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

第1図は従来のソート処理装置の構成図、第2図は第1
図に示したソート処理装置の動作原理図、第3図は本発
明の一実施例であるソート処理装置の構成図、第4図は
第3図に示したビット反転回路を構成するEXORゲー
トの動作図、第5図は第3図のソート処理装置による複
数キーに対するソート処理の動作説明図である。 1・・・第1のメモリ、 2・・・第2のメモリ、3・
・・比較器、  4・・・フラグレジスタ、5・・・入
出力回路、 6・・・ユニット、7・・・切替回路、 
 8・・・レジスタA。 9・・・レジスタB、 10・・・ビット反転回路、1
1・・・EXORゲート、 12・・・反転制御端子、
13・・・入力データ端子、 14・・・出力データ端
子、15・・・降順ソート処理器。
Figure 1 is a configuration diagram of a conventional sort processing device, and Figure 2 is a diagram of a conventional sort processing device.
FIG. 3 is a diagram of the configuration of the sorting device which is an embodiment of the present invention, and FIG. 4 is a diagram of the EXOR gate constituting the bit inverting circuit shown in FIG. 3. FIG. 5 is an explanatory diagram of the operation of sorting processing for a plurality of keys by the sorting processing device of FIG. 3. 1... first memory, 2... second memory, 3...
... Comparator, 4... Flag register, 5... Input/output circuit, 6... Unit, 7... Switching circuit,
8...Register A. 9...Register B, 10...Bit inversion circuit, 1
1... EXOR gate, 12... Inversion control terminal,
13... Input data terminal, 14... Output data terminal, 15... Descending sort processor.

Claims (1)

【特許請求の範囲】[Claims] (1)2個のデータを保持するメモリと、該メモリに保
持されたデータ間の大小関係を判定する比較器と、該比
較器による該メモリに保持された2個のデータの大小関
係にもとづいて、該2個のデータのいずれか一方を右方
向又は左方向に転送するための転送回路とを少なくとも
有する比較転送ユニットの一次元アレイ構造からなるソ
ート処理器を備えて、文字列あるいは正整数を対象とし
て昇順あるいは降順のいずれかにソートできるソート処
理装置において、 前記ソート処理器を降順又は昇順に特定されたソート処
理器に構成するするとともに、該ソート処理器にソート
対象データを入力あるいは出力する際に二値符号で表わ
されたソート対象データの各々のビットを反転するか否
かの機能を有するビット反転手段を具備し、該ビット反
転手段のビット反転操作を実行するか否かによって昇順
あるいは降順のいずれのソートも実行できるように構成
されたことを特徴とするソート処理装置。
(1) A memory that holds two pieces of data, a comparator that determines the magnitude relationship between the data held in the memory, and a comparator that determines the size relationship between the two pieces of data held in the memory. a sorting processor having a one-dimensional array structure of comparison transfer units having at least a transfer circuit for transferring either one of the two data to the right or to the left; In a sort processing device capable of sorting in either ascending order or descending order, the sort processing device is configured to be a sort processing device specified in descending order or ascending order, and data to be sorted is input or output to the sort processing device. The bit reversing means has a function of inverting each bit of the data to be sorted expressed in binary code when performing the sorting process, and the bit reversing means performs the bit reversing operation. A sort processing device characterized in that it is configured to be able to perform sorting in either ascending order or descending order.
JP17576485A 1985-08-12 1985-08-12 Sorting processor Pending JPS6237739A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP17576485A JPS6237739A (en) 1985-08-12 1985-08-12 Sorting processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP17576485A JPS6237739A (en) 1985-08-12 1985-08-12 Sorting processor

Publications (1)

Publication Number Publication Date
JPS6237739A true JPS6237739A (en) 1987-02-18

Family

ID=16001846

Family Applications (1)

Application Number Title Priority Date Filing Date
JP17576485A Pending JPS6237739A (en) 1985-08-12 1985-08-12 Sorting processor

Country Status (1)

Country Link
JP (1) JPS6237739A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01211191A (en) * 1988-02-19 1989-08-24 Fujitsu Ltd Dictionary sorting processor
EP0803800A2 (en) * 1996-04-26 1997-10-29 Mitsubishi Denki Kabushiki Kaisha A sort processor and a sort processing device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01211191A (en) * 1988-02-19 1989-08-24 Fujitsu Ltd Dictionary sorting processor
EP0803800A2 (en) * 1996-04-26 1997-10-29 Mitsubishi Denki Kabushiki Kaisha A sort processor and a sort processing device
EP0803800A3 (en) * 1996-04-26 1997-12-03 Mitsubishi Denki Kabushiki Kaisha A sort processor and a sort processing device

Similar Documents

Publication Publication Date Title
US3296426A (en) Computing device
JPS60129847A (en) Apparatus for loading bit structure to latch strings
US3675001A (en) Fast adder for multi-number additions
US3109162A (en) Data boundary cross-over and/or advance data access system
US3293418A (en) High speed divider
US3781819A (en) Shift unit for variable data widths
US3026034A (en) Binary to decimal conversion
JPS59226923A (en) Bus interface apparatus
US5511189A (en) Data sorting apparatus capable of detecting completion of data sorting early and sorting method therefor
JPS6237739A (en) Sorting processor
JPS6142031A (en) Sorting processor
US3700872A (en) Radix conversion circuits
US4719590A (en) Apparatus and method for performing addition and subtraction
US3911405A (en) General purpose edit unit
US3125676A (en) jeeves
JPS6278627A (en) Sorting processor
SU1499345A1 (en) Device for extracting unities from positional code
US5912831A (en) Process and system for adding or substracting symbols in any base without converting to a common base
JP2752220B2 (en) String processing unit
JPS6327732B2 (en)
RU2021633C1 (en) Multiplying device
JPS6081640A (en) Sort processor
SU1300641A1 (en) Device for converting binary-coded decimal code to binary code
JPH0250258A (en) Vector processing device
SU1053100A1 (en) Device for determining average value of odd set of of number