JPH02193279A - Sorting device - Google Patents

Sorting device

Info

Publication number
JPH02193279A
JPH02193279A JP26726289A JP26726289A JPH02193279A JP H02193279 A JPH02193279 A JP H02193279A JP 26726289 A JP26726289 A JP 26726289A JP 26726289 A JP26726289 A JP 26726289A JP H02193279 A JPH02193279 A JP H02193279A
Authority
JP
Japan
Prior art keywords
shift
data
distance
character code
stage
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
JP26726289A
Other languages
Japanese (ja)
Inventor
Masayuki Ishigami
正之 石上
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP26726289A priority Critical patent/JPH02193279A/en
Publication of JPH02193279A publication Critical patent/JPH02193279A/en
Pending legal-status Critical Current

Links

Landscapes

  • Character Discrimination (AREA)

Abstract

PURPOSE:To execute high speed sorting by comparing simultaneously a new distance and a character code with regard to all stages of each shift array, and also, executing simultaneously loading and shifting of each shift array based on a result of its comparison with regard to all stages. CONSTITUTION:In the case of applying to sorting of a candidate of a character recognizing device, data and a key become a character code and a distance, respectively. By each comparing means 8, 9, a new character code and a distance, and a character code and a distance held in each stage of each shift array 1, 2 are compared simultaneously. In accordance with a result of this comparison, shifting and loading of each stage of each shift array 1, 2 are controlled successively, a space is secured in a stage for the new character code and the distance, and the new character code and the distance are loaded to its stage, by which sorting whose key is a distance is executed. In such a way, high speed sorting can be executed.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、データをそのキーによって一定の順番に並べ
替えるソーティング装置に係り、例えば文字認識装置に
おいて辞書との距離をキーとして候補の文字コードの高
速ソーティングの用途に好適なソーティング装置に関す
る。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a sorting device that sorts data in a certain order according to its keys, and for example, in a character recognition device, character codes of candidates are determined using distance from a dictionary as a key. The present invention relates to a sorting device suitable for high-speed sorting applications.

〔従来の技術と発明が解決しようとする課題〕漢字OC
Rでは、認識対象文字イメージの特徴を抽出し、それと
標準特徴辞書とのマツチングを行うことによって認識結
果(候補)を決定するが、各テンプレート(辞書の1文
字毎の特徴パターン)とのマツチングを行う毎に距離を
キーとしたソーティングが必要である。第8図はこのソ
ーティングの例である。この例は、(a)に示した状態
で、文字コードにのテンプレートとのマツチングで距離
が80となった場合(簡略的に(K、80)と表す)、
文字コードCと文字コードDの間に文字コードKが挿入
されて(b)の状態に更新されたことを示している。
[Problems to be solved by conventional technology and invention] Kanji OC
In R, recognition results (candidates) are determined by extracting the features of the recognition target character image and matching them with a standard feature dictionary. Sorting using distance as a key is required each time. FIG. 8 is an example of this sorting. In this example, in the state shown in (a), if the distance is 80 when matching the character code with the template (simply expressed as (K, 80)),
This shows that the character code K has been inserted between the character code C and the character code D, and the state has been updated to the state shown in (b).

また、漢字OCRでは、マルチフォントへの対応など、
認識率向上のために同一文字コードに対して複数のテン
プレートを用意する場合がある。
In addition, Kanji OCR supports multiple fonts, etc.
In order to improve the recognition rate, multiple templates may be prepared for the same character code.

この場合、候補中に同一文字コードが重複しないように
する必要がある。第9図はこの例であり、(a)の状態
において、文字コードGが重複して候補となった\め、
(G、80)を挿入後、同じ文字コードGで距離が大き
い(G、120)のデータを削除することにより(b)
の状態になったことを示している。
In this case, it is necessary to ensure that the same character code does not overlap in the candidates. Figure 9 is an example of this, where in the state of (a), character code G is duplicated and becomes a candidate.
After inserting (G, 80), by deleting the data of (G, 120) with the same character code G but with a large distance (b)
This indicates that the state has been reached.

なお、漢字OCRでは認識結果として10候補程度を出
力し後処理の対象とするのが一般的であるので、こ\で
も10候補としている。また、文字コードとして通常、
シフトJISなどの漢字コードが用いられるが、こ\で
は便宜上アルファベットで示している。
Note that since it is common for Kanji OCR to output about 10 candidates as recognition results and use them for post-processing, 10 candidates are used here as well. Also, as a character code, usually
Kanji codes such as Shift JIS are used, but for convenience, they are shown in alphabetical order.

