JP2006301685A - Multiplying device - Google Patents

Multiplying device Download PDF

Info

Publication number
JP2006301685A
JP2006301685A JP2005118033A JP2005118033A JP2006301685A JP 2006301685 A JP2006301685 A JP 2006301685A JP 2005118033 A JP2005118033 A JP 2005118033A JP 2005118033 A JP2005118033 A JP 2005118033A JP 2006301685 A JP2006301685 A JP 2006301685A
Authority
JP
Japan
Prior art keywords
multiplier
signal
adder
bits
partial product
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2005118033A
Other languages
Japanese (ja)
Inventor
Hiroaki Suzuki
弘明 鈴木
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology 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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2005118033A priority Critical patent/JP2006301685A/en
Publication of JP2006301685A publication Critical patent/JP2006301685A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the number of data to be input to an adder, and to increase the arithmetic speed of a multiplier. <P>SOLUTION: A multiplying device is provided with a decoder 101 and an adder 102. The decoder 101 is provided with 0 bit to (2m-1) bits b<SB>0</SB>to b2<SB>m-1</SB>, additional bits b<SB>2m</SB>, signal generation parts g<SB>0</SB>to g<SB>m</SB>and partial product generating parts G<SB>0</SB>to G<SB>m</SB>. As for a multiplier Y without code, a value 0 is adopted, and as for a multiplier Y with code, the same value as the (2m-1) bits b<SB>2m-1</SB>as the most significant bits of the multiplier Y is adopted for the additional bits b<SB>2m</SB>. The signal generating part g<SB>j</SB>(0≤j≤m-1) generates a multiplier signal t<SB>j</SB>and an addition signal S<SB>j</SB>from the multiplier Y, and a signal generating part g<SB>m</SB>generates a multiplier signal t<SB>m</SB>from the multiplier Y. A partial product generating part G<SB>j</SB>(0≤j≤m) generates a partial product P<SB>j</SB>based on the multiplier signal t<SB>j</SB>and a multiplicand X. The adder 102 adds the partial product P<SB>o</SB>to the partial product P<SB>j</SB>with an additional signal S<SB>j-1</SB>so as to be separated by 1 bit at a lower order side. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は乗算装置に関し、例えばワレス・ツリーを用いた乗算装置に関する。   The present invention relates to a multiplication device, for example, a multiplication device using a Wallace tree.

従来から被乗数と乗数との乗算演算を行う乗算装置では、ブースのアルゴリズムを用いることで、乗数について所定の長さのビット毎に部分積を生成し、これを加算器で加算することで乗算結果を得ている。   Conventionally, in a multiplication apparatus that performs multiplication operation of a multiplicand and a multiplier, a Booth algorithm is used to generate a partial product for each bit of a predetermined length for the multiplier and add the result by an adder. Have gained.

なお、本発明に関連する技術を以下に示す。   In addition, the technique relevant to this invention is shown below.

特開平8−305550号公報JP-A-8-305550

しかし、従来の乗算装置では、部分積の符号に対応した少なくとも一つのデータを生成し、これを加算器に入力する必要がある。このため、当該データの分だけ加算器における演算時間が長くなり、乗算装置の演算速度が遅くなるおそれがあった。   However, in the conventional multiplication apparatus, it is necessary to generate at least one data corresponding to the sign of the partial product and input this to the adder. For this reason, the operation time in the adder is increased by the amount of the data, and the operation speed of the multiplication device may be reduced.

上記特許文献1では、乗数の最上位ビットから生成される部分積と、上記データとを選択して加算器に入力することで、加算器に入力されるデータ数が増加することを回避している。しかし、当該選択には、セレクタが用いられているため、加算器での演算速度の遅延は回避されるものの、セレクタでの選択に要する時間だけ乗算装置の演算速度が遅くなる。   In Patent Document 1, the partial product generated from the most significant bit of the multiplier and the data are selected and input to the adder, thereby avoiding an increase in the number of data input to the adder. Yes. However, since the selector is used for the selection, a calculation speed delay in the adder is avoided, but the calculation speed of the multiplication device is reduced by the time required for the selection in the selector.

本発明は上述した事情に鑑みてなされたものであり、加算器に入力されるデータ数を減らし、しかも乗算装置の演算速度を高速化することが目的とされる。   The present invention has been made in view of the above-described circumstances, and it is an object of the present invention to reduce the number of data input to the adder and to increase the operation speed of the multiplier.

