JP2887038B2 - Division processing unit - Google Patents

Division processing unit

Info

Publication number
JP2887038B2
JP2887038B2 JP5035246A JP3524693A JP2887038B2 JP 2887038 B2 JP2887038 B2 JP 2887038B2 JP 5035246 A JP5035246 A JP 5035246A JP 3524693 A JP3524693 A JP 3524693A JP 2887038 B2 JP2887038 B2 JP 2887038B2
Authority
JP
Japan
Prior art keywords
comparison
divisor
value
remainder
numerical value
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 - Fee Related
Application number
JP5035246A
Other languages
Japanese (ja)
Other versions
JPH06250826A (en
Inventor
亜紀子 嶋
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.)
PII EFU YUU KK
Original Assignee
PII EFU YUU KK
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 PII EFU YUU KK filed Critical PII EFU YUU KK
Priority to JP5035246A priority Critical patent/JP2887038B2/en
Publication of JPH06250826A publication Critical patent/JPH06250826A/en
Application granted granted Critical
Publication of JP2887038B2 publication Critical patent/JP2887038B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は,除算処理装置,特に除
数が限定されている場合において除算により商と余りを
算出する除算処理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a division processing apparatus, and more particularly to a division processing apparatus for calculating a quotient and a remainder by division when a divisor is limited.

【0002】[0002]

【従来の技術】数値データを転送する際,転送中に生じ
る誤りに対処するために,数値データの末尾にチェック
ディジィットを付して転送している。
2. Description of the Related Art When transferring numerical data, a check digit is added to the end of the numerical data in order to cope with an error occurring during the transfer.

【0003】チェックデジットには,代表的なものとし
て,次の方法がある。 a.モジュラス7 b.モジュラス9 c.モジュラス10 d.モジュラス11 これらの方法では,数値データを7,9,10,または
11で 除算した結果得られる余りを利用してチェック
デジットを作成する。
The check digit is typically represented by the following method. a. Modulus 7 b. Modulus 9 c. Modulus 10 d. Modulus 11 These methods use the remainder obtained by dividing the numeric data by 7, 9, 10, or 11 to check
Create a digit .

【0004】例えば,数値データ「12345678
9」に対してモジュラス7方法によりチェックデジット
を作成する場合,次のように行う。123456789
÷7=17636684余り1したがって,チェックデ
ジットは1となり,転送データは,123456789
1のようになる。
For example, numerical data "12345678"
In the case where a check digit is created for the "9" by the modulus 7 method, the following is performed. 123456789
÷ 7 = 17636684 remainder 1 Therefore, check
The jet becomes 1 and the transfer data is 123456789.
It looks like 1.

【0005】また,数値データの受信側では,チェック
デジットチェックを行って,受信した数値データの誤り
の有無を確認している。チェックデジットチェックに
は,代表的なものとして,次の方法がある。
On the receiving side of numerical data, a check is performed.
A digit check is performed to confirm whether the received numerical data has an error. Check digit checks include the following methods as typical ones.

【0006】a.モジュラス7チェック b.モジュラス9チェック c.モジュラス10チェック d.モジュラス11チェック これらの方法においても,受信データを7,9,10,
または11で除算した結果得られる余りを利用する。
A. Modulus 7 check b. Modulus 9 check c. Modulus 10 check d. Modulus 11 check In these methods as well, the received data is 7, 9, 10,
Alternatively, the remainder obtained by dividing by 11 is used.

【0007】このように,数値データ処理においては,
限定された除数(上記の場合,7,9,10,または1
1)を使用する除算が頻繁に行われている。従来は,上
述したような限定された除数を使用する除算も,通常の
除算と同じく,XX÷xx(被除数÷除数)という処理
の繰り返しによって,結果である商と余りを算出してい
た。
Thus, in the numerical data processing,
Limited divisor (7, 9, 10, or 1 in the above case)
Division using (1) is frequently performed. Conventionally, in the division using the limited divisor as described above, the quotient and the remainder are calculated by repeating the process of XX ÷ xx (dividend ÷ divisor), similarly to the usual division.

【0008】[0008]

【発明が解決しようとする課題】上述したように,従来
は,限定された除数を使用する除算も,通常の除算と同
じく,XX÷xx(被除数÷除数)という処理の繰り返
しによって,結果である商と余りを算出していたので,
処理速度が遅い,という問題があった。
As described above, conventionally, a division using a limited divisor is the same as a normal division by repeating a process of XX ÷ xx (dividend ÷ divisor). Since the quotient and remainder were calculated,
There was a problem that the processing speed was slow.

【0009】本発明は,上記の問題点を解決して,除算
の高速化を実現することのできる除算処理装置,特に除
数が限定されている場合において除算により商と余りを
算出する除算処理装置を提供することを目的とする。
The present invention solves the above-mentioned problems, and realizes a high-speed division processing apparatus. In particular, a division processing apparatus for calculating a quotient and a remainder by division when the divisor is limited. The purpose is to provide.

【0010】[0010]

【課題を解決するための手段】上記の目的を達成するた
めに,本発明に係る除算処理装置は,次のように構成す
る。
In order to achieve the above object, a division processing apparatus according to the present invention is configured as follows.

【0011】(1)被除数を上位桁から順次除数で除算
して商および余りを算出する除算処理装置であって,
数1〜9から成るインデックスの各々ごとに、除数のイ
ンデックス倍の比較数値を対応づけた除数テーブルと、
除数テーブルから比較数値を選択する比較数値設定部
と、 被除数の先頭から1桁ずつ切りだした数値と,前回
算出された余りとを合成して次の比較対象数値を生成
る比較対象数値生成部と、 生成された比較対象数値ごと
に、該比較対象数値と除数テーブルから選択された比較
数値とを比較し、比較対象数値よりも小さくかつもっと
も比較対象数値に近い比較数値を決定する比較演算処理
部と、 決定された比較数値に対応するインデックスを商
として出力する商同定処理部と、 比較対象数値から上記
決定された比較数値を減算して余りを算出する余り算出
部とを備え、比較演算処理部は,除数テーブルのインデ
ックスの中央値に対応する、除数の倍数の数値を比較数
の初期値として選択して設定し、その後、比較演算処
理部により比較対象数値と該比較数値の初期値との比較
演算結果の大小関係に応じて、現在選択されているイン
デックスを中心としてその上側領域あるいは下側領域に
おけるいずれかの中央値の除数の倍数を次の比較数値と
して選択して設定し、以下同様にして比較演算結果に応
じて比較数値の設定を行うように構成する。
[0011] (1) dividend to a division processing device by dividing sequentially the divisor from the upper digit to calculate the quotient and remainder, each respective index consisting integer <br/> number 1-9, the divisor b
A divisor table that associates the comparison value of index times with a divisor table,
Comparative numerical value setting section that selects a comparative numerical value from the divisor table
And the number cut out one digit at a time from the beginning of the dividend
And a remainder calculated synthesized to generate the following comparison object values
Comparable numerical value generator and each generated comparative numerical value
The comparison value and the comparison selected from the divisor table
Compare with the numerical value, and it is smaller and more than
Operation to determine a comparison value close to the comparison target value
And the index corresponding to the determined comparison value
A quotient identification processing unit for outputting as said from the comparison object values
Calculate the remainder by subtracting the determined comparison value and calculating the remainder
The comparison operation processing unit selects and sets a multiple value of the divisor corresponding to the median value of the index of the divisor table as an initial value of the comparison value , and thereafter performs the comparison operation processing.
Comparison of the comparison value with the initial value of the comparison value
The currently selected input is selected according to the magnitude relation of the calculation result.
In the upper or lower area around the index
The multiple of the divisor of one of the medians in
To select and set, and then follow the same
The comparison value is set in the same way.

【0012】(2)前記(1)の除算処理装置におい
て、除数テーブル,予め除算処理装置内のメモリに格
納されているように構成する。
(2) In the division processing device of the above (1), the divisor table is configured to be stored in advance in a memory in the division processing device .

【0013】(3)前記(1)の除算処理装置におい
て,除数テーブルは、入力された除数に基づいて,メモ
リ上に作成されるように構成する。
(3) In the division processing device of (1), the divisor table stores a memo based on the inputted divisor.
To be created on the server.

【0014】図1は,本発明の基本構成を示す図であ
る。図中,11は除数設定部,12は被除数入力部,1
3は除算処理装置,14は除数テーブル,15は被除数
保持部,16は比較数値設定部,17は比較対象数値生
成部,18は比較演算処理部,19は商同定処理部,2
0は余り算出部,21は結果出力部である。
FIG. 1 is a diagram showing a basic configuration of the present invention. In the figure, 11 is a divisor setting unit, 12 is a dividend input unit, 1
3 is a division processing device, 14 is a divisor table, 15 is a dividend holding unit, 16 is a comparative numerical value setting unit, 17 is a comparison target numerical value generating unit, 18 is a comparison operation processing unit, 19 is a quotient identification processing unit, 2
0 is a remainder calculation unit, and 21 is a result output unit.

【0015】除数設定部11は,除数を設定するための
ものである。被除数入力部12は,被除数を入力するた
めのものである。除算処理装置13は,入力された被除
数と除数とから商および余りを算出するものであり,除
数テーブル14,被除数保持部15,比較数値設定部1
6,比較対象数値生成部17,比較演算処理部18,商
同定処理部19,および余り算出部20が設けられてい
る。
The divisor setting section 11 is for setting a divisor. The dividend input unit 12 is for inputting a dividend. The division processing device 13 calculates a quotient and a remainder from the input dividend and the divisor. The divisor table 14, the dividend holding unit 15, and the comparative numerical value setting unit 1
6, a comparison target numerical value generation unit 17, a comparison operation processing unit 18, a quotient identification processing unit 19, and a remainder calculation unit 20 are provided.

【0016】除数テーブル14は,整数1〜9から成る
インデックスに,除数の1倍の数値,除数の2倍の数
値,除数の3倍の数値,除数の4倍の数値,除数の5倍
の数値,除数の6倍の数値,除数の7倍の数値,除数の
8倍の数値,および除数の9倍の数値が対応されたもの
から成る。
The divisor table 14 stores, in the index composed of integers 1 to 9, numerical values that are 1 times the divisor, 2 times the divisor, 3 times the divisor, 4 times the divisor, and 5 times the divisor. Numerical values, six times the divisor, seven times the divisor, eight times the divisor, and nine times the divisor correspond.

【0017】被除数保持部15は,被除数入力部12か
ら入力された被除数を保持する。比較数値設定部16
は,初期値としてインデックス5に対応する,除数の5
倍の数値を比較数値として設定し,その後,比較演算処
理部18の処理結果に応じて所定のインデックスに対応
する除数の倍数を比較数値として設定する。
The dividend storage unit 15 stores the dividend input from the dividend input unit 12. Comparative numerical value setting section 16
Is the divisor of 5 corresponding to index 5 as the initial value.
A multiple value is set as a comparison value, and then a multiple of a divisor corresponding to a predetermined index is set as a comparison value according to the processing result of the comparison operation processing unit 18.

