JPH07281870A - Unit and method for shift arithmetic - Google Patents

Unit and method for shift arithmetic

Info

Publication number
JPH07281870A
JPH07281870A JP2027395A JP2027395A JPH07281870A JP H07281870 A JPH07281870 A JP H07281870A JP 2027395 A JP2027395 A JP 2027395A JP 2027395 A JP2027395 A JP 2027395A JP H07281870 A JPH07281870 A JP H07281870A
Authority
JP
Japan
Prior art keywords
data
shift
bit data
output
bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2027395A
Other languages
Japanese (ja)
Inventor
Shinichi Marui
信一 丸井
Katsuhiko Ueda
勝彦 上田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2027395A priority Critical patent/JPH07281870A/en
Publication of JPH07281870A publication Critical patent/JPH07281870A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To efficiently perform the shift arithmetic of multiple-precision data. CONSTITUTION:The shift arithmetic unit is equipped with a shifter 20 which outputs high-order digit bit data (B), intermediate-order digit bit data (D), and low-order digit bit data (C) by shifting data according to a shift number, a multiplexer 30 which is coupled with the output of the shifter 20 and selects one of the high-order digit bit data (B) and low-order digit bit data (C) according to the shift direction, a register 40 which is coupled with the output of the multiplexer 30 and stores the data selected by the multiplexer 30, a computing element 60 which is coupled with the output of the shifter 20 and the output of the register 40 and outputs its arithmetic result by processing the intermediate-order digit bit data (D) and the data stored in the register 40, and a register group 8 which is coupled with the output of the computing element 60 and stores the arithmetic result.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、シフト演算装置及びシ
フト演算方法に関し、特に、単精度のデータを処理する
ハードウェアを用いて、多倍精度のシフト演算を実行す
るシフト演算装置及びシフト演算方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a shift arithmetic unit and a shift arithmetic method, and more particularly, to a shift arithmetic unit and a shift arithmetic unit for executing a multiple precision shift arithmetic using hardware for processing single precision data. Regarding the method.

【0002】[0002]

【従来の技術】近年のディジタル技術の急速な発展に伴
って、ディジタル信号処理などの高度な処理を高速に実
行するプロセッサが求められている。これらの処理の中
には、高い演算精度を必要とするものもある。例えば、
CELP(Code Excited LinearPrediction)系の音声コ
ーディックにおける短期予測分析処理は、36ビット程
度の演算精度を必要とするとされている。CELP系の
音声コーディックは、ディジタル音声通信には不可欠と
される音声コーディックの1つである。しかし、高い演
算精度をハードウェアで実現することは得策ではない。
プロセッサの回路規模が大きくなり、コストや消費電力
の面で不利な点が多いからである。そこで、単精度のデ
ータを処理するハードウェアを用いて、複数の命令を組
み合わせることにより倍精度演算を実行する手法が開発
されている。倍精度演算には、倍精度加算、倍精度減
算、倍精度シフト演算などがある。
2. Description of the Related Art With the rapid development of digital technology in recent years, there has been a demand for a processor capable of executing sophisticated processing such as digital signal processing at high speed. Some of these processes require high calculation accuracy. For example,
It is said that short-term predictive analysis processing in a CELP (Code Excited Linear Prediction) type speech codec requires a calculation accuracy of about 36 bits. The CELP-based voice codec is one of the voice codecs essential for digital voice communication. However, it is not a good idea to realize high calculation accuracy with hardware.
This is because the circuit scale of the processor becomes large and there are many disadvantages in terms of cost and power consumption. Therefore, there has been developed a method of executing a double-precision operation by combining a plurality of instructions using hardware that processes single-precision data. Double-precision arithmetic includes double-precision addition, double-precision subtraction, and double-precision shift arithmetic.

【0003】図9は、24ビットデータを処理するハー
ドウェアを用いて倍精度シフト演算を実行する従来のシ
フト演算装置の構成を示す。このシフト演算装置は、シ
フト数を格納するレジスタ110、111と、レジスタ
110又は111に格納されたシフト数に応じて24ビ
ットデータ(A)をシフトするシフタ120と、24ビ
ットデータ(E)とシフタ120から出力される24ビ
ットデータ(D)とに対して演算を行う演算器(AL
U)160と、ALU160の演算結果を格納する24
ビットレジスタ170、171、172とを有してい
る。
FIG. 9 shows the configuration of a conventional shift operation device for executing a double precision shift operation using hardware for processing 24-bit data. This shift operation device includes registers 110 and 111 that store the number of shifts, a shifter 120 that shifts 24-bit data (A) according to the number of shifts stored in the register 110 or 111, and 24-bit data (E). An arithmetic unit (AL that performs arithmetic on the 24-bit data (D) output from the shifter 120)
U) 160 and stores the calculation result of the ALU 160 24
It has bit registers 170, 171, and 172.

【0004】以下、上述した構成を有するシフト演算装
置を用いて、倍精度データを左にNビットだけシフトす
る方法を説明する。ここで、倍精度データは、上位の2
4ビットデータと下位の24ビットデータとからなり、
Nは1以上の整数である。シフトされるべき倍精度デー
タのうち上位データはレジスタ170に格納されてお
り、シフトされるべき倍精度データのうち下位データは
レジスタ171に格納されていると仮定する。また、倍
精度シフト演算の結果のうち上位データはレジスタ17
0に格納され、倍精度シフト演算の結果のうち下位デー
タはレジスタ172に格納されると仮定する。
A method of shifting double-precision data to the left by N bits by using the shift arithmetic unit having the above-mentioned structure will be described below. Here, the double-precision data is the upper 2
It consists of 4-bit data and lower 24-bit data,
N is an integer of 1 or more. It is assumed that the upper data of the double-precision data to be shifted is stored in the register 170, and the lower data of the double-precision data to be shifted is stored in the register 171. In addition, the upper data of the result of the double precision shift operation is the
It is assumed that the lower-order data stored in 0 and the double-precision shift operation result is stored in the register 172.

【0005】左Nビットの倍精度シフト演算の処理は、
以下の手順に従って実行される。図10は、その手順を
模式的に示したものである。
The processing of the left N-bit double-precision shift operation is
It is executed according to the following procedure. FIG. 10 schematically shows the procedure.

【0006】[1]レジスタ110にシフト数「N」が
格納される。
[1] The shift number “N” is stored in the register 110.

【0007】[2]レジスタ171に格納される下位デ
ータは、データ(A)としてシフタ120に入力され
る。シフタ120は、下位データを左にNビットだけシ
フトする。ALU160は、シフタ120の出力(デー
タ(D))をそのまま出力する(スルー出力)。ALU
160の出力は、下位データとしてレジスタ172に格
納される。
[2] The lower data stored in the register 171 is input to the shifter 120 as data (A). The shifter 120 shifts the lower data to the left by N bits. The ALU 160 outputs the output (data (D)) of the shifter 120 as it is (through output). ALU
The output of 160 is stored in the register 172 as lower data.

【0008】[3]レジスタ111にシフト数「−(2
4−N)」が格納される。
[3] The shift number "-(2
4-N) "is stored.

【0009】[4]レジスタ171に格納される下位デ
ータは、データ(A)としてシフタ120に入力され
る。シフタ120は、下位データを右に(24−N)ビ
ットだけシフトする。ALU160は、シフタ120の
出力(データ(D))をそのまま出力する(スルー出
力)。ALU160の出力は、レジスタ171に格納さ
れる。
[4] The lower data stored in the register 171 is input to the shifter 120 as data (A). The shifter 120 shifts the lower data to the right by (24-N) bits. The ALU 160 outputs the output (data (D)) of the shifter 120 as it is (through output). The output of the ALU 160 is stored in the register 171.

【0010】[5]レジスタ170に格納される上位デ
ータは、データ(A)としてシフタ120に入力され
る。シフタ120は、上位データを左にNビットだけシ
フトする。レジスタ171に格納されるデータはデータ
(E)としてALU160に入力される。ALU160
は、シフタ120の出力(データ(D))とデータ
(E)とに対して論理和演算を実行する。ALU160
の出力は、上位データとしてレジスタ170に格納され
る。
[5] The upper data stored in the register 170 is input to the shifter 120 as data (A). The shifter 120 shifts the upper data to the left by N bits. The data stored in the register 171 is input to the ALU 160 as data (E). ALU160
Performs an OR operation on the output (data (D)) of the shifter 120 and the data (E). ALU160
Is stored in the register 170 as upper data.

【0011】[0011]

【発明が解決しようとする課題】しかしながら、従来の
左Nビットの倍精度シフト演算は、シフト数の設定を除
いて、3回のシフト操作を必要とする。その結果、倍精
度シフト演算は、シフト数の設定を含めると更に多くの
演算を必要とする。これに対し、他の倍精度演算(倍精
度加算、倍精度減算など)はおよそ2回の演算で足り
る。従って、一般に、倍精度シフト演算は、他の倍精度
演算に比べて非常に効率が悪いと言う問題点を有してい
た。
However, the conventional left N-bit double-precision shift operation requires three shift operations except for the setting of the shift number. As a result, the double precision shift operation requires more operations including the setting of the shift number. On the other hand, other double-precision operations (double-precision addition, double-precision subtraction, etc.) need only be performed twice. Therefore, in general, the double-precision shift operation has a problem that it is extremely inefficient as compared with other double-precision operations.

【0012】LD−CELP(Low-Delay CELP)は、CE
LP系の音声コーディックの1つである。LD−CEL
Pは、ディレイが小さいという特性を有しており、主と
して有線系(ISDNなど)のコーディックとして注目
されている。LD−CELPにおいては、短期予測分析
処理の比重が他のコーディックに比べて非常に大きい。
このため、LD−CELPにおいては、約50万回/秒
の倍精度シフト演算が実行される。これは、VSELP
(Vector Sum Excited Linear Prediction)、PSI−S
ELP(Pitch Synchronous Innovation CELP)などの携
帯用ディジタル電話の音声コーディックにおいて実行さ
れる倍精度シフト演算の回数の約25倍にあたる。従っ
て、LD−CELPの実現にあたっては、倍精度シフト
演算の効率化を図ることが必須である。
LD-CELP (Low-Delay CELP) is CE
It is one of the LP-based voice codecs. LD-CEL
P has a characteristic that the delay is small, and has been attracting attention mainly as a corded codec (ISDN or the like). In LD-CELP, the weight of short-term predictive analysis processing is much higher than that of other codecs.
Therefore, in the LD-CELP, a double precision shift operation of about 500,000 times / second is executed. This is VSELP
(Vector Sum Excited Linear Prediction), PSI-S
This is about 25 times the number of double-precision shift operations executed in the voice codec of a portable digital telephone such as an ELP (Pitch Synchronous Innovation CELP). Therefore, in order to realize LD-CELP, it is essential to improve the efficiency of double-precision shift calculation.