この発明にかかる乗算装置は、第0乃至第mの信号生成部と、部分積生成部と、加算器とを備える。前記第0の前記信号生成部は、2mビット長(m;自然数)の乗数の最下位2ビットに対応する第0の加算信号及び第0の乗数信号を生成する。前記第j(1≦j≦m−1の整数)の前記信号生成部は、前記乗数の第(2j+1),2j,(2j−1)ビットに対応する第jの加算信号とともに第jの乗数信号を生成する。前記第mの前記信号生成部は、前記乗数の最上位ビット及び付加ビットに対応する第mの乗数信号を生成する。前記部分積生成部は、被乗数と前記第0乃至前記第mの前記乗数信号とを用いてそれぞれ第0乃至第mの部分積を生成する。前記加算部は、前記第0の前記部分積と、前記第1乃至前記第mの前記乗算信号に基づいてビットがずれて、前記第0乃至前記第(m−1)の前記加算信号をそれぞれ下位側に1ビット離して従える前記第1乃至前記第mの前記部分積とを加算する。前記付加ビットは、符号なしの前記乗数については値0を採り、符号付きの前記乗数については前記乗数の最上位ビットの値と同じ値を採る。   A multiplication apparatus according to the present invention includes 0th to mth signal generation units, a partial product generation unit, and an adder. The 0th signal generation unit generates a 0th addition signal and a 0th multiplier signal corresponding to the least significant 2 bits of a multiplier having a length of 2m bits (m: natural number). The signal generator of the j-th (1 ≦ j ≦ m−1) is a j-th multiplier together with a j-th added signal corresponding to the (2j + 1), 2j, and (2j−1) bits of the multiplier. Generate a signal. The m-th signal generation unit generates an m-th multiplier signal corresponding to the most significant bit and the additional bits of the multiplier. The partial product generator generates 0th to mth partial products using a multiplicand and the 0th to mth multiplier signals, respectively. The adder shifts bits based on the 0th partial product and the 1st to mth multiplication signals, and outputs the 0th to (m−1) th addition signals, respectively. The first to mth partial products that are separated by 1 bit from the lower side are added. The additional bit takes the value 0 for the unsigned multiplier and takes the same value as the value of the most significant bit of the multiplier for the signed multiplier.

この発明にかかる乗算装置によれば、付加ビット及び乗数の最上位ビットに基づいて第mの乗数信号が生成されるので、乗数が符号付きである場合と符号なしである場合のいずれであるかを選択するための論理回路が不要である。しかも部分積のうち第1乃至第mの部分積はそれぞれ第0乃至第(m−1)の加算信号を下位ビットとして従えるので、第1乃至第(m−1)の加算信号の総和を第0乃至第mの部分積の生成とは別途に生成する必要がなく、加算器にm+1個の部分積を入力するだけで良い。よって、乗算装置の演算速度が高速化される。   According to the multiplication device of the present invention, since the m-th multiplier signal is generated based on the additional bits and the most significant bit of the multiplier, whether the multiplier is signed or unsigned. The logic circuit for selecting is unnecessary. In addition, since the first to m-th partial products of the partial products follow the 0th to (m−1) th addition signals as lower bits, respectively, the sum of the first to (m−1) th addition signals is It is not necessary to generate the 0th to mth partial products separately, and it is only necessary to input m + 1 partial products to the adder. Therefore, the calculation speed of the multiplier is increased.

実施の形態1.
図1は、本実施の形態にかかる乗算装置を概念的に示すブロック図である。当該乗算装置は、デコーダ101及び加算器102を備える。デコーダ101には、2進数で表された被乗数Xと乗数Yとが入力される。乗数Yは2mビット長を有する。一方、被乗数Xのビット長には2mビット長以外のビット長が採用できる。ここで、符号mは自然数を表し、以下同様である。
Embodiment 1 FIG.
FIG. 1 is a block diagram conceptually showing the multiplication apparatus according to this embodiment. The multiplication apparatus includes a decoder 101 and an adder 102. The decoder 101 receives a multiplicand X and a multiplier Y expressed in binary numbers. The multiplier Y has a length of 2 m bits. On the other hand, a bit length other than the 2m bit length can be adopted as the bit length of the multiplicand X. Here, the symbol m represents a natural number, and so on.

デコーダ101は、第0ビット乃至第(2m−1)ビットb0〜b2m-1、付加ビットb2m、信号生成部g0〜gm及び部分積生成部G0〜Gmを有する。 The decoder 101 has a 0th bit to the (2m-1) bit b 0 ~b 2m-1, the additional bit b 2m, signal generator g 0 to g m and the partial product generator G 0 ~G m.

第0ビット乃至第(2m−1)ビットb0〜b2m-1の各々は、入力された乗数Yに基づいて値0または値1を採る。 Each of the 0th bit to the (2m−1) th bits b 0 to b 2m−1 takes a value 0 or a value 1 based on the inputted multiplier Y.

付加ビットb2mは、符号なしの乗数Yについては値0を採り、符号付きの乗数Yについては乗数Yの最上位ビットである第(2m−1)ビットb2m-1と同じ値を採る。具体的には、付加ビットb2m及び第(2m−1)ビットb2m-1は、符号なしの乗数Yについてはそれぞれ値0,1を採り、符号付きの乗数Yについては乗数が正の場合にはそれぞれ値0,0を、負の場合にはそれぞれ値1,1を採る。 The additional bit b 2m takes the value 0 for the unsigned multiplier Y, and takes the same value as the (2m−1) th bit b 2m−1 which is the most significant bit of the multiplier Y for the signed multiplier Y. Specifically, the additional bit b 2m and the (2m−1) th bit b 2m−1 take the values 0 and 1 for the unsigned multiplier Y, respectively, and the multiplier for the signed multiplier Y is positive. Takes the values 0 and 0, respectively, and takes the values 1 and 1 if negative.