このようなソーティングは、汎用のCPUとメモリを用
いソフトウェア処理によって行うことも可能である。し
かし、一つ一つの文字について登録済みデータとの距離
を比較していき、挿入位置を決めた後に、その位置より
後方(距離が大きい側)の登録済みデータ(文字コード
と距離)の移動(読出し書込みの繰返し)を行わなけれ
ばならず、高速処理が難しい。文字コードの重複を排除
する場合には、そのための同様の処理も必要である。
Such sorting can also be performed by software processing using a general-purpose CPU and memory. However, after comparing the distance with the registered data for each character and determining the insertion position, the registered data (character code and distance) behind that position (on the side with a larger distance) is moved ( This requires repeated reading and writing, making high-speed processing difficult. Similar processing is also required to eliminate duplicate character codes.

これに対し、距離の値をメモリアドレスのインデックス
として文字コードを書込むことによるソーティングする
方式も提案されているが、かなりのメモリ容量を必要と
する(容量は候補として有効とする距離の最大値に依存
する)といった欠点があり、特に1チツプ化を図る場合
に問題がある。
On the other hand, a sorting method has been proposed in which the distance value is used as an index of the memory address and character codes are written, but this method requires a considerable amount of memory capacity (the capacity is the maximum value of the distance that is valid as a candidate). This is particularly problematic when attempting to integrate into a single chip.

また、同一文字コードの重複排除は、別処理として行わ
なければならない。
Also, elimination of duplicates of the same character code must be performed as a separate process.

さらに、データベース・システム等への適用を主目的と
して、ソーティング処理を専用のハードウェアを実行さ
せるパイプライン・マージソータ、バイトニックソータ
等も提案されているが、文字認識装置における候補デー
タのソーティング処理用としては回路構成が複雑すぎる
という問題がある。
Furthermore, pipeline merge sorters, bitonic sorters, etc., which execute sorting processing using dedicated hardware, have been proposed mainly for application to database systems, etc.; However, there is a problem that the circuit configuration is too complicated.

本発明の目的は、1チツプ化が容易な比較的簡単な構成
で、漢字OCRの候補データの高速ソーティングなどの
用途に好適なソーティング装置を提供することにある。
An object of the present invention is to provide a sorting device that has a relatively simple configuration that can be easily integrated into a single chip and is suitable for high-speed sorting of candidate data for Kanji OCR.

本発明の他の目的は、ソートされた結果を外部に効率よ
く読み出すことのできるソーティング装置を提供するこ
とにある。
Another object of the present invention is to provide a sorting device that can efficiently read out sorted results to the outside.

〔課題を解決するための手段〕[Means to solve the problem]

上記目的を達成するために、請求項(1)では、外部よ
り入力されるデータおよびそのキーを保持する手段と、
ロードおよびシフトが可能なエレメントの組合せからな
る多段構成のデータ・シフトアレイおよびキー・シフト
アレイと、該データ・=4− シフトアレイの各段に保持された各データと該データ保
持手段に保持されたデータとを一斉に比較する手段と、
該キー・シフトアレイの各段に保持された各キーと該キ
ー保持手段に保持されたキーとを一斉に比較する手段と
、該各比較手段の比較績Ikに従って該各シフトアレイ
の各段について一斉に、該保持手段に保持されたデータ
およびキーのロードおよび該各シフトアレイの保持して
いるデータおよびキーのシフトを順次制御することによ
り、該各シフトアレイ上にデータおよびキーをキーの順
番に従って配列させる制御手段とを有することを特徴と
するものである。
In order to achieve the above object, claim (1) provides means for retaining externally input data and its key;
A data shift array and a key shift array having a multistage configuration consisting of a combination of elements that can be loaded and shifted, each data held in each stage of the data = 4-shift array, and the data held in the data holding means. and a means to simultaneously compare the data
means for simultaneously comparing each key held in each stage of the key shift array with the key held in the key holding means, and for each stage of each shift array according to the comparison result Ik of each comparing means; By sequentially controlling the loading of the data and keys held in the holding means and the shifting of the data and keys held in each of the shift arrays, data and keys are transferred onto each of the shift arrays in the key order. and control means for arranging the arrangement according to the following.

また、請求項(2)では、制御手段は、ソーティング結
果を読み出す際、各シフトアレイをアップダウン制御し
、キーの小さい順または大きい順にデータおよび/また
はキーを任意に読み出すことを特徴とするものである。
Further, in claim (2), the control means controls each shift array up and down when reading out the sorting results, and arbitrarily reads out data and/or keys in ascending order of keys or in descending order of keys. It is.

〔作 用〕[For production]

例えば文字認識装置の候補のソーティングに適用した場
合、データは文字コード、キーは距離となる。新規の文
字コードと距離が保持手段に保持されると、各比較手段
によって、この文字コードおよび距離と各シフトアレイ
の各段に保持されている文字コードおよび距離が比較さ
れる。この比較の結果に従って制御手段により、各シフ
トアレイの各段のシフトおよびロードが順次制御され、
新規の文字コードおよび距離を挿入すべき段にスペース
が確保され、その段に新規の文字コードおよび距離がロ
ードされることにより、距離をキーとしたソーティング
がなされる。重複文字コードがある場合、距離の大きい
側の削除も、この時に同時になされる。
For example, when applied to sorting candidates for a character recognition device, the data is the character code and the key is the distance. When a new character code and distance are held in the holding means, each comparison means compares this character code and distance with the character code and distance held in each row of each shift array. The control means sequentially controls the shifting and loading of each stage of each shift array according to the result of this comparison,
A space is secured in the row where a new character code and distance should be inserted, and the new character code and distance are loaded into that row, thereby performing sorting using distance as a key. If there are duplicate character codes, the one with the larger distance is also deleted at the same time.

新規の距離および文字コードの比較は各シフトアレイの
全段について一斉に比較され、またその比較結果に基づ
く各シフトアレ・rのロードおよびシフトも全段につい
て一斉に行われるため、高速のソーティングが可能であ
る。
New distances and character codes are compared for all stages of each shift array at the same time, and loading and shifting of each shift array/r based on the comparison results is also performed for all stages at the same time, enabling high-speed sorting. It is.

また、ソーティング結果を外部へ読み出す際は、各シフ
トアレイをアップダウン制御して、キーの小さい順また
は大きい順に読み出すことができるため、これを必要に
応じて任意に変更することにより、効率のよい読出しが
可能である。
In addition, when reading the sorting results to the outside, each shift array can be controlled up and down to read in the order of the smallest key or the largest key, so by changing this arbitrarily as necessary, you can improve efficiency. Reading is possible.

装置構成に関しては、各シフトアレイはエレメントを多
段に組合せた規則的構成となり、また各比較手段も通常
の多ビツト比較器と同様の規則的な構成(同一エレメン
トの繰返し)となるため、全体として比較的簡単な回路
構成となり、1チツプ化に向いている。
Regarding the device configuration, each shift array has a regular configuration in which elements are combined in multiple stages, and each comparison means has a regular configuration (repetition of the same element) similar to a normal multi-bit comparator, so the overall It has a relatively simple circuit configuration and is suitable for integration into a single chip.

〔実施例〕〔Example〕

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

第1図は本発明の一実施例を示すブロック図である。こ
の実施例は、文字認識装置の候補のソーティングに適用
されるもので、認識結果としての文字コード(データ)
と距離(キー)はそれぞれ文字コード・シフトアレイ1
と距離データ・シフトアレイ2上に距離の小さい順にソ
ーティングされるものとする。
FIG. 1 is a block diagram showing one embodiment of the present invention. This example is applied to sorting candidates for a character recognition device, and the character code (data) as a recognition result
and distance (key) are character code and shift array 1, respectively.
It is assumed that the distance data is sorted on the distance data shift array 2 in descending order of distance.

新たな文字コードと距離を各シフトアレイ1゜2の該当
する位置に挿入する場合、内部バス3を介し、文字コー
ドは文字コードレジスタ4に、距離データは距離データ
レジスタ5にそれぞれセットされ、コントロール線6に
よりシフトコントロール部7に起動がかけられる。また
、距離データ比較器8により、距離データレジスタ5に
セットされた距離データと、距離データ・シフトアレイ
2に登録済みの距離データ(こ\では最大10個)が−
斉に比較され、比較結果がシフトコントロール部7へ与
えられる。同時に、文字コード比較器9により1文字コ
ードレジスタ4にセットされた文字コードと、文字コー
ド・シフトアレイ1に登録済みの文字コードが一斉に比
較され、比較結果がシフトコントロール部7に与えられ
る。
When inserting a new character code and distance into the corresponding position of each shift array 1.2, the character code and distance data are set in the character code register 4 and the distance data register 5, respectively, via the internal bus 3, and the control Shift control section 7 is activated by line 6. Additionally, the distance data comparator 8 compares the distance data set in the distance data register 5 with the distance data registered in the distance data shift array 2 (up to 10 in this case).
They are compared at the same time, and the comparison results are given to the shift control section 7. At the same time, the character code comparator 9 compares the character code set in the single character code register 4 with the character code registered in the character code shift array 1 all at once, and the comparison result is provided to the shift control section 7.

起動されたシフトコントロール部7では、各比較器8,
9の比較結果をもとに簡単な論理演算(後述)を行い、
その結果により各シフトアレイ1.2を動作させて各レ
ジスタ4,5上の文字コードおよび距離データの挿入ス
ペースを確保した後、その挿入スペースに当該文字コー
ドおよび距離データを書込む。最終的な認識結果として
の候補の文字コードおよび距離データは、距離の小さい
順(第1段目から)あるいは大きい順(第10段目から
)に、文字コードレジスタ4および距離データレジスタ
5を経由して内部バス3に逐次読出すことができる。
In the activated shift control section 7, each comparator 8,
Perform simple logical operations (described later) based on the comparison results in step 9.
Based on the results, each shift array 1.2 is operated to secure an insertion space for the character code and distance data in each register 4, 5, and then the character code and distance data are written in the insertion space. The candidate character codes and distance data as the final recognition result are passed through the character code register 4 and the distance data register 5 in order of decreasing distance (from the first stage) or increasing distance (from the 10th stage). The data can be sequentially read out onto the internal bus 3.

第2図(a)はシフトアレイ(文字コード・シフトアレ
イ1または距離データ・シフトアレイ2、いずれも同一
構成)のブロック図である。11は1ビツトのデータの
保持・シフトのためのシフトエレメントである。横一列
に並んだシフトエレメント11が一つの文字コードまた
は距離データを保持するもので、これが10段配列され
ている。
FIG. 2(a) is a block diagram of a shift array (character code shift array 1 or distance data shift array 2, both having the same configuration). 11 is a shift element for holding and shifting 1-bit data. Shift elements 11 arranged horizontally hold one character code or distance data, and are arranged in ten stages.

データは上の段から下の段へあるいは下の段から上の段
へ向ってシフトされる。同一の段のシフトエレメント1
1は、シフトコントロール部7によって一斉に制御され
る。
Data is shifted from the top row to the bottom row or from the bottom row to the top row. Shift element 1 in the same stage
1 are controlled all at once by the shift control section 7.

第2図(b)に一つのシフトエレメントの入出力信号線
の関係を示す。ここで、ロードデータ入力線aは文字コ
ード・レジスタ4あるいは距離データレジスタ5に各段
共通に接続される。また、シフトデータ入出力線す、c
は、シフト方向が上から下の場合、bが入力線、Cが出
力線となり、下から上の場合はこの関係が逆になり、第
1段目のシフトデータ入出力線す及び第10段目のシフ
トデータ入出力線Cはそれぞれレジスタ4または5に接
続される。d−hはコントロール/クロック信号線であ
る。なお、シフト/ロード指定線fおよびクロック入力
線gは(a)図では省略しである。データの上段から下
段あるいは下段から上段のシフト方向はシフトアップダ
ウン信号線りの値で決まる。
FIG. 2(b) shows the relationship between the input and output signal lines of one shift element. Here, the load data input line a is commonly connected to the character code register 4 or the distance data register 5 at each stage. In addition, shift data input/output lines
When the shift direction is from top to bottom, b becomes the input line and C becomes the output line, and when the shift direction is from bottom to top, this relationship is reversed, and the shift data input/output line of the 1st stage and the 10th stage The second shift data input/output line C is connected to the register 4 or 5, respectively. dh is a control/clock signal line. Note that the shift/load designation line f and the clock input line g are omitted in FIG. The direction in which the data is shifted from the upper stage to the lower stage or from the lower stage to the upper stage is determined by the value of the shift up/down signal line.

各シフトエレメント11は第3図に示すように。Each shift element 11 is as shown in FIG.

アンド回路21〜25、オア回路26,27、インバー
タ回路28〜30、トランスファゲート回路31〜33
、フリップフロップ回路34より構成されている。信号
名は第2図と一致している。
AND circuits 21-25, OR circuits 26, 27, inverter circuits 28-30, transfer gate circuits 31-33
, a flip-flop circuit 34. The signal names match those in FIG.

ロード動作時、レジスタ4または5からのデータ(文字
コードまたは距離)はロードデータ入力線aに入力し、
フリップフロップ34に保持される。
During load operation, data (character code or distance) from register 4 or 5 is input to load data input line a,
It is held in a flip-flop 34.

シフト動作時、シフトアップダウン信号線りがロウの場
合は、前段からのフリップフロップシフト出力されたデ
ータはシフトデータ入出力線すに入力して、当該段のフ
リップフロップ34に移り、それまでフリップフロップ
34に保持されていたデータはシフトデータ入出力線C
に出力する。シフトアップダウン信号線りがハイの時は
、この関係が逆になる。これらの動作で必要とするシフ
トコントロール部7からのコントロール信号線としては
、シフトを行うかどうかを制御するためのシフトマスク
信号が入力するシフトマスク線d、外部からのデータ入
力を制御するためのロードマスク信号が入力するロード
マスクse、シフトまたはロードを選択するためのロー
ド/シフト信号が入力するロード/シフト線f、クロッ
クが入力するクロック線g、及び、上記シフトデータ入
出力線す、cの入出力関係(すなわち、シフト方向)を
切替えるシフトアップダウン信号が入力するシフトアッ
プダウン信号線りがある。
During a shift operation, if the shift up/down signal line is low, the data shifted and output from the flip-flop from the previous stage is input to the shift data input/output line, transferred to the flip-flop 34 of the relevant stage, and is transferred to the flip-flop until then. The data held in the shift data input/output line C
Output to. When the shift up/down signal line is high, this relationship is reversed. The control signal lines from the shift control unit 7 necessary for these operations include a shift mask line d to which a shift mask signal is input to control whether or not to perform a shift, and a shift mask line d to control data input from the outside. A load mask se to which a load mask signal is input, a load/shift line f to which a load/shift signal for selecting shift or load is input, a clock line g to which a clock is input, and the shift data input/output lines S, c. There is a shift up/down signal line to which a shift up/down signal for switching the input/output relationship (i.e., shift direction) is input.

第4図は距離データ比較器8のブロック図であり、41
は1ビツトの比較を行う距離データ比較器エレメントを
示している。距離データ比較器8には、一つの距離デー
タのビット数に等しい個数の距離データ比較器エレメン
ト41を図示のように接続したブロックが、距離データ
・シフトアレイ2の各段に対応して合計10段分あり、
−斉に作動する。第4図(b)に一つの距離データ比較
器エレメント41の入出力信号の関係を示す。
FIG. 4 is a block diagram of the distance data comparator 8, with 41
indicates a distance data comparator element that performs a 1-bit comparison. The distance data comparator 8 has a total of 10 blocks each having a number of distance data comparator elements 41 connected as shown in the figure, each corresponding to the number of bits of one distance data, corresponding to each stage of the distance data shift array 2. There are steps,
- Operate in unison. FIG. 4(b) shows the relationship between input and output signals of one distance data comparator element 41.

各距離データ比較器エレメント41は第5図に示すよう
に、アンド回路42〜45、オア回路46.47、イン
バータ回路48〜50より構成される。信号名は第4図
と一致している。aは距離データ・レジスタ8の対応ビ
ットの出力と接続される比較距離入力線、fは距離デー
タ・シフトアレイ2の対応段の対応ビットのシフトデー
タ入出力線と接続される登録距離入力線である。dは登
録距離〉比較距離のときに有効となる出力線、eは登録
距離=比較距離のときに有効となる出力線である。bと
Cはそれぞれ上位ビットの距離データ比較器エレメント
の出力線d、eが接続される入力線である。
As shown in FIG. 5, each distance data comparator element 41 is comprised of AND circuits 42-45, OR circuits 46, 47, and inverter circuits 48-50. The signal names match those in FIG. a is a comparison distance input line connected to the output of the corresponding bit of the distance data register 8, and f is a registered distance input line connected to the shift data input/output line of the corresponding bit of the corresponding stage of the distance data shift array 2. be. d is an output line that becomes effective when registered distance>comparison distance, and e is an output line that becomes effective when registered distance=comparison distance. b and C are input lines to which the output lines d and e of the distance data comparator element of the upper bit are connected, respectively.

第6図(a)は文字コード比較器9のブロック図であり
、51は文字コードの1ビツトの比較を行うための文字
コード比較器エレメントを示している。文字コード比較
器9には1文字コードのビット数に等しい個数の文字コ
ード比較器エレメント51を図示のように接続したブロ
ックが、文字コード・シフトアレイ1の各段に対応して
合計10段分あり、−斉に作動する。第6図(b)に一
つの文字コード比較器エレメント51の入出力信号関係
を示す。
FIG. 6(a) is a block diagram of the character code comparator 9, and 51 indicates a character code comparator element for performing 1-bit comparison of character codes. The character code comparator 9 has a block in which a number of character code comparator elements 51 equal to the number of bits of one character code are connected as shown, for a total of 10 stages corresponding to each stage of the character code shift array 1. Yes, - operate in unison. FIG. 6(b) shows the input/output signal relationship of one character code comparator element 51.

各文字コード比較器エレメント51は第7図に示すよう
に、アンド回路52〜54、オア回路55、インバータ
回路56.57より構成される。
As shown in FIG. 7, each character code comparator element 51 is composed of AND circuits 52 to 54, an OR circuit 55, and inverter circuits 56 and 57.

信号名は第6図と一致している。aは文字コード・レジ
スタ4の対応ビットの出力と接続される比較文字コード
入力線、Cは文字コード・シフトアレイ1の対応段の対
応ビットのシフトデータ出力線と接続される登録文字コ
ード入力線である。dは登録文字コード=比較文字コー
ドのときに有効となる出力線、bは上位ビットの文字コ
ード比較器エレメントの出力線dが接続される入力線で
ある。
The signal names match those in FIG. A is a comparison character code input line connected to the output of the corresponding bit of the character code register 4, and C is a registered character code input line connected to the shift data output line of the corresponding bit of the corresponding stage of the character code shift array 1. It is. d is an output line that becomes valid when the registered character code=comparison character code, and b is an input line to which the output line d of the upper bit character code comparator element is connected.

シフトコントロール部7の働きは次の通りである。距離
データレジスタ5にセットされた対象距離データをD、
文字コードレジスタ4にセットされた対象文字コードを
C1登録済みの距離データおよび文字コードをそれぞれ
D i+ ci (i= i〜10で1位から10位ま
での登録済みデータ、すなわちシフトアレイ1,2の各
段の値に対応)とし、距離データ比較器8の結果をRD
□、文字コード比較器9の結果をRC,とする。
The function of the shift control section 7 is as follows. The target distance data set in the distance data register 5 is D,
The target character code set in the character code register 4 is C1, and the registered distance data and character code are each D i + ci (i = i to 10, registered data from 1st to 10th place, that is, shift arrays 1 and 2). ), and the result of the distance data comparator 8 is RD
□, the result of the character code comparator 9 is RC.