【0013】本発明の目的は、多倍精度データのシフト
演算を効率よく行なうことができるシフト演算装置及び
シフト演算方法を提供することにある。
An object of the present invention is to provide a shift operation device and a shift operation method which can efficiently perform a shift operation of multiple precision data.

【0014】[0014]

【課題を解決するための手段】本発明のシフト演算装置
は、シフト数に応じてデータをシフトすることにより、
上位ビットデータと中位ビットデータと下位ビットデー
タとを出力するシフト手段と、該シフト手段の出力に結
合され、シフト方向に応じて該上位ビットデータと該下
位ビットデータのうちの一方を選択する第1選択手段
と、該第1選択手段の出力に結合され、該第1選択手段
によって選択されたデータを格納する第1格納手段と、
該シフト手段の出力と該第1格納手段の出力とに結合さ
れ、該中位ビットデータと該第1格納手段に格納された
該データとに演算することにより、演算結果を出力する
演算手段と、該演算手段の出力に結合され、該演算結果
を格納する第2格納手段とを備えており、これにより、
上記目的が達成される。
The shift arithmetic unit of the present invention shifts data according to the number of shifts,
Shifting means for outputting upper bit data, middle order bit data and lower bit data, and output of the shift means, and selects one of the upper bit data and the lower bit data according to a shift direction. First selecting means and first storing means coupled to the output of the first selecting means for storing data selected by the first selecting means;
Arithmetic means coupled to the output of the shift means and the output of the first storage means, and operating on the middle-order bit data and the data stored in the first storage means to output an operation result; , Second storage means coupled to the output of the arithmetic means for storing the arithmetic result, whereby
The above object is achieved.

【0015】前記シフト演算装置は、更なるデータを受
け取り、制御信号に応じて該更なるデータと前記第1格
納手段に格納された前記データとのうちの一方を選択す
る第2選択手段をさらに備えていてもよく、該第2選択
手段の出力が前記演算手段に入力されるようにしてもよ
い。
The shift operation device further includes second selecting means for receiving further data and selecting one of the further data and the data stored in the first storing means in response to a control signal. It may be provided, and the output of the second selecting means may be input to the calculating means.

【0016】前記シフト手段は、m個の2kビットシフ
タ(k=0,1,...,m−1)と、2mビットシフ
タと、前記シフト数をデコードすることにより、該m個
の2kビットシフタ(k=0,1,...,m−1)及
び該2mビットシフタのそれぞれにシフト動作を行うか
否かを示す制御信号を供給するデコード手段とを備えて
いてもよい。ここで、mは1以上の整数である。
The shift means decodes the m 2 k- bit shifters (k = 0, 1, ..., M-1), the 2 m- bit shifters, and the m shifts to decode the m 2 k- bit shifters. A k- bit shifter (k = 0, 1, ..., M-1) and a decoding unit that supplies a control signal indicating whether or not the shift operation is performed to the 2 m- bit shifter may be provided. Here, m is an integer of 1 or more.

【0017】前記2m-1ビットシフタの出力の一部は、
前記第1選択手段の出力に等しくてもよい。
A part of the output of the 2 m-1 bit shifter is
It may be equal to the output of the first selecting means.

【0018】前記第2格納手段は、前記演算結果の部分
をそれぞれ格納する複数のレジスタを含んでいてもよ
い。
The second storage means may include a plurality of registers for respectively storing the operation result portions.

【0019】前記第2格納手段は、前記データの部分を
それぞれ格納する複数のレジスタと、前記演算結果の部
分をそれぞれ格納する複数のレジスタとを含んでいても
よい。
The second storage means may include a plurality of registers for respectively storing the data portions and a plurality of registers for respectively storing the operation result portions.

【0020】本発明のシフト演算方法は、第1データと
第2データとを用いて、倍精度のシフト演算を行うシフ
ト演算方法であって、a)シフト数に応じて該第1デー
タをシフトすることにより、上位ビットデータと中位ビ
ットデータと下位ビットデータとを出力するステップ
と、b)ステップa)において出力された該中位ビット
データを該シフト演算の結果の部分として格納するステ
ップと、c)シフト方向に応じてステップa)において
出力された該上位ビットデータと該下位ビットデータの
うちの一方を選択するステップと、d)ステップc)に
おいて選択されたデータを格納するステップと、e)該
シフト数に応じて該第2データをシフトすることによ
り、上位ビットデータと中位ビットデータと下位ビット
データとを出力するステップと、f)ステップe)にお
いて出力された該中位ビットデータとステップd)にお
いて格納された該データとを結合するステップと、g)
ステップf)において結合された該データを該シフト演
算の結果の部分として格納するステップとを包含してお
り、これにより、上記目的が達成される。
The shift operation method of the present invention is a shift operation method for performing double-precision shift operation using the first data and the second data, and a) shifts the first data according to the number of shifts. To output the high-order bit data, the middle-order bit data, and the low-order bit data, and b) storing the middle-order bit data output in step a) as a part of the result of the shift operation. , C) selecting one of the upper bit data and the lower bit data output in step a) according to the shift direction, and d) storing the data selected in step c), e) Shifting the second data according to the shift number to output upper bit data, middle bit data, and lower bit data. And-up, and coupling the said data stored in step d) and middle order bit data output in f) step e), g)
Storing the combined data in step f) as part of the result of the shift operation, whereby the above objective is achieved.

【0021】ステップf)における結合は、ステップ
e)において出力された前記中位ビットデータとステッ
プd)において格納された前記データとに対して論理和
演算を実行することによって達成されてもよい。
The combining in step f) may be accomplished by performing an OR operation on the middle bit data output in step e) and the data stored in step d).

【0022】ステップa)〜ステップd)は、プログラ
ムの実行における1ステップにおいて実行され、ステッ
プe)〜ステップg)は、該プログラムの実行における
1ステップにおいて実行される。
Steps a) to d) are executed in one step in the execution of the program, and steps e) to g) are executed in one step in the execution of the program.

【0023】本発明の他のシフト演算方法は、第1デー
タと少なくとも1つの第2データと第3データとを用い
て、多倍精度のシフト演算を行うシフト演算方法であっ
て、a)シフト数に応じて該第1データをシフトするこ
とにより、上位ビットデータと中位ビットデータと下位
ビットデータとを出力するステップと、b)ステップ
a)において出力された該中位ビットデータを該シフト
演算の結果の部分として格納するステップと、c)シフ
ト方向に応じてステップa)において出力された該上位
ビットデータと該下位ビットデータのうちの一方を選択
するステップと、d)ステップc)において選択された
データを格納するステップと、e)該シフト数に応じて
該少なくとも1つの第2データのうちの1つをシフトす
ることにより、上位ビットデータと中位ビットデータと
下位ビットデータとを出力するステップと、f)該シフ
ト方向に応じてステップe)において出力された該上位
ビットデータと該下位ビットデータのうちの一方を選択
するステップと、g)ステップf)において選択された
データを格納するステップと、h)ステップe)におい
て出力された該中位ビットデータとステップd)及びス
テップg)において最も最近に格納されたデータとを結
合するステップと、i)ステップh)において結合され
た該データを該シフト演算の結果の部分として格納する
ステップと、j)該シフト数に応じて該第3データをシ
フトすることにより、上位ビットデータと中位ビットデ
ータと下位ビットデータとを出力するステップと、k)
ステップj)において出力された該中位ビットデータと
ステップg)において最も最近に格納されたデータとを
結合するステップと、l)ステップk)において結合さ
れた該データを該シフト演算の結果の部分として格納す
るステップとを包含しており、これにより、上記目的が
達成される。
Another shift operation method of the present invention is a shift operation method for performing a multi-precision shift operation using the first data and at least one second data and third data. Shifting the first data in accordance with the number to output upper bit data, middle bit data, and lower bit data; and b) shifting the middle bit data output in step a). Storing as a part of the result of the operation, c) selecting one of the upper bit data and the lower bit data output in step a) according to the shift direction, and d) in step c). Storing the selected data, e) shifting one of the at least one second data according to the shift number, Of the high-order bit data, the middle-order bit data, and the low-order bit data, and f) selecting one of the high-order bit data and the low-order bit data output in step e) according to the shift direction. , G) storing the data selected in step f), and h) combining the middle bit data output in step e) with the data most recently stored in steps d) and g). And i) storing the data combined in step h) as a part of the result of the shift operation, and j) shifting the third data according to the number of shifts to obtain high-order bit data. And outputting middle-order bit data and lower-order bit data, k).
Combining the middle bit data output in step j) with the most recently stored data in step g), and l) combining the data combined in step k) with the portion of the result of the shift operation. And the step of storing as, thereby achieving the above object.

【0024】ステップh)における結合は、ステップ
e)において出力された前記中位ビットデータとステッ
プd)及びステップg)において最も最近に格納された
前記データとに対して論理和演算を実行することによっ
て達成されてもよい。
The combination in step h) is to perform an OR operation on the middle bit data output in step e) and the most recently stored data in steps d) and g). May be achieved by

【0025】ステップk)における結合は、ステップ
j)において出力された前記中位ビットデータとステッ
プg)において最も最近に格納された前記データとに対
して論理和演算を実行することによって達成されてもよ
い。
The combining in step k) is accomplished by performing an OR operation on the intermediate bit data output in step j) and the data most recently stored in step g). Good.

【0026】ステップa)〜ステップd)は、プログラ
ムの実行における1ステップにおいて実行され、ステッ
プe)〜ステップi)は、該プログラムの実行における
1ステップにおいて実行され、ステップj)〜ステップ
l)は、該プログラムの実行における1ステップにおい
て実行される。
Steps a) to d) are executed in one step in the execution of the program, steps e) to i) are executed in one step in the execution of the program, and steps j) to l) are executed. , Is executed in one step in the execution of the program.

【0027】前記シフト演算方法は、ステップe)〜ス
テップi)を繰り返すステップをさらに包含してもよ
い。
The shift calculation method may further include a step of repeating steps e) to i).

【0028】[0028]

【作用】本発明によれば、倍精度データを左にシフトす
る場合には、その左シフトにより下位データからあふれ
たデータがレジスタに格納され、そのレジスタに格納さ
れたデータと上位データを左シフトした結果とが結合さ
れる。また、倍精度データを右にシフトする場合には、
その右シフトにより上位データからあふれたデータがレ
ジスタに格納され、そのレジスタに格納されたデータと
下位データを右シフトした結果とが結合される。このよ
うに、倍精度データのシフト演算は、2回のシフト操作
により実現される。同様にして、M倍精度データのシフ
ト演算をM回のシフト操作により実現することができ
る。ここで、Mは3以上の整数である。これにより、多
倍精度データのシフト演算を効率よく行なうことができ
る。
According to the present invention, when the double-precision data is shifted to the left, the data overflowed from the lower data by the left shift is stored in the register, and the data stored in the register and the upper data are shifted to the left. The result is combined with. Also, when shifting double-precision data to the right,
The right shift causes the data overflowing from the upper data to be stored in the register, and the data stored in the register and the result of right shifting the lower data are combined. In this way, the shift calculation of double-precision data is realized by two shift operations. Similarly, a shift operation of M double precision data can be realized by M shift operations. Here, M is an integer of 3 or more. As a result, the shift calculation of multi-precision data can be efficiently performed.

