JPH08202533A - Division processor - Google Patents

Division processor

Info

Publication number
JPH08202533A
JPH08202533A JP7007977A JP797795A JPH08202533A JP H08202533 A JPH08202533 A JP H08202533A JP 7007977 A JP7007977 A JP 7007977A JP 797795 A JP797795 A JP 797795A JP H08202533 A JPH08202533 A JP H08202533A
Authority
JP
Japan
Prior art keywords
quotient
value
remainder
dividend
addition
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.)
Withdrawn
Application number
JP7007977A
Other languages
Japanese (ja)
Inventor
Toshimitsu Nagata
敏光 永田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP7007977A priority Critical patent/JPH08202533A/en
Publication of JPH08202533A publication Critical patent/JPH08202533A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE: To speedily find a quotient when a divisor has a value of (2<n> -1) by adding an addition value calculated by an adding means to a carry value calculated by a calculating means. CONSTITUTION: A sectioning means 2 sections a dividend into (n)-bit units and a generating means 3 generates the quotient and remainder when a bit array having a zero value as all low-order bits of (n)-bit data is divided by (2<n> -1) by every (n) bits sectioned by the sectioning means 2. In response to the generation, the adding means 4 adds the quotient generated by the generating means 3 and the calculating means calculates the carry value of the addition value calculated by the adding means 4 by adding the remainder generated by the generating means 3. Then adding means 4 adds the addition value calculated by itself to the carry value calculated by the calculating means 5 to find and output the final quotient. Thus, when the divisor has the value of (2<n> -1), the quotient when the dividend is divided by divisor can be found through the simple addition processing.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、2進数表現の被除数
を、2進数表現の除数で割り算するときの商を求める除
算処理装置に関し、特に、除数が(2n −1)の値を持
つときに、その商を高速に求められるようにする除算処
理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a division processing device for obtaining a quotient when a dividend represented by a binary number is divided by a divisor represented by a binary number, and particularly, a divisor has a value of (2 n -1). At times, the present invention relates to a division processing device that enables the quotient to be obtained at high speed.

【0002】2進数で表される数値を3で割り算するこ
とが頻繁に行われている。例えば、立方根を求めるとき
には、この割り算処理を実行する必要がある。これか
ら、除数が3の値を持つ割り算処理を高速に実行できる
ようにする構成の構築が叫ばれている。
Frequently, a numerical value represented by a binary number is divided by 3. For example, when calculating the cube root, it is necessary to execute this division processing. From now on, there is a demand for construction of a configuration that enables high-speed division processing in which the divisor has a value of 3.

【0003】[0003]

【従来の技術】除数が2n の値を持つときには、被除数
の仮数部分をnビット右シフトしていくことで、割り算
処理を実行できることになるが、除数がそれ以外の値を
持つときには、このような簡単な操作で割り算処理を実
行することができず、部分剰余を算出していくことで割
り算処理を実行する構成の除算処理装置を用いている。
2. Description of the Related Art When a divisor has a value of 2 n , the mantissa part of the dividend is right-shifted by n bits, so that the division process can be executed. The division processing device is configured so that the division processing cannot be executed by such a simple operation and the division processing is executed by calculating the partial remainder.

【0004】これから、従来では、除数が3の場合に
は、この構成の除算処理装置を用いることで商を求める
方法を採っていた。
Conventionally, therefore, when the divisor is 3, a method of obtaining a quotient by using the division processing device having this configuration has been adopted.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、部分剰
余を算出していくことで割り算処理を実行する構成の除
算処理装置は、構成が複雑であることから商を高速に求
めることができない。
However, the division processing device configured to execute the division process by calculating the partial remainder cannot obtain the quotient at high speed because of the complicated configuration.

【0006】これから、従来技術に従っていると、被除
数を3で割り算する処理を高速に実行することができ
ず、これがために、立方根を高速に求めることができな
いという問題点があった。
According to the prior art, therefore, the process of dividing the dividend by 3 cannot be executed at high speed, which causes a problem that the cube root cannot be obtained at high speed.

【0007】本発明はかかる事情に鑑みてなされたもの
であって、除数が3のような(2n−1)の値を持つと
きに、被除数を除数で割り算するときの商を高速に求め
られるようにする新たな除算処理装置の提供を目的とす
る。
The present invention has been made in view of the above circumstances, and when the divisor has a value of (2 n -1) such as 3, the quotient when the dividend is divided by the divisor is obtained at high speed. It is an object of the present invention to provide a new division processing device that can be used.

【0008】[0008]

【課題を解決するための手段】図1に本発明の原理構成
を図示する。図中、1は本発明により構成される除算処
理装置であって、2進数表現の被除数を、2進数表現の
(2n −1)の値を持つ除数で割り算するときの商を求
めるものである。
FIG. 1 shows the principle configuration of the present invention. In the figure, reference numeral 1 is a division processing device configured according to the present invention, and is for obtaining a quotient when a dividend represented by a binary number is divided by a divisor having a value of (2 n -1) represented by a binary number. is there.

【0009】この除算処理装置1は、区画手段2と、発
生手段3と、加算手段4と、算出手段5とを備える。こ
の区画手段2は、被除数をnビットを単位にして区画す
る。発生手段3は、区画手段2の区画するnビット毎
に、そのnビットデータの全下位ビットをゼロ値とする
ビット列を(2n −1)で割り算するときの商及び剰余
を発生する。加算手段4は、発生手段3の発生する商を
加算する。算出手段5は、発生手段3の発生する剰余を
加算することで、加算手段4の算出する加算値の桁上げ
値を算出する。
This division processing device 1 comprises a partitioning means 2, a generating means 3, an adding means 4 and a calculating means 5. The partition means 2 partitions the dividend in units of n bits. The generating means 3 generates, for each n bits partitioned by the partitioning means 2, a quotient and a remainder when a bit string having all lower bits of the n-bit data as a zero value is divided by (2 n -1). The adding means 4 adds the quotient generated by the generating means 3. The calculation means 5 calculates the carry value of the addition value calculated by the addition means 4 by adding the remainders generated by the generation means 3.

【0010】[0010]

【作用】被除数をnビットを単位にして区画して、その
nビットデータの全下位ビットをゼロ値とするビット列
を生成する場合に、そのビット列を(2n −1)で割り
算するときの商及び剰余には、規定の規則性がある。
When the dividend is divided in units of n bits to generate a bit string in which all lower bits of the n-bit data have a zero value, the quotient when the bit string is divided by (2 n -1) And the surplus has a prescribed regularity.

【0011】例えば、除数が3である場合、すなわち、
「n=2」の例で説明するならば、被除数の仮数を2ビ
ットを単位にして区画して、その2ビットデータの全下
位ビットをゼロ値とするビット列を生成する場合に、そ
のビット列を3で割り算するときの商及び剰余は、図2
に示すようなものとなるが、この商は、2進数で表現す
ると図3に示すような規則性を持つ。
For example, when the divisor is 3, that is,
In the example of “n = 2”, when dividing the mantissa of the dividend in units of 2 bits and generating a bit string in which all lower bits of the 2-bit data are zero values, the bit string is The quotient and the remainder when dividing by 3 are shown in Figure 2.
However, this quotient has a regularity as shown in FIG. 3 when expressed in a binary number.

【0012】すなわち、2ビットデータが「11」のと
きには、剰余は0となって、商は、被除数から切り出し
た2ビットの位置に「01」を設定することで直ちに求
まり、2ビットデータが「01」のときには、剰余は1
となって、商は、被除数から切り出した2ビットより下
位のビット列の内の偶数ビットに「1」を設定すること
で直ちに求まり、2ビットデータが「10」のときに
は、剰余は2となって、商は、被除数から切り出した2
ビットより下位のビット列の内の奇数ビットに「1」を
設定することで直ちに求まる。
That is, when the 2-bit data is "11", the remainder becomes 0, and the quotient is immediately obtained by setting "01" in the 2-bit position cut out from the dividend, and the 2-bit data is "0". When 01 ", the remainder is 1
Then, the quotient is immediately obtained by setting "1" to even-numbered bits in the bit sequence lower than 2 bits cut out from the dividend, and when the 2-bit data is "10", the remainder becomes 2. , The quotient is cut out from the dividend 2
It can be immediately obtained by setting "1" to the odd bit of the bit string lower than the bit.

【0013】この規則性を利用して、区画手段2は、被
除数をnビットを単位にして区画し、発生手段3は、区
画手段2の区画するnビット毎に、そのnビットデータ
の全下位ビットをゼロ値とするビット列を(2n −1)
で割り算するときの商及び剰余を発生する。
Utilizing this regularity, the partitioning means 2 partitions the dividend in units of n bits, and the generating means 3 for every n bits partitioned by the partitioning means 2, all lower bits of the n-bit data. A bit string whose bits are zero (2 n -1)
Generate the quotient and remainder when dividing by.

【0014】この発生を受けて、加算手段4は、発生手
段3の発生する商を加算し、一方、算出手段5は、発生
手段3の発生する剰余を加算することで、加算手段4の
算出する加算値の桁上げ値を算出する。そして、例え
ば、加算手段4が、自手段の算出する加算値と、算出手
段5の算出する桁上げ値とを加算することで、最終的な
商を求めて出力する。
In response to this occurrence, the addition means 4 adds the quotient generated by the generation means 3, while the calculation means 5 adds the remainder generated by the generation means 3 to calculate the addition means 4. Calculate the carry value of the added value. Then, for example, the adding means 4 calculates the final quotient by adding the addition value calculated by itself and the carry value calculated by the calculating means 5, and outputs the final quotient.

【0015】このように、本発明によれば、除数が(2
n −1)の値を持つときに、被除数を除数で割り算する
ときの商を単純な加算処理により求めることができるよ
うになることから、その商を高速に求められるようにな
る。
As described above, according to the present invention, the divisor is (2
Since the quotient when the dividend is divided by the divisor can be obtained by a simple addition process when the value has a value of n −1), the quotient can be obtained at high speed.

【0016】[0016]

【実施例】以下、実施例に従って本発明を詳細に説明す
る。図4に、本発明により構成される除算処理装置1の
一実施例を図示する。この実施例では、除数が3である
とともに、被除数が8ビットで表されることを想定して
いる。
EXAMPLES The present invention will be described in detail below with reference to examples. FIG. 4 illustrates an embodiment of the division processing device 1 configured according to the present invention. In this embodiment, it is assumed that the divisor is 3 and the dividend is represented by 8 bits.

【0017】図中、10は被除数レジスタであって、被
除数をラッチするもの、11は選択回路であって、被除
数レジスタ10にラッチされる被除数の持つ連続する2
ビットデータを順番に選択して出力するもの、12は商
・剰余発生回路であって、選択回路11の出力する2ビ
ットデータの全下位ビットをゼロ値とするビット列を3
で割り算するときの商及び剰余を発生するもの、13は
加算回路であって、商・剰余発生回路12の発生する商
を入力とする入力端子と、自回路の出力値を入力とする
入力端子とを持って、商・剰余発生回路12の発生する
商を累積加算するものである。
In the figure, 10 is a dividend register for latching the dividend, and 11 is a selection circuit, which has two consecutive registers of the dividend latched in the dividend register 10.
A quotient / residue generation circuit 12 selects bit data in order and outputs the quotient / remainder generation circuit, and a bit string in which all lower bits of the 2-bit data output by the selection circuit 11 are zero values
Which generates a quotient and a remainder when divided by, 13 is an adder circuit, which has an input terminal for inputting the quotient generated by the quotient / remainder generating circuit 12 and an input terminal for inputting the output value of the own circuit With, the quotient generated by the quotient / remainder generation circuit 12 is cumulatively added.

