JPH0474218A - Arithmetic circuit - Google Patents

Arithmetic circuit

Info

Publication number
JPH0474218A
JPH0474218A JP2188525A JP18852590A JPH0474218A JP H0474218 A JPH0474218 A JP H0474218A JP 2188525 A JP2188525 A JP 2188525A JP 18852590 A JP18852590 A JP 18852590A JP H0474218 A JPH0474218 A JP H0474218A
Authority
JP
Japan
Prior art keywords
circuit
mask
bit
arithmetic
bits
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
JP2188525A
Other languages
Japanese (ja)
Inventor
Koji Doi
土居 晃二
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP2188525A priority Critical patent/JPH0474218A/en
Publication of JPH0474218A publication Critical patent/JPH0474218A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Complex Calculations (AREA)

Abstract

PURPOSE:To keep the interchange ability between the present and conventional types of arithmetic logic operation circuits by adding the hardware to an arithmetic logic operation circuit in order to mask the input and output signals of the arithmetic logic circuit. CONSTITUTION:The output of a 16-bit multiplier 1 passes through a 1st mask circuit 4a, and the circuit 4a masks a specific bit of an input signal based on the contents of a mask circuit control register 5a. Therefore, the low order 16 bits are masked to '0' out of 32 bits of the output signal of the circuit 4a. Then this mask data is shifted to the right by a bt by a 32-bit ALU 2b in terms of arithmetic. This arithmetic result is temporarily inputted to a totalizing register 3b through a 2nd mask circuit 4b. Then the ALU 2b calculates the input data and the contents of a lst totalizing register 3a to add them to the register 3a. Thus this totalizing result is equal to that obtained by a DSPI. Then the interchangeability is kept between the present and conventional types of arithmetic logic operation circuits.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、マイクロプロセッサの演算回路に関する。[Detailed description of the invention] [Industrial application field] The present invention relates to an arithmetic circuit for a microprocessor.

〔従来の技術〕[Conventional technology]

近年、LSIのデバイス技術の向上により、マイクロプ
ロセッサのデータビット幅は、従来の8ビツト、16ビ
ツトから、32ビット、64ビツトへと大きくなってき
ている。
In recent years, due to improvements in LSI device technology, the data bit width of microprocessors has increased from the conventional 8 bits and 16 bits to 32 bits and 64 bits.

その結果、マイクロプロセッサの算術論理演算回路く以
下ALUと記す)のビット数もデータビット幅の増加に
伴ない大きくなってきている。
As a result, the number of bits in the arithmetic and logic operation circuit (hereinafter referred to as ALU) of microprocessors has increased as the data bit width has increased.

然るに、一方で、国際電信電話諮問委員会勧告(CCI
TT  Recommendation)G、721で
勧告されている音声符号化のように、演算精度が規格に
よって定められているようなアプリケーションも存在す
る。
However, on the other hand, the International Telegraph and Telephone Consultative Committee Recommendations (CCI)
There are also applications for which calculation accuracy is determined by standards, such as audio encoding recommended in TT Recommendation) G., 721.

このような特定のアプリケーションにおいては、演算精
度における互換性が必要になるため、従来のものより多
ビットのマイクロプロセッサを使用する時でも、従来の
マイクロプロセッサと同一のビット数で演算することが
必要になる。
In these specific applications, compatibility in calculation accuracy is required, so even when using a microprocessor with more bits than a conventional one, it is necessary to perform calculations with the same number of bits as a conventional microprocessor. become.

しかし、従来のマイクロプロセッサにおけるALUでは
、例えは、32ビツトALUでは32ビット精度の演算
しかできないため、演算精度における互換性を保つため
には、ソフトウェアでデータを補正しなければならなか
った。
However, in the ALU in a conventional microprocessor, for example, a 32-bit ALU can only perform calculations with 32-bit precision, so in order to maintain compatibility in calculation precision, data had to be corrected by software.

従来性なわれているデータ補正の例として、DSP (
デジタル シグナル プロセッサ :Digital 
 Signal  Processer)を例に挙げて