【0018】比較対象数値生成部17は,被除数保持部
15が保持している被除数を先頭から1桁ずつ切りだし
たものと,余り算出部20が算出する余りとから,比較
対象数値を生成する。
The comparison target numerical value generating section 17 generates a comparison target numerical value from the dividend stored in the dividend storage section 15 by one digit from the beginning and the remainder calculated by the remainder calculation section 20. .

【0019】比較演算処理部18は,比較対象数値生成
部17が生成する比較対象数値と,比較数値設定部16
が設定する比較数値とを比較演算処理し,その比較演算
処理結果に応じて,商同定処理部19または比較数値設
定部16に制御を移す。
The comparison operation processing unit 18 compares the comparison target value generated by the comparison target value generation unit 17 with the comparison value setting unit 16.
Performs the comparison operation with the comparison numerical value set by, and transfers the control to the quotient identification processing unit 19 or the comparison numerical value setting unit 16 according to the result of the comparison operation processing.

【0020】結果出力部21は,除算処理装置13が算
出した商および余りを出力する。
The result output unit 21 outputs the quotient and remainder calculated by the division processing unit 13.

【0021】[0021]

【作用】図2は,図1に示す除算処理装置13内に設け
られた比較演算処理部18の動作フローを示す図であ
る。
FIG. 2 is a diagram showing an operation flow of the comparison operation processing section 18 provided in the division processing apparatus 13 shown in FIG.

【0022】以下,図1および図2を用いて,本発明に
係る除算処理装置13の動作を説明する。まず,除数設
定部11に除数7(seven)を設定する。すると,
除算処理装置13内に,図1に示す除数テーブル14が
設定される。
Hereinafter, the operation of the division processing device 13 according to the present invention will be described with reference to FIGS. First, the divisor 7 is set in the divisor setting unit 11. Then
The divisor table 14 shown in FIG. 1 is set in the division processing device 13.

【0023】除数テーブル14は,整数1〜9から成る
インデックスIに,除数7の1倍の数値(7),除数7
の2倍の数値(14),除数7の3倍の数値(21),
除数7の4倍の数値(28),除数7の5倍の数値(3
5),除数7の6倍の数値(42),除数7の7倍の数
値(49),除数7の8倍の数値(56),および除数
7の9倍の数値(63)が対応されたものから成る。
The divisor table 14 stores, in an index I consisting of integers 1 to 9, a numerical value (7) that is one time the divisor 7 and a divisor 7
A value twice as large as (14), a value as three times as large as divisor 7 (21),
Numerical value 4 times divisor 7 (28), Numerical value 5 times divisor 7 (3
5), 6 times the divisor 7 (42), 7 times the divisor 7 (49), 8 times the divisor 7 (56), and 9 times the divisor 7 (63) Consisting of

【0024】以下では,煩瑣を避けて,インデックスI
に対応する除数をTBL[I]と表すことにする。(例
えば,除数テーブル14において,除数7の3倍の数値
は,TBL[3]と表される。)除数テーブル14の設
定には,次の方式がある。
In the following, the index I
Is represented as TBL [I]. (For example, in the divisor table 14, a value that is three times the divisor 7 is represented as TBL [3].) The divisor table 14 is set in the following manner.

【0025】(1)予め除算処理装置13内のメモリに
複数個の除数に対応する除数テーブルを格納しておき,
その中から除数7(seven)に対応するものを選択
する方式。
(1) A divisor table corresponding to a plurality of divisors is stored in a memory in the division processing device 13 in advance,
A method of selecting one corresponding to a divisor of 7 (seven) from among them.

【0026】(2)除数設定部11から入力された除数
7(seven)に基づいて,除算処理装置13がその
内部メモリ上に除数テーブル14を作成する方式。除数
テーブル14が設定された除算処理装置13に,被除数
入力部12から被除数H=H1 2 3 ・・・Hn が入
力される。入力された被除数Hは,被除数保持部15に
「H=H1 2 3 ・・・Hn 」のように格納される。
(2) A method in which the division processing unit 13 creates a divisor table 14 in its internal memory based on the divisor 7 (seven) input from the divisor setting unit 11. The dividend H = H 1 H 2 H 3 ... H n is input from the dividend input unit 12 to the division processing device 13 in which the divisor table 14 is set. The input dividend H is stored in the dividend holding unit 15 as “H = H 1 H 2 H 3 ... H n ”.

【0027】初期値として,比較数値設定部16は,T
BL[5]を設定する。比較対象数値生成部17は,被
除数保持部15が保持する被除数Hの始めの1桁H
1 と,余り算出部20が算出する余りA(=0,初期
値)とを合成して,比較対象数値K=AH1 を生成す
る。
As an initial value, the comparison numerical value setting unit 16
BL [5] is set. The comparison target numerical value generation unit 17 calculates the first digit H of the dividend H held by the dividend holding unit 15.
1 and the remainder A (= 0, initial value) calculated by the remainder calculation unit 20 are combined to generate a comparison target value K = AH 1 .