【0018】14は結果レジスタであって、加算回路1
3の出力する累積加算値をラッチするもの、15は切替
回路であって、ゼロ値か結果レジスタ14のラッチする
累積加算値のいずれか一方を選択して、加算回路13に
入力するもの、16は桁上げ回路であって、商・剰余発
生回路12の発生する剰余を加算することで加算回路1
3に対して桁上げの指示・非指示を発行するもの、17
はカウンタであって、4を計数値の初期値として、計数
値を1つずつディクリメントとしていくことで制御信号
αを生成するものである。
Reference numeral 14 denotes a result register, which is an adder circuit 1
A latch circuit for latching the cumulative addition value output by 3; a switching circuit 15 for selecting either a zero value or the cumulative addition value latched by the result register 14 and inputting it to the adding circuit 13; Is a carry circuit, and adds the remainders generated by the quotient / remainder generation circuit 12 to add circuit 1
Issue a carry instruction / non-instruction to 3
Is a counter, which generates a control signal α by decrementing the count value one by one with 4 being the initial value of the count value.

【0019】図2及び図3に示したように、被除数の仮
数を2ビットを単位にして区画して、その2ビットデー
タの全下位ビットをゼロ値とするビット列を生成する場
合に、そのビット列を3で割り算するときの商及び剰余
は、その2ビットデータが「11」のときには、剰余は
0となって、商は、被除数から切り出した2ビットの位
置に「01」を設定することで直ちに求まり、その2ビ
ットデータが「01」のときには、剰余は1となって、
商は、被除数から切り出した2ビットより下位のビット
列の内の偶数ビットに「1」を設定することで直ちに求
まり、その2ビットデータが「10」のときには、剰余
は2となって、商は、被除数から切り出した2ビットよ
り下位のビット列の内の奇数ビットに「1」を設定する
ことで直ちに求まることになる。
As shown in FIGS. 2 and 3, when the mantissa of the dividend is divided in units of 2 bits and a bit string in which all lower bits of the 2-bit data are zero values is generated, the bit string is generated. The quotient and the remainder when dividing by 3 are 0 when the 2-bit data is “11”, and the quotient is set to “01” at the 2-bit position cut out from the dividend. It is found immediately, and when the 2-bit data is "01", the remainder becomes 1,
The quotient is immediately obtained by setting "1" to an even bit in the bit string lower than 2 bits cut out from the dividend, and when the 2-bit data is "10", the remainder is 2 and the quotient is , Is immediately obtained by setting "1" to the odd bit in the bit sequence lower than 2 bits cut out from the dividend.

【0020】すなわち、被除数の8ビットデータの持つ
2ビット区画を下位から順番に、区画a,区画b,区画
c,区画dと表すならば、図5に示すように、区画aの
2ビットデータが「11」であるときに、その全下位デ
ータをゼロ値とするビット列を3で割り算すると、「商
=01,剰余=0」となり、区画bの2ビットデータが
「11」であるときに、その全下位データをゼロ値とす
るビット列を3で割り算すると、「商=0100,剰余=
0」となり、区画cの2ビットデータが「11」である
ときに、その全下位データをゼロ値とするビット列を3
で割り算すると、「商=010000,剰余=0」となり、区
画dの2ビットデータが「11」であるときに、その全
下位データをゼロ値とするビット列を3で割り算する
と、「商=01000000,剰余=0」となるという規則性が
ある。
That is, if the 2-bit sections of the 8-bit data of the dividend are represented in order from the lower order as section a, section b, section c, and section d, the 2-bit data of section a as shown in FIG. When the bit string whose all lower order data is zero value is divided by 3, when is “11”, “quotient = 01, remainder = 0”, and when the 2-bit data of the section b is “11” , And dividing the bit string whose all lower-order data is zero value by 3, "quotient = 0100, remainder =
When the 2-bit data of the section c is “11”, the bit string whose zero value is all the lower order data is 3
When divided by, “quotient = 00000, remainder = 0”, and when the 2-bit data of the section d is “11”, if the bit string whose zero value is all lower-order data is divided by 3, “quotient = 01000000” , There is a regularity that the remainder = 0.

【0021】そして、区画aの2ビットデータが「0
1」であるときに、その全下位ビットをゼロ値とするビ
ット列を3で割り算すると、「商=00,剰余=1」とな
り、区画bの2ビットデータが「01」であるときに、
その全下位ビットをゼロ値とするビット列を3で割り算
すると、「商=01,剰余=1」となり、区画cの2ビッ
トデータが「01」であるときに、その全下位ビットを
ゼロ値とするビット列を3で割り算すると、「商=010
1,剰余=1」となり、区画dの2ビットデータが「0
1」であるときに、その全下位ビットをゼロ値とするビ
ット列を3で割り算すると、「商=010101,剰余=1」
となるという規則性がある。
Then, the 2-bit data of the section a is "0".
When the bit string whose all lower bits are zero values is divided by 3 when it is "1", it becomes "quotient = 00, remainder = 1", and when the 2-bit data of the section b is "01",
When a bit string whose all lower bits are zero values is divided by 3, "quotient = 01, remainder = 1", and when the 2-bit data of the section c is "01", all lower bits are zero values. If the bit string to be divided is divided by 3, “quotient = 010
1, remainder = 1 ", and the 2-bit data of section d is" 0 "
If it is 1 ”and the bit string whose all lower bits are zero values is divided by 3,“ quotient = 010101, remainder = 1 ”
There is a regularity that