図1では、付加ビットb2mが第(2m−1)ビットb2m-1の上位に付加されているが、これとは異なる位置に付加されても良い。 In FIG. 1, the additional bit b 2m is added above the (2m−1) th bit b 2m−1 , but it may be added at a different position.

信号生成部gj(0≦j≦m−1)はそれぞれ、乗数Yから乗数信号tj及び加算信号Sjを生成する。信号生成部gmは、乗数Yから乗数信号tmを生成する。ここで、符号jは整数を表し、以下同様である。 Each of the signal generation units g j (0 ≦ j ≦ m−1) generates a multiplier signal t j and an addition signal S j from the multiplier Y. The signal generation unit g m generates a multiplier signal t m from the multiplier Y. Here, the symbol j represents an integer, and so on.

部分積生成部Gj(0≦j≦m)には乗数信号tjと被乗数Xとがそれぞれ入力され、これらに基づいて部分積生成部Gjは部分積Pjを出力する。 The partial product generator G j (0 ≦ j ≦ m) receives the multiplier signal t j and the multiplicand X, and the partial product generator G j outputs the partial product P j based on these signals.

加算器102には部分積Pj(0≦j≦m)が入力される。このとき、部分積P0以外の部分積Pjは、後述するように加算信号Sj-1を従える。加算器102は、部分積P0を含む全ての部分積Pjを加算して、被乗数Xと乗数Yとの乗算結果Rを出力する。 The partial product P j (0 ≦ j ≦ m) is input to the adder 102. At this time, the partial product P j other than the partial product P 0 follows the addition signal S j−1 as described later. The adder 102 adds all the partial products P j including the partial product P 0 and outputs a multiplication result R of the multiplicand X and the multiplier Y.

乗数信号tj(0≦j≦m−1)、加算信号Sj及び部分積Pjに関し、以下に具体的に説明する。乗数信号tm及び部分積Pmについては後述する。 The multiplier signal t j (0 ≦ j ≦ m−1), the addition signal S j and the partial product P j will be specifically described below. The multiplier signal t m and the partial product P m will be described later.

信号生成部gj(1≦j≦m−1)は、ブースのアルゴリズムに従って、第(2j+1),2j,(2j−1)ビットを用いて演算を行う。演算の結果として10進数表記で−2,−1,0,1,2のいずれかが得られる。 The signal generation unit g j (1 ≦ j ≦ m−1) performs an operation using the (2j + 1) th, 2j, and (2j−1) bits according to Booth's algorithm. As a result of the operation, one of −2, −1, 0, 1 and 2 is obtained in decimal notation.

信号生成部g0は、最下位2ビットである第0ビット及び第1ビットのそれぞれの値を用いて演算を行う。演算の結果として10進数表記で−2,−1,0,1のいずれかが得られる。例えば、信号生成部g0は、第0ビット及び第1ビットの数値と、第0ビットの下位側に付加されて値0を採るビットとを用いて、ブースのアルゴリズムに従って演算を行ってもよく、図1でこの場合が示されている。 The signal generation unit g 0 performs an operation using the values of the 0th bit and the 1st bit which are the least significant 2 bits. As a result of the operation, one of −2, −1, 0, 1 is obtained in decimal notation. For example, the signal generation unit g 0 may perform an operation according to the Booth algorithm using the numerical values of the 0th bit and the 1st bit and the bit that is added to the lower side of the 0th bit and takes the value 0. This case is shown in FIG.

演算の結果が2のとき、信号生成部gj(1≦j≦m−1)は、部分積生成部Gjに被乗数Xを(2j+1)ビットだけ上位へとシフトさせる信号を乗数信号tjとして生成する。乗数信号tjが入力された部分積生成部Gjは、被乗数Xを(2j+1)ビットだけ上位へとシフトさせ、これを部分積Pjとして出力する。 When the result of calculation is 2, the signal generator g j (1 ≦ j ≦ m -1) is the partial product generators G j multiplicand X (2j + 1) multiplier a signal to shift into bits by higher signal t j Generate as The partial product generator G j to which the multiplier signal t j is input shifts the multiplicand X by (2j + 1) bits and outputs this as a partial product P j .

演算の結果が1のとき、信号生成部gj(0≦j≦m−1)は、部分積生成部Gjに被乗数Xを2jビットだけ上位へとシフトさせる信号を乗数信号tjとして生成する。乗数信号tjが入力された部分積生成部Gjは、被乗数Xを2jビットだけ上位へとシフトさせ、これを部分積Pjとして出力する。 When the result of the operation is 1, the signal generation unit g j (0 ≦ j ≦ m−1) generates a signal that causes the partial product generation unit G j to shift the multiplicand X up by 2j bits as the multiplier signal t j. To do. The partial product generator G j to which the multiplier signal t j is input shifts the multiplicand X by 2j bits and outputs this as a partial product P j .

演算の結果が0のとき、信号生成部gj(0≦j≦m−1)は、部分積生成部Gjに部分積Pjとして0を出力させる信号を生成する。 When the calculation result is 0, the signal generation unit g j (0 ≦ j ≦ m−1) generates a signal that causes the partial product generation unit G j to output 0 as the partial product P j .