RD□はD□〉Dのときに有効となり、RC□はC工=
Cのときに有効となる。
RD□ is valid when D□>D, and RC□ is C =
It becomes effective when C.

RX、=RC工ΦRX□+1 RX11=RC,+RC2+・+RC1゜とすると、 シフトマスクMSよ=RX、・RDエ ロードマスクML□= (RD工0RD=−、)・MS
If RX,=RC machining ΦRX□+1 RX11=RC,+RC2+・+RC1゜, shift mask MS=RX,・RD Erode mask ML□= (RD machining 0RD=-,)・MS
.

たゾしRD、=0 となる。こ\で+は論理和、・は論理積、■は排他的論
理和、−は否定を表す。
Tazoshi RD becomes =0. Here, + represents logical sum, * represents logical product, ■ represents exclusive logical sum, and - represents negation.

シフトコントロール部7は、ソーティング動作時、上記
演算によって決定したシフトマスクMS□およびロード
マスクML、の信号をシフトアレイ1.2の対応入力線
に印加した状態で、シフト/ロード指定信号をシフト指
定状態(ハイ状態)にしてクロックを供給し、次にロー
ド指定状態(ロウ状態)にしてクロックを与える。シフ
トアップダウン信号をロウとしておく。最初(シフト指
定時)のクロックで、シフトアレイ1,2上のある段が
挿入すべきスペースとして確保され、次のクロック(ロ
ード指定時)でそのスペース段に対象距離データおよび
対象文字コードが書込まれる。
During the sorting operation, the shift control unit 7 applies the shift mask MS□ and load mask ML signals determined by the above calculation to the corresponding input lines of the shift array 1.2, and sends the shift/load designation signal to shift designation. It is brought into the state (high state) and supplied with a clock, and then brought into a load designation state (low state) and supplied with a clock. Keep the shift up/down signal low. At the first clock (when specifying a shift), a certain row on shift arrays 1 and 2 is secured as a space to be inserted, and at the next clock (when specifying a load), target distance data and target character code are written to that space row. be included.