【0029】[0029]

【実施例】以下、図面を参照しながら、本発明によるシ
フト演算装置の実施例を説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of a shift arithmetic unit according to the present invention will be described below with reference to the drawings.

【0030】図1は、本発明によるシフト演算装置の実
施例の構成を示す。シフト演算装置は、与えられたシフ
ト数に応じて、データ(A)をシフトすることにより、
上位ビットデータ(B)と下位ビットデータ(C)と中
位ビットデータ(D)とを出力するシフタ20と、シフ
タ20の出力に結合され、シフト方向に応じて上位ビッ
トデータ(B)と下位ビットデータ(C)のうちの一方
を選択するマルチプレクサ30と、マルチプレクサ30
の出力に結合され、マルチプレクサ30によって選択さ
れたデータを格納するレジスタ40と、シフタ20の出
力とレジスタ40の出力とに結合され、シフタ20から
出力された中位ビットデータ(D)とマルチプレクサ5
0によって選択されたデータとに演算を行う演算器(A
LU)60と、ALU60の出力に結合され、ALU6
0による演算結果を格納するレジスタ群80とを有して
いる。
FIG. 1 shows the configuration of an embodiment of a shift arithmetic unit according to the present invention. The shift operation device shifts the data (A) according to the given shift number,
A shifter 20 that outputs upper bit data (B), lower bit data (C), and middle bit data (D), and an output of the shifter 20 are coupled to the upper bit data (B) and the lower bit according to the shift direction. A multiplexer 30 for selecting one of bit data (C), and a multiplexer 30
Of the shifter 20 and the output of the register 40 and the register 40 for storing the data selected by the multiplexer 30 and the intermediate bit data (D) output from the shifter 20 and the multiplexer 5
An arithmetic unit (A that performs an arithmetic operation on the data selected by 0
LU) 60 and the output of ALU60,
It has a register group 80 for storing the operation result by 0.

【0031】本実施例では、データ(A)〜(D)は、
いずれも16ビットデータである。しかし、本発明はデ
ータのビット数には限定されない。
In this embodiment, the data (A) to (D) are
Both are 16-bit data. However, the present invention is not limited to the number of bits of data.

【0032】シフタ20に与えられるシフト数は、レジ
スタ10に格納される。レジスタ10に格納されるシフ
ト数が負数の場合には、シフタ20は、そのシフト数の
絶対値だけ左にデータ(A)をシフトする。レジスタ1
0に格納されるシフト数が正数の場合には、シフタ20
は、そのシフト数だけ右にデータ(A)をシフトする。
The shift number given to the shifter 20 is stored in the register 10. When the shift number stored in the register 10 is a negative number, the shifter 20 shifts the data (A) to the left by the absolute value of the shift number. Register 1
If the shift number stored in 0 is a positive number, the shifter 20
Shifts the data (A) to the right by the number of shifts.

【0033】シフタ20と、マルチプレクサ30と、A
LU60と、レジスタ群80には、制御回路90によっ
て制御信号が供給される。
The shifter 20, the multiplexer 30, and the A
A control circuit 90 supplies a control signal to the LU 60 and the register group 80.

【0034】シフタ20には、算術シフトか論理シフト
かを示す制御信号が入力される。シフタ20は、制御信
号に応じて算術シフトと論理シフトのうちの一方を行
う。
The shifter 20 is supplied with a control signal indicating whether it is an arithmetic shift or a logical shift. The shifter 20 performs one of arithmetic shift and logical shift according to the control signal.

【0035】マルチプレクサ30には、シフト方向を示
す制御信号が入力される。シフト方向が左であることを
示す制御信号が入力された場合には、マルチプレクサ3
0は、シフタ20から出力される上位ビットデータ
(B)を選択する。シフト方向が右であることを示す制
御信号が入力された場合には、マルチプレクサ30は、
シフタ20から出力される下位ビットデータ(C)を選
択する。シフト方向は、レジスタ10に格納されるシフ
ト数の最上位ビットを参照することにより決定すること
ができる。従って、シフト数の最上位ビットの値に応じ
てマルチプレクサ30の動作を制御するようにしてもよ
い。
A control signal indicating the shift direction is input to the multiplexer 30. When a control signal indicating that the shift direction is left is input, the multiplexer 3
0 selects the upper bit data (B) output from the shifter 20. When a control signal indicating that the shift direction is right is input, the multiplexer 30
The lower bit data (C) output from the shifter 20 is selected. The shift direction can be determined by referring to the most significant bit of the shift number stored in the register 10. Therefore, the operation of the multiplexer 30 may be controlled according to the value of the most significant bit of the shift number.

【0036】ALU60は、制御信号に応じて種々の算
術演算又は論理演算を実行する。算術演算には、2進お
よび10進の加減算、乗除算、算術的桁送りなどが含ま
れる。また、論理演算には、論理積(AND)、論理和
(OR)、排他的論理和(XOR)などが含まれる。A
LU60に対する制御信号は、プログラム中の命令をデ
コードすることによって得られる。例えば、加算命令に
対してはALU60は加算器として動作し、論理和命令
に対してはALU60は論理和器として動作する。しか
しながら、倍精度シフト演算を実行するためには、AL
U60は、少なくとも2つの機能を有していれば足り
る。その2つの機能とは、ALU60に入力される2つ
のデータのうちの一方をそのまま出力する(スルー出
力)機能と、ALU60に入力される2つのデータに対
して論理和演算を実行する機能とである。
The ALU 60 executes various arithmetic operations or logical operations according to control signals. Arithmetic operations include binary and decimal addition, subtraction, multiplication and division, arithmetic shifts, and the like. The logical operation includes logical product (AND), logical sum (OR), exclusive logical sum (XOR), and the like. A
The control signal for the LU 60 is obtained by decoding the instruction in the program. For example, the ALU 60 operates as an adder for an add instruction, and the ALU 60 operates as an OR adder for an OR instruction. However, in order to execute the double precision shift operation, AL
It is sufficient for U60 to have at least two functions. The two functions are a function of directly outputting one of the two data input to the ALU 60 (through output) and a function of performing a logical sum operation on the two data input to the ALU 60. is there.

【0037】レジスタ群80は、レジスタ70とレジス
タ71とを有している。倍精度シフト演算が実行される
前に、シフトされるべき倍精度データのうち上位の16
ビットデータがレジスタ70に格納され、シフトされる
べき倍精度データのうち下位の16ビットデータがレジ
スタ71に格納される。倍精度シフト演算が実行された
後、ALU60による演算結果のうち上位の16ビット
データがレジスタ70に格納され、ALU60による演
算結果のうち下位の16ビットデータがレジスタ71に
格納される。
The register group 80 has a register 70 and a register 71. Before the double-precision shift operation is executed, the upper 16 bits of the double-precision data to be shifted are
Bit data is stored in the register 70, and lower 16-bit data of the double-precision data to be shifted is stored in the register 71. After the double precision shift operation is executed, the upper 16-bit data of the operation result by ALU 60 is stored in register 70, and the lower 16-bit data of the operation result by ALU 60 is stored in register 71.

【0038】あるいは、倍精度シフト演算が実行される
前の上位データと下位データとを格納するレジスタと倍
精度シフト演算が実行された後の上位データと下位デー
タとを格納するレジスタとが異なるように、レジスタ群
80を構成してもよい。
Alternatively, the register for storing the high-order data and the low-order data before the double-precision shift operation is different from the register for storing the high-order data and the low-order data after the double-precision shift operation is executed. Alternatively, the register group 80 may be configured.

【0039】図2は、本発明によるシフト演算装置の他
の実施例の構成を示す。図2に示されるシフト演算装置
の構成は、マルチプレクサ50が追加されている点を除
き、図1に示されるシフト演算装置の構成と同じであ
る。従って、マルチプレクサ50以外の構成要素の説明
は省略する。
FIG. 2 shows the configuration of another embodiment of the shift arithmetic unit according to the present invention. The configuration of the shift operation device shown in FIG. 2 is the same as the configuration of the shift operation device shown in FIG. 1 except that a multiplexer 50 is added. Therefore, description of components other than the multiplexer 50 is omitted.

【0040】マルチプレクサ50は、制御信号に応じて
2つの入力のうちの一方を出力する。マルチプレクサ5
0の入力の一方は、レジスタ40の出力に結合され、マ
ルチプレクサ50の入力の他方は、データ(E)に結合
される。制御信号は、制御回路90によってマルチプレ
クサ50に供給される。
The multiplexer 50 outputs one of the two inputs according to the control signal. Multiplexer 5
One of the inputs of 0 is coupled to the output of register 40 and the other of the inputs of multiplexer 50 is coupled to the data (E). The control signal is supplied to the multiplexer 50 by the control circuit 90.

【0041】倍精度シフト演算が実行される場合には、
マルチプレクサ50は常にレジスタ40に格納されたデ
ータを選択するように制御される。従って、マルチプレ
クサ50は、倍精度シフト演算の実行には不要である。
倍精度シフト演算以外の演算(例えば、論理積演算)が
実行される場合には、マルチプレクサ50はデータ
(E)を選択するように制御されてもよい。このような
制御をすることにより、ALU60を用いて種々の演算
を実行することが可能となる。
When a double precision shift operation is executed,
The multiplexer 50 is controlled to always select the data stored in the register 40. Therefore, the multiplexer 50 is not necessary to execute the double precision shift operation.
When an operation other than the double-precision shift operation (for example, a logical product operation) is executed, the multiplexer 50 may be controlled to select the data (E). By performing such control, it becomes possible to execute various calculations using the ALU 60.

【0042】図3は、図1に示されるシフタ20の構成
を示す。シフタ20は、6個のシフタを組み合わせるこ
とにより、左(25−1)ビット〜右25ビットのシフト
を実現する。シフタ20は、1ビット左シフタ301と
2ビット左シフタ302と4ビット左シフタ303と8
ビット左シフタ304と16ビット左シフタ305と3
2ビット右シフタ306とを含んでいる。シフタ20
は、シフト数をデコードすることによって制御信号CO
L1〜COL6を生成するデコーダ307をさらに含ん
でいる。制御信号COL1〜COL6の状態は、アクテ
ィブであるか非アクティブであるかのいずれかである。
制御回路90からの算術シフトか論理シフトかを示す制
御信号は、シフタ301〜306のそれぞれに供給され
る(ただし、図3ではその制御信号の図示は省略されて
いる)。
FIG. 3 shows the structure of the shifter 20 shown in FIG. The shifter 20 realizes shifting from left (2 5 −1) bits to right 25 bits by combining 6 shifters. The shifter 20 includes a 1-bit left shifter 301, a 2-bit left shifter 302, a 4-bit left shifter 303, and a 8-bit left shifter 303.
Bit left shifter 304 and 16 bit left shifter 305 and 3
It includes a 2-bit right shifter 306. Shifter 20
Control signal CO by decoding the shift number.
A decoder 307 for generating L1 to COL6 is further included. The states of the control signals COL1 to COL6 are either active or inactive.
A control signal indicating the arithmetic shift or the logical shift from the control circuit 90 is supplied to each of the shifters 301 to 306 (however, the control signal is not shown in FIG. 3).

【0043】1ビット左シフタ301は、シフタ20に
入力される16ビットデータを受け取り、制御信号CO
L1に応じてその16ビットデータを左に1ビットだけ
シフトするか否かを決定する。制御信号COL1がアク
ティブである場合には、シフタ301は16ビットデー
タを左に1ビットだけシフトする。制御信号COL1が
非アクティブである場合には、シフタ301はシフト動
作を行わず入力されたデータをそのまま出力する。シフ
タ301は、17ビットデータを出力する。シフタ30
1から出力される17ビットデータの最下位ビットは、
シフタ301に入力される16ビットデータの最下位ビ
ットに対応している。
The 1-bit left shifter 301 receives the 16-bit data input to the shifter 20, and receives the control signal CO
Depending on L1, it is determined whether the 16-bit data is shifted to the left by 1 bit. When the control signal COL1 is active, the shifter 301 shifts 16-bit data to the left by 1 bit. When the control signal COL1 is inactive, the shifter 301 does not perform the shift operation and outputs the input data as it is. The shifter 301 outputs 17-bit data. Shifter 30
The least significant bit of the 17-bit data output from 1 is
It corresponds to the least significant bit of 16-bit data input to the shifter 301.

【0044】2ビット左シフタ302は、シフタ301
から出力される17ビットデータを受け取り、制御信号
COL2に応じてその17ビットデータを左に2ビット
だけシフトするか否かを決定する。制御信号COL2が
アクティブである場合には、シフタ302は17ビット
データを左に2ビットだけシフトする。制御信号COL
2が非アクティブである場合には、シフタ302はシフ
ト動作を行わず入力されたデータをそのまま出力する。
シフタ302は、19ビットデータを出力する。シフタ
302から出力される19ビットデータの最下位ビット
は、シフタ302に入力される17ビットデータの最下
位ビットに対応している。
The 2-bit left shifter 302 is the shifter 301.
It receives the 17-bit data output from, and determines whether to shift the 17-bit data to the left by 2 bits according to the control signal COL2. When the control signal COL2 is active, the shifter 302 shifts the 17-bit data to the left by 2 bits. Control signal COL
When 2 is inactive, the shifter 302 does not perform the shift operation and outputs the input data as it is.
The shifter 302 outputs 19-bit data. The least significant bit of the 19-bit data output from the shifter 302 corresponds to the least significant bit of the 17-bit data input to the shifter 302.

【0045】シフタ303〜305も上述したシフタ3
01及び302と同様に動作する。
The shifters 303 to 305 are also the shifters 3 described above.
It operates similarly to 01 and 302.

【0046】32ビット右シフタ306は、シフタ30
5から出力される47ビットデータを受け取り、制御信
号COL6に応じてその47ビットデータを右に32ビ
ットだけシフトするか否かを決定する。制御信号COL
6がアクティブである場合には、シフタ306は47ビ
ットデータを右に32ビットだけシフトする。制御信号
COL6が非アクティブである場合には、シフタ306
はシフト動作を行わず入力されたデータをそのまま出力
する。シフタ306は、第78ビット(最上位ビット)
から第0ビット(最下位ビット)を有している。シフタ
306の第32ビットは、シフタ305から出力される
47ビットデータの最下位ビットに対応している。シフ
タ306は、第63ビットから第48ビットの16ビッ
トデータを上位ビットデータ(B)として出力する。シ
フタ306は、第47ビットから第32ビットの16ビ
ットデータを中位ビットデータ(D)として出力する。
シフタ306は、第31ビットから第16ビットの16
ビットデータを下位ビットデータ(C)として出力す
る。
The 32-bit right shifter 306 is the shifter 30.
The 47-bit data output from 5 is received, and it is determined whether to shift the 47-bit data to the right by 32 bits according to the control signal COL6. Control signal COL
If 6 is active, shifter 306 shifts 47-bit data to the right by 32 bits. When the control signal COL6 is inactive, the shifter 306
Outputs the input data as it is without performing the shift operation. The shifter 306 is the 78th bit (most significant bit)
To 0th bit (least significant bit). The 32nd bit of the shifter 306 corresponds to the least significant bit of the 47-bit data output from the shifter 305. The shifter 306 outputs 16-bit data from the 63rd bit to the 48th bit as upper bit data (B). The shifter 306 outputs the 16-bit data from the 47th bit to the 32nd bit as the middle-order bit data (D).
The shifter 306 has 16 bits from the 31st bit to the 16th bit.
The bit data is output as lower bit data (C).

【0047】例えば、左に10ビットだけデータをシフ
トする場合には、デコーダ307は、制御信号COL2
とCOL4とをアクティブにし、制御信号COL1とC
OL3とCOL5とCOL6とを非アクティブにする。
その結果、シフタ302とシフタ304とがシフト動作
を行い、シフタ301とシフタ303とシフタ305と
シフタ306とはシフト動作を行わず入力されたデータ
をそのまま出力する。
For example, when shifting the data by 10 bits to the left, the decoder 307 uses the control signal COL2.
And COL4 are activated, and the control signals COL1 and C
Deactivate OL3, COL5, and COL6.
As a result, the shifter 302 and the shifter 304 perform the shift operation, and the shifter 301, the shifter 303, the shifter 305, and the shifter 306 do not perform the shift operation and output the input data as they are.

【0048】右に10ビットだけデータをシフトする場
合には、デコーダ307は、制御信号COL2とCOL
3とCOL5とCOL6をアクティブにし、制御信号C
OL1とCOL4とを非アクティブにする。その結果、
シフタ302とシフタ303シフタ305とによってデ
ータはいったん左に22ビットだけシフトされた後、シ
フタ306によって右に32ビットだけシフトされる。
その結果、右に10ビットだけシフトされたデータが得
られる。
When shifting data by 10 bits to the right, the decoder 307 controls the control signals COL2 and COL.
3 and COL5 and COL6 are activated, and the control signal C
Deactivate OL1 and COL4. as a result,
The shifter 302 and the shifter 303 shifter 305 shift data to the left by 22 bits, and then shifter 306 shifts the data to the right by 32 bits.
As a result, data shifted by 10 bits to the right is obtained.

【0049】図4は、図3に示される2ビット左シフタ
302の構成を示す。シフタ302には算術シフトか論
理シフトかを示す制御信号とシフトするか否かを示す制
御信号とが入力される。シフタ302は、複数のマルチ
プレクサと複数のAND回路とを含む。AND回路は、
算術シフトの場合であって、かつ、シフトしない場合
に、シフタ302から出力される上位の2ビットをシフ
タ302に入力される最上位ビットの値に従って符号拡
張するために使用される。シフタ301、303〜30
6の構成もシフタ302の構成と同様である。
FIG. 4 shows the structure of the 2-bit left shifter 302 shown in FIG. The shifter 302 receives a control signal indicating whether it is an arithmetic shift or a logical shift and a control signal indicating whether to shift. The shifter 302 includes a plurality of multiplexers and a plurality of AND circuits. The AND circuit is
In the case of arithmetic shift, and when not shifting, it is used to sign-extend the upper 2 bits output from the shifter 302 according to the value of the most significant bit input to the shifter 302. Shifter 301, 303-30
The configuration of 6 is similar to that of the shifter 302.

【0050】図3に示されるシフタ20の構成と同様に
して、(m+1)個のシフタを組み合わせることによ
り、左(2m−1)ビット〜右2mビットのシフトを実現
するように、シフタ20を構成することもできる。ここ
で、mは1以上の整数である。この場合、シフタ20
は、m個の2kビット左シフタ(k=0,1,...,
m−1)と2mビット右シフタとを有している。ここ
で、kは0以上m−1以下の整数である。図3に示され
るシフタ20の構成は、m=5の場合の例である。
Similar to the structure of the shifter 20 shown in FIG. 3, by combining (m + 1) shifters, a shift of (2 m −1) bits left to 2 m bits right is realized. It is also possible to configure 20. Here, m is an integer of 1 or more. In this case, the shifter 20
Are m 2 k- bit left shifters (k = 0, 1, ...,
m-1) and a 2 m- bit right shifter. Here, k is an integer of 0 or more and m-1 or less. The configuration of the shifter 20 shown in FIG. 3 is an example when m = 5.

【0051】さらに、図3に示されるシフタ20の構成
において、シフタ306の第47ビットから第32ビッ
トの16ビットデータを中位ビットデータ(D)として
出力し、かつ、シフタ305の第31ビットから第16
ビットの16ビットデータを上位/下位ビットデータと
して出力するようにしてもよい。この場合には、上位/
下位ビットデータは、図1に示されるマルチプレクサ3
0の出力と等しくなる。従って、中位ビットデータ
(D)と上位/下位ビットデータとを出力するようにシ
フタ20を改変した場合には、シフタ20の出力をAL
U60の一方の入力に結合することにより、マルチプレ
クサ30を省略することができる。
Further, in the configuration of the shifter 20 shown in FIG. 3, 16-bit data of the 47th bit to the 32nd bit of the shifter 306 is output as the middle-order bit data (D) and the 31st bit of the shifter 305 is output. From 16th
16-bit data of bits may be output as upper / lower bit data. In this case, the top /
The lower bit data is the multiplexer 3 shown in FIG.
It becomes equal to the output of 0. Therefore, when the shifter 20 is modified so as to output the middle-order bit data (D) and the high-order / low-order bit data, the shifter 20 outputs AL.
By coupling to one input of U60, the multiplexer 30 can be omitted.

【0052】さらに、シフタ20は、右(2m−1)ビ
ット〜左2mビットのシフトを実現するために、m個の
kビット右シフタ(k=0,1,...,m−1)と
mビット左シフタとを含んでいてもよい。
Further, the shifter 20 has m 2 k- bit right shifters (k = 0, 1, ..., M) in order to realize a shift from right (2 m -1) bits to left 2 m bits. -1) and a 2 m- bit left shifter may be included.

【0053】次に、上述した構成を有するシフト演算装
置を用いて、倍精度シフト演算を実行する方法を説明す
る。
Next, a method of executing a double precision shift operation using the shift operation device having the above-mentioned configuration will be described.

【0054】以下、倍精度データを左にNビットだけ論
理シフトする方法を説明する。ここで、倍精度データ
は、上位の16ビットデータと下位の16ビットデータ
とからなり、Nは1以上の整数である。上位の16ビッ
トデータはレジスタ70に格納されており、下位の16
ビットデータはレジスタ71に格納されていると仮定す
る。また、倍精度シフト演算の結果のうち上位データは
レジスタ70に格納され、倍精度シフト演算の結果のう
ち下位データはレジスタ71に格納されると仮定する。
A method of logically shifting double-precision data to the left by N bits will be described below. Here, the double precision data is composed of upper 16-bit data and lower 16-bit data, and N is an integer of 1 or more. The upper 16-bit data is stored in the register 70, and the lower 16 bits are stored.
It is assumed that the bit data is stored in the register 71. It is also assumed that the upper data of the double-precision shift operation result is stored in the register 70, and the lower data of the double-precision shift operation result is stored in the register 71.

【0055】図5は、左Nビットの倍精度シフト演算の
処理を模式的に示す。図5において、括弧付きの数字
は、以下に示す各ステップの番号に対応する。
FIG. 5 schematically shows the processing of a double N-bit double-precision shift operation. In FIG. 5, the numbers in parentheses correspond to the numbers of the respective steps shown below.

【0056】ステップ1:シフト数「−N」がレジスタ
10に格納される。
Step 1: The shift number "-N" is stored in the register 10.

【0057】ステップ2−1:レジスタ71から下位デ
ータが読み出され、下位データはデータ(A)としてシ
フタ20に入力される。
Step 2-1: Lower data is read from the register 71, and the lower data is input to the shifter 20 as data (A).

【0058】ステップ2−2:シフタ20は、下位デー
タを左にNビットだけ論理シフトすることにより、上位
ビットデータ(B)と中位ビットデータ(D)と下位ビ
ットデータ(C)とを出力する。
Step 2-2: The shifter 20 logically shifts the lower data to the left by N bits to output the upper bit data (B), the intermediate bit data (D) and the lower bit data (C). To do.

【0059】ステップ2−3:ALU60は、シフタ2
0から出力された中位ビットデータ(D)をそのまま出
力する(スルー出力)。ALU60の出力は、下位デー
タとしてレジスタ71に格納される。
Step 2-3: The ALU 60 uses the shifter 2
The middle-order bit data (D) output from 0 is output as it is (through output). The output of the ALU 60 is stored in the register 71 as lower data.

【0060】ステップ2−4:マルチプレクサ30は、
シフタ20から出力された上位ビットデータ(B)と下
位ビットデータ(C)のうち上位ビットデータ(B)を
選択する。選択された上位ビットデータ(B)はレジス
タ40に格納される。
Step 2-4: The multiplexer 30
The upper bit data (B) is selected from the upper bit data (B) and the lower bit data (C) output from the shifter 20. The selected upper bit data (B) is stored in the register 40.

【0061】ステップ3−1:レジスタ70から上位デ
ータが読み出され、上位データはデータ(A)としてシ
フタ20に入力される。
Step 3-1: The upper data is read from the register 70, and the upper data is input to the shifter 20 as data (A).

【0062】ステップ3−2:シフタ20は、上位デー
タを左にNビットだけ論理シフトすることにより、上位
ビットデータ(B)と中位ビットデータ(D)と下位ビ
ットデータ(C)とを出力する。
Step 3-2: The shifter 20 logically shifts the upper data to the left by N bits to output the upper bit data (B), the intermediate bit data (D) and the lower bit data (C). To do.

【0063】ステップ3−3:ALU60は、シフタ2
0から出力された中位ビットデータ(D)とレジスタ4
0に格納されたデータ(F)とに対して論理和演算を実
行する。ALU60の出力は、上位データとしてレジス
タ70に格納される。
Step 3-3: The ALU 60 is the shifter 2
Middle-order bit data (D) output from 0 and register 4
The logical sum operation is performed on the data (F) stored in 0. The output of the ALU 60 is stored in the register 70 as upper data.

【0064】このようにして、左Nビットの倍精度シフ
ト演算が実現される。なお、上述の処理において、ステ
ップ2−1〜2−4は、プログラムの実行における1ス
テップにおいて実行され、ステップ3−1〜3−3は、
プログラムの実行における1ステップにおいて実行され
る。
In this way, the left N-bit double precision shift operation is realized. In the above process, steps 2-1 to 2-4 are executed in one step in executing the program, and steps 3-1 to 3-3 are
It is executed in one step in the execution of the program.

【0065】なお、上位16ビットデータと下位16ビ
ットデータとからなる倍精度データを左にNビットだけ
算術シフトする場合には、上述したステップ3−2にお
いて、論理シフトの代わりに算術シフトを実行すればよ
い。論理シフトか算術シフトかは上位データにのみ関連
するからである。
When double-precision data consisting of upper 16-bit data and lower 16-bit data is arithmetically shifted to the left by N bits, arithmetic shift is executed instead of logical shift in step 3-2 described above. do it. This is because the logical shift or arithmetic shift is related only to the upper data.

【0066】以下、倍精度データを右にNビットだけ論
理シフトする方法を説明する。ここで、倍精度データ
は、上位の16ビットデータと下位の16ビットデータ
とからなり、Nは1以上の整数である。上位の16ビッ
トデータはレジスタ70に格納されており、下位の16
ビットデータはレジスタ71に格納されていると仮定す
る。また、倍精度シフト演算の結果のうち上位データは
レジスタ70に格納され、倍精度シフト演算の結果のう
ち下位データはレジスタ71に格納されると仮定する。
A method for logically shifting the double precision data rightward by N bits will be described below. Here, the double precision data is composed of upper 16-bit data and lower 16-bit data, and N is an integer of 1 or more. The upper 16-bit data is stored in the register 70, and the lower 16 bits are stored.
It is assumed that the bit data is stored in the register 71. It is also assumed that the upper data of the double-precision shift operation result is stored in the register 70, and the lower data of the double-precision shift operation result is stored in the register 71.

【0067】図6は、右Nビットの倍精度シフト演算の
処理を模式的に示す。図6において、括弧付きの数字
は、以下に示す各ステップの番号に対応する。
FIG. 6 schematically shows the processing of the right N-bit double precision shift operation. In FIG. 6, the numbers in parentheses correspond to the numbers of the respective steps shown below.

【0068】ステップ1:シフト数「N」がレジスタ1
0に格納される。
Step 1: The shift number "N" is register 1
Stored in 0.

【0069】ステップ2−1:レジスタ70から上位デ
ータが読み出され、上位データはデータ(A)としてシ
フタ20に入力される。
Step 2-1: Upper data is read from the register 70, and the upper data is input to the shifter 20 as data (A).

【0070】ステップ2−2:シフタ20は、上位デー
タを右にNビットだけ論理シフトすることにより、上位
ビットデータ(B)と中位ビットデータ(D)と下位ビ
ットデータ(C)とを出力する。
Step 2-2: The shifter 20 logically shifts the upper data to the right by N bits to output the upper bit data (B), the middle bit data (D) and the lower bit data (C). To do.

【0071】ステップ2−3:ALU60は、シフタ2
0から出力された中位ビットデータ(D)をそのまま出
力する(スルー出力)。ALU60の出力は、上位デー
タとしてレジスタ70に格納される。
Step 2-3: The ALU 60 uses the shifter 2
The middle-order bit data (D) output from 0 is output as it is (through output). The output of the ALU 60 is stored in the register 70 as upper data.

【0072】ステップ2−4:マルチプレクサ30は、
シフタ20から出力された上位ビットデータ(B)と下
位ビットデータ(C)のうち下位ビットデータ(C)を
選択する。選択された下位ビットデータ(C)はレジス
タ40に格納される。
Step 2-4: The multiplexer 30
The lower bit data (C) is selected from the upper bit data (B) and the lower bit data (C) output from the shifter 20. The selected lower bit data (C) is stored in the register 40.

【0073】ステップ3−1:レジスタ71から下位デ
ータが読み出され、下位データはデータ(A)としてシ
フタ20に入力される。
Step 3-1: Lower data is read from the register 71, and the lower data is input to the shifter 20 as data (A).

【0074】ステップ3−2:シフタ20は、下位デー
タを右にNビットだけ論理シフトすることにより、上位
ビットデータ(B)と中位ビットデータ(D)と下位ビ
ットデータ(C)とを出力する。
Step 3-2: The shifter 20 logically shifts the lower data to the right by N bits to output the upper bit data (B), the middle bit data (D) and the lower bit data (C). To do.

【0075】ステップ3−3:ALU60は、シフタ2
0から出力された中位ビットデータ(D)とレジスタ4
0に格納されたデータ(F)とに対して論理和演算を実
行する。ALU60の出力は、下位データとしてレジス
タ71に格納される。
Step 3-3: The ALU 60 is the shifter 2
Middle-order bit data (D) output from 0 and register 4
The logical sum operation is performed on the data (F) stored in 0. The output of the ALU 60 is stored in the register 71 as lower data.

【0076】このようにして、右Nビットの倍精度シフ
ト演算が実現される。なお、上述の処理において、ステ
ップ2−1〜2−4は、プログラムの実行における1ス
テップにおいて実行され、ステップ3−1〜3−3は、
プログラムの実行における1ステップにおいて実行され
る。
In this way, the right N-bit double precision shift operation is realized. In the above process, steps 2-1 to 2-4 are executed in one step in executing the program, and steps 3-1 to 3-3 are
It is executed in one step in the execution of the program.

【0077】なお、上位16ビットデータと下位16ビ
ットデータとからなる倍精度データを右にNビットだけ
算術シフトする場合には、上述したステップ2−2にお
いて、論理シフトの代わりに算術シフトを実行すればよ
い。論理シフトか算術シフトかは上位データにのみ関連
するからである。
When double-precision data consisting of upper 16-bit data and lower 16-bit data is arithmetically shifted to the right by N bits, arithmetic shift is executed instead of logical shift in step 2-2. do it. This is because the logical shift or arithmetic shift is related only to the upper data.

【0078】また、本実施例では、2ワード倍精度デー
タは、レジスタ70とレジスタ71に格納されていると
仮定した。しかし、本発明はこれに限られない。2ワー
ド倍精度データが他の保持回路に格納されている場合
に、その2ワード倍精度データをデータ(A)又はデー
タ(E)としてシフト演算装置に入力するようにしても
よい。
Further, in this embodiment, it is assumed that the 2-word double precision data is stored in the register 70 and the register 71. However, the present invention is not limited to this. When the 2-word double-precision data is stored in another holding circuit, the 2-word double-precision data may be input to the shift arithmetic unit as data (A) or data (E).

【0079】次に、3倍精度データを左にNビットだけ
論理シフトする方法を説明する。ここで、3倍精度デー
タは、上位の16ビットデータと中位の16ビットデー
タと下位の16ビットデータとからなり、Nは1以上の
整数である。この例では、図1に示されるレジスタ7
0、71に加えて、レジスタ72(図示せず)を使用す
る。
Next, a method of logically shifting triple precision data to the left by N bits will be described. Here, the triple precision data is composed of upper 16-bit data, middle 16-bit data, and lower 16-bit data, and N is an integer of 1 or more. In this example, register 7 shown in FIG.
In addition to 0, 71, a register 72 (not shown) is used.

【0080】上位の16ビットデータはレジスタ70に
格納されており、中位の16ビットデータはレジスタ7
1に格納されており、下位の16ビットデータはレジス
タ72に格納されていると仮定する。また、3倍精度シ
フト演算の結果のうち上位データはレジスタ70に格納
され、3倍精度シフト演算の結果のうち中位データはレ
ジスタ71に格納され、3倍精度シフト演算の結果のう
ち下位データはレジスタ72に格納されると仮定する。
The upper 16-bit data is stored in the register 70, and the middle 16-bit data is stored in the register 7.
1 and the lower 16-bit data is assumed to be stored in the register 72. The upper data of the result of the triple precision shift operation is stored in the register 70, the middle data of the result of the triple precision shift operation is stored in the register 71, and the lower data of the result of the triple precision shift operation is stored. Are stored in register 72.

【0081】図7は、左Nビットの3倍精度シフト演算
の処理を模式的に示す。図7において、括弧付きの数字
は、以下に示す各ステップの番号に対応する。
FIG. 7 schematically shows the processing of the left N-bit triple precision shift operation. In FIG. 7, the numbers in parentheses correspond to the numbers of the respective steps shown below.

【0082】ステップ101:シフト数「−N」がレジ
スタ10に格納される。
Step 101: The shift number "-N" is stored in the register 10.

【0083】ステップ102−1:レジスタ71から下
位データが読み出され、下位データはデータ(A)とし
てシフタ20に入力される。
Step 102-1: Lower data is read from the register 71, and the lower data is input to the shifter 20 as data (A).

【0084】ステップ102−2:シフタ20は、下位
データを左にNビットだけ論理シフトすることにより、
上位ビットデータ(B)と中位ビットデータ(D)と下
位ビットデータ(C)とを出力する。
Step 102-2: The shifter 20 logically shifts the lower data to the left by N bits,
The high-order bit data (B), the middle-order bit data (D), and the low-order bit data (C) are output.

【0085】ステップ102−3:ALU60は、シフ
タ20から出力された中位ビットデータ(D)をそのま
ま出力する(スルー出力)。ALU60の出力は、下位
データとしてレジスタ72に格納される。
Step 102-3: The ALU 60 directly outputs the middle-order bit data (D) output from the shifter 20 (through output). The output of the ALU 60 is stored in the register 72 as lower data.

【0086】ステップ102−4:マルチプレクサ30
は、シフタ20から出力された上位ビットデータ(B)
と下位ビットデータ(C)のうち上位ビットデータ
(B)を選択する。選択された上位ビットデータ(B)
はレジスタ40に格納される。
Step 102-4: Multiplexer 30
Is the upper bit data (B) output from the shifter 20.
And the upper bit data (B) is selected from the lower bit data (C). Selected upper bit data (B)
Are stored in the register 40.

【0087】ステップ103−1:レジスタ71から中
位データが読み出され、中位データはデータ(A)とし
てシフタ20に入力される。
Step 103-1: The middle level data is read from the register 71, and the middle level data is input to the shifter 20 as data (A).

【0088】ステップ103−2:シフタ20は、中位
データを左にNビットだけ論理シフトすることにより、
上位ビットデータ(B)と中位ビットデータ(D)と下
位ビットデータ(C)とを出力する。
Step 103-2: The shifter 20 logically shifts the middle data to the left by N bits,
The high-order bit data (B), the middle-order bit data (D), and the low-order bit data (C) are output.

【0089】ステップ103−3:ALU60は、ステ
ップ103−2においてシフタ20から出力された中位
ビットデータ(D)とステップ102−4においてレジ
スタ40に格納されたデータ(F)とに対して論理和演
算を実行する。ALU60の出力は、中位データとして
レジスタ71に格納される。
Step 103-3: The ALU 60 logically processes the middle-order bit data (D) output from the shifter 20 in step 103-2 and the data (F) stored in the register 40 in step 102-4. Performs a sum operation. The output of the ALU 60 is stored in the register 71 as medium data.

【0090】ステップ103−4:マルチプレクサ30
は、ステップ103−2においてシフタ20から出力さ
れた上位ビットデータ(B)と下位ビットデータ(C)
のうち上位ビットデータ(B)を選択する。選択された
上位ビットデータ(B)はレジスタ40に格納される。
Step 103-4: Multiplexer 30
Is the upper bit data (B) and the lower bit data (C) output from the shifter 20 in step 103-2.
Of these, the upper bit data (B) is selected. The selected upper bit data (B) is stored in the register 40.

【0091】ステップ104−1:レジスタ70から上
位データが読み出され、上位データはデータ(A)とし
てシフタ20に入力される。
Step 104-1: The upper data is read from the register 70, and the upper data is input to the shifter 20 as data (A).

【0092】ステップ104−2:シフタ20は、上位
データを左にNビットだけ論理シフトすることにより、
上位ビットデータ(B)と中位ビットデータ(D)と下
位ビットデータ(C)とを出力する。
Step 104-2: The shifter 20 logically shifts the upper data to the left by N bits,
The high-order bit data (B), the middle-order bit data (D), and the low-order bit data (C) are output.

【0093】ステップ104−3:ALU60は、ステ
ップ104−2においてシフタ20から出力された中位
ビットデータ(D)とステップ103−4においてレジ
スタ40に格納されたデータ(F)とに対して論理和演
算を実行する。ALU60の出力は、上位データとして
レジスタ70に格納される。
Step 104-3: The ALU 60 logically processes the middle-order bit data (D) output from the shifter 20 in step 104-2 and the data (F) stored in the register 40 in step 103-4. Performs a sum operation. The output of the ALU 60 is stored in the register 70 as upper data.

【0094】このようにして、左Nビットの3倍精度シ
フト演算が実現される。なお、上述の処理において、ス
テップ102−1〜102−4は、プログラムの実行に
おける1ステップにおいて実行され、ステップ103−
1〜103−4は、プログラムの実行における1ステッ
プにおいて実行され、ステップ104−1〜104−3
は、プログラムの実行における1ステップにおいて実行
される。
In this way, the left N-bit triple precision shift operation is realized. In the above process, steps 102-1 to 102-4 are executed in one step in the execution of the program, and step 103-
1 to 103-4 are executed in one step in the execution of the program, and steps 104-1 to 104-3 are executed.
Is executed in one step in the execution of the program.

【0095】なお、上位16ビットデータと中位16ビ
ットデータと下位16ビットデータとからなる3倍精度
データを左にNビットだけ算術シフトする場合には、上
述したステップ104−2において、論理シフトの代わ
りに算術シフトを実行すればよい。論理シフトか算術シ
フトかは上位データにのみ関連するからである。
When triple-precision data consisting of upper 16-bit data, middle 16-bit data, and lower 16-bit data is arithmetically shifted to the left by N bits, logical shift is performed in step 104-2 described above. Instead of, you can do an arithmetic shift. This is because the logical shift or arithmetic shift is related only to the upper data.

【0096】同様にして、右Nビットの3倍精度シフト
演算を行うこともできる。
Similarly, a right N-bit triple precision shift operation can be performed.

【0097】さらに、一般に、NビットのM倍精度シフ
ト演算を行うことができる。ここで、Mは3以上の整数
である。図7を参照して既に説明した3倍精度シフト演
算の処理はM=3の例である。
Further, in general, an N-bit M double precision shift operation can be performed. Here, M is an integer of 3 or more. The processing of the triple precision shift operation already described with reference to FIG. 7 is an example of M = 3.

【0098】以下、図8を参照して、NビットのM倍精
度シフト演算の処理の手順を説明する。NビットのM倍
精度シフト演算の処理は、処理1と(M−2)回繰り返
される処理2と処理3とを含んでいる。ここで、被シフ
トデータであるM倍精度データは、1個の単精度の第1
データと(M−2)個の単精度の第2データと1個の単
精度の第3データとからなると仮定する。ただし、シフ
ト方向が左である場合には、第3データ、第2データ、
第1データの順に上位ビットのデータであるとし、シフ
ト方向が右である場合には、第1データ、第2データ、
第3データの順に上位ビットのデータであるとする。
The procedure of the N-bit M double precision shift operation will be described below with reference to FIG. The processing of the N-bit M double precision shift operation includes processing 1 and processing 2 and processing 3 which are repeated (M−2) times. Here, the M double precision data which is the shifted data is one single precision first
It is assumed that the data consists of (M-2) single-precision second data and one single-precision third data. However, when the shift direction is left, the third data, the second data,
If the shift direction is right, the first data, the second data,
It is assumed that the higher-order data is the third data in order.

【0099】処理1は、以下のステップ801〜804
を含んでいる。
Process 1 is the following steps 801 to 804.
Is included.

【0100】ステップ801:第1データをNビットだ
けシフトすることにより、上位ビットデータ(B)と中
位ビットデータ(D)と下位ビットデータ(C)とを出
力する。
Step 801: By shifting the first data by N bits, upper bit data (B), middle bit data (D) and lower bit data (C) are output.

【0101】ステップ802:ステップ801において
出力された中位ビットデータ(D)をシフト演算の結果
の部分として格納する。
Step 802: The middle-order bit data (D) output at step 801 is stored as a part of the result of the shift operation.

【0102】ステップ803:シフト方向に応じてステ
ップ801において出力された上位ビットデータ(B)
と下位ビットデータ(C)のうちの一方を選択する。
Step 803: Upper bit data (B) output in step 801 according to the shift direction
And lower bit data (C) are selected.

【0103】ステップ804:ステップ803において
選択されたデータを格納する。
Step 804: The data selected in step 803 is stored.

【0104】処理1のステップ803において、シフト
方向が左である場合には、上位ビットデータ(B)が選
択され、シフト方向が右である場合には、下位ビットデ
ータ(C)が選択される。処理1は、上述したステップ
102−1〜102−4に相当する。
In step 803 of process 1, if the shift direction is left, the upper bit data (B) is selected, and if the shift direction is right, the lower bit data (C) is selected. . Process 1 corresponds to steps 102-1 to 102-4 described above.

【0105】処理2は、以下のステップ805〜809
を含んでいる。
The process 2 includes the following steps 805 to 809.
Is included.

【0106】ステップ805:(M−2)個の第2デー
タのうちの1つをNビットだけシフトすることにより、
上位ビットデータ(B)と中位ビットデータ(D)と下
位ビットデータ(C)とを出力する。
Step 805: Shifting one of the (M-2) second data by N bits,
The high-order bit data (B), the middle-order bit data (D), and the low-order bit data (C) are output.