【0022】そして、区画aの2ビットデータが「1
0」であるときに、その全下位ビットをゼロ値とするビ
ット列を3で割り算すると、「商=00,剰余=2」とな
り、区画bの2ビットデータが「10」であるときに、
その全下位ビットをゼロ値とするビット列を3で割り算
すると、「商=10,剰余=2」となり、区画cの2ビッ
トデータが「10」であるときに、その全下位ビットを
ゼロ値とするビット列を3で割り算すると、「商=101
0,剰余=2」となり、区画dの2ビットデータが「1
0」であるときに、その全下位ビットをゼロ値とするビ
ット列を3で割り算すると、「商=101010,剰余=2」
となるという規則性がある。
Then, the 2-bit data of the section a is "1".
When the bit string whose all lower bits are zero values is divided by 3 when it is "0", it becomes "quotient = 00, remainder = 2", and when the 2-bit data of the section b is "10",
When the bit string having all the lower bits as the zero value is divided by 3, "quotient = 10, remainder = 2", and when the 2-bit data of the section c is "10", all the lower bits are regarded as the zero value. If you divide the bit string to
0, remainder = 2 ”, and the 2-bit data of section d is“ 1 ”
When the bit string whose all lower bits are zero values is divided by 3 when it is “0”, “quotient = 101010, remainder = 2”
There is a regularity that

【0023】商・剰余発生回路12は、選択回路11か
ら被除数の2ビットデータが与えられると、この図5に
示す関係に従って、その2ビットデータの全下位ビット
をゼロ値とするビット列を3で割り算するときの商及び
剰余を発生する。
When the quotient / remainder generation circuit 12 is supplied with the 2-bit data of the dividend from the selection circuit 11, the bit string whose zero value is all the lower bits of the 2-bit data is set to 3 in accordance with the relationship shown in FIG. Generates quotient and remainder when dividing.

【0024】この発生処理は、図5の関係を管理する変
換テーブルを用意して、2ビットデータのデータパター
ンと、その区画位置とが与えられるときに、それらの情
報を検索キーにしてその変換テーブルを検索することで
実現できるが、論理回路を使って実現することも可能で
ある。
In this generation processing, a conversion table for managing the relationship shown in FIG. 5 is prepared, and when a data pattern of 2-bit data and its partition position are given, those pieces of information are used as search keys to perform the conversion. It can be realized by searching a table, but can also be realized by using a logic circuit.

【0025】この商・剰余発生回路12の発生する商を
累積していくことで、被除数レジスタ10にラッチされ
る被除数を3で割り算したときの商が求まることになる
が、商・剰余発生回路12の発生する剰余の合計値が3
を超えるときには、その超えた分により発生する桁上げ
値をその累積値に加算していく必要がある。桁上げ回路
16は、このために用意されるものである。
By accumulating the quotient generated by the quotient / remainder generating circuit 12, the quotient when the dividend latched in the dividend register 10 is divided by 3, the quotient / remainder generating circuit is obtained. The total value of the surpluses generated by 12 is 3
When it exceeds, it is necessary to add the carry value generated by the exceeded amount to the cumulative value. The carry circuit 16 is provided for this purpose.

【0026】この実施例では、選択回路11は、最初
に、被除数の持つ区画dの2ビットデータを選択出力
し、続いて、被除数の持つ区画cの2ビットデータを選
択出力し、続いて、被除数の持つ区画bの2ビットデー
タを選択出力し、最後に、被除数の持つ区画aの2ビッ
トデータを選択出力していく構成を採ることから、桁上
げ回路16は、この選択出力に応じて商・剰余発生回路
12により発生される剰余を受けて、新たに受け取った
剰余と、前回までの剰余の合計値とを加算することで新
たな剰余の合計値を求めて、それが3を超えるときに
は、加算回路13に対して加算値を1つ補正していくこ
とを指示するとともに、合計値から3を引いたものを新
たな合計値とし、一方、それが3を超えないときには、
加算回路13に対して補正を指示しないとともに、求め
た合計値をそのまま新たな合計値としていく処理を実行
する。
In this embodiment, the selection circuit 11 first selects and outputs the 2-bit data of the section d of the dividend, then outputs the 2-bit data of the section c of the dividend, and then, Since the 2-bit data of the section b of the dividend is selected and output, and finally the 2-bit data of the section a of the dividend is selected and output, the carry circuit 16 responds to this selection output. Upon receiving the surplus generated by the quotient / remainder generating circuit 12, the newly received surplus is added to the total value of the surpluses up to the previous time to obtain a new total value of the surplus, which exceeds 3 Occasionally, the addition circuit 13 is instructed to correct the addition value by one, and a value obtained by subtracting 3 from the total value is set as a new total value. On the other hand, when it does not exceed 3,
The correction is not instructed to the adder circuit 13, and the obtained total value is directly used as a new total value.

【0027】すなわち、桁上げ回路16は、商・剰余発
生回路12の発生する剰余と、自回路の保持する前回ま
での剰余の合計値とを入力として、図6に示すような信
号処理を実行するのである。この信号処理は、図6の関
係を管理する変換テーブルを用意して、商・剰余発生回
路12から剰余が与えられるときに、その剰余の値と、
前回までの剰余の合計値とを検索キーにしてその変換テ
ーブルを検索することで実現できるが、論理回路を使っ
て実現することも可能である。
That is, the carry circuit 16 receives the remainder generated by the quotient / remainder generating circuit 12 and the total value of the remainders held by the own circuit up to the previous time, and executes signal processing as shown in FIG. To do. This signal processing prepares a conversion table for managing the relationship of FIG. 6, and when the remainder is given from the quotient / remainder generation circuit 12, the value of the remainder and
This can be realized by searching the conversion table using the total value of the remainder up to the previous time as a search key, but it can also be realized by using a logic circuit.