【0028】以下,本発明に係る除算処理装置13は,
次のように動作する。 比較演算処理部18が,比較対象数値Kと,TBL
[5]とを比較する。両者が等しい場合,その結果を商
同定処理部19に通知する。商同定処理部19は,商S
1 が5であることを結果出力部21へ出力し,余り算出
部20は,余りAが0であることを算出し,その結果を
比較対象数値生成部17へ通知する。
Hereinafter, the division processing device 13 according to the present invention
It works as follows. The comparison processing unit 18 compares the comparison target value K with the TBL
Compare with [5]. If both are equal, the result is notified to the quotient identification processing unit 19. The quotient identification processing unit 19
The fact that 1 is 5 is output to the result output unit 21, and the remainder calculation unit 20 calculates that the remainder A is 0, and notifies the comparison target numerical value generation unit 17 of the result.

【0029】前者が後者より小さい場合,の処理を行
う。前者が後者より大きい場合,の処理を行う。 比較演算処理部18が,比較対象数値Kと,TBL
[3]とを比較する。
If the former is smaller than the latter, the following processing is performed. If the former is greater than the latter, perform the processing of. The comparison processing unit 18 compares the comparison target value K with the TBL
Compare with [3].

【0030】両者が等しい場合,その結果を商同定処理
部19に通知する。商同定処理部19は,商S1 が3で
あることを結果出力部21へ出力し,余り算出部20
は,余りAが0であることを算出し,その結果を比較対
象数値生成部17へ通知する。
When both are equal, the result is notified to the quotient identification processing section 19. The quotient identification processing unit 19 outputs to the result output unit 21 that the quotient S 1 is 3, and outputs the remainder calculation unit 20
Calculates that the remainder A is 0, and notifies the comparison target numerical value generation unit 17 of the result.

【0031】前者が後者より小さい場合,の処理を行
う。前者が後者より大きい場合,の処理を行う。 比較演算処理部18が,比較対象数値Kと,TBL
[2]とを比較する。
If the former is smaller than the latter, the following processing is performed. If the former is greater than the latter, perform the processing of. The comparison processing unit 18 compares the comparison target value K with the TBL
Compare with [2].

【0032】両者が等しいか,または前者が後者より大
きい場合,その結果を商同定処理部19へ通知する。商
同定処理部19は,商S1 が2であることを結果出力部
21へ出力し,余り算出部20は,余りAを算出し,そ
の結果を比較対象数値生成部17へ通知する。
If both are equal or the former is greater than the latter, the result is notified to the quotient identification processing unit 19. The quotient identification processing unit 19 outputs that the quotient S 1 is 2 to the result output unit 21, the remainder calculation unit 20 calculates the remainder A, and notifies the comparison target numerical value generation unit 17 of the result.

【0033】前者が後者より小さい場合,の処理を行
う。 比較演算処理部18が,比較対象数値Kと,TBL
[1]とを比較し,その結果を商同定処理部19へ通知
する。
If the former is smaller than the latter, the following processing is performed. The comparison processing unit 18 compares the comparison target value K with the TBL
[1] and compares the result with the quotient identification processing unit 19.

【0034】商同定処理部19は,前者と後者が等しい
か,前者より後者が大きい場合,商S1 が1であること
を結果出力部21へ通知し,前者が後者より小さい場
合,商S1 が0であることを結果出力部21へ出力し,
余り算出部20は,余りAを算出し,その結果を比較対
象数値生成部17へ通知する。
The quotient identification processing unit 19 notifies the result output unit 21 that the quotient S 1 is 1 if the former is equal to or greater than the latter, and to the quotient S if the former is smaller than the latter. The fact that 1 is 0 is output to the result output unit 21,
The remainder calculation unit 20 calculates the remainder A and notifies the result to the comparison target numerical value generation unit 17.

【0035】 比較演算処理部18が,比較対象数値
Kと,TBL[4]とを比較し,その結果を商同定処理
部19へ通知する。商同定処理部は,前者と後者が等し
いか,前者より後者が大きい場合,商S1が4であるこ
とを結果出力部21へ通知し,前者が後者より小さい場
合,商S1が3であることを結果出力部21へ出力し,
余り算出部20は,余りAを算出し,その結果を比較対
象数値生成部17へ通知する。
The comparison operation processing unit 18 compares the comparison target numerical value K with TBL [4], and notifies the result to the quotient identification processing unit 19. The quotient identification processing unit notifies the result output unit 21 that the quotient S 1 is 4 when the former is equal to or the latter is larger than the former, and the quotient S 1 is 3 when the former is smaller than the latter. Is output to the result output unit 21,
The remainder calculation unit 20 calculates the remainder A and notifies the result to the comparison target numerical value generation unit 17.

【0036】 比較演算処理部18が,比較対象数値
Kと,TBL[7]とを比較する。両者が等しい場合,
その結果を商同定処理部19へ通知する。商同定処理部
19は,商S1 が7であることを結果出力部21へ出力
し,余り算出部20は,余りAが0であることを算出
し,その結果を比較対象数値生成部17へ通知する。
The comparison operation processing unit 18 compares the comparison target value K with TBL [7]. If they are equal,
The result is notified to the quotient identification processing unit 19. The quotient identification processing unit 19 outputs that the quotient S 1 is 7 to the result output unit 21, and the remainder calculating unit 20 calculates that the remainder A is 0, and outputs the result to the comparison target numerical value generating unit 17. Notify to

【0037】前者が後者より小さい場合,の処理を行
う。前者が後者より大きい場合,の処理を行う。 比較演算処理部18が,比較対象数値Kと,TBL
[6]とを比較し,その結果を商同定処理部19へ通知
する。
If the former is smaller than the latter, the following processing is performed. If the former is greater than the latter, perform the processing of. The comparison processing unit 18 compares the comparison target value K with the TBL
[6], and notifies the quotient identification processing unit 19 of the result.