説明する。
As an example of conventional data correction, DSP (
Digital signal processor: Digital
This will be explained by taking the signal processor as an example.

第5図は、従来のDSPの第1の例の構成を示すブロッ
ク図である。
FIG. 5 is a block diagram showing the configuration of a first example of a conventional DSP.

この第1の例では、DSPは、16ビツトの乗算器1と
、16ビツトのALU2aと、第1累算レジスタ3aと
からなっている。以後、この従来のDSPの第1の例を
、DSP Iと記すこととする。
In this first example, the DSP consists of a 16-bit multiplier 1, a 16-bit ALU 2a, and a first accumulation register 3a. Hereinafter, this first example of the conventional DSP will be referred to as DSP I.

第6図は、従来のDSPの第2の例の構成を示すブロッ
ク図である。
FIG. 6 is a block diagram showing the configuration of a second example of a conventional DSP.

第2の例ては、DSPは、16ヒントの乗算器1と、3
2ビツトのALTJ2bと、第1累算レジスタ3a及び
第2累算レジスタ3bとからなっている。以後、この従
来のDSPの第2の例を、DSP[と記すこととする。
In the second example, the DSP has 16 hint multipliers 1 and 3
It consists of a 2-bit ALTJ2b, a first accumulation register 3a, and a second accumulation register 3b. Hereinafter, this second example of the conventional DSP will be referred to as DSP.

なお、16ビツトの乗算器とは、乗数、被乗数とも16
ビツトであり、結果が32ビットの乗算器である。
Note that a 16-bit multiplier means that both the multiplier and the multiplicand are 16
The result is a 32-bit multiplier.

又、以下に述べる説明中では、二つのDSPのデータフ
ォーマットは、第7図に示すような固定小数点2の補数
表示とする。
In the following explanation, it is assumed that the data formats of the two DSPs are fixed-point two's complement representation as shown in FIG.

演算の例として、 のような積和演算を考え、al及びXlは、例として、
第8図に示すようなデータであるものとする。
As an example of an operation, consider a product-sum operation such as, and al and Xl are, for example,
Assume that the data is as shown in FIG.

又、ここでは、簡単のため、al及びXlは小数点以下
4桁の10進数であるとする。
Further, here, for simplicity, it is assumed that al and Xl are decimal numbers with four digits after the decimal point.

従って、以下の説明ては、仮想的に、16ビットの2進
数は小数点以下4桁の10進数に、32ビットの2進数
は小数点以下8桁の10進数に置き替えて説明する。
Therefore, in the following explanation, a 16-bit binary number will be hypothetically replaced with a decimal number with 4 digits after the decimal point, and a 32-bit binary number will be hypothetically replaced with a decimal number with 8 digits after the decimal point.

又、0式、の中の2−1は、2進数では右1ビツト算術
シフトを示すか、ここでは、2進数の右1ビツト算術シ
フトを、10進数での右1桁算術シフトとして置き替え
て考える。
Also, 2-1 in the 0 expression indicates a 1-bit arithmetic shift to the right in binary, or here, the 1-bit arithmetic shift to the right in binary is replaced as a 1-digit arithmetic shift to the right in decimal. I think about it.

上記の演算の処理の手順は以下の通りとなる。The processing procedure for the above calculation is as follows.

1)al  −X+の計算く乗算)を行う。1) Perform the calculation (multiplication of al -X+).

+2) (1)の結果を右1ビツト算術シフト(ALU
演算)する。
+2) The result of (1) is arithmetic shifted 1 bit to the right (ALU
calculation).

(31F2+の結果を累算(ALU演算)する。(31F2+ results are accumulated (ALU operation).

先ず、DSPIでの演算結果について説明する。First, the calculation results in DSPI will be explained.

初めに、第8図の各行に示すal及びX+の組み合わせ
に対して、乗算器1の出力aI −Xは、第8図中A欄
で示すような32ビツトの値になる。
First, for the combinations of al and X+ shown in each row of FIG. 8, the output aI-X of multiplier 1 becomes a 32-bit value as shown in column A in FIG.

しかし、このDSP ■では、ALU2aが16ビット
であるため、乗算器1の出力は1.へLじ2aの入力部
で、32ビットのうち下位1f:)ヒ・ソトか切り捨て
られて16ビットのデータとなり、実際にA L U 
2 aて演算される値は第8図中り欄で示すようになる
However, in this DSP (2), since the ALU 2a is 16 bits, the output of the multiplier 1 is 1. At the input section of L2a, the lower 1f of the 32 bits is truncated and becomes 16-bit data, which is actually A L U
The values calculated using 2a are shown in the middle column of FIG.

次に、このデータをALU2aて右1ビット算術シフト
する。この時、ALU2aか16ビットであるので、デ
ータの最下位ビットがこのシフトによってビット落ちを
起こし、結果として第8図中E欄て示すような値になる
Next, this data is arithmetic shifted to the right by 1 bit using the ALU 2a. At this time, since the ALU 2a is 16 bits, the least significant bit of the data is dropped due to this shift, resulting in a value as shown in column E in FIG.

次に、この値をALU2aで演算して第1累算レジスタ
3aへ累算する。
Next, this value is calculated by the ALU 2a and accumulated in the first accumulation register 3a.

累算結果は、”0.0566”である。The cumulative result is "0.0566".

次に、同じ演算をDSPIIで実行する場合について述
べる。
Next, a case will be described in which the same operation is executed by DSPII.

この場合は、乗算器1か前述のDSP Iに用いられた
ものと同しであるのて、乗算器1の出力は前述と同じ結
果となり、第8図中A欄で示される。
In this case, since multiplier 1 is the same as that used in the DSP I described above, the output of multiplier 1 is the same as described above, and is shown in column A in FIG.

次に、この乗算結果を右1ビツト算術シフトするが、こ
の場合、DSPIIではALU2bか32ビットである
ので、乗算器1の出力はALU2bでそのままシフトさ
れる。その結果は第8図中B欄のようになる。
Next, this multiplication result is arithmetic shifted by 1 bit to the right. In this case, since ALU 2b is 32 bits in DSPII, the output of multiplier 1 is shifted as is in ALU 2b. The result is as shown in column B in FIG.

それらの値をALU2bで演算し、第1累算レジスタ3
aへ累算すると、その累算結果は′“0.056725
27”となりDSP Iでの結果と異なってしまう。
These values are calculated by ALU2b, and the first accumulation register 3
When it is accumulated to a, the accumulation result is '“0.056725
27'', which is different from the result with DSP I.

次に、このDSPIIでの演算結果をDSP 丁での演
算結果と一致させるための処理、すなわち、演算の途中
結果の同一性を保つための、乗算器1の出力結果の下位
ビットの” o ”へのマスクと、ALU2bの演算結
果の下位ビットの“0パへのマスク処理について考える
Next, processing is performed to match the calculation result of this DSP II with the calculation result of the DSP 2. In other words, in order to maintain the sameness of the intermediate results of the calculation, the lower bits of the output result of the multiplier 1 are changed to "o". Consider masking of the lower bits of the operation result of the ALU 2b to "0".

上述のマスク処理をDSPIIで行なうには、第6図に
示すDSPI[のブロック図における別の累算レジスタ
3bを使用し、以下に述べるような処理が必要になる。
In order to perform the above-mentioned mask processing in the DSP II, it is necessary to use another accumulation register 3b in the block diagram of the DSPI shown in FIG. 6, and to perform the processing described below.

なお、以下の説明では、DSPIIでは乗算器1の高力
結果を第2累算レジスタ3bへ転送することが可能であ
り、又、ALU2bで第2累算レジスタ3bと直接デー
タの演算が可能であるものとする。
In addition, in the following explanation, it is possible to transfer the high-power result of the multiplier 1 to the second accumulation register 3b in the DSPII, and it is also possible to perform data calculations directly with the second accumulation register 3b in the ALU 2b. Assume that there is.

もしこのことが可能でないDSPならば更に処理量が増
加するが、説明内容の本質には変りかない。
If the DSP is not capable of this, the amount of processing will further increase, but the essence of the explanation will not change.

マスク処理を伴うDSPnの処理は、下記のとうりであ
る。
DSPn processing involving mask processing is as follows.

(1)乗算器1の出力を第2累算レジスタ3bへ転送す
る。
(1) Transfer the output of multiplier 1 to second accumulation register 3b.

(2)第2累算レジスタ3bの内容と、“’FFFF0
OOO“°とのANDを演算し、その結果を第2累算レ
ジスタ3bへ転送する。
(2) The contents of the second accumulation register 3b and “'FFFF0
An AND operation is performed with OOO"°, and the result is transferred to the second accumulation register 3b.

(3)第2累算レジスタ3bの内容を右1ビツト算術シ
フトする。
(3) Arithmetic shift the contents of the second accumulation register 3b to the right by 1 bit.

(4)第2累算レジスタ3bの内容と、“FFFF0O
OO”とのANDを演算し、その結果を第2累算レジス
タ3bへ転送する。
(4) The contents of the second accumulation register 3b and “FFFF0O
OO'' and transfers the result to the second accumulation register 3b.

(5)第1累算レジスタ3aの内容と、第2累算レジス
タ3bとの内容を加算し、その結果を第1累算レジスタ
3aへ転送する。
(5) Add the contents of the first accumulation register 3a and the contents of the second accumulation register 3b, and transfer the result to the first accumulation register 3a.

以上の処理によって、DSPIIでの演算結果は、”0
.05660000” となり、DSP Jでの結果と
同一の結果が得られる。
Through the above processing, the calculation result in DSPII is “0”.
.. 05660000'', and the same result as that obtained with DSP J is obtained.

以上の説明では、上記の処理中、(2)及び(4)のマ
スク処理がDSP Iでの処理に対して追加となる。
In the above description, during the above processing, the masking processing in (2) and (4) is added to the processing in the DSP I.

従って、この例では8個のデータを累算しているので、
全体で32ステップ分の増加となる。
Therefore, in this example, 8 pieces of data are accumulated, so
This is a total increase of 32 steps.

このような処理の増加は、32ビツトである乗算器の出
力を16ビツトのデータとしてALUで扱う場合には常
に生ずることである。
Such an increase in processing always occurs when the output of a 32-bit multiplier is treated as 16-bit data by the ALU.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

以上説明したように、従来の演算回路の構成では、AL
Uのビット数を増加させた場合、従来機種との演算にお
ける互換性が失われるという欠点があり、これを避けて
、演算の互換性を保つためには、補正のためのソフトウ
ェア処理を追加しなければならず、処理ステップが増加
する。
As explained above, in the conventional arithmetic circuit configuration, the AL
Increasing the number of bits in U has the disadvantage of losing computation compatibility with conventional models.In order to avoid this and maintain computation compatibility, software processing for correction must be added. additional processing steps.

本発明の目的は、多ビットのALUを用いな場合におい
て、これより少ないビットの演算を簡単に、又、任意の
ビット数て行う回路を提供し、従来ソフトウェアで行な
われていた処理を行わなくても、従来機種との互換性を
保てるようにすることにある。
An object of the present invention is to provide a circuit that easily performs operations with fewer bits and with an arbitrary number of bits when a multi-bit ALU is not used, thereby eliminating the need for processing that was conventionally performed using software. However, the aim is to maintain compatibility with previous models.

〔課題を解決するための手段〕[Means to solve the problem]

本発明の演算回路は、 入力信号の任意のビットを二値の一方の値にマスクして
算術論理演算回路に出力する第1のマスク回路と、 前記第1のマスク回路の出力と累算レジスタの出力との
算術及び論理演算を行なう算術論理演算回路と、 前記算術論理演算回路の演算結果の任意のビットを二値
の一方の値にマスクして前記累算レジスタに出力する第
2のマスク回路と、 前記第2のマスク回路の出力を格納する前記累算レジス
タと、 前記第1及び第2のマスク回路がマスクする内容を指定
するマスク情報を格納するレジスタとを有することを特
徴とする。
The arithmetic circuit of the present invention includes: a first mask circuit that masks an arbitrary bit of an input signal into one of two values and outputs the masked value to an arithmetic and logic operation circuit; and an output of the first mask circuit and an accumulation register. an arithmetic and logic operation circuit that performs arithmetic and logical operations with the output of the arithmetic and logic operation circuit; and a second mask that masks any bit of the operation result of the arithmetic and logic operation circuit into one of two values and outputs it to the accumulation register. A circuit, the accumulation register storing the output of the second mask circuit, and a register storing mask information specifying contents to be masked by the first and second mask circuits. .

〔実施例〕〔Example〕

次に、本発明について、図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は、本発明の第1の実施例によるDSPの構成を
示すブロック図である。
FIG. 1 is a block diagram showing the configuration of a DSP according to a first embodiment of the present invention.

このDSPは、第1図に示すように、16ビツトの乗算
器1.第1マスク回路4a、32ビツトのALU2b、
第2マスク回路4b、第1累算レジスタ3a、第2累算
レジスタ3b及びマスク回路制御レジスタ(以後制御レ
ジスタと記す>5aとから構成されている。
As shown in FIG. 1, this DSP consists of 16-bit multipliers 1. A first mask circuit 4a, a 32-bit ALU 2b,
It is composed of a second mask circuit 4b, a first accumulation register 3a, a second accumulation register 3b, and a mask circuit control register (hereinafter referred to as a control register>5a).

ALU2bは、従来のDSPIIと同様に32ビツトで
ある。
ALU2b is 32 bits like the conventional DSPII.

上記の構成のDSPにおいて、第1マスク回路4a及び
第2マスク回路4bにおけるマスクビット及びマスク極
性は、制御レジスタ5aによって制御される。
In the DSP having the above configuration, the mask bits and mask polarity in the first mask circuit 4a and the second mask circuit 4b are controlled by the control register 5a.

本実施例では、各マスク回路への入力のうち、上位nビ
ット又は下位mビットを連続的にマスクするように制御
レジスタ5aて指定する。
In this embodiment, the control register 5a specifies that the upper n bits or the lower m bits of the input to each mask circuit are to be continuously masked.

例えは、第2図のように、制御レジスタ5aのフォーマ
ットを定める。
For example, as shown in FIG. 2, the format of the control register 5a is determined.

“マスク有無′”は、マスクするかしないかを指定し、
本実施例では、 “1“′か「マスク有り」を、 パ0°“が「マスク無し」を表す。
“Mask presence/absence′” specifies whether to mask or not.
In this embodiment, "1" represents "with mask", and "0°" represents "without mask".

次に、゛マスク極性”′は、マスクする極性を指定し、
本実施例では、 ′“1′°が「”1′″にマスク」を、“0″′が「“
0“にマスク、・を表す。
Next, ``Mask polarity'' specifies the polarity to mask,
In this example, '1'° means "mask to "1'", and "0"' means "mask".
0" represents a mask and .

更に“′上位・下位′°は、マスクする位置か上位ビッ
トか、あるいは下位ビットかを指定し、本実施例では、 “1゛′が「上位ビット」を、 “0″が「下位ビット」を表す。
Furthermore, "'upper/lower'" specifies whether the position to be masked is the upper bit or the lower bit, and in this embodiment, "1" indicates the "upper bit" and "0" indicates the "lower bit". represents.

又、“マスクビット″は、マスクする桁数を指定し、本
実施例では、 “” o o o o o ”が「1ビツト」、“’ 
00001 ”が「2ビツト」と順に指定して、“11
111 ”か「32ビツト」を指定する。
In addition, "mask bit" specifies the number of digits to be masked, and in this embodiment, "" o o o o o" is "1 bit", "'
00001” is specified as “2 bits” in order, and “11
Specify ``111'' or ``32 bit.''

第3図に、上述のマスク処理を実現するためのマスク回
路の例を示す。
FIG. 3 shows an example of a mask circuit for realizing the above-described mask processing.

第3図に示すマスク回路において、制御レジスタ5aの
“マスク有無“′の出力が0°“、すなわち、「マスク
無し」の場合には、デコーダ6の出力及び制御レジスタ
5aの゛マスク極性“の出力の如何に関らす、マスク回
路の入力と出力とは同じものとなり、全ビットともマス
クされない。
In the mask circuit shown in FIG. 3, when the "mask presence/absence" output of the control register 5a is 0°, that is, "no mask", the output of the decoder 6 and the "mask polarity" of the control register 5a are Regardless of the output, the input and output of the mask circuit are the same, and none of the bits are masked.

又、制御レジスタ5aの“マスク有無″′の出力が°゛
1”、すなわち、「マスク有り」の場合には、デコーダ
6の出力が“1″、すなわち、指定されたビットでは、
入力の如何に関らず、出力が、制御レジスタ5aの“マ
スク極性′°の出力と同じものになる。又、上記以外の
ビットでは、゛マスク極性″°の出力の如何に関らず、
入力と出力が同じものになる。
Further, when the output of "masking presence/absence" of the control register 5a is "1", that is, "masked", the output of the decoder 6 is "1", that is, for the specified bit,
Regardless of the input, the output will be the same as the "mask polarity" output of the control register 5a.In addition, for bits other than the above, regardless of the "mask polarity" output,
Input and output will be the same.

すなわち、第3図に示すマスク回路によって、指定され
たビットが、指定された極性にマスクされる。
That is, the designated bit is masked to the designated polarity by the mask circuit shown in FIG.

次に、上述のような構成の本実施例によるDSPによっ
て、前出の積和演算を実行する場合の動作について説明
する。
Next, an explanation will be given of the operation when the above-mentioned sum-of-products operation is executed by the DSP according to this embodiment configured as described above.

なお、この場合、データフォーマットは従来と同様に、
第7図に示すような固定小数点2の補数表現となってい
るものとする。又、説明のために、仮想的に、10進数
を使用することも同様とする。
In this case, the data format is the same as before.
It is assumed that the fixed-point two's complement representation is as shown in FIG. Also, for the sake of explanation, decimal numbers may be used virtually.

第1図において、乗算器1の出力は従来と同様に第8図
中A欄で示される値となる。
In FIG. 1, the output of multiplier 1 becomes the value shown in column A in FIG. 8, as in the conventional case.

この乗算器1の出力は、32ビツトのALU2bに入力
される前に、第1マスク回路4aを通過する。
The output of this multiplier 1 passes through a first mask circuit 4a before being input to the 32-bit ALU 2b.

第1マスク回路4aでは、制御レジスタ5aの内容に従
って、入力信号の特定のビットをマスクする。
The first mask circuit 4a masks specific bits of the input signal according to the contents of the control register 5a.

この場合は、制御レジスタ5aの指定は、下位16ビツ
トを0″にマスクするようになっている。すなわち、”
1001000” である。
In this case, the designation of the control register 5a is such that the lower 16 bits are masked to 0". In other words, "
1001000”.

従って、第1マスク回路4aの出力信号は、32ビット
のうち下位16ビットか“0″にマスクされ、第8図中
り欄に示すデータと同一のデータとなる。
Therefore, the output signal of the first mask circuit 4a is masked to the lower 16 bits of 32 bits or "0", and becomes the same data as shown in the middle column of FIG.

次にこのデータをALU2bで右1ビツト算術シフトす
ると、その結果は第8図C欄のデータとなる。
Next, this data is arithmetic shifted by 1 bit to the right in ALU 2b, and the result becomes the data in column C of FIG.

次に、このALU2bの演算結果を、第2マスク回1i
tlj4bを通して一旦第2累算レジスタ3bへ入力す
る。従って、シフト結果は、第8図中E欄のデータと同
じくなる。
Next, the calculation result of this ALU 2b is applied to the second mask cycle 1i.
It is once input to the second accumulation register 3b through tlj4b. Therefore, the shift result is the same as the data in column E in FIG.

次いで、ALU2bは、このデータと第1累算レジスタ
3aの内容とを演算し、第1累算レジスタ3aへ累算す
るので、その累算結果は、剤述のDSP Iによる累算
結果と同一となる。
Next, the ALU 2b calculates this data and the contents of the first accumulation register 3a, and accumulates it in the first accumulation register 3a, so that the accumulation result is the same as the accumulation result by the DSP I described above. becomes.

以上のマスク処理に伴って余分に必要となる処理は、制
御レジスタ5aヘマスク情報を入力するという1回の処
理だけである。
The only additional process required in conjunction with the above masking process is one process of inputting mask information to the control register 5a.

なお、本実施例では、演算効率を上げるために二つの累
算レジスタを用いたが、累算レジスタは一つでもよく、
その場合は、シフト演算の際に累算値か破壊されないよ
うに、累算値を、−時、例えばデータメモリなどに待避
させればよい。
Note that in this embodiment, two accumulation registers are used to increase calculation efficiency, but it is also possible to use only one accumulation register.
In that case, the accumulated value may be saved, for example, in a data memory, so that the accumulated value is not destroyed during the shift operation.

次に、本発明の第2の実施例について説明する。Next, a second embodiment of the present invention will be described.

第2の実施例は、第1図に示すブロック図において、第
1マスク回#r4a及び第2マスク回路4bの制御方法
を変更したものである。
In the second embodiment, the method of controlling the first mask circuit #r4a and the second mask circuit 4b in the block diagram shown in FIG. 1 is changed.

第4図に、本実施例におけるマスク回路のブロック図を
示す。
FIG. 4 shows a block diagram of the mask circuit in this embodiment.

前述の第1の実施例では、上位nビット又は下位mビッ
トを連続的にマスクするように制御レジスタ上で指定し
たが、第2の実施例では、ビット単位にマスクの有無を
制御するようにしたものである。
In the first embodiment described above, the control register specifies that the upper n bits or the lower m bits are to be masked continuously, but in the second embodiment, the presence or absence of masking is controlled bit by bit. This is what I did.

従って、第2の実施例におけるfilノ御レジスタは、
マスク回路のビット数に1を加えた33ビットで構成さ
れ、最上位ビットがマスクする極性を指定し、次からの
32ビツトが、それぞれマスクするビット位置に対して
、マスクの有無を指定する。
Therefore, the fil control register in the second embodiment is
It consists of 33 bits, which is the number of bits in the mask circuit plus 1. The most significant bit specifies the polarity to be masked, and the next 32 bits specify whether or not to mask each bit position.

二のような制御を実行するためのマスク回路は第4図に
示すような回路で実現できる。
A mask circuit for executing the control described in 2 can be realized by a circuit as shown in FIG.

第4図において、制御レジスタ5bに、例えば、“”0
0000000000000000111111111
1111111 ”を書き込むと、マスク回路4cへの
入力のうち、下位の16ビットが°“0°′にマスクさ
れるので、第1の実施例によるDSPと同じ演算結果が
得られる。
In FIG. 4, the control register 5b contains, for example, ""0.
0000000000000000111111111
When "1111111" is written, the lower 16 bits of the input to the mask circuit 4c are masked to "0", so that the same calculation result as the DSP according to the first embodiment can be obtained.

なお、以上の説明から明らかなように、本発明は、第1
の実施例及び第2の実施例で示したマスク回路の制御方
法及び回路構成に拘束されることなく、これと異なるマ
スク回路制御方法及び回路構成でも同一の効果が得られ
る。
Note that, as is clear from the above description, the present invention
The same effect can be obtained even with a different mask circuit control method and circuit configuration without being restricted by the mask circuit control method and circuit configuration shown in the embodiment and the second embodiment.

又、ALUを32ビツトであるとして説明したが、この
ビット数もなんら特許請求の範囲を制限するものではな
い。
Further, although the ALU has been described as having 32 bits, this number of bits does not limit the scope of the claims in any way.

更に、データフォーマットを2の補数表現として説明し
たが、このことも、特許請求の範囲をなんら制限するも
のでないことも明らかである。
Furthermore, although the data format has been described as two's complement representation, it is clear that this does not limit the scope of the claims in any way.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明によれば、算術論理演算回
路の入力信号及び出力信号をマスクするハードウェアを
この算術論理演算回路に付加することにより、データビ
ット幅が増えても、処理量の増加なしに従来機種の算術
論理演算回路との互換性を保つことのできる演算回路を
提供できるという効果がある。
As explained above, according to the present invention, by adding hardware that masks the input signals and output signals of the arithmetic and logic circuit to the arithmetic and logic circuit, the amount of processing can be reduced even if the data bit width increases. This has the advantage that it is possible to provide an arithmetic circuit that can maintain compatibility with conventional arithmetic and logic circuits without any increase.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は、本発明の第1の実施例によるDSPの構成を
示すブロック図、第2図は、本発明の第1の実施例にお
けるマスク回路制御レジスタのフォーマットを表す図、
第3図は、本発明の第1の実施例におけるマスク回路の
構成を示す回路図、第4図は、本発明の第2の実施例に
おけるマスク回路の構成を示す回路図、第5図は、従来
のDSPの第1の例の構成を示すブロック図、第6図は
、従来のDSPの第2の例の構成を示すブロック図、第
7図は、従来のDSPにおける固定小数点2の補数表現
のデータフォーマットを表す図、第8図は、従来のDS
P及び本発明の実施例によるDSPの動作を説明するた
めの図である。 1・・・乗算器、2a、2b・・・算術論理演算回路(
ALU) 、3a、3b−累算レジスタ、4a4b、4
c・マスク回路、5a、5b・・・マスク回路制御レジ
スタ、6・・・デコーダ。
FIG. 1 is a block diagram showing the configuration of a DSP according to the first embodiment of the present invention, FIG. 2 is a diagram showing the format of the mask circuit control register in the first embodiment of the present invention,
FIG. 3 is a circuit diagram showing the configuration of the mask circuit in the first embodiment of the present invention, FIG. 4 is a circuit diagram showing the configuration of the mask circuit in the second embodiment of the present invention, and FIG. , a block diagram showing the configuration of a first example of a conventional DSP, FIG. 6 is a block diagram showing the configuration of a second example of a conventional DSP, and FIG. 7 is a block diagram showing the configuration of a second example of a conventional DSP. A diagram showing the data format of expression, Figure 8, shows the conventional DS
FIG. 2 is a diagram for explaining the operation of a DSP according to an embodiment of the present invention. 1... Multiplier, 2a, 2b... Arithmetic logic operation circuit (
ALU), 3a, 3b - Accumulation register, 4a4b, 4
c. Mask circuit, 5a, 5b... Mask circuit control register, 6... Decoder.

Claims (1)

【特許請求の範囲】 入力信号の任意のビットを二値の一方の値にマスクして
算術論理演算回路に出力する第1のマスク回路と、 前記第1のマスク回路の出力と累算レジスタの出力との
算術及び論理演算を行なう算術論理演算回路と、 前記算術論理演算回路の演算結果の任意のビットを二値
の一方の値にマスクして前記累算レジスタに出力する第
2のマスク回路と、 前記第2のマスク回路の出力を格納する前記累算レジス
タと、 前記第1及び第2のマスク回路がマスクする内容を指定
するマスク情報を格納するレジスタとを有することを特
徴とする演算回路。
[Scope of Claims] A first mask circuit that masks an arbitrary bit of an input signal into one of two values and outputs it to an arithmetic and logic operation circuit; and an output of the first mask circuit and an accumulation register. an arithmetic and logic operation circuit that performs arithmetic and logical operations with the output; and a second mask circuit that masks any bit of the operation result of the arithmetic and logic operation circuit into one of two values and outputs it to the accumulation register. and the accumulation register that stores the output of the second mask circuit; and a register that stores mask information that specifies contents to be masked by the first and second mask circuits. circuit.
JP2188525A 1990-07-17 1990-07-17 Arithmetic circuit Pending JPH0474218A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2188525A JPH0474218A (en) 1990-07-17 1990-07-17 Arithmetic circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2188525A JPH0474218A (en) 1990-07-17 1990-07-17 Arithmetic circuit

Publications (1)

Publication Number Publication Date
JPH0474218A true JPH0474218A (en) 1992-03-09

Family

ID=16225239

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2188525A Pending JPH0474218A (en) 1990-07-17 1990-07-17 Arithmetic circuit

Country Status (1)

Country Link
JP (1) JPH0474218A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009104405A (en) * 2007-10-23 2009-05-14 Yamaha Corp Digital signal processing apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009104405A (en) * 2007-10-23 2009-05-14 Yamaha Corp Digital signal processing apparatus

Similar Documents

Publication Publication Date Title
US6009451A (en) Method for generating barrel shifter result flags directly from input data
US4700324A (en) Digital circuit performing an arithmetic operation with an overflow
US5883824A (en) Parallel adding and averaging circuit and method
US20030088602A1 (en) High-speed computation in arithmetic logic circuit
US6128726A (en) Accurate high speed digital signal processor
US4805131A (en) BCD adder circuit
JPS62191926A (en) Arithmetic unit
GB2262637A (en) Padding scheme for optimized multiplication.
US20040117421A1 (en) Methods and systems for computing floating-point intervals
EP0472030A2 (en) Method and apparatus for modifying two's complement multiplier to perform unsigned magnitude multiplication
JPH0474218A (en) Arithmetic circuit
JPH0519170B2 (en)
US7051062B2 (en) Apparatus and method for adding multiple-bit binary-strings
JPS623330A (en) Adder
JPH07146777A (en) Arithmetic unit
JPH11126157A (en) Method and circuit for multiplication
KR100337716B1 (en) A circuit forming the sum of products
JPS62209621A (en) Multiplying device
JPH02178833A (en) Adder for adding data different in bit length
RU2069009C1 (en) Adding device
SU1501052A1 (en) Function computing device
JPS5853218A (en) Digital filter
SU1273918A1 (en) Adding-subtracting device
JPH0644226B2 (en) Processor
JPH04160533A (en) Microprocessor