演算の結果が−1のとき、信号生成部gj(0≦j≦m−1)は、部分積生成部Gjに被乗数Xを2jビットだけ上位へとシフトさせ、これを反転させる信号を乗数信号tjとして生成する。乗数信号tjが入力された部分積生成部Gjは、被乗数Xを2jビットだけ上位へとシフトさせて反転させ、これを部分積Pjとして出力する。 When the result of the operation is −1, the signal generation unit g j (0 ≦ j ≦ m−1) causes the partial product generation unit G j to shift the multiplicand X up by 2j bits and to invert the signal. Generated as a multiplier signal t j . The partial product generator G j to which the multiplier signal t j is input shifts the multiplicand X up by 2j bits and inverts it, and outputs it as a partial product P j .

演算の結果が−2のとき、信号生成部gj(0≦j≦m−1)は、部分積生成部Gjに被乗数Xを(2j+1)ビットだけ上位へとシフトさせ、これを反転させる信号を乗数信号tjとして生成する。乗数信号tjが入力された部分積生成部Gjは、被乗数Xを(2j+1)ビットだけ上位へとシフトさせて反転させ、これを部分積Pjとして出力する。 When the result of the calculation is −2, the signal generation unit g j (0 ≦ j ≦ m−1) causes the partial product generation unit G j to shift the multiplicand X by (2j + 1) bits and inverts it. The signal is generated as a multiplier signal t j . The partial product generator G j to which the multiplier signal t j is input shifts the multiplicand X up by (2j + 1) bits and inverts it, and outputs this as a partial product P j .

演算の結果が2、1及び0のいずれかである場合には、乗数信号tj(0≦j≦m−1)の生成に並行して信号生成部gjは、第(2j+1)ビットを0とする信号を加算信号Sjとして生成する。この加算信号Sjが生成された場合には、部分積Pj+1は、第(2j+1)ビットが0とされて加算器102に入力される。 When the result of the operation is any one of 2, 1 and 0, the signal generator g j sets the (2j + 1) th bit in parallel with the generation of the multiplier signal t j (0 ≦ j ≦ m−1). A signal to be 0 is generated as the addition signal S j . When the addition signal S j is generated, the partial product P j + 1 is input to the adder 102 with the (2j + 1) -th bit set to 0.

演算の結果が−1または−2である場合には、乗数信号tj(0≦j≦m−1)の生成に並行して信号生成部gjは、第(2j+1)ビットを1とする信号を加算信号Sjとして生成する。この加算信号Sjが生成された場合には、部分積Pj+1は、第(2j+1)ビットが1とされて、加算器102に入力される。 When the calculation result is −1 or −2, the signal generation unit g j sets the (2j + 1) th bit to 1 in parallel with the generation of the multiplier signal t j (0 ≦ j ≦ m−1). The signal is generated as the addition signal S j . When the addition signal S j is generated, the partial product P j + 1 is input to the adder 102 with the (2j + 1) -th bit set to 1.

演算の結果の値がいずれの場合であっても、これらの内容は、部分積Pj+1が加算信号Sjを下位側に1ビット離して従えると把握できる。 Regardless of the value of the result of the calculation, it can be understood that these contents can be followed by the partial product P j + 1 separating the addition signal S j by 1 bit to the lower side.

乗数信号tm及び部分積Pmに関し、以下に具体的に説明する。 The multiplier signal t m and the partial product P m will be specifically described below.

信号生成部gmは、付加ビットb2m及び第(2m−1)ビットb2m-1を用いて演算を行う。具体的には、付加ビットb2m及び第(2m−1)ビットb2m-1が値1,1または値0,0を採る場合には、信号生成部gmは、部分積生成部Gmに部分積Pmとして0を出力させる信号を生成する。 The signal generator g m performs an operation using the additional bit b 2m and the (2m−1) th bit b 2m−1 . Specifically, when the additional bit b 2m and the (2m−1) th bit b 2m−1 take the value 1, 1 or the value 0, 0, the signal generation unit g m uses the partial product generation unit G m. A signal for outputting 0 as a partial product P m is generated.

値0,1を採る場合には、信号生成部gmは、部分積生成部Gmに被乗数Xを2mビットだけ上位へとシフトさせる信号を乗数信号tmとして生成する。乗数信号tmが入力された部分積生成部Gmは、被乗数Xを2mビットだけ上位へとシフトさせ、これを部分積Pmとして出力する。 When taking the value 0, 1, the signal generator g m generates a signal for shifting the multiplicand X to the upper only 2m bits to the partial product generator G m as a multiplier signal t m. The partial product generator G m to which the multiplier signal t m is input shifts the multiplicand X by 2 m bits and outputs it as a partial product P m .

上述した乗算装置によれば、付加ビットb2m及び乗数の最上位ビット第(2m−1)ビットb2m-1に基づいて乗数信号tmが生成されるので、乗数が符号付きである場合と符号なしである場合のいずれであるかを選択するための論理回路が不要である。しかも部分積Pj(0≦j≦m)のうち部分積P0以外の部分積Pjは加算信号Sj-1を従えるので、加算信号Sj-1の総和を部分積Pjの生成とは別途に生成する必要がなく、加算器102にm+1個の部分積Pjを入力するだけで良い。よって、乗算装置の演算速度が高速化される。 According to the multiplier described above, the multiplier signal t m is generated based on the additional bit b 2m and the most significant bit (2m−1) th bit b 2m−1 of the multiplier, and therefore the multiplier is signed. There is no need for a logic circuit for selecting which one is unsigned. Moreover, since the partial product P j other than the partial product P 0 of the partial product P j (0 ≦ j ≦ m ) subdue the sum signal S j-1, the generation of partial products P j a sum of the sum signal S j-1 And m + 1 partial products P j need only be input to the adder 102. Therefore, the calculation speed of the multiplier is increased.