【0038】商同定処理部19は,前者と後者が等しい
か,前者より後者が大きい場合,商S1 が6であること
を結果出力部21へ出力し,前者が後者より小さい場
合,商S1 が5であることを結果出力部21へ出力し,
余り算出部20は,余りAを算出し,その結果を比較対
象数値生成部17へ通知する。
The quotient identification processing section 19 outputs to the result output section 21 that the quotient S 1 is 6 when the former is equal to or greater than the latter, and outputs the quotient S 1 when the former is smaller than the latter. The fact that 1 is 5 is output to the result output unit 21,
The remainder calculation unit 20 calculates the remainder A and notifies the result to the comparison target numerical value generation unit 17.

【0039】 比較演算処理部18が,比較対象数値
Kと,TBL[9]とを比較する。両者が等しいか,ま
たは前者が後者より大きい場合,その結果を商同定処理
部19へ通知し,商同定処理部19は,商S1 が9であ
ることを結果出力部21へ出力し,余り算出部20は,
余りAを算出し,その結果を比較対象数値生成部17へ
通知する。
The comparison operation processing unit 18 compares the comparison target value K with TBL [9]. If either they are equal, or the former greater than the latter, and notifies the result to the quotient identification processing unit 19, the quotient identification processing unit 19 outputs the quotient S 1 is a 9 to the result output section 21, too The calculation unit 20
The remainder A is calculated, and the result is notified to the comparison target numerical value generation unit 17.

【0040】前者が後者より小さい場合,の処理を行
う。 比較演算処理部18が,比較対象数値Kと,TBL
[8]とを比較し,その結果を商同定処理部19へ通知
する。
If the former is smaller than the latter, the following processing is performed. The comparison processing unit 18 compares the comparison target value K with the TBL
[8], and notifies the quotient identification processing unit 19 of the result.

【0041】商同定処理部19は,前者と後者が等しい
か,前者より後者が大きい場合,商S1 が8であること
を結果出力部21へ出力し,前者が後者より小さい場
合,商S1 が7であることを結果出力部21へ出力し,
余り算出部20は,余りAを算出し,その結果を比較対
象数値生成部17へ通知する。
The quotient identification processing unit 19, the former and whether the latter are equal, if the latter is greater than the former, and outputs the quotient S 1 is a 8 to the result output section 21, if the former is smaller than the latter, the quotient S The fact that 1 is 7 is output to the result output unit 21,
The remainder calculation unit 20 calculates the remainder A and notifies the result to the comparison target numerical value generation unit 17.

【0042】以上で,被除数Hの始めの1桁H1 に対す
る除算が終了する。上述のように,文章にすると長くな
るが,〜の処理は,最大限4段階の比較処理である
ので,従来の繰り返し除算に比べると,はるかに短時間
で処理が終了する。
With the above, the division for the first digit H 1 of the dividend H is completed. As described above, the length of a sentence becomes longer, but since the processing (1) to (4) is a maximum of four-stage comparison processing, the processing is completed in a much shorter time than the conventional iterative division.

【0043】以下同様に,被除数Hの2桁目以降(H2
3 ・・・Hn )の除算を行い,結果出力部21に,商
S=S1 2 3 ・・・,および余りAを得る。 (具体例)851÷7 1.1桁目 A=0 → K=8 K=8 < TBL[5]=35 K=8 < TBL[3]=21 K=8 < TBL[2]=14 K=8 > TBL[1]=7 ∴ 商S1 =1,余りA=8−7=1 2.2桁目 A=1 → K=15 K=15 < TBL[5]=35 K=15 < TBL[3]=21 K=15 > TBL[2]=14 ∴ 商S2 =2,余りA=15−14=1 3.3桁目 A=1 → K=11 K=11 < TBL[5]=35 K=11 < TBL[3]=21 K=11 < TBL[2]=14 K=11 > TBL[1]=7 ∴ 商S3 =1,余りA=11−7=4 以上の結果から, 851÷7=S1 2 3 =121余り4 が算出された。
Similarly, the second and subsequent digits of the dividend H (H 2
H 3 ... H n ), and a quotient S = S 1 S 2 S 3 ... (Specific example) 851 ÷ 7 1.1st digit A = 0 → K = 8 K = 8 <TBL [5] = 35 K = 8 <TBL [3] = 21 K = 8 <TBL [2] = 14K = 8> TBL [1] = 7 ∴ Quotient S 1 = 1, remainder A = 8−7 = 1 2.2nd digit A = 1 → K = 15 K = 15 <TBL [5] = 35 K = 15 < TBL [3] = 21 K = 15> TBL [2] = 14 ∴ Quotient S 2 = 2, remainder A = 15−14 = 1 3.3rd digit A = 1 → K = 11 K = 11 <TBL [5 ] = 35 K = 11 <TBL [3] = 21 K = 11 <TBL [2] = 14 K = 11> TBL [1] = 7 ∴ S 3 = 1, remainder A = 11−7 = 4 From the results, 851 ÷ 7 = S 1 S 2 S 3 = 121 remainder 4 was calculated.

【0044】以上の説明から分かるように,数値データ
をパック10進数で表すと,比較対象数値生成部17
が,被除数保持部15が保持する被除数Hの各桁H
i と,余り算出部20が算出する余りAとを合成して,
比較対象数値K=AHi を生成する処理が極めて簡単化
されるので,除算の処理速度がより向上する。
As can be understood from the above description, when the numerical data is represented by a packed decimal number, the comparison target numerical value generation unit 17
Is the digit H of the dividend H held by the dividend holding unit 15.
i and the remainder A calculated by the remainder calculation unit 20 are synthesized,
Since the process of generating the comparison object value K = AH i is extremely simplified, the processing speed of the division is further improved.

