JPWO2020090025A1 - Arithmetic processing unit and control method of arithmetic processing unit - Google Patents

Arithmetic processing unit and control method of arithmetic processing unit Download PDF

Info

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
Application number
JP2020554661A
Other languages
Japanese (ja)
Other versions
JP7006808B2 (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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Publication of JPWO2020090025A1 publication Critical patent/JPWO2020090025A1/en
Application granted granted Critical
Publication of JP7006808B2 publication Critical patent/JP7006808B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods 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/544Methods 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/556Logarithmic 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 arithmetic processing circuit 500.
The arithmetic processing circuit 500 shown in FIG. 8 includes registers 501 to 504, a determination circuit 505, a CSA (Carry-Save Adder) 506, 507, a Log Table circuit 508, and a right shift circuit (RSFT) 509. It includes 510 and arithmetic circuits 511 to 514.

演算処理回路500は指数(EXP)演算および対数(LOG)演算を行なう演算回路である。例えば、演算1回で商2bitを求めるradix-4のSTL(Sequential Table Lookup)法を用いる。 The arithmetic processing circuit 500 is an arithmetic circuit that performs exponential (EXP) arithmetic and logarithmic (LOG) arithmetic. For example, the STL (Sequential Table Lookup) method of radix-4, which obtains a quotient of 2 bits in one operation, is used.

演算処理回路500は、指数演算において、xを入力とし、exp(x)を求める。
Lはべき数の空間の変数であり、Eは指数の空間の変数である。また、iは演算の繰り返し回数である。
The arithmetic processing circuit 500 takes x as an input and obtains exp (x) in the exponential arithmetic.
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 registers 501, 502, 503, 504 may be referred to as LS, LC, ES, and EC, respectively. Further, the registers 501, 502, 503, 504 may be referred to as registers LS, LC, ES, and EC, respectively.

演算処理回路500においては、初期値をL1 = x,E1 = exp(0) = 1となるよう、レジスタ501〜504の初期化が行なわれる。In the arithmetic processing circuit 500, the registers 501 to 504 are initialized so that the initial values are L 1 = x and E 1 = exp (0) = 1.

なお、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 arithmetic processing circuit 500, while satisfying x = log (E i) + L i, that closer to 0 gradually the L i by repeating an operation, E i approaches exp (x) (L i = x → 0, E i = exp (0) → exp (x)).

すなわち、処理対象の指数演算において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 arithmetic processing circuit 500 takes x as an input and obtains log (x) in logarithmic arithmetic.
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 arithmetic processing circuit 500, Log Table circuits 508 and CSA506 is, to achieve a L i operations in exponentiation or logarithmic operation. Further, the right shift circuits 509, 510, arithmetic circuits 511 to 514 and CSA507 realize E i arithmetic in exponential calculation or logarithmic calculation.

指数演算を行なう場合、判定回路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 decision circuit 505, based on the L i, selects n. The determination circuit 505 determines the magnitude relationship and difference between L i and 0, and selects the value of n where L i is closest to 0. On the other hand, when performing logarithmic calculation, the determination circuit 505 selects n based on E i. The determination circuit 505 determines the magnitude relationship and difference between E i and 1, and selects the value of n where E i is closest to 1. The selected n is output to the Log Table circuit 508.

Log Table回路508には、予め変数i, nに対応するlog(1+n*2^-2i)の値が設定されており、iと判定回路505から入力されるnとに応じたlog(1+n*2^-2i)の値をCSA506に出力する。 In the Log Table circuit 508, the value of log (1 + n * 2 ^ -2i) corresponding to the variables i and n is set in advance, and the log (1 + n * 2 ^ -2i) corresponding to i and n input from the determination circuit 505 is set. The value of 1 + n * 2 ^ -2i) is output to CSA506.

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 register 502.

また、右シフト回路509,510,演算回路511〜514およびCSA507が、指数演算におけるEi演算(上記式(2)参照)を実現する。Further, the right shift circuits 509, 510, arithmetic circuits 511 to 514 and CSA507 realize E i arithmetic (see the above equation (2)) in exponential arithmetic.

右シフト回路509,510は、レジスタ503,504から読み出された値ES,ECに対して2iビットの右シフト演算を行なうことで2^-2i倍算を実現する。これにより、上記式(2)の2^-2iの演算が実現される。なお、その後、演算回路511〜514によりEi×n×2^-2iの演算が実現される。The right shift circuits 509 and 510 realize 2 ^ -2i multiplication by performing a 2i bit right shift operation on the values ES and EC read from the registers 503 and 504. As a result, the operation of 2 ^ -2i in the above equation (2) is realized. After that, the calculation of E i × n × 2 ^ -2i is realized by the calculation circuits 511 to 514.

演算回路511,512は、右シフト回路509,510から出力された値に対して、1倍(×1)演算または2倍(×2)演算を行なう。例えば、判定回路505において決定されたnが+2または-2である場合に、演算回路511,512は×2演算を行なう。一方、判定回路505において決定されたnが+1または-1である場合に、演算回路511,512は×1演算を行なう。 The arithmetic circuits 511 and 512 perform 1x (x1) arithmetic or 2x (x2) arithmetic on the values output from the right shift circuits 509 and 510. For example, when n determined in the determination circuit 505 is +2 or -2, the arithmetic circuits 511 and 512 perform x2 arithmetic. On the other hand, when n determined in the determination circuit 505 is +1 or -1, the arithmetic circuits 511 and 512 perform × 1 arithmetic.

演算回路513,514は、演算回路511,512から出力された値をスルー(+)または符号反転(-)して出力する。例えば、判定回路505において決定されたnが+2,+1,0のいずれかである場合に、演算回路513,514はスルー出力する。一方、判定回路505において決定されたnが-2または-1である場合に、演算回路513,514は符号反転して出力する。 The arithmetic circuits 513 and 514 output the values output from the arithmetic circuits 511 and 512 as through (+) or sign inversion (-). For example, when n determined in the determination circuit 505 is any of +2, +1, and 0, the arithmetic circuits 513 and 514 output through. On the other hand, when n determined in the determination circuit 505 is -2 or -1, the arithmetic circuits 513 and 514 are code-inverted and output.

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 register 504.

演算処理回路500においては、指数演算の結果としてレジスタ503,504の値Eiを出力し、対数演算の結果としてレジスタ501,502の値Liを出力する。 The arithmetic processing circuit 500 outputs the value E i of the registers 503 and 504 as a result of the exponential operation, and outputs the value L i of the registers 501 and 502 as the result of the logarithmic operation.

しかしながら、このような従来の演算処理回路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 arithmetic processing circuit 500, when performing an exponential operation, when L i is far from 0, E i does not sufficiently approach exp (x) in one operation, and as a result, the operation is performed. E i may not converge to exp (x) even if is repeated. Similarly, when performing logarithmic operations, when E i is far from 1, Li i does not approach log (x) sufficiently in one operation, and as a result, even if the operation is repeated, L i is log (x). May not converge to. This is because it is assumed that E i or L i is in a range close to the solution to some extent, but when the number of repetitions (i) is small, it may be out of that range.

すなわち、演算を繰り返しても指数演算の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 arithmetic processing circuit 600 for solving the problem caused by the arithmetic processing circuit 500 as described above.

この図9に示す演算処理回路600においては、図8に示した演算処理回路500の判定回路505に代えて判定回路601,1st_nテーブル回路602およびセレクタ603を備える。また、演算処理回路500の演算回路511,512に代えて演算回路604,605を備えるとともに、Log Table回路508に代えてLog Table回路606を備える。その他の部分は図8の演算処理回路500と同様に構成されている。 The arithmetic processing circuit 600 shown in FIG. 9 includes a determination circuit 601, 1st_n table circuit 602 and a selector 603 in place of the determination circuit 505 of the arithmetic processing circuit 500 shown in FIG. Further, the arithmetic circuits 604 and 605 are provided in place of the arithmetic circuits 511 and 512 of the arithmetic processing circuit 500, and the Log Table circuit 606 is provided in place of the Log Table circuit 508. Other parts are configured in the same manner as the arithmetic processing circuit 500 of FIG.

なお、図中、既述の符号と同一の符号は同様の部分を示しているので、その説明は省略する。 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 arithmetic processing circuit 600 shown in FIG. 9, the selection logic of n is changed only for the first arithmetic (i = 1).

1st_nテーブル回路602および判定回路601の各出力がセレクタ603に入力される。 Each output of the 1st_n table circuit 602 and the determination circuit 601 is input to the selector 603.

1st_nテーブル回路602は、演算1回目(i=1)においてのみ参照される参照テーブル(lookup table)である。演算1回目(i=1)だけ、L1もしくはE1(つまり入力x)をインデックスとして1st_nテーブル回路602が参照され、セレクタ603は1st_n テーブル回路602の出力を選択して出力する。The 1st_n table circuit 602 is a lookup table that is referred to only in the first operation (i = 1). Only in the first operation (i = 1), the 1st_n table circuit 602 is referred to with L 1 or E 1 (that is, the input x) as an index, and the selector 603 selects and outputs the output of the 1st_n table circuit 602.

なお、演算2回目以降は、セレクタ603は判定回路601の出力を選択して出力する。また、判定回路601においては、図8に示した判定回路505に比べてnの選択肢に±3が追加されている。すなわち、判定回路601は、選択肢nとして、-3,-2,-1,0,+1,+2,+3を有する。 From the second calculation onward, the selector 603 selects and outputs the output of the determination circuit 601. Further, in the determination circuit 601, ± 3 is added to the options of n as compared with the determination circuit 505 shown in FIG. That is, the determination circuit 601 has -3, -2, -1, 0, +1, +2, +3 as options n.

セレクタ603の出力は、演算回路513,514,604,605およびLog Table回路606に入力される。 The output of the selector 603 is input to the arithmetic circuits 513, 514, 604, 605 and the Log Table circuit 606.

Log Table回路606においては、Log Table回路508に比べて、エントリにn=-3,+3に対応する値を追加して備える。 Compared to the Log Table circuit 508, the Log Table circuit 606 is provided with additional values corresponding to n = -3 and +3 to the entry.

演算回路604,605は、それぞれ、×1 or ×2 or ×3回路であり、判定回路601から出力されるnに応じて、スルー(×1)または、左シフト(×2)または×3乗算のいずれかを行なう。 The arithmetic circuits 604 and 605 are × 1 or × 2 or × 3 circuits, respectively, and are through (× 1), left shift (× 2), or × 3 multiplication according to n output from the determination circuit 601. Do one of the above.

特開平8−123785号公報Japanese Unexamined Patent Publication No. 8-123785 特開平2−170285号公報Japanese Unexamined Patent Publication No. 2-170285

しかしながら、このような図9に示す従来の演算処理回路600においては、1st_nテーブル回路602やセレクタ603,演算回路604,605を備えることで、回路規模が大きくなる。これにより、クリティカルパスの論理段数が多くなり、ディレイが大きくなるという課題がある。 However, in the conventional arithmetic processing circuit 600 shown in FIG. 9, the circuit scale is increased by providing the 1st_n table circuit 602 and the selectors 603 and the arithmetic circuits 604 and 605. As a result, there is a problem that the number of logical stages of the critical path increases and the delay increases.

本発明は、このような課題に鑑み創案されたもので、回路規模を大きくすることなく指数演算または対数演算において解に収束できるようにすることを目的とする。 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.

実施形態の一例としての演算処理回路の構成を例示する図である。It is a figure which illustrates the structure of the arithmetic processing circuit as an example of an embodiment. 実施形態の一例としての演算処理回路におけるLog Table回路のインデックスとエントリとの関係を例示する図である。It is a figure which illustrates the relationship between the index and the entry of the Log Table circuit in the arithmetic processing circuit as an example of an embodiment. 実施形態の一例としての演算処理回路における右シフト回路の回路構成を例示する図である。It is a figure which illustrates the circuit structure of the right shift circuit in the arithmetic processing circuit as an example of an embodiment. 図3に例示した右シフト回路のセレクタの切り替えルールを例示する図である。It is a figure which illustrates the switching rule of the selector of the right shift circuit illustrated in FIG. 実施形態の一例としての演算処理回路の処理の概要を説明するためのフローチャートである。It is a flowchart for demonstrating the outline of processing of the arithmetic processing circuit as an example of Embodiment. 実施形態の一例としての演算処理回路における演算処理を説明するためのフローチャートである。It is a flowchart for demonstrating the arithmetic processing in the arithmetic processing circuit as an example of Embodiment. 実施形態の一例としての演算処理回路をプロセッサに実装する構成例を示す図である。It is a figure which shows the configuration example which implements the arithmetic processing circuit as an example of Embodiment in a processor. 従来の演算処理回路の構成を示す図である。It is a figure which shows the structure of the conventional arithmetic processing circuit. 従来の演算処理回路の構成を示す図である。It is a figure which shows the structure of the conventional arithmetic processing circuit.

以下、図面を参照して本演算処理装置および演算処理装置の制御方法に係る実施の形態を説明する。ただし、以下に示す実施形態はあくまでも例示に過ぎず、実施形態で明示しない種々の変形例や技術の適用を排除する意図はない。すなわち、本実施形態を、その趣旨を逸脱しない範囲で種々変形して実施することができる。また、各図は、図中に示す構成要素のみを備えるという趣旨ではなく、他の機能等を含むことができる。 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 arithmetic processing circuit 1 as an example of an embodiment.

演算処理回路(演算器)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 arithmetic processing circuit 1 shown in FIG. 1 is an arithmetic processing circuit that realizes two types of operations, an exponential (EXP) operation and a logarithmic (LOG) operation. That is, the arithmetic processing circuit 1 selectively realizes either exponential arithmetic or logarithmic arithmetic.

[指数演算]
指数演算においては、例えば、演算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 quotient 2 bits in one calculation may be used.
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 arithmetic processing circuit 1 shown in FIG. 1 includes registers 101-104, determination circuits 105, CSA107, 114, Log Table circuit 106, right shift circuits (RSFT2) 108, 109, and arithmetic circuits 110-113.

以下、レジスタ101をレジスタLSと表す場合がある。同様に、レジスタ102をレジスタLCと表す場合があり、レジスタ103をレジスタESと表す場合があり、レジスタ104をレジスタECと表す場合がある。 Hereinafter, the register 101 may be referred to as a register LS. Similarly, the register 102 may be referred to as a register LC, the register 103 may be referred to as a register ES, and the register 104 may be referred to as a register EC.

レジスタ101は、判定回路105およびCSA107にそれぞれ接続されている。レジスタ101には、後述するCSA107によるLi演算の結果(sum)が格納される。すなわち、レジスタ101には、演算処理の過程でCSA107によって生成された演算途中値が格納される。 The register 101 is connected to the determination circuit 105 and the CSA 107, respectively. The register 101 stores the result (sum) of the Li operation by CSA107, which will be described later. That is, the register 101 stores the calculation intermediate value generated by the CSA 107 in the process of calculation processing.

また、レジスタ101から読み出されたレジスタ値Liは、判定回路105およびCSA107のそれぞれに入力される。The register value L i read from the register 101 is inputted into the decision circuit 105 and CSA107.

レジスタ102は、判定回路105およびCSA107にそれぞれ接続されている。レジスタ102にCSA107によるLi演算の結果(carry)が格納される。すなわち、レジスタ102には、演算処理の過程でCSA107によって生成された演算途中値が格納される。The register 102 is connected to the determination circuit 105 and the CSA 107, respectively. Register 102 to the L i calculation by CSA107 result (carry) is stored. That is, the register 102 stores the calculation intermediate value generated by the CSA 107 in the process of calculation processing.

レジスタ102から読み出されたレジスタ値Liは判定回路105およびCSA107のそれぞれに入力される。Register value L i read from the register 102 are input to the respective decision circuits 105 and CSA107.

Log Table回路106およびCSA107が、指数演算または対数演算におけるLi演算を実現する。右シフト回路108,109,演算回路110〜113およびCSA114が、指数演算または対数演算におけるEi演算を実現する。Log Table circuits 106 and CSA107 is, to achieve a L i operations in exponentiation or logarithmic operation. The right shift circuits 108, 109, arithmetic circuits 110-113 and CSA 114 realize E i arithmetic in exponential or logarithmic arithmetic.

ここで、本演算処理回路1においては、繰り返し回数(i)が少ない時点、すなわちiが閾値k以下の時点では1サイクルあたりに求めるビット数(第1数)を少なくする(例えば、1回)。そして、繰り返し回数(i)が閾値kよりも大きくなった以降は1サイクルあたりに求めるビット数(第2数)を増やす(例えば、2回以上)。第2数は第1数よりも多くする。 Here, in the present arithmetic processing circuit 1, when the number of repetitions (i) is small, that is, when i is equal to or less than the threshold value k, the number of bits (first number) obtained per cycle is reduced (for example, once). .. Then, after the number of repetitions (i) becomes larger than the threshold value k, the number of bits (second number) obtained per cycle is increased (for example, twice or more). The second number is larger than the first number.

具体的には、例えば、Liの算出(Li演算)およびEiの算出(Ei演算)には、以下の式(3)を用いる。

Figure 2020090025
Specifically, for example, the calculation of L i (L i calculation) and the calculation of E i (E i calculation), using the following equation (3).
Figure 2020090025

なお、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 decision circuit 105, based on the L i, selects n. The determination circuit 105 determines the magnitude relationship and difference between L i and 0, and selects the value of n where L i is closest to 0. When performing logarithmic calculation, the determination circuit 105 selects n based on E i. The determination circuit 105 determines the magnitude relationship and difference between E i and 1, and selects the value of n where E i is closest to 1.

判定回路105によって決定されたnの値は、演算回路110〜113およびLog Table回路106に入力される。 The value of n determined by the determination circuit 105 is input to the arithmetic circuits 110 to 113 and the Log Table circuit 106.

Log Table回路106は、log(1+n*2^-A)の値を出力する。ここで、i≦kのとき A=iであり、i>kのときA=2i-kである。 The Log Table circuit 106 outputs the value of log (1 + n * 2 ^ -A). Here, A = i when i ≤ k, and A = 2i-k when i> k.

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 circuit 106, and corresponds to i and n input from the determination circuit 105. Output the value of log (1 + n * 2 ^ -A).

すなわち、Log Table回路106は、インデックスとしてiおよびnを有し、エントリとしてlog(1+n×2^-i)やlog(1+n×2^-(2i-k))の各値を有する。 That is, the Log Table circuit 106 has i and n as indexes, and each value of log (1 + n × 2 ^ -i) or log (1 + n × 2 ^-(2i-k)) as an entry. Have.

図2は実施形態の一例としての演算処理回路1におけるLog Table回路106のインデックスとエントリとの関係を例示する図である。 FIG. 2 is a diagram illustrating the relationship between the index and the entry of the Log Table circuit 106 in the arithmetic processing circuit 1 as an example of the embodiment.

この図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 circuit 106 outputs the value of the entry corresponding to the input i and n to the CSA 107.

なお、Log Table回路106は、図2に例示するようなインデックスとエントリとを対応付けた情報を図示しない記憶装置に格納し、iおよびnが入力された場合に、この情報を、入力されたi,nをインデックスとして参照して、対応するエントリの値を取得し、出力してもよい。 The Log Table circuit 106 stores information in which an index and an entry are associated with each other as illustrated in FIG. 2 in a storage device (not shown), and when i and n are input, this information is input. You may refer to i and n as indexes to get the value of the corresponding entry and output it.

また、Log Table回路106は、図2に例示するような情報を制御ユニット10等から取得してもよい。 Further, the Log Table circuit 106 may acquire information as illustrated in FIG. 2 from the control unit 10 or the like.

CSA107は、3入力−2出力(3 in - 2 out)の桁上げ保存加算器であり、レジスタ101,102およびLog Table回路106から各出力が入力される。また、このCSA107の出力(演算結果)のうち、部分和ビットの列はレジスタ101に入力される。一方、CSA107の出力(演算結果)のうち、桁上げビットの列はレジスタ102に入力される。 The CSA 107 is a 3-input-2 output (3 in − 2 out) carry-save adder, and each output is input from the registers 101 and 102 and the Log Table circuit 106. Further, in the output (calculation result) of the CSA 107, a string of partial sum bits is input to the register 101. On the other hand, in the output (calculation result) of CSA107, the carry bit string is input to the register 102.

CSA107は、Li+1の演算(Li演算)を行なう。CSA107は、Log Table回路106から出力されたlog(1+n*2^-A)の値を用いて、上記式(3)に基づきLiを算出する。The CSA 107 performs an operation of L i + 1 (L i operation). CSA107, using the value of Log output from Table circuit 106 the log (1 + n * 2 ^ -A), and calculates the L i based on the equation (3).

レジスタ103は、判定回路105,右シフト回路108およびCSA114にそれぞれ接続されており、このレジスタ103に後述するCSA114によるEi演算の結果(sum)が格納される。すなわち、レジスタ103には、演算処理の過程でCSA114によって生成された演算途中値が格納される。The register 103 is connected to the determination circuit 105, the right shift circuit 108, and the CSA 114, respectively, and the result (sum) of the E i operation by the CSA 114, which will be described later, is stored in the register 103. That is, the register 103 stores the calculation intermediate value generated by the CSA 114 in the process of calculation processing.

レジスタ103から読み出されたレジスタ値Eiは、判定回路105,右シフト回路108およびCSA114のそれぞれに入力される。 The register value E i read from the register 103 is input to the determination circuit 105, the right shift circuit 108, and the CSA 114, respectively.

レジスタ104は、判定回路105,右シフト回路109およびCSA114にそれぞれ接続されている。このレジスタ104にCSA114によるEi演算の結果(carry)が格納される。すなわち、レジスタ104には、演算処理の過程でCSA114によって生成された演算途中値が格納される。The register 104 is connected to the determination circuit 105, the right shift circuit 109, and the CSA 114, respectively. The result (carry) of the E i operation by the CSA 114 is stored in this register 104. That is, the register 104 stores the calculation intermediate value generated by the CSA 114 in the process of calculation processing.

レジスタ104から読み出されたレジスタ値Eiは、判定回路105,右シフト回路109およびCSA114のそれぞれに入力される。 The register value E i read from the register 104 is input to each of the determination circuit 105, the right shift circuit 109, and the CSA 114.

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 registers 103 and 104 and the arithmetic circuits 112 and 113 is input.

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 registers 103 and 104 and the arithmetic circuits 112 and 113, respectively.

CSA114の出力(演算結果)のうち部分和ビットの列は、レジスタ103に入力される。一方、CSA114の出力(演算結果)のうち桁上げビットの列はレジスタ104に入力される。 A string of partial sum bits in the output (calculation result) of the CSA 114 is input to the register 103. On the other hand, a string of carry bits in the output (calculation result) of CSA 114 is input to the register 104.

右シフト回路108,109は、処理対象データのビット列に対して右シフトを行なうものであり、処理対象データに対して、演算繰り返し回数iに応じた数のビットシフトを行なう。右シフト回路108は、レジスタ103のレジスタ出力ESに対して、また、右シフト回路109は、レジスタ104のレジスタ出力ECに対して、それぞれ右シフト演算を行なうことで、Ei×2^-iの演算またはEi×2^-(2i-k)の演算を実現する。The right shift circuits 108 and 109 perform a right shift on the bit string of the processing target data, and perform a number of bit shifts on the processing target data according to the number of operation repetitions i. The right shift circuit 108 performs a right shift operation on the register output ES of the register 103, and the right shift circuit 109 performs a right shift operation on the register output EC of the register 104, so that E i × 2 ^ -i Or E i × 2 ^-(2i-k).

右シフト回路108,109は、i≦kのとき Ei×2^-iの演算を行ない、i>kのときEi×2^-(2i-k)の演算を行なう。The right shift circuits 108 and 109 perform an operation of E i × 2 ^ -i when i ≦ k, and perform an operation of E i × 2 ^-(2i-k) when i> k.

右シフト回路108,109は、iだけEiを右シフトすることでEi×2^-iの演算を実現し、2i-kだけEiを右シフトすることでEi×2^-(2i-k)の演算を実現する。なお、右シフト回路108,109は互いに同様の構成を有する。Right shift circuit 108 and 109, i only achieves calculation of E i × 2 ^ -i by right shifting the E i, 2i-k only E by right shifting the E i i × 2 ^ - ( 2 Realize the operation of i-k). The right shift circuits 108 and 109 have the same configuration as each other.

図3は実施形態の一例としての演算処理回路1における右シフト回路108,109の回路構成を例示する図、図4は図3に例示した右シフト回路108,109のセレクタ1081の切り替えルールを例示する図である。 FIG. 3 is a diagram illustrating the circuit configuration of the right shift circuits 108 and 109 in the arithmetic processing circuit 1 as an example of the embodiment, and FIG. 4 is an example of a switching rule of the selector 1081 of the right shift circuits 108 and 109 illustrated in FIG. It is a figure to do.