【0107】ステップ806:シフト方向に応じてステ
ップ805において出力された上位ビットデータ(B)
と下位ビットデータ(C)のうちの一方を選択する。
Step 806: Upper bit data (B) output at step 805 according to the shift direction
And lower bit data (C) are selected.

【0108】ステップ807:ステップ806において
選択されたデータを格納する。
Step 807: The data selected in step 806 is stored.

【0109】ステップ808:ステップ805において
出力された中位ビットデータ(D)とステップ804及
びステップ807において最も最近に格納されたデータ
とを結合する。この結合は、例えば、論理和演算を実行
することによって達成される。
Step 808: The middle-order bit data (D) output in step 805 is combined with the most recently stored data in steps 804 and 807. This combination is achieved, for example, by performing an OR operation.

【0110】ステップ809:ステップ808において
結合されたデータをシフト演算の結果の部分として格納
する。
Step 809: The data combined in step 808 is stored as a part of the result of the shift operation.

【0111】処理2のステップ806において、シフト
方向が左である場合には、上位ビットデータ(B)が選
択され、シフト方向が右である場合には、下位ビットデ
ータ(C)が選択される。処理2は、上述したステップ
103−1〜103−4に相当する。
In step 806 of process 2, if the shift direction is left, the upper bit data (B) is selected, and if the shift direction is right, the lower bit data (C) is selected. . Process 2 corresponds to steps 103-1 to 103-4 described above.

【0112】処理3は、以下のステップ810〜812
を含んでいる。
Process 3 is the following steps 810 to 812.
Is included.

【0113】ステップ810:第3データをNビットだ
けシフトすることにより、上位ビットデータ(B)と中
位ビットデータ(D)と下位ビットデータ(C)とを出
力する。
Step 810: The upper bit data (B), the middle bit data (D) and the lower bit data (C) are output by shifting the third data by N bits.

【0114】ステップ811:ステップ810において
出力された中位ビットデータ(D)とステップ807に
おいて最も最近に格納されたデータとを結合する。この
結合は、例えば、論理和演算を実行することによって達
成される。
Step 811: The middle-order bit data (D) output at step 810 and the data most recently stored at step 807 are combined. This combination is achieved, for example, by performing an OR operation.

【0115】ステップ812:ステップ811において
結合されたデータをシフト演算の結果の部分として格納
する。
Step 812: The data combined in step 811 is stored as a part of the result of the shift operation.

【0116】処理3は、上述したステップ104−1〜
104−3に相当する。
Process 3 is the above-described step 104-1.
It corresponds to 104-3.

【0117】このようにして、M回のシフト操作によ
り、M倍精度シフト演算が実現される。処理1と処理2
と処理3のそれぞれは、プログラム実行における1ステ
ップにおいて実行される。処理2は、(M−2)回繰り
返される。従って、M倍精度シフト演算は、シフト数の
設定を除いてMステップで実現される。M倍精度シフト
演算を実行するためには、多数のレジスタが必要とされ
る。しかし、データをいったん退避するなどの公知の手
法を用いることにより、レジスタの数を削減することが
できる。
In this way, M double precision shift operations are realized by M times of shift operations. Process 1 and process 2
And the process 3 are each executed in one step in the program execution. Process 2 is repeated (M-2) times. Therefore, the M double precision shift operation is realized in M steps except for the setting of the shift number. A large number of registers are required to perform the M double precision shift operation. However, the number of registers can be reduced by using a known method such as temporarily saving data.

【0118】[0118]

【発明の効果】本発明によれば、倍精度データを左にシ
フトする場合には、その左シフトにより下位データから
あふれたデータがレジスタに格納され、そのレジスタに
格納されたデータと上位データを左シフトした結果とが
結合される。また、倍精度データを右にシフトする場合
には、その右シフトにより上位データからあふれたデー
タがレジスタに格納され、そのレジスタに格納されたデ
ータと下位データを右シフトした結果とが結合される。
このように、倍精度データのシフト演算は、2回のシフ
ト操作により実現される。従って、従来のシフト演算装
置を用いた倍精度データのシフト演算に比べてシフト操
作を1回削減することができる。上述したように、LD
−CELPにおいては、約50万回/秒の倍精度シフト
演算が実行される。倍精度シフト演算におけるシフト操
作を1回削減することにより、プログラム実行時におけ
る動的ステップを50万ステップ/秒だけ削減すること
ができる。これにより、倍精度シフト演算を含む処理が
大幅に高速化される。また、プログラム実行時における
動的ステップの削減に相当する時間に他の処理を実行す
るようにしてもよい。あるいは、その削減に相当する時
間に処理を行わないこととして低電力化を図ることもで
きる。
According to the present invention, when the double-precision data is shifted to the left, the data that overflows from the lower data is stored in the register by the left shift, and the data stored in the register and the upper data are combined. The result of the left shift is combined with the result. When the double-precision data is shifted to the right, the data shifted from the upper data is stored in the register by the right shift, and the data stored in the register and the result of right-shifting the lower data are combined. .
In this way, the shift calculation of double-precision data is realized by two shift operations. Therefore, the number of shift operations can be reduced once as compared with the shift calculation of double precision data using the conventional shift calculation device. As mentioned above, LD
In -CELP, a double precision shift operation of about 500,000 times / sec is executed. By reducing the shift operation once in the double-precision shift operation, it is possible to reduce the number of dynamic steps during program execution by 500,000 steps / second. This significantly speeds up the processing including the double-precision shift operation. Further, other processing may be executed at a time corresponding to the reduction of dynamic steps when executing a program. Alternatively, it is possible to reduce the power consumption by not performing the processing in the time corresponding to the reduction.

【0119】同様にして、本発明によれば、M倍精度デ
ータのシフト演算をM回のシフト操作により実現するこ
とができる。ここで、Mは3以上の整数である。これに
より、多倍精度データのシフト演算を効率よく行なうこ
とができる。
Similarly, according to the present invention, a shift operation of M double precision data can be realized by M shift operations. Here, M is an integer of 3 or more. As a result, the shift calculation of multi-precision data can be efficiently performed.

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

【図1】本発明によるシフト演算装置の実施例の構成を
示す図である。
FIG. 1 is a diagram showing a configuration of an embodiment of a shift arithmetic unit according to the present invention.

【図2】本発明によるシフト演算装置の他の実施例の構
成を示す図である。
FIG. 2 is a diagram showing a configuration of another embodiment of the shift arithmetic unit according to the present invention.

【図3】図1に示されるシフタ20の構成を示す図であ
る。
FIG. 3 is a diagram showing a configuration of a shifter 20 shown in FIG.

【図4】図3に示される左2ビットシフタ302の構成
を示す図である。
4 is a diagram showing a configuration of a left 2-bit shifter 302 shown in FIG.

【図5】本発明による左Nビット倍精度シフト演算の処
理を模式的に示す図である。
FIG. 5 is a diagram schematically showing processing of a left N-bit double precision shift operation according to the present invention.

【図6】本発明による右Nビット倍精度シフト演算の処
理を模式的に示す図である。
FIG. 6 is a diagram schematically showing a process of a right N-bit double precision shift operation according to the present invention.

【図7】本発明による左Nビット3倍精度シフト演算の
処理を模式的に示す図である。
FIG. 7 is a diagram schematically showing processing of left N-bit triple precision shift operation according to the present invention.

【図8】本発明によるNビットM倍精度シフト演算の処
理を示すフローチャートである。
FIG. 8 is a flowchart showing a process of an N-bit M double precision shift operation according to the present invention.

【図9】従来のシフト演算装置の構成を示す図である。FIG. 9 is a diagram showing a configuration of a conventional shift calculation device.

【図10】従来の倍精度シフト演算の処理を模式的に示
す図である。
FIG. 10 is a diagram schematically showing a conventional double precision shift calculation process.

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

10、40、70、71 レジスタ 20 シフタ 30、50 マルチプレクサ 60 演算器(ALU) 90 制御回路 10, 40, 70, 71 register 20 shifter 30, 50 multiplexer 60 arithmetic unit (ALU) 90 control circuit

Claims (14)

