JP3531402B2 - Square circuit - Google Patents

Square circuit

Info

Publication number
JP3531402B2
JP3531402B2 JP06031697A JP6031697A JP3531402B2 JP 3531402 B2 JP3531402 B2 JP 3531402B2 JP 06031697 A JP06031697 A JP 06031697A JP 6031697 A JP6031697 A JP 6031697A JP 3531402 B2 JP3531402 B2 JP 3531402B2
Authority
JP
Japan
Prior art keywords
input
output
adder
circuit
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
JP06031697A
Other languages
Japanese (ja)
Other versions
JPH10254680A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP06031697A priority Critical patent/JP3531402B2/en
Publication of JPH10254680A publication Critical patent/JPH10254680A/en
Application granted granted Critical
Publication of JP3531402B2 publication Critical patent/JP3531402B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、入力データの数
値の2乗を出力する2乗回路の改良に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an improvement of a squaring circuit that outputs the square of the numerical value of input data.

【0002】[0002]

【従来の技術】2乗演算は、乗数と被乗数が同一の乗算
とみなすことができる。従来の2乗回路に関して、ディ
ジタル回路での2乗値の導出法は、例えば文献「ハード
ウェアの知識」(大須賀節雄、近谷英昭著、オーム社)
に、ディジタル回路の乗算法が記載されている。ディジ
タル回路の乗算の基本規則は、被乗数に、乗数の各桁を
それぞれ乗算し、これを乗数の各桁に対応した桁数だけ
左に桁移動(ビットシフト)して部分積を求め、次いで
これらの部分積を加算することで乗算結果を得るもので
ある。すなわち (1)乗数の桁が0なら、被乗数に0をかけて0 (2)乗数の桁が1なら、被乗数に1をかけて被乗数
を、それぞれかけた乗数の桁と等しいだけ左ビットシフ
トして加えることにより、乗算結果を得ることができ
る。
2. Description of the Related Art A square operation can be regarded as a multiplication in which a multiplier and a multiplicand are the same. Regarding the conventional squaring circuit, the method for deriving the squaring value in a digital circuit is described in, for example, the document “Knowledge of Hardware” (Setsuo Osuka, Hideaki Chikaya, Ohmsha).
Describes a digital circuit multiplication method. The basic rule of multiplication in a digital circuit is that the multiplicand is multiplied by each digit of the multiplier, and this is moved to the left by the number of digits corresponding to each digit of the multiplier (bit shift) to obtain the partial product. The result of multiplication is obtained by adding the partial products of. That is, (1) If the digit of the multiplier is 0, multiply the multiplicand by 0, and (2) If the digit of the multiplier is 1, multiply the multiplicand by 1 and shift the multiplicand to the left by an amount equal to the digit of the multiplied multiplier. Then, the multiplication result can be obtained.

【0003】この導出法は10進数の場合と同様であ
る。例えば10進数における6×5の、ディジタル回路
における計算法を例にとって説明する。2進数で表すと
6は110、5は101と表せる。以下、2進数で表記
した後の括弧内に10進数の数値を記すものとする。す
なわち110(6)、101(5)と表記する。110
(6)×101(5)の演算は次のようになる。
This derivation method is similar to the case of decimal numbers. For example, a calculation method in a digital circuit of 6 × 5 in decimal will be described as an example. When expressed in binary numbers, 6 can be expressed as 110 and 5 can be expressed as 101. In the following, decimal numbers will be written in parentheses after being expressed in binary numbers. That is, they are represented as 110 (6) and 101 (5). 110
The calculation of (6) × 101 (5) is as follows.

【0004】[0004]

【数1】 [Equation 1]

【0005】すなわち、乗数101(5)の各桁のう
ち、0である桁については0を、また1である桁は被乗
数110(6)を、その桁だけビットシフトして部分積
を求め、部分積を全て加算することによって乗算結果を
得ることができる。
That is, of each digit of the multiplier 101 (5), 0 is digitized for a digit which is 0 and multiplicand 110 (6) is digitized for a digit which is 1, and a partial product is obtained by bit-shifting that digit. The multiplication result can be obtained by adding all the partial products.

【0006】ところで2乗は、乗数と被乗数が同一の乗
算と考えることができる。従って例えば、従来の2乗回
路において1011(11)の2乗は、以上述べた従来
の方法によると次のように求められる。
By the way, the square can be considered as a multiplication in which the multiplier and the multiplicand are the same. Therefore, for example, in the conventional squaring circuit, the square of 1011 (11) is obtained as follows according to the conventional method described above.

【0007】[0007]

【数2】 [Equation 2]

【0008】このような2乗値を求めるための従来の2
乗回路について具体的に説明する。従来の方法で入力デ
ータの2乗値を出力する2乗回路は、ゲートアレイ上や
ICなどの論理素子を用いた回路において、論理積ゲー
トと加算器を用いて実現することができる。一例とし
て、2乗回路の入力データが4ビットの場合の従来の2
乗回路の具体的なハードウェアの構成を示す構成図を
17に示す。次に、図1 を用いて従来の2乗回路の動
作について説明する。図17において、1701、17
02、1703、1704は論理積ゲート、1705、
1706、1707は加算器である。
The conventional 2 for determining such a squared value
The squaring circuit will be specifically described. A squaring circuit that outputs a squared value of input data by a conventional method can be realized by using a logical product gate and an adder in a circuit using a logic element such as a gate array or an IC. As an example, when the input data of the squaring circuit is 4 bits, the conventional 2
Figure a block diagram showing a specific hardware configuration of the circuit multiply
Shown in 17 . Next, the operation of the conventional squaring circuit with reference to FIG 7. In FIG. 17 , 1701 and 17
02, 1703, 1704 are AND gates, 1705,
1706 and 1707 are adders.

【0009】次に回路の動作について説明する。図17
において、2乗回路に入力される4ビットのデータを下
位ビットから順にD0、D1、D2、D3とする。このとき
i(i:負でない整数)は0か1である。すなわちDi
∈{0、1}である。2乗回路に入力された4ビットの
ディジタルデータは、論理積ゲート1701に入力され
る。論理積ゲート1701は入力のD0とD0、D1
2、D3との論理積をとり、加算器1705に出力す
る。すなわち、論理積ゲート1701は、D0が0なら
ば0を、D0が1ならば入力データを、加算器1705
に出力する。
Next, the operation of the circuit will be described. FIG. 17
In the above, 4-bit data input to the squaring circuit is set to D 0 , D 1 , D 2 , and D 3 in order from the lower bit. At this time, D i (i: non-negative integer) is 0 or 1. That is, D i
Ε {0, 1}. The 4-bit digital data input to the squaring circuit is input to the AND gate 1701. The AND gate 1701 has inputs D 0 and D 0 , D 1 ,
The logical product of D 2 and D 3 is calculated and output to the adder 1705. That is, the AND gate 1701 outputs 0 if D 0 is 0, the input data if D 0 is 1, and the adder 1705
Output to.

【0010】2乗回路に入力された4ビットのデータ
は、同様に論理積ゲート1702、論理積ゲート170
3、論理積ゲート1704に入力される。そして論理積
ゲート1702ではD1とD0、D1、D2、D3との論理
積をとり、加算器1705に出力する。また論理積ゲー
ト1703ではD2とD0、D1、D2、D3との論理積を
とり、加算器1706に出力する。さらに論理積ゲート
1704ではD3とD0、D1、D2、D3との論理積をと
り、加算器1707に出力する。すなわち、論理積ゲー
ト1702は、D1が0ならば0を、D1が1ならば入力
データを、加算器1705に出力する。さらに、論理積
ゲート1703は、D2が0ならば0を、D2が1ならば
入力データを、加算器1706に出力する。同様に、論
理積ゲート1704は、D3が0ならば0を、D3が1な
らば入力データを、加算器1707に出力する。
The 4-bit data input to the squaring circuit is similarly AND gate 1702 and AND gate 170.
3, input to the AND gate 1704. Then, the logical product gate 1702 calculates the logical product of D 1 and D 0 , D 1 , D 2 , and D 3 and outputs the logical product to the adder 1705. The logical product gate 1703 takes the logical product of D 2 and D 0 , D 1 , D 2 , and D 3 and outputs the logical product to the adder 1706. Further, the logical product gate 1704 calculates the logical product of D 3 and D 0 , D 1 , D 2 , and D 3 and outputs the logical product to the adder 1707. That is, AND gate 1702, a 0, D 1 is 0, D 1 is a 1, then the input data, and outputs to the adder 1705. Moreover, AND gate 1703, a D 2 are 0, 0, D 2 is a 1, then the input data, and outputs to the adder 1706. Similarly, AND gate 1704, a D 3 is 0, 0, D 3 is a 1, then the input data, and outputs to the adder 1707.

【0011】加算器1705の動作を説明する。加算器
1705では、論理積ゲート1701から出力される値
と、論理積ゲート1702から出力される値を1ビット
左ビットシフトした値を加算して、加算結果を出力す
る。すなわち、加算器1705は2乗回路の入力データ
の最下位桁と、下から2桁目の乗算結果を加算した加算
結果を出力する。
The operation of the adder 1705 will be described. The adder 1705 adds the value output from the logical product gate 1701 and the value output from the logical product gate 1702 by 1-bit left bit shift, and outputs the addition result. That is, the adder 1705 outputs the addition result obtained by adding the least significant digit of the input data of the squaring circuit and the multiplication result of the second digit from the bottom.

【0012】次に、加算器1706の動作を説明する。
加算器1706では、加算器1705の出力と、論理積
ゲート1703の出力を2ビット左ビットシフトした値
を加算して、加算結果を出力する。すなわち、加算器1
706は2乗回路の入力データの最下位桁と、下から2
桁目と、上から2桁めの乗算結果を加算した加算結果を
出力する。
Next, the operation of the adder 1706 will be described.
The adder 1706 adds the output of the adder 1705 and the value obtained by shifting the output of the AND gate 1703 by 2 bits to the left, and outputs the addition result. That is, the adder 1
706 is the least significant digit of the input data of the squaring circuit and 2 from the bottom
The addition result of adding the multiplication result of the second digit from the first digit is output.

【0013】次に、加算器1707の動作を説明する。
加算器1707では、加算器1706の出力と、論理積
ゲート1704の出力を3ビット左ビットシフトした値
を加算して、加算結果を出力する。すなわち、加算器1
707は2乗回路の入力データの各桁の乗算結果を加算
した加算結果を出力する。
Next, the operation of the adder 1707 will be described.
The adder 1707 adds the output of the adder 1706 and the value obtained by shifting the output of the AND gate 1704 by 3 bits to the left, and outputs the addition result. That is, the adder 1
Reference numeral 707 outputs the addition result obtained by adding the multiplication result of each digit of the input data of the squaring circuit.

【0014】このように、2乗する値すなわち被2乗値
が4ビットの場合、少なくとも4ビット以上の数値を3
回加算する必要がある。ところが2乗回路に高速動作が
要求される場合、加算器による遅延が問題となる。例え
ばゲートアレイ上の1ビット加算器の遅延は、文献「A
SICデータブックTC180G/Eシリーズマクロセ
ル」(東芝)によると約1.2nsである。従って4ビ
ット加算器の遅延は4.8nsとなるが、これは論理積
セルの遅延0.3nsの16倍に達する。4ビット加算
を3回行なう場合の遅延は4.8×3=14.4nsで
あるから、1/14.4ns=約70MHz以上の信号
は出力に1クロック以上の遅れを生じ、パイプライン処
理が必要となるためタイミング制御が複雑になり、回路
規模も増大するという問題があった。
As described above, when the value to be squared, that is, the value to be squared is 4 bits, a numerical value of at least 4 bits or more is 3
It is necessary to add times. However, when the squaring circuit is required to operate at high speed, the delay due to the adder becomes a problem. For example, the delay of the 1-bit adder on the gate array is described in the document "A.
According to "SIC Data Book TC180G / E Series Macrocell" (Toshiba), it is about 1.2 ns. Therefore, the delay of the 4-bit adder is 4.8 ns, which is 16 times the delay of 0.3 ns of the AND cell. Since the delay when performing 4-bit addition three times is 4.8 × 3 = 14.4 ns, a signal of 1 / 14.4 ns = about 70 MHz or more causes a delay of 1 clock or more in output, and pipeline processing Since it is necessary, there is a problem that the timing control becomes complicated and the circuit scale also increases.

【0015】2乗回路に入力データが入力されて、2乗
値が出力されるまでの遅延を少なくするためには、出力
のビット削減が一般的である。ビット削減は遅延を減少
できるだけでなく、回路規模も縮小できる。例えば入力
のビット数が7ビットである場合、従来の2乗回路のう
ちビット削減しない場合の回路構成を示す構成図を図1
(a)に、ビット削減をした場合の回路構成を示す構
成図を図18(b)に示す。
In order to reduce the delay until the squared value is output after the input data is input to the squaring circuit, it is general to reduce the output bit. Bit reduction can not only reduce the delay but also the circuit scale. For example, when the number of input bits is 7 bits, a circuit diagram showing a circuit configuration of the conventional squaring circuit in which no bits are reduced is shown in FIG .
In 8 (a), shows a configuration diagram showing a circuit configuration in a case where the bit reduction in FIG. 18 (b).

【0016】図18(a)に示した回路は、入力のビッ
ト数が7ビットの場合の従来の2乗回路の構成図であ
り、回路の動作は図17に示した、入力が4ビットの場
合と同様であるため、回路の動作の説明を省略する。次
に、ビット削減した場合の回路の動作を、図18(b)
を用いて説明する。図18(b)において、1801、
1802、1803は論理積ゲート、1804、180
5は加算器である。
The circuit shown in FIG . 18A is a block diagram of a conventional squaring circuit in the case where the number of input bits is 7 bits. The operation of the circuit is shown in FIG. Since it is similar to the case, the description of the circuit operation is omitted. Next, the operation of the circuit when the number of bits is reduced is shown in FIG.
Will be explained. In FIG. 18B, 1801,
1802 and 1803 are AND gates, 1804 and 180
5 is an adder.

【0017】次に回路の動作について説明する。図18
(b)において、2乗回路に入力される7ビットのデー
タを下位ビットから順にD0、D1、D2、D3、D4
5、D6とする。このときDi(i:負でない整数)は
0か1である。すなわちDi∈{0、1}である。2乗
回路に入力された7ビットのディジタルデータは、論理
積ゲート1801に入力される。論理積ゲート1801
は入力のD4とD0、D1、D2、D3、D4、D5、D6との
論理積をとり、加算器1804に出力する。すなわち、
論理積ゲート1801は、D4が0ならば0を、D0が1
ならば入力データを、加算器1804に出力する。
Next, the operation of the circuit will be described. FIG.
In (b), 7-bit data input to the squaring circuit is D 0 , D 1 , D 2 , D 3 , D 4 , in order from the lower bit.
Let them be D 5 and D 6 . At this time, D i (i: non-negative integer) is 0 or 1. That is, D i ε {0,1}. The 7-bit digital data input to the squaring circuit is input to the AND gate 1801. AND gate 1801
Takes the logical product of the input D 4 and D 0 , D 1 , D 2 , D 3 , D 4 , D 5 and D 6 and outputs it to the adder 1804. That is,
The AND gate 1801 outputs 0 when D 4 is 0 and D 0 is 1
If so, the input data is output to the adder 1804.

【0018】2乗回路に入力された7ビットのデータ
は、同様に論理積ゲート1802、論理積ゲート180
3に入力される。そして論理積ゲート1802ではD5
とD0、D1、D2、D3、D4、D5、D6との論理積をと
り、加算器1804に出力する。また論理積ゲート18
03ではD6とD0、D1、D2、D3、D4、D5、D6との
論理積をとり、加算器1805に出力する。すなわち、
論理積ゲート1802は、D5が0ならば0を、D5が1
ならば入力データを、加算器1804に出力する。ま
た、論理積ゲート1803は、D6が0ならば0を、D6
が1ならば入力データを、加算器1805に出力する。
The 7-bit data input to the squaring circuit is similarly AND gate 1802 and AND gate 180.
Input to 3. Then, in the AND gate 1802, D 5
And D 0 , D 1 , D 2 , D 3 , D 4 , D 5 , and D 6 are ANDed and output to the adder 1804. AND gate 18
In 03, the logical product of D 6 and D 0 , D 1 , D 2 , D 3 , D 4 , D 5 and D 6 is calculated and output to the adder 1805. That is,
The AND gate 1802, D 5 is 0, 0, D 5 1
If so, the input data is output to the adder 1804. Further, the AND gate 1803, 0, D 6 is 0, D 6
If is 1, the input data is output to the adder 1805.

【0019】加算器1804の動作を説明する。加算器
1804では、論理積ゲート1801から出力される値
を4ビットシフトした値と、論理積ゲート1802から
出力される値を5ビットシフトした値を加算して、加算
結果を出力する。すなわち、加算器1804は2乗回路
の入力データの上から2桁目と、上から3桁目の乗算結
果を加算した加算結果を出力する。
The operation of the adder 1804 will be described. The adder 1804 adds the value output from the AND gate 1801 by 4 bits and the value output from the AND gate 1802 by 5 bits, and outputs the addition result. That is, the adder 1804 outputs the addition result obtained by adding the multiplication result of the second digit from the top of the input data of the squaring circuit and the multiplication result of the third digit from the top.

【0020】次に、加算器1805の動作を説明する。
加算器1805では、加算器1804の出力と、論理積
ゲート1803から出力される値を6ビットシフトした
値を加算して、加算結果を出力する。すなわち、加算器
1805は2乗回路の入力データの最上位桁と、上から
2桁目と、上から3桁めの乗算結果を加算した加算結果
を出力する。
Next, the operation of the adder 1805 will be described.
The adder 1805 adds the output of the adder 1804 and the value obtained by shifting the value output from the AND gate 1803 by 6 bits, and outputs the addition result. That is, the adder 1805 outputs the addition result obtained by adding the most significant digit of the input data of the squaring circuit, the second digit from the top, and the third digit from the top.

【0021】このように入力が7ビットの場合、ビット
削減をしなければ図18(a)に示したように加算回数
が7−1=6回必要であるのに対し、ビット削減をして
下位ビットとの乗算を行なわない構成とすることで、加
算回数を減らすことができる。例えば図18(b)に示
した回路のように、上から3ビットまでしか乗算を行な
わない構成とすれば、加算回数は2回まで減らすことが
できる。
In this way, when the input is 7 bits, if the bit reduction is not performed, the number of additions is required to be 7-1 = 6 times as shown in FIG. The number of additions can be reduced by adopting a configuration in which multiplication with lower bits is not performed. For example, if the circuit shown in FIG. 18B is configured to perform multiplication only up to 3 bits, the number of additions can be reduced to two.

【0022】ビット削減をして2乗回路の出力に対する
下位ビットの寄与をなくすと、加算回数が減って遅延が
減少し、回路規模を小さくできるという利点がある一方
で、2乗回路の出力が真の2乗値からの誤差を生ずると
いう問題点がある。例えば上に述べた7ビット入力のビ
ット削減した従来の2乗回路の入出力特性のグラフを
19に示す。図19において、点線はビット削減なしの
理想的な場合、実線はビット削減ありの場合の2乗回路
の入出力特性である。図19からわかるように、ビット
削減を行なうことで実線からの誤差が大きくなるという
問題がある。
When bits are reduced to eliminate the contribution of lower bits to the output of the squaring circuit, the number of additions is reduced, the delay is reduced, and the circuit scale can be reduced, while the output of the squaring circuit is reduced. There is a problem that an error from the true square value is generated. Figure a graph of input-output characteristics of the conventional squaring circuit, for example that the bit reduction mentioned 7-bit input on
19 shows. In FIG. 19 , the dotted line shows the input / output characteristics of the squaring circuit in the ideal case without bit reduction and the solid line with the bit reduction. As can be seen from FIG. 19, there is a problem that the error from the solid line becomes large by reducing the bits.

【0023】[0023]

【発明が解決しようとする課題】以上のように、従来の
2乗回路においては、入力データの桁に応じた個数の部
分積を、加算器で加算して2乗値を出力する構成であっ
た。従って、2乗回路の入力データのビット数が増えれ
ば増えるほど、加算器の加算回数が増加した。よって高
速な回路動作速度が求められる場合においては、2乗値
を出力するのに数クロックの遅延が生じる可能性があ
り、パイプライン処理を行う必要が生じてタイミング制
御が複雑となり、その結果回路規模が増大するという課
題があった。また、繰り返し加算を行なうことによる遅
延を少なくするために加算器の数を減らし、出力の下位
ビットの削減を行なう場合、2乗回路の出力値に誤差が
生じてしまい、正確な2乗値が出力されないという課題
があった。本発明は、このような課題を解決するために
なされたものであり、簡単な論理積回路構成で高速動作
に対応できる2乗回路を得ることを目的とする。
As described above, in the conventional squaring circuit, the adder adds the partial products of the number corresponding to the digit of the input data and outputs the squared value. It was Therefore, as the number of bits of the input data of the squaring circuit increases, the number of additions of the adder increases. Therefore, when a high-speed circuit operation speed is required, a delay of several clocks may occur to output the squared value, which requires pipeline processing to complicate timing control. There was a problem that the scale increased. Further, when the number of adders is reduced to reduce the delay due to repeated addition and the lower bits of the output are reduced, an error occurs in the output value of the squaring circuit, and an accurate square value is obtained. There was a problem that it was not output. The present invention has been made to solve such a problem, and an object of the present invention is to obtain a square circuit that can handle high-speed operation with a simple AND circuit configuration.

【0024】[0024]

【課題を解決するための手段】本発明に係る2乗回路
は、2乗回路の入力のMSB値を抽出するMSB値抽出
回路と、2乗回路の入力から上記MSB値抽出回路の出
力であるMSB値を減算して2乗回路の入力のLSP値
を求める加算器と、上記MSB値抽出回路の出力である
MSB値を左ビットシフトする左ビットシフト回路と、
上記加算器の出力であるLSP値を左ビットシフトする
左ビットシフト回路と、上記2つの左ビットシフト回路
の出力を加算して2乗結果を出力する加算器とを備える
ようにしたものである。
The squaring circuit according to the present invention is an MSB value extracting circuit for extracting the MSB value of the input of the squaring circuit and an output of the MSB value extracting circuit from the input of the squaring circuit. An adder for subtracting the MSB value to obtain the LSP value at the input of the squaring circuit; a left bit shift circuit for left bit shifting the MSB value output from the MSB value extraction circuit;
A left bit shift circuit for left bit shifting the LSP value which is the output of the adder, and an adder for adding the outputs of the two left bit shift circuits and outputting the squared result are provided. .

【0025】また、本発明に係る2乗回路は、入力のM
SB値を抽出するMSB値抽出回路として動作する、入
力の最上位ビットと全ビットの論理積を出力する複数の
論理積ゲートと、イネーブル入力によって加算出力をハ
イインピーダンスにする、入力の最上位ビットを一方の
入力とする複数の加算器と、2乗回路の入力が0の場合
に1を出力する論理積素子と、論理和素子と、3ステー
ト出力バッファを備えるようにしたものである。
Further, the squaring circuit according to the present invention uses the input M
A plurality of AND gates that operate as an MSB value extraction circuit that extracts the SB value and that outputs a logical product of the most significant bit of the input and all bits, and the most significant bit of the input that makes the addition output high impedance by the enable input Is provided as one input, a logical product element that outputs 1 when the input of the squaring circuit is 0, a logical sum element, and a 3-state output buffer.

【0026】また、本発明に係る2乗回路は、入力のM
SB値を抽出するMSB値抽出回路として動作する、入
力の最上位ビットと全ビットの論理積を出力する複数の
論理積ゲートと、イネーブル入力によって出力をハイイ
ンピーダンスにする複数の3ステート出力バッファゲー
トと、2乗回路の入力が0の場合に1を出力する論理積
素子と、論理和素子と、3ステート出力バッファと、入
力の最上位ビットを一方の入力とする2乗結果を出力す
る加算器とを備えるようにしたものである。
Further, the squaring circuit according to the present invention uses the input M
A plurality of AND gates that output the logical product of the most significant bit of the input and all bits, and a plurality of three-state output buffer gates that make the output high impedance by the enable input, operating as an MSB value extraction circuit that extracts the SB value And an AND element which outputs 1 when the input of the squaring circuit is 0, an OR element, a 3-state output buffer, and an addition which outputs a squared result in which the most significant bit of the input is one input It is equipped with a container.

【0027】また、本発明に係る2乗回路は、2乗回路
の入力のMSB値を抽出するMSB値抽出回路と、2乗
回路の入力から上記MSB値抽出回路の出力であるMS
B値を減算して2乗回路の入力のLSP値を求める加算
器と、上記MSB値抽出回路の出力であるMSB値を左
ビットシフトする左ビットシフト回路と、上記加算器の
出力であるLSP値を左ビットシフトする左ビットシフ
ト回路と、上記加算器の出力であるLSP値のMSB値
を抽出するMSB値抽出回路と、上記加算器の出力であ
るLSP値から上記MSB値抽出回路の出力であるLS
P値のMSB値を減算して2乗回路の入力のLSP値の
LSP値を求める加算器と、上記MSB値抽出回路の出
力であるMSB値を左ビットシフトする左ビットシフト
回路と、上記加算器の出力であるLSP値を左ビットシ
フトする左ビットシフト回路と、上記4つの左ビットシ
フト回路の出力を加算して2乗結果を出力する加算器と
を備えるようにしたものである。
Further, the squaring circuit according to the present invention is an MSB value extracting circuit for extracting the MSB value of the input of the squaring circuit and an output of the MSB value extracting circuit from the input of the squaring circuit.
An adder that subtracts the B value to obtain the LSP value of the input of the squaring circuit, a left bit shift circuit that left-shifts the MSB value that is the output of the MSB value extraction circuit, and an LSP that is the output of the adder. A left bit shift circuit that shifts the value to the left, an MSB value extraction circuit that extracts the MSB value of the LSP value that is the output of the adder, and an output of the MSB value extraction circuit from the LSP value that is the output of the adder Is LS
An adder that subtracts the MSB value of the P value to obtain the LSP value of the LSP value of the input of the squaring circuit, a left bit shift circuit that left-shifts the MSB value that is the output of the MSB value extraction circuit, and the addition A left bit shift circuit for left-shifting the LSP value, which is the output of the converter, and an adder for adding the outputs of the four left bit shift circuits and outputting the squared result are provided.

【0028】また、本発明に係る2乗回路は、2乗回路
の入力のMSB値を抽出するMSB値抽出回路と、2乗
回路の入力から上記MSB値抽出回路の出力であるMS
B値を減算して2乗回路の入力のLSP値を求める加算
器と、上記MSB値抽出回路の出力であるMSB値をデ
コードするデコーダと、上記デコーダ出力を左ビットシ
フトする左ビットシフト回路と、上記加算器の出力であ
るLSP値を左ビットシフトする左ビットシフト回路
と、上記2つの左ビットシフト回路の出力を加算して2
乗結果を出力する加算器とを備えるようにしたものであ
る。
Further, the squaring circuit according to the present invention is an MSB value extracting circuit for extracting the MSB value of the input of the squaring circuit and an output of the MSB value extracting circuit from the input of the squaring circuit.
An adder that subtracts the B value to obtain the LSP value of the input of the squaring circuit, a decoder that decodes the MSB value that is the output of the MSB value extraction circuit, and a left bit shift circuit that shifts the decoder output to the left. , The left bit shift circuit for left bit shifting the LSP value output from the adder and the outputs from the two left bit shift circuits are added to obtain 2
And an adder for outputting a multiplication result.