図2は、乗数Yの範囲(22m>Y≧−22m-1)と付加ビットb2m及び第(2m−1)ビットb2m-1がそれぞれ採る値との関係を示している。値0,1は22m>Y≧22m-1の範囲に、値0,0は22m-1>Y≧0の範囲に、値1,1は0>Y≧−22m-1の範囲にそれぞれ対応する。 FIG. 2 shows the relationship between the range of the multiplier Y (2 2m > Y ≧ −2 2m−1 ) and the values taken by the additional bit b 2m and the (2m−1) th bit b 2m−1 . Values 0 and 1 are in the range 2 2m> Y ≧ 2 2m-1 , values 0 and 0 are in the range 2 2m-1 > Y ≧ 0, and values 1 and 1 are in the range 0> Y ≧ −2 2m-1 . Each corresponds to a range.

なお、図2では−22m-1>Y≧−22mの範囲についても示されており、この範囲には値1,0が対応する。しかし、付加ビットb2m及び乗数の最上位ビット第(2m−1)ビットb2m-1がそれぞれ値1,0を採る場合には、乗数Yの範囲を拡張できる一方、乗算装置の演算速度が高速化できない。 In FIG. 2, the range of −2 2m−1 > Y ≧ −22 m is also shown, and values 1 and 0 correspond to this range. However, when the additional bit b 2m and the most significant bit (2m−1) bit b 2m−1 of the multiplier take the values 1 and 0, respectively, the range of the multiplier Y can be expanded, while the operation speed of the multiplication device is increased. Cannot speed up.

実施の形態2.
本実施の形態では、加算器102がワレス・ツリーに従って加算演算を行う場合が説明される。
Embodiment 2. FIG.
In the present embodiment, a case where adder 102 performs an addition operation according to a Wallace tree will be described.

図3は、加算器102の加算演算で用いられるワレス・ツリーであって、m=8の場合を概念的に示す。加算器102には、9個の部分積Pj(0≦j≦8)が入力される。 FIG. 3 conceptually shows a Wallace tree used in the addition operation of the adder 102 and m = 8. Nine partial products P j (0 ≦ j ≦ 8) are input to the adder 102.

ワレス・ツリーは、第1次加算器211〜213、第2次加算器221,222、第3次加算器231及び第4次加算器241で構成される。   The Wallace tree is composed of first adders 211 to 213, second adders 221 and 222, a third adder 231, and a fourth adder 241.

第1次加算器乃至第4次加算器はいずれも3入力2出力の加算素子である。3入力2出力の加算素子には、例えばキャリー保存加算器(CSA)が採用でき、以下について同様である。   Each of the first to fourth adders is a 3-input 2-output addition element. For example, a carry-save adder (CSA) can be employed as the 3-input 2-output adder, and the same applies to the following.

第1次加算器211には部分積P0〜P2、第1次加算器212には部分積P3〜P5、第1次加算器213には部分積P6〜P8がそれぞれ入力される。 The first adder 211 receives partial products P 0 to P 2 , the first adder 212 receives partial products P 3 to P 5 , and the first adder 213 receives partial products P 6 to P 8. Is done.

第2次加算器221には、第1次加算器211の2出力の両方と、第2次加算器212の2出力の一方とが入力される。第2次加算器222には、第1次加算器212の2出力の他方と、第1次加算器213の2出力の両方とが入力される。   Both the two outputs of the first adder 211 and one of the two outputs of the second adder 212 are input to the second adder 221. The other of the two outputs of the first adder 212 and the two outputs of the first adder 213 are input to the second adder 222.

第3次加算器231には、第2次加算器221の2出力の両方と、第2次加算器222の2出力の一方とが入力される。   The third adder 231 receives both the two outputs of the second adder 221 and one of the two outputs of the second adder 222.

第4次加算器241には、第3次加算器231の2出力の両方と、第2次加算器222の2出力の他方とが入力される。   Both the two outputs of the third adder 231 and the other two outputs of the second adder 222 are input to the fourth adder 241.

第4次加算器241の2出力は乗算結果Rとして、加算器102から出力される。   The two outputs of the fourth adder 241 are output from the adder 102 as the multiplication result R.

第1次加算器211〜213での加算演算は並行して行うことができ、これが図3では第1ステージとして示されている。同様に、第2次加算器221,222、第3次加算器231及び第4次加算器241での加算演算が、図3では第2ステージ乃至第4ステージとしてそれぞれ示されている。第1乃至第4ステージでの演算は、いずれの一の演算についても他の演算と並行して行うことができない。よって、m=8の場合には、ワレス・ツリーには4つのステージが必要とされる。   The addition operations in the first adders 211 to 213 can be performed in parallel, which is shown as the first stage in FIG. Similarly, the addition operations in the second adders 221, 222, the third adder 231, and the fourth adder 241 are shown as the second to fourth stages in FIG. The calculations in the first to fourth stages cannot be performed in parallel with other calculations for any one calculation. Thus, when m = 8, the Wallace tree requires four stages.

図3との比較のために、例えば10個の部分積Pj(0≦j≦9)が加算器102に入力される場合のワレス・ツリーを図4に概念的に示す。当該ワレス・ツリーは、第1次加算器211〜213、第2次加算器221,222、第3次加算器231、第4次加算器241及び第5次加算器251で構成される。第1次加算器乃至第5次加算器はいずれも3入力2出力の加算素子であり、第1次加算器乃至第4次加算器については、ツリー構造が図3で示されるものと同じである。 For comparison with FIG. 3, FIG. 4 conceptually shows a Wallace tree in the case where, for example, ten partial products P j (0 ≦ j ≦ 9) are input to the adder 102. The Wallace tree is composed of first adders 211 to 213, second adders 221 and 222, third adder 231, fourth adder 241, and fifth adder 251. Each of the first to fifth adders is a three-input two-output adder, and the tree structure of the first to fourth adders is the same as that shown in FIG. is there.

第5次加算器には、第4次加算器241の2出力の両方と、部分積P9とが入力される。第5次加算器251の2出力は乗算結果Rとして、加算器102から出力される。 Both the two outputs of the fourth adder 241 and the partial product P 9 are input to the fifth adder. The two outputs of the fifth adder 251 are output from the adder 102 as the multiplication result R.

図4では、第5次加算器251の加算演算が、第5ステージとして示されている。第5ステージは、第1乃至第4ステージでの演算と並行して行うことはできない。よって、10個の部分積Pj(0≦j≦9)が入力されるワレス・ツリーでは、5つのステージが必要とされる。 In FIG. 4, the addition operation of the fifth adder 251 is shown as the fifth stage. The fifth stage cannot be performed in parallel with the calculations in the first to fourth stages. Therefore, in the Wallace tree to which ten partial products P j (0 ≦ j ≦ 9) are input, five stages are required.

よって、加算器102に入力される部分積が9個の場合には、それが10個の場合に比べて、ワレス・ツリーで必要とされるステージ数を一つ少なくすることができる。これにより、加算器102での演算時間を短縮することができ、以って乗算装置での演算速度を高速化できる。   Therefore, when nine partial products are input to the adder 102, the number of stages required in the Wallace tree can be reduced by one compared to the case where there are ten partial products. Thereby, the calculation time in the adder 102 can be shortened, and the calculation speed in the multiplication device can be increased.

より一般的には、実施の形態1で説明した乗算装置によればm+1個の部分積Pj(0≦j≦m)が加算器102に入力され、加算器102はワレス・ツリーに従って部分積Pjの加算演算を行う。 More generally, according to the multiplication apparatus described in the first embodiment, m + 1 partial products P j (0 ≦ j ≦ m) are input to the adder 102, and the adder 102 performs partial product according to the Wallace tree. Addition operation of P j is performed.

特に、自然数mが式(1)を満たす場合、具体的にはm=8、32、128、256、320、512、2048、・・・の場合には、上述したと同様に、m+2個の部分積が加算器102に入力される場合に比べて、ステージ数を一つ少なくすることができる。ここで、Ceil[ ]は、[ ]内の値以上であって最小の整数を表す。また、符号kは整数を表す。   In particular, when the natural number m satisfies the formula (1), specifically, when m = 8, 32, 128, 256, 320, 512, 2048,..., As described above, m + 2 Compared to the case where the partial product is input to the adder 102, the number of stages can be reduced by one. Here, Ceil [] represents a minimum integer that is greater than or equal to the value in []. The symbol k represents an integer.

Figure 2006301685
Figure 2006301685

実施の形態3.
図5は、加算器102の加算演算に用いられるツリーであって、m=16の場合を概念的に示す。加算器102には、17個の部分積Pj(0≦j≦16)が入力される。
Embodiment 3 FIG.
FIG. 5 is a tree used for the addition operation of the adder 102 and conceptually shows a case where m = 16. The adder 102 receives 17 partial products P j (0 ≦ j ≦ 16).

ツリーは、いずれも3入力2出力の加算素子である第1次加算器乃至第15次加算器301〜315で構成される。   The tree is composed of first to fifteenth adders 301 to 315 which are 3-input 2-output adder elements.

第1次加算器301には部分積P0〜P2が入力される。第j次加算器30j(2≦j≦15)には、第i次加算器30i(i=j−1)の2出力の両方と、部分積Pj+1とが入力される。第15次加算器315の2出力は乗算結果Rとして、加算器102から出力される。 Partial products P 0 to P 2 are input to the first adder 301. Both the two outputs of the i-th adder 30i (i = j−1) and the partial product P j + 1 are input to the j-th adder 30j (2 ≦ j ≦ 15). The two outputs of the fifteenth adder 315 are output from the adder 102 as the multiplication result R.