【0028】次に、このように構成される実施例の動作
処理について詳細に説明する。ここで、説明の便宜上、
被除数レジスタ10にセットされる被除数が「1001 111
1(=159) 」であることを想定する。
Next, the operation processing of the embodiment thus constructed will be described in detail. Here, for convenience of explanation,
The dividend set in the dividend register 10 is “1001 111
1 (= 159) ”is assumed.

【0029】本発明の除算処理装置1では、初期値とし
て4がセットされると、カウンタ17は、選択回路11
に対して、被除数レジスタ10にラッチされる被除数の
持つ区画dの2ビットデータの選択出力を指示し、商・
剰余発生回路12に対して、区画dの2ビットデータが
処理対象であることを指示し、切替回路15に対して、
ゼロ値の選択出力を指示する。
In the division processing device 1 of the present invention, when 4 is set as the initial value, the counter 17 causes the selection circuit 11 to operate.
Is instructed to select and output the 2-bit data of the section d of the dividend latched in the dividend register 10,
The remainder generation circuit 12 is instructed that the 2-bit data of the section d is the processing target, and the switching circuit 15 is
Indicate the selective output of zero value.

【0030】この指示を受け取ると、選択回路11は、
被除数の持つ区画dの2ビットデータである「10」を
出力し、この出力を受けて、商・剰余発生回路12は、
図5の変換関係に従って、「10 1010(=42)」という商
と、「2」という剰余を発生する。そして、この指示を
受け取ると、切替回路15は、ゼロ値を選択して加算回
路13に入力する。
Upon receiving this instruction, the selection circuit 11
"10" which is the 2-bit data of the section d of the dividend is output, and upon receipt of this output, the quotient / remainder generation circuit 12
According to the conversion relationship of FIG. 5, a quotient of "10 1010 (= 42)" and a remainder of "2" are generated. Then, upon receiving this instruction, the switching circuit 15 selects a zero value and inputs it to the adding circuit 13.

【0031】この切替回路15からの入力と、商・剰余
発生回路12からの商入力を受けて、加算回路13は、
この2つの入力値を加算することで、「10 1010(=42)」
を算出することになるが、このとき、桁上げ回路16
が、前回までの剰余の合計値の0と、商・剰余発生回路
12の発生する剰余の2とを受けて、図6の信号処理に
従って桁上げを発行しない構成を採るので、この算出値
「10 1010(=42)」を累積加算値としてそのまま結果レジ
スタ14に格納する。そして、桁上げ回路16は、図6
の信号処理に従って新たに2を保持する。
Upon receiving the input from the switching circuit 15 and the quotient input from the quotient / remainder generation circuit 12, the adder circuit 13
By adding these two input values, "10 1010 (= 42)"
However, at this time, the carry circuit 16
However, since it receives 0 of the total value of the remainders up to the previous time and 2 of the remainders generated by the quotient / remainder generation circuit 12, it does not issue a carry according to the signal processing of FIG. 10 1010 (= 42) ”is stored as it is in the result register 14 as a cumulative addition value. The carry circuit 16 is shown in FIG.
2 is newly held in accordance with the signal processing of 1.

【0032】続いて、カウンタ17は、計数値を1つデ
ィクリメントすることで3を保持すると、選択回路11
に対して、被除数レジスタ10にラッチされる被除数の
持つ区画cの2ビットデータの選択出力を指示し、商・
剰余発生回路12に対して、区画cの2ビットデータが
処理対象であることを指示し、切替回路15に対して、
結果レジスタ14の保持する累積加算値「10 1010(=4
2)」の選択出力を指示する。
Subsequently, when the counter 17 holds 3 by decrementing the count value by 1, the selection circuit 11
Is instructed to select and output the 2-bit data of the section c of the dividend latched in the dividend register 10,
The remainder generating circuit 12 is instructed that the 2-bit data in the section c is to be processed, and the switching circuit 15 is
The cumulative addition value “10 1010 (= 4
2) ”Selective output is instructed.

【0033】この指示を受け取ると、選択回路11は、
被除数の持つ区画cの2ビットデータである「01」を
出力し、この出力を受けて、商・剰余発生回路12は、
図5の変換関係に従って、「0101(=5)」という商と、
「1」という剰余を発生する。そして、この指示を受け
取ると、切替回路15は、結果レジスタ14の保持する
「10 1010(=42)」を選択して加算回路13に入力する。
Upon receiving this instruction, the selection circuit 11
"01" which is the 2-bit data of the section c of the dividend is output, and upon receipt of this output, the quotient / remainder generation circuit 12
According to the conversion relation of FIG. 5, the quotient “0101 (= 5)” and
A remainder of "1" is generated. Then, upon receiving this instruction, the switching circuit 15 selects “10 1010 (= 42)” held in the result register 14 and inputs it to the addition circuit 13.

【0034】この切替回路15からの入力と、商・剰余
発生回路12からの商入力を受けて、加算回路13は、
この2つの入力値を加算することで、「10 1111(=47)」
を算出することになるが、このとき、桁上げ回路16
が、前回までの剰余の合計値の2と、商・剰余発生回路
12の発生する剰余の1とを受けて、図6の信号処理に
従って桁上げ指示を発行する構成を採るので、この算出
値に1を加算することで、「11 0000(=48)」という累積
加算値を求めて結果レジスタ14に格納する。そして、
桁上げ回路16は、図6の信号処理に従って新たに0を
保持する。
Upon receiving the input from the switching circuit 15 and the quotient input from the quotient / remainder generating circuit 12, the adding circuit 13
By adding these two input values, "10 1111 (= 47)"
However, at this time, the carry circuit 16
However, since it is configured to issue a carry instruction according to the signal processing of FIG. 6 in response to the sum of the remainders up to the previous value of 2 and the remainder 1 generated by the quotient / remainder generation circuit 12, this calculated value By adding 1 to, the cumulative addition value of “11 0000 (= 48)” is obtained and stored in the result register 14. And
The carry circuit 16 newly holds 0 according to the signal processing of FIG.

【0035】続いて、カウンタ17は、計数値を1つデ
ィクリメントすることで2を保持すると、選択回路11
に対して、被除数レジスタ10にラッチされる被除数の
持つ区画bの2ビットデータの選択出力を指示し、商・
剰余発生回路12に対して、区画bの2ビットデータが
処理対象であることを指示し、切替回路15に対して、
結果レジスタ14の保持する累積加算値「11 0000(=4
8)」の選択出力を指示する。
Subsequently, when the counter 17 holds 2 by decrementing the count value by 1, the selection circuit 11
Is instructed to select and output the 2-bit data of the section b of the dividend latched in the dividend register 10,
The remainder generation circuit 12 is instructed that the 2-bit data in the section b is to be processed, and the switching circuit 15 is
The cumulative addition value “11 0000 (= 4
8) ”Selective output is instructed.

【0036】この指示を受け取ると、選択回路11は、
被除数の持つ区画bの2ビットデータである「11」を
出力し、この出力を受けて、商・剰余発生回路12は、
図5の変換関係に従って、「0100(=4)」という商と、
「0」という剰余を発生する。そして、この指示を受け
取ると、切替回路15は、結果レジスタ14の保持する
「11 0000(=48)」を選択して加算回路13に入力する。
Upon receiving this instruction, the selection circuit 11
"11" which is the 2-bit data of the section b of the dividend is output, and upon receipt of this output, the quotient / remainder generation circuit 12
According to the conversion relation of FIG. 5, the quotient “0100 (= 4)” and
A remainder of "0" is generated. Then, upon receiving this instruction, the switching circuit 15 selects “11 0000 (= 48)” held in the result register 14 and inputs it to the addition circuit 13.

【0037】この切替回路15からの入力と、商・剰余
発生回路12からの商入力を受けて、加算回路13は、
この2つの入力値を加算することで、「11 0100(=52)」
を算出することになるが、このとき、桁上げ回路16
が、前回までの剰余の合計値の0と、商・剰余発生回路
12の発生する剰余の0とを受けて、図6の信号処理に
従って桁上げを発行しない構成を採るので、この算出値
「11 0100(=52)」を累積加算値としてそのまま結果レジ
スタ14に格納する。そして、桁上げ回路16は、図6
の信号処理に従って新たに0を保持する。
Upon receiving the input from the switching circuit 15 and the quotient input from the quotient / remainder generating circuit 12, the adding circuit 13
By adding these two input values, "11 0100 (= 52)"
However, at this time, the carry circuit 16
However, since it receives 0 of the total value of the remainders up to the previous time and 0 of the remainders generated by the quotient / remainder generation circuit 12, it adopts a configuration in which no carry is issued according to the signal processing of FIG. 11 0100 (= 52) ”is stored as it is in the result register 14 as a cumulative addition value. The carry circuit 16 is shown in FIG.
0 is newly held in accordance with the signal processing of.

【0038】続いて、カウンタ17は、計数値を1つデ
ィクリメントすることで1を保持すると、選択回路11
に対して、被除数レジスタ10にラッチされる被除数の
持つ区画aの2ビットデータの選択出力を指示し、商・
剰余発生回路12に対して、区画aの2ビットデータが
処理対象であることを指示し、切替回路15に対して、
結果レジスタ14の保持する累積加算値「11 0100(=5
2)」の選択出力を指示する。
Subsequently, when the counter 17 holds 1 by decrementing the count value by 1, the selection circuit 11
Is instructed to select and output the 2-bit data of the section a of the dividend latched in the dividend register 10,
The remainder generation circuit 12 is instructed that the 2-bit data in the section a is to be processed, and the switching circuit 15 is
The cumulative addition value “11 0100 (= 5
2) ”Selective output is instructed.

【0039】この指示を受け取ると、選択回路11は、
被除数の持つ区画aの2ビットデータである「11」を
出力し、この出力を受けて、商・剰余発生回路12は、
図5の変換関係に従って、「01(=1)」という商と、
「0」という剰余を発生する。そして、この指示を受け
取ると、切替回路15は、結果レジスタ14の保持する
「11 0100(=52)」を選択して加算回路13に入力する。
Upon receiving this instruction, the selection circuit 11
"11" which is the 2-bit data of the partition a of the dividend is output, and upon receipt of this output, the quotient / residue generation circuit 12
According to the conversion relationship of FIG. 5, the quotient “01 (= 1)” and
A remainder of "0" is generated. Then, upon receiving this instruction, the switching circuit 15 selects “110100 (= 52)” held in the result register 14 and inputs it to the addition circuit 13.

【0040】この切替回路15からの入力と、商・剰余
発生回路12からの商入力を受けて、加算回路13は、
この2つの入力値を加算することで、「11 0101(=53)」
を算出することになるが、このとき、桁上げ回路16
が、前回までの剰余の合計値の0と、商・剰余発生回路
12の発生する剰余の0とを受けて、図6の信号処理に
従って桁上げを発行しない構成を採るので、この算出値
「11 0101(=53)」を累積加算値としてそのまま結果レジ
スタ14に格納する。
Upon receiving the input from the switching circuit 15 and the quotient input from the quotient / remainder generating circuit 12, the adding circuit 13
By adding these two input values, "11 0101 (= 53)"
However, at this time, the carry circuit 16
However, since it receives 0 of the total value of the remainders up to the previous time and 0 of the remainders generated by the quotient / remainder generation circuit 12, it adopts a configuration in which no carry is issued according to the signal processing of FIG. 11 0101 (= 53) ”is stored as it is in the result register 14 as a cumulative addition value.

【0041】この処理に従って、「1001 1111(=159) 」
という被除数を3で割り算するときの商「「11 0101(=5
3)」が、結果レジスタ14に格納されることになる。図
7に、以上に説明した除算処理過程を図示する。このよ
うに、本発明では、被除数を3で割り算するときの商を
単純な加算処理で求めるのである。
According to this processing, "1001 1111 (= 159)"
The quotient "" 11 0101 (= 5
3) ”will be stored in the result register 14. FIG. 7 illustrates the division processing process described above. As described above, in the present invention, the quotient when the dividend is divided by 3 is obtained by a simple addition process.

【0042】この実施例の除算処理は、被除数が負の値
を示すときにもそのまま適用できる。すなわち、被除数
が負の値を示すときには、ビット反転して1を加算する
ことで、その被除数を絶対値に変換し、その絶対値表示
の被除数に対して、上述の除算処理を実行することで商
を求めて、それをビット反転して1を加算することで、
最終的な商を求めればよいのである。図8に、被除数が
「−97」であるときのこの除算処理例を図示する。
The division processing of this embodiment can be applied as it is even when the dividend has a negative value. That is, when the dividend has a negative value, the bit is inverted and 1 is added to convert the dividend to an absolute value, and the above-described division process is performed on the dividend represented by the absolute value. By finding the quotient, inverting it and adding 1,
You just need to find the final quotient. FIG. 8 illustrates an example of this division processing when the dividend is "-97".

【0043】実施例では、被除数を3で割り算するとき
の適用例に従って本発明を開示したが、本発明は除数が
3に限られるものではなく、除数が(2n −1)の値を
持つときに適用できるものである。
In the embodiment, the present invention is disclosed according to the application example when the dividend is divided by 3, but the present invention is not limited to the divisor, and the divisor has a value of (2 n -1). Sometimes applicable.

【0044】例えば、除数が7(n=3)の場合には、
「xyz」という2進数表現の被除数を7で割り算する
ときの剰余と、「xyz000」という2進数表現の被
除数を7で割り算するときの剰余とは同じになるととも
に、後者の商は、 〔x×25 +y×24 +z×23 〕÷7=〔x×22
y×21 +z×20 〕×〔7+1〕÷7=〔x×22
y×21 +z×20 〕+〔x×22 +y×21 +z×2
0 〕÷7 という関係式から分かるように、前者の商に、「x×2
2 +y×21 +z×20」を加算するものであるという
規則性がある。これから、この規則性を使って、本発明
を適用することが可能になるのである。
For example, when the divisor is 7 (n = 3),
The remainder when dividing the dividend in the binary representation "xyz" by 7 is the same as the remainder when dividing the dividend in the binary representation "xyz000" by 7, and the latter quotient is [x × 2 5 + y × 2 4 + z × 2 3 ] ÷ 7 = [x × 2 2 +
y × 2 1 + z × 2 0 ] × [7 + 1] ÷ 7 = [x × 2 2 +
y × 2 1 + z × 2 0 ] + [x × 2 2 + y × 2 1 + z × 2
0 ] ÷ 7 As can be seen from the relational expression, the former quotient becomes “xx2
2 + y × 2 1 + z × 2 0 ”is added. From this, it is possible to apply the present invention by using this regularity.

【0045】また、実施例では、2入力の加算回路13
を使う構成を開示したが、本発明はこれに限られるもの
ではなく、3入力のCSAや、4入力以上の加算回路を
使って、商・剰余発生回路12の発生する商の累積加算
値を求めていく構成を採ってもよい。この構成を採る
と、少ないサイクル数で商を求めることができるように
なる。
Further, in the embodiment, the 2-input adder circuit 13 is used.
However, the present invention is not limited to this, and the cumulative addition value of the quotient generated by the quotient / remainder generating circuit 12 is calculated by using a 3-input CSA or an adding circuit of 4 or more inputs. You may take the structure to seek. With this configuration, the quotient can be obtained with a small number of cycles.

【0046】[0046]

【発明の効果】以上説明したように、本発明によれば、
除数が(2n −1)の値を持つときに、被除数を除数で
割り算するときの商を単純な加算処理により求めること
ができるようになることから、その商を高速に求められ
るようになる。
As described above, according to the present invention,
When the divisor has a value of (2 n -1), the quotient when the dividend is divided by the divisor can be obtained by a simple addition process, so that the quotient can be obtained at high speed. .

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

【図1】本発明の原理構成図である。FIG. 1 is a principle configuration diagram of the present invention.

【図2】3で割り算するときの商及び剰余の説明図であ
る。
FIG. 2 is an explanatory diagram of a quotient and a remainder when dividing by 3.

【図3】3で割り算するときの商及び剰余の説明図であ
る。
FIG. 3 is an explanatory diagram of a quotient and a remainder when dividing by 3.

【図4】本発明の一実施例である。FIG. 4 is an example of the present invention.

【図5】商・剰余発生回路の発生する商及び剰余の説明
図である。
FIG. 5 is an explanatory diagram of a quotient and a remainder generated by a quotient / remainder generating circuit.

【図6】桁上げ回路の信号処理説明図である。FIG. 6 is an explanatory diagram of signal processing of a carry circuit.

【図7】本発明の除算処理の説明図である。FIG. 7 is an explanatory diagram of division processing according to the present invention.

【図8】本発明の除算処理の説明図である。FIG. 8 is an explanatory diagram of a division process of the present invention.

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