なお、文字コードが重複している場合、距離が大きいほ
うのデータは上記操作でシフトアレイ1゜2より削除(
シフトアウト)される。
In addition, if the character codes overlap, the data with the larger distance will be deleted from shift array 1゜2 by the above operation (
shifted out).

また、ソーティング動作を始める前に、文字コードシフ
トアレイ1は0クリアしく文字コードとしてOはないも
のとしている)、距離データ・シフトアレイ2はリジェ
クト距離閾値で初期化しておくことは当然である。第1
0図にソーティング動作時のシフトコントロール部7の
処理フローチャートを示す。
Furthermore, before starting the sorting operation, the character code shift array 1 is cleared to 0 (assuming that there is no O as a character code), and the distance data shift array 2 is of course initialized with a reject distance threshold. 1st
FIG. 0 shows a processing flowchart of the shift control section 7 during the sorting operation.

ソーティング動作が終了し、各シフトアレイ1゜2より
結果を読み出す場合は、シフト/ロード指定信号をシフ
ト指定状態(ハイ状態)に設定すると共に、シフトアッ
プタウン信号はハイあるいはロウに設定して、クロック
を与える。これにより、各シフトアレイ1,2のソート
済み文字コードおよび距離データが距離の小さい順また
は大きい順に各レジスタ4,5に読み出される。即ち、
シフトアップダウン信号をハイにすると、第2図におい
て、シフト方向は下から上になり、距離の小さい順に読
み出され、シフトアップダウン信号をロウにすると、逆
にシフト方向は上から下になり、距離の大きい順に読み
出される。この読出しは、シフトアレイ1,2の一方に
ついてのみ行ってもよい。
When the sorting operation is completed and the results are to be read from each shift array 1 and 2, the shift/load designation signal is set to the shift designation state (high state), and the shift uptown signal is set to high or low. Give the clock. As a result, the sorted character codes and distance data of each shift array 1, 2 are read out to each register 4, 5 in order of decreasing distance or increasing distance. That is,
When the shift up/down signal is set high, the shift direction will be from bottom to top in Figure 2, and the data will be read out in order of decreasing distance.When the shift up/down signal is set low, the shift direction will be from top to bottom in Figure 2. , are read out in descending order of distance. This reading may be performed for only one of shift arrays 1 and 2.

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