【0045】[0045]

【実施例】上述したように, 除数テーブル14の設定
には,次の方式がある。 (1)予め除算処理装置13内のメモリに複数個の除数
に対応する除数テーブルを格納しておき,その中から除
数に対応するものを選択する方式。
DESCRIPTION OF THE PREFERRED EMBODIMENTS As described above, there are the following methods for setting the divisor table 14. (1) A method in which a divisor table corresponding to a plurality of divisors is stored in a memory in the division processing device 13 in advance, and a table corresponding to the divisor is selected from the tables.

【0046】(2)除数設定部11から入力された除数
に基づいて,除算処理装置13がその内部メモリ上に除
数テーブル14を作成する方式。図3は,上記(1)に
示す方式の除数テーブルの例を示す図である。同図は,
7の倍数から成る除数テーブル,9の倍数から成る除数
テーブル,10の倍数から成る除数テーブル,および1
1の倍数から成る除数テーブルが,図1に示す除算処理
装置13内に設けられたメモリ内に格納されている様子
を示している。
(2) A method in which the division processing unit 13 creates a divisor table 14 in its internal memory based on the divisor input from the divisor setting unit 11. FIG. 3 is a diagram showing an example of the divisor table of the method shown in (1). The figure shows
A divisor table consisting of multiples of 7, a divisor table consisting of multiples of 9, a divisor table consisting of multiples of 10, and 1
2 shows a state in which a divisor table composed of multiples of 1 is stored in a memory provided in the division processing device 13 shown in FIG.