【0029】また、本発明に係る2乗回路は、入力のM
SB値を抽出するMSB値抽出回路として動作する、入
力の最上位ビットと全ビットの論理積を出力する複数の
論理積ゲートと、イネーブル入力によって加算出力をハ
イインピーダンスにする複数の加算器と、2乗回路の入
力が0の場合に1を出力する論理積素子と、論理和素子
と、3ステート出力バッファを備えるようにしたもので
ある。
Further, the squaring circuit according to the present invention uses the input M
A plurality of AND gates that operate as an MSB value extraction circuit that extracts the SB value and that outputs a logical product of the most significant bit of the input and all bits; and a plurality of adders that make the addition output high impedance by the enable input, This is provided with a logical product element that outputs 1 when the input of the squaring circuit is 0, an OR element, and a 3-state output buffer.

【0030】また、本発明に係る2乗回路は、入力のM
SB値を抽出するMSB値抽出回路として動作する、入
力の最上位ビットと全ビットの論理積を出力する複数の
論理積ゲートと、イネーブル入力によって出力をハイイ
ンピーダンスにする複数の3ステート出力バッファゲー
トと、2乗回路の入力が0の場合に1を出力する論理積
素子と、論理和素子と、3ステート出力バッファと、2
乗結果を出力する加算器とを備えるようにしたものであ
る。
Further, the squaring circuit according to the present invention uses the input M
A plurality of AND gates that output the logical product of the most significant bit of the input and all bits, and a plurality of three-state output buffer gates that make the output high impedance by the enable input, operating as an MSB value extraction circuit that extracts the SB value And an AND element that outputs 1 when the input of the squaring circuit is 0, an OR element, a 3-state output buffer, and 2
And an adder for outputting a multiplication result.

【0031】また、本発明に係る2乗回路は、入力のM
SB値を抽出するMSB値抽出回路として動作する、入
力の最上位ビットと全ビットの論理積を出力する複数の
論理積ゲートと、加算器の入力をデコードするデコーダ
として動作する論理積素子とインバータと、イネーブル
入力によって加算出力をハイインピーダンスにする複数
の加算器と、2乗回路の入力が0の場合に1を出力する
論理積素子と、論理和素子と、3ステート出力バッファ
を備えるようにしたものである。
Further, the squaring circuit according to the present invention uses the input M
A plurality of AND gates that operate as an MSB value extraction circuit that extracts SB values, that outputs a logical product of the most significant bit of the input and all bits, and an AND element and an inverter that operate as a decoder that decodes the input of the adder And a plurality of adders that make the addition output high impedance by the enable input, a logical product element that outputs 1 when the input of the squaring circuit is 0, a logical sum element, and a 3-state output buffer. It was done.

【0032】[0032]