以上の説明から明らかなように、本発明によれば、比較
的簡単かつ1チツプ化に向いた規則的回路構成で、漢字
OCRの認識結果などの高速ソーティングおよびソーテ
ィング結果の効率のよい読出しが可能なソーティング装
置を実現することができる。
As is clear from the above description, according to the present invention, high-speed sorting of kanji OCR recognition results and efficient reading of the sorting results is possible with a relatively simple and regular circuit configuration suitable for integration into a single chip. A sorting device can be realized.

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

第1図は本発明の一実施例のブロック図、第2図はシフ
トアレイのブロック図、第3図はシフトエレメントの回
路図、第4図は距離データ比較器の1段分の構成を示す
ブロック図、第5図は距離データ比較器エレメントの回
路図、第6図は文字コード比較器の1段分の構成を示す
ブロック図、第7図は文字コード比較器エレメントの回
路図、第8図は認識結果のソーティングの説明図、第9
図は文字コードが重複した場合の認識結果のソーティン
グの説明図、第10図はソーティング動作時のシフトコ
ントロール部の処理フロー図である。 1・・・文字コード・シフトアレイ、 2・・・距離データ・シフトアレイ、 3・・・内部バス、 4・・・文字コードレジスタ、5
・・・距離データレジスタ、 7・・・シフトコントロール部、 8・・・距離データ比較器、 9・・・文字コード比較器、 11・・・シフトエレメント、 31・・・距離データ比較器エレメント、41・・・文
字コード比較器エレメント。 ト 一817− −よ。−這、勉騨 → 喝ψ n、yh−)阜ミぐ d υ 譜−−
Fig. 1 is a block diagram of an embodiment of the present invention, Fig. 2 is a block diagram of a shift array, Fig. 3 is a circuit diagram of a shift element, and Fig. 4 shows the configuration of one stage of a distance data comparator. Block diagram: FIG. 5 is a circuit diagram of the distance data comparator element; FIG. 6 is a block diagram showing the configuration of one stage of the character code comparator; FIG. 7 is a circuit diagram of the character code comparator element; Figure 9 is an explanatory diagram of sorting recognition results.
This figure is an explanatory diagram of sorting of recognition results when character codes overlap, and FIG. 10 is a processing flow diagram of the shift control section during sorting operation. 1...Character code shift array, 2...Distance data shift array, 3...Internal bus, 4...Character code register, 5
... Distance data register, 7... Shift control unit, 8... Distance data comparator, 9... Character code comparator, 11... Shift element, 31... Distance data comparator element, 41...Character code comparator element. Toichi 817--Yo. -Cree, study → ki ψ n, yh-) Fumigud υ fu--

Claims (2)

【特許請求の範囲】[Claims] (1)外部より入力されるデータおよびそのキーを保持
する手段と、ロードおよびシフトが可能なエレメントの
組合せからなる多段構成のデータ・シフトアレイおよび
キー・シフトアレイと、該データ・シフトアレイの各段
に保持された各データと該データ保持手段に保持された
データとを一斉に比較する手段と、該キー・シフトアレ
イの各段に保持された各キーと該キー保持手段に保持さ
れたキーとを一斉に比較する手段と、該各比較手段の比
較結果に従って該各シフトアレイの各段について一斉に
、該保持手段に保持されたデータおよびキーのロードお
よび該各シフトアレイの保持しているデータおよびキー
のシフトを順次制御することにより、該各シフトアレイ
上にデータおよびキーをキーの順番に従って配列させる
制御手段とを有することを特徴とするソーティング装置
(1) A data shift array and a key shift array having a multi-stage configuration consisting of a combination of elements that can be loaded and shifted; means for simultaneously comparing each data held in each stage with the data held in said data holding means; and each key held in each stage of said key shift array and the key held in said key holding means. loading the data and keys held in the holding means for each stage of each shift array at the same time according to the comparison results of each comparison means; and loading the data and keys held in each shift array at the same time 1. A sorting device comprising: control means for arranging data and keys on each shift array according to the order of keys by sequentially controlling shifts of data and keys.
(2)前記制御手段は、ソーティング結果を外部へ読み
出す際、各シフトアレイをアップダウン制御し、キーの
小さい順または大きい順にデータおよび/またはキーを
読み出すことを特徴とする請求項(1)記載のソーティ
ング装置。
(2) The control means, when reading out the sorting results to the outside, controls each shift array up and down, and reads out data and/or keys in ascending order of keys or in ascending order of keys. sorting device.
JP26726289A 1988-10-14 1989-10-13 Sorting device Pending JPH02193279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP26726289A JPH02193279A (en) 1988-10-14 1989-10-13 Sorting device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP25857688 1988-10-14
JP63-258576 1988-10-14
JP26726289A JPH02193279A (en) 1988-10-14 1989-10-13 Sorting device

Publications (1)

Publication Number Publication Date
JPH02193279A true JPH02193279A (en) 1990-07-30

Family

ID=26543732

Family Applications (1)

Application Number Title Priority Date Filing Date
JP26726289A Pending JPH02193279A (en) 1988-10-14 1989-10-13 Sorting device

Country Status (1)

Country Link
JP (1) JPH02193279A (en)

Similar Documents

Publication Publication Date Title
US9886017B2 (en) Counter operation in a state machine lattice
US9866218B2 (en) Boolean logic in a state machine lattice
US9275290B2 (en) Methods and systems for routing in a state machine
US5247688A (en) Character recognition sorting apparatus having comparators for simultaneous comparison of data and corresponding key against respective multistage shift arrays
US10698697B2 (en) Adaptive routing to avoid non-repairable memory and logic defects on automata processor
JPS6136849A (en) Systolic array for solving circulative loop dependant algorism
US5511189A (en) Data sorting apparatus capable of detecting completion of data sorting early and sorting method therefor
US20100057809A1 (en) Information storing/retrieving method and device for state transition table, and program
JPH0666050B2 (en) Sort processing method
JPH02193279A (en) Sorting device
JP2003099488A (en) Logical matching device
JP2540899B2 (en) Sorter memory management method
JP2587447B2 (en) Sorting device
JPS59148943A (en) Memory circuit
JPH07101382B2 (en) Margin processing device
JP2564881B2 (en) Bit string comparison method
SU1541593A1 (en) Comparison device
JPH03126129A (en) Sorting method
JPS61136181A (en) Production of dictionary for character recognizer
JPH01201722A (en) Sort processor
JPS63231526A (en) Sort processor
JPH02206830A (en) Merge processing method
JPH01102636A (en) Sorting circuit
JPS63298524A (en) Data retrieving system
JPS61136180A (en) Character recognizer