第1次加算器乃至第15次加算器301〜315での加算演算は、いずれの一の加算演算についても他の加算演算と並行して行うことができないので、ツリーには15個のステージが必要とされる。   Since the addition operation in the first to 15th adders 301 to 315 cannot be performed in parallel with any other addition operation for any one addition operation, there are 15 stages in the tree. Needed.

図5との比較のために、例えば18個の部分積Pj(0≦j≦17)が加算器102に入力される場合のツリーを図6に概念的に示す。当該ツリーは、いずれも3入力2出力の加算素子である第1次加算器乃至第16次加算器301〜316で構成される。第1次加算器乃至第15次加算器301〜315については、ツリー構造が図5で示されるものと同じである。 For comparison with FIG. 5, for example, a tree in the case where 18 partial products P j (0 ≦ j ≦ 17) are input to the adder 102 is conceptually shown in FIG. The tree includes first to sixteenth adders 301 to 316 which are 3-input 2-output adder elements. For the first to fifteenth adders 301 to 315, the tree structure is the same as that shown in FIG.

第16次加算器316には、第15次加算器315の2出力の両方と、部分積P16とが入力される。第16次加算器316の2出力は乗算結果Rとして、加算器102から出力される。 Both the two outputs of the 15th order adder 315 and the partial product P 16 are input to the 16th order adder 316. The two outputs of the sixteenth adder 316 are output from the adder 102 as the multiplication result R.

第16次加算器316の加算演算は、第1次加算器乃至第15次加算器301〜315の加算演算と並行して行うことができないので、図6で示されるツリーには16個のステージが必要とされる。   Since the addition operation of the sixteenth adder 316 cannot be performed in parallel with the addition operations of the first to fifteenth adders 301 to 315, there are 16 stages in the tree shown in FIG. Is needed.

よって、加算器102に入力される部分積が17個である場合には、それが18個である場合に比べて、ツリーで必要とされるステージ数を一つ少なくすることができる。   Therefore, when the number of partial products input to the adder 102 is 17, the number of stages required in the tree can be reduced by one compared to the case where there are 18 partial products.

より一般的には、実施の形態1で説明した乗算装置によればm+1個の部分積Pj(0≦j≦m)が加算器102に入力され、加算器102はステージ数が(m−1)であるツリーに従って部分積Pjの加算演算を行う。このより、m+2個の部分積が加算器102に入力される場合に比べて、ステージ数を一つ少なくすることができる。 More generally, according to the multiplication apparatus described in the first embodiment, m + 1 partial products P j (0 ≦ j ≦ m) are input to the adder 102, and the adder 102 has (m− The partial product P j is added according to the tree 1). Thus, the number of stages can be reduced by one as compared with the case where m + 2 partial products are input to the adder 102.

実施の形態1で説明される、乗算装置を概念的に示すブロック図である。1 is a block diagram conceptually showing a multiplication device described in Embodiment 1. FIG. 乗数の範囲と付加ビット及び第(2m−1)ビットの値との関係を示す図である。It is a figure which shows the relationship between the range of a multiplier, and the value of an additional bit and the (2m-1) th bit. 実施の形態2で説明される、ワレス・ツリーを概念的に示す図である。It is a figure which shows notionally the Wallace tree demonstrated in Embodiment 2. FIG. 10個の部分積を入力した場合に採用されるワレス・ツリーを示す図である。It is a figure which shows the Wallace tree employ | adopted when ten partial products are input. 実施の形態3で説明される、ツリーを概念的に示す図である。It is a figure which shows notionally the tree demonstrated in Embodiment 3. FIG. 18個の部分積を入力した場合に採用されるツリーを示す図である。It is a figure which shows the tree employ | adopted when 18 partial products are input.

符号の説明Explanation of symbols

102 加算器、X 被乗数、Y 乗数、g0〜gm 信号生成部、G0〜Gm 部分積生成部、t0〜tm 乗数信号、S0〜Sm-1 加算信号、P0〜Pm-1 部分積。
102 adder, X multiplicand, Y multiplier, g 0 to g m signal generation unit, G 0 to G m partial product generation unit, t 0 to t m multiplier signal, S 0 to S m-1 addition signal, P 0 to P m-1 partial product.

Claims (5)