右シフト回路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 selector 1081 according to the switching rule illustrated in FIG. 4, and i> k. In the case of, the output of the operation result of E i × 2 ^-(2i-k) is realized.

図3および図4においてはデータ幅が16bitの右シフト回路108,109を例示しており、また、k=3の場合について示すものとする。 In FIGS. 3 and 4, right shift circuits 108 and 109 having a data width of 16 bits are illustrated, and the case where k = 3 is shown.

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 right shift circuits 108 and 109 include selectors 1081 for inputting D for each bit of R (R [0] to R [15]). The selector 1081 selects and outputs according to i with reference to the switching rule illustrated in FIG. The number of inputs of the selector 1801 is the number that i can take (9 in the example shown in FIG. 4).

図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 right shift circuits 108 and 109, the shift amount is changed at the threshold value k (k = 3 in the example shown in FIG. 4), and when i ≦ 3, the shift is performed by the operation of E i × 2 ^ -i. Quantity = i bits, and when i> k, the shift amount = 2i-k bits by the operation of E i × 2 ^-(2i-k).

このように、右シフト回路108,109は、処理対象データに対して、演算繰り返し回数iに応じた数のビットシフトを行なう。入力D[15:0]がiビット右シフトしたものがR[15:0]となる。 In this way, the right shift circuits 108 and 109 perform a number of bit shifts on the data to be processed according to the number of operation repetitions i. The input D [15: 0] shifted to the right by the i bit becomes R [15: 0].

演算回路110,111は、入力された値に対して、1倍(×1)演算または2倍(×2)演算を行なう。演算回路110,111は、入力された値をスルーすることで1倍(×1)演算を実現し、入力されたレジスタ値を1bit左シフトすることで2倍(×2)演算を実現する。 The arithmetic circuits 110 and 111 perform a 1-fold (x1) operation or a 2-fold (x2) operation on the input value. The arithmetic circuits 110 and 111 realize a 1x (x1) operation by passing through the input value, and a 2x (x2) operation by shifting the input register value to the left by 1 bit.

例えば、判定回路105において決定されたnが+2または-2である場合に、演算回路110,111は×2演算を行なう。一方、判定回路105において決定されたnが+1または-1である場合に、演算回路110,111は×1演算を行なう。 For example, when n determined in the determination circuit 105 is +2 or -2, the arithmetic circuits 110 and 111 perform × 2 arithmetic. On the other hand, when n determined by the determination circuit 105 is +1 or -1, the arithmetic circuits 110 and 111 perform × 1 arithmetic.

演算回路110による演算結果は演算回路112に入力され、演算回路111による演算結果は演算回路113に入力される。 The calculation result by the calculation circuit 110 is input to the calculation circuit 112, and the calculation result by the calculation circuit 111 is input to the calculation circuit 113.

演算回路112,113は、入力された値をスルー(+)または符号反転(-)して出力する。演算回路112,113には、判定回路105からの出力が入力される。演算回路112,113は、判定回路105において決定されたnの符号に応じた符号を選択して設定する。 The arithmetic circuits 112 and 113 output the input value through (+) or sign inversion (-). The output from the determination circuit 105 is input to the arithmetic circuits 112 and 113. The arithmetic circuits 112 and 113 select and set a code corresponding to the code of n determined in the determination circuit 105.

制御ユニット10は本演算処理回路1における演算処理を制御する。制御ユニット10は、プログラムからの指示で動作する。 The control unit 10 controls the arithmetic processing in the arithmetic processing circuit 1. The control unit 10 operates according to an instruction from the program.

制御ユニット10は、命令デコーダとしての機能を備え、図示しない命令レジスタに読み込まれた命令の内容を解読し、本演算処理回路1を制御する。 The control unit 10 has a function as an instruction decoder, decodes the contents of an instruction read in an instruction register (not shown), and controls the arithmetic processing circuit 1.

メモリ11は、例えばRAM(Random Access Memory)である。メモリ11には、例えば、各レジスタ101〜104の初期値が格納されている。初期値は演算処理の種類(指数演算および対数演算)に応じて、それぞれ備えられている。 The memory 11 is, for example, a RAM (Random Access Memory). The memory 11 stores, for example, the initial values of the registers 101 to 104. Initial values are provided according to the type of arithmetic processing (exponential arithmetic and logarithmic arithmetic).

制御ユニット10は、本演算処理回路1における演算処理の開始時に、各レジスタ101〜104の初期化を行なう。制御ユニット10は本演算処理回路1において実行する演算種類に応じた初期値をメモリ11から読み出し、各レジスタ101〜104に格納することで初期化を行なってもよい。 The control unit 10 initializes the registers 101 to 104 at the start of the arithmetic processing in the arithmetic processing circuit 1. The control unit 10 may perform initialization by reading an initial value corresponding to the operation type executed in the operation processing circuit 1 from the memory 11 and storing it in each of the registers 101 to 104.

また、制御ユニット10は、演算処理の結果を格納するレジスタ101〜104から演算結果を読み出し、出力させる。 Further, the control unit 10 reads the calculation result from the registers 101 to 104 that store the result of the calculation process and outputs the result.

制御ユニット10は、Log Table回路106が参照するインデックスとエントリとを対応付けた情報(図2参照)を、メモリ11に格納し、適宜、Log Table回路106に提供してもよい。 The control unit 10 may store the information (see FIG. 2) in which the index and the entry referred to by the Log Table circuit 106 are associated with each other in the memory 11 and appropriately provide the information to the Log Table circuit 106.

また、制御ユニット10は、右シフト回路108,109が参照するセレクタ1081の切り替えルール(図4参照)をメモリ11に格納し、適宜、右シフト回路108,109に提供してもよい。 Further, the control unit 10 may store the switching rule (see FIG. 4) of the selector 1081 referred to by the right shift circuits 108 and 109 in the memory 11 and provide the right shift circuits 108 and 109 as appropriate.

また、制御ユニット10は、本演算処理回路1における演算処理の開始指示を行なってもよい。 Further, the control unit 10 may give an instruction to start arithmetic processing in the arithmetic processing circuit 1.

制御ユニット10は、本演算処理回路1における演算の繰り返し(ループ)回数を示すiを管理してもよい。制御ユニット10は、iのカウントを行ない、このiの値と予め設定された閾値(imax)とを比較することでループが終わったという判断を行なってもよい。 The control unit 10 may manage i indicating the number of repetitions (loops) of the calculation in the calculation processing circuit 1. The control unit 10 may count i and compare the value of i with a preset threshold value (imax) to determine that the loop has ended.

(B)動作
上述の如く構成された実施形態の一例としての演算処理回路1の処理の概要を、図5に示すフローチャート(ステップA1〜A15)に従って説明する。
(B) Operation An outline of the processing of the arithmetic processing circuit 1 as an example of the embodiment configured as described above will be described with reference to the flowcharts (steps A1 to A15) shown in FIG.

ステップA1において、制御ユニット10は演算種類の確認を行なう。演算種類が指数演算である場合には(ステップA1のEXPルート参照)、ステップA2に移行する。 In step A1, the control unit 10 confirms the calculation type. If the operation type is exponential operation (see the EXP route in step A1), the process proceeds to step A2.

ステップA2において、例えば右シフト回路108,109は、演算の繰り返し回数iが所定の閾値k(例えば、k=3)以下であるかを確認する。 In step A2, for example, the right shift circuits 108 and 109 confirm whether the number of repetitions i of the operation is equal to or less than a predetermined threshold value k (for example, k = 3).

確認の結果、演算の繰り返し回数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 arithmetic processing circuit 1 sets a specified first number (first number of bits: for example, 1 bit) as the number of bits to be obtained per cycle.

一方、演算の繰り返し回数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 arithmetic processing circuit 1 sets a second number (second number of bits: for example, 2 bits) that is larger than the first number as the number of bits to be obtained per cycle. The right shift circuits 108 and 109 execute the right shift operation according to the set number of shifts.

ステップA5において、判定回路105は、Liに基づいてnを選択する。In step A5, the decision circuit 105 selects the n based on L i.

ステップ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 control unit 10 confirms whether the exponential calculation is completed. As a result of this confirmation, if the exponential calculation is not completed (see the NO route in step A7), the value of i is incremented (i ++) in step A8, and then the process returns to step A2.

また、ステップ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 registers 103 and 104 are output as the result of the E i operation.

一方、ステップ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 control unit 10 confirms whether the number of times the operation is repeated i is equal to or less than a predetermined threshold value k (for example, k = 3).

確認の結果、演算の繰り返し回数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 arithmetic processing circuit 1 sets a specified first number (first number of bits: for example, 1 bit) as the number of bits to be obtained per cycle.

一方、演算の繰り返し回数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 arithmetic processing circuit 1 sets a second number (second number of bits: for example, 2 bits) that is larger than the first number as the number of bits to be obtained per cycle. The right shift circuits 108 and 109 execute the right shift operation according to the set number of shifts.

ステップA12において、判定回路105は、Eiに基づいてnを選択する。In step A12, the determination circuit 105 selects n based on E i.

その後、ステップ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 control unit 10 confirms whether the logarithmic calculation is completed. As a result of this confirmation, if the logarithmic calculation is not completed (see the NO route in step A13), the value of i is incremented (i ++) in step A14, and then the process returns to step A9.

また、ステップ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 registers 101 and 102 are output as the result of the Li operation.

次に、実施形態の一例としての演算処理回路1における演算処理を、図6に示すフローチャート(ステップB1〜B23)に従って説明する。 Next, the arithmetic processing in the arithmetic processing circuit 1 as an example of the embodiment will be described according to the flowcharts (steps B1 to B23) shown in FIG.

演算処理の開始に際して、xが入力される。ステップB1において、制御ユニット10は演算種類の確認を行なう。演算種類が指数演算である場合には(ステップB1のEXPルート参照)、ステップB2に移行する。 At the start of the arithmetic processing, x is input. In step B1, the control unit 10 confirms the calculation type. If the operation type is exponential operation (see the EXP route in step B1), the process proceeds to step B2.

ステップ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 control unit 10. For example, the registers 101 to 104 are initialized so that L 1 = x and E 1 = 1. 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.

ステップ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 right shift circuits 108 and 109 confirm whether the number of repetitions i of the operation is equal to or less than a predetermined threshold value k (for example, k = 3).

確認の結果、演算の繰り返し回数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 determination circuit 105 determines the magnitude relationship and difference between L i and 0, and selects the value of n where L i is closest to 0.

ステップB8において、Log Table回路106は、iと判定回路105によって選択されたnとに対応するlog(1+n*2^-A)の値を出力する。 In step B8, the Log Table circuit 106 outputs the value of log (1 + n * 2 ^ -A) corresponding to i and n selected by the determination circuit 105.

ステップ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 Log Table circuit 106 obtained from the log (1 + n * 2 ^ -A), performs L i calculated based on the equation (3). That is, CSA107 calculates L i + 1 = L i --log (1 + n × 2 ^ -A).

また、ステップB10において、右シフト回路108,109,演算回路110〜113およびCSA114が、指数演算におけるEi演算(上記式(3)参照)を実現する。すなわち、CSA114等は、Ei+1 = Ei + Ei × n × 2^-A を算出する。Further, in step B10, the right shift circuits 108 and 109, the arithmetic circuits 110 to 113 and the CSA 114 realize the E i arithmetic in the exponential arithmetic (see the above equation (3)). That is, CSA114 and the like calculate E i + 1 = E i + E i × n × 2 ^ -A.

その後、制御がステップ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 control unit 10. For example, the registers 101 to 104 are initialized so that L 1 = 0 and E 1 = x. Note that LS + LC = L 1 , for example, set 0 for each of LS and LC. Similarly, ES + EC = E 1 , and one of ES and EC is set to x and the other is set to 0.

ステップ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 right shift circuits 108 and 109 confirm whether the number of repetitions i of the operation is equal to or less than a predetermined threshold value k (for example, k = 3).

確認の結果、演算の繰り返し回数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 determination circuit 105 determines the magnitude relationship and difference between E i and 1, and selects the value of n where E i is closest to 0.

ステップB19において、Log Table回路106は、iと判定回路105によって選択されたnとに対応するlog(1+n*2^-A)の値を出力する。 In step B19, the Log Table circuit 106 outputs the value of log (1 + n * 2 ^ -A) corresponding to i and n selected by the determination circuit 105.

ステップ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 Log Table circuit 106 obtained from the log (1 + n * 2 ^ -A), performs L i calculated based on the equation (3). That is, CSA107 calculates L i + 1 = L i --log (1 + n × 2 ^ -A).

また、ステップB21において、右シフト回路108,109,演算回路110〜113およびCSA114が、指数演算におけるEi演算(上記式(3)参照)を実現する。すなわち、CSA114等は、Ei+1 = Ei + Ei × n × 2^-A を算出する。Further, in step B21, the right shift circuits 108 and 109, the arithmetic circuits 110 to 113 and the CSA 114 realize the E i arithmetic (see the above equation (3)) in the exponential arithmetic. That is, CSA114 and the like calculate E i + 1 = E i + E i × n × 2 ^ -A.

その後、制御がステップ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 arithmetic processing circuit 1 as an example of the embodiment, when the number of repetitions i of the arithmetic i is equal to or less than the threshold value k, the number of bits required per cycle is reduced and the arithmetic is repeated. When the number of times i is larger than the threshold value k, the number of bits to be obtained per cycle is increased. As a result, the exponential operation E i can be converged to exp (x), and the logarithmic operation L i can be converged to log (x).

また、図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 arithmetic processing circuit 1 as an example of the above-described embodiment is mounted on a processor for, for example, deep learning.

ディープラーニング等を用途とするプロセッサは、図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 arithmetic processing circuit 1 may be used as the EXP / LOG arithmetic unit provided in the processor.

図7に例示するプロセッサは、命令ユニットと、複数のレジスタファイル#1〜#mと、複数の実行ユニット#1〜#mを備える。 The processor illustrated in FIG. 7 includes an instruction unit, a plurality of register files # 1 to # m, and a plurality of execution units # 1 to # m.

各実行ユニットは複数(n個)の演算器#1〜#nを備え、これらの演算器に演算処理回路1が備えられる。 Each execution unit includes a plurality of (n) arithmetic units # 1 to # n, and these arithmetic units are provided with an arithmetic processing circuit 1.

この図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 arithmetic processing circuit 1 to each such arithmetic unit, the effect of reducing the circuit scale of the arithmetic unit is obtained. Can be played.

そして、本発明は上述した実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲で種々変形して実施することができる。 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 Arithmetic processing circuit 10 Control unit 11 Memory 12 Processor 101-104 Register 105 Judgment circuit 107, 114 CSA
106 Log Table circuit 108, 109 Right shift circuit 110-113 Arithmetic circuit 1081 Selector

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.
JP2020554661A 2018-10-31 2018-10-31 Arithmetic processing unit and control method of arithmetic processing unit Active JP7006808B2 (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (3)

* Cited by examiner, † Cited by third party
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