【特許請求の範囲】[Claims] 【請求項1】 シフト数に応じてデータをシフトするこ
とにより、上位ビットデータと中位ビットデータと下位
ビットデータとを出力するシフト手段と、 該シフト手段の出力に結合され、シフト方向に応じて該
上位ビットデータと該下位ビットデータのうちの一方を
選択する第1選択手段と、 該第1選択手段の出力に結合され、該第1選択手段によ
って選択されたデータを格納する第1格納手段と、 該シフト手段の出力と該第1格納手段の出力とに結合さ
れ、該中位ビットデータと該第1格納手段に格納された
該データとに演算することにより、演算結果を出力する
演算手段と、 該演算手段の出力に結合され、該演算結果を格納する第
2格納手段とを備えたシフト演算装置。
1. A shift means for outputting high-order bit data, middle-order bit data, and low-order bit data by shifting data according to the number of shifts, and a shift means coupled to the output of the shift means, depending on the shift direction. A first selecting means for selecting one of the upper bit data and the lower bit data, and a first storage coupled to an output of the first selecting means for storing the data selected by the first selecting means. Means, and an output of the shift means and an output of the first storage means, and outputs a calculation result by performing an operation on the middle-order bit data and the data stored in the first storage means. A shift arithmetic device comprising: arithmetic means; and a second storage means coupled to an output of the arithmetic means and storing the arithmetic result.
【請求項2】 前記シフト演算装置は、 更なるデータを受け取り、制御信号に応じて該更なるデ
ータと前記第1格納手段に格納された前記データとのう
ちの一方を選択する第2選択手段をさらに備えており、
該第2選択手段の出力が前記演算手段に入力される、請
求項1に記載のシフト演算装置。
2. The shift computing device receives second data, and selects one of the further data and the data stored in the first storage device according to a control signal. Is further equipped with
The shift arithmetic unit according to claim 1, wherein an output of the second selecting unit is input to the arithmetic unit.
【請求項3】 前記シフト手段は、m個の2kビットシ
フタ(k=0,1,...,m−1)と、2mビットシ
フタと、前記シフト数をデコードすることにより、該m
個の2kビットシフタ(k=0,1,...,m−1)
及び該2mビットシフタのそれぞれにシフト動作を行う
か否かを示す制御信号を供給するデコード手段とを備え
ており、mは1以上の整数である、請求項1に記載のシ
フト演算装置。
3. The shift means decodes the m 2 k- bit shifters (k = 0, 1, ..., M-1), 2 m- bit shifters, and the shift number to obtain the m bits.
2 k- bit shifters (k = 0, 1, ..., M-1)
The shift operation device according to claim 1, further comprising: a decoding unit that supplies a control signal indicating whether or not to perform a shift operation to each of the 2 m bit shifters, and m is an integer of 1 or more.
【請求項4】 前記2m-1ビットシフタの出力の一部
は、前記第1選択手段の出力に等しい、請求項3に記載
のシフト演算装置。
4. The shift arithmetic unit according to claim 3, wherein a part of the output of the 2 m-1 bit shifter is equal to the output of the first selecting means.
【請求項5】 前記第2格納手段は、前記演算結果の部
分をそれぞれ格納する複数のレジスタを含んでいる、請
求項1に記載のシフト演算装置。
5. The shift operation device according to claim 1, wherein the second storage means includes a plurality of registers that respectively store the operation result portions.
【請求項6】 前記第2格納手段は、前記データの部分
をそれぞれ格納する複数のレジスタと、前記演算結果の
部分をそれぞれ格納する複数のレジスタとを含んでい
る、請求項1に記載のシフト演算装置。
6. The shift according to claim 1, wherein the second storage means includes a plurality of registers that respectively store the data portion and a plurality of registers that respectively store the operation result portion. Arithmetic unit.
【請求項7】 第1データと第2データとを用いて、倍
精度のシフト演算を行うシフト演算方法であって、 a)シフト数に応じて該第1データをシフトすることに
より、上位ビットデータと中位ビットデータと下位ビッ
トデータとを出力するステップと、 b)ステップa)において出力された該中位ビットデー
タを該シフト演算の結果の部分として格納するステップ
と、 c)シフト方向に応じてステップa)において出力され
た該上位ビットデータと該下位ビットデータのうちの一
方を選択するステップと、 d)ステップc)において選択されたデータを格納する
ステップと、 e)該シフト数に応じて該第2データをシフトすること
により、上位ビットデータと中位ビットデータと下位ビ
ットデータとを出力するステップと、 f)ステップe)において出力された該中位ビットデー
タとステップd)において格納された該データとを結合
するステップと、 g)ステップf)において結合された該データを該シフ
ト演算の結果の部分として格納するステップとを包含す
るシフト演算方法。
7. A shift operation method for performing a double-precision shift operation using first data and second data, comprising: a) shifting the first data in accordance with the number of shifts to obtain high-order bits. Outputting data, middle-order bit data, and lower-order bit data, b) storing the middle-order bit data output in step a) as a part of the result of the shift operation, and c) in the shift direction. Accordingly, the step of selecting one of the upper bit data and the lower bit data output in step a), d) the step of storing the data selected in step c), and e) the shift number. Outputting the high-order bit data, the middle-order bit data, and the low-order bit data by shifting the second data accordingly, and f) the step e) combining the middle bit data output in step d) with the data stored in step d), and g) storing the data combined in step f) as part of the result of the shift operation. A shift operation method including steps.
【請求項8】 ステップf)における結合は、ステップ
e)において出力された前記中位ビットデータとステッ
プd)において格納された前記データとに対して論理和
演算を実行することによって達成される、請求項7に記
載のシフト演算方法。
8. The combining in step f) is accomplished by performing an OR operation on the middle bit data output in step e) and the data stored in step d). The shift calculation method according to claim 7.
【請求項9】 ステップa)〜ステップd)は、プログ
ラムの実行における1ステップにおいて実行され、ステ
ップe)〜ステップg)は、該プログラムの実行におけ
る1ステップにおいて実行される、請求項7に記載のシ
フト演算方法。
9. The method according to claim 7, wherein steps a) to d) are executed in one step in the execution of the program, and steps e) to g) are executed in one step in the execution of the program. Shift calculation method.
【請求項10】 第1データと少なくとも1つの第2デ
ータと第3データとを用いて、多倍精度のシフト演算を
行うシフト演算方法であって、 a)シフト数に応じて該第1データをシフトすることに
より、上位ビットデータと中位ビットデータと下位ビッ
トデータとを出力するステップと、 b)ステップa)において出力された該中位ビットデー
タを該シフト演算の結果の部分として格納するステップ
と、 c)シフト方向に応じてステップa)において出力され
た該上位ビットデータと該下位ビットデータのうちの一
方を選択するステップと、 d)ステップc)において選択されたデータを格納する
ステップと、 e)該シフト数に応じて該少なくとも1つの第2データ
のうちの1つをシフトすることにより、上位ビットデー
タと中位ビットデータと下位ビットデータとを出力する
ステップと、 f)該シフト方向に応じてステップe)において出力さ
れた該上位ビットデータと該下位ビットデータのうちの
一方を選択するステップと、 g)ステップf)において選択されたデータを格納する
ステップと、 h)ステップe)において出力された該中位ビットデー
タとステップd)及びステップg)において最も最近に
格納されたデータとを結合するステップと、 i)ステップh)において結合された該データを該シフ
ト演算の結果の部分として格納するステップと j)該シフト数に応じて該第3データをシフトすること
により、上位ビットデータと中位ビットデータと下位ビ
ットデータとを出力するステップと、 k)ステップj)において出力された該中位ビットデー
タとステップg)において最も最近に格納されたデータ
とを結合するステップと、 l)ステップk)において結合された該データを該シフ
ト演算の結果の部分として格納するステップとを包含す
るシフト演算方法。
10. A shift operation method for performing a multiple precision shift operation using first data and at least one second data and third data, comprising: a) the first data according to the number of shifts. To output the high-order bit data, the middle-order bit data, and the low-order bit data, and b) store the middle-order bit data output in step a) as a part of the result of the shift operation. And c) selecting one of the upper bit data and the lower bit data output in step a) according to the shift direction, and d) storing the data selected in step c). And e) shifting one of the at least one second data according to the shift number to obtain a high-order bit data and a middle-order bit. Data and lower bit data, f) selecting one of the higher bit data and the lower bit data output in step e) according to the shift direction, and g) step f) storing the selected data, h) combining the middle bit data output in step e) with the most recently stored data in steps d) and g), i) storing the combined data in step h) as a part of the result of the shift operation; and j) shifting the third data according to the number of shifts to obtain upper bit data and middle bit data. And k) outputting the lower-order bit data, and k) the step of outputting the middle-order bit data output in step j). Most recently stored the data coupling a, l) shift operation method comprising the steps of storing the data combined in step k) as a result of part of the shift operation in g).
【請求項11】 ステップh)における結合は、ステッ
プe)において出力された前記中位ビットデータとステ
ップd)及びステップg)において最も最近に格納され
た前記データとに対して論理和演算を実行することによ
って達成される、請求項10に記載のシフト演算方法。
11. The combining in step h) performs an OR operation on the middle-bit data output in step e) and the most recently stored data in steps d) and g). The shift arithmetic method according to claim 10, which is achieved by
【請求項12】 ステップk)における結合は、ステッ
プj)において出力された前記中位ビットデータとステ
ップg)において最も最近に格納された前記データとに
対して論理和演算を実行することによって達成される、
請求項10に記載のシフト演算方法。
12. Combining in step k) is accomplished by performing an OR operation on the middle bit data output in step j) and the data most recently stored in step g). Will be
The shift calculation method according to claim 10.
【請求項13】 ステップa)〜ステップd)は、プロ
グラムの実行における1ステップにおいて実行され、ス
テップe)〜ステップi)は、該プログラムの実行にお
ける1ステップにおいて実行され、ステップj)〜ステ
ップl)は、該プログラムの実行における1ステップに
おいて実行される、請求項10に記載のシフト演算方
法。
13. Steps a) to d) are executed in one step in the execution of the program, steps e) to i) are executed in one step in the execution of the program, and steps j) to l are executed. ) Is executed in one step in the execution of the program, the shift operation method according to claim 10.
【請求項14】 前記シフト演算方法は、ステップe)
〜ステップi)を繰り返すステップをさらに包含する、
請求項10に記載のシフト演算方法。
14. The shift calculation method comprises step e).
~ Further comprising repeating step i),
The shift calculation method according to claim 10.
JP2027395A 1994-02-18 1995-02-08 Unit and method for shift arithmetic Pending JPH07281870A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2027395A JPH07281870A (en) 1994-02-18 1995-02-08 Unit and method for shift arithmetic

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP6-21037 1994-02-18
JP2103794 1994-02-18
JP2027395A JPH07281870A (en) 1994-02-18 1995-02-08 Unit and method for shift arithmetic

Publications (1)

Publication Number Publication Date
JPH07281870A true JPH07281870A (en) 1995-10-27

Family

ID=26357181

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2027395A Pending JPH07281870A (en) 1994-02-18 1995-02-08 Unit and method for shift arithmetic

Country Status (1)

Country Link
JP (1) JPH07281870A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5750049A (en) * 1980-09-09 1982-03-24 Toshiba Corp Shifting circuit
JPS62249228A (en) * 1986-04-22 1987-10-30 Nec Corp Shift device
JPS62249227A (en) * 1986-04-22 1987-10-30 Nec Corp Shift device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5750049A (en) * 1980-09-09 1982-03-24 Toshiba Corp Shifting circuit
JPS62249228A (en) * 1986-04-22 1987-10-30 Nec Corp Shift device
JPS62249227A (en) * 1986-04-22 1987-10-30 Nec Corp Shift device

Similar Documents

Publication Publication Date Title
JP5273866B2 (en) Multiplier / accumulator unit
US6209017B1 (en) High speed digital signal processor
US7047272B2 (en) Rounding mechanisms in processors
KR100470299B1 (en) Processing multiply-accumulate operations in a single cycle
US7395304B2 (en) Method and apparatus for performing single-cycle addition or subtraction and comparison in redundant form arithmetic
US5633897A (en) Digital signal processor optimized for decoding a signal encoded in accordance with a Viterbi algorithm
JP3667635B2 (en) Arithmetic unit
JP3487903B2 (en) Arithmetic device and arithmetic method
US5426600A (en) Double precision division circuit and method for digital signal processor
US6754689B2 (en) Method and apparatus for performing subtraction in redundant form arithmetic
JPH064271A (en) Multiplier
US5559730A (en) Shift operation unit and shift operation method
JPH05134851A (en) Multiplying circuit output system
US6314507B1 (en) Address generation unit
US6269385B1 (en) Apparatus and method for performing rounding and addition in parallel in floating point multiplier
JPH09222991A (en) Adding method and adder
JPH0546363A (en) Divider
JPH07281870A (en) Unit and method for shift arithmetic
JPH10503311A (en) Galois field polynomial multiply / divide circuit and digital signal processor incorporating the same
Verbauwhede et al. A low power DSP engine for wireless communications
US6122651A (en) Method and apparatus for performing overshifted rotate through carry instructions by shifting in opposite directions
JPH1063500A (en) Signal processor
JPS62197868A (en) Linear approximation conversion circuit for pipeline construction
JPH09311779A (en) Multiplier and digital signal processor using the same
JP2002157114A (en) Multiplier and integrated circuit device having the same

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19991111