【発明の実施の形態】実施の形態1. 図1は、実施の形態1における2乗回路の構成を示す構
成図であり、図1において、101はMSB値抽出回
路、102は左ビットシフト回路、103は加算器、1
04は左ビットシフト回路、105は加算器である。本
実施の形態における2乗回路で求める値について説明す
る。2乗回路は入力されるデータの数値の2乗の数値の
データを出力する回路である。入力データをx、出力デ
ータをyとすると、xとyの関係は次の式で表せる。 y=x2 (1) 上式において、xをx1とx2の和で表すものとする。す
なわち x=x1+x2 (2) とする。式(2)を代入すると、式(1)は次のように
書き表せる。 y=(x1+x22 =x1 2+2x12+x2 2 (3) ここで、x1>x2が成り立つならば、それぞれを2乗し
たx1 2、x2 2の間には次の関係が成立する。 x1 2≫x2 2 (4) 式(4)の関係を用いると、式(3)は次のように変形
できる。 y=x1 2+2x12+x2 2 ≒x1 2+2x12 (5) すなわち、x1>x2が成り立つようにx1とx2を選べ
ば、2乗回路出力データyに対するx2 2の寄与を無視で
きる。本実施の形態1では式(5)の右辺を2乗回路の
出力として求める。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiment 1. 1 is a configuration diagram showing a configuration of a squaring circuit according to the first embodiment. In FIG. 1, 101 is an MSB value extraction circuit, 102 is a left bit shift circuit, 103 is an adder, 1
Reference numeral 04 is a left bit shift circuit, and 105 is an adder. The value obtained by the squaring circuit in the present embodiment will be described. The squaring circuit is a circuit that outputs the numerical data of the square of the input data. When the input data is x and the output data is y, the relationship between x and y can be expressed by the following equation. y = x 2 (1) In the above equation, x is represented by the sum of x 1 and x 2 . That is, x = x 1 + x 2 (2). By substituting the equation (2), the equation (1) can be expressed as follows. y = (x 1 + x 2 ) 2 = x 1 2 + 2x 1 x 2 + x 2 2 (3) If x 1 > x 2 holds, squared x 1 2 and x 2 2 respectively . The following relationships are established for. x 1 2 >> x 2 2 (4) Using the relationship of the expression (4), the expression (3) can be transformed as follows. y = x 1 2 + 2x 1 x 2 + x 2 2 ≒ x 1 2 + 2x 1 x 2 (5) In other words, choose the x 1 and x 2 as x 1> x 2 holds, for squaring circuit output data y The contribution of x 2 2 can be ignored. In the first embodiment, the right side of equation (5) is obtained as the output of the squaring circuit.

【0033】以下、図を用いて動作について説明する。
図1において、2値信号であるディジタルの入力データ
は2乗回路に入力されると、MSB値抽出回路101に
入力されてMSB値が抽出される。ここでMSBとは入
力データを2進表現した場合に1となる最も上位の桁の
ことである。2乗回路の入力データxの数値が2m≦x
≦2m+1−1(mは負でない整数)の範囲である場合、
mビット目がMSBである。この場合、MSB値は2m
である。また、以後入力データxからMSB値2mを引
いた値x−2mを表す複数のビット、つまりMSBより
下位の複数ビットをLSPとし、x−2mをLSP値と
する。MSB値抽出回路101はmビット目が1である
mを抽出して出力する。以下、入力データxのMSB
値である2mをx1、xからMSB値2mを引いたx−x1
すなわちLSP値をx2とする。従って、x、x1、x2
の間には以下の関係が成立する。 x=x1+x2 (2)
The operation will be described below with reference to the drawings.
In FIG. 1, when digital input data, which is a binary signal, is input to the squaring circuit, it is input to the MSB value extraction circuit 101 to extract the MSB value. Here, the MSB is the most significant digit which becomes 1 when the input data is expressed in binary. The value of the input data x of the squaring circuit is 2 m ≤x
If ≦ 2 m + 1 −1 (m is a non-negative integer),
The m-th bit is the MSB. In this case, the MSB value is 2 m
Is. Further, hereinafter, a plurality of bits representing a value x-2 m obtained by subtracting the MSB value 2 m from the input data x, that is, a plurality of bits lower than the MSB are set as LSP, and x-2 m is set as an LSP value. The MSB value extraction circuit 101 extracts and outputs 2 m in which the m-th bit is 1. Below, MSB of input data x
The value 2 m is x 1 , and the MSB value 2 m is subtracted from x-x 1.
That is, the LSP value is set to x 2 . Therefore, x, x 1 , x 2
The following relationships are established between the two. x = x 1 + x 2 (2)

【0034】一例として、入力データx=11の場合を
考える。2進数で表すと11は1011である。以後、
2進数で表記した後の括弧内に10進数で数値を記すも
のとする。すなわち1011(11)と表記する。xは
MSB値である1000(8)と、入力データ1011
(11)からMSB値1000(8)を引いたLSP値
11(3)に分けることができる。MSB値抽出回路1
01は3ビット目が1である1000(8)を抽出して
出力する。なお、mは負でない整数であるから、最下位
のビットは0ビット目である。
As an example, consider the case of input data x = 11. When expressed in a binary number, 11 is 1011. After that,
Numerical values shall be written in decimal numbers in parentheses after being written in binary numbers. That is, it is expressed as 1011 (11). x is the MSB value 1000 (8) and the input data 1011
It can be divided into LSP value 11 (3) obtained by subtracting MSB value 1000 (8) from (11). MSB value extraction circuit 1
01 extracts and outputs 1000 (8) in which the third bit is 1. Since m is a non-negative integer, the least significant bit is the 0th bit.

【0035】MSB値抽出回路101は入力データxの
MSB値であるx1すなわち2mを出力する。MSB値抽
出回路101から出力されたx1は左ビットシフト回路
102に入力される。また、x1は左ビットシフト回路
102のシフト入力Sにも入力される。左ビットシフト
回路102に入力されたx1は、シフト入力Sで指定さ
れる桁だけ左ビットシフトされる。シフト入力Sにはm
ビット目が1のx1が入力されているので、x1はmビッ
トだけ左ビットシフトされ、x1’を出力する。ここ
で、x1’は2mをmビットシフトした値であるから22m
に等しい。すなわちx1’=x1 2である。左ビットシフ
ト回路102はx1すなわち2mを2乗して、x1 2すなわ
ち22mを加算器105に出力する。
The MSB value extraction circuit 101 outputs x 1 which is the MSB value of the input data x, that is, 2 m . The x 1 output from the MSB value extraction circuit 101 is input to the left bit shift circuit 102. Further, x 1 is also input to the shift input S of the left bit shift circuit 102. The x 1 input to the left bit shift circuit 102 is left bit-shifted by the digit designated by the shift input S. M for shift input S
Since x 1 of which the 1st bit is 1 is input, x 1 is left-shifted by m bits to output x 1 ′. Here, x 1 'is a value obtained by shifting 2 m by m bits, so 2 2m
be equivalent to. That is, x 1 ′ = x 1 2 . The left bit shift circuit 102 squares x 1 or 2 m and outputs x 1 2 or 2 2m to the adder 105.

【0036】入力データx=11の場合の左ビットシフ
ト回路102の動作を説明する。MSB値抽出回路10
1から出力された、入力データxのMSB値である10
00(8)は、左ビットシフト回路102で3ビットだ
け左ビットシフトされる。ここで、1000(8)は3
ビット目だけが1であるから、1000(8)の3ビッ
トシフトは2乗操作に等しい。ビットシフトされた値1
000000(64)は、左ビットシフト回路102の
出力として加算器105に入力される。
The operation of the left bit shift circuit 102 when the input data x = 11 will be described. MSB value extraction circuit 10
10 which is the MSB value of the input data x output from 1
00 (8) is left bit-shifted by 3 bits in the left bit shift circuit 102. Where 1000 (8) is 3
Since only the 1st bit is 1, a 3-bit shift of 1000 (8) is equivalent to a square operation. Bit-shifted value 1
000000 (64) is input to the adder 105 as the output of the left bit shift circuit 102.

【0037】MSB値抽出回路101から出力される入
力データxのMSB値であるx1すなわち2mは、加算器
103にも入力される。加算器103は入力データxか
らx1を減算し、x−x1すなわちLSP値であるx2
左ビットシフト回路104に出力する。
The MSB value x 1 or 2 m of the input data x output from the MSB value extraction circuit 101 is also input to the adder 103. The adder 103 subtracts x 1 from the input data x and outputs x−x 1, that is, the LSP value x 2 to the left bit shift circuit 104.

【0038】入力データx=11の場合の加算器103
の動作を説明する。加算器103は、MSB値抽出回路
101から出力された入力データxのMSB値である1
000(8)を、入力データx=1011(11)から
減算し、入力データxのLSP値である11(3)を左
ビットシフト回路104に出力する。
Adder 103 when input data x = 11
The operation of will be described. The adder 103 is 1 which is the MSB value of the input data x output from the MSB value extraction circuit 101.
000 (8) is subtracted from the input data x = 1011 (11), and the LSP value of the input data x, 11 (3), is output to the left bit shift circuit 104.

【0039】左ビットシフト回路104には、加算器1
03の出力である入力データxのLSP値 2 が入力さ
れる。また、左ビットシフト回路104のシフト入力S
にはMSB値抽出回路101から出力される入力データ
xのMSB値であるx1が入力される。左ビットシフト
回路104に入力された 2 は、シフト入力Sで指定さ
れる値に1を加えた桁だけ左ビットシフトされる。シフ
ト入力Sにはmビット目が1のx1が入力されているの
で、x2は(m+1)ビットだけ左ビットシフトされ
る。ここで左mビットシフトはx1倍に相当し、左1ビ
ットシフトは2倍に相当する。すなわち、左ビットシフ
ト回路104におけるx2の左(m+1)ビットシフト
は、2x12を導出する操作に等しい。左ビットシフト
回路104は、2x12を加算器105に出力する。
The left bit shift circuit 104 includes an adder 1
The LSP value x 2 of the input data x, which is the output of 03, is input. In addition, the shift input S of the left bit shift circuit 104
X 1 which is the MSB value of the input data x output from the MSB value extraction circuit 101 is input to the. The x 2 input to the left bit shift circuit 104 is left bit-shifted by a digit obtained by adding 1 to the value designated by the shift input S. Since x 1 with the m-th bit being 1 is input to the shift input S, x 2 is shifted to the left by (m + 1) bits. The left m-bit shift corresponds to x 1 times, and the left 1-bit shift corresponds to 2 times. That is, the left (m + 1) bit shift of x 2 in the left bit shift circuit 104 is equivalent to the operation of deriving 2x 1 x 2 . The left bit shift circuit 104 outputs 2 × 1 × 2 to the adder 105.

【0040】入力データx=11の場合の左ビットシフ
ト回路104の動作を説明する。加算器103から出力
された入力データxのLSP値である11(3)は、3
+1=4ビットだけ左ビットシフトされる。ここで、左
4ビットシフトは24=16倍の操作に等しく、2×x1
(8)×x2(3)=48が導出される。ビットシフト
された値は110000(48)であり、左ビットシフ
ト回路104の出力として加算器105に出力される。
The operation of the left bit shift circuit 104 when the input data x = 11 will be described. 11 (3), which is the LSP value of the input data x output from the adder 103, is 3
The bit is shifted left by + 1 = 4 bits. Here, the left 4-bit shift is equivalent to the operation of 2 4 = 16 times, 2 × x 1
(8) × x 2 (3) = 48 is derived. The bit-shifted value is 110000 (48), which is output to the adder 105 as the output of the left bit shift circuit 104.

【0041】加算器105では、左ビットシフト回路1
02から出力されるx1 2と、左ビットシフト回路104
から出力される2x12を加算し、2乗回路の出力とし
て出力する。入力x=11の場合、1000000(6
4)と110000(48)が加算されて、11100
00(112)が出力される。
In the adder 105, the left bit shift circuit 1
And x 1 2 output from 02, the left bit shift circuit 104
2 x 1 x 2 output from the above are added and output as the output of the squaring circuit. When input x = 11, 1000000 (6
4) and 110000 (48) are added, 11100
00 (112) is output.

【0042】以上のように、2乗回路の入力データをM
SB値とLSP値に分割して、それぞれに対して一定の
左ビットシフト演算を行なって部分積を求め、2つの部
分積を加算して2乗値を求めることにより、従来よりも
加算器の数を減らして、遅延が少ない2乗回路を得るこ
とができる。
As described above, the input data of the squaring circuit is M
The SB value and the LSP value are divided, a constant left bit shift operation is performed on each of them, a partial product is obtained, and two partial products are added to obtain a squared value. The number can be reduced to obtain a squaring circuit with less delay.

【0043】実施の形態2. 実施の形態1ではブロック図を用いて2乗回路の動作の
説明を行なったが、実際の論理回路を用いて、2乗回路
を構成することができる。実施の形態2では実際のディ
ジタル信号が2乗回路に入力された場合のビット単位の
処理を、論理回路を用いて説明する。
Embodiment 2. Although the operation of the squaring circuit has been described using the block diagram in the first embodiment, the squaring circuit can be configured using an actual logic circuit. In the second embodiment, processing in bit units when an actual digital signal is input to the squaring circuit will be described using a logic circuit.

【0044】実施の形態2でも、実施の形態1と同様に
y=x2をx=x1+x2とおくことによって、y≒x1 2
+2x12と近似した値を求める。以下、一例として入
力のビット数が4ビットの場合について、図を用いて実
施の形態2について説明する。図2は、実施の形態2に
おける2乗回路の構成を示す構成図であり、201、2
02、203は論理積ゲート、204、205、206
は加算器、207は3ステート出力バッファ、208は
論理積素子、209は論理和素子である。
[0044] Even the second embodiment, by placing the Form 1 in the same manner as y = x 2 embodiment x = x 1 + x 2, y ≒ x 1 2
+ 2x 1 x 2 and obtaining the value approximating. Hereinafter, as an example, a case where the number of input bits is 4 bits will be described with reference to the drawings. FIG. 2 is a configuration diagram showing the configuration of the squaring circuit according to the second embodiment.
02 and 203 are AND gates, and 204, 205 and 206
Is an adder, 207 is a 3-state output buffer, 208 is an AND element, and 209 is an OR element.

【0045】次に回路の動作について説明する。図2に
おいて、2乗回路に入力される4ビットのデータを下位
ビットから順にD0、D1、D2、D3とする。このときD
i(i:負でない整数)は0か1である。すなわちDi
{0、1}である。まず、2乗回路に入力されるデータ
が0でない場合について説明する。すなわち、論理積記
号を&とすれば、D0&D1&D2&D3≠0である。2乗
回路に入力された4ビットのディジタル信号のうち、D
3は加算器204のイネーブルEに入力される。加算器
204はE=1ならば加算器204の入力AとBを加算
して加算結果を出力し、E=0ならば出力はハイインピ
ーダンスとなって加算結果を出力しない。従ってD3
1であれば、加算器204は入力D0、D1、D2、D3
用いて加算し、加算結果を出力する。これに対してD3
=0であれば、加算器204の出力はハイインピーダン
スとなって加算結果を出力しない。
Next, the operation of the circuit will be described. In FIG. 2, 4-bit data input to the squaring circuit is D 0 , D 1 , D 2 and D 3 in order from the lower bit. At this time D
i (i: non-negative integer) is 0 or 1. That is, D i
It is {0,1}. First, a case where the data input to the squaring circuit is not 0 will be described. That is, if the logical product symbol is &, then D 0 & D 1 & D 2 & D 3 ≠ 0. Of the 4-bit digital signal input to the squaring circuit, D
3 is input to the enable E of the adder 204. If E = 1, the adder 204 adds the inputs A and B of the adder 204 and outputs the addition result, and if E = 0, the output becomes high impedance and the addition result is not output. Therefore D 3 =
If it is 1, the adder 204 adds using the inputs D 0 , D 1 , D 2 , and D 3 and outputs the addition result. On the other hand, D 3
If = 0, the output of the adder 204 becomes high impedance and the addition result is not output.

【0046】一例として、2乗回路の入力が1011
(11)の場合について説明する。D3=1であるか
ら、加算器204のイネーブルEは1となって、加算器
204は入力AとBを加算して加算結果を出力する。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since a D 3 = 1, the enable E of the adder 204 is 1, the adder 204 outputs the addition result by adding the inputs A and B.

【0047】入力された4ビットのディジタル信号は論
理積ゲート201にも入力される。D3は論理積ゲート
201のCへ、またD0、D1、D2は論理積ゲート20
1のI0、I1、I2へ、それぞれ入力される。論理積ゲ
ート201では、D3の反転と、下位の3ビットD0、D
1、D2との論理積をとり、加算器205及び論理積ゲー
ト202に出力する。すなわち論理積ゲート201は、
3=0であれば、O0、O1、O2からそれぞれD0
1、D2を出力し、D3=1であれば、O0、O1、O2
ら0を加算器205及び論理積ゲート202に出力す
る。
The input 4-bit digital signal is also input to the AND gate 201. D 3 goes to C of the AND gate 201, and D 0 , D 1 and D 2 go to the AND gate 20.
1 is input to I 0 , I 1 , and I 2 , respectively. In the AND gate 201, the inversion of D 3 and the lower 3 bits D 0 , D
The logical product of 1 and D 2 is calculated and output to the adder 205 and the logical product gate 202. That is, the AND gate 201 is
If D 3 = 0, then O 0 , O 1 and O 2 are respectively changed to D 0 ,
D 1 and D 2 are output, and if D 3 = 1 then O 0 , O 1 and O 2 to 0 are output to the adder 205 and the AND gate 202.

【0048】このことを図を用いて説明する。図3
(a)は、論理積ゲート201の構成を示す構成図であ
り、301はインバータ、302、303、304は論
理積素子である。論理積ゲート201のCはインバータ
301に接続されている。従って、インバータ301は
3 の反転↓D 3 (以降、反転された信号は下向き矢印↓
を付す)を論理積素子302、303、304のBに出
力する。
This will be described with reference to the drawings. Figure 3
(A) is a block diagram showing the structure of the AND gate 201, where 301 is an inverter, and 302, 303, 304 are AND elements. C of the AND gate 201 is connected to the inverter 301. Therefore, the inverter 301
D 3 of the inverting ↓ D 3 (hereinafter, the inverted signal is down arrow ↓
Is added to B of the logical product elements 302, 303, 304.

【0049】論理積ゲート201のI0、I1、I2は、
それぞれ論理積素子304、303、302のAに接続
されている。また、O0、O1、O2には、それぞれ論理
積素子304、303、302の論理積出力が接続され
ている。論理積素子302、303、304は、それぞ
れ入力AとBの論理積を出力する。従って、D3=0な
らば反転されたD3 (反転された信号は下向き矢印↓を
付す)は、↓D3=1となって論理積素子302、30
3、304のBには1が入力されるため、論理積素子3
04、303、302の出力はそれぞれD0、D1、D2
と一致し、O0、O1、O2からはそれぞれD0、D1、D2
が出力される。反対にD3=1ならば↓D3=0となって
論理積素子302、303、304のBには0が入力さ
れるため、論理積素子304、303、302の出力は
全て0となり、O0、O1、O2からは0が出力される。
論理積ゲート201の入出力表を、図3(a)と共に示
す。
I 0 , I 1 , and I 2 of the AND gate 201 are
They are connected to A of the logical product elements 304, 303 and 302, respectively. Further, the logical product outputs of the logical product elements 304, 303 and 302 are connected to O 0 , O 1 and O 2 , respectively. The logical product elements 302, 303, 304 output the logical product of the inputs A and B, respectively. Therefore, if D 3 = 0, the inverted D 3 (the inverted signal is indicated by the downward arrow ↓).
Subjecting) is AND gate becomes ↓ D 3 = 1 302,30
Since 1 is input to B of 3, 304, the logical product element 3
The outputs of 04, 303 and 302 are D 0 , D 1 and D 2 respectively.
And O 0 , O 1 and O 2 respectively represent D 0 , D 1 and D 2
Is output. On the other hand, if D 3 = 1 then ↓ D 3 = 0 and 0 is input to B of the logical product elements 302, 303, 304, so the outputs of the logical product elements 304, 303, 302 all become 0, 0 is output from O 0 , O 1 and O 2 .
An input / output table of the AND gate 201 is shown together with FIG.

【0050】論理積ゲート201の出力は、加算器20
5及び論理積ゲート202に入力される。論理積ゲート
201のO0、O1、O2から出力される信号を、それぞ
れD0’、D1’、D2’とする。D3=0ならば、D2
=D2、D1’=D1、D0’=D0である。論理積ゲート
201の出力のうち、D2’は加算器205のイネーブ
ルEに入力される。加算器205は加算器204と同様
に、E=1ならば加算器205の入力AとBを加算して
加算結果を出力し、E=0ならば出力はハイインピーダ
ンスとなって加算結果を出力しない。従ってD2’=1
であれば、すなわち入力のMSBがD2であれば、加算
器205は入力D0’、D1’、D2’を用いて加算し、
加算結果を出力する。これに対してD2’=0であれ
ば、加算器205の出力はハイインピーダンスとなって
加算結果を出力しない。
The output of the AND gate 201 is the adder 20.
5 and the AND gate 202. The signals output from O 0 , O 1 and O 2 of the AND gate 201 are D 0 ′, D 1 ′ and D 2 ′, respectively. If D 3 = 0, then D 2 '
= D 2 , D 1 ′ = D 1 , D 0 ′ = D 0 . Of the outputs of the AND gate 201, D 2 'is input to the enable E of the adder 205. Similar to the adder 204, the adder 205 adds the inputs A and B of the adder 205 and outputs the addition result when E = 1, and outputs the high impedance when E = 0 and outputs the addition result. do not do. Therefore, D 2 '= 1
, Ie, if the MSB of the input is D 2 , then adder 205 adds using inputs D 0 ′, D 1 ′, D 2 ′,
Output the addition result. On the other hand, if D 2 '= 0, the output of the adder 205 becomes high impedance and the addition result is not output.

【0051】一例として、2乗回路の入力が1011
(11)の場合について説明する。D3=1であるか
ら、論理積ゲート201はD0’、D1’、D2’を全て
0として出力する。するとD2’=0が加算器205の
イネーブルEに入力されるため、加算器205の出力は
ハイインピーダンスとなって、加算結果を出力しない。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since D 3 = 1, AND gate 201 D 0 ', D 1', outputs the all D 2 '0. Then, since D 2 '= 0 is input to the enable E of the adder 205, the output of the adder 205 becomes high impedance and the addition result is not output.

【0052】論理積ゲート201から出力された
0’、D1’、D2’は、論理積ゲート202にも入力
される。D2’は論理積ゲート202のCへ、また
0’、D1’は論理積ゲート202のI0、I1へ、それ
ぞれ入力される。論理積ゲート202でも論理積ゲート
201と同様に、D2’の反転と、下位の2ビット
0’、D1’との論理積をとり、加算器206及び論理
積ゲート203に出力する。すなわち論理積ゲート20
2は、D2’=0であれば、O0、O1からそれぞれ
0’、D1’を、またD2’=1であれば、O0、O1
ら0を加算器206及び論理積ゲート203に出力す
る。
D 0 ′, D 1 ′ and D 2 ′ output from the AND gate 201 are also input to the AND gate 202. D 2 ′ is input to C of the AND gate 202, and D 0 ′ and D 1 ′ are input to I 0 and I 1 of the AND gate 202, respectively. Similarly to the AND gate 201, the AND gate 202 also takes the logical product of the inversion of D 2 ′ and the lower 2 bits D 0 ′ and D 1 ′, and outputs it to the adder 206 and the AND gate 203. That is, the AND gate 20
2, 'if = 0, O 0, respectively, from O 1 D 0' D 2, D 1 ' , and also D 2' if = a 1, O 0, from O 1 0 adders 206 and Output to the AND gate 203.

【0053】このことを図を用いて説明する。図3
(b)は、論理積ゲート202の構成を示す構成図であ
り、305はインバータ、306、307は論理積素子
である。論理積ゲート202のCはインバータ305に
接続されている。従って、インバータ305はD2’の
反転↓D 2 を論理積素子306、307のBに出力す
る。
This will be described with reference to the drawings. Figure 3
(B) is a configuration diagram showing a configuration of the AND gate 202, in which 305 is an inverter, and 306 and 307 are AND elements. The C of the AND gate 202 is connected to the inverter 305. Thus, inverter 305 outputs a 'inversion ↓ D 2 of' D 2 to B of AND gate 306 and 307.

【0054】論理積ゲート202のI0、I1は、それぞ
れ論理積素子307、306のAに接続されている。ま
たO0、O1には、それぞれ論理積素子307、306の
論理積出力が接続されている。論理積素子306、30
7は、それぞれ入力AとBの論理積を出力する。従っ
て、D2’=0ならば↓D2’=1となって論理積素子3
06、307のBには1が入力されるため、論理積素子
307、306の出力はそれぞれD0’、D1’と一致
し、O0、O1からはそれぞれD0’、D1’が出力され
る。反対にD2’=1ならば↓D2’=0となって論理積
素子306、307のBには0が入力されるため、論理
積素子306、307の出力は全て0となり、O0、O1
からは0が出力される。論理積ゲート202の入出力表
を、図3(b)と共に示す。
I 0 and I 1 of the logical product gate 202 are connected to A of the logical product elements 307 and 306, respectively. Further, the logical product outputs of the logical product elements 307 and 306 are connected to O 0 and O 1 , respectively. AND elements 306, 30
7 outputs a logical product of inputs A and B, respectively. Therefore, if D 2 '= 0, then ↓ D 2 ' = 1 and the logical product element 3
Since the 06,307 of B 1 is inputted, respectively output D 0 of AND gate 307 and 306 ', D 1' coincides with, O 0, respectively, from O 1 is D 0 ', D 1' Is output. On the contrary, if D 2 '= 1, then ↓ D 2 ' = 0 and 0 is input to B of the logical product elements 306 and 307, so that the outputs of the logical product elements 306 and 307 are all 0 and O 0 , O 1
Will output 0. An input / output table of the AND gate 202 is shown together with FIG.

【0055】論理積ゲート202の出力は、加算器20
6及び論理積ゲート203に入力される。論理積ゲート
202のO0、O1から出力される信号を、それぞれ
0’’、D1’’とする。D3=0かつD2=0ならば、
1’’=D1、D0’’=D0である。論理積ゲート20
2の出力のうち、D1’’は加算器206のイネーブル
Eに入力される。加算器206は加算器204、加算器
205と同様に、E=1ならば加算器206の入力Aと
Bを加算して加算結果を出力し、E=0ならば出力はハ
イインピーダンスとなって加算結果を出力しない。従っ
てD1’’=1であれば、すなわち入力のMSBがD1
あれば、加算器206は入力D0’’、D1’’を用いて
加算し、加算結果を出力する。これに対してD1’’=
0であれば、加算器206の出力はハイインピーダンス
となって加算結果を出力しない。
The output of the AND gate 202 is the adder 20.
6 and the AND gate 203. The signals output from O 0 and O 1 of the AND gate 202 are D 0 ″ and D 1 ″, respectively. If D 3 = 0 and D 2 = 0,
D 1 ″ = D 1 and D 0 ″ = D 0 . AND gate 20
Of the two outputs, D 1 ″ is input to the enable E of the adder 206. Similar to the adder 204 and the adder 205, the adder 206 adds the inputs A and B of the adder 206 and outputs the addition result when E = 1, and the output becomes high impedance when E = 0. Do not output the addition result. Therefore, if D 1 ″ = 1, that is, if the input MSB is D 1 , the adder 206 performs addition using the inputs D 0 ″ and D 1 ″, and outputs the addition result. On the other hand, D 1 ″ =
If it is 0, the output of the adder 206 becomes high impedance and the addition result is not output.

【0056】一例として、2乗回路の入力が1011
(11)の場合について説明する。D3=1であるか
ら、論理積ゲート201はD0’、D1’、D2’を全て
0として出力する。D2’=0であるから、論理積ゲー
ト202はD0’、D1’をそのまま出力する。すなわち
0’’、D1’’は共に0である。するとD1’’=0
が加算器206のイネーブルEに入力されるため、加算
器206の出力はハイインピーダンスとなって、加算結
果を出力しない。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since D 3 = 1, AND gate 201 D 0 ', D 1', outputs the all D 2 '0. Since D 2 '= 0, the AND gate 202 outputs D 0 ' and D 1 'as they are. That is, both D 0 ″ and D 1 ″ are 0. Then D 1 ″ = 0
Is input to the enable E of the adder 206, the output of the adder 206 becomes high impedance and the addition result is not output.

【0057】論理積ゲート202から出力された
0’’、D1’’は、論理積ゲート203にも入力され
る。D1’’は論理積ゲート203のCへ、またD0’’
は論理積ゲート203のI0へ、それぞれ入力される。
論理積ゲート203でも論理積ゲート201、202と
同様に、D1’’の反転と、下位の1ビットD0’’との
論理積をとり、3ステート出力バッファ207及び論理
和素子209に出力する。すなわち論理積ゲート203
は、D1’’=0であれば、O0からD0’’を出力し、
1’’=1であれば、O0から0を3ステート出力バッ
ファ207及び論理和素子209に出力する。
The D 0 ″ and D 1 ″ output from the AND gate 202 are also input to the AND gate 203. D 1 ″ goes to C of the AND gate 203, and D 0
Are input to I 0 of the AND gate 203, respectively.
Similarly to the logical product gates 201 and 202, the logical product gate 203 takes the logical product of the inversion of D 1 ″ and the lower 1 bit D 0 ″ and outputs the logical product to the 3-state output buffer 207 and the logical sum element 209. To do. That is, the AND gate 203
Outputs D 0 ″ from O 0 if D 1 ″ = 0,
If D 1 ″ = 1, O 0 to 0 are output to the 3-state output buffer 207 and the OR element 209.

【0058】このことを図を用いて説明する。図3
(c)は、論理積ゲート203の構成を示す構成図であ
り、308はインバータ、309は論理積素子である。
論理積ゲート203のCはインバータ308に接続され
ている。従って、インバータ308はD1’’の反転さ
れた↓D1’’を論理積素子309のBに出力する。
This will be described with reference to the drawings. Figure 3
(C) is a block diagram showing the configuration of the AND gate 203, where 308 is an inverter and 309 is an AND element.
C of the AND gate 203 is connected to the inverter 308. Thus, inverter 308 outputs D 1 '' inverted ↓ D 1 'of the' to B of AND gate 309.

【0059】論理積ゲート203のI0は、論理積素子
309のAに接続されている。またO0には、論理積素
子309の論理積出力が接続されている。論理積素子3
09は、入力AとBの論理積を出力する。従って、
1’’=0ならば↓D1’’=1となって論理積素子3
09のBには1が入力されるため、論理積素子309の
出力はD0’’と一致し、O0からはD0’’が出力され
る。反対にD1’’=1ならば↓D1’’=0となって論
理積素子309のBには0が入力されるため、論理積素
子309の出力は0となり、O0からは0が出力され
る。論理積ゲート203の入出力表を、図3(c)と共
に示す。
I 0 of the AND gate 203 is connected to A of the AND element 309. The logical product output of the logical product element 309 is connected to O 0 . AND element 3
09 outputs the logical product of the inputs A and B. Therefore,
If D 1 ″ = 0, ↓ D 1 ″ = 1, and AND element 3
Since the 09 B 1 is inputted, the output of AND gate 309 'coincides with, from O 0 D 0' D 0 'is output'. On the other hand, if D 1 ″ = 1, ↓ D 1 ″ = 0 and 0 is input to B of the logical product element 309, so the output of the logical product element 309 becomes 0, and 0 from O 0. Is output. An input / output table of the AND gate 203 is shown together with FIG.

【0060】論理積ゲート203の出力は、3ステート
出力バッファ207及び論理和素子209の入力aに入
力される。論理積ゲート203のO0から出力される信
号をD0’’’とする。D3=0かつD2=0かつD1=0
ならば、D0’’’=D0である。ところで今、2乗回路
の入力データは0でないので、論理積素子208は0を
出力し、論理和素子209の入力bには0が入力され
る。論理和素子209は入力aと入力bの論理和を出力
するので、論理和素子209から出力される値は入力a
すなわちD0’’’と等しい。すなわちD0’’’=0な
らば0を、またD0’’’=1ならば1を出力する。論
理和素子209の出力は、3ステート出力バッファ20
7のイネーブルEに入力される。3ステート出力バッフ
ァ207は、E=1ならば入力であるD0’’’を出力
し、E=0ならば出力はハイインピーダンスとなって入
力を出力しない。従って、D0’’’=1であれば、す
なわち入力のMSBがD1であれば、E=1となり、3
ステート出力バッファ207は1を出力し、D0’’’
=0であれば、すなわち入力のMSBが 1 以外であれ
ば、E=0となり、3ステート出力バッファ207の出
力はハイインピーダンスとなって入力を出力しない。
The output of the AND gate 203 is input to the 3-state output buffer 207 and the input a of the OR element 209. The signal output from O 0 of the AND gate 203 is D 0 ′ ″. D 3 = 0 and D 2 = 0 and D 1 = 0
Then, D 0 ′ ″ = D 0 . By the way, since the input data of the squaring circuit is not 0, the logical product element 208 outputs 0, and 0 is input to the input b of the logical sum element 209. Since the logical sum element 209 outputs the logical sum of the input a and the input b, the value output from the logical sum element 209 is the input a.
That is, it is equal to D 0 '''. That is, if D 0 ″ ″ = 0, 0 is output, and if D 0 ″ ″ = 1, 1 is output. The output of the logical sum element 209 is the 3-state output buffer 20.
7 is input to enable E. The 3-state output buffer 207 outputs D 0 ″ ″ which is an input when E = 1, and when E = 0, the output becomes high impedance and does not output the input. Therefore, if D 0 ′ ″ = 1, that is, if the input MSB is D 1 , then E = 1 and 3
The state output buffer 207 outputs 1 and D 0 '''
= 0, that is, when the MSB of the input is other than D 1 , E = 0 and the output of the 3-state output buffer 207 becomes high impedance and the input is not output.

【0061】一例として、2乗回路の入力が1011
(11)の場合について説明する。D3=1であるか
ら、論理積ゲート201はD0’、D1’、D2’を全て
0として出力する。D2’=0であるから、論理積ゲー
ト202はD0’、D1’をそのまま出力する。すなわち
0’’、D1’’は共に0である。D1’’=0である
から、論理積ゲート203はD0’’をそのまま、すな
わちD0’’’=0として出力する。また、2乗回路の
入力は0でないので、論理積素子208は0を出力す
る。論理和素子209はD0’’’=0と論理積素子2
08の出力すなわち0の論理和である0を出力する。従
って、3ステート出力バッファ207のイネーブルEは
0となり、出力はハイインピーダンスとなって入力
0’’’を出力しない。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since D 3 = 1, AND gate 201 D 0 ', D 1', outputs the all D 2 '0. Since D 2 '= 0, the AND gate 202 outputs D 0 ' and D 1 'as they are. That is, both D 0 ″ and D 1 ″ are 0. 'Since = 0, the AND gate 203 D 0' D 1 'outputs "as is, i.e. as D 0' '' = 0. Further, since the input of the squaring circuit is not 0, the logical product element 208 outputs 0. The logical sum element 209 is a logical product element 2 with D 0 ″ ″ = 0.
The output of 08, that is, 0 which is the logical sum of 0 is output. Therefore, the enable E of the 3-state output buffer 207 becomes 0, the output becomes high impedance, and the input D 0 ′ ″ is not output.

【0062】次に、2乗回路の入力データが0の場合に
ついて説明する。すなわち、論理和記号を#とすれば、
0#D1#D2#D3=0である。このとき、論理積素子
208は論理和素子209の入力bに1を出力する。ま
た、加算器204、205、206のイネーブルEはい
ずれも0となるため、出力はいずれもハイインピーダン
スとなって加算結果を出力しない。さらに、論理積ゲー
ト203の出力D0’’’=0であるので、3ステート
出力バッファ207及び論理和素子209の入力aは共
に0となる。
Next, the case where the input data of the squaring circuit is 0 will be described. That is, if the logical sum symbol is #,
D 0 #D 1 #D 2 #D 3 = 0. At this time, the logical product element 208 outputs 1 to the input b of the logical sum element 209. Further, since the enable E of each of the adders 204, 205, and 206 is 0, all outputs become high impedance and the addition result is not output. Further, since the output D 0 ′ ″ = 0 of the AND gate 203, the inputs a of the 3-state output buffer 207 and the OR element 209 are both 0.

【0063】論理和素子209は、入力aに入力された
論理積ゲート203の出力D0’’’と、入力bに入力
された論理積素子208の出力との論理和を、3ステー
ト出力バッファ207のイネーブルEに入力する。今、
論理積素子208は1を出力するため、論理和素子20
9は論理積ゲート203の出力D0’’’が0か1かに
かかわらず1を出力し、3ステート出力バッファ207
のイネーブルEには1が入力される。従って、3ステー
ト出力バッファ207は入力D0’’’=0を、2乗回
路の出力として出力する。
The logical sum element 209 calculates the logical sum of the output D 0 ′ ″ of the logical product gate 203 input to the input a and the output of the logical product element 208 input to the input b. Input to enable E of 207. now,
Since the logical product element 208 outputs 1, the logical sum element 20
9 outputs 1 regardless of whether the output D 0 ′ ″ of the AND gate 203 is 0 or 1 and outputs the 3-state output buffer 207.
1 is input to the enable E of the. Therefore, the 3-state output buffer 207 outputs the input D 0 ″ ″ = 0 as the output of the squaring circuit.

【0064】以上のように、2乗回路の入力データにお
けるMSBがD3ならば、すなわちD3=1ならば、加算
器204のみが加算を行なう。また、MSBがD2なら
ば、すなわちD3=0で、かつD2=1ならば、加算器2
05のみが加算を行なう。同様に、MSBがD1なら
ば、すなわちD3=0、D2=0で、かつD1=1なら
ば、加算器206のみが加算を行なう。さらにMSBが
0ならば、すなわちD3=0、D2=0、D1=0で、か
つD0=1ならば、3ステート出力バッファ207が1
を出力する。すなわち論理積ゲート201、202、2
03及び3ステート出力バッファ207は、入力のMS
B値抽出回路として動作する。そして2乗回路の入力デ
ータが0ならば3ステート出力バッファ207から0が
出力される。
As described above, if the MSB in the input data of the squaring circuit is D 3 , that is, if D 3 = 1 then only the adder 204 performs addition. If the MSB is D 2 , that is, D 3 = 0 and D 2 = 1 then the adder 2
Only 05 adds. Similarly, if the MSB is D 1 , ie, D 3 = 0, D 2 = 0 and D 1 = 1 then only adder 206 will perform the addition. If the MSB is D 0 , that is, D 3 = 0, D 2 = 0, D 1 = 0 and D 0 = 1 and the 3-state output buffer 207 is 1
Is output. That is, the AND gates 201, 202, 2
The 03 and 3-state output buffers 207 are input MSs.
It operates as a B value extraction circuit. If the input data of the squaring circuit is 0, the 3-state output buffer 207 outputs 0.

【0065】次に、2乗回路の入力のMSBがD3、す
なわちD3=1の場合の加算器204の動作を図を用い
て説明する。D3=1であるから2乗回路の入力データ
の数値は8以上15以下であり、加算器204のみが加
算結果を出力する。図4(a)は加算器204の構成を
示す構成図である。図4(a)に示したように、加算器
204は7ビット加算器であり、入力AはA0からA6
での7個の入力(A0が最下位桁)がある。同様に、入
力BはB0からB6までの7個の入力(B0が最下位桁)
がある。
Next, the operation of the adder 204 when the MSB of the input of the squaring circuit is D 3 , that is, D 3 = 1 will be described with reference to the drawings. Since D 3 = 1, the numerical value of the input data of the squaring circuit is 8 or more and 15 or less, and only the adder 204 outputs the addition result. FIG. 4A is a configuration diagram showing the configuration of the adder 204. As shown in FIG. 4A, the adder 204 is a 7-bit adder, and the input A has seven inputs A 0 to A 6 (A 0 is the least significant digit). Similarly, input B is 7 inputs from B 0 to B 6 (B 0 is the least significant digit)
There is.

【0066】図4(a)に示すように、加算器204の
入力Aには、A6にD3=1が入力され、A0からA5まで
の6個の入力には0が入力される。すなわち、加算器2
04の入力Aには、MSB値である8の2乗=64が入
力される。一方、加算器204の入力Bには、B6
5、B4にそれぞれD2、D1、D0が入力され、B0から
3までの4個の入力には0が入力される。すなわち、
加算器204の入力Bには、2乗回路の入力データから
MSB値である8を引いた値を2×8=16倍した値が
入力される。加算器204では入力Aに入力される64
と、入力Bに入力される入力データから8を引いた値の
16倍を加算し、2乗回路の出力として出力する。従っ
て2乗回路の出力yは、2乗回路の入力xのMSB値x
1と、xからx1を引いたLSP値x2を用いて次のよう
に表せる。 y=x1 2+2x12 (6)
As shown in FIG. 4A, D 3 = 1 is input to A 6 to the input A of the adder 204, and 0 is input to the 6 inputs A 0 to A 5. It That is, the adder 2
To the input A of 04, the MSB value of 8 square = 64 is input. On the other hand, the input B of the adder 204 has B 6 ,
D 2 , D 1 , and D 0 are input to B 5 and B 4 , respectively, and 0 is input to the four inputs B 0 to B 3 . That is,
A value obtained by subtracting the MSB value of 8 from the input data of the squaring circuit by 2 × 8 = 16 is input to the input B of the adder 204. 64 input to the input A in the adder 204
And 16 times the value obtained by subtracting 8 from the input data input to the input B are added and output as the output of the squaring circuit. Therefore, the output y of the squaring circuit is the MSB value x of the input x of the squaring circuit.
1, expressed as follows by using the LSP value x 2 minus x 1 from x. y = x 1 2 + 2x 1 x 2 (6)

【0067】2乗回路の入力のMSBが 2 、すなわち
3=0かつD2=1の場合の加算器205の動作を図を
用いて説明する。D3=0かつD2=1であるから2乗回
路の入力データの数値は4以上7以下であり、加算器2
05のみが加算結果を出力する。図4(b)は加算器2
05の構成を示す構成図である。図4(b)に示したよ
うに、加算器205は5ビット加算器であり、入力Aは
0からA4までの5個の入力(A0が最下位桁)があ
る。同様に、入力BはB0からB4までの5個の入力(B
0が最下位桁)がある。
The operation of the adder 205 when the MSB of the input of the squaring circuit is D 2 , that is, D 3 = 0 and D 2 = 1 will be described with reference to the drawings. Since D 3 = 0 and D 2 = 1 are satisfied, the numerical value of the input data of the squaring circuit is 4 or more and 7 or less, and the adder 2
Only 05 outputs the addition result. FIG. 4B shows an adder 2
It is a block diagram which shows the structure of 05. As shown in FIG. 4B, the adder 205 is a 5-bit adder, and the input A has five inputs A 0 to A 4 (A 0 is the least significant digit). Similarly, input B is five inputs B 0 to B 4 (B
0 is the least significant digit).

【0068】図4(b)に示すように、加算器205の
入力Aには、A4にD2=1が入力され、A0からA3まで
の4個の入力には0が入力される。すなわち、加算器2
05の入力Aには、MSB値である4の2乗=16が入
力される。一方、加算器205の入力Bには、B4とB3
にそれぞれD1とD0が入力され、B0からB2までの3個
の入力には0が入力される。すなわち、加算器205の
入力Bには、2乗回路の入力データからMSB値である
4を引いた値を2×4=8倍した値が入力される。加算
器205では入力Aに入力される16と、入力Bに入力
される入力データから4を引いた値の8倍を加算し、2
乗回路の出力として出力する。従って2乗回路の出力y
は、2乗回路の入力xのMSB値x1と、xからx1を引
いたLSP値x2を用いて次のように表せる。 y=x1 2+2x12 (6)
As shown in FIG. 4B, D 2 = 1 is input to A 4 to the input A of the adder 205, and 0 is input to the four inputs A 0 to A 3. It That is, the adder 2
To the input A of 05, the MSB value of 4 squared = 16 is input. On the other hand, the input B of the adder 205 has B 4 and B 3
D 1 and D 0 are input to each of them, and 0 is input to the three inputs B 0 to B 2 . That is, the input B of the adder 205 receives a value obtained by subtracting the MSB value of 4 from the input data of the squaring circuit, which is 2 × 4 = 8 times. In the adder 205, 16 input to the input A and 8 times the value obtained by subtracting 4 from the input data input to the input B are added, and 2 is added.
It outputs as the output of the squaring circuit. Therefore, the output y of the squaring circuit
Can be expressed as follows using the MSB value x 1 of the input x of the squaring circuit and the LSP value x 2 obtained by subtracting x 1 from x. y = x 1 2 + 2x 1 x 2 (6)

【0069】2乗回路の入力のMSBがD1、すなわち
3=0かつD2=0かつD1=1の場合の加算器206
の動作を図を用いて説明する。D3=0かつD2=0かつ
1=1であるから2乗回路の入力データの数値は2ま
たは3であり、加算器206のみが加算結果を出力す
る。図4(c)は加算器206の構成を示す構成図であ
る。図4(c)に示したように、加算器206は3ビッ
ト加算器であり、入力AはA0からA2までの3個の入力
(A0が最下位桁)がある。同様に、入力BはB0からB
2までの3個の入力(B0が最下位桁)がある。
The adder 206 when the MSB of the input of the squaring circuit is D 1 , that is, D 3 = 0, D 2 = 0 and D 1 = 1
The operation of will be described with reference to the drawings. Since D 3 = 0, D 2 = 0 and D 1 = 1 are given, the numerical value of the input data of the squaring circuit is 2 or 3, and only the adder 206 outputs the addition result. FIG. 4C is a configuration diagram showing the configuration of the adder 206. As shown in FIG. 4C, the adder 206 is a 3-bit adder, and the input A has three inputs A 0 to A 2 (A 0 is the least significant digit). Similarly, inputs B are B 0 to B
There are 3 inputs up to 2 (B 0 is the least significant digit).

【0070】図4(c)に示すように、加算器206の
入力Aには、A2にD1=1が入力され、A0とA1には0
が入力される。すなわち、加算器206の入力Aには、
MSB値である2の2乗=4が入力される。一方、加算
器206の入力Bには、B2にD0が入力され、B0とB1
には0が入力される。すなわち、加算器206の入力B
には、2乗回路の入力データからMSB値である2を引
いた値を2×2=4倍した値が入力される。加算器20
6では入力Aに入力される4と、入力Bに入力される入
力データから2を引いた値の4倍を加算し、2乗回路の
出力として出力する。従って2乗回路の出力yは、2乗
回路の入力xのMSB値x1と、xからx1を引いたLS
P値x2を用いて次のように表せる。 y=x1 2+2x12 (6)
As shown in FIG. 4C, D 1 = 1 is input to A 2 to the input A of the adder 206, and 0 is input to A 0 and A 1.
Is entered. That is, the input A of the adder 206 is
The MSB value 2 squared = 4 is input. On the other hand, to the input B of the adder 206, D 0 is input to B 2 and B 0 and B 1
Is input to 0. That is, the input B of the adder 206
A value obtained by subtracting 2 which is the MSB value from the input data of the squaring circuit is multiplied by 2 × 2 = 4 is input to the. Adder 20
In 6, the 4 input to the input A and 4 times the value obtained by subtracting 2 from the input data input to the input B are added and output as the output of the squaring circuit. Therefore, the output y of the squaring circuit is the LSB obtained by subtracting x 1 from the MSB value x 1 of the input x of the squaring circuit.
It can be expressed as follows using the P value x 2 . y = x 1 2 + 2x 1 x 2 (6)

【0071】一例として、2乗回路の入力が1011
(11)の場合について説明する。この場合D3=1で
あるから、加算器204のみが加算結果を出力する。加
算器204の入力Aには、82=64が入力される。ま
た、加算器204の入力Bには11−8=3の16倍、
すなわち48が入力される。従って加算器204は64
+48=112を2乗回路の出力として出力する。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. In this case, since D 3 = 1, only the adder 204 outputs the addition result. 8 2 = 64 is input to the input A of the adder 204. Also, the input B of the adder 204 is 16 times 11-8 = 3,
That is, 48 is input. Therefore, the adder 204 has 64
+ 48 = 112 is output as the output of the squaring circuit.

【0072】以上のように、2乗回路の入力データのM
SB値を抽出して、MSB値の2乗と、MSB値に応じ
た下位ビットの倍数を加算器で加算して2乗値を求める
ことにより、従来よりも加算器の数を減らし、回路規模
の小さな2乗回路を得ることができる。
As described above, M of the input data of the squaring circuit is
The SB value is extracted, and the square of the MSB value and the multiple of the lower bits according to the MSB value are added by an adder to obtain the square value. Can be obtained.

【0073】実施の形態3. 実施の形態2では、MSB値抽出回路として動作する論
理積ゲートの入力毎に加算器を持ち、1つの入力データ
に対してどれか1つの加算器あるいは3ステート出力バ
ッファが2乗結果を出力する構成としたが、これは必ず
しも必要ではない。例えば、図5に示すように加算器の
入力に対して3ステート出力バッファゲートを用いる構
成としてもよい。一般に加算器に比べ3ステートバッフ
ァの方がゲート数は少ないので、3ステートバッファゲ
ートを加算器の代わりに用いることで、回路規模を小さ
くすることができる。
Third Embodiment In the second embodiment, an adder is provided for each input of the AND gate that operates as the MSB value extraction circuit, and any one adder or three-state output buffer outputs the squared result for one input data. Although configured, this is not necessary. For example, as shown in FIG. 5, a configuration may be used in which a 3-state output buffer gate is used for the input of the adder. Generally, the number of gates in the three-state buffer is smaller than that in the adder. Therefore, the circuit scale can be reduced by using the three-state buffer gate instead of the adder.

【0074】実施の形態3でも、実施の形態1と同様に
y=x2をx=x1+x2とおくことによって、y≒x1 2
+2x12と近似した値を求める。以下、一例として入
力のビット数が4ビットの場合について、図を用いて実
施の形態3について説明する。図5は、実施の形態3に
おける2乗回路の構成を示す構成図であり、501、5
02、503、504は3ステート出力バッファゲー
ト、505は加算器である。なお、図2と同一又は相当
部分については、同一番号を付して説明は省略する。
Also in the third embodiment, as in the first embodiment, by setting y = x 2 to x = x 1 + x 2 , y≈x 1 2
+ 2x 1 x 2 and obtaining the value approximating. Hereinafter, as an example, a case where the number of input bits is 4 bits will be described with reference to the drawings. FIG. 5 is a configuration diagram showing the configuration of the squaring circuit according to the third embodiment.
02, 503, and 504 are 3-state output buffer gates, and 505 is an adder. It should be noted that the same or corresponding parts as those in FIG.

【0075】次に回路の動作について説明する。実施の
形態2と同様に、図5において、2乗回路に入力される
4ビットの信号を下位ビットから順にD0、D1、D2
3とする。このときDi∈{0、1}である。まず、2
乗回路に入力されるデータが0でない場合について説明
する。
Next, the operation of the circuit will be described. As in the case of the second embodiment, in FIG. 5, the 4-bit signal input to the squaring circuit is D 0 , D 1 , D 2 , in order from the lower bit.
Let it be D 3 . At this time, D i ε {0,1}. First, 2
A case where the data input to the squaring circuit is not 0 will be described.

【0076】実施の形態2と同様に、2乗回路に入力さ
れた4ビットのディジタル信号は論理積ゲート201に
入力される。論理積ゲート201では、D3の反転と、
下位の3ビットとの論理積をとり、論理積ゲート202
に出力する。論理積ゲート202では、D2’の反転
と、下位の2ビットとの論理積をとり、論理積ゲート2
03に出力する。論理積ゲート203では、D1’’の
反転と、D0との論理積をとり、3ステート出力バッフ
ァゲート304に出力する。すなわち、実施の形態2と
同様に、論理積ゲート201、202、203は、2乗
回路入力データのMSB値抽出回路として動作する。
As in the second embodiment, the 4-bit digital signal input to the squaring circuit is input to the AND gate 201. In the AND gate 201, the inversion of D 3
The logical product with the lower 3 bits is calculated, and the logical product gate 202
Output to. In the logical product gate 202, the logical product of the inversion of D 2 'and the lower 2 bits is calculated, and the logical product gate 2
Output to 03. The logical product gate 203 takes the logical product of the inversion of D 1 ″ and D 0 and outputs the logical product to the 3-state output buffer gate 304. That is, as in the second embodiment, the AND gates 201, 202 and 203 operate as an MSB value extraction circuit for squaring circuit input data.

【0077】3ステート出力バッファゲート501の動
作を説明する。2乗回路の入力データは、論理積ゲート
201の他、3ステート出力バッファゲート501にも
入力される。D0、D1、D2、D3は3ステート出力バッ
ファゲート501のI0、I1、I2、I3へ、それぞれ入
力される。3ステート出力バッファゲート501には、
加算器505の使用しない入力を0にするために、0が
入力G1に入力される。具体的にはG1を接地する。ま
た、入力された4ビットの入力データのうちD3は、3
ステート出力バッファゲート501のイネーブルEにも
入力される。3ステート出力バッファゲート501はE
=D3=1ならば入力をそのまま出力し、E=D3=0な
らば出力はハイインピーダンスとなって入力を出力しな
い。従って3ステート出力バッファゲート501は、D
3が1ならばD0、D1、D2、D3、G1(=0)を加算器
505に出力し、D3が0ならば、出力はハイインピー
ダンスとなって、入力であるD0、D1、D2、D3、G1
(=0)を加算器505に出力しない。
The operation of the 3-state output buffer gate 501 will be described. The input data of the squaring circuit is input to the 3-state output buffer gate 501 as well as the AND gate 201. D 0 , D 1 , D 2 , and D 3 are input to I 0 , I 1 , I 2 , and I 3 of the 3-state output buffer gate 501, respectively. The 3-state output buffer gate 501 has
A 0 is input to input G 1 to zero the unused input of adder 505. Specifically, G 1 is grounded. In addition, D 3 of the input 4-bit input data is 3
It is also input to the enable E of the state output buffer gate 501. The 3-state output buffer gate 501 is E
= D 3 = 1, the input is output as it is, and E = D 3 = 0, the output is high impedance and the input is not output. Therefore, the 3-state output buffer gate 501 is
If 3 is 1, D 0 , D 1 , D 2 , D 3 , and G 1 (= 0) are output to the adder 505, and if D 3 is 0, the output becomes high impedance and the input D 0 , D 1 , D 2 , D 3 , G 1
(= 0) is not output to the adder 505.

【0078】このことを図を用いて説明する。図6
(a)は3ステート出力バッファゲート501の構成を
示す構成図であり、601、602、603、604、
605は3ステート出力バッファである。3ステート出
力バッファゲート501のEは、3ステート出力バッフ
ァ601、602、603、604、605のイネーブ
ルEに接続される。3ステート出力バッファゲート50
1のG1、I0、I1、I2、I3は、それぞれ3ステート
出力バッファ605、604、603、602、601
に接続されている。従って605、604、603、6
02、601には、それぞれ0、D0、D1、D2、D3
入力される。また、Og、O0、O1、O2、O3には、そ
れぞれ3ステート出力バッファ605、604、60
3、602、601の出力が接続されている。
This will be described with reference to the drawings. Figure 6
(A) is a configuration diagram showing a configuration of a 3-state output buffer gate 501, which includes 601, 602, 603, 604,
Reference numeral 605 is a 3-state output buffer. E of the 3-state output buffer gate 501 is connected to the enable E of the 3-state output buffers 601, 602, 603, 604, 605. 3-state output buffer gate 50
G 1 , I 0 , I 1 , I 2 , and I 3 of 1 are 3-state output buffers 605, 604, 603, 602, and 601 respectively.
It is connected to the. Therefore 605, 604, 603, 6
02, 601, 0, D 0 , D 1 , D 2 , D 3 are input, respectively. The three-state output buffers 605, 604, and 60 are provided for O g , O 0 , O 1 , O 2 , and O 3 , respectively.
The outputs of 3, 602 and 601 are connected.

【0079】3ステート出力バッファ601、602、
603、604、605のイネーブルEにはD3が入力
され、E=D3=1ならば3ステート出力バッファ60
5、604、603、602、601は、それぞれG1
(=0)、D0、D1、D2、D3を出力し、E=D3=0
ならば3ステート出力バッファ605、604、60
3、602、601の各出力は全てハイインピーダンス
となって信号を出力しない。3ステート出力バッファ5
01の入出力表を、図6(a)とともに示す。
Three-state output buffers 601, 602,
D 3 is input to the enable E of 603, 604 and 605, and if E = D 3 = 1 then the 3-state output buffer 60
5, 604, 603, 602 and 601 are each G 1
(= 0), D 0 , D 1 , D 2 , D 3 are output, and E = D 3 = 0
If so, 3-state output buffers 605, 604, 60
All the outputs of 3, 602, and 601 become high impedance and do not output a signal. 3-state output buffer 5
The input / output table of 01 is shown together with FIG.

【0080】一例として、2乗回路の入力が1011
(11)の場合について説明する。D3=1であるか
ら、3ステート出力バッファゲート501はD0、D1
2、D3、G1(=0)を、加算器505に出力する。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since D 3 = 1, the 3-state output buffer gate 501 has D 0 , D 1 ,
D 2 , D 3 , and G 1 (= 0) are output to the adder 505.

【0081】次に、3ステート出力バッファゲート50
2の動作を説明する。論理積ゲート201から出力され
るD0’、D1’、D2’は、論理積ゲート202の他、
3ステート出力バッファゲート502にも入力される。
0’、D1’、D2’は3ステート出力バッファゲート
502のI0、I1、I2へ、それぞれ入力される。3ス
テート出力バッファゲート502には、加算器505の
使用しない入力を0にするために、0が入力G2に入力
される。具体的にはG2を接地する。また、3ステート
出力バッファゲート502の入力のうちD2’は、3ス
テート出力バッファゲート502のイネーブルEにも入
力される。3ステート出力バッファゲート502はE=
2’=1ならば入力をそのまま出力し、E=D2’=0
ならば出力はハイインピーダンスとなって入力を出力し
ない。従って3ステート出力バッファゲート502は、
2’が1ならばD0’、D1’、D2’、G2(=0)を
加算器505に出力し、D2’が0ならば、出力はハイ
インピーダンスとなって、入力であるD0、D1、D2
2(=0)を加算器505に出力しない。
Next, the 3-state output buffer gate 50
The operation of No. 2 will be described. D 0 ′, D 1 ′ and D 2 ′ output from the logical product gate 201 are the logical product gate 202,
It is also input to the 3-state output buffer gate 502.
D 0 ′, D 1 ′ and D 2 ′ are input to I 0 , I 1 and I 2 of the 3-state output buffer gate 502, respectively. To the 3-state output buffer gate 502, 0 is input to the input G 2 in order to set the unused input of the adder 505 to 0. Specifically, G 2 is grounded. D 2 'of the inputs of the 3-state output buffer gate 502 is also input to the enable E of the 3-state output buffer gate 502. The 3-state output buffer gate 502 is E =
If D 2 '= 1, the input is output as it is, E = D 2 ' = 0
Then, the output becomes high impedance and the input is not output. Therefore, the 3-state output buffer gate 502 is
If D 2 ′ is 1, D 0 ′, D 1 ′, D 2 ′ and G 2 (= 0) are output to the adder 505, and if D 2 ′ is 0, the output becomes high impedance and the input D 0 , D 1 , D 2 ,
G 2 (= 0) is not output to the adder 505.

【0082】このことを図を用いて説明する。図6
(b)は3ステート出力バッファゲート502の構成を
示す構成図であり、606、607、608、609は
3ステート出力バッファである。3ステート出力バッフ
ァゲート502のEは、3ステート出力バッファ60
6、607、608、609のイネーブルEに接続され
る。3ステート出力バッファゲート502のG2、I0
1、I2は、それぞれ3ステート出力バッファ609、
608、607、606に接続されている。従って60
9、608、607、606には、それぞれ0、
0’、D1’、D2’が入力される。また、Og、O0
1、O2には、それぞれ3ステート出力バッファ60
9、608、607、606の出力が接続されている。
This will be described with reference to the drawings. Figure 6
(B) is a configuration diagram showing a configuration of the 3-state output buffer gate 502, and 606, 607, 608, 609 are 3-state output buffers. E of the 3-state output buffer gate 502 is a 3-state output buffer 60.
Connected to enable E of 6, 607, 608, 609. G 2 , I 0 of the 3-state output buffer gate 502,
I 1 and I 2 are 3-state output buffers 609 and
It is connected to 608, 607, and 606. Therefore 60
9, 608, 607, and 606 have 0,
D 0 ′, D 1 ′ and D 2 ′ are input. Also, O g , O 0 ,
A 3-state output buffer 60 is provided for each of O 1 and O 2.
The outputs of 9, 608, 607, and 606 are connected.

【0083】3ステート出力バッファ606、607、
608、609のイネーブルEにはD2’が入力され、
E=D2’=1ならば3ステート出力バッファ609、
608、607、606は、それぞれG2(=0)、
0’、D1’、D2’を出力し、E=D2’=0ならば3
ステート出力バッファ609、608、607、606
の各出力は全てハイインピーダンスとなって信号を出力
しない。3ステート出力バッファ502の入出力表を、
図6(b)とともに示す。
Three-state output buffers 606, 607,
D 2 'is input to enable E of 608 and 609,
If E = D 2 '= 1, 3-state output buffer 609,
608, 607 and 606 are G 2 (= 0) and
Outputs D 0 ', D 1 ' and D 2 'and 3 if E = D 2 ' = 0
State output buffers 609, 608, 607, 606
Outputs of all become high impedance and do not output signals. Input / output table of 3-state output buffer 502
It shows with FIG.6 (b).

【0084】一例として、2乗回路の入力が1011
(11)の場合について説明する。D3=1であるか
ら、論理積ゲート201はD0’、D1’、D2’を全て
0として出力する。D2’=0であるから、3ステート
出力バッファゲート502のイネーブルEには0が入力
される。従って3ステート出力バッファゲート502の
出力はハイインピーダンスとなって、入力である
0’、D1’、D2’、G2(=0)を加算器505に出
力しない。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since D 3 = 1, AND gate 201 D 0 ', D 1', outputs the all D 2 '0. Since D 2 '= 0, 0 is input to the enable E of the 3-state output buffer gate 502. Therefore, the output of the 3-state output buffer gate 502 becomes high impedance, and the inputs D 0 ′, D 1 ′, D 2 ′ and G 2 (= 0) are not output to the adder 505.

【0085】次に、3ステート出力バッファゲート50
3の動作を説明する。論理積ゲート202から出力され
るD0’’、D1’’は、論理積ゲート203の他、3ス
テート出力バッファゲート503にも入力される。
0’’、D1’’は3ステート出力バッファゲート50
3のI0、I1へ、それぞれ入力される。3ステート出力
バッファゲート503には、加算器505の使用しない
入力を0にするために、0が入力G3に入力される。具
体的にはG3を接地する。また、3ステート出力バッフ
ァゲート503の入力のうちD1’’は、3ステート出
力バッファゲート503のイネーブルEにも入力され
る。3ステート出力バッファゲート503はE=
1’’=1ならば入力をそのまま出力し、E=D1’’
=0ならば出力はハイインピーダンスとなって入力を出
力しない。従って3ステート出力バッファゲート503
は、D1’’が1ならばD0’’、D1’’、G3(=0)
を加算器505に出力し、D1’’が0ならば、出力は
ハイインピーダンスとなって、入力であるD0’’、
1’’、G3(=0)を加算器505に出力しない。
Next, the 3-state output buffer gate 50
The operation of No. 3 will be described. D 0 ″ and D 1 ″ output from the AND gate 202 are input to the 3-state output buffer gate 503 as well as the AND gate 203.
D 0 ″ and D 1 ″ are 3-state output buffer gates 50
3 are input to I 0 and I 1 , respectively. To the 3-state output buffer gate 503, 0 is input to the input G 3 in order to set the unused input of the adder 505 to 0. Specifically, G 3 is grounded. Further, D 1 ″ of the inputs of the 3-state output buffer gate 503 is also input to the enable E of the 3-state output buffer gate 503. The 3-state output buffer gate 503 has E =
If D 1 ″ = 1, the input is output as it is, E = D 1
If = 0, the output becomes high impedance and the input is not output. Therefore, the 3-state output buffer gate 503
Is, D 1 '' is 1 if D 0 '', D 1 ' ', G 3 (= 0)
Is output to the adder 505, and if D 1 ″ is 0, the output becomes high impedance and the input D 0 ″,
D 1 ″ and G 3 (= 0) are not output to the adder 505.

【0086】このことを図を用いて説明する。図6
(c)は3ステート出力バッファゲート503の構成を
示す構成図であり、610、611、612は3ステー
ト出力バッファである。3ステート出力バッファゲート
503のEは、3ステート出力バッファ610、61
1、612のイネーブルEに接続される。3ステート出
力バッファゲート503のG3、I0、I1は、それぞれ
3ステート出力バッファ612、611、610に接続
されている。従って612、611、610には、それ
ぞれ0、D0’’、D1’’が入力される。また、Og
0、O1には、それぞれ3ステート出力バッファ61
2、611、610の出力が接続されている。
This will be described with reference to the drawings. Figure 6
FIG. 6C is a configuration diagram showing the configuration of the 3-state output buffer gate 503, and 610, 611, and 612 are 3-state output buffers. E of the 3-state output buffer gate 503 is a 3-state output buffer 610, 61.
Connected to enable E of 1,612. G 3 , I 0 , and I 1 of the 3-state output buffer gate 503 are connected to the 3-state output buffers 612, 611, and 610, respectively. Therefore, 0, D 0 ″, and D 1 ″ are input to 612, 611, and 610, respectively. Also, O g ,
A three-state output buffer 61 is provided for each of O 0 and O 1.
The outputs of 2, 611 and 610 are connected.

【0087】3ステート出力バッファ610、611、
612のイネーブルEにはD1’’が入力され、E=
1’’=1ならば3ステート出力バッファ612、6
11、610は、それぞれG3(=0)、D0’’、
1’’を出力し、E=D1’’=0ならば3ステート出
力バッファ610、611、612の各出力は全てハイ
インピーダンスとなって信号を出力しない。3ステート
出力バッファ503の入出力表を、図6(c)とともに
示す。
Three-state output buffers 610 and 611,
D 1 ″ is input to the enable E of 612, and E =
If D 1 ″ = 1, 3-state output buffers 612, 6
11, 610 are G 3 (= 0), D 0 ″,
D 1 ″ is output, and if E = D 1 ″ = 0, the outputs of the three-state output buffers 610, 611, and 612 all become high impedance and no signal is output. An input / output table of the 3-state output buffer 503 is shown with FIG.

【0088】一例として、2乗回路の入力が1011
(11)の場合について説明する。D3=1であるか
ら、論理積ゲート201はD0’、D1’、D2’を全て
0として出力する。D2’=0であるから、論理積ゲー
ト202はD0’、D1’をそのまま、すなわち
0’’、D1’’を共に0として出力する。D1’’=
0であるから、3ステート出力バッファゲート503の
イネーブルEには0が入力される。従って3ステート出
力バッファゲート503の出力はハイインピーダンスと
なって、入力であるD0’’、D1’’、G3(=0)を
加算器505に出力しない。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since D 3 = 1, AND gate 201 D 0 ', D 1', outputs the all D 2 '0. 'Because it is = 0, the AND gate 202 D 0' D 2, 'as it is, i.e. D 0' D 1 ', and it outputs the 0 both D 1' '. D 1 ″ =
Since it is 0, 0 is input to the enable E of the 3-state output buffer gate 503. Therefore, the output of the 3-state output buffer gate 503 becomes high impedance, and the inputs D 0 ″, D 1 ″ and G 3 (= 0) are not output to the adder 505.

【0089】次に、3ステート出力バッファゲート50
4の動作を説明する。論理積ゲート203から出力され
るD0’’’は、3ステート出力バッファゲート504
に入力される。D0’’’、は3ステート出力バッファ
ゲート504のI0へ入力される。3ステート出力バッ
ファゲート504には、加算器505の使用しない入力
を0にするために、入力0がG4に入力される。具体的
にはG4を接地する。また、3ステート出力バッファゲ
ート504に入力されるD0’’’は、論理和素子20
9の入力aにも入力される。ところで今、2乗回路の入
力は0でないので、論理積素子208は0を出力し、論
理和素子209の入力bには0が入力される。論理和素
子209は入力aと入力bの論理和を出力するので、論
理和素子209から出力される値はD0’’’と等し
い。すなわち、D0’’’=0ならば0を出力し、D0
1ならば1を出力する。論理和素子209の出力は、3
ステート出力バッファゲート504のイネーブルEに入
力される。3ステート出力バッファゲート504はE=
1ならば入力をそのまま出力し、E=0ならば出力はハ
イインピーダンスとなって入力を出力しない。従って、
3ステート出力バッファゲート504は、D0’’’=
1ならばD0’’’、G4(=0)を加算器505に出力
し、D0’’’=0ならば、出力はハイインピーダンス
となって、入力であるD0、G4(=0)を加算器505
に出力しない。
Next, the 3-state output buffer gate 50
The operation of No. 4 will be described. D 0 ′ ″ output from the AND gate 203 is a 3-state output buffer gate 504.
Entered in. D 0 ″ ″ is input to I 0 of the 3-state output buffer gate 504. The 3-state output buffer gate 504 has an input 0 input to G 4 to zero the unused input of adder 505. Specifically grounds the G 4. Further, D 0 ″ ″ input to the 3-state output buffer gate 504 is the OR element 20.
It is also input to the input a of 9. By the way, since the input of the squaring circuit is not 0, the logical product element 208 outputs 0, and 0 is input to the input b of the logical sum element 209. Since the logical sum element 209 outputs the logical sum of the input a and the input b, the value output from the logical sum element 209 is equal to D 0 ″ ″. That is, if D 0 ′ ″ = 0, 0 is output, and D 0 =
If it is 1, 1 is output. The output of the logical sum element 209 is 3
It is input to the enable E of the state output buffer gate 504. The 3-state output buffer gate 504 is E =
If it is 1, the input is output as it is, and if E = 0, the output becomes high impedance and the input is not output. Therefore,
The 3-state output buffer gate 504 has D 0 ′ ″ =
If 1, D 0 ″ ″, G 4 (= 0) is output to the adder 505, and if D 0 ″ ″ = 0, the output becomes high impedance and the input D 0 , G 4 ( 0 = 0) is added to the adder 505
Do not output to.

【0090】このことを図を用いて説明する。図6
(d)は3ステート出力バッファゲート504の構成を
示す構成図であり、613、614は3ステート出力バ
ッファである。3ステート出力バッファゲート504の
Eは、3ステート出力バッファ613、614のイネー
ブルEに接続される。3ステート出力バッファゲート5
04のG4、I0は、それぞれ3ステート出力バッファ6
14、613に接続されている。従って614、613
には、それぞれ0、D0’’’が入力される。また、
g、O0には、それぞれ3ステート出力バッファ61
4、613の出力が接続されている。
This will be described with reference to the drawings. Figure 6
FIG. 6D is a configuration diagram showing the configuration of the 3-state output buffer gate 504, and 613 and 614 are 3-state output buffers. E of the 3-state output buffer gate 504 is connected to the enable E of the 3-state output buffers 613 and 614. 3-state output buffer gate 5
G 4 and I 0 of 04 are 3-state output buffers 6 respectively.
14 and 613. Therefore, 614 and 613
0 and D 0 ′ ″ are input to the respective terminals. Also,
A three-state output buffer 61 is provided for each of O g and O 0.
The outputs of 4, 613 are connected.

【0091】3ステート出力バッファ613、614の
イネーブルEには論理和素子209の出力が入力され、
E=1ならば3ステート出力バッファ614、613
は、それぞれG4(=0)、D0’’’を出力し、E=0
ならば3ステート出力バッファ613、614の各出力
は全てハイインピーダンスとなって信号を出力しない。
3ステート出力バッファ504の入出力表を、図6
(d)とともに示す。
The output of the logical sum element 209 is input to the enable E of the three-state output buffers 613 and 614,
If E = 1, 3-state output buffers 614 and 613
Outputs G 4 (= 0) and D 0 ''', respectively, and E = 0
In that case, all outputs of the three-state output buffers 613 and 614 become high impedance and no signal is output.
The input / output table of the 3-state output buffer 504 is shown in FIG.
Shown with (d).

【0092】一例として、2乗回路の入力が1011
(11)の場合について説明する。D3=1であるか
ら、論理積ゲート201はD0、D1、D2を全て0とし
て出力し、このためD2=0であるから、論理積ゲート
202はD0、D1をそのまま、すなわちD0、D1を共に
0として出力する。さらにD1=0であるから、論理積
ゲート203はD0をそのまま、すなわちD0=0として
出力する。すると論理和素子209の入力aには0が入
力される。このとき論理和素子209は、D0=0と論
理積素子208から入力される0との論理和すなわち0
を、3ステート出力バッファゲート504のイネーブル
Eに入力する。従って3ステート出力バッファゲート5
04の出力はハイインピーダンスとなって、入力である
0、G4(=0)を加算器505に出力しない。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since a D 3 = 1, the AND gate 201 is outputted as 0 all the D 0, D 1, D 2 , Therefore since it is D 2 = 0, the AND gate 202 as the D 0, D 1 That is, both D 0 and D 1 are output as 0. Since addition is D 1 = 0, the AND gate 203 outputs a D 0 as is, i.e. as D 0 = 0. Then, 0 is input to the input a of the logical sum element 209. At this time, the logical sum element 209 is a logical sum of D 0 = 0 and 0 input from the logical product element 208, that is, 0.
Is input to the enable E of the 3-state output buffer gate 504. Therefore, 3-state output buffer gate 5
The output of 04 becomes high impedance, and the inputs D 0 and G 4 (= 0) are not output to the adder 505.

【0093】次に、加算器505の動作を図を用いて説
明する。図7は、3ステート出力バッファゲート50
1、502、503、504と加算器505の接続を説
明する図であり、図5における3ステート出力バッファ
ゲート501、502、503、504と加算器505
を、入出力接続を含めて詳細に記した図である。図7に
示すように、加算器505は7ビット加算器であり、入
力AはA0からA6までの7個の入力(A0が最下位桁)
がある。同様に、入力BはB0からB6までの7個の入力
(B0が最下位桁)がある。入力AのうちA5、A3、A1
の入力を常に0とする。具体的にはA5、A3、A1を接
地する。同様に入力Bのうち、B1、B0の入力を常に0
とする。具体的にはB1、B0を接地する。
Next, the operation of the adder 505 will be described with reference to the drawings. FIG. 7 shows a 3-state output buffer gate 50.
FIG. 6 is a diagram for explaining the connection between 1, 502, 503, 504 and the adder 505, and the 3-state output buffer gates 501, 502, 503, 504 and the adder 505 in FIG.
FIG. 3 is a diagram showing in detail, including input / output connections. As shown in FIG. 7, the adder 505 is a 7-bit adder, and the input A is seven inputs A 0 to A 6 (A 0 is the least significant digit).
There is. Similarly, the input B has seven inputs B 0 to B 6 (B 0 is the least significant digit). Of the input A, A 5 , A 3 , A 1
Is always 0. Specifically, A 5 , A 3 , and A 1 are grounded. Similarly, of inputs B, the inputs of B 1 and B 0 are always 0
And Specifically, B 1 and B 0 are grounded.

【0094】3ステート出力バッファゲート501、5
02、503、504の出力と加算器505の接続を説
明する。3ステート出力バッファゲート501の出力の
うち、O3は加算器505のA6に接続される。またO2
はB6、O1はB5、O0はB4にそれぞれ接続される。ま
た、それ以外の加算器505の入力には3ステート出力
バッファゲート501のOgが接続される。次に、3ス
テート出力バッファゲート502の出力のうち、O2
加算器505のA4に接続される。またO1はB4、O0
3にそれぞれ接続される。また、それ以外の加算器5
05の入力には3ステート出力バッファゲート502の
gが接続される。次に、3ステート出力バッファゲー
ト503の出力のうち、O1は加算器505のA2に接続
される。またO0はB2に接続される。また、それ以外の
加算器505の入力には3ステート出力バッファゲート
503のOgが接続される。次に、3ステート出力バッ
ファゲート504の出力のうち、O0は加算器505の
0に接続される。また、それ以外の加算器505の入
力には3ステート出力バッファゲート504のOgが接
続される。
Three-state output buffer gates 501, 5
The connections of the outputs of 02, 503, and 504 and the adder 505 will be described. Of the outputs of the 3-state output buffer gate 501, O 3 is connected to A 6 of the adder 505. Also O 2
Is connected to B 6 , O 1 is connected to B 5 , and O 0 is connected to B 4 . Further, the O g of the 3-state output buffer gate 501 is connected to the input of the other adder 505. Next, of the outputs of the 3-state output buffer gate 502, O 2 is connected to A 4 of the adder 505. O 1 is connected to B 4 , and O 0 is connected to B 3 . Also, other adders 5
The O g of the 3-state output buffer gate 502 is connected to the input of 05. Next, of the outputs of the 3-state output buffer gate 503, O 1 is connected to A 2 of the adder 505. Also, O 0 is connected to B 2 . Further, the O g of the 3-state output buffer gate 503 is connected to the input of the other adder 505. Next, of the outputs of the 3-state output buffer gate 504, O 0 is connected to A 0 of the adder 505. Further, O g of the 3-state output buffer gate 504 is connected to the input of the other adder 505.

【0095】次に、2乗回路の入力のMSBがD3、す
なわちD3=1の場合の加算器505の動作を説明す
る。このとき2乗回路の入力データの数値は8以上15
以下であり、3ステート出力バッファゲート501のみ
が入力を加算器505に出力する。加算器505の入力
Aには、A6に3ステート出力バッファゲート501か
ら出力されるD3が入力される。A1、A3、A5は接地さ
れており、入力は0である。またA0、A2、A4は3ス
テート出力バッファゲート501のG1(=0)が入力
されるため、入力は0である。すなわち、加算器505
の入力Aには、 2 =64が入力される。一方、加算器
505の入力Bには、B6、B5、B4にそれぞれD2、D
1、D0が入力される。B0、B1は接地されており、入力
は0である。またB2、B3は3ステート出力バッファゲ
ート501の出力G1(=0)が入力されるため、入力
は0である。すなわちB0、B1、B2、B3が0であるこ
とから、加算器505の入力Bには、D2、D1、D0
表される2乗回路の入力データから8を引いた値の16
倍が入力される。加算器505は入力Aに入力される6
4と、入力Bに入力される入力データから8を引いた値
の16倍を加算し、2乗回路の出力として出力する。
Next, the operation of the adder 505 when the MSB of the input of the squaring circuit is D 3 , that is, D 3 = 1 will be described. At this time, the numerical value of the input data of the squaring circuit is 8 or more and 15
Below, only the 3-state output buffer gate 501 outputs its input to the adder 505. To the input A of the adder 505, D 3 output from the 3-state output buffer gate 501 is input to A 6 . A 1 , A 3 , and A 5 are grounded, and the input is 0. The A 0, since the G 1 of A 2, A 4 is 3-state output buffer gate 501 (= 0) is input, the input is zero. That is, the adder 505
8 2 = 64 is input to the input A of. On the other hand, the input B of the adder 505 is connected to B 6 , B 5 , and B 4 by D 2 and D, respectively.
1 and D 0 are input. B 0 and B 1 are grounded and the input is 0. Further, since the output G 1 (= 0) of the 3-state output buffer gate 501 is input to B 2 and B 3 , the input is 0. That is, since B 0 , B 1 , B 2 and B 3 are 0, 8 is subtracted from the input data of the square circuit represented by D 2 , D 1 and D 0 to the input B of the adder 505. Value of 16
Double is entered. The adder 505 is input to the input A 6
4 and 16 times the value obtained by subtracting 8 from the input data input to the input B are added and output as the output of the squaring circuit.

【0096】次に、2乗回路の入力のMSBがD2、す
なわちD3=0で、D2=1の場合の加算器505の動作
を説明する。このとき2乗回路の入力データの数値は4
以上7以下であり、3ステート出力バッファゲート50
2のみが入力を加算器505に出力する。加算器505
の入力Aには、A4に3ステート出力バッファゲート5
02から出力されるD2が入力される。A1、A3、A5
接地されており、入力は0である。またA0、A2、A6
は3ステート出力バッファゲート502の出力G2(=
0)が入力されるため、入力は0である。すなわち、加
算器505の入力Aには、 2 =16が入力される。一
方、加算器505の入力Bには、B4、B3にそれぞれD
1、D0が入力される。B0、B1は接地されており、入力
は0である。またB2、B5、B6は3ステート出力バッ
ファゲート502の出力G2(=0)が入力されるた
め、入力は0である。すなわちB0、B1、B2が0であ
ることから、加算器505の入力Bには、D1、D0で表
される2乗回路の入力データから4を引いた値の8倍が
入力される。加算器505は入力Aに入力される16
と、入力Bに入力される入力データから4を引いた値の
8倍を加算し、2乗回路の出力として出力する。
Next, the operation of the adder 505 when the MSB of the input of the squaring circuit is D 2 , that is, D 3 = 0 and D 2 = 1 will be described. At this time, the numerical value of the input data of the squaring circuit is 4
The above is 7 or less, and the 3-state output buffer gate 50
Only 2 outputs its input to the adder 505. Adder 505
Input A has a 3-state output buffer gate 5 on A 4
D 2 output from 02 is input. A 1 , A 3 , and A 5 are grounded, and the input is 0. Also, A 0 , A 2 , A 6
Is the output G 2 of the 3-state output buffer gate 502 (=
0) is input, so the input is 0. That is, 4 2 = 16 is input to the input A of the adder 505. On the other hand, the input B of the adder 505 has B 4 and B 3 respectively having D
1 and D 0 are input. B 0 and B 1 are grounded and the input is 0. Further, since the output G 2 (= 0) of the 3-state output buffer gate 502 is input to B 2 , B 5 , and B 6 , the input is 0. That is, since B 0 , B 1 and B 2 are 0, the input B of the adder 505 is 8 times the value obtained by subtracting 4 from the input data of the squaring circuit represented by D 1 and D 0. Is entered. The adder 505 is input to the input A 16
And 8 times the value obtained by subtracting 4 from the input data input to the input B are added and output as the output of the squaring circuit.

【0097】次に、2乗回路の入力のMSBがD1、す
なわちD3=0、D2=0で、かつD1=1の場合の加算
器505の動作を説明する。このとき2乗回路の入力デ
ータの数値は2または3であり、3ステート出力バッフ
ァゲート503のみが入力を加算器505に出力する。
加算器505の入力Aには、A2に3ステート出力バッ
ファゲート503から出力されるD1が入力される。
1、A3、A5は接地されており、入力は0である。ま
たA0、A4、A6は3ステート出力バッファゲート50
3の出力G3(=0)が入力されるため、入力は0であ
る。すなわち、加算器505の入力Aには、 2 =4が
入力される。一方、加算器505の入力Bには、B2
0が入力される。B0、B1は接地されており、入力は
0である。またB3、B4、B5、B6は3ステート出力バ
ッファゲート503の出力G3(=0)が入力されるた
め、入力は0である。すなわちB0、B1が0であること
から、加算器505の入力Bには、D0で表される2乗
回路の入力データから2を引いた値の4倍が入力され
る。加算器505は入力Aに入力される4と、入力Bに
入力される入力データから2を引いた値の4倍を加算
し、2乗回路の出力として出力する。
Next, the operation of the adder 505 when the MSB of the input of the squaring circuit is D 1 , that is, D 3 = 0, D 2 = 0 and D 1 = 1 will be described. At this time, the numerical value of the input data of the squaring circuit is 2 or 3, and only the 3-state output buffer gate 503 outputs the input to the adder 505.
To the input A of the adder 505, D 1 output from the 3-state output buffer gate 503 is input to A 2 .
A 1 , A 3 , and A 5 are grounded, and the input is 0. A 0 , A 4 , and A 6 are 3-state output buffer gates 50.
Since the output G 3 (= 0) of 3 is input, the input is 0. That is, 2 2 = 4 is input to the input A of the adder 505. On the other hand, to the input B of the adder 505, D 0 is input to B 2 . B 0 and B 1 are grounded and the input is 0. Further, since the output G 3 (= 0) of the 3-state output buffer gate 503 is input to B 3 , B 4 , B 5 , and B 6 , the input is 0. That is, since B 0 and B 1 are 0, four times the value obtained by subtracting 2 from the input data of the squaring circuit represented by D 0 is input to the input B of the adder 505. The adder 505 adds 4 input to the input A and 4 times the value obtained by subtracting 2 from the input data input to the input B, and outputs the result as the output of the squaring circuit.

【0098】一例として、2乗回路の入力が1011
(11)の場合について説明する。この場合D0=1で
あるから、3ステート出力バッファゲート501のみが
加算器505に入力する。加算器505の入力Aには、
2 =64が入力される。また、加算器505の入力B
には、11−8=3の16倍、すなわち48が入力され
る。従って加算器505は64+48=112を2乗回
路の出力として出力する。
As an example, the input of the squaring circuit is 1011.
The case of (11) will be described. Since D 0 = 1 in this case, only the 3-state output buffer gate 501 inputs to the adder 505. The input A of the adder 505 is
8 2 = 64 is input. Also, the input B of the adder 505
Is input 16 times 11-8 = 3, that is, 48. Therefore, the adder 505 outputs 64 + 48 = 112 as the output of the squaring circuit.

【0099】以上のように、2乗回路の入力データのM
SBを抽出して、MSBの2乗と、MSBに応じた下位
ビットの倍数を加算器で加算して2乗値を求めることに
より、従来よりも加算器の数を減らすことができる。さ
らに、3ステート出力バッファゲートを用いて加算器の
数を減らすことにより、回路規模の小さな2乗回路を得
ることができる。
As described above, M of the input data of the squaring circuit is
It is possible to reduce the number of adders by extracting SB and calculating the square value by adding the square of MSB and the multiple of the lower bit according to MSB by the adder. Furthermore, by reducing the number of adders by using the 3-state output buffer gate, it is possible to obtain a square circuit having a small circuit scale.

【0100】実施の形態4. 実施の形態1では、MSB値抽出回路を用いて入力デー
タのMSB値を求め、入力データをMSB値とLSP値
に分割して演算を行なう構成とした。本実施の形態4で
は、LSP値に対してさらにMSB値を抽出し、MSB
値とLSP値に分割して演算を行い、加算することで、
出力の誤差を小さくする。
Fourth Embodiment In the first embodiment, the MSB value of the input data is obtained using the MSB value extraction circuit, and the input data is divided into the MSB value and the LSP value to perform the calculation. In the fourth embodiment, the MSB value is further extracted from the LSP value and the MSB value is extracted.
Value and LSP value are divided and calculated and added,
Reduce the output error.

【0101】本実施の形態4における2乗回路で求める
値について説明する。2乗回路は入力データの数値の2
乗の数値のデータを出力する回路である。入力データを
x、出力データをyとすると、xとyの関係は次の式で
表せる。 y=x2 (1) 上式において、xをx1とx2の和で表すものとする。す
なわち x=x1+x2 (2) が成立する。式(2)を代入すると、式(1)は次のよ
うに書き表せる。 y=(x1+x22 =x1 2+2x12+x2 2 (3) 実施の形態1では、x1>x2が成り立つようにx1とx2
を選ぶことで、式(3)においてx2 2を無視した値を求
めた。実施の形態4では、x1>x2が成り立つようにx
1とx2を選び、さらに 2 をx3とx4の和で表すものと
する。すなわち x2=x3+x4 (7) が成立する。式(7)を代入すると、式(3)は次のよ
うに書き表せる。 y=x1 2+2x12+x2 2 =x1 2+2x12+x3 2+2x34+x4 2 (3)’ ここで、x3>x4が成り立つならば、それぞれを2乗し
たx3 2、x4 2の間には次の関係が成立する。 x3 2≫x4 2 (8) 式(8)の関係を用いると、式(3)’は次のように変
形できる。 y=x1 2+2x12+x3 2+2x34+x4 2 ≒x1 2+2x12+x3 2+2x34 (9) すなわち、x3>x4が成り立つようにx3とx4を選べ
ば、2乗出力データyに対するx4 2の寄与を無視でき
る。本実施の形態4では式(9)の右辺を2乗回路の出
力として求める。以下、図を用いて実施の形態4につい
て説明する。図8は、実施の形態4における2乗回路の
構成を示す構成図であり、図8において、801はMS
B値抽出回路、802は左ビットシフト回路、803は
加算器、804は左ビットシフト回路、805は加算器
である。また、図1と同一または相当部分については同
一符号を付してその説明は省略する。
The value obtained by the squaring circuit in the fourth embodiment will be described. The square circuit is the numerical value 2 of the input data.
This is a circuit that outputs the data of the power value. When the input data is x and the output data is y, the relationship between x and y can be expressed by the following equation. y = x 2 (1) In the above equation, x is represented by the sum of x 1 and x 2 . That is, x = x 1 + x 2 (2) holds. By substituting the equation (2), the equation (1) can be expressed as follows. y = (x 1 + x 2 ) 2 = x 1 2 + 2x 1 x 2 + x 2 2 (3) In the first embodiment, x 1 and x 2 are satisfied so that x 1 > x 2.
By selecting, the value ignoring x 2 2 in the formula (3) was obtained. In the fourth embodiment, x 1 so that x 1 > x 2 holds.
Select 1 and x 2, further denote the x 2 by the sum of x 3 and x 4. That is, x 2 = x 3 + x 4 (7) holds. By substituting the equation (7), the equation (3) can be expressed as follows. y = x 1 2 + 2x 1 x 2 + x 2 2 = x 1 2 + 2x 1 x 2 + x 3 2 + 2x 3 x 4 + x 4 2 (3) 'Here, if x 3 > x 4 holds, then 2 The following relation holds between the multiplied x 3 2 and x 4 2 . x 3 2 >> x 4 2 (8) Using the relationship of the expression (8), the expression (3) ′ can be transformed as follows. y = x 1 2 + 2x 1 x 2 + x 3 2 + 2x 3 x 4 + x 4 2 ≒ x 1 2 + 2x 1 x 2 + x 3 2 + 2x 3 x 4 (9) i.e., x 3> x 4 so holds x 3 And x 4 are selected, the contribution of x 4 2 to the squared output data y can be ignored. In the fourth embodiment, the right side of equation (9) is obtained as the output of the squaring circuit. The fourth embodiment will be described below with reference to the drawings. FIG. 8 is a configuration diagram showing the configuration of the squaring circuit according to the fourth embodiment. In FIG. 8, 801 is an MS.
A B value extraction circuit, 802 is a left bit shift circuit, 803 is an adder, 804 is a left bit shift circuit, and 805 is an adder. Further, the same or corresponding portions as those in FIG. 1 are designated by the same reference numerals and the description thereof will be omitted.

【0102】次に回路の動作について説明する。図8に
おいて、実施の形態1と同様にディジタルの入力データ
は2乗回路に入力されると、MSB値抽出回路101に
入力されてMSB値が抽出される。2乗回路の入力デー
タxの数値が2m≦x≦2m+1−1(mは負でない整数)
の範囲である場合、mビット目がMSBである。この場
合、MSB値抽出回路101はmビット目が1である2
mを抽出して出力する。以下、入力xのMSB値である
mをx1、xから2mを引いたLSP値x−2mすなわち
x−x1をx2とする。すなわち、x、x1、x2の間には
以下の関係が成立する。 x=x1+x2 (6)
Next, the operation of the circuit will be described. In FIG. 8, as in the first embodiment, when digital input data is input to the squaring circuit, it is input to the MSB value extraction circuit 101 and the MSB value is extracted. The numerical value of the input data x of the squaring circuit is 2 m ≤x≤2 m + 1 -1 (m is a non-negative integer)
, The m-th bit is the MSB. In this case, the MSB value extraction circuit 101 outputs 2 where the m-th bit is 1.
Extract and output m . Hereinafter, 2 m that is the MSB value of the input x is x 1 , and the LSP value x−2 m obtained by subtracting 2 m from x, that is, x−x 1 is x 2 . That is, the following relationship holds between x, x 1 and x 2 . x = x 1 + x 2 (6)

【0103】一例として、入力データx=14の場合を
考える。2進数で表すと14は1110(14)であ
る。xはMSBである1000(8)と、入力データ1
110(14)からMSB値1000(8)を引いたL
SP値110(6)に分けることができる。MSB値抽
出回路101は3ビット目が1である1000(8)を
抽出して出力する。
As an example, consider the case of input data x = 14. When expressed in binary, 14 is 1110 (14). x is the MSB 1000 (8) and the input data 1
L obtained by subtracting the MSB value of 1000 (8) from 110 (14)
The SP value can be divided into 110 (6). The MSB value extraction circuit 101 extracts and outputs 1000 (8) in which the third bit is 1.

【0104】MSB値抽出回路101は入力データxの
MSB値であるx1すなわち2mを出力する。MSB値抽
出回路101から出力されたx1は左ビットシフト回路
102に入力される。また、x1は左ビットシフト回路
102のシフト入力Sにも入力される。左ビットシフト
回路102に入力されたx1は、シフト入力Sで指定さ
れる桁だけ左ビットシフトされる。シフト入力Sにはm
ビット目が1のx1が入力されているので、x1はmビッ
トだけ左ビットシフトされ、x1’を出力する。ここ
で、x1’は2mをmビットシフトした値であるから22m
に等しい。すなわちx1’=x1 2である。左ビットシフ
ト回路102はx1すなわち2mを2乗して、x1 2すなわ
ち22mを加算器805に出力する。
The MSB value extraction circuit 101 outputs x 1 that is the MSB value of the input data x, that is, 2 m . The x 1 output from the MSB value extraction circuit 101 is input to the left bit shift circuit 102. Further, x 1 is also input to the shift input S of the left bit shift circuit 102. The x 1 input to the left bit shift circuit 102 is left bit-shifted by the digit designated by the shift input S. M for shift input S
Since x 1 of which the 1st bit is 1 is input, x 1 is left-shifted by m bits to output x 1 ′. Here, x 1 'is a value obtained by shifting 2 m by m bits, so 2 2m
be equivalent to. That is, x 1 ′ = x 1 2 . The left bit shift circuit 102 squares x 1 or 2 m and outputs x 1 2 or 2 2m to the adder 805.

【0105】入力データx=14の場合の左ビットシフ
ト回路102の動作を説明する。MSB値抽出回路10
1から出力された、入力データxのMSB値である10
00(8)は、左ビットシフト回路102で3ビットだ
け左ビットシフトされる。ここで、1000(8)は3
ビット目だけが1であるから、1000(8)の3ビッ
トシフトは2乗操作に等しい。ビットシフトされた値1
000000(64)は、左ビットシフト回路102の
出力として加算器805に入力される。
The operation of the left bit shift circuit 102 when the input data x = 14 will be described. MSB value extraction circuit 10
10 which is the MSB value of the input data x output from 1
00 (8) is left bit-shifted by 3 bits in the left bit shift circuit 102. Where 1000 (8) is 3
Since only the 1st bit is 1, a 3-bit shift of 1000 (8) is equivalent to a square operation. Bit-shifted value 1
000000 (64) is input to the adder 805 as the output of the left bit shift circuit 102.

【0106】MSB値抽出回路101から出力される入
力データxのMSB値であるx1すなわち2mは、加算器
103にも入力される。加算器103は入力データxか
らx1を減算し、x−x1すなわちLSP値であるx2
左ビットシフト回路104に出力する。
The MSB value x 1 of the input data x output from the MSB value extraction circuit 101, that is, 2 m, is also input to the adder 103. The adder 103 subtracts x 1 from the input data x and outputs x−x 1, that is, the LSP value x 2 to the left bit shift circuit 104.

【0107】入力データx=14の場合の加算器103
の動作を説明する。加算器103は、MSB値抽出回路
101から出力された入力データxのMSB値である1
000(8)を、入力データx=1110(14)から
減算し、入力データxのLSP値である110(6)を
左ビットシフト回路104に出力する。
Adder 103 when input data x = 14
The operation of will be described. The adder 103 is 1 which is the MSB value of the input data x output from the MSB value extraction circuit 101.
000 (8) is subtracted from the input data x = 1110 (14), and 110 (6), which is the LSP value of the input data x, is output to the left bit shift circuit 104.

【0108】左ビットシフト回路104には、加算器1
03の出力である入力データxのLSP値x2が入力さ
れる。また、左ビットシフト回路104のシフト入力S
にはMSB値抽出回路101から出力される入力データ
xのMSB値であるx1が入力される。左ビットシフト
回路104に入力されたx2は、シフト入力Sで指定さ
れる値に1を加えた桁だけ左ビットシフトされる。シフ
ト入力Sにはmビット目が1のx1が入力されているの
で、x2は(m+1)ビットだけ左ビットシフトされ
る。ここで左mビットシフトはx1倍に相当し、1ビッ
トシフトは2倍に相当する。すなわち、左ビットシフト
回路104におけるx2の左(m+1)ビットシフト
は、2x12を導出する操作に等しい。左ビットシフト
回路104は、2x12を加算器805に出力する。
The left bit shift circuit 104 includes an adder 1
The LSP value x 2 of the input data x, which is the output of 03, is input. In addition, the shift input S of the left bit shift circuit 104
X 1 which is the MSB value of the input data x output from the MSB value extraction circuit 101 is input to the. The x 2 input to the left bit shift circuit 104 is left bit-shifted by a digit obtained by adding 1 to the value designated by the shift input S. Since x 1 with the m-th bit being 1 is input to the shift input S, x 2 is shifted to the left by (m + 1) bits. Here, a left m-bit shift corresponds to x 1 times, and a 1-bit shift corresponds to 2 times. That is, the left (m + 1) bit shift of x2 in the left bit shift circuit 104 is equivalent to the operation of deriving 2x 1 x 2 . The left bit shift circuit 104 outputs 2 × 1 × 2 to the adder 805.

【0109】入力データx=14の場合の左ビットシフ
ト回路104の動作を説明する。加算器103から出力
された入力データxのLSP値である110(6)は、
3+1=4ビットだけビットシフトされる。ここで、4
ビットシフトは24=16倍の操作に等しく、2×x1
(8)×x2(6)=96が導出される。ビットシフト
された値は1100000(96)であり、左ビットシ
フト回路104の出力として加算器105に出力され
る。
The operation of the left bit shift circuit 104 when the input data x = 14 will be described. 110 (6), which is the LSP value of the input data x output from the adder 103, is
It is bit-shifted by 3 + 1 = 4 bits. Where 4
Bit shift is equal to 24 = 16 times operation, 2 × x 1
(8) × x 2 (6) = 96 is derived. The bit-shifted value is 1100000 (96), which is output to the adder 105 as the output of the left bit shift circuit 104.

【0110】加算器103から出力される入力データx
のLSP値x2は、MSB値抽出回路801にも入力さ
れてMSB値が抽出される。入力データxのLSP値x
2の数値が2n≦x≦2n+1−1(nは負でない整数、m
>n)の範囲である場合、nビット目がMSBである。
この場合、MSB値抽出回路801はnビット目が1で
ある2nを抽出して出力する。以下、入力データxのL
SP値x2のMSB値である2nをx3、x2から2nを引
いたx2−2nすなわちx2−x3をx4とする。すなわ
ち、x2、x3、x4の間には以下の関係が成立する。 x2=x3+x4 (7)
Input data x output from the adder 103
The LSP value x 2 of is also input to the MSB value extraction circuit 801, and the MSB value is extracted. LSP value x of input data x
2 numbers are 2 n ≦ x ≦ 2 n + 1 -1 (n is a nonnegative integer, m
> N), the nth bit is the MSB.
In this case, the MSB value extraction circuit 801 extracts and outputs 2 n in which the nth bit is 1. Below, L of input data x
SP value is a MSB value of x 2 and 2 n to x 3, x having from x 2 minus 2 n 2 -2 n other words x 2 -x 3 and x 4. That is, the following relationship holds among x 2 , x 3 , and x 4 . x 2 = x 3 + x 4 (7)

【0111】入力データx=14の場合のMSB値抽出
回路801の動作を説明する。入力データxのLSP値
である110(6)は、MSB値である100(4)
と、110(6)から100(4)を引いたLSP値1
0(2)に分けることができる。MSB値抽出回路80
1は2ビット目が1である100(4)を抽出して出力
する。
The operation of the MSB value extraction circuit 801 when the input data x = 14 will be described. The LSP value 110 (6) of the input data x is the MSB value 100 (4).
And LSP value 1 obtained by subtracting 100 (4) from 110 (6)
It can be divided into 0 (2). MSB value extraction circuit 80
1 outputs 100 (4) in which the second bit is 1 and outputs it.

【0112】MSB値抽出回路801はx2のMSB値
であるx3すなわち2nを出力する。MSB値抽出回路8
01から出力されたx3は左ビットシフト回路802に
入力される。また、x3は左ビットシフト回路802の
シフト入力Sにも入力される。左ビットシフト回路80
2に入力されたx3は、シフト入力Sで指定される桁だ
け左ビットシフトされる。シフト入力Sにはnビット目
が1のx3が入力されているので、x3はnビットだけ左
ビットシフトされ、x3’を出力する。ここで、x3’は
nを左nビットシフトした値であるから22nに等し
い。すなわちx3’=x32である。左ビットシフト回路
802はx3すなわち2nを2乗して、x3 2すなわち22n
を加算器805に出力する。
The MSB value extraction circuit 801 outputs x 3 which is the MSB value of x 2 , that is, 2 n . MSB value extraction circuit 8
The x 3 output from 01 is input to the left bit shift circuit 802. Further, x 3 is also input to the shift input S of the left bit shift circuit 802. Left bit shift circuit 80
The x 3 input to 2 is left bit-shifted by the digit specified by the shift input S. Since x 3 having the n-th bit of 1 is input to the shift input S, x 3 is left-bit shifted by n bits and outputs x 3 ′. Here, x 3 'is equal to 2 2n because it is a value obtained by shifting 2 n left n bits. I.e. x 3 '= x 3 2. The left bit shift circuit 802 squares x 3 or 2 n to obtain x 3 2 or 2 2n
Is output to the adder 805.

【0113】入力データx=14の場合の左ビットシフ
ト回路802の動作を説明する。MSB値抽出回路80
1から出力された、入力データxのLSP値 2 のMS
B値である100(4)は、左ビットシフト回路802
で2ビットだけ左ビットシフトされる。ここで、100
(4)は2ビット目だけが1であるから、100(4)
の左2ビットシフトは2乗操作に等しい。ビットシフト
された出力10000(16)は、左ビットシフト回路
802の出力として加算器805に入力される。
The operation of the left bit shift circuit 802 when the input data x = 14 will be described. MSB value extraction circuit 80
MS of LSP value x 2 of input data x output from 1
The B value 100 (4) is the left bit shift circuit 802.
Is shifted left by 2 bits. Where 100
In (4), only the second bit is 1, so 100 (4)
The left 2 bit shift of is equal to the square operation. The bit-shifted output 10000 (16) is input to the adder 805 as the output of the left bit shift circuit 802.

【0114】MSB値抽出回路801から出力されるx
2のMSB値であるx3すなわち2nは、加算器803に
も入力される。加算器803は入力データxのLSP値
2からx3を減算し、x2−x3すなわちx4を左ビット
シフト回路804に出力する。
X output from the MSB value extraction circuit 801
The MSB value of 2 that is x 3, that is, 2 n, is also input to the adder 803. The adder 803 the x 3 subtracts from the LSP value x 2 of the input data x, and outputs a x 2 -x 3 i.e. x 4 left bit shift circuit 804.

【0115】入力データx=14の場合の加算器803
の動作を説明する。加算器803は、MSB値抽出回路
801から出力されたx2のMSB値である100
(4)を、加算器603の入力である110(6)から
減算し、x2のLSP値である10(2)を左ビットシ
フト回路804に出力する。
Adder 803 when input data x = 14
The operation of will be described. The adder 803 outputs the MSB value of x 2 output from the MSB value extraction circuit 801, which is 100.
(4) is subtracted from 110 (6) which is the input of the adder 603, and 10 (2) which is the LSP value of x 2 is output to the left bit shift circuit 804.

【0116】左ビットシフト回路804には、加算器8
03の出力であるx2のLSP値x4が入力される。ま
た、左ビットシフト回路804のシフト入力Sには、M
SB値抽出回路801から出力されるx2のMSB値で
あるx3が入力される。左ビットシフト回路804に入
力されたx4は、シフト入力Sで指定される値に1を加
えた桁だけ左ビットシフトされる。シフト入力Sにはn
ビット目が1のx3が入力されているので、x4は(n+
1)ビットだけ左ビットシフトされる。ここで左nビッ
トシフトは 3 倍に相当し、1ビットシフトは2倍に相
当する。すなわち、左ビットシフト回路804における
4の(n+1)ビットシフトは、2x34を導出する
操作に等しい。左ビットシフト回路804は、2x34
を加算器805に出力する。
The left bit shift circuit 804 includes an adder 8
The LSP value x 4 of x 2 which is the output of 03 is input. Further, the shift input S of the left bit shift circuit 804 has M
X 3 which is the MSB value of x 2 output from the SB value extraction circuit 801 is input. The x 4 input to the left bit shift circuit 804 is left bit shifted by a digit obtained by adding 1 to the value designated by the shift input S. N for shift input S
Since x 3 of which the 1st bit is 1 is input, x 4 is (n +
1) Left bit is shifted by 1 bit. The left n-bit shift corresponds to x 3 times, and the 1-bit shift corresponds to 2 times. That is, the (n + 1) -bit shift of x 4 in the left bit shift circuit 804 is equivalent to the operation of deriving 2x 3 x 4 . Left bit shift circuit 804, 2x 3 x 4
Is output to the adder 805.

【0117】入力データx=14の場合の左ビットシフ
ト回路804の動作を説明する。加算器803から出力
されたx2のLSP値である10(2)は、2+1=3
ビットだけビットシフトされる。ここで、3ビットシフ
トは 3 =8倍の操作に等しく、2×x3(4)×x
4(2)=16が導出される。左ビットシフトされた値
は10000(16)であり、左ビットシフト回路80
4の出力として加算器805に出力される。
The operation of the left bit shift circuit 804 when the input data x = 14 will be described. 10 (2), which is the LSP value of x 2 output from the adder 803, is 2 + 1 = 3.
Only bits are bit-shifted. Here, 3-bit shift is equivalent to 2 3 = 8 times operation, 2 × x 3 (4) × x
4 (2) = 16 is derived. The value left-shifted is 10000 (16), and the left-bit shift circuit 80
4 is output to the adder 805.

【0118】加算器805では、左ビットシフト回路1
02から出力されるx1 2と左ビットシフト回路104か
ら出力される2x12と左ビットシフト回路802から
出力されるx3 2と左ビットシフト回路804から出力さ
れる2x34を加算し、2乗回路の出力として出力す
る。入力データx=14の場合、1000000(6
4)と1100000(96)と10000(16)と
10000(16)が加算されて、11000000
(192)が出力される。
In the adder 805, the left bit shift circuit 1
The x 1 2 and 2x 1 x 2 and 2x 3 x 4 output from x 3 2 and the left bit shift circuit 804 which is output from the left bit shift circuit 802 which is output from the left bit shift circuit 104 which is output from the 02 Add and output as the output of the squaring circuit. When input data x = 14, 1000000 (6
4), 1100000 (96), 10000 (16) and 10000 (16) are added to obtain 11,000,000
(192) is output.

【0119】図20に、2乗回路の入出力のグラフを示
す。点線が理想値、実線が実施の形態4における2乗回
路の入出力、一点鎖線が実施の形態1における2乗回路
の入出力である。実施の形態4の方が出力の近似誤差が
少ないことがわかる。
FIG . 20 shows a graph of the input / output of the squaring circuit. The dotted line is the ideal value, the solid line is the input / output of the squaring circuit in the fourth embodiment, and the alternate long and short dash line is the input / output of the squaring circuit in the first embodiment. It can be seen that the fourth embodiment has smaller output approximation error.

【0120】以上のように、2乗回路の入力データをM
SB値とLSP値に分割して、それぞれに対しあらかじ
め定められた左ビットシフト演算を行なって部分積を求
め、さらにLSP値に対しても同様にMSB値とLSP
値に分割して、それぞれに対しあらかじめ定められた左
ビットシフト演算を行なって部分積を求め、これら4つ
の部分積を加算して2乗値を求めることにより、従来よ
りも加算器の数を減らして、遅延が少ない2乗回路を得
ることができる。またLSP値をさらに分割してビット
シフト演算を施して加算することで、より誤差の少ない
2乗回路を得ることができる。
As described above, the input data of the squaring circuit is M
The SB value and the LSP value are divided, a predetermined left bit shift operation is performed for each to obtain a partial product, and the MSP value and the LSP value are similarly calculated for the LSP value.
By dividing into values, performing a predetermined left bit shift operation for each to obtain partial products, and adding these four partial products to obtain the squared value, the number of adders can be made smaller than before. By reducing the number, it is possible to obtain a squaring circuit with a small delay. Further, by further dividing the LSP value, performing the bit shift operation and adding the result, a square circuit with less error can be obtained.

【0121】実施の形態5. 実施の形態1では入力データをMSB値とLSP値に分
割して、それぞれに対しあらかじめ定められた左ビット
シフト演算を行なって部分積を求め、2つの部分積を加
算して2乗値を求める構成とした。実施の形態5では、
左ビットシフト回路に入力するデータをデコーダでデコ
ードし、デコーダ出力を左ビットシフト回路で左ビット
シフトして部分積を求め、2つの部分積を加算して2乗
値を求める構成として動作を説明する。
Embodiment 5. FIG. In the first embodiment, input data is divided into an MSB value and an LSP value, a predetermined left bit shift operation is performed on each of them to obtain a partial product, and two partial products are added to obtain a squared value. It was configured. In the fifth embodiment,
The operation is described as a configuration in which data input to the left bit shift circuit is decoded by a decoder, the decoder output is left bit shifted by the left bit shift circuit to obtain a partial product, and two partial products are added to obtain a squared value. To do.

【0122】実施の形態1では、y=x2をx=x1+x
2とおき、y≒x1 2+2x12と近似した。この場合、
近似誤差はx2 2である。2乗回路の入力データxの数値
が2m≦x≦2m+1−1(mは負でない整数)の範囲であ
る場合、mビット目がMSBである。ここで実施の形態
1と同様に、x1をxのMSB値とすれば、x2の最上位
ビットの値によって、近似誤差x2 2の値は変動する。
In the first embodiment, y = x 2 is replaced by x = x 1 + x
It was set to 2 and approximated as y≈x 1 2 + 2x 1 x 2 . in this case,
Approximation error is x 2 2. When the numerical value of the input data x of the squaring circuit is in the range of 2 m ≦ x ≦ 2 m + 1 −1 (m is a non-negative integer), the m-th bit is the MSB. Here as in the first embodiment, if the x 1 and MSB value of x, the most significant bits of the value of x 2, the value of the approximation error x 2 2 varies.

【0123】例えば、もしx2の最上位ビット、すなわ
ち(m−1)ビット目が0であれば、x2はx1/2より
小さい。x2=x1/2の場合の近似誤差の割合、すなわ
ちx2 2/yは、次のように求められる。 x2 2/y=(x1/2)2/(3x1/2)2 =1/9 (10) 従って(m−1)ビット目が0の場合、近似誤差の割合
は1/9より小さくなる。
For example, if the most significant bit of x 2 , that is, the (m-1) th bit is 0, x 2 is smaller than x 1/2 . The ratio of the approximation error when x 2 = x 1/2 , that is, x 2 2 / y is calculated as follows. x 2 2 / y = (x 1/2) 2 / (3x 1/2) 2 = 1/9 (10) hence (m-1) if bit is 0, the ratio of the approximation error than 1/9 Get smaller.

【0124】しかしながら、もしx2の最上位ビット、
すなわち(m−1)ビット目が1であれば、x2はx1
り小さい。x2=x1の場合の近似誤差の割合、すなわち
2 2/yは、次のように求められる。 x2 2/y=x1 2/(2x12 =1/4 (11) 従って(m−1)ビット目が1の場合、近似誤差の割合
は1/4程度の大きな値を取りうる。
However, if the most significant bit of x 2 ,
That is, if the (m−1) th bit is 1, x 2 is smaller than x 1 . The ratio of the approximation error when x 2 = x 1 , that is, x 2 2 / y is obtained as follows. x 2 2 / y = x 1 2 / (2x 1 ) 2 = 1/4 (11) Therefore, when the (m−1) th bit is 1, the approximation error ratio can take a large value of about 1/4. .

【0125】実施の形態5では、まずy=x2をx=x1
+x2とおくことによって、y≒x1 2+2x12と近似
する。さらにx2の最上位ビットにより表される数値を
5とおき、x1 2を(x1+x5/2)×x1にデコードす
ることで、2乗回路の出力値yを次のように表す。 y=x1 2+2x12+x15/2 (12) 本実施の形態5では式(12)の右辺を2乗回路の出力
として求める。式(12)によれば、x2の最上位ビッ
トが0の場合、x5=0より式(12)の右辺第3項は
0となって実施の形態1で求めた値と一致するが、x2
の最上位ビットが1の場合、x5=2m-1より右辺第3項
の値である22(m-1)が出力に加えられ、実施の形態1に
比べて近似誤差を減らすことができる。以下、図を用い
て実施の形態5について説明する。図9は、実施の形態
5における2乗回路の構成を示す構成図であり、図9に
おいて、901はデコーダである。また、図1と同一ま
たは相当部分については同一符号を付してその説明は省
略する。
In the fifth embodiment, first, y = x 2 is changed to x = x 1
+ By placing a x 2, to approximate y ≒ x 1 2 + 2x 1 x 2. Furthermore the numeric value represented by the most significant bit of x 2 x 5 Distant, the x 1 2 (x 1 + x 5/2) by decoding the × x 1, the output value y of the square circuit as follows Represent. In y = x 1 2 + 2x 1 x 2 + x 1 x 5/2 (12) according to the present embodiment 5 obtains the right side of equation (12) as an output of the squaring circuit. According to equation (12), when the most significant bit of x 2 is 0, the third term on the right side of equation (12) becomes 0 from x 5 = 0, which is in agreement with the value obtained in the first embodiment. , X 2
If the most significant bit of is 2 then the value of the third term on the right - hand side, 2 2 (m-1), is added to the output from x 5 = 2 m-1 to reduce the approximation error compared to the first embodiment. You can Embodiment 5 will be described below with reference to the drawings. FIG. 9 is a configuration diagram showing the configuration of the squaring circuit according to the fifth embodiment, and in FIG. 9, reference numeral 901 is a decoder. Further, the same or corresponding portions as those in FIG. 1 are designated by the same reference numerals and the description thereof will be omitted.

【0126】次に回路の動作について説明する。図9に
おいて、2値信号であるディジタルの入力データは2乗
回路に入力されると、MSB値抽出回路101に入力さ
れてMSB値が抽出される。2乗回路の入力データxの
数値が2m≦x≦2m+1−1(mは負でない整数)の範囲
である場合、mビット目がMSBである。この場合、M
SB値抽出回路101はmビット目が1である2mを抽
出して出力する。以下、入力データxのMSB値である
mをx1、xから2mを引いたx−2mすなわちLSP値
をx−x1をx2とする。従って、x、x1、x2の間には
以下の関係が成立する。 x=x1+x2 (6)
Next, the operation of the circuit will be described. In FIG. 9, when digital input data which is a binary signal is input to the squaring circuit, it is input to the MSB value extraction circuit 101 and the MSB value is extracted. When the numerical value of the input data x of the squaring circuit is in the range of 2 m ≦ x ≦ 2 m + 1 −1 (m is a non-negative integer), the m-th bit is the MSB. In this case, M
The SB value extraction circuit 101 extracts and outputs 2 m in which the m-th bit is 1. Hereinafter, a 2 m is the MSB value of the input data x x 1, the x-2 m i.e. LSP values minus 2 m from x to x-x 1 and x 2. Therefore, the following relationship holds between x, x 1 and x 2 . x = x 1 + x 2 (6)

【0127】一例として、入力データx=14の場合を
考える。2進数で表すと14は1110(14)であ
る。xはMSB値である1000(8)と、入力データ
1110(14)からMSB値1000(8)を引いた
LSP値110(6)に分けることができる。MSB値
抽出回路101は3ビット目が1である1000(8)
を抽出して出力する。
As an example, consider the case of input data x = 14. When expressed in binary, 14 is 1110 (14). x can be divided into 1000 (8) which is the MSB value and LSP value 110 (6) obtained by subtracting the MSB value 1000 (8) from the input data 1110 (14). In the MSB value extraction circuit 101, the third bit is 1 (1000 (8))
Is extracted and output.

【0128】MSB値抽出回路101は入力データxの
MSB値であるx1すなわち2mを出力する。MSB値抽
出回路101から出力されるx1は、デコーダ901に
入力されると共に加算器103にも入力される。加算器
103は入力データxからx1を減算し、x−x1すなわ
ちx2をデコーダ901に出力する。
The MSB value extraction circuit 101 outputs x 1 that is the MSB value of the input data x, that is, 2 m . The x 1 output from the MSB value extraction circuit 101 is input to the decoder 901 and also to the adder 103. The adder 103 subtracts x 1 from the input data x and outputs x−x 1, that is, x 2 to the decoder 901.

【0129】入力データx=14の場合の加算器103
の動作を説明する。加算器103は、MSB値抽出回路
101から出力された入力データxのMSB値である1
000(8)を、入力データxである1110(14)
から減算し、入力データxのLSP値である110
(6)をデコーダ901に出力する。
Adder 103 when input data x = 14
The operation of will be described. The adder 103 is 1 which is the MSB value of the input data x output from the MSB value extraction circuit 101.
000 (8) is the input data x, 1110 (14)
110 which is the LSP value of the input data x
(6) is output to the decoder 901.

【0130】MSB値抽出回路101から出力される入
力データxのMSB値であるx1すなわち2mと、加算器
103の出力であるx2は、デコーダ901に入力され
てデコードされる。このことを図を用いて説明する。図
10はデコーダ901の構成を示す構成図であり、10
01は最上位ビット抽出回路、1002は右ビットシフ
ト回路、1003は加算器である。
[0130] and x 1 i.e. 2 m is MSB value of the input data x output from the MSB value extraction circuit 101, x 2 which is the output of the adder 103 is decoded is input to the decoder 901. This will be described with reference to the drawings. FIG. 10 is a block diagram showing the structure of the decoder 901.
01 is the most significant bit extraction circuit, 1002 is a right bit shift circuit, and 1003 is an adder.

【0131】デコーダ901に入力されたx2は、最上
位ビット抽出回路1001に入力されて最上位ビットが
抽出される。xのMSBはmビット目であるので、xの
LSP値であるx2の最上位ビットは(m−1)ビット
目である。(m−1)ビット目が0であれば最上位ビッ
ト抽出回路1001はx5=0を、また(m−1)ビッ
ト目が1であれば最上位ビット抽出回路1001はx5
=2m-1を、右ビットシフト回路1002に出力する。
The x 2 input to the decoder 901 is input to the most significant bit extraction circuit 1001 and the most significant bit is extracted. Since the MSB of x is the mth bit, the most significant bit of x 2 , which is the LSP value of x, is the (m-1) th bit. (M-1) the long bit is 0 MSB extraction circuit 1001 x 5 = 0, also (m-1) most significant if bit is 1 bit extraction circuit 1001 x 5
= 2 m-1 is output to the right bit shift circuit 1002.

【0132】最上位ビット抽出回路1001から出力さ
れたx5は、右ビットシフト回路1002に入力されて
1ビットだけ右ビットシフトされる。従って右ビットシ
フト回路1002から出力される値x5/2は、入力x
の(m−1)ビット目が0か1かにより、0かまたは2
m-2となる。右ビットシフト回路1002から出力され
るx5/2は、加算器1003に入力されてx1と加算さ
れる。従って加算器1003から出力される値(x1
5/2)は、入力xの(m−1)ビット目が0か1か
により、2mかまたは2m+2m-2となる。加算器100
3の出力はデコーダ901の出力として左ビットシフト
回路102に入力される。
The x 5 output from the most significant bit extraction circuit 1001 is input to the right bit shift circuit 1002 and right bit shifted by 1 bit. Therefore, the value x 5/2 which is output from the right bit shift circuit 1002, the input x
0 or 2 depending on whether the (m-1) th bit of is 0 or 1.
It becomes m-2 . X 5/2 which is output from the right bit shift circuit 1002 is added is input x 1 and the adder 1003. Therefore, the value output from the adder 1003 (x 1 +
x 5/2) is the input x (m-1) th bit is 0 or 1 Kaniyori becomes 2 m or 2 m +2 m-2. Adder 100
The output of 3 is input to the left bit shift circuit 102 as the output of the decoder 901.

【0133】入力データx=14の場合のデコーダ90
1の動作を説明する。入力データxのLSP値である1
10(6)の最上位ビットは1である。最上位ビット値
抽出回路1001は2ビット目が1である100(4)
を抽出して、右ビットシフト回路1002に出力する。
右ビットシフト回路1002は、最上位ビット抽出回路
1001から出力された2ビット目が1である100
(4)を1ビット右ビットシフトし、10(2)を加算
器1003に出力する。加算器1003は、MSB値抽
出回路101から出力された1000(8)と、右ビッ
トシフト回路1002から出力される10(2)を加算
して、加算結果1010(10)をデコーダ901の出
力として左ビットシフト回路102に出力する。
Decoder 90 for input data x = 14
The operation of No. 1 will be described. 1 which is the LSP value of input data x
The most significant bit of 10 (6) is 1. The most significant bit value extraction circuit 1001 has a second bit of 1 100 (4)
Is extracted and output to the right bit shift circuit 1002.
In the right bit shift circuit 1002, the second bit output from the most significant bit extraction circuit 1001 is 100.
(4) is shifted right by 1 bit and 10 (2) is output to the adder 1003. The adder 1003 adds 1000 (8) output from the MSB value extraction circuit 101 and 10 (2) output from the right bit shift circuit 1002, and outputs an addition result 1010 (10) as an output of the decoder 901. Output to the left bit shift circuit 102.

【0134】デコーダ901から出力された(x1+x5
/2)は、左ビットシフト回路102に入力される。ま
た、MSB値抽出回路101から出力されたx1は、左
ビットシフト回路102のシフト入力Sにも入力され
る。左ビットシフト回路102に入力された(x1+x5
/2)は、シフト入力Sで指定される桁だけ左ビットシ
フトされる。シフト入力Sにはmビット目が1のx1
入力されているので、(x1+x5/2)はmビットだけ
左ビットシフトされ、x1’を出力する。ここで、x1
は2mかまたは2m+2m-2をmビットシフトした値であ
るから、22mかまたは22m+22m-2に等しい。すなわち
1’=(x1 2+x15/2)である。左ビットシフト
回路102はx1 2すなわち22mと、x15/2すなわち
0かまたは2mm-2の和を加算器105に出力する。
(X 1 + x 5 output from the decoder 901)
/ 2) is input to the left bit shift circuit 102. Further, x 1 output from the MSB value extraction circuit 101 is also input to the shift input S of the left bit shift circuit 102. (X 1 + x 5 input to the left bit shift circuit 102
/ 2) is bit-shifted to the left by the digit specified by the shift input S. Since the shift input S m-th bit is input x 1 of 1, (x 1 + x 5 /2) is bit-shifted to the left by m bits, and outputs a x 1 '. Where x 1 '
It is because a value of 2 m or 2 m +2 m-2 and m-bit shift, equal to 2 2m or 2 2m +2 2m-2. That x 1 'is = (x 1 2 + x 1 x 5/2). Left bit shift circuit 102 outputs a x 1 2 Namely 2 2m, the sum of x 1 x 5/2 i.e. 0 or 2 m 2 m-2 in the adder 105.

【0135】入力データx=14の場合のビットシフト
回路102の動作を説明する。デコーダ901から出力
された入力データxのMSB値である1000(8)
と、LSP値の最上位ビットを1ビット右ビットシフト
した10(2)の和である1010(10)は、左ビッ
トシフト回路102で3ビット左ビットシフトされる。
左ビットシフトされた値1010000(80)は、左
ビットシフト回路102の出力として加算器105に入
力される。
The operation of the bit shift circuit 102 when the input data x = 14 will be described. 1000 (8) which is the MSB value of the input data x output from the decoder 901
And 1010 (10), which is the sum of 10 (2) obtained by right-shifting the most significant bit of the LSP value by 1 bit, is left-bit-shifted by 3 bits in the left-bit shift circuit 102.
The left bit-shifted value 1010000 (80) is input to the adder 105 as the output of the left bit shift circuit 102.

【0136】加算器103から出力される入力データx
のLSP値x2は、デコーダ901に入力されると共に
左ビットシフト回路104に入力される。また、左ビッ
トシフト回路104のシフト入力Sには、MSB値抽出
回路101から出力される入力データxのMSB値であ
るx1が入力される。左ビットシフト回路104に入力
されたx2は、シフト入力Sで指定される値に1を加え
た桁だけ左ビットシフトされる。シフト入力Sにはmビ
ット目が1のx1が入力されているので、x2は(m+
1)ビットだけ左ビットシフトされる。ここで左mビッ
トシフトはx1倍に相当し、左1ビットシフトは2倍に
相当する。すなわち、左ビットシフト回路104におけ
るx2の左(m+1)ビットシフトは、2x12を導出
する操作に等しい。左ビットシフト回路104は、2x
12を加算器105に出力する。
Input data x output from the adder 103
The LSP value x 2 of is input to the decoder 901 and the left bit shift circuit 104. Further, the shift input S of the left bit shift circuit 104 is input with x 1 which is the MSB value of the input data x output from the MSB value extraction circuit 101. The x 2 input to the left bit shift circuit 104 is left bit-shifted by a digit obtained by adding 1 to the value designated by the shift input S. Since x 1 whose m-th bit is 1 is input to the shift input S, x 2 is (m +
1) Left bit is shifted by 1 bit. The left m-bit shift corresponds to x 1 times, and the left 1-bit shift corresponds to 2 times. That is, the left (m + 1) bit shift of x 2 in the left bit shift circuit 104 is equivalent to the operation of deriving 2x 1 x 2 . The left bit shift circuit 104 is 2x
1 × 2 is output to the adder 105.

【0137】入力データx=14の場合の左ビットシフ
ト回路104の動作を説明する。加算器103から出力
された入力データxのLSP値である110(6)は、
3+1=4ビットだけ左ビットシフトされる。ここで、
左4ビットシフトは24=16倍の操作に等しく、2×
1(8)×x2(6)=96が導出される。ビットシフ
トされた値は110000(96)であり、ビットシフ
ト回路104の出力として加算器105に出力される。
The operation of the left bit shift circuit 104 when the input data x = 14 will be described. 110 (6), which is the LSP value of the input data x output from the adder 103, is
The bits are left-shifted by 3 + 1 = 4 bits. here,
Left 4 bit shift is equivalent to 2 4 = 16 times operation, 2 ×
x 1 (8) × x 2 (6) = 96 is derived. The bit-shifted value is 110000 (96), which is output to the adder 105 as the output of the bit shift circuit 104.

【0138】加算器105では、左ビットシフト回路1
02から出力されるx1 2+x15/2と、左ビットシフ
ト回路104から出力される2x12を加算し、2乗回
路の出力として出力する。入力x=14の場合、101
0000(80)と110000(96)が加算され
て、1110000(176)が出力される。
In the adder 105, the left bit shift circuit 1
And x 1 2 + x 1 x 5 /2 which is output from the 02 adds 2x 1 x 2 output from the left bit shift circuit 104 as the output of the squaring circuit. 101 if input x = 14
0000 (80) and 110000 (96) are added and 110000 (176) is output.

【0139】以上のように、2乗回路の入力データをM
SB値とLSP値に分割して、MSB値をLSP値の最
上位ビットを用いてデコードし、デコーダ出力とLSP
値のそれぞれに対しあらかじめ定められた左ビットシフ
ト演算を行なって部分積を求め、2つの部分積を加算し
て2乗値を求めることにより、従来よりも加算器の数を
減らして、遅延が少ない2乗回路を、少ない誤差で得る
ことができる。
As described above, the input data of the square circuit is M
It is divided into SB value and LSP value, and the MSB value is decoded using the most significant bit of the LSP value.
A predetermined left shift operation is performed on each of the values to obtain a partial product, and two partial products are added to obtain a square value. Fewer square circuits can be obtained with less error.

【0140】実施の形態6. 実施の形態5では演算機能を持つブロックを用いて2乗
回路の動作の説明を行なった。実施の形態6では実際の
ディジタル信号が2乗回路に入力された場合のビット単
位の処理を、論理回路を用いて説明する。
Sixth Embodiment In the fifth embodiment, the operation of the squaring circuit has been described using the block having the arithmetic function. In the sixth embodiment, processing in bit units when an actual digital signal is input to the squaring circuit will be described using a logic circuit.

【0141】実施の形態6でも、実施の形態5と同様に
y=x2をx=x1+x2とおくことによって、y≒x1 2
+2x12と近似する。さらにx2の最上位ビットによ
り表される数値をx5とおき、x1 2を(x1+x5/2)
×x1にデコードすることで、結局y=x1 2+2x12
+x15/2を2乗回路の出力として求める。以下、一
例として入力のビット数が4ビットの場合について、図
を用いて実施の形態6について説明する。図11は、実
施の形態6における2乗回路の構成を示す構成図であ
り、1101、1102、1103は加算器である。ま
た、図2と同一または相当部分については同一符号を付
してその説明は省略する。
Also in the sixth embodiment, as in the fifth embodiment, by setting y = x 2 to x = x 1 + x 2 , y≈x 1 2
+ Approximate to the 2x 1 x 2. Furthermore the numeric value represented by the most significant bit of x 2 x 5 Distant, the x 1 2 (x 1 + x 5/2)
By decoding into × x 1 , eventually y = x 1 2 + 2x 1 x 2
+ Request x 1 x 5/2 as an output of the squaring circuit. Hereinafter, as an example, a case where the number of input bits is 4 will be described with reference to the drawings. FIG. 11 is a configuration diagram showing the configuration of the squaring circuit in the sixth embodiment, and 1101, 1102, and 1103 are adders. Further, the same or corresponding parts as those in FIG. 2 are designated by the same reference numerals, and the description thereof will be omitted.

【0142】実施の形態2と同様に、2乗回路に入力さ
れた4ビットのディジタル信号は論理積ゲート201に
入力される。論理積ゲート201では、D3の反転と、
下位の3ビットとの論理積をとり、論理積ゲート202
に出力する。論理積ゲート202では、D2’の反転
と、下位の2ビットとの論理積をとり、論理積ゲート2
03に出力する。論理積ゲート203では、D1’’の
反転と、D0との論理積をとり、3ステート出力バッフ
ァゲート304に出力する。すなわち、実施の形態2と
同様に、論理積ゲート201、202、203は、2乗
回路入力データのMSB値抽出回路として動作する。
As in the second embodiment, the 4-bit digital signal input to the squaring circuit is input to the AND gate 201. In the AND gate 201, the inversion of D 3
The logical product with the lower 3 bits is calculated, and the logical product gate 202
Output to. In the logical product gate 202, the logical product of the inversion of D 2 'and the lower 2 bits is calculated, and the logical product gate 2
Output to 03. The logical product gate 203 takes the logical product of the inversion of D 1 ″ and D 0 and outputs the logical product to the 3-state output buffer gate 304. That is, as in the second embodiment, the AND gates 201, 202 and 203 operate as an MSB value extraction circuit for squaring circuit input data.

【0143】2乗回路に入力された4ビットのデータの
うち、D3は加算器1101のイネーブルEに入力され
る。加算器1101はE=1ならば加算器の入力を加算
して加算結果を出力し、E=0ならば出力はハイインピ
ーダンスとなって加算結果を出力しない。従ってD3
1であれば、加算器1101は入力D0、D1、D2、D3
を用いて加算し、加算結果を出力する。これに対してD
3=0であれば、加算器1101の出力はハイインピー
ダンスとなって加算結果を出力しない。
Of the 4-bit data input to the squaring circuit, D 3 is input to the enable E of the adder 1101. When E = 1, the adder 1101 adds the inputs of the adder and outputs the addition result. When E = 0, the output becomes high impedance and the addition result is not output. Therefore D 3 =
If 1, the adder 1101 inputs D 0 , D 1 , D 2 , D 3
To add and output the addition result. On the other hand, D
If 3 = 0, the output of the adder 1101 becomes high impedance and the addition result is not output.

【0144】一例として、2乗回路の入力が1110
(14)の場合について説明する。D3=1であるか
ら、加算器1101のイネーブルEは1となって、加算
器1101は加算結果を出力する。
As an example, the input of the squaring circuit is 1110.
The case of (14) will be described. Since a D 3 = 1, the enable E of the adder 1101 is 1, the adder 1101 outputs the addition result.

【0145】論理積ゲート201の出力のうち、D2
加算器1102のイネーブルEに入力される。加算器1
102は加算器1101と同様に、E=1ならば入力を
加算して加算結果を出力し、E=0ならば出力はハイイ
ンピーダンスとなって加算結果を出力しない。従ってD
2=1であれば、加算器1102は入力D0、D1、D2
用いて加算し、加算結果を出力する。これに対してD2
=0であれば、加算器1102の出力はハイインピーダ
ンスとなって加算結果を出力しない。
Of the outputs of the AND gate 201, D 2 is input to the enable E of the adder 1102. Adder 1
Similarly to the adder 1101, the reference numeral 102 adds the inputs when E = 1 and outputs the addition result, and the output becomes high impedance when E = 0 and does not output the addition result. Therefore D
If 2 = 1, the adder 1102 adds using the inputs D 0 , D 1 , and D 2 and outputs the addition result. On the other hand, D 2
If = 0, the output of the adder 1102 becomes high impedance and the addition result is not output.

【0146】論理積ゲート202の出力のうち、D1
加算器1103のイネーブルEに入力される。加算器1
103は加算器1101、1102と同様に、E=1な
らば入力を加算して加算結果を出力し、E=0ならば出
力はハイインピーダンスとなって加算結果を出力しな
い。従ってD1=1であれば、加算器1103は入力
0、D1を用いて加算し、加算結果を出力する。これに
対してD1=0であれば、加算器1103の出力はハイ
インピーダンスとなって加算結果を出力しない。
Of the outputs of the AND gate 202, D 1 is input to the enable E of the adder 1103. Adder 1
Similarly to the adders 1101 and 1102, 103 adds the inputs and outputs the addition result when E = 1, and outputs the high impedance when E = 0 and does not output the addition result. Therefore, if D 1 = 1, the adder 1103 adds using the inputs D 0 and D 1 and outputs the addition result. On the other hand, if D 1 = 0, the output of the adder 1103 becomes high impedance and the addition result is not output.

【0147】次に、2乗回路の入力のMSBがD3、す
なわちD3=1の場合の加算器1101の動作を図を用
いて説明する。D3=1であるから2乗回路の入力デー
タの数値は8以上15以下であり、加算器1101のみ
が加算結果を出力する。図12(a)は加算器1101
の構成を示す構成図である。図12(a)に示したよう
に、加算器1101は7ビット加算器であり、入力Aは
0からA6までの7個の入力(A0が最下位桁)があ
る。同様に、入力BはB0からB6までの7個の入力(B
0が最下位桁)がある。
Next, the operation of the adder 1101 when the MSB of the input of the squaring circuit is D 3 , that is, D 3 = 1 will be described with reference to the drawings. Since D 3 = 1, the numerical value of the input data of the squaring circuit is 8 or more and 15 or less, and only the adder 1101 outputs the addition result. FIG. 12A shows an adder 1101.
It is a block diagram which shows the structure of. As shown in FIG. 12A, the adder 1101 is a 7-bit adder, and the input A has seven inputs A 0 to A 6 (A 0 is the least significant digit). Similarly, input B is seven inputs B 0 to B 6 (B
0 is the least significant digit).

【0148】図12(a)に示すように、加算器110
1の入力Aには、A6、A4にそれぞれD3=1、D2が入
力され、A0からA3及びA5の5個の入力には0が入力
される。すなわち、加算器1101の入力Aには、MS
B値である8の2乗=64と、LSP値の最上位ビット
を1ビット右ビットシフトした値の和が入力される。一
方、加算器1101の入力Bには、B6、B5、B4にそ
れぞれD2、D1、D0が入力され、B0からB3までの4
個の入力には0が入力される。すなわち、加算器110
1の入力Bには、2乗回路の入力データからMSB値で
ある8を引いた値を2×8=16倍した値が入力され
る。加算器1101では入力AとBを加算し、2乗回路
の出力として出力する。
As shown in FIG. 12A, the adder 110
To the input A of 1, D 3 = 1 and D 2 are input to A 6 and A 4 , respectively, and 0 is input to the five inputs A 0 to A 3 and A 5 . That is, the input A of the adder 1101 is connected to the MS
The sum of the square of 8 = 64 which is the B value and the value obtained by right-shifting the most significant bit of the LSP value by 1 bit is input. On the other hand, to the input B of the adder 1101, D 2 , D 1 , and D 0 are input to B 6 , B 5 , and B 4 , respectively, and 4 from B 0 to B 3 are input.
0 is input to each input. That is, the adder 110
A value obtained by subtracting 8 which is the MSB value from the input data of the squaring circuit is multiplied by 2 × 8 = 16 is input to the input B of 1. The adder 1101 adds the inputs A and B and outputs the result as the output of the squaring circuit.

【0149】2乗回路の入力のMSBがD2、すなわち
3=0で、かつD2=1の場合の加算器1102の動作
を図を用いて説明する。D2=1であるから2乗回路の
入力データの数値は4以上7以下であり、加算器110
2のみが加算結果を出力する。図12(b)は加算器1
102の構成を示す構成図である。図12(b)に示し
たように、加算器1102は5ビット加算器であり、入
力AはA0からA4までの5個の入力(A0が最下位桁)
がある。同様に、入力BはB0からB4までの5個の入力
(B0が最下位桁)がある。
The operation of the adder 1102 when the MSB of the input of the squaring circuit is D 2 , that is, D 3 = 0 and D 2 = 1 will be described with reference to the drawings. Since D 2 = 1, the value of the input data of the squaring circuit is 4 or more and 7 or less, and the adder 110
Only 2 outputs the addition result. FIG. 12B shows an adder 1
2 is a configuration diagram showing the configuration of 102. FIG. As shown in FIG. 12B, the adder 1102 is a 5-bit adder, and the input A is five inputs A 0 to A 4 (A 0 is the least significant digit).
There is. Similarly, the input B has five inputs B 0 to B 4 (B 0 is the least significant digit).

【0150】図12(b)に示すように、加算器110
2の入力Aには、A4、A2にそれぞれD2、D1が入力さ
れ、A0、A1、A3の3個の入力には0が入力される。
すなわち、加算器1102の入力Aには、MSB値であ
る4の2乗=16と、LSP値の最上位ビットを1ビッ
ト右ビットシフトした値の和が入力される。一方、加算
器1102の入力Bには、B4とB3にそれぞれD1とD0
が入力され、B0からB2までの3個の入力には0が入力
される。すなわち、加算器1102の入力Bには、2乗
回路の入力データからMSB値である4を引いた値を2
×4倍した値が入力される。加算器1102では入力A
とBを加算し、2乗回路の出力として出力する。
As shown in FIG. 12B, the adder 110
To the second input A, D 2 and D 1 are input to A 4 and A 2 , respectively, and 0 is input to the three inputs A 0 , A 1 and A 3 .
That is, to the input A of the adder 1102, the sum of 4 squared = 16, which is the MSB value, and the value obtained by right-shifting the most significant bit of the LSP value by 1 bit are input. On the other hand, the input B of the adder 1102 is connected to B 4 and B 3 by D 1 and D 0 , respectively.
Is input, and 0 is input to the three inputs B 0 to B 2 . That is, for the input B of the adder 1102, the value obtained by subtracting the MSB value of 4 from the input data of the squaring circuit is 2
The value multiplied by × 4 is input. Input A at adder 1102
And B are added and output as the output of the squaring circuit.

【0151】2乗回路の入力のMSBがD1、すなわち
3=0、D2=0で、かつD1=1である場合の加算器
1103の動作を図を用いて説明する。D1=1である
から2乗回路の入力データの数値は2または3であり、
加算器1103のみが加算結果を出力する。図12
(c)は加算器1103の構成を示す構成図である。図
12(c)に示したように、加算器1103は3ビット
加算器であり、入力AはA0からA2までの3個の入力
(A0が最下位桁)がある。同様に、入力BはB0からB
2までの3個の入力(B0が最下位桁)がある。
The operation of the adder 1103 when the MSB of the input of the squaring circuit is D 1 , that is, D 3 = 0, D 2 = 0 and D 1 = 1 will be described with reference to the drawings. Since D 1 = 1, the numerical value of the input data of the squaring circuit is 2 or 3,
Only the adder 1103 outputs the addition result. 12
FIG. 7C is a configuration diagram showing a configuration of the adder 1103. As shown in FIG. 12C, the adder 1103 is a 3-bit adder, and the input A has three inputs A 0 to A 2 (A 0 is the least significant digit). Similarly, inputs B are B 0 to B
There are 3 inputs up to 2 (B 0 is the least significant digit).

【0152】図12(c)に示すように、加算器110
3の入力Aには、A2、A0にD1、D0が入力され、A1
には0が入力される。すなわち、加算器1103の入力
Aには、MSB値である2の2乗=4と、LSP値の最
上位ビットを1ビット右ビットシフトした値の和が入力
される。一方、加算器1103の入力Bには、B2にD0
が入力され、B0とB1には0が入力される。すなわち、
加算器1103の入力Bには、2乗回路の入力データか
らMSB値である2を引いた値を2×2倍した値が入力
される。加算器1103では入力Aと、入力Bを加算
し、2乗回路の出力として出力する。
As shown in FIG. 12C, the adder 110
The third input A, is D 1, D 0 is input to the A 2, A 0, A 1
Is input to 0. That is, to the input A of the adder 1103, the sum of the MSB value of 2 squared = 4 and the value obtained by right-shifting the most significant bit of the LSP value by 1 bit is input. On the other hand, the input B of the adder 1103 is B 2 to D 0.
Is input, and 0 is input to B 0 and B 1 . That is,
To the input B of the adder 1103, a value obtained by subtracting 2 which is the MSB value from the input data of the squaring circuit is multiplied by 2 × 2 is input. The adder 1103 adds the input A and the input B and outputs the result as the output of the squaring circuit.

【0153】一例として、2乗回路の入力が1110
(14)の場合について説明する。この場合D3=1で
あるから、加算器1101のみが加算結果を出力する。
加算器1101の入力Aには、8×(8+2)=80が
入力される。また、加算器1101の入力Bには14−
8=6の16倍、すなわち96が入力される。従って加
算器1101は80+96=176を2乗回路の出力と
して出力する。
As an example, the input of the squaring circuit is 1110.
The case of (14) will be described. In this case, since D 3 = 1, only the adder 1101 outputs the addition result.
8 × (8 + 2) = 80 is input to the input A of the adder 1101. Further, the input B of the adder 1101 has a value of 14-
16 times 8 = 6, that is, 96 is input. Therefore, the adder 1101 outputs 80 + 96 = 176 as the output of the squaring circuit.

【0154】以上のように、2乗回路の入力データをM
SB値とLSP値に分割して、MSB値とLSP値の最
上位ビットを用いてデコードし、デコーダ出力とLSP
値のそれぞれに対しMSB値に応じた左ビットシフト演
算を行ない、左ビットシフト演算の結果を加算して2乗
値を求めることにより、従来よりも加算器の数を減らし
て、遅延が少ない2乗回路を、少ない誤差で得ることが
できる。
As described above, the input data of the squaring circuit is M
Divide into SB value and LSP value, decode using the most significant bit of MSB value and LSP value, and decode output and LSP
By performing a left bit shift operation according to the MSB value for each value and adding the results of the left bit shift operation to obtain a squared value, the number of adders is reduced and the delay is smaller than in the conventional case. The squaring circuit can be obtained with a small error.

【0155】図13に、2乗回路の入出力のグラフを示
す。点線が理想値、実線が実施の形態6における2乗回
路の入出力、一点鎖線が実施の形態1における2乗回路
の入出力である。図13から、実施の形態6の方が出力
の近似誤差が少ないことがわかる。
FIG. 13 shows a graph of input / output of the squaring circuit. The dotted line is the ideal value, the solid line is the input / output of the squaring circuit in the sixth embodiment, and the alternate long and short dash line is the input / output of the squaring circuit in the first embodiment. It can be seen from FIG. 13 that the sixth embodiment has a smaller output approximation error.

【0156】実施の形態7.Seventh Embodiment

【0157】実施の形態6では、論理積ゲートの出力を
加算器の出力とする構成としたが、これは必ずしも必要
ではなく、実施の形態3と同様に論理積ゲートの出力を
3ステート出力バッファゲートの入力とする構成とし、
3ステート出力バッファゲートの出力を加算器で加算す
る構成としてもよい。
In the sixth embodiment, the output of the AND gate is used as the output of the adder. However, this is not always necessary, and the output of the AND gate is not required as in the third embodiment.
It is configured as the input of 3-state output buffer gate,
The output of the 3-state output buffer gate may be added by an adder.

【0158】この場合の2乗回路の構成図は、例えば2
乗回路の入力が4ビットの場合は図3と同一の構成図と
なる。以下2乗回路の入力が4ビットの場合を例にと
り、実施の形態7における2乗回路の構成図が図3であ
るとして説明する。実施の形態7において実施の形態3
と異なる点は3ステート出力バッファゲート501、5
02、503と加算器505の接続法である。
The configuration diagram of the squaring circuit in this case is, for example, 2
When the input of the squaring circuit is 4 bits, the configuration is the same as in FIG. Taking the case where the input of the squaring circuit is 4 bits as an example, the configuration of the squaring circuit in the seventh embodiment will be described below with reference to FIG. Third Embodiment in Third Embodiment
Is different from the 3-state output buffer gates 501 and 5
02 and 503 and the adder 505 are connected.

【0159】実施の形態7における3ステート出力バッ
ファゲート501、502、503と加算器505の接
続を図を用いて説明する。図14は、3ステート出力バ
ッファゲート501、502、503と加算器505の
接続を説明する図であり、図14における3ステート出
力バッファゲート501、502、503、504と加
算器505を、入出力接続を含めて詳細に記した図であ
る。図14に示すように、加算器505は7ビット加算
器であり、入力AはA0からA6までの7個の入力(A0
が最下位桁)がある。同様に、入力BはB0からB6まで
の7個の入力(B0が最下位桁)がある。入力Aのうち
5、A3、A1の入力を常に0とする。具体的にはA5
3、A1を接地する。同様に入力Bのうち、B1、B0
入力を常に0とする。具体的にはB1、B0を接地する。
The connection between the 3-state output buffer gates 501, 502 and 503 and the adder 505 in the seventh embodiment will be described with reference to the drawings. FIG. 14 is a diagram for explaining the connection between the 3-state output buffer gates 501, 502, 503 and the adder 505. The 3-state output buffer gates 501, 502, 503, 504 and the adder 505 in FIG. It is the figure which described in detail including connection. As shown in FIG. 14, the adder 505 is a 7-bit adder, and the input A has seven inputs A 0 to A 6 (A 0
Is the least significant digit). Similarly, the input B has seven inputs B 0 to B 6 (B 0 is the least significant digit). Of the inputs A, the inputs A 5 , A 3 , and A 1 are always 0. Specifically, A 5 ,
Ground A 3 and A 1 . Similarly, of the inputs B, the inputs of B 1 and B 0 are always 0. Specifically, B 1 and B 0 are grounded.

【0160】3ステート出力バッファゲート501、5
02、503、504の出力と加算器505の接続を説
明する。3ステート出力バッファゲート501の出力の
うち、O3、O2はそれぞれ加算器505のA6、A4に接
続される。またO2はB6にも接続され、O1はB5、O0
はB4にそれぞれ接続される。また、それ以外の加算器
505の入力には3ステート出力バッファゲート501
のOgが接続される。次に、3ステート出力バッファゲ
ート502の出力のうち、O2、O1はそれぞれ加算器5
05のA4、A2に接続される。またO1はB4にも接続さ
れ、O0はB3に接続される。また、それ以外の加算器5
05の入力には3ステート出力バッファゲート502の
gが接続される。次に、3ステート出力バッファゲー
ト503の出力のうち、O1、O0は加算器505の
2、A0に接続される。またO0はB2にも接続される。
また、それ以外の加算器505の入力には3ステート出
力バッファゲート503のOgが接続される。次に、3
ステート出力バッファゲート504の出力のうち、O0
は加算器505のA0に接続される。また、それ以外の
加算器505の入力には3ステート出力バッファゲート
504のOgが接続される。
3-state output buffer gates 501 and 5
The connections of the outputs of 02, 503, and 504 and the adder 505 will be described. Of the outputs of the 3-state output buffer gate 501, O 3 and O 2 are connected to A 6 and A 4 of the adder 505, respectively. O 2 is also connected to B 6 , and O 1 is B 5 , O 0.
Are respectively connected to B 4 . In addition, the input of the other adder 505 is the 3-state output buffer gate 501.
O g of is connected. Next, of the outputs of the 3-state output buffer gate 502, O 2 and O 1 are respectively added by the adder 5
05 is connected to A 4 and A 2 . O 1 is also connected to B 4 , and O 0 is connected to B 3 . Also, other adders 5
The O g of the 3-state output buffer gate 502 is connected to the input of 05. Next, of the outputs of the 3-state output buffer gate 503, O 1 and O 0 are connected to A 2 and A 0 of the adder 505. O 0 is also connected to B 2 .
Further, the O g of the 3-state output buffer gate 503 is connected to the input of the other adder 505. Then 3
Of the outputs of the state output buffer gate 504, O 0
Is connected to A 0 of the adder 505. Further, O g of the 3-state output buffer gate 504 is connected to the input of the other adder 505.

【0161】次に、2乗回路の入力のMSBがD3、す
なわちD3=1の場合の加算器505の動作を説明す
る。このとき2乗回路の入力データの数値は8以上15
以下であり、3ステート出力バッファゲート501のみ
が入力を加算器505に出力する。加算器505の入力
Aには、A6、A4に3ステート出力バッファゲート50
1から出力されるD3、D2が入力される。A1、A3、A
5は接地されており、入力は0である。またA0、A2
3ステート出力バッファゲート501のG1(=0)が
入力されるため、入力は0である。すなわち、加算器5
05の入力Aには、MSB値である8の2乗=64と、
LSP値の最上位ビットを1ビット右ビットシフトした
値の和が入力される。一方、加算器505の入力Bに
は、B6、B5、B4にそれぞれD2、D1、D0が入力され
る。B0、B1は接地されており、入力は0である。また
2、B3は3ステート出力バッファゲート501の出力
1(=0)が入力されるため、入力は0である。すな
わち、加算器505の入力Bには、2乗回路の入力デー
タからMSB値である8を引いた値を2×8=16倍し
た値が入力される。加算器505は入力Aと、入力Bを
加算し、2乗回路の出力として出力する。
Next, the operation of the adder 505 when the MSB of the input of the squaring circuit is D 3 , that is, D 3 = 1 will be described. At this time, the numerical value of the input data of the squaring circuit is 8 or more and 15
Below, only the 3-state output buffer gate 501 outputs its input to the adder 505. The input A of the adder 505 has three-state output buffer gates 50 at A 6 and A 4.
D 3 and D 2 output from 1 are input. A 1 , A 3 , A
5 is grounded and the input is 0. Further, since A 1 and A 2 are input to G 1 (= 0) of the 3-state output buffer gate 501, the input is 0. That is, the adder 5
In input A of 05, the MSB value 8 squared = 64,
The sum of the values obtained by shifting the most significant bit of the LSP value by 1 bit to the right is input. On the other hand, to the input B of the adder 505, D 2 , D 1 and D 0 are input to B 6 , B 5 and B 4 , respectively. B 0 and B 1 are grounded and the input is 0. Further, since the output G 1 (= 0) of the 3-state output buffer gate 501 is input to B 2 and B 3 , the input is 0. That is, a value obtained by subtracting the MSB value of 8 from the input data of the squaring circuit is multiplied by 2 × 8 = 16 is input to the input B of the adder 505. The adder 505 adds the input A and the input B and outputs the result as the output of the squaring circuit.

【0162】次に、2乗回路の入力のMSBがD2、す
なわちD3=0で、D2=1の場合の加算器505の動作
を説明する。このとき2乗回路の入力データの数値は4
以上7以下であり、3ステート出力バッファゲート50
2のみが入力を加算器505に出力する。加算器505
の入力Aには、A4、A2に3ステート出力バッファゲー
ト502から出力されるD2、D1が入力される。A1
3、A5は接地されており、入力は0である。また
0、A6は3ステート出力バッファゲート502の出力
2(=0)が入力されるため、入力は0である。すな
わち、加算器505の入力Aには、MSB値である4の
2乗=16と、LSP値の最上位ビットを1ビット右ビ
ットシフトした値の和が入力される。一方、加算器50
5の入力Bには、B4、B3にそれぞれD1、D0が入力さ
れる。B0、B1は接地されており、入力は0である。ま
たB2、B5、B6は3ステート出力バッファゲート50
2の出力G2(=0)が入力されるため、入力は0であ
る。すなわち、加算器505の入力Bには、2乗回路の
入力データからMSB値である4を引いた値を2×4=
8倍した値が入力される。加算器505は入力Aと、入
力Bを加算し、2乗回路の出力として出力する。
Next, the operation of the adder 505 when the MSB of the input of the squaring circuit is D 2 , that is, D 3 = 0 and D 2 = 1 will be described. At this time, the numerical value of the input data of the squaring circuit is 4
The above is 7 or less, and the 3-state output buffer gate 50
Only 2 outputs its input to the adder 505. Adder 505
The input A is supplied with A 4 , A 2 and D 2 , D 1 output from the 3-state output buffer gate 502. A 1 ,
A 3 and A 5 are grounded and the input is 0. Further, since the output G 2 (= 0) of the 3-state output buffer gate 502 is input to A 0 and A 6 , the input is 0. That is, to the input A of the adder 505, the sum of 4 squared = 16, which is the MSB value, and the value obtained by right-shifting the most significant bit of the LSP value by 1 bit are input. On the other hand, the adder 50
To the input B of 5, D 1 and D 0 are input to B 4 and B 3 , respectively. B 0 and B 1 are grounded and the input is 0. B 2 , B 5 , and B 6 are 3-state output buffer gates 50.
Since the output G 2 (= 0) of 2 is input, the input is 0. That is, for the input B of the adder 505, the value obtained by subtracting the MSB value of 4 from the input data of the squaring circuit is 2 × 4 =
The value multiplied by 8 is input. The adder 505 adds the input A and the input B and outputs the result as the output of the squaring circuit.

【0163】次に、2乗回路の入力のMSBがD1、す
なわちD3=0、D2=0で、かつD1=1の場合の加算
器505の動作を説明する。このとき2乗回路の入力デ
ータの数値は2または3であり、3ステート出力バッフ
ァゲート503のみが入力を加算器505に出力する。
加算器505の入力Aには、A2、A0に3ステート出力
バッファゲート503から出力されるD1、D0が入力さ
れる。A1、A3、A5は接地されており、入力は0であ
る。またA4、A6は3ステート出力バッファゲート50
3の出力G3(=0)が入力されるため、入力は0であ
る。すなわち、加算器505の入力Aには、MSB値で
ある2の2乗=4と、LSP値の最上位ビットを1ビッ
ト右ビットシフトした値の和が入力される。一方、加算
器505の入力Bには、B2にD0が入力される。B0
1は接地されており、入力は0である。またB3
4、B5、B6は3ステート出力バッファゲート503
の出力G3(=0)が入力されるため、入力は0であ
る。すなわち、加算器505の入力Bには、2乗回路の
入力データからMSB値である2を引いた値を2×2=
4倍した値が入力される。加算器505は入力Aと、入
力Bを加算し、2乗回路の出力として出力する。
Next, the operation of the adder 505 when the MSB of the input of the squaring circuit is D 1 , that is, D 3 = 0, D 2 = 0 and D 1 = 1 will be described. At this time, the numerical value of the input data of the squaring circuit is 2 or 3, and only the 3-state output buffer gate 503 outputs the input to the adder 505.
To the input A of the adder 505, D 2 , D 0 output from the 3-state output buffer gate 503 are input to A 2 , A 0 . A 1 , A 3 , and A 5 are grounded, and the input is 0. A 4 and A 6 are 3-state output buffer gates 50.
Since the output G 3 (= 0) of 3 is input, the input is 0. That is, to the input A of the adder 505, the sum of the MSB value of 2 squared = 4 and the value obtained by right-shifting the most significant bit of the LSP value by 1 bit is input. On the other hand, to the input B of the adder 505, D 0 is input to B 2 . B 0 ,
B 1 is grounded and the input is 0. Also B 3 ,
B 4 , B 5 , and B 6 are 3-state output buffer gates 503
Since the output G 3 (= 0) of is input, the input is 0. That is, for the input B of the adder 505, the value obtained by subtracting the MSB value of 2 from the input data of the squaring circuit is 2 × 2 =
The value multiplied by 4 is input. The adder 505 adds the input A and the input B and outputs the result as the output of the squaring circuit.

【0164】一例として、2乗回路の入力が1110
(14)の場合について説明する。この場合D0=1で
あるから、3ステート出力バッファゲート501のみが
加算器505に入力する。加算器505の入力Aには、
8×(8+2)=80が入力される。また、加算器50
5の入力Bには、14−8=6の16倍、すなわち96
が入力される。従って加算器505は80+96=17
6を2乗回路の出力として出力する。
As an example, the input of the squaring circuit is 1110.
The case of (14) will be described. Since D 0 = 1 in this case, only the 3-state output buffer gate 501 inputs to the adder 505. The input A of the adder 505 is
8 × (8 + 2) = 80 is input. Also, the adder 50
For input B of 5, 16 times 14-8 = 6, or 96
Is entered. Therefore, the adder 505 is 80 + 96 = 17
6 is output as the output of the squaring circuit.

【0165】以上のように、2乗回路の入力データをM
SB値とLSP値に分割して、MSB値とLSP値の最
上位ビットを用いてデコードし、デコーダ出力とLSP
値のそれぞれに対しMSB値に応じた左ビットシフト演
算を行ない、左ビットシフト演算の結果を加算して2乗
値を求めることにより、従来よりも加算器の数を減ら
し、遅延を少なくできる。さらに、3ステート出力バッ
ファゲートを用いて加算器の数を減らすことにより、少
ない誤差で2乗回路を得ることができる。
As described above, the input data of the squaring circuit is M
Divide into SB value and LSP value, decode using the most significant bit of MSB value and LSP value, and decode output and LSP
By performing the left bit shift operation according to the MSB value for each value and adding the result of the left bit shift operation to obtain the squared value, the number of adders can be reduced and the delay can be reduced as compared with the conventional case. Further, the square circuit can be obtained with a small error by reducing the number of adders by using the 3-state output buffer gate.

【0166】実施の形態8. 実施の形態6では、デコードの方法として入力データの
LSP値の最上位ビットを1ビット右ビットシフトし
て、MSB値と加算する方法を、実際の論理回路を用い
た場合について説明したが、このデコード法は必ずしも
必要ではない。例えば、2乗回路の構成を図15に示す
ような構成としてもよい。図15は実施の形態8におけ
る2乗回路の構成図であり、1501はデコーダであ
る。実施の形態8における2乗回路の動作について、図
15を用いて説明する。なお実施の形態2における図
2、ならびに実施の形態6における図11と同一または
相当部分については同一符号を付してその説明は省略す
る。
Eighth Embodiment In the sixth embodiment, as a decoding method, a method of right-shifting the most significant bit of the LSP value of the input data by 1 bit and adding it to the MSB value has been described in the case of using an actual logic circuit. The decoding method is not always necessary. For example, the squaring circuit may be configured as shown in FIG. FIG. 15 is a block diagram of the squaring circuit in the eighth embodiment, and 1501 is a decoder. The operation of the squaring circuit according to the eighth embodiment will be described with reference to FIG. Note that the same or corresponding portions as those in FIG. 2 in the second embodiment and FIG. 11 in the sixth embodiment are denoted by the same reference numerals and the description thereof will be omitted.

【0167】実施の形態8と実施の形態6との相違点
は、図15に示したように、加算器1101の入力に、
デコーダ1501が挿入されていることである。また実
施の形態8でも、実施の形態6と同様、2乗回路の入力
のMSBがD3、すなわちD3=1の場合だけ加算器11
01が動作する。D3=1であるから2乗回路の入力デ
ータの数値は8以上15以下であり、加算器1101の
みが加算結果を出力する。入力データは、論理積ゲート
201、加算器1101に入力されるとともにデコーダ
1501にも入力される。
The difference between the eighth embodiment and the sixth embodiment is that, as shown in FIG. 15, the input of the adder 1101 is
That is, the decoder 1501 is inserted. Also in the eighth embodiment, as in the sixth embodiment, the adder 11 is used only when the MSB of the input of the squaring circuit is D 3 , that is, D 3 = 1.
01 works. Since D 3 = 1, the numerical value of the input data of the squaring circuit is 8 or more and 15 or less, and only the adder 1101 outputs the addition result. The input data is input to the AND gate 201 and the adder 1101 and also to the decoder 1501.

【0168】図21はデコーダ1501の構成を示す構
成図であり、デコーダ1501と加算器1101の接続
も同時に示す。図21において、2101は論理積素
子、2102はインバータである。図21に示すよう
に、加算器1101の入力のうちD1、D2は論理積素子
2101に入力される。論理積素子2101は入力のD
1とD2の論理積をとって、加算器1101のA5に入力
する。またD1はインバータ2102にも入力される。
インバータ2102はD1の反転を、加算器1101の
4に入力する。その他の加算器1101の入力Aに
は、A6にD3=1が入力され、A0からA3の4個の入力
には0が入力される。一方、加算器1101の入力Bに
は、B6、B5、B4にそれぞれD2、D1、D0が入力さ
れ、B0からB3までの4個の入力には0が入力される。
加算器1101では入力Aと入力Bを加算し、2乗回路
の出力として出力する。
FIG . 21 is a block diagram showing the structure of the decoder 1501, and shows the connection between the decoder 1501 and the adder 1101 at the same time. In FIG. 21 , reference numeral 2101 is a logical product element, and 2102 is an inverter. As shown in FIG. 21 , D 1 and D 2 of the inputs of the adder 1101 are input to the logical product element 2101. The logical product element 2101 is the input D
The logical product of 1 and D 2 is calculated and input to A 5 of the adder 1101. Further, D 1 is also input to the inverter 2102.
The inverter 2102 inputs the inversion of D 1 into A 4 of the adder 1101. To the input A of the other adder 1101, D 3 = 1 is input to A 6 , and 0 is input to the four inputs A 0 to A 3 . On the other hand, to the input B of the adder 1101, D 2 , D 1 and D 0 are input to B 6 , B 5 and B 4 , respectively, and 0 is input to the four inputs B 0 to B 3. R.
The adder 1101 adds the input A and the input B and outputs the result as the output of the squaring circuit.

【0169】図16に、2乗回路の入出力のグラフを示
す。点線が理想値、実線が実施の形態8における2乗回
路の入出力、一点鎖線が実施の形態6における2乗回路
の入出力である。入力データが大きい場合、実施の形態
8のようなデコーダを用いることにより、実施の形態6
における2乗回路よりも近似誤差を少なくすることがで
きる。
FIG. 16 shows a graph of input / output of the squaring circuit. The dotted line is the ideal value, the solid line is the input / output of the squaring circuit in the eighth embodiment, and the alternate long and short dash line is the input / output of the squaring circuit in the sixth embodiment. When the input data is large, the decoder according to the eighth embodiment is used, whereby the sixth embodiment is realized.
The approximation error can be smaller than that of the square circuit in.

【0170】[0170]

【発明の効果】この発明は以上説明したように構成され
ているので、以下に記載されるような効果を奏する。
Since the present invention is constructed as described above, it has the following effects.

【0171】実施の形態1では、2乗回路の入力のMS
B値を抽出する。2乗回路の入力からMSB値を減算し
て2乗回路の入力のLSP値を求める。MSB値を左ビ
ットシフトする。LSP値を左ビットシフトする。左ビ
ットシフトした値を加算して2乗結果を出力すること
で、算器による加算回数を減らして回路規模の小さな2
乗回路を実現できる。
In the first embodiment, the MS of the input of the squaring circuit is
Extract the B value. The MSB value is subtracted from the input of the squaring circuit to obtain the LSP value of the input of the squaring circuit. The MSB value is bit-shifted to the left. Bit shift the LSP value to the left. By adding the values bit-shifted to the left and outputting the squared result, the number of additions by the calculator is reduced and
A squaring circuit can be realized.

【0172】また、実施の形態2では、複数の論理積ゲ
ートで複数の論理積を出力する。複数の論理積ゲート出
力を用いて複数の加算器で加算する。入力の論理積を出
力する。論理積出力と論理積ゲート出力の論理和を出力
する。論理和出力により入力を出力することで、加算器
による加算回数を減らして回路規模の小さな2乗回路を
実現できる。
Further, in the second embodiment, a plurality of AND gates output a plurality of ANDs. Addition is performed by a plurality of adders using a plurality of AND gate outputs. Outputs the logical product of the inputs. Outputs the logical sum of the logical product output and the logical product gate output. By outputting the input by the logical sum output, it is possible to reduce the number of additions by the adder and realize a square circuit having a small circuit scale.

【0173】また、実施の形態3では、複数の論理積ゲ
ートで複数の論理積を出力する。複数の論理積ゲート出
力の最上位ビットにより入力を出力する。入力の論理積
を出力する。論理積出力と論理積ゲート出力の論理和を
出力する。論理和出力により入力を出力する。加算器で
加算して2乗結果を出力することで、加算器による加算
回数を減らして回路規模の小さな2乗回路を実現でき
る。
Further, in the third embodiment, a plurality of AND gates output a plurality of ANDs. The input is output according to the most significant bit of the outputs of the AND gates. Outputs the logical product of the inputs. Outputs the logical sum of the logical product output and the logical product gate output. Input is output by OR output. By adding with the adder and outputting the squared result, the number of additions by the adder can be reduced and a square circuit with a small circuit scale can be realized.

【0174】また、実施の形態4では、2乗回路の入力
のMSB値を抽出する。2乗回路の入力からMSB値を
減算して2乗回路の入力のLSP値を求める。MSB値
を左ビットシフトする。LSP値を左ビットシフトす
る。2乗回路の入力のLSP値のMSB値を抽出する。
2乗回路の入力のLSP値からLSP値のMSB値を減
算して2乗回路の入力のLSP値のLSP値を求める。
LSP値のMSB値を左ビットシフトする。LSP値の
LSP値を左ビットシフトする。左ビットシフトした値
を加算して2乗結果を出力することで、加算器による加
算回数を減らし、回路規模が小さく、さらに出力の誤差
の小さな2乗回路を実現することができる。
Also, in the fourth embodiment, the MSB value of the input of the squaring circuit is extracted. The MSB value is subtracted from the input of the squaring circuit to obtain the LSP value of the input of the squaring circuit. The MSB value is bit-shifted to the left. Bit shift the LSP value to the left. The MSB value of the LSP value at the input of the squaring circuit is extracted.
The MSB value of the LSP value is subtracted from the LSP value of the input of the squaring circuit to obtain the LSP value of the LSP value of the input of the squaring circuit.
The MSB value of the LSP value is left bit-shifted. The LSP value of the LSP value is bit-shifted to the left. By adding the values bit-shifted to the left and outputting the squared result, the number of times of addition by the adder can be reduced, and a square circuit with a small circuit scale and a small output error can be realized.

【0175】また、実施の形態5では、2乗回路の入力
のMSB値を抽出する。2乗回路の入力からMSB値を
減算して2乗回路の入力のLSP値を求める。LSP値
を用いてMSB値をデコードする。デコード結果を左ビ
ットシフトする。LSP値を左ビットシフトする。左ビ
ットシフトした値を加算して2乗結果を出力すること
で、加算器による加算回数を減らし、回路規模が小さ
く、さらに出力の誤差の小さな2乗回路を実現すること
ができる。
Also, in the fifth embodiment, the MSB value of the input of the squaring circuit is extracted. The MSB value is subtracted from the input of the squaring circuit to obtain the LSP value of the input of the squaring circuit. Decode the MSB value using the LSP value. The decoding result is bit-shifted to the left. Bit shift the LSP value to the left. By adding the values bit-shifted to the left and outputting the squared result, the number of times of addition by the adder can be reduced, and a square circuit with a small circuit scale and a small output error can be realized.

【0176】また、実施の形態6では、複数の論理積ゲ
ートで複数の論理積を出力する。複数の論理積ゲート出
力を用いて複数の加算器で加算する。入力の論理積を出
力する。論理積出力と論理積ゲート出力の論理和を出力
する。論理和出力により入力を出力することで、加算器
による加算回数を減らして回路規模の小さな、さらに出
力の誤差の少ない2乗回路を実現できる。
Further, in the sixth embodiment, a plurality of AND gates output a plurality of ANDs. Addition is performed by a plurality of adders using a plurality of AND gate outputs. Outputs the logical product of the inputs. Outputs the logical sum of the logical product output and the logical product gate output. By outputting the input by the logical sum output, it is possible to reduce the number of additions by the adder and realize a squaring circuit having a small circuit scale and a small output error.

【0177】また、実施の形態7では、複数の論理積ゲ
ートで複数の論理積を出力する。複数の論理積ゲート出
力の最上位ビットにより入力を出力する。複数の論理積
ゲート入力の論理積を出力する。論理積出力と論理積ゲ
ート出力の論理和を出力する。論理和出力により入力を
出力する。加算器で加算して2乗結果を出力すること
で、加算器による加算回数を減らして回路規模の小さ
な、さらに出力の誤差の少ない2乗回路を実現できる。
Further, in the seventh embodiment, a plurality of AND gates output a plurality of ANDs. The input is output according to the most significant bit of the outputs of the AND gates. Outputs the logical product of multiple logical product gate inputs. Outputs the logical sum of the logical product output and the logical product gate output. Input is output by OR output. By performing addition by the adder and outputting the squared result, it is possible to reduce the number of additions by the adder and realize a squaring circuit having a small circuit scale and a small output error.

【0178】また、実施の形態8では、複数の論理積ゲ
ートで複数の論理積を出力する。複数の論理積ゲート出
力の最上位ビットにより入力を出力する。複数の論理積
ゲート入力の論理積を出力する。論理積出力と論理積ゲ
ート出力の論理和を出力する。論理和出力により入力を
出力する。加算器入力の論理積を出力する。加算器入力
の反転を出力する。加算器で加算して2乗結果を出力す
ることで、加算器による加算回数を減らして回路規模の
小さな、さらに出力の誤差の少ない2乗回路を実現でき
る。
Also, in the eighth embodiment, a plurality of AND gates output a plurality of ANDs. The input is output according to the most significant bit of the outputs of the AND gates. Outputs the logical product of multiple logical product gate inputs. Outputs the logical sum of the logical product output and the logical product gate output. Input is output by OR output. Outputs the logical product of the adder inputs. Outputs the inverse of the adder input. By performing addition by the adder and outputting the squared result, it is possible to reduce the number of additions by the adder and realize a squaring circuit having a small circuit scale and a small output error.

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

【図1】 本発明の実施の形態1による2乗回路の構成
図である。
FIG. 1 is a configuration diagram of a squaring circuit according to a first embodiment of the present invention.

【図2】 本発明の実施の形態2による2乗回路の構成
図である。
FIG. 2 is a configuration diagram of a squaring circuit according to a second embodiment of the present invention.

【図3】 本発明の実施の形態2による論理積ゲートの
構成を示す構成図及びその入出力を示す図である。
FIG. 3 is a configuration diagram showing a configuration of an AND gate according to a second embodiment of the present invention and a diagram showing its input / output.

【図4】 本発明の実施の形態2による加算器の構成図
である。
FIG. 4 is a configuration diagram of an adder according to a second embodiment of the present invention.

【図5】 本発明の実施の形態3による2乗回路の構成
図である。
FIG. 5 is a configuration diagram of a squaring circuit according to a third embodiment of the present invention.

【図6】 本発明の実施の形態3による3ステート出力
バッファゲートの構成図とその入出力を示す図である。
FIG. 6 is a configuration diagram of a 3-state output buffer gate according to a third embodiment of the present invention and a diagram showing its input / output.

【図7】 本発明の実施の形態3による3ステート出力
バッファゲートと加算器の接続を示す接続図である。
FIG. 7 is a connection diagram showing a connection between a 3-state output buffer gate and an adder according to a third embodiment of the present invention.

【図8】 本発明の実施の形態4による2乗回路の構成
図である。
FIG. 8 is a configuration diagram of a squaring circuit according to a fourth embodiment of the present invention.

【図9】 本発明の実施の形態5による2乗回路の構成
図である。
FIG. 9 is a configuration diagram of a squaring circuit according to a fifth embodiment of the present invention.

【図10】 本発明の実施の形態5によるデコーダの構
成図である。
FIG. 10 is a configuration diagram of a decoder according to a fifth embodiment of the present invention.

【図11】 本発明の実施の形態6による2乗回路の構
成図である。
FIG. 11 is a configuration diagram of a squaring circuit according to a sixth embodiment of the present invention.

【図12】 本発明の実施の形態6による加算器の構成
図である。
FIG. 12 is a configuration diagram of an adder according to a sixth embodiment of the present invention.

【図13】 本発明の実施の形態6による2乗回路の入
出力特性図である。
FIG. 13 is an input / output characteristic diagram of the squaring circuit according to the sixth embodiment of the present invention.

【図14】 本発明の実施の形態7による3ステート出
力バッファゲートと加算器の接続を示す接続図である。
FIG. 14 is a connection diagram showing a connection between a 3-state output buffer gate and an adder according to a seventh embodiment of the present invention.

【図15】 本発明の実施の形態8における2乗回路の
構成図である。
FIG. 15 is a configuration diagram of a squaring circuit according to an eighth embodiment of the present invention.

【図16】 本発明の実施の形態8による2乗回路の入
出力特性図である。
FIG. 16 is an input / output characteristic diagram of the squaring circuit according to the eighth embodiment of the present invention.

【図17】 本発明の実施の形態4による2乗回路の入
出力特性図である。
FIG. 17 is an input / output characteristic diagram of the squaring circuit according to the fourth embodiment of the present invention.

【図18】 本発明の実施の形態8におけるデコーダと
加算器の構成を示す構成図である。
FIG. 18 is a configuration diagram showing configurations of a decoder and an adder according to an eighth embodiment of the present invention.

【図19】 従来の2乗回路の構成を示す構成図であ
る。
FIG. 19 is a configuration diagram showing a configuration of a conventional squaring circuit.

【図20】 従来の2乗回路の構成を示す構成図と、従
来のビット削減を行なう2乗回路の構成を示す構成図で
ある。
FIG. 20 is a configuration diagram showing a configuration of a conventional squaring circuit and a configuration of a conventional squaring circuit for performing bit reduction.

【図21】 従来のビット削減を行なう2乗回路の入出
力特性図である。
FIG. 21 is an input / output characteristic diagram of a conventional square circuit that reduces bits.

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

101 MSB値抽出回路 102、104 左ビットシフト回路 103、105 加算器 201、202、203 論理積ゲート 204、205、206 加算器 207 3ステート出力バッファ 208 論理積素子 209 論理和素子 301、305、308 インバータ 302、303、304、306、307、309 論
理積素子 501、502、503、504 3ステート出力バッ
ファゲート 505 加算器 601〜614 3ステート出力バッファ 801 MSB値抽出回路 802、804 左ビットシフト回路 803、805 加算器 901 デコーダ 1001 最上位ビット抽出回路 1002 右ビットシフト回路 1003 加算器 1101、1102、1103 加算器 1501 デコーダ 1701、1702、1703、1704 論理積ゲー
ト 1705、1706、1707 加算器 1801、1802、1803 論理積ゲート 1804、1805 加算器 2101 論理積素子 2102 インバータ。
101 MSB value extraction circuit 102, 104 left bit shift circuit 103, 105 adder 201, 202, 203 AND gate 204, 205, 206 adder 207 3-state output buffer 208 AND element 209 OR element 301, 305, 308 Inverters 302, 303, 304, 306, 307, 309 AND elements 501, 502, 503, 504 3-state output buffer gate 505 Adders 601-614 3-state output buffer 801 MSB value extraction circuits 802, 804 Left bit shift circuit 803 , 805 Adder 901 Decoder 1001 Most significant bit extraction circuit 1002 Right bit shift circuit 1003 Adder 1101, 1102, 1103 Adder 1501 Decoder 1701, 1702, 1703, 1704 AND gate 17 5,1706,1707 adder 1801, 1802 and 1803 AND gates 1804 and 1805 adder 2101 AND gate 2102 inverter.

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平2−22734(JP,A) 特開 昭48−63652(JP,A) 特開 昭64−57332(JP,A) 特開 昭57−168342(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 7/552 ─────────────────────────────────────────────────── --- Continuation of the front page (56) References JP-A-2-22734 (JP, A) JP-A 48-63652 (JP, A) JP-A 64-57332 (JP, A) JP-A 57- 168342 (JP, A) (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 7/552

Claims (8)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 入力のMSB値を抽出するMSB値抽出
回路と、前記MSB値抽出回路の出力を左ビットシフト
する左ビットシフト回路と、入力から前記MSB値抽出
回路の出力を減算してLSP値を出力する加算器と、前
記加算器の出力であるLSP値を左ビットシフトする左
ビットシフト回路と、 前記2つの左ビットシフト回路の出力を加算する加算器
を備えたことを特徴とする2乗回路。
1. An MSB value extraction circuit for extracting an MSB value of an input, a left bit shift circuit for left bit shifting an output of the MSB value extraction circuit, and an LSP by subtracting an output of the MSB value extraction circuit from an input. It is provided with an adder for outputting a value, a left bit shift circuit for left bit shifting the LSP value output from the adder, and an adder for adding the outputs of the two left bit shift circuits. Square circuit.
【請求項2】 入力のMSB値を抽出するMSB値抽出
回路として動作する、入力の最上位ビットと入力の全ビ
ットとの論理積を出力する複数の論理積ゲートと、前記
複数の論理積ゲートの出力を入力とし、特に論理積ゲー
トの最上位ビットを一方の入力とする、イネーブル入力
によって加算出力をハイインピーダンスにする複数の加
算器と、2乗回路の入力が0の場合に1を出力する論理
積素子と、論理和素子の出力と論理積ゲートの出力を入
力とする論理和素子と、論理和素子の出力によって入力
を出力する3ステート出力バッファを備えたことを特徴
とする2乗回路。
2. A plurality of AND gates, which operate as an MSB value extraction circuit for extracting an MSB value of an input, output a logical product of the most significant bit of the input and all the bits of the input, and the plurality of AND gates. Of the AND gate, one of which is the most significant bit of the AND gate, and one of which is output when the input of the squaring circuit is 0 And a three-state output buffer that outputs the input by the output of the logical sum element, and the output of the logical sum gate and the output of the logical product gate circuit.
【請求項3】 入力のMSB値を抽出するMSB値抽出
回路として動作する、入力の最上位ビットと入力の全ビ
ットとの論理積を出力する複数の論理積ゲートと、前記
複数の論理積ゲートの出力を入力とし、イネーブル入力
によって入力を出力する複数の3ステート出力バッファ
ゲートと、2乗回路の入力が0の場合に1を出力する論
理積素子と、前記論理和素子の出力と論理積ゲートの出
力を入力とする論理和素子と、前記複数の3ステート出
力バッファゲートの出力を入力とし、特に3ステート出
力バッファゲートの最上位ビットを一方の入力とする、
加算結果を出力する加算器とを備えたことを特徴とする
2乗回路。
3. A plurality of AND gates, which operate as an MSB value extraction circuit for extracting the MSB value of the input, output a logical product of the most significant bit of the input and all the bits of the input, and the plurality of AND gates. Of the three-state output buffer gates, which outputs the inputs by the enable inputs, an AND element that outputs 1 when the input of the squaring circuit is 0, and an AND of the outputs of the OR elements. An OR element having the output of the gate as an input and the outputs of the plurality of three-state output buffer gates as the inputs, and particularly the most significant bit of the three-state output buffer gates as one input,
A squaring circuit comprising: an adder that outputs an addition result.
【請求項4】 入力のMSB値を抽出するMSB値抽出
回路と、前記MSB値抽出回路の出力を左ビットシフト
する左ビットシフト回路と、入力から前記MSB値抽出
回路の出力を減算してLSP値を出力する加算器と、前
記加算器の出力であるLSP値を左ビットシフトする左
ビットシフト回路と、前記LSP値のMSB値を抽出す
るMSB値抽出回路と、前記MSB値抽出回路の出力で
あるLSP値のMSB値を左ビットシフトする左ビット
シフト回路と、入力のLSP値から前記MSB値抽出回
路の出力であるLSP値のMSB値を減算してLSP値
のLSP値を出力する加算器と、前記加算器の出力であ
るLSP値のLSP値を左ビットシフトする左ビットシ
フト回路と、前記4つの左ビットシフト回路の出力を加
算する加算器を備えたことを特徴とする2乗回路。
4. An MSB value extracting circuit for extracting an MSB value of an input, a left bit shift circuit for left bit shifting an output of the MSB value extracting circuit, and an LSP by subtracting an output of the MSB value extracting circuit from an input. An adder that outputs a value, a left bit shift circuit that left-shifts the LSP value output from the adder, an MSB value extraction circuit that extracts the MSB value of the LSP value, and an output of the MSB value extraction circuit A left bit shift circuit for left bit shifting the MSB value of the LSP value and an addition for outputting the LSP value of the LSP value by subtracting the MSB value of the LSP value output from the MSB value extraction circuit from the input LSP value. And a left bit shift circuit for left bit shifting the LSP value of the LSP value output from the adder, and an adder for adding the outputs of the four left bit shift circuits. A squaring circuit characterized in that
【請求項5】 入力のMSB値を抽出するMSB値抽出
回路と、入力から前記MSB値抽出回路の出力を減算し
てLSP値を出力する加算器と、前記MSB値抽出回路
の出力と前記加算器の出力であるLSP値を入力とする
デコーダと、前記デコーダの出力を左ビットシフトする
左ビットシフト回路と、前記加算器の出力であるLSP
値を左ビットシフトする左ビットシフト回路と、前記2
つの左ビットシフト回路の出力を加算する加算器を備え
たことを特徴とする2乗回路。
5. An MSB value extraction circuit for extracting an input MSB value, an adder for subtracting an output of the MSB value extraction circuit from an input to output an LSP value, an output of the MSB value extraction circuit and the addition Decoder that receives the LSP value that is the output of the adder, a left bit shift circuit that shifts the output of the decoder to the left bit, and an LSP that is the output of the adder
A left bit shift circuit for shifting the value to the left by a bit;
A squaring circuit comprising an adder for adding the outputs of two left bit shift circuits.
【請求項6】 入力のMSB値を抽出するMSB値抽出
回路として動作する、入力の最上位ビットと入力の全ビ
ットとの論理積を出力する複数の論理積ゲートと、前記
複数の論理積ゲートの出力を入力とし、イネーブル入力
によって加算出力をハイインピーダンスにする複数の加
算器と、2乗回路の入力が0の場合に1を出力する論理
積素子と、論理和素子の出力と論理積ゲートの出力を入
力とする論理和素子と、論理和素子の出力によって入力
を出力する3ステート出力バッファを備えたことを特徴
とする2乗回路。
6. A plurality of logical product gates, which operate as an MSB value extraction circuit for extracting an input MSB value, which outputs a logical product of the most significant bit of the input and all the bits of the input, and the plurality of logical product gates. , The output of which is an input, and the adder which makes the addition output high impedance by the enable input, the AND element which outputs 1 when the input of the square circuit is 0, the output of the OR element and the AND gate 2. A squaring circuit comprising: a logical sum element having an output of the input as an input and a three-state output buffer outputting an input by the output of the logical sum element.
【請求項7】 入力のMSB値を抽出するMSB値抽出
回路として動作する、入力の最上位ビットと入力の全ビ
ットとの論理積を出力する複数の論理積ゲートと、前記
複数の論理積ゲートの出力を入力とし、イネーブル入力
によって入力を出力する複数の3ステート出力バッファ
ゲートと、2乗回路の入力が0の場合に1を出力する論
理積素子と、論理和素子の出力と論理積ゲートの出力を
入力とする論理和素子と、複数の3ステート出力バッフ
ァゲートの出力を入力とし、加算結果を出力する加算器
とを備えたことを特徴とする2乗回路。
7. A plurality of AND gates, which operate as an MSB value extraction circuit for extracting an MSB value of an input, output a logical product of the most significant bit of the input and all the bits of the input, and the plurality of AND gates. 3-state output buffer gates that take the output of the input as an input and that output by the enable input, an AND element that outputs 1 when the input of the squaring circuit is 0, an output of the OR element and an AND gate 2. A squaring circuit comprising: a logical sum element having the output of the input as an input and an adder having the outputs of a plurality of three-state output buffer gates as the input and outputting the addition result.
【請求項8】 入力のMSB値を抽出するMSB値抽出
回路として動作する、入力の最上位ビットと入力の全ビ
ットとの論理積を出力する複数の論理積ゲートと、加算
器の入力をデコードするデコーダとして動作する論理積
素子とインバータと、前記複数の論理積ゲートの出力と
論理積素子の出力とインバータの出力を入力とし、イネ
ーブル入力によって加算出力をハイインピーダンスにす
る複数の加算器と、2乗回路の入力が0の場合に1を出
力する論理積素子と、論理和素子の出力と論理積ゲート
の出力を入力とする論理和素子と、論理和素子の出力に
よって入力を出力する3ステート出力バッファを備えた
ことを特徴とする2乗回路。
8. A plurality of AND gates, which operate as an MSB value extraction circuit for extracting the MSB value of the input, output a logical product of the most significant bit of the input and all the bits of the input, and decode the input of the adder. A logical product element that operates as a decoder and an inverter, a plurality of adders that take the outputs of the plurality of logical product gates, the output of the logical product element and the output of the inverter as inputs, and that make the addition output high impedance by the enable input, An AND element that outputs 1 when the input of the squaring circuit is 0, an OR element that receives the output of the OR element and the output of the AND gate, and an input that outputs the output of the OR element 3 A squaring circuit having a state output buffer.
JP06031697A 1997-03-14 1997-03-14 Square circuit Expired - Fee Related JP3531402B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP06031697A JP3531402B2 (en) 1997-03-14 1997-03-14 Square circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP06031697A JP3531402B2 (en) 1997-03-14 1997-03-14 Square circuit

Publications (2)

Publication Number Publication Date
JPH10254680A JPH10254680A (en) 1998-09-25
JP3531402B2 true JP3531402B2 (en) 2004-05-31

Family

ID=13138659

Family Applications (1)

Application Number Title Priority Date Filing Date
JP06031697A Expired - Fee Related JP3531402B2 (en) 1997-03-14 1997-03-14 Square circuit

Country Status (1)

Country Link
JP (1) JP3531402B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9207941B2 (en) * 2013-03-15 2015-12-08 Intel Corporation Systems, apparatuses, and methods for reducing the number of short integer multiplications
KR101733871B1 (en) * 2015-08-10 2017-05-24 한국전력공사 Apparatus, method and program for mixed square operation

Also Published As

Publication number Publication date
JPH10254680A (en) 1998-09-25

Similar Documents

Publication Publication Date Title
US5790446A (en) Floating point multiplier with reduced critical paths using delay matching techniques
US5506799A (en) Booth array multiplying circuit having carry correction
Abed et al. VLSI implementation of a low-power antilogarithmic converter
US6782405B1 (en) Method and apparatus for performing division and square root functions using a multiplier and a multipartite table
EP0613082A1 (en) 4:2 adder and multiplier circuit employing the same
US5023827A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
JPH0969040A (en) Circuit for computing/dividing of square root of radical number 2 by three overlapped stages with presumptive computing
US5132925A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
Takagi et al. A hardware algorithm for integer division
Stelling et al. Implementing multiply-accumulate operation in multiplication time
JPH0573269A (en) Adder
KR100308726B1 (en) Apparatus and method for reducing the number of round-up predictor stages in a high speed arithmetic apparatus
EP0811909A1 (en) Arithmetic circuit for calculating a square-root of a sum of squares
JPH02293929A (en) Method and apparatus for digital system multiplication
JPH0619685A (en) Parallel multiplying circuit
JP3531402B2 (en) Square circuit
US20040010536A1 (en) Apparatus for multiplication of data in two's complement and unsigned magnitude formats
US4866655A (en) Arithmetic processor and divider using redundant signed digit
EP0670061A1 (en) Enhanced fast multiplier.
JP3429927B2 (en) Normalization circuit device of floating point arithmetic unit
JPH0157372B2 (en)
KR950001055B1 (en) Multiplication method and circuit
US20040049528A1 (en) Apparatus and method for adding multiple-bit binary-strings
JP3456450B2 (en) Fixed point multiplier and method
JPH061437B2 (en) Processor

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040127

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040210

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040223

LAPS Cancellation because of no payment of annual fees