【0047】図3では,4個の除数テーブルが格納され
ている場合を示したが,除数テーブル記憶部に格納され
る除数テーブルは,これらのうちの一つでも,二つで
も,適当な個数でよい。また,図示した除数(7,9,
10,11)以外の除数の倍数から成る除数テーブルを
格納してもよい。
Although FIG. 3 shows a case where four divisor tables are stored, the divisor table stored in the divisor table storage unit may be one or two of these tables. Is fine. Also, the divisors shown (7, 9,
A divisor table composed of multiples of the divisor other than (10, 11) may be stored.

【0048】以下,具体例を基に,本発明に係る除算処
理装置の動作を説明する。図4は,123456789
0÷7を本発明に係る除算処理装置が実行する際の具体
的な動作を説明する図である。図1に示す除算処理装置
13内に設けられた比較演算処理部18の動作フローを
示す図3と共に上記の除算をステップごとに順を追って
説明する。
Hereinafter, the operation of the division processing device according to the present invention will be described based on a specific example. FIG.
It is a figure explaining the concrete operation | movement at the time of performing the division | segmentation processing apparatus which concerns on this invention about 0 @ 7. The above-described division will be described step by step in conjunction with FIG. 3 showing the operation flow of the comparison operation processing section 18 provided in the division processing apparatus 13 shown in FIG.

【0049】使用する除数テーブルは,次のものであ
る。 seven ={7,14,21,28,35,42,49,56,63 } この場合も,以前と同じく,第I番目(インデックス=
I)の数値を TBL[I] と表す。
The divisor table used is as follows. seven = {7,14,21,28,35,42,49,56,63} In this case, the I-th index (index =
The numerical value of I) is represented as TBL [I].

【0050】なお,図4の左下に記載したように,数
1,数2,および数3は,次のように定義されている。
数1は,前の繰り越しの数,すなわち前ステップの余り
である。
As described at the lower left of FIG. 4, Equations 1, 2, and 3 are defined as follows.
Equation 1 is the number of previous carry-overs, that is, the remainder of the previous step.

【0051】数2は,被除数から取り出した数である。
数3は,比較対象として生成された数,すなわち,図1
において,比較対象数値生成部17が生成する数であ
る。
Equation 2 is a number extracted from the dividend.
Equation 3 is a number generated as a comparison object, that is, FIG.
Is a number generated by the comparison target numerical value generation unit 17.

【0052】(ステップ1) 数1=0,数2=1 → 数3=1 数3 < TBL[5] 数3 < TBL[3] 数3 < TBL[2] 数3 < TBL[1] ∴ 商S1 =0,余りA=1 (ステップ2) 数1=1,数2=2 → 数3=12 数3 < TBL[5] 数3 < TBL[3] 数3 < TBL[2] 数3 > TBL[1] ∴ 商S2 =1,余りA=5 (ステップ3) 数1=5,数2=3 → 数3=53 数3 > TBL[5] 数3 > TBL[7] 数3 < TBL[9] 数3 < TBL[8] ∴ 商S3 =7,余りA=4 (ステップ4) 数1=4,数2=4 → 数3=44 数3 > TBL[5] 数3 < TBL[7] 数3 > TBL[6] ∴ 商S4 =6,余りA=2 (ステップ5) 数1=2,数2=5 → 数3=25 数3 > TBL[5] 数3 < TBL[7] 数3 > TBL[6] ∴ 商S5 =3,余りA=4 (ステップ6) 数1=4,数2=6 → 数3=46 数3 > TBL[5] 数3 < TBL[7] 数3 > TBL[6] ∴ 商S6 =6,余りA=4 (ステップ7) 数1=4,数2=7 → 数3=47 数3 > TBL[5] 数3 < TBL[7] 数3 > TBL[6] ∴ 商S7 =6,余りA=5 (ステップ8) 数1=5,数2=8 → 数3=58 数3 > TBL[5] 数3 > TBL[7] 数3 < TBL[9] 数3 > TBL[8] ∴ 商S8 =8,余りA=2 (ステップ9) 数1=2,数2=9 → 数3=29 数3 < TBL[5] 数3 > TBL[3] 数3 > TBL[4] ∴ 商S9 =4,余りA=1 (ステップ10) 数1=1,数2=0 → 数3=10 数3 < TBL[5] 数3 < TBL[3] 数3 < TBL[2] 数3 > TBL[1] ∴ 商S10=1,余りA=3 以上の各ステップを経て, 1234567890÷7 の結果は,次の通りになる。(Step 1) Equation 1 = 0, Equation 2 = 1 → Equation 3 = 1 Equation 3 <TBL [5] Equation 3 <TBL [3] Equation 3 <TBL [2] Equation 3 <TBL [1] Quotient S 1 = 0, remainder A = 1 (Step 2) Equation 1 = 1, Equation 2 = 2 → Equation 3 = 12 Equation 3 <TBL [5] Equation 3 <TBL [3] Equation 3 <TBL [2] Equation 3> TBL [1] ∴ quotient S 2 = 1, remainder A = 5 (Step 3) Equation 1 = 5, Equation 2 = 3 → Equation 3 = 53 Equation 3> TBL [5] Equation 3> TBL [7] 3 <TBL [9] Equation 3 <TBL [8] 商 quotient S 3 = 7, remainder A = 4 (Step 4) Equation 1 = 4, Equation 2 = 4 → Equation 3 = 44 Equation 3> TBL [5] Number 3 <TBL [7] Equation 3> TBL [6] ∴ Quotient S 4 = 6, remainder A = 2 (Step 5) Equation 1 = 2, Equation 2 = 5 → Equation 3 = 25 Equation 3> TBL [5] Number 3 <TBL [7] number 3> TBL [6] ∴ quotient S 5 = 3, remainder A = 4 (step 6) number 1 = 4, number 2 = 6 → number 3 = 46 number 3> TBL [5] number 3 <TBL [7] number 3> TBL [6] ∴ quotient S 6 = 6, remainder A = 4 (step 7) number 1 = 4, number 2 = 7 → number 3 = 47 number 3> TBL [5] number 3 <TBL [7] number 3> TBL [6] ∴ quotient S 7 = 6, remainder A = 5 (step 8) number 1 = 5, number 2 = 8 → number 3 = 58 number 3> TBL [5] number 3> TBL [7] Equation 3 <TBL [9] Equation 3> TBL [8] ∴ S 8 = 8, remainder A = 2 (Step 9) Equation 1 = 2, Equation 2 = 9 → Equation 3 = 29 3 <TBL [5] Equation 3> TBL [3] Equation 3> TBL [4] ∴ S 9 = 4, remainder A = 1 (Step 10) Equation 1 = 1, Equation 2 = 0 → Equation 3 = 10 3 < TBL [5] Equation 3 <TBL [3] Equation 3 <TBL [2] Equation 3> TBL [1] 商 S 10 = 1, remainder A = 3 Through the above steps, the result of 12345678890 ÷ 7 is It is as follows.

【0053】 本発明に係る除算処理装置には,種々の用途が考えられ
るが,OCR装置によって読み込んだ数値データにチェ
ックデジットを付与する際のパック除算に適用したとこ
ろ,従来の装置に比べて処理速度が大幅に向上した。
[0053] The division processing apparatus according to the present invention, various applications are conceivable, Choi numerical data read by the OCR device
When applied to pack division when giving a digit , the processing speed was greatly improved compared to the conventional device.

【0054】[0054]

【発明の効果】本発明によれば,除算処理装置,特に除
数が限定されている場合において除算により商と余りを
算出する除算処理装置において,除算の高速化を実現す
ることができる。
According to the present invention, the speed of division can be increased in a division processing device, particularly in a division processing device that calculates a quotient and a remainder by division when the divisor is limited.

【0055】その結果,例えば,本発明に係る除算処理
装置を,OCR装置によって読み込んだ数値のパック除
算に適用すると,従来の装置に比べて処理速度の大幅な
向上が実現する。
As a result, for example, when the division processing device according to the present invention is applied to the pack division of the numerical value read by the OCR device, the processing speed is greatly improved as compared with the conventional device.

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

【図1】本発明の基本構成を示す図である。FIG. 1 is a diagram showing a basic configuration of the present invention.

【図2】比較演算処理部の動作フローを示す図である。FIG. 2 is a diagram showing an operation flow of a comparison operation processing unit.

【図3】除数テーブルの例を示す図である。FIG. 3 is a diagram illustrating an example of a divisor table.

【図4】除算の例を示す図である。FIG. 4 is a diagram illustrating an example of division.

【符号の説明】[Explanation of symbols]

11 除数設定部 12 被除数入力部 13 除算処理装置 14 除数テーブル 15 被除数保持部 16 比較数値設定部 17 比較対象数値生成部 18 比較演算処理部 19 商同定処理部 20 余り算出部 21 結果出力部 Reference Signs List 11 divisor setting unit 12 dividend input unit 13 division processing unit 14 divisor table 15 dividend holding unit 16 comparative numerical value setting unit 17 comparison numerical value generation unit 18 comparison arithmetic processing unit 19 quotient identification processing unit 20 remainder calculation unit 21 result output unit

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 被除数を上位桁から順次除数で除算して
商および余りを算出する除算処理装置であって, 数1〜9から成るインデックスの各々ごとに、除数の
インデックス倍の比較数値を対応づけた除数テーブル
と、 除数テーブルから比較数値を選択する比較数値設定部
と、 被除数の 先頭から1桁ずつ切りだした数値と,前回算出
された余りとを合成して次の比較対象数値を生成する比
較対象数値生成部と、 生成された比較対象数値ごとに、該比較対象数値と除数
テーブルから選択された比較数値とを比較し、比較対象
数値よりも小さくかつもっとも比較対象数値に近い比較
数値を決定する比較演算処理部と、 決定された比較数値に対応するインデックスを商として
出力する商同定処理部と、 比較対象数値から上記決定された比較数値を減算して余
りを算出する余り算出部とを備え、 比較数値設定部は,除数テーブルのインデックスの中央
値に対応する、除数の倍数の数値を比較数値の初期値
して選択して設定し、その後、比較演算処理部により比
較対象数値と該比較数値の初期値との比較演算結果の大
小関係に応じて、現在選択されているインデックスを中
心としてその上側領域あるいは下側領域におけるいずれ
かの中央値の除数の倍数を次の比較数値として選択して
設定し、以下同様にして比較演算結果に応じて比較数値
の設定を行うものであることを特徴とする除算処理装
置。
The method according to claim 1] dividend A division processing unit by dividing sequentially the divisor from the upper digit to calculate the quotient and remainder, each respective index consisting of integer numbers 1 to 9, the divisor
Divisor table that associates the comparison value of index times
And a comparison value setting section that selects a comparison value from the divisor table
And the numerical value obtained by cutting out one digit from the beginning of the dividend, and the previous calculation
Ratio that combines the remainder with the sum to produce the next comparison value
A comparison target numerical value generating unit, and for each generated comparison target numerical value, the comparison target numerical value and the divisor.
Compare with the comparison value selected from the table, and compare
Comparison smaller than the numerical value and closest to the numerical value to be compared
A comparison operation processing unit for determining a numerical value, and an index corresponding to the determined comparative value as a quotient
The output quotient identification processing section subtracts the determined comparison value from the comparison value and outputs the remainder.
And a remainder calculating unit for calculating the remainder, wherein the comparative numerical value setting unit is provided at the center of the divisor table index .
A value corresponding to a multiple of the divisor corresponding to the value is selected and set as an initial value of the comparison value , and then the comparison operation processing unit performs the comparison.
The value of the comparison operation result between the comparison target value and the initial value of the comparison value
The currently selected index is set according to the
Either in the upper or lower region as a heart
Select a multiple of the median divisor as the next comparison value
Set, and then compare the numerical value according to the comparison operation result
A division processing device for setting the following .
【請求項2】 請求項1において, 除数テーブルは,予め除算処理装置内のメモリに格納さ
れていることを特徴とする除算処理装置。
2. The division processing device according to claim 1, wherein the divisor table is stored in a memory of the division processing device in advance.
【請求項3】 請求項1において,除数テーブルは、 入力された除数に基づいて,メモリ上
に作成されるものであることを特徴とする除算処理装
置。
3. The divisor table according to claim 1, wherein the divisor table is stored in a memory based on the input divisor.
A division processing device characterized in that the division processing device is created .
JP5035246A 1993-02-24 1993-02-24 Division processing unit Expired - Fee Related JP2887038B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5035246A JP2887038B2 (en) 1993-02-24 1993-02-24 Division processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5035246A JP2887038B2 (en) 1993-02-24 1993-02-24 Division processing unit