2mビット長(m;自然数)の乗数の最下位2ビットに対応する第0の加算信号及び第0の乗数信号を生成する第0の信号生成部と、
前記乗数の第(2j+1),2j,(2j−1)ビットに対応する第jの加算信号とともに第jの乗数信号を生成する第j(1≦j≦m−1の整数)の信号生成部と、
前記乗数の最上位ビット及び付加ビットに対応する第mの乗数信号を生成する第mの信号生成部と、
被乗数と前記第0乃至前記第mの前記乗数信号とを用いてそれぞれ第0乃至第mの部分積を生成する部分積生成部と、
前記第0の前記部分積と、前記第1乃至前記第mの前記乗算信号に基づいてビットがずれて、前記第0乃至前記第(m−1)の前記加算信号をそれぞれ下位側に1ビット離して従える前記第1乃至前記第mの前記部分積とを加算する加算器と
を備え、
前記付加ビットは、符号なしの前記乗数については値0を採り、符号付きの前記乗数については前記乗数の最上位ビットの値と同じ値を採る、乗算装置。
A 0th signal generation unit for generating a 0th addition signal and a 0th multiplier signal corresponding to the least significant 2 bits of a multiplier having a length of 2 m bits (m: natural number);
A jth (1 ≦ j ≦ m−1) signal generation unit that generates a jth multiplier signal together with a jth addition signal corresponding to the (2j + 1) th, 2j, and (2j−1) th bits of the multiplier. When,
An mth signal generation unit for generating an mth multiplier signal corresponding to the most significant bit and the additional bits of the multiplier;
A partial product generator for generating 0th to mth partial products using a multiplicand and the 0th to mth multiplier signals, respectively;
Bits are shifted based on the 0th partial product and the 1st to mth multiplication signals, and the 0th to (m-1) th addition signals are each set to 1 bit on the lower side. An adder that adds the first to mth partial products that are separated from each other;
The multiplication device, wherein the additional bit takes a value of 0 for the unsigned multiplier and takes the same value as the value of the most significant bit of the multiplier for the signed multiplier.
前記第0乃至前記第(m−1)の前記信号生成部は、ブースのアルゴリズムに従って前記第0乃至前記第(m−1)の前記加算信号及び前記第0乃至前記第(m−1)の前記乗数信号を生成する、請求項1記載の乗算装置。   The 0th to (m−1) th signal generation units are configured to perform the 0th to (m−1) th addition signals and the 0th to (m−1) th signal generation units according to Booth's algorithm. The multiplier according to claim 1, wherein the multiplier signal is generated. 前記加算器はワレス・ツリーに従って加算演算を行う、請求項1または請求項2記載の乗算装置。   The multiplication device according to claim 1, wherein the adder performs an addition operation according to a Wallace tree. 前記加算器は、キャリー保存加算器を含む、請求項1乃至請求項3のいずれか一つに記載の乗算装置   The multiplication device according to any one of claims 1 to 3, wherein the adder includes a carry save adder. 前記自然数mは、これを2倍して1だけ加えたものを2で割った値以上で最小の整数が3の倍数となる、請求項1乃至請求項4のいずれか一つに記載の乗算装置。
5. The multiplication according to claim 1, wherein the natural number m is a value obtained by multiplying the natural number m by 2 and dividing by 2 and having a minimum integer equal to or a multiple of 3. 5. apparatus.
JP2005118033A 2005-04-15 2005-04-15 Multiplying device Pending JP2006301685A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005118033A JP2006301685A (en) 2005-04-15 2005-04-15 Multiplying device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005118033A JP2006301685A (en) 2005-04-15 2005-04-15 Multiplying device

Publications (1)

Publication Number Publication Date
JP2006301685A true JP2006301685A (en) 2006-11-02

Family

ID=37469943

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005118033A Pending JP2006301685A (en) 2005-04-15 2005-04-15 Multiplying device

Country Status (1)

Country Link
JP (1) JP2006301685A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897513A (en) * 2020-07-29 2020-11-06 上海芷锐电子科技有限公司 Multiplier based on reverse polarity technology and code generation method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897513A (en) * 2020-07-29 2020-11-06 上海芷锐电子科技有限公司 Multiplier based on reverse polarity technology and code generation method thereof

Similar Documents

Publication Publication Date Title
Vun et al. A new RNS based DA approach for inner product computation
JP4790791B2 (en) Multiplier, digital filter, signal processing device, synthesis device, synthesis program, and synthesis program recording medium
EP1672481B1 (en) Division and square root arithmetic unit
US7308471B2 (en) Method and device for performing operations involving multiplication of selectively partitioned binary inputs using booth encoding
WO1999038088A1 (en) Method and apparatus for arithmetic operation
KR101560340B1 (en) Integer multiply and multiply-add operations with saturation
JPH0447849B2 (en)
Low et al. A new approach to the design of efficient residue generators for arbitrary moduli
US6018758A (en) Squarer with diagonal row merged into folded partial product array
US20140358979A1 (en) GENERATING A FAST 3x MULTIPLAND TERM FOR RADIX-8 BOOTH MULTIPLICATION
Pieper et al. Efficient Dedicated Multiplication Blocks for 2's Complement Radix-2m Array Multipliers.
JPWO2006022089A1 (en) Multiplier
JP6734938B2 (en) Neural network circuit
US5870322A (en) Multiplier to selectively perform unsigned magnitude multiplication or signed magnitude multiplication
JP2006301685A (en) Multiplying device
JPH05158659A (en) Multiplier
JPH08314697A (en) Multiplier used for both number with sign and number withoutsign
US7043517B2 (en) Multiply accumulator for two N bit multipliers and an M bit addend
JP4290203B2 (en) Reduction array apparatus and method
CN116991359B (en) Booth multiplier, hybrid Booth multiplier and operation method
JPH01251133A (en) Multiplying circuit and method
JP2765516B2 (en) Multiply-accumulate unit
JP2606339B2 (en) Multiplier
Singh et al. Design and Simulation of Diminished-One Modulo 2n+ 1 Adder Using Circular Carry Selection
Farshidi et al. A Novel Multiple Valued Logic OHRNS Adder Circuit for Modulo rn-1