1 除算処理装置 2 区画手段 3 発生手段 4 加算手段 5 算出手段 1 division processing device 2 partitioning means 3 generating means 4 adding means 5 calculating means

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 2進数表現の被除数を、2進数表現の
(2n −1)の値を持つ除数で割り算するときの商を求
める除算処理装置であって、 被除数をnビットを単位にして区画する区画手段と、 上記区画手段の区画するnビット毎に、そのnビットデ
ータの全下位ビットをゼロ値とするビット列を上記除数
で割り算するときの商及び剰余を発生する発生手段と、 上記発生手段の発生する商を加算する加算手段と、 上記発生手段の発生する剰余を加算することで、上記加
算手段の算出する加算値の桁上げ値を算出する算出手段
とを備え、 上記加算手段の算出する加算値と、上記算出手段の算出
する桁上げ値とを加算することで、被除数を上記除数で
割り算するときの商を求めるよう構成されることを、 特徴とする除算処理装置。
1. A division processing device for obtaining a quotient when a dividend represented by a binary number is divided by a divisor having a value of (2 n -1) represented by a binary number, wherein the dividend is a unit of n bits. Partitioning means for partitioning; generating means for generating, for each n bits partitioned by the partitioning means, a quotient and a remainder when a bit string having all lower bits of the n-bit data as a zero value is divided by the divisor; The addition means for adding the quotient generated by the generation means, and the calculation means for calculating the carry value of the addition value calculated by the addition means by adding the remainder generated by the generation means. And a carry value calculated by the calculating means are added to obtain a quotient when the dividend is divided by the divisor.
【請求項2】 請求項1記載の除算処理装置において、 加算手段は、発生手段の発生する商を順番に選択する構
成を採って、前回の選択時に求めた商の累積値と、今回
選択した商とを加算していくことで、発生手段の発生す
る商を加算していくよう処理することを、 特徴とする除算処理装置。
2. The division processing device according to claim 1, wherein the adding means selects the quotient generated by the generating means in order, and selects the cumulative value of the quotient obtained at the previous selection and the present time. A division processing device characterized by performing processing so as to add the quotient generated by the generating means by adding the quotient and the quotient.
【請求項3】 請求項2記載の除算処理装置において、 加算手段は、2つ以上の商を加算対象として商を選択し
ていくよう処理することを、 特徴とする除算処理装置。
3. The division processing device according to claim 2, wherein the addition means performs processing so as to select two or more quotients as addition targets and to select the quotient.
【請求項4】 請求項1、2又は3記載の除算処理装置
において、 加算手段は、発生手段の発生する商の加算処理と、この
加算処理により求まる加算値と算出手段の算出する桁上
げ値との加算処理という2つの加算処理を実行するよう
処理することを、 特徴とする除算処理装置。
4. The division processing device according to claim 1, 2 or 3, wherein the addition means adds the quotient generated by the generation means, the addition value obtained by this addition processing, and the carry value calculated by the calculation means. A division processing device, characterized in that processing is performed so as to perform two addition processings called addition processing with and.
JP7007977A 1995-01-23 1995-01-23 Division processor Withdrawn JPH08202533A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7007977A JPH08202533A (en) 1995-01-23 1995-01-23 Division processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7007977A JPH08202533A (en) 1995-01-23 1995-01-23 Division processor

Publications (1)

Publication Number Publication Date
JPH08202533A true JPH08202533A (en) 1996-08-09

Family

ID=11680520

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7007977A Withdrawn JPH08202533A (en) 1995-01-23 1995-01-23 Division processor

Country Status (1)

Country Link
JP (1) JPH08202533A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5945657A (en) * 1996-07-31 1999-08-31 Nec Corporation Constant divider
JP2006503382A (en) * 2002-10-09 2006-01-26 アナログ デバイシーズ インク Small Galois field multiplier engine
CN100414963C (en) * 2005-08-31 2008-08-27 佳能株式会社 Normalization method, and multi-dimensional interpolation method and apparatus
US10289602B2 (en) 2016-12-26 2019-05-14 Casio Computer Co., Ltd. Calculation apparatus, displaying method in calculation apparatus, and recording medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5945657A (en) * 1996-07-31 1999-08-31 Nec Corporation Constant divider
JP2006503382A (en) * 2002-10-09 2006-01-26 アナログ デバイシーズ インク Small Galois field multiplier engine
CN100414963C (en) * 2005-08-31 2008-08-27 佳能株式会社 Normalization method, and multi-dimensional interpolation method and apparatus
US7898707B2 (en) 2005-08-31 2011-03-01 Canon Kabushiki Kaisha Normalization method, and multi-dimensional interpolation method and apparatus
US10289602B2 (en) 2016-12-26 2019-05-14 Casio Computer Co., Ltd. Calculation apparatus, displaying method in calculation apparatus, and recording medium

Similar Documents

Publication Publication Date Title
US5132925A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
US5023827A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
EP3769208B1 (en) Stochastic rounding logic
JP2585649B2 (en) Division circuit
US6182100B1 (en) Method and system for performing a logarithmic estimation within a data processing system
de Lassus Saint-Geniès et al. Exact lookup tables for the evaluation of trigonometric and hyperbolic functions
US7809784B2 (en) Apparatus and method for calculation of divisions and square roots
JP2001222410A (en) Divider
JP2006172035A (en) Division/square root extraction computing element
US7016930B2 (en) Apparatus and method for performing operations implemented by iterative execution of a recurrence equation
JPH08202533A (en) Division processor
JPH10283340A (en) Arithmetic processor
JPH086766A (en) Sine and cosine arithmetic device
JPS622330B2 (en)
JP2578482B2 (en) Floating point arithmetic unit
JP2991788B2 (en) Decoder
JP2822472B2 (en) Integer square root calculator
JP3493085B2 (en) Arithmetic unit
JP2608090B2 (en) High radix non-restoring divider
JP3233432B2 (en) Multiplier
JP2803442B2 (en) Square root device
JP2607759B2 (en) Divider
JPH0778748B2 (en) Galois field arithmetic unit
JPH05257650A (en) Dividing device
JP2001092639A (en) Division and square root arithmetic unit

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20020402