Publications (2)

Publication Number Publication Date
JPH06250826A JPH06250826A (en) 1994-09-09
JP2887038B2 true JP2887038B2 (en) 1999-04-26

Family

ID=12436484

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5035246A Expired - Fee Related JP2887038B2 (en) 1993-02-24 1993-02-24 Division processing unit

Country Status (1)

Country Link
JP (1) JP2887038B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6049920B1 (en) * 2016-01-15 2016-12-21 株式会社 ディー・エヌ・エー Information processing apparatus and information processing program

Also Published As

Publication number Publication date
JPH06250826A (en) 1994-09-09

Similar Documents

Publication Publication Date Title
US8793300B2 (en) Montgomery multiplication circuit
KR100756137B1 (en) Division and square root arithmetic unit
US7543008B1 (en) Apparatus and method for providing higher radix redundant digit lookup tables for recoding and compressing function values
EP1475699B1 (en) Multiplier
US6018758A (en) Squarer with diagonal row merged into folded partial product array
EP3614257B1 (en) Float division by constant integer
JP3551113B2 (en) Divider
US5944776A (en) Fast carry-sum form booth encoder
JP2887038B2 (en) Division processing unit
JPH0317132B2 (en)
JP3660075B2 (en) Dividing device
US6938064B1 (en) Method for computing fast Fourier transform and inverse fast Fourier transform
JPS58129653A (en) Multiplication system
JP2737933B2 (en) Division device
JP4202701B2 (en) Polynomial residue arithmetic unit, method and program
JP5072558B2 (en) Data processing device
JPH0468656B2 (en)
JP2781658B2 (en) Address generation circuit and CD-ROM device using the same
JP2000010763A (en) Division circuit
JP3136709B2 (en) Exponentiation unit
JPH0628153A (en) Low-error calculation processor
CN113544684A (en) Data replacement device, data replacement method, and program
JPH06110661A (en) Divider
JP3074910B2 (en) Division device
JPH06149666A (en) Data compressor

Legal Events

Date Code Title Description
S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees