JPWO2020090025A1 - Arithmetic processing unit and control method of arithmetic processing unit - Google Patents
Arithmetic processing unit and control method of arithmetic processing unit Download PDFInfo
- Publication number
- JPWO2020090025A1 JPWO2020090025A1 JP2020554661A JP2020554661A JPWO2020090025A1 JP WO2020090025 A1 JPWO2020090025 A1 JP WO2020090025A1 JP 2020554661 A JP2020554661 A JP 2020554661A JP 2020554661 A JP2020554661 A JP 2020554661A JP WO2020090025 A1 JPWO2020090025 A1 JP WO2020090025A1
- Authority
- JP
- Japan
- Prior art keywords
- arithmetic
- circuit
- calculation
- arithmetic processing
- repetitions
- 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.)
- Granted
Links
- 238000012545 processing Methods 0.000 title claims description 91
- 238000000034 method Methods 0.000 title claims description 35
- 238000004364 calculation method Methods 0.000 claims abstract description 97
- 238000012790 confirmation Methods 0.000 description 9
- 238000013459 approach Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000003252 repetitive effect Effects 0.000 description 3
- 238000013135 deep learning Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000010187 selection method Methods 0.000 description 2
- 230000010365 information processing Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000001902 propagating effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/544—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices for evaluating functions by calculation
- G06F7/556—Logarithmic or exponential functions
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Pure & Applied Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Mathematical Optimization (AREA)
- General Engineering & Computer Science (AREA)
- Complex Calculations (AREA)
- Advance Control (AREA)
Abstract
指数演算または対数演算を行なう演算回路107,114と、演算回路107,114による演算繰り返し回数が閾値以下の場合に、1サイクル当たりに演算回路107,114が求めるビット数を第1数に設定し、演算繰り返し回数が閾値よりも多い場合に、1サイクル当たりに演算回路107,114が求めるビット数を、第1数よりも多い第2数に設定する設定部106,108,109とを備えることで、回路規模を大きくすることなく指数演算または対数演算において解に収束できるようにする。When the number of calculation repetitions by the calculation circuits 107 and 114 that perform exponential calculation or logarithmic calculation and the calculation repetition by the calculation circuits 107 and 114 is less than the threshold value, the number of bits required by the calculation circuits 107 and 114 per cycle is set to the first number. It is provided with setting units 106, 108, 109 for setting the number of bits required by the arithmetic circuits 107, 114 per cycle to a second number, which is larger than the first number, when the number of arithmetic repetitions is larger than the threshold value. Therefore, it is possible to converge on a solution in exponential operation or logarithmic operation without increasing the circuit scale.
Description
本発明は、演算処理装置および演算処理装置の制御方法に関する。 The present invention relates to an arithmetic processing unit and a control method for the arithmetic processing unit.
図8は従来の演算処理回路500の構成を示す図である。
この図8に示す演算処理回路500は、レジスタ501〜504,判定回路505,CSA(Carry-Save Adder:桁上げ保存加算器)506,507,Log Table回路508,右シフト回路(RSFT)509,510および演算回路511〜514を備える。FIG. 8 is a diagram showing a configuration of a conventional
The
演算処理回路500は指数(EXP)演算および対数(LOG)演算を行なう演算回路である。例えば、演算1回で商2bitを求めるradix-4のSTL(Sequential Table Lookup)法を用いる。
The
演算処理回路500は、指数演算において、xを入力とし、exp(x)を求める。
Lはべき数の空間の変数であり、Eは指数の空間の変数である。また、iは演算の繰り返し回数である。The
L is a space variable of powers and E is a space variable of exponents. Also, i is the number of times the operation is repeated.
Liの算出(Li演算)には、以下の式(1)を用いる。
Li+1= Li - log(1 + n × 2^-2i) ・・・(1)The L i calculated in (L i calculation), using the following equation (1).
L i + 1 = L i --log (1 + n × 2 ^ -2i) ・ ・ ・ (1)
また、Eiの算出(Ei演算)には、以下の式(2)を用いる。
Ei+1= Ei × (1 + n × 2^-2i)
=Ei+ Ei × n × 2^-2i ・・・(2)Further, the calculation of E i (E i calculation), using the following equation (2).
E i + 1 = E i × (1 + n × 2 ^ -2i)
= E i + E i × n × 2 ^ -2i ・ ・ ・ (2)
ただし、n = -2, -1, 0, +1, +2であり、Liと0との大小関係および差分を判定し、Liが0に一番近づくようにnを選ぶ。However, n = -2, -1, 0, +1, +2, determine the magnitude relationship and difference between L i and 0, and select n so that L i is closest to 0.
なお、レジスタ501,502,503,504に格納される値(レジスタ値)を、それぞれLS,LC,ES,ECという場合がある。また、レジスタ501,502,503,504を、それぞれレジスタLS,LC,ES,ECという場合がある。
The values (register values) stored in the
演算処理回路500においては、初期値をL1 = x,E1 = exp(0) = 1となるよう、レジスタ501〜504の初期化が行なわれる。In the
なお、LS + LC = L1であり、例えば、LSとLCとのいずれか一方にxを設定し、他方に0を設定する。同様に、ES + EC =E1であり、ESとECとのいずれか一方に1を設定し、他方に0を設定する。Note that LS + LC = L 1 , for example, x is set in either LS or LC, and 0 is set in the other. Similarly, ES + EC = E 1 , set 1 for either ES or EC and 0 for the other.
演算処理回路500においては、x = log(Ei) + Liを満たしつつ、演算を繰り返してLiを少しずつ0に近づけることで、Eiがexp(x)に近づく(Li=x→0、Ei=exp(0)→exp(x))。In the
すなわち、処理対象の指数演算においてiが予め規定された最大値(imax)に到達するまで、Liを算出するLi演算とEiを算出するEi演算とを繰り返し行なう。That is, until it reaches the maximum value i in the exponent computation to be processed is defined in advance (imax), repeated E i and calculation for calculating the L i operations and E i to calculate the L i is performed.
演算処理回路500は、対数演算において、xを入力とし、log(x)を求める。
Lは対数の空間の変数であり、Eは真数の空間の変数である。またiは繰り返し演算の回数である。The
L is a variable in logarithmic space and E is a variable in antilogarithm space. Also, i is the number of repetitive operations.
初期値をL1= log(1) = 0,E1 = xとし、x = Ei × exp(Li)を満たしつつ、演算を繰り返してEiを少しずつ1に近づけることで、Liがlog(x)に近づく(Ei=x→1、Li=log(1)→log(x))。By setting the initial value to L 1 = log (1) = 0 and E 1 = x and satisfying x = E i × exp (L i ) and repeating the operation to gradually bring E i closer to 1, L i Approaches log (x) (E i = x → 1, L i = log (1) → log (x)).
対数演算におけるLiおよびEiの演算方法(Li演算,Ei演算)は概ね指数演算と同様であるが、nの選び方は異なる。すなわち、Eiと1との大小関係および差分を判定し、Eiが1に一番近づくようにnを選ぶ。The calculation methods of L i and E i in logarithmic calculation (L i calculation, E i calculation) are almost the same as those of exponential calculation, but the selection method of n is different. That is, the magnitude relationship and difference between E i and 1 are judged, and n is selected so that E i is closest to 1.
演算処理回路500において、Log Table回路508およびCSA506が、指数演算または対数演算におけるLi演算を実現する。また、右シフト回路509,510,演算回路511〜514およびCSA507が、指数演算または対数演算におけるEi演算を実現する。In the
指数演算を行なう場合、判定回路505は、Liに基づき、nを選択する。判定回路505は、Liと0との大小関係および差分を判定し、Liが0に一番近づくnの値を選択する。一方、対数演算を行なう場合、判定回路505は、Eiに基づき、nを選択する。判定回路505は、Eiと1との大小関係および差分を判定し、Eiが1に一番近づくnの値を選択する。選択されたnはLog Table回路508に出力される。When performing the exponentiation, the
Log Table回路508には、予め変数i, nに対応するlog(1+n*2^-2i)の値が設定されており、iと判定回路505から入力されるnとに応じたlog(1+n*2^-2i)の値をCSA506に出力する。
In the
CSA506は、桁上を伝播させずにそのまま出力する加算器であり、上記式(1)を用いてLi演算(参照)を行なう。CSA506の出力(演算結果)のうち部分和ビットの列は、レジスタ501に入力される。一方、CSA506の出力(演算結果)のうち桁上げビットの列はレジスタ502に入力される。CSA506 is an adder directly outputs without propagate Ketajo performs L i calculates (see) by using the equation (1). A string of partial sum bits in the output (calculation result) of CSA506 is input to register 501. On the other hand, a string of carry bits in the output (calculation result) of CSA506 is input to the
また、右シフト回路509,510,演算回路511〜514およびCSA507が、指数演算におけるEi演算(上記式(2)参照)を実現する。Further, the
右シフト回路509,510は、レジスタ503,504から読み出された値ES,ECに対して2iビットの右シフト演算を行なうことで2^-2i倍算を実現する。これにより、上記式(2)の2^-2iの演算が実現される。なお、その後、演算回路511〜514によりEi×n×2^-2iの演算が実現される。The
演算回路511,512は、右シフト回路509,510から出力された値に対して、1倍(×1)演算または2倍(×2)演算を行なう。例えば、判定回路505において決定されたnが+2または-2である場合に、演算回路511,512は×2演算を行なう。一方、判定回路505において決定されたnが+1または-1である場合に、演算回路511,512は×1演算を行なう。
The
演算回路513,514は、演算回路511,512から出力された値をスルー(+)または符号反転(-)して出力する。例えば、判定回路505において決定されたnが+2,+1,0のいずれかである場合に、演算回路513,514はスルー出力する。一方、判定回路505において決定されたnが-2または-1である場合に、演算回路513,514は符号反転して出力する。
The
CSA507は、桁上を伝播させずにそのまま出力する加算器であり、上記式(2)を用いてEi演算を行なう。CSA507の出力(演算結果)のうち部分和ビットの列は、レジスタ503に入力される。一方、CSA507の出力(演算結果)のうち桁上げビットの列はレジスタ504に入力される。The CSA507 is an adder that outputs as it is without propagating the digits, and performs an E i operation using the above equation (2). A string of partial sum bits in the output (calculation result) of CSA507 is input to register 503. On the other hand, in the output (calculation result) of CSA507, the carry bit string is input to the
演算処理回路500においては、指数演算の結果としてレジスタ503,504の値Eiを出力し、対数演算の結果としてレジスタ501,502の値Liを出力する。 The arithmetic processing circuit 500 outputs the value E i of the
しかしながら、このような従来の演算処理回路500においては、指数演算を行なう場合に、Liが0から遠い時点では、1回の演算でEiがexp(x)に十分近づかず、結果として演算を繰り返してもEiがexp(x)に収束しないことがある。同様に、対数演算を行なう場合に、Eiが1から遠い時点では、1回の演算でLiがlog(x)に十分近づかず、結果として演算を繰り返してもLiがlog(x)に収束しないことがある。EiもしくはLiが解にある程度近い範囲にあることを想定しているのに対し、繰り返し回数(i)が少ない時点では、その範囲から外れる場合があるからである。However, in such a conventional
すなわち、演算を繰り返しても指数演算のEiもしくは対数演算のLiが解に収束しない場合がある。That is, even if the operation is repeated, E i of the exponential operation or L i of the logarithmic operation may not converge to the solution.
図9は上述の如き演算処理回路500による問題を解消するための従来の演算処理回路600の構成を示す図である。
FIG. 9 is a diagram showing a configuration of a conventional
この図9に示す演算処理回路600においては、図8に示した演算処理回路500の判定回路505に代えて判定回路601,1st_nテーブル回路602およびセレクタ603を備える。また、演算処理回路500の演算回路511,512に代えて演算回路604,605を備えるとともに、Log Table回路508に代えてLog Table回路606を備える。その他の部分は図8の演算処理回路500と同様に構成されている。
The
なお、図中、既述の符号と同一の符号は同様の部分を示しているので、その説明は省略する。 In the figure, the same reference numerals as those described above indicate the same parts, and thus the description thereof will be omitted.
この図9に示す演算処理回路600においては、演算1回目(i=1)だけnの選択論理を変更する。
In the
1st_nテーブル回路602および判定回路601の各出力がセレクタ603に入力される。
Each output of the
1st_nテーブル回路602は、演算1回目(i=1)においてのみ参照される参照テーブル(lookup table)である。演算1回目(i=1)だけ、L1もしくはE1(つまり入力x)をインデックスとして1st_nテーブル回路602が参照され、セレクタ603は1st_n テーブル回路602の出力を選択して出力する。The
なお、演算2回目以降は、セレクタ603は判定回路601の出力を選択して出力する。また、判定回路601においては、図8に示した判定回路505に比べてnの選択肢に±3が追加されている。すなわち、判定回路601は、選択肢nとして、-3,-2,-1,0,+1,+2,+3を有する。
From the second calculation onward, the
セレクタ603の出力は、演算回路513,514,604,605およびLog Table回路606に入力される。
The output of the
Log Table回路606においては、Log Table回路508に比べて、エントリにn=-3,+3に対応する値を追加して備える。
Compared to the
演算回路604,605は、それぞれ、×1 or ×2 or ×3回路であり、判定回路601から出力されるnに応じて、スルー(×1)または、左シフト(×2)または×3乗算のいずれかを行なう。
The
しかしながら、このような図9に示す従来の演算処理回路600においては、1st_nテーブル回路602やセレクタ603,演算回路604,605を備えることで、回路規模が大きくなる。これにより、クリティカルパスの論理段数が多くなり、ディレイが大きくなるという課題がある。
However, in the conventional
本発明は、このような課題に鑑み創案されたもので、回路規模を大きくすることなく指数演算または対数演算において解に収束できるようにすることを目的とする。 The present invention has been devised in view of such a problem, and an object of the present invention is to enable convergence to a solution in exponential or logarithmic operations without increasing the circuit scale.
上記の目的を達成するために、この演算処理装置は、指数演算または対数演算を行なう演算回路と、前記演算回路による演算繰り返し回数が閾値以下の場合に、1サイクル当たりに前記演算回路が求めるビット数を第1数に設定し、前記演算繰り返し回数が前記閾値よりも多い場合に、1サイクル当たりに前記演算回路が求めるビット数を、前記第1数よりも多い第2数に設定する設定部とを備える。 In order to achieve the above object, this arithmetic processing apparatus includes an arithmetic circuit that performs exponential calculation or logarithmic calculation, and bits obtained by the arithmetic circuit per cycle when the number of arithmetic repetitions by the arithmetic circuit is equal to or less than a threshold value. A setting unit that sets the number to the first number and sets the number of bits required by the calculation circuit per cycle to the second number, which is larger than the first number, when the number of repetitions of the calculation is larger than the threshold value. And.
回路規模を大きくすることなく指数演算または対数演算において解に収束できる。 It can converge to a solution in exponential or logarithmic operations without increasing the circuit scale.
以下、図面を参照して本演算処理装置および演算処理装置の制御方法に係る実施の形態を説明する。ただし、以下に示す実施形態はあくまでも例示に過ぎず、実施形態で明示しない種々の変形例や技術の適用を排除する意図はない。すなわち、本実施形態を、その趣旨を逸脱しない範囲で種々変形して実施することができる。また、各図は、図中に示す構成要素のみを備えるという趣旨ではなく、他の機能等を含むことができる。 Hereinafter, embodiments relating to the present arithmetic processing unit and the control method of the arithmetic processing unit will be described with reference to the drawings. However, the embodiments shown below are merely examples, and there is no intention of excluding the application of various modifications and techniques not specified in the embodiments. That is, the present embodiment can be variously modified and implemented within a range that does not deviate from the purpose. Further, each figure does not mean that it includes only the components shown in the figure, but may include other functions and the like.
図1は実施形態の一例としての演算処理回路1の構成を例示する図である。
FIG. 1 is a diagram illustrating a configuration of an
演算処理回路(演算器)1は、例えば情報処理装置のプロセッサ(演算処理装置)に備えられ、演算を実現する。図1に示す演算処理回路1は、指数(EXP)演算および対数(LOG)演算の2種類の演算を実現する演算処理回路である。すなわち、本演算処理回路1は、指数演算および対数演算のいずれかを選択的に実現する。
The arithmetic processing circuit (arithmetic unit) 1 is provided in, for example, a processor (arithmetic processing unit) of an information processing device to realize arithmetic operations. The
[指数演算]
指数演算においては、例えば、演算1回で商2bitを求めるradix4のSTL(Sequential Table Lookup)法を用いてもよい。
例えば、xを入力とし、exp(x)を求める。
Lはべき数の空間の変数であり、Eは指数の空間の変数である。また、iは演算の繰り返し回数である。[Exponential calculation]
In the exponential calculation, for example, the STL (Sequential Table Lookup) method of radix4 for obtaining the
For example, take x as an input and find exp (x).
L is a space variable of powers and E is a space variable of exponents. Also, i is the number of times the operation is repeated.
初期値をL1= x,E1 = exp(0) = 1とし、x = log(Ei) + Liを満たしつつ、演算を繰り返してLiを少しずつ0に近づけることで、Eiがexp(x)に近づく(Li=x→0、Ei=exp(0)→exp(x))。By setting the initial values to L 1 = x and E 1 = exp (0) = 1, and satisfying x = log (E i ) + L i , repeating the calculation to gradually bring L i closer to 0, E i Approaches exp (x) (L i = x → 0, Ei = exp (0) → exp (x)).
[対数演算]
対数演算にSTL法を用いてもよい。
例えば、xを入力とし、log(x)を求める。[Logarithmic calculation]
The STL method may be used for logarithmic calculation.
For example, take x as an input and find log (x).
Lは対数の空間の変数であり、Eは真数の空間の変数である。またiは繰り返し演算の回数である。 L is a variable in logarithmic space and E is a variable in antilogarithm space. Also, i is the number of repetitive operations.
初期値をL1= log(1) = 0,E1 = xとし、x = Ei × exp(Li)を満たしつつ、演算を繰り返してEiを少しずつ1に近づけることで、Liがlog(x)に近づく(Ei=x→1、Li=log(1)→log(x))。By setting the initial value to L 1 = log (1) = 0 and E 1 = x and satisfying x = E i × exp (L i ) and repeating the operation to gradually bring E i closer to 1, L i Approaches log (x) (E i = x → 1, L i = log (1) → log (x)).
対数演算におけるLiおよびEiの演算方法(Li演算,Ei演算)は概ね指数演算と同様であるが、nの選び方は異なる。すなわち、Eiと1との大小関係および差分を判定し、Eiが1に一番近づくようにnを選ぶ。The calculation methods of L i and E i in logarithmic calculation (L i calculation, E i calculation) are almost the same as those of exponential calculation, but the selection method of n is different. That is, the magnitude relationship and difference between E i and 1 are judged, and n is selected so that E i is closest to 1.
(A)構成
図1に示す演算処理回路1は、レジスタ101〜104,判定回路105,CSA107,114,Log Table回路106,右シフト回路(RSFT2)108,109および演算回路110〜113を備える。(A) Configuration The
以下、レジスタ101をレジスタLSと表す場合がある。同様に、レジスタ102をレジスタLCと表す場合があり、レジスタ103をレジスタESと表す場合があり、レジスタ104をレジスタECと表す場合がある。
Hereinafter, the
レジスタ101は、判定回路105およびCSA107にそれぞれ接続されている。レジスタ101には、後述するCSA107によるLi演算の結果(sum)が格納される。すなわち、レジスタ101には、演算処理の過程でCSA107によって生成された演算途中値が格納される。
The
また、レジスタ101から読み出されたレジスタ値Liは、判定回路105およびCSA107のそれぞれに入力される。The register value L i read from the
レジスタ102は、判定回路105およびCSA107にそれぞれ接続されている。レジスタ102にCSA107によるLi演算の結果(carry)が格納される。すなわち、レジスタ102には、演算処理の過程でCSA107によって生成された演算途中値が格納される。The
レジスタ102から読み出されたレジスタ値Liは判定回路105およびCSA107のそれぞれに入力される。Register value L i read from the
Log Table回路106およびCSA107が、指数演算または対数演算におけるLi演算を実現する。右シフト回路108,109,演算回路110〜113およびCSA114が、指数演算または対数演算におけるEi演算を実現する。
ここで、本演算処理回路1においては、繰り返し回数(i)が少ない時点、すなわちiが閾値k以下の時点では1サイクルあたりに求めるビット数(第1数)を少なくする(例えば、1回)。そして、繰り返し回数(i)が閾値kよりも大きくなった以降は1サイクルあたりに求めるビット数(第2数)を増やす(例えば、2回以上)。第2数は第1数よりも多くする。
Here, in the present
具体的には、例えば、Liの算出(Li演算)およびEiの算出(Ei演算)には、以下の式(3)を用いる。
なお、n = -2, -1, 0, +1, +2である。
本実施形態においては、i≦kのときには1サイクルあたりに求めるビット数(第1数)は1であり、i>kのときには1サイクルあたりに求めるビット数(第2数)は2である。Note that n = -2, -1, 0, +1, +2.
In the present embodiment, the number of bits (first number) obtained per cycle is 1 when i ≦ k, and the number of bits (second number) obtained per cycle is 2 when i> k.
指数演算を行なう場合、判定回路105は、Liに基づき、nを選択する。判定回路105は、Liと0との大小関係および差分を判定し、Liが0に一番近づくnの値を選択する。対数演算を行なう場合、判定回路105は、Eiに基づき、nを選択する。判定回路105は、Eiと1との大小関係および差分を判定し、Eiが1に一番近づくnの値を選択する。When performing the exponentiation, the
判定回路105によって決定されたnの値は、演算回路110〜113およびLog Table回路106に入力される。
The value of n determined by the
Log Table回路106は、log(1+n*2^-A)の値を出力する。ここで、i≦kのとき A=iであり、i>kのときA=2i-kである。
The
Log Table回路106には、変数であるi, nに対応するlog(1+n*2^-A)の値が予め設定されており、iと判定回路105から入力されるnとに応じたlog(1+n*2^-A)の値を出力する。
The value of log (1 + n * 2 ^ -A) corresponding to the variables i and n is preset in the
すなわち、Log Table回路106は、インデックスとしてiおよびnを有し、エントリとしてlog(1+n×2^-i)やlog(1+n×2^-(2i-k))の各値を有する。
That is, the
図2は実施形態の一例としての演算処理回路1におけるLog Table回路106のインデックスとエントリとの関係を例示する図である。
FIG. 2 is a diagram illustrating the relationship between the index and the entry of the
この図2においては、1≦i≦9であり、k=3の例について示す。また、図2中においては、便宜上、各エントリをlogを冠した対数の形式で示しているが、実際には各エントリには対数を計算した数値が保持される。また、図2中において“don't care”が示された箇所は選択されることがない。 In FIG. 2, 1 ≦ i ≦ 9 and an example of k = 3 is shown. Further, in FIG. 2, for convenience, each entry is shown in the form of a logarithm with a log, but in reality, each entry holds a numerical value obtained by calculating the logarithm. In addition, the portion indicated by "don't care" in FIG. 2 is not selected.
Log Table回路106は、入力されたiおよびnに対応するエントリの値をCSA107に出力する。
The
なお、Log Table回路106は、図2に例示するようなインデックスとエントリとを対応付けた情報を図示しない記憶装置に格納し、iおよびnが入力された場合に、この情報を、入力されたi,nをインデックスとして参照して、対応するエントリの値を取得し、出力してもよい。
The
また、Log Table回路106は、図2に例示するような情報を制御ユニット10等から取得してもよい。
Further, the
CSA107は、3入力−2出力(3 in - 2 out)の桁上げ保存加算器であり、レジスタ101,102およびLog Table回路106から各出力が入力される。また、このCSA107の出力(演算結果)のうち、部分和ビットの列はレジスタ101に入力される。一方、CSA107の出力(演算結果)のうち、桁上げビットの列はレジスタ102に入力される。
The
CSA107は、Li+1の演算(Li演算)を行なう。CSA107は、Log Table回路106から出力されたlog(1+n*2^-A)の値を用いて、上記式(3)に基づきLiを算出する。The
レジスタ103は、判定回路105,右シフト回路108およびCSA114にそれぞれ接続されており、このレジスタ103に後述するCSA114によるEi演算の結果(sum)が格納される。すなわち、レジスタ103には、演算処理の過程でCSA114によって生成された演算途中値が格納される。The
レジスタ103から読み出されたレジスタ値Eiは、判定回路105,右シフト回路108およびCSA114のそれぞれに入力される。 The register value E i read from the
レジスタ104は、判定回路105,右シフト回路109およびCSA114にそれぞれ接続されている。このレジスタ104にCSA114によるEi演算の結果(carry)が格納される。すなわち、レジスタ104には、演算処理の過程でCSA114によって生成された演算途中値が格納される。The
レジスタ104から読み出されたレジスタ値Eiは、判定回路105,右シフト回路109およびCSA114のそれぞれに入力される。 The register value E i read from the
CSA114は、4入力−2出力(4 in - 2 out)の桁上げ保存加算器であり、レジスタ103,104および演算回路112,113からの各出力が入力される。
The CSA 114 is a 4-input-2 output (4 in − 2 out) carry-save adder, and each output from the
CSA114は、指数演算または対数演算に用いられる。CSA114は、Ei+1の演算を行なう。CSA114は、レジスタ103,104および演算回路112,113のそれぞれから出力された値を用いて、上記式(3)に基づきEiを算出する。CSA114 is used for exponential or logarithmic operations. The CSA 114 performs an E i + 1 operation. The CSA 114 calculates E i based on the above equation (3) using the values output from the
CSA114の出力(演算結果)のうち部分和ビットの列は、レジスタ103に入力される。一方、CSA114の出力(演算結果)のうち桁上げビットの列はレジスタ104に入力される。
A string of partial sum bits in the output (calculation result) of the CSA 114 is input to the
右シフト回路108,109は、処理対象データのビット列に対して右シフトを行なうものであり、処理対象データに対して、演算繰り返し回数iに応じた数のビットシフトを行なう。右シフト回路108は、レジスタ103のレジスタ出力ESに対して、また、右シフト回路109は、レジスタ104のレジスタ出力ECに対して、それぞれ右シフト演算を行なうことで、Ei×2^-iの演算またはEi×2^-(2i-k)の演算を実現する。The
右シフト回路108,109は、i≦kのとき Ei×2^-iの演算を行ない、i>kのときEi×2^-(2i-k)の演算を行なう。The
右シフト回路108,109は、iだけEiを右シフトすることでEi×2^-iの演算を実現し、2i-kだけEiを右シフトすることでEi×2^-(2i-k)の演算を実現する。なお、右シフト回路108,109は互いに同様の構成を有する。
図3は実施形態の一例としての演算処理回路1における右シフト回路108,109の回路構成を例示する図、図4は図3に例示した右シフト回路108,109のセレクタ1081の切り替えルールを例示する図である。
FIG. 3 is a diagram illustrating the circuit configuration of the
右シフト回路108,109は図4に例示する切り替えルールに従って各セレクタ1081による選択出力を行なうことで、i≦kの場合にEi×2^-iの演算結果の出力を行ない、i>kの場合にEi×2^-(2i-k)の演算結果の出力を実現する。 The right shift circuits 108 and 109 output the calculation result of E i × 2 ^ -i when i ≦ k by performing selection output by each
図3および図4においてはデータ幅が16bitの右シフト回路108,109を例示しており、また、k=3の場合について示すものとする。
In FIGS. 3 and 4,
D[15:0]は、シフト対象のデータを示し、R[15:0]はシフト後のデータを示す。なお、[15]は符号ビットである。また、iは繰り返し演算の回数である。 D [15: 0] indicates the data to be shifted, and R [15: 0] indicates the data after the shift. Note that [15] is a sign bit. Also, i is the number of repetitive operations.
右シフト回路108,109は、Rの各ビット(R[0]〜R[15])に対し、Dを入力とするセレクタ1081をそれぞれ備える。セレクタ1081は、図4に例示する切り替えルールを参照してiに応じた選択および出力を行なう。セレクタ1801の入力数はiのとり得る数(図4に示す例では9)である。
The
図4に例示する切り替えルールにおいて、例えばR[0]は、i≦3の場合にはシフト量がiのデータが出力データとして選択され、i≧4の場合にはシフト量が2i-kのデータが出力データとして選択されている。すなわち、右シフト回路108,109においては、閾値k(図4に示す例ではk=3)を境にシフト量が変更され、i≦3の場合にEi×2^-iの演算によりシフト量=iビットとなり、i>kの場合にEi×2^-(2i-k)の演算によりシフト量=2i-kビットとなる。In the switching rule illustrated in FIG. 4, for example, in R [0], data having a shift amount of i is selected as output data when i ≦ 3, and when i ≧ 4, the shift amount is 2i-k. The data is selected as output data. That is, in the
このように、右シフト回路108,109は、処理対象データに対して、演算繰り返し回数iに応じた数のビットシフトを行なう。入力D[15:0]がiビット右シフトしたものがR[15:0]となる。
In this way, the
演算回路110,111は、入力された値に対して、1倍(×1)演算または2倍(×2)演算を行なう。演算回路110,111は、入力された値をスルーすることで1倍(×1)演算を実現し、入力されたレジスタ値を1bit左シフトすることで2倍(×2)演算を実現する。
The
例えば、判定回路105において決定されたnが+2または-2である場合に、演算回路110,111は×2演算を行なう。一方、判定回路105において決定されたnが+1または-1である場合に、演算回路110,111は×1演算を行なう。
For example, when n determined in the
演算回路110による演算結果は演算回路112に入力され、演算回路111による演算結果は演算回路113に入力される。
The calculation result by the
演算回路112,113は、入力された値をスルー(+)または符号反転(-)して出力する。演算回路112,113には、判定回路105からの出力が入力される。演算回路112,113は、判定回路105において決定されたnの符号に応じた符号を選択して設定する。
The
制御ユニット10は本演算処理回路1における演算処理を制御する。制御ユニット10は、プログラムからの指示で動作する。
The
制御ユニット10は、命令デコーダとしての機能を備え、図示しない命令レジスタに読み込まれた命令の内容を解読し、本演算処理回路1を制御する。
The
メモリ11は、例えばRAM(Random Access Memory)である。メモリ11には、例えば、各レジスタ101〜104の初期値が格納されている。初期値は演算処理の種類(指数演算および対数演算)に応じて、それぞれ備えられている。
The
制御ユニット10は、本演算処理回路1における演算処理の開始時に、各レジスタ101〜104の初期化を行なう。制御ユニット10は本演算処理回路1において実行する演算種類に応じた初期値をメモリ11から読み出し、各レジスタ101〜104に格納することで初期化を行なってもよい。
The
また、制御ユニット10は、演算処理の結果を格納するレジスタ101〜104から演算結果を読み出し、出力させる。
Further, the
制御ユニット10は、Log Table回路106が参照するインデックスとエントリとを対応付けた情報(図2参照)を、メモリ11に格納し、適宜、Log Table回路106に提供してもよい。
The
また、制御ユニット10は、右シフト回路108,109が参照するセレクタ1081の切り替えルール(図4参照)をメモリ11に格納し、適宜、右シフト回路108,109に提供してもよい。
Further, the
また、制御ユニット10は、本演算処理回路1における演算処理の開始指示を行なってもよい。
Further, the
制御ユニット10は、本演算処理回路1における演算の繰り返し(ループ)回数を示すiを管理してもよい。制御ユニット10は、iのカウントを行ない、このiの値と予め設定された閾値(imax)とを比較することでループが終わったという判断を行なってもよい。
The
(B)動作
上述の如く構成された実施形態の一例としての演算処理回路1の処理の概要を、図5に示すフローチャート(ステップA1〜A15)に従って説明する。(B) Operation An outline of the processing of the
ステップA1において、制御ユニット10は演算種類の確認を行なう。演算種類が指数演算である場合には(ステップA1のEXPルート参照)、ステップA2に移行する。
In step A1, the
ステップA2において、例えば右シフト回路108,109は、演算の繰り返し回数iが所定の閾値k(例えば、k=3)以下であるかを確認する。
In step A2, for example, the
確認の結果、演算の繰り返し回数iが閾値k以下である場合には(ステップA2のYESルート参照)、ステップA3に移行する。ステップA3において、演算処理回路1は、1サイクルあたりに求めるビット数として規定の第1の数(第1のビット数:例えば1bit)を設定する。
As a result of the confirmation, if the number of times the operation is repeated i is equal to or less than the threshold value k (see the YES route in step A2), the process proceeds to step A3. In step A3, the
一方、演算の繰り返し回数iが閾値kよりも多い場合には(ステップA2のNOルート参照)、ステップA4に移行する。ステップA4において、演算処理回路1は、1サイクルあたりに求めるビット数として、第1の数よりも多い第2の数(第2のビット数:例えば2bit)を設定する。右シフト回路108,109が、設定されたシフト数に応じた右シフト演算を実行する。
On the other hand, when the number of repetitions i of the operation is larger than the threshold value k (see the NO route in step A2), the process proceeds to step A4. In step A4, the
ステップA5において、判定回路105は、Liに基づいてnを選択する。In step A5, the
ステップA6において、ステップA3またはステップA4において設定された第1の数または第2の数に応じたビット数で、指数演算が実行される。 In step A6, the exponential calculation is executed with the number of bits corresponding to the first number or the second number set in step A3 or step A4.
ステップA7において、制御ユニット10は指数演算が終了したかを確認する。この確認の結果、指数演算が終了していない場合には(ステップA7のNOルート参照)、ステップA8においてiの値をインクリメント(i++)した後、ステップA2に戻る。
In step A7, the
また、ステップA7における確認の結果、指数演算が終了している場合には(ステップA7のYESルート参照)、ステップA15に移行する。 If, as a result of the confirmation in step A7, the exponential calculation is completed (see the YES route in step A7), the process proceeds to step A15.
ステップA15においては、レジスタ103,104の値がEi演算の結果として出力される。In step A15, the values of
一方、ステップA1における確認の結果、演算種類が対数演算である場合には(ステップA1のLOGルート参照)、ステップA9に移行する。 On the other hand, as a result of the confirmation in step A1, if the operation type is logarithmic operation (see the LOG route in step A1), the process proceeds to step A9.
ステップS9において、制御ユニット10は、演算の繰り返し回数iが所定の閾値k(例えば、k=3)以下であるかを確認する。
In step S9, the
確認の結果、演算の繰り返し回数iが閾値k以下である場合には(ステップA9のYESルート参照)、ステップA10に移行する。ステップA10において、演算処理回路1は、1サイクルあたりに求めるビット数として規定の第1の数(第1のビット数:例えば1bit)を設定する。
As a result of the confirmation, if the number of times the operation is repeated i is equal to or less than the threshold value k (see the YES route in step A9), the process proceeds to step A10. In step A10, the
一方、演算の繰り返し回数iが閾値kよりも多い場合には(ステップA9のNOルート参照)、ステップA11に移行する。ステップA11において、演算処理回路1は、1サイクルあたりに求めるビット数として、第1の数よりも多い第2の数(第2のビット数:例えば2bit)を設定する。右シフト回路108,109が、設定されたシフト数に応じた右シフト演算を実行する。
On the other hand, when the number of repetitions i of the operation is larger than the threshold value k (see the NO route in step A9), the process proceeds to step A11. In step A11, the
ステップA12において、判定回路105は、Eiに基づいてnを選択する。In step A12, the
その後、ステップA6において、ステップA10またはステップA11において設定された第1の数または第2の数に応じたビット数で、対数演算が実行される。 Then, in step A6, the logarithmic operation is executed with the number of bits corresponding to the first number or the second number set in step A10 or step A11.
ステップA13において、制御ユニット10は対数演算が終了したかを確認する。この確認の結果、対数演算が終了していない場合には(ステップA13のNOルート参照)、ステップA14においてiの値をインクリメント(i++)した後、ステップA9に戻る。
In step A13, the
また、ステップA13における確認の結果、対数演算が終了している場合には(ステップA13のYESルート参照)、ステップA15に移行する。 If, as a result of the confirmation in step A13, the logarithmic calculation is completed (see the YES route in step A13), the process proceeds to step A15.
ステップA15においては、レジスタ101,102の値がLi演算の結果として出力される。In step A15, the values of
次に、実施形態の一例としての演算処理回路1における演算処理を、図6に示すフローチャート(ステップB1〜B23)に従って説明する。
Next, the arithmetic processing in the
演算処理の開始に際して、xが入力される。ステップB1において、制御ユニット10は演算種類の確認を行なう。演算種類が指数演算である場合には(ステップB1のEXPルート参照)、ステップB2に移行する。
At the start of the arithmetic processing, x is input. In step B1, the
ステップB2において、レジスタ101〜104の初期化が行なわれる。レジスタの初期化は、例えば、制御ユニット10によって行なわれる。例えば、レジスタ101〜104に対して、L1=x,E1=1となるように初期化が行なわれる。なお、LS + LC = L1であり、例えば、LSとLCとのいずれか一方にxを設定し、他方に0を設定する。同様に、ES + EC =E1であり、ESとECとのいずれか一方に1を設定し、他方に0を設定する。In step B2, registers 101 to 104 are initialized. The initialization of the register is performed by, for example, the
ステップB3において、処理対象の指数演算においてiが予め規定された最大値(imax)に到達するまで、ステップB11までの制御を繰り返し実施するループ処理を開始する。 In step B3, a loop process is started in which the control up to step B11 is repeatedly executed until i reaches a predetermined maximum value (imax) in the exponential calculation to be processed.
ステップB4において、例えば右シフト回路108,109は、演算の繰り返し回数iが所定の閾値k(例えば、k=3)以下であるかを確認する。
In step B4, for example, the
確認の結果、演算の繰り返し回数iが閾値k以下である場合には(ステップB4のYESルート参照)、ステップB5において、A=iが設定される。一方、演算の繰り返し回数iが閾値kよりも多い場合には(ステップB4のNOルート参照)、ステップB6において、A=2i-kが設定される。 As a result of the confirmation, when the number of repetitions i of the operation is equal to or less than the threshold value k (see the YES route in step B4), A = i is set in step B5. On the other hand, when the number of repetitions i of the operation is larger than the threshold value k (see the NO route in step B4), A = 2i-k is set in step B6.
その後、ステップB7において、判定回路105は、Liと0との大小関係および差分を判定し、Liが0に一番近づくnの値を選択する。After that, in step B7, the
ステップB8において、Log Table回路106は、iと判定回路105によって選択されたnとに対応するlog(1+n*2^-A)の値を出力する。
In step B8, the
ステップB9において、CSA107が、Log Table回路106から取得したlog(1+n*2^-A)を用いて、上記式(3)に基づきLi演算を行なう。すなわち、CSA107は、Li+1 = Li- log(1 + n × 2^-A)を算出する。In step B9, CSA107, using the
また、ステップB10において、右シフト回路108,109,演算回路110〜113およびCSA114が、指数演算におけるEi演算(上記式(3)参照)を実現する。すなわち、CSA114等は、Ei+1 = Ei + Ei × n × 2^-A を算出する。Further, in step B10, the
その後、制御がステップB11に進む。ステップB11では、ステップB3に対応するループ端処理が実施される。ここで、iがimaxに到達すると(i = imax)、ステップB12に移行する。 After that, the control proceeds to step B11. In step B11, the loop end processing corresponding to step B3 is performed. Here, when i reaches imax (i = imax), the process proceeds to step B12.
ステップB12において、Eiは後段の処理部(例えば、他の演算回路等)に出力され、処理を終了する。In step B12, E i is output to a processing unit (for example, another arithmetic circuit or the like) in the subsequent stage, and processing ends.
ステップB1における演算種類の確認の結果、演算種類が対数演算である場合には(ステップB1のLOGルート参照)、ステップB13に移行する。 As a result of checking the operation type in step B1, if the operation type is a logarithmic operation (see the LOG route in step B1), the process proceeds to step B13.
ステップB13において、レジスタ101〜104の初期化が行なわれる。レジスタの初期化は、例えば、制御ユニット10によって行なわれる。例えば、レジスタ101〜104に対して、L1=0,E1=xとなるように初期化が行なわれる。なお、LS + LC = L1であり、例えば、LSとLCとのそれぞれに0を設定する。同様に、ES + EC =E1であり、ESとECとのいずれか一方にxを設定し、他方に0を設定する。In step B13, registers 101 to 104 are initialized. The initialization of the register is performed by, for example, the
ステップB14において、処理対象の指数演算においてiが予め規定された最大値(imax)に到達するまで、ステップB22までの制御を繰り返し実施するループ処理を開始する。 In step B14, a loop process is started in which the control up to step B22 is repeatedly executed until i reaches a predetermined maximum value (imax) in the exponential calculation to be processed.
ステップB15において、例えば右シフト回路108,109は、演算の繰り返し回数iが所定の閾値k(例えば、k=3)以下であるかを確認する。
In step B15, for example, the
確認の結果、演算の繰り返し回数iが閾値k以下である場合には(ステップB15のYESルート参照)、ステップB16において、A=iが設定される。一方、演算の繰り返し回数iが閾値kよりも多い場合には(ステップB15のNOルート参照)、ステップB17において、A=2i-kが設定される。 As a result of the confirmation, when the number of repetitions i of the operation is equal to or less than the threshold value k (see the YES route in step B15), A = i is set in step B16. On the other hand, when the number of repetitions i of the operation is larger than the threshold value k (see the NO route in step B15), A = 2i-k is set in step B17.
その後、ステップB18において、判定回路105は、Eiと1との大小関係および差分を判定し、Eiが0に一番近づくnの値を選択する。After that, in step B18, the
ステップB19において、Log Table回路106は、iと判定回路105によって選択されたnとに対応するlog(1+n*2^-A)の値を出力する。
In step B19, the
ステップB20において、CSA107が、Log Table回路106から取得したlog(1+n*2^-A)を用いて、上記式(3)に基づきLi演算を行なう。すなわち、CSA107は、Li+1 = Li- log(1 + n × 2^-A)を算出する。In step B20, CSA107, using the
また、ステップB21において、右シフト回路108,109,演算回路110〜113およびCSA114が、指数演算におけるEi演算(上記式(3)参照)を実現する。すなわち、CSA114等は、Ei+1 = Ei + Ei × n × 2^-A を算出する。Further, in step B21, the
その後、制御がステップB22に進む。ステップB22では、ステップB14に対応するループ端処理が実施される。ここで、iがimaxに到達すると(i = imax)、ステップB23に移行する。 After that, the control proceeds to step B22. In step B22, the loop end processing corresponding to step B14 is performed. Here, when i reaches imax (i = imax), the process proceeds to step B23.
ステップB23において、Liは後段の処理部(例えば、他の演算回路等)に出力され、処理を終了する。In step B23, L i is output to the subsequent processing unit (for example, other arithmetic circuits, etc.), the process ends.
(C)効果
このように、実施形態の一例としての演算処理回路1によれば、演算の繰り返し回数iが閾値k以下の時点において、1サイクル当たりに求めるビット数を少なくするとともに、演算の繰り返し回数iが閾値kよりも多い時点において、1サイクル当たりに求めるビット数を多くする。これにより、指数演算のEiをexp(x)に、対数演算のLiをlog(x)にそれぞれ収束させることができる。(C) Effect As described above, according to the
また、図9に示した従来の演算処理回路と比べて、1st_nテーブル回路等を備える必要がなく、回路規模を削減することができる。これにより、クリティカルパスの論理段数を減らし、ディレイを小さくすることができる。 Further, as compared with the conventional arithmetic processing circuit shown in FIG. 9, it is not necessary to provide a 1st_n table circuit or the like, and the circuit scale can be reduced. As a result, the number of logical stages of the critical path can be reduced and the delay can be reduced.
すなわち、回路規模を大きくすることなく指数演算または対数演算において解に収束できるのである。 That is, it is possible to converge on a solution in exponential or logarithmic operations without increasing the circuit scale.
(D)その他
図7は上述した実施形態の一例としての演算処理回路1を、例えば、ディープラーニング等の用途のプロセッサに実装する構成例を示す図である。(D) Others FIG. 7 is a diagram showing a configuration example in which the
ディープラーニング等を用途とするプロセッサは、図7に例示するように、複数の演算器を備え、並列演算を行なう。 As illustrated in FIG. 7, a processor for deep learning or the like is provided with a plurality of arithmetic units and performs parallel arithmetic.
各演算器は、それぞれ指数演算および対数演算を行なうEXP/LOG演算器を備え、図7に示すように、プロセッサに備えられるEXP/LOG演算器として本演算処理回路1を用いてもよい。
Each arithmetic unit includes an EXP / LOG arithmetic unit that performs exponential calculation and logarithmic calculation, and as shown in FIG. 7, the
図7に例示するプロセッサは、命令ユニットと、複数のレジスタファイル#1〜#mと、複数の実行ユニット#1〜#mを備える。
The processor illustrated in FIG. 7 includes an instruction unit, a plurality of
各実行ユニットは複数(n個)の演算器#1〜#nを備え、これらの演算器に演算処理回路1が備えられる。
Each execution unit includes a plurality of (n)
この図7に例示するプロセッサシステムは、全体に対する演算器の占有率が大きいものであるが、このような各演算器に本演算処理回路1を適用することで、演算器の回路規模削減の効果を奏することができる。
The processor system illustrated in FIG. 7 has a large occupancy rate of the arithmetic unit with respect to the whole. By applying the
そして、本発明は上述した実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲で種々変形して実施することができる。 The present invention is not limited to the above-described embodiment, and can be modified in various ways without departing from the spirit of the present invention.
また、上述した開示により本実施形態を当業者によって実施・製造することが可能である。 Further, according to the above-mentioned disclosure, it is possible for a person skilled in the art to carry out and manufacture the present embodiment.
1 演算処理回路
10 制御ユニット
11 メモリ
12 プロセッサ
101〜104 レジスタ
105 判定回路
107,114 CSA
106 Log Table回路
108,109 右シフト回路
110〜113 演算回路
1081 セレクタ1
106
Claims (8)
前記演算回路による演算繰り返し回数が閾値以下の場合に、1サイクル当たりに前記演算回路が求めるビット数を第1数に設定し、前記演算繰り返し回数が前記閾値よりも多い場合に、1サイクル当たりに前記演算回路が求めるビット数を、前記第1数よりも多い第2数に設定する設定部と
を備えること特徴とする、演算処理装置。An arithmetic circuit that performs exponential or logarithmic operations,
When the number of arithmetic repetitions by the arithmetic circuit is equal to or less than the threshold value, the number of bits required by the arithmetic circuit per cycle is set to the first number, and when the number of arithmetic repetitions is greater than the threshold value, per cycle. An arithmetic processing apparatus including a setting unit for setting the number of bits required by the arithmetic circuit to a second number larger than the first number.
前記右シフト回路が、前記処理対象データに対して、前記演算繰り返し回数に応じた数のビットシフトを行なう
ことを特徴とする、請求項1に記載の演算処理装置。The setting unit is a right shift circuit that shifts the bit string of the data to be processed to the right.
The arithmetic processing unit according to claim 1, wherein the right shift circuit performs a number of bit shifts on the data to be processed according to the number of times the arithmetic is repeated.
演算繰り返し回数(i)が閾値以下の場合に、Li+1 = Li - log(1 + n × 2^-i)を演算し、
前記演算繰り返し回数(i)が前記閾値よりも多い場合に、Li+1 = Li- log(1 + n × 2^-(2i-k))を演算する
ことを特徴とする、請求項1または2記載の演算処理装置。The calculation circuit is an exponential calculation circuit that performs exponential calculation.
When the number of operation repetitions (i) is less than or equal to the threshold value, L i + 1 = L i --log (1 + n × 2 ^ -i) is calculated.
A claim, characterized in that L i + 1 = L i --log (1 + n × 2 ^-(2i-k)) is calculated when the number of repetitions (i) of the calculation is larger than the threshold value. The arithmetic processing unit according to 1 or 2.
演算繰り返し回数(i)が閾値以下の場合に、Ei+1 = Ei + Ei× n × 2^-iを演算し、
前記演算繰り返し回数(i)が前記閾値よりも多い場合に、Ei+1 = Ei+ Ei × n × 2^-(2i-k)を演算する
ことを特徴とする、請求項1〜3のいずれか1項に記載の演算処理装置。The arithmetic circuit is an exponential arithmetic circuit that performs logarithmic arithmetic.
When the number of operation repetitions (i) is less than or equal to the threshold value, E i + 1 = E i + E i × n × 2 ^ -i is calculated.
Claims 1 to 3, characterized in that E i + 1 = E i + Ei × n × 2 ^-(2i-k) is calculated when the number of repetitions (i) of the calculation is larger than the threshold value. The arithmetic processing unit according to any one of the above items.
前記演算回路による演算繰り返し回数を確認する処理と、
前記演算回路による前記演算繰り返し回数が閾値以下の場合に、1サイクル当たりに前記演算回路が求めるビット数を第1数に設定し、前記演算繰り返し回数が前記閾値よりも多い場合に、1サイクル当たりに前記演算回路が求めるビット数を、前記第1数よりも多い第2数に設定する処理
とを備えること特徴とする、演算処理装置の制御方法。In an arithmetic processing unit including an arithmetic circuit that performs exponential calculation or logarithmic calculation,
The process of confirming the number of arithmetic repetitions by the arithmetic circuit and
When the number of arithmetic repetitions by the arithmetic circuit is equal to or less than the threshold value, the number of bits required by the arithmetic circuit per cycle is set to the first number, and when the number of arithmetic repetitions is greater than the threshold value, the number of bits per cycle is set. A method for controlling an arithmetic processing apparatus, which comprises a process of setting the number of bits required by the arithmetic circuit to a second number larger than the first number.
ことを特徴とする、請求項5に記載の演算処理装置の制御方法。The fifth aspect of claim 5, wherein the right shift circuit that shifts the bit string of the data to be processed to the right performs a number of bit shifts to the data to be processed according to the number of repetitions of the calculation. A control method for arithmetic processing units.
演算繰り返し回数(i)が閾値以下の場合に、Li+1 = Li - log(1 + n × 2^-i)を演算し、
前記演算繰り返し回数(i)が前記閾値よりも多い場合に、Li+1 = Li- log(1 + n × 2^-(2i-k))を演算する
ことを特徴とする、請求項5または6記載の演算処理装置の制御方法。The calculation circuit is an exponential calculation circuit that performs exponential calculation.
When the number of operation repetitions (i) is less than or equal to the threshold value, L i + 1 = L i --log (1 + n × 2 ^ -i) is calculated.
A claim, characterized in that L i + 1 = L i --log (1 + n × 2 ^-(2i-k)) is calculated when the number of repetitions (i) of the calculation is larger than the threshold value. 5. The method for controlling an arithmetic processing unit according to 5 or 6.
演算繰り返し回数(i)が閾値以下の場合に、Ei+1 = Ei + Ei× n × 2^-iを演算し、
前記演算繰り返し回数(i)が前記閾値よりも多いの場合に、Ei+1 = Ei+ Ei × n × 2^-(2i-k)を演算する
ことを特徴とする、請求項5〜7のいずれか1項に記載の演算処理装置の制御方法。The arithmetic circuit is an exponential arithmetic circuit that performs logarithmic arithmetic.
When the number of operation repetitions (i) is less than or equal to the threshold value, E i + 1 = E i + E i × n × 2 ^ -i is calculated.
In the case of the calculation repetition count (i) is greater than the threshold, E i + 1 = E i + Ei × n × 2 ^ - characterized by calculating the (2i-k), according to claim 5 7. The method for controlling an arithmetic processing unit according to any one of 7.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP2018/040476 WO2020090025A1 (en) | 2018-10-31 | 2018-10-31 | Arithmetic processing unit and control method of arithmetic processing unit |
Publications (2)
Publication Number | Publication Date |
---|---|
JPWO2020090025A1 true JPWO2020090025A1 (en) | 2021-09-24 |
JP7006808B2 JP7006808B2 (en) | 2022-01-24 |
Family
ID=70462894
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2020554661A Active JP7006808B2 (en) | 2018-10-31 | 2018-10-31 | Arithmetic processing unit and control method of arithmetic processing unit |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP7006808B2 (en) |
WO (1) | WO2020090025A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113721886B (en) * | 2020-05-25 | 2024-08-27 | 瑞昱半导体股份有限公司 | Operation method of logarithmic calculation circuit and logarithmic calculation circuit |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH02118725A (en) * | 1988-10-28 | 1990-05-07 | Nec Corp | Logarithmic function arithmetic unit |
JPH0934693A (en) * | 1995-07-21 | 1997-02-07 | Nec Corp | Exponent logarithm conversion circuit |
JP2009276990A (en) * | 2008-05-14 | 2009-11-26 | Sharp Corp | Computing device, its calculation method, signal processing device, computing device control program, and recording medium in which program is recorded |
-
2018
- 2018-10-31 JP JP2020554661A patent/JP7006808B2/en active Active
- 2018-10-31 WO PCT/JP2018/040476 patent/WO2020090025A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH02118725A (en) * | 1988-10-28 | 1990-05-07 | Nec Corp | Logarithmic function arithmetic unit |
JPH0934693A (en) * | 1995-07-21 | 1997-02-07 | Nec Corp | Exponent logarithm conversion circuit |
JP2009276990A (en) * | 2008-05-14 | 2009-11-26 | Sharp Corp | Computing device, its calculation method, signal processing device, computing device control program, and recording medium in which program is recorded |
Also Published As
Publication number | Publication date |
---|---|
WO2020090025A1 (en) | 2020-05-07 |
JP7006808B2 (en) | 2022-01-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2018124681A (en) | Arithmetic processing device, information processing device, method, and program | |
JP2005250481A (en) | Extended montgomery modular multiplier supporting multiple precision | |
JP7096828B2 (en) | Devices and methods for processing input operand values | |
TW201702863A (en) | Apparatus and method for controlling rounding when performing a floating point operation | |
KR20190024701A (en) | Concurrent multi-bit adder | |
CN107038014B (en) | Rounding an inverse square root result | |
KR20050089067A (en) | Device and method for calculating a multiplication involving a shifting of the multiplicand | |
JP7006808B2 (en) | Arithmetic processing unit and control method of arithmetic processing unit | |
JP6877812B2 (en) | Duplicate propagation operation | |
JP2004519017A (en) | Method and apparatus for multiplying coefficients | |
TWI235328B (en) | Logic network and methods of computing | |
JPH0317132B2 (en) | ||
US20150178045A1 (en) | Partially and Fully Parallel Normaliser | |
CN115079997A (en) | Method for efficient unbiased rounding of logarithm execution hardware | |
US20040210613A1 (en) | Method and apparatus for modular multiplication | |
JP2003084969A (en) | Floating point remainder computing element, information processing device, and computer program | |
JP7120320B2 (en) | Arithmetic processing device and method of controlling arithmetic processing device | |
CN116149600B (en) | Method, device, equipment and medium for setting logic circuit of multi-constant multiplier | |
JP7120885B2 (en) | Semiconductor device and division method | |
JP7131627B2 (en) | Arithmetic processing unit | |
US20240201951A1 (en) | Systems and methods for shift last multiplication and accumulation (mac) process | |
KR101753162B1 (en) | Method for calculating of leading zero, apparatus thereof | |
JP6984762B2 (en) | Arithmetic processing unit and control method of arithmetic processing unit | |
JPH10333883A (en) | Multiplying method and circuit therefor | |
JP2021111016A (en) | Arithmetic processing device, control method of arithmetic processing device and arithmetic processing program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210311 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20210311 |
|
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: 20211207 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20211220 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 7006808 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |