JPH04307623A - Arithmetic logical computing device - Google Patents
Arithmetic logical computing deviceInfo
- Publication number
- JPH04307623A JPH04307623A JP3072008A JP7200891A JPH04307623A JP H04307623 A JPH04307623 A JP H04307623A JP 3072008 A JP3072008 A JP 3072008A JP 7200891 A JP7200891 A JP 7200891A JP H04307623 A JPH04307623 A JP H04307623A
- Authority
- JP
- Japan
- Prior art keywords
- input data
- arithmetic
- output
- data
- selection
- 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
Links
Landscapes
- Complex Calculations (AREA)
Abstract
Description
【0001】0001
【産業上の利用分野】本発明は、入力データに対し、加
減演算、非線形演算等の演算を行なう信号処理プロセッ
サの算術論理演算部に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic and logic operation section of a signal processing processor that performs operations such as addition and subtraction operations and nonlinear operations on input data.
【0002】0002
【従来の技術】従来使用されている信号処理プロセッサ
の算術論理演算部は一般に図4に示す装置が用いられて
いる。図4において、4は算術論理演算器(ALU)
、5は算術論理演算器(ALU) 4の演算の種類を制
御する制御回路である。算術論理演算器(ALU) 4
は入力されたデータA、データB に対し、制御回路5
の制御に従って演算を行ない、演算結果F を出力する
。詳細は特許出願番号平1−70807に記されている
。2. Description of the Related Art A device shown in FIG. 4 is generally used as an arithmetic and logic operation section of a conventionally used signal processing processor. In FIG. 4, 4 is an arithmetic logic unit (ALU)
, 5 is a control circuit for controlling the type of operation of the arithmetic logic unit (ALU) 4. Arithmetic logic unit (ALU) 4
is the control circuit 5 for input data A and data B.
It performs calculations under the control of , and outputs the calculation result F. Details are given in patent application number Hei 1-70807.
【0003】ディジタル信号処理の際によく使用される
命令として次に示す5つの特種命令がある。特種命令1
とは、閾値データA と閾値データC でデータB を
いわゆるクリップする命令である。その概念図を図5に
示す。There are the following five special instructions that are frequently used in digital signal processing. Special command 1
is an instruction to clip data B with threshold data A and threshold data C. A conceptual diagram is shown in FIG.
【0004】図5に示すように、データB が閾値デー
タA より大きい場合は定数Chを、データB が閾値
データA と閾値データC の間の場合はデータB を
、データB が閾値データC より小さい場合は定数C
lを出力する命令である。As shown in FIG. 5, when data B is larger than threshold data A, constant Ch is set, when data B is between threshold data A and threshold data C, data B is set, and data B is larger than threshold data C. If small, constant C
This is an instruction to output l.
【0005】この命令はディジタル信号に対して何らか
の処理を行なう際に、入出力データのダイナミック・レ
ンジより広いダイナミック・レンジを持つ演算系で処理
した時、すべての処理結果を入出力データのダイナミッ
ク・レンジ内に収めるために必ず使用される。[0005] When performing some processing on digital signals using an arithmetic system that has a wider dynamic range than the dynamic range of the input/output data, this instruction converts all processing results into the dynamic range of the input/output data. Always used to keep it within the range.
【0006】特種命令2とは、入力データBが正又は0
ならば1を、負ならば−1を出力する命令である。この
命令はデータを2の補数表現から絶対値表現に変換する
際に非常に有効である。Special instruction 2 means that input data B is positive or 0.
This is an instruction that outputs 1 if the value is negative, and -1 if the value is negative. This instruction is very effective in converting data from two's complement representation to absolute value representation.
【0007】2の補数表現のデータを処理する場合、切
り捨てや丸めなどの処理を行なった際に数直線上で同方
向に誤差が生じる。従って、処理後の誤差を数直線上で
0に関して対称になるようにしたい場合には、データを
符号と絶対値とに分割し、絶対値に対して処理を行ない
、その後2の補数表現に戻してやらねばならない。When processing data in two's complement representation, errors occur in the same direction on the number line when processes such as truncation and rounding are performed. Therefore, if you want the error after processing to be symmetrical about 0 on the number line, divide the data into sign and absolute value, process the absolute value, and then convert it back to two's complement representation. I have to do it.
【0008】その際に、この特種命令2の結果を符号と
して保存しておき処理後のデータに乗じてやれば、簡単
な操作で2の補数表現と絶対値表現との変換ができる。
特種命令3とは、入力データA と入力データB のう
ちいずれか大きい方を出力する命令である。At this time, if the result of this special instruction 2 is saved as a code and multiplied by the processed data, conversion between two's complement representation and absolute value representation can be performed with a simple operation. Special instruction 3 is an instruction that outputs the larger of input data A and input data B.
【0009】特種命令4とは、入力データAと入力デー
タBのうちいずれか小さい方を出力する命令である。特
種命令5とは、入力データA と入力データB の差の
絶対値を出力する命令である。Special instruction 4 is an instruction that outputs the smaller of input data A and input data B. Special instruction 5 is an instruction that outputs the absolute value of the difference between input data A and input data B.
【0010】一般に、図4に示すような従来の2の補数
演算を行う算術論理演算部を持つ信号処理プロセッサで
、上述した特種命令を実行したい場合、プロセッサに用
意されている演算結果による条件分岐命令、演算結果に
よらない無条件分岐命令を用いて行なう。その手順を次
に示す。In general, when it is desired to execute the above-mentioned special instructions in a signal processing processor having an arithmetic and logic unit that performs conventional two's complement operations as shown in FIG. This is done using an unconditional branch instruction that does not depend on instructions or operation results. The procedure is shown below.
【0011】特種命令1
STEP1: A − B
STEP2: 演算結果の最上位ビットが1なら
ばSTEP7 へ
0ならば次のSTEPへ(条件分岐命令)STEP3:
B − C
STEP4: 演算結果の最上位ビットが1なら
ばSTEP9 へ
0ならば次のSTEPへ(条件分岐命令)STEP5:
B をレジスタに書き込むSTEP6:
STEP10へ(無条件分岐命令)STEP7:
A をレジスタに書き込むSTEP8: S
TEP10へ(無条件分岐命令)STEP9:
C をレジスタに書き込むSTEP10:
特種命令2
STEP1: A − 0
STEP2: 演算結果の最上位ビットが1なら
ばSTEP5 へ
0ならば次のSTEPへ(条件分岐命令)STEP3:
1をレジスタに書き込むSTEP4:
STEP6 へ(無条件分岐命令)STEP5:
−1をレジスタに書き込むSTEP6:
特種命令3
STEP1: A − B
STEP2: 演算結果の最上位ビットが1なら
ばSTEP5 へ
0ならば次のSTEPへ(条件分岐命令)STEP3:
A をレジスタに書き込むSTEP4:
STEP6 へ(無条件分岐命令)STEP5:
B をレジスタに書き込むSTEP6:
特種命令4
STEP1: A − B
STEP2: 演算結果の最上位ビットが1なら
ばSTEP5 へ
0ならば次のSTEPへ(条件分岐命令)STEP3:
B をレジスタに書き込むSTEP4:
STEP6 へ(無条件分岐命令)STEP5:
Aをレジスタに書き込むSTEP6:
特種命令5
STEP1: A − B
STEP2: 演算結果の最上位ビットが1なら
ばSTEP5 へ
0ならば次のSTEPへ(条件分岐命令)STEP3:
A − Bをレジスタに書き込むSTEP4:
STEP7 へ(無条件分岐命令)STEP5
: B − A
STEP6: B − Aをレジスタに書き込む
STEP7:
上記のような処理はよく使用されるものであるが、分岐
命令を使用するので、処理時間がかかるという問題があ
った。例えば画像データのように膨大な量のデータを扱
う場合には、処理時間の短縮は非常に重要な問題である
。Special instruction 1 STEP 1: A - B STEP 2: If the most significant bit of the operation result is 1, go to STEP 7 If it is 0, go to the next STEP (conditional branch instruction) STEP 3:
B - C STEP 4: If the most significant bit of the operation result is 1, go to STEP 9 If it is 0, go to the next STEP (conditional branch instruction) STEP 5:
STEP 6: Write B to the register.
Go to STEP 10 (unconditional branch instruction) STEP 7:
STEP 8: Write A to the register: S
To TEP10 (unconditional branch instruction) STEP9:
Write C to the register STEP 10: Special instruction 2 STEP 1: A - 0 STEP 2: If the most significant bit of the operation result is 1, go to STEP 5 If it is 0, go to the next STEP (conditional branch instruction) STEP 3:
STEP 4: Write 1 to the register.
Go to STEP 6 (unconditional branch instruction) STEP 5:
Write -1 to the register STEP 6: Special instruction 3 STEP 1: A - B STEP 2: If the most significant bit of the operation result is 1, go to STEP 5 If it is 0, go to the next STEP (conditional branch instruction) STEP 3:
STEP 4: Write A to the register.
Go to STEP 6 (unconditional branch instruction) STEP 5:
Write B to the register STEP 6: Special instruction 4 STEP 1: A - B STEP 2: If the most significant bit of the operation result is 1, go to STEP 5 If it is 0, go to the next STEP (conditional branch instruction) STEP 3:
STEP 4: Write B to the register.
Go to STEP 6 (unconditional branch instruction) STEP 5:
Write A to the register STEP 6: Special instruction 5 STEP 1: A - B STEP 2: If the most significant bit of the operation result is 1, go to STEP 5 If it is 0, go to the next STEP (conditional branch instruction) STEP 3:
STEP 4: Write A-B to the register.
Go to STEP 7 (unconditional branch instruction) STEP 5
: B - A STEP 6: Write B - A to the register STEP 7: The above processing is often used, but since it uses a branch instruction, there is a problem that it takes a long processing time. For example, when handling a huge amount of data such as image data, reducing processing time is a very important issue.
【0012】特許出願番号平1−70807にすでに記
されている演算装置では、特種命令3、4は1サイクル
で実行できる。しかしその他の特種命令1、2、5は上
記のステップだけ必要である。In the arithmetic unit already described in Patent Application No. 1-70807, special instructions 3 and 4 can be executed in one cycle. However, other special instructions 1, 2, and 5 only require the above steps.
【0013】[0013]
【発明が解決しようとする課題】上述したいずれの特種
命令もディジタル信号処理では非常によく使用されるも
のである。SUMMARY OF THE INVENTION All of the above-mentioned special instructions are very commonly used in digital signal processing.
【0014】しかし、上記の例で見たように従来の構成
の算術論理演算装置では、特種命令1に9STEPのプ
ログラム・エリアと6STEPの実行サイクル、特種命
令2に5STEPのプログラム・エリアと4STEPの
実行サイクル、特種命令3に5STEPのプログラム・
エリアと4STEPの実行サイクル、特種命令4に6S
TEPのプログラム・エリアと4STEPの実行サイク
ル、特種命令5に5STEPのプログラム・エリアと4
STEPの実行サイクルが必要であるという問題があっ
た。またこのような特種命令を1サイクルで実行できる
演算装置が望まれていた。However, as seen in the above example, in an arithmetic logic unit with a conventional configuration, special instruction 1 has a program area of 9 STEPs and an execution cycle of 6 STEPs, and special instruction 2 has a program area of 5 STEPs and an execution cycle of 4 STEPs. Execution cycle, 5 STEP program for special instructions 3
Area and 4STEP execution cycle, special instruction 4 and 6S
TEP program area and 4 STEP execution cycle, special instruction 5, 5 STEP program area and 4
There is a problem in that a STEP execution cycle is required. Furthermore, there has been a desire for an arithmetic device that can execute such special instructions in one cycle.
【0015】特種命令3、4に関しては、特許出願番号
平1−70807にすでに記されている演算装置で解決
された。しかしその他の特種命令1、2、5は未解決で
あり、全ての特種命令を1サイクルで実行できる演算装
置が望まれていた。Special instructions 3 and 4 have been solved using an arithmetic unit already described in patent application No. 1-70807. However, other special instructions 1, 2, and 5 have not yet been solved, and an arithmetic device that can execute all special instructions in one cycle has been desired.
【0016】本発明は、上述の課題に鑑み、よく使用さ
れる処理を1サイクルで実行できる多機能な算術論理演
算装置を提供することを目的としている。SUMMARY OF THE INVENTION In view of the above-mentioned problems, it is an object of the present invention to provide a multifunctional arithmetic and logic operation device that can execute frequently used processes in one cycle.
【0017】[0017]
本発明は上記目的を達成するために、
(1) 第1の入力データから第2の入力データを減
算する第1の減算器と、第2の入力データから第1の入
力データより小さい第3の入力データを減算する第2の
減算器と、第1の定数と第2の定数と第2の入力データ
の内の1つを選択し出力する選択回路と、前記2つの減
算器の出力結果により前記選択回路の出力を制御する選
択制御回路とを有し、前記選択制御回路により前記第1
の減算器の演算結果の最上位ビットが1の時は第1の定
数を、前記第1の減算器と前記第2の減算器の演算結果
の最上位ビットが共に0の時は第2の入力データを、前
記第2の減算器の演算結果の最上位ビットが1の時は第
2の定数を前記選択回路から出力して制御するよう構成
している。In order to achieve the above object, the present invention provides: (1) a first subtracter that subtracts second input data from the first input data; and a third subtracter that is smaller than the first input data from the second input data. a second subtracter that subtracts the input data; a selection circuit that selects and outputs one of the first constant, the second constant, and the second input data; and the output results of the two subtracters. a selection control circuit that controls the output of the selection circuit, and the selection control circuit controls the output of the first selection circuit.
When the most significant bit of the operation result of the subtracter is 1, the first constant is used, and when the most significant bit of the operation result of the first subtracter and the second subtracter are both 0, the second constant is used. The input data is controlled by outputting a second constant from the selection circuit when the most significant bit of the operation result of the second subtracter is 1.
【0018】(2) 1または−1のいずれかを選択
して出力する選択回路と、入力データにより前記選択回
路の出力を制御する選択制御回路とを有し、前記選択制
御回路により入力データの最上位ビットが1の時は−1
を、入力データの最上位ビットが0の時は1を前記選択
回路から出力して制御するよう構成している。(2) It has a selection circuit that selects and outputs either 1 or -1, and a selection control circuit that controls the output of the selection circuit based on input data, and the selection control circuit controls the output of the input data. -1 when the most significant bit is 1
is controlled by outputting 1 from the selection circuit when the most significant bit of input data is 0.
【0019】(3) 第1の入力データと第2の入力
データとを算術論理演算する算術論理演算器と、前記算
術論理演算器の演算を制御する演算制御回路と、第3の
入力データと第1の入力データの内のいずれかを選択し
て出力する第1の選択回路と、命令の種類により前記第
1の選択回路を制御する第1の選択制御回路と、第2の
入力データから前記第1の選択回路の出力データを減算
する減算器と、1か−1を選択して出力する第2の選択
回路と、第2の入力データにより前記第2の選択回路を
制御する第2の選択制御回路と、前記算術論理演算器の
出力と前記減算器の出力と第1の入力データと第2の入
力データと第1の定数と第2の定数と前記第2の選択回
路の出力の内の1つを選択し、出力する第3の選択回路
と、命令の種類と前記算術論理演算器と前記減算器の演
算結果により前記第3の選択回路を制御する第3の選択
制御回路とを有し、前記演算制御回路により第1、第2
、第3、第4の特種命令実行時は前記算術論理演算器の
演算を減算に制御し、前記第1の選択制御回路により第
5の特種命令実行時は第1の入力データを、第5の特種
命令以外の命令の実行時は第3の入力データを前記第1
の選択回路から出力するように制御し、前記第2の選択
制御回路により第2の入力データの最上位ビットが0の
時は1を、第2の入力データの最上位ビットが1の時は
−1を前記第2の選択回路から出力するように制御し、
前記第3の選択制御回路により通常の算術論理演算を実
行する時は前記算術論理演算器の出力を、第1の特種命
令実行時は、前記算術論理演算器の演算結果の最上位ビ
ットが1の時は第1の定数を、前記算術論理演算器と前
記減算器の演算結果の最上位ビットが共に0の時は第2
の入力データを、前記減算器の演算結果の最上位ビット
が1の時は第2の定数を、第2の特種命令実行時は、前
記第2の選択回路の出力データを、第3の特種命令実行
時は、前記算術論理演算器の演算結果の最上位ビットが
1の時は第2の入力データを、0の時は第1の入力デー
タを、第4の特種命令実行時は、前記算術論理演算器の
演算結果の最上位ビットが1の時は第1の入力データを
、0の時は第2の入力データを、第5の特種命令実行時
は、前記算術論理演算器の演算結果の最上位ビットが1
の時は前記減算器の演算結果を、0の時は前記算術論理
演算器の演算結果を、前記第3の選択回路から出力して
制御するよう構成している。(3) an arithmetic and logic unit that performs an arithmetic and logic operation on first input data and second input data, an arithmetic control circuit that controls the operation of the arithmetic and logic unit, and third input data; a first selection circuit that selects and outputs one of the first input data; a first selection control circuit that controls the first selection circuit according to the type of instruction; a subtracter that subtracts the output data of the first selection circuit; a second selection circuit that selects and outputs 1 or -1; and a second selection circuit that controls the second selection circuit with second input data. a selection control circuit, an output of the arithmetic logic unit, an output of the subtracter, first input data, second input data, a first constant, a second constant, and an output of the second selection circuit. a third selection circuit that selects and outputs one of the above, and a third selection control circuit that controls the third selection circuit based on the type of instruction and the operation results of the arithmetic and logic unit and the subtracter. and a first and a second
, when executing the third and fourth special instructions, the operation of the arithmetic and logic unit is controlled to subtraction, and when the fifth special instruction is executed, the first input data is controlled by the first selection control circuit. When executing an instruction other than the special instruction, the third input data is
The second selection control circuit outputs 1 when the most significant bit of the second input data is 0, and outputs 1 when the most significant bit of the second input data is 1. -1 from the second selection circuit;
When the third selection control circuit executes a normal arithmetic and logic operation, the output of the arithmetic and logic unit is set to 1, and when the first special instruction is executed, the most significant bit of the operation result of the arithmetic and logic unit is set to 1. When , the first constant is used, and when the most significant bits of the operation results of the arithmetic and logic unit and the subtracter are both 0, the second constant is used.
When the most significant bit of the operation result of the subtracter is 1, the input data of When an instruction is executed, when the most significant bit of the operation result of the arithmetic logic unit is 1, the second input data is used, when it is 0, the first input data is used, and when the fourth special instruction is executed, the above-mentioned When the most significant bit of the operation result of the arithmetic and logic unit is 1, the first input data is used, when it is 0, the second input data is used, and when the fifth special instruction is executed, the operation of the arithmetic and logic unit is executed. The most significant bit of the result is 1
The third selection circuit is configured to output and control the calculation result of the subtracter when 0, and the calculation result of the arithmetic and logic unit when 0.
【0020】[0020]
【作用】本発明は上述した構成により、2つの閾値でデ
ータをクリップする命令、データが正ならば1、負なら
ば−1を出力する命令、2つのデータのうちの大きい方
、あるいは小さい方を出力する命令、2つのデータの差
の絶対値を求める命令を1サイクルで実行することが可
能になるものである。[Operation] With the above-described configuration, the present invention has an instruction to clip data using two threshold values, an instruction to output 1 if the data is positive, and -1 if the data is negative, and the larger or smaller of the two data. This makes it possible to execute in one cycle an instruction that outputs the value of the difference between two pieces of data, and an instruction that calculates the absolute value of the difference between two pieces of data.
【0021】[0021]
【実施例】以下、本発明の実施例について図1、図2、
図3を参照しながら説明する。本発明の第1の実施例を
図1に示す。図1において、1.1,1.2は、減算器
、2.1は選択回路、3.1は選択制御回路である。図
1の回路構成及び動作を以下に説明する。[Example] Examples of the present invention will be described below with reference to FIGS. 1, 2,
This will be explained with reference to FIG. A first embodiment of the invention is shown in FIG. In FIG. 1, 1.1 and 1.2 are subtracters, 2.1 is a selection circuit, and 3.1 is a selection control circuit. The circuit configuration and operation of FIG. 1 will be explained below.
【0022】減算器1.1は閾値データA 、データB
を入力とし、A−B の演算を行ないデータD とし
て出力する。減算器1.2はデータB と閾値データA
より小さい閾値データC を入力とし、B−C の演
算を行ないデータE として出力する。選択回路2.1
は入力データB と定数Ch、Clを入力とし、選択制
御回路3.1に従ってデータF として出力する。選択
制御回路3.1はD とE の最上位ビットを入力とし
、D の最上位ビットが1の時は定数Chを、D とE
の最上位ビットが共に0の時は入力データB を、E
の最上位ビットが1の時は定数Clを出力するように
選択回路2.1を制御する。[0022] The subtracter 1.1 receives threshold data A and data B.
is input, performs the calculation A-B, and outputs it as data D. Subtractor 1.2 uses data B and threshold data A
The smaller threshold value data C is input, the calculation B-C is performed, and the result is output as data E. Selection circuit 2.1
inputs input data B and constants Ch and Cl, and outputs it as data F according to the selection control circuit 3.1. The selection control circuit 3.1 inputs the most significant bits of D and E, and when the most significant bit of D is 1, it inputs a constant Ch;
When the most significant bits of both are 0, input data B and E
When the most significant bit of is 1, the selection circuit 2.1 is controlled to output the constant Cl.
【0023】例えば閾値データA が100 、閾値デ
ータC が50、定数Chが120 、定数Clが0の
時、データBが200ならば120が、80ならば80
が、−30ならば0が出力される。次に、本発明の第2
の実施例を図2に示す。図2の回路構成及び動作を以下
に説明する。For example, when the threshold data A is 100, the threshold data C is 50, the constant Ch is 120, and the constant Cl is 0, if the data B is 200, it is 120, and if it is 80, it is 80.
is -30, 0 is output. Next, the second aspect of the present invention
An example of this is shown in FIG. The circuit configuration and operation of FIG. 2 will be explained below.
【0024】選択回路2.2は、1と−1を入力とし、
選択制御回路3.2に従ってデータF として出力する
。
選択制御回路3.2は、入力データの最上位ビットを入
力とし、入力データの最上位ビットが1ならば−1を、
0ならば1を出力するように選択回路2.2を制御する
。例えば、入力データが200 ならば1が、−30な
らば−1が出力される。The selection circuit 2.2 receives 1 and -1 as inputs,
It is output as data F according to the selection control circuit 3.2. The selection control circuit 3.2 takes the most significant bit of the input data as an input, and if the most significant bit of the input data is 1, -1,
If it is 0, the selection circuit 2.2 is controlled to output 1. For example, if the input data is 200, 1 is output, and if the input data is -30, -1 is output.
【0025】さらに、本発明の第3の実施例を図3に示
す。ここで図1、図2の第1実施例、および第2実施例
と共通の構成要素の番号は同じにしてある。図3におい
て、4は通常の算術論理演算器、5は演算制御回路であ
る。図3の回路構成及び動作を以下に説明する。Furthermore, a third embodiment of the present invention is shown in FIG. Here, the numbers of the components common to the first embodiment and the second embodiment of FIGS. 1 and 2 are the same. In FIG. 3, 4 is a normal arithmetic and logic unit, and 5 is an arithmetic control circuit. The circuit configuration and operation of FIG. 3 will be explained below.
【0026】算術論理演算器4はデータA 、B を入
力とし、演算制御回路5に従って算術論理演算を行ない
データD として出力する。減算器1.2はデータB
と第1の選択回路2.3の出力を入力とし、データBか
ら第1の選択回路2.3の出力を減算し、データEとし
て出力する。
第3の選択回路2.1はデータA 、B 、D 、E
、定数Ch、定数Cl、第3の選択回路2.2の出力を
入力とし、選択制御回路3.1に従ってデータF とし
て出力する。The arithmetic and logic unit 4 inputs the data A and B, performs arithmetic and logic operations according to the arithmetic control circuit 5, and outputs the data as data D. Subtractor 1.2 is data B
and the output of the first selection circuit 2.3 are input, the output of the first selection circuit 2.3 is subtracted from the data B, and the result is output as data E. The third selection circuit 2.1 selects data A, B, D, E.
, a constant Ch, a constant Cl, and the output of the third selection circuit 2.2, and outputs it as data F according to the selection control circuit 3.1.
【0027】演算制御回路5は、特種命令1、2、3、
4の実行時は算術論理演算器4の演算を減算に制御し、
その他通常の算術論理演算の場合は通常の制御をする。
第1の選択制御回路3.3は、特種命令5の実行時は入
力データAを、特種命令5以外の命令の実行時は入力デ
ータC を出力するように第1の選択回路2.3を制御
する。第2の選択制御回路3.2は、入力データB の
最上位ビットが0の時は1を、入力データB の最上位
ビットが1の時は−1を出力するように第2の選択回路
2.2を制御する。第3の選択制御回路3.1は、通常
の算術論理演算を実行する時は算術論理演算器4の出力
を出力するように、特種命令1の実行時は、算術論理演
算器4の演算結果の最上位ビットが1の時は定数Chを
、算術論理演算器4と減算器1.2の演算結果の最上位
ビットが共に0の時は入力データB を、減算器1.2
の演算結果の最上位ビットが1の時は定数Clを出力す
るように、特種命令2の実行時は、選択回路2.2の出
力データを出力するように、特種命令3の実行時は、算
術論理演算器4の演算結果の最上位ビットが1の時は入
力データB を、0の時は入力データA を出力するよ
うに、特種命令4の実行時は、算術論理演算器4の演算
結果の最上位ビットが1の時は入力データA を、0の
時は入力データB を出力するように、特種命令5の実
行時は、算術論理演算器4の演算結果の最上位ビットが
1の時は減算器1.2の演算結果を、0の時は算術論理
演算器4の演算結果を、出力するように選択回路2.1
を制御する。The arithmetic control circuit 5 executes special instructions 1, 2, 3,
4, the operation of the arithmetic logic unit 4 is controlled to subtraction,
For other normal arithmetic and logic operations, normal control is performed. The first selection control circuit 3.3 controls the first selection circuit 2.3 to output input data A when special instruction 5 is executed, and output input data C when an instruction other than special instruction 5 is executed. Control. The second selection control circuit 3.2 outputs 1 when the most significant bit of input data B is 0, and outputs -1 when the most significant bit of input data B is 1. 2.2. The third selection control circuit 3.1 outputs the output of the arithmetic and logic unit 4 when executing a normal arithmetic and logic operation, and outputs the operation result of the arithmetic and logic unit 4 when executing the special instruction 1. When the most significant bit of the arithmetic logic unit 4 and the subtracter 1.2 are 0, the input data B is used.
When the most significant bit of the operation result is 1, the constant Cl is output; when the special instruction 2 is executed, the output data of the selection circuit 2.2 is output; when the special instruction 3 is executed, the output data of the selection circuit 2.2 is output. When the special instruction 4 is executed, the operation of the arithmetic and logic unit 4 is performed so that when the most significant bit of the operation result of the arithmetic and logic unit 4 is 1, input data B is output, and when it is 0, input data A is output. When the most significant bit of the result is 1, input data A is output, and when it is 0, input data B is output. The selection circuit 2.1 outputs the calculation result of the subtracter 1.2 when the value is 0, and the calculation result of the arithmetic logic unit 4 when the value is 0.
control.
【0028】[0028]
【発明の効果】以上の実施例から明らかなように、2つ
の閾値でデータをクリップする命令、データが正ならば
1、負ならば−1を出力する命令、2つのデータのうち
の大きい方、あるいは小さい方を出力する命令、2つの
データの差の絶対値を求める命令すべてを1サイクルで
実行することが可能となる。従ってプログラム・メモリ
の使用領域が減り、処理の高速化が実現でき、またデー
タを連続して入力すれば連続して処理できるなど、その
効果は大きい。Effects of the Invention As is clear from the above embodiments, there is an instruction to clip data using two threshold values, an instruction to output 1 if the data is positive, and -1 if the data is negative, and the larger of the two data. , an instruction to output the smaller one, and an instruction to find the absolute value of the difference between two data can all be executed in one cycle. Therefore, the area used in the program memory is reduced, processing speed can be increased, and if data is input continuously, it can be processed continuously, which has great effects.
【図1】本発明の第1の実施例の算術論理演算装置の構
成図である。FIG. 1 is a configuration diagram of an arithmetic and logic operation device according to a first embodiment of the present invention.
【図2】本発明の第2の実施例の算術論理演算装置の構
成図である。FIG. 2 is a configuration diagram of an arithmetic and logic operation device according to a second embodiment of the present invention.
【図3】本発明の第3の実施例の算術論理演算装置の構
成図である。FIG. 3 is a configuration diagram of an arithmetic and logic operation device according to a third embodiment of the present invention.
【図4】従来例の算術論理演算部の構成図である。FIG. 4 is a configuration diagram of a conventional arithmetic and logic operation unit.
【図5】特種命令1の概念図である。FIG. 5 is a conceptual diagram of special instruction 1.
1.1 減算器 1.2 減算器 2.1 選択回路 2.2 選択回路 2.3 選択回路 3.1 選択制御回路 3.2 選択制御回路 3.3 選択制御回路 4 算術論理演算器 5 演算制御回路 1.1 Subtractor 1.2 Subtractor 2.1 Selection circuit 2.2 Selection circuit 2.3 Selection circuit 3.1 Selection control circuit 3.2 Selection control circuit 3.3 Selection control circuit 4 Arithmetic logic unit 5 Arithmetic control circuit
Claims (3)
タを減算する第1の減算器と、第2の入力データから第
1の入力データより小さい第3の入力データを減算する
第2の減算器と、第1の定数と第2の定数と第2の入力
データの内の1つを選択し出力する選択回路と、前記2
つの減算器の出力結果により前記選択回路の出力を制御
する選択制御回路とを有し、前記選択制御回路により前
記第1の減算器の演算結果の最上位ビットが1の時は第
1の定数を、前記第1の減算器と前記第2の減算器の演
算結果の最上位ビットが共に0の時は第2の入力データ
を、前記第2の減算器の演算結果の最上位ビットが1の
時は第2の定数を前記選択回路から出力して制御するよ
う構成した算術論理演算装置。1. A first subtracter that subtracts second input data from first input data; and a second subtractor that subtracts third input data smaller than the first input data from the second input data. a subtracter; a selection circuit that selects and outputs one of the first constant, the second constant, and the second input data;
a selection control circuit that controls the output of the selection circuit based on the output results of the two subtractors, and when the most significant bit of the operation result of the first subtractor is 1, the selection control circuit sets a first constant. When the most significant bit of the operation results of the first subtracter and the second subtracter are both 0, the second input data is used, and the most significant bit of the operation result of the second subtracter is 1. an arithmetic and logic operation device configured to control by outputting a second constant from the selection circuit;
力する選択回路と、入力データにより前記選択回路の出
力を制御する選択制御回路とを有し、前記選択制御回路
により入力データの最上位ビットが1の時は−1を、入
力データの最上位ビットが0の時は1を前記選択回路か
ら出力して制御するよう構成した算術論理演算装置。2. A selection circuit that selects and outputs either 1 or -1, and a selection control circuit that controls the output of the selection circuit based on input data, wherein the selection control circuit selects and outputs either 1 or -1. An arithmetic and logic operation device configured to control by outputting -1 when the most significant bit of input data is 1 and outputting 1 from the selection circuit when the most significant bit of input data is 0.
とを算術論理演算する算術論理演算器と、前記算術論理
演算器の演算を制御する演算制御回路と、第3の入力デ
ータと第1の入力データの内のいずれかを選択して出力
する第1の選択回路と、命令の種類により前記第1の選
択回路を制御する第1の選択制御回路と、第2の入力デ
ータから前記第1の選択回路の出力データを減算する減
算器と、1か−1を選択して出力する第2の選択回路と
、第2の入力データにより前記第2の選択回路を制御す
る第2の選択制御回路と、前記算術論理演算器の出力と
前記減算器の出力と第1の入力データと第2の入力デー
タと第1の定数と第2の定数と前記第2の選択回路の出
力の内の1つを選択し、出力する第3の選択回路と、命
令の種類と前記算術論理演算器と前記減算器の演算結果
により前記第3の選択回路を制御する第3の選択制御回
路とを有し、前記演算制御回路により第1、第2、第3
、第4の特種命令実行時は前記算術論理演算器の演算を
減算に制御し、前記第1の選択制御回路により第5の特
種命令実行時は第1の入力データを、第5の特種命令以
外の命令の実行時は第3の入力データを前記第1の選択
回路から出力するように制御し、前記第2の選択制御回
路により第2の入力データの最上位ビットが0の時は1
を、第2の入力データの最上位ビットが1の時は−1を
前記第2の選択回路から出力するように制御し、前記第
3の選択制御回路により通常の算術論理演算を実行する
時は前記算術論理演算器の出力を、第1の特種命令実行
時は、前記算術論理演算器の演算結果の最上位ビットが
1の時は第1の定数を、前記算術論理演算器と前記減算
器の演算結果の最上位ビットが共に0の時は第2の入力
データを、前記減算器の演算結果の最上位ビットが1の
時は第2の定数を、第2の特種命令実行時は、前記第2
の選択回路の出力データを、第3の特種命令実行時は、
前記算術論理演算器の演算結果の最上位ビットが1の時
は第2の入力データを、0の時は第1の入力データを、
第4の特種命令実行時は、前記算術論理演算器の演算結
果の最上位ビットが1の時は第1の入力データを、0の
時は第2の入力データを、第5の特種命令実行時は、前
記算術論理演算器の演算結果の最上位ビットが1の時は
前記減算器の演算結果を、0の時は前記算術論理演算器
の演算結果を、前記第3の選択回路から出力して制御す
るよう構成した算術論理演算装置。3. An arithmetic and logic unit that performs an arithmetic and logic operation on first input data and second input data; an operation control circuit that controls the operation of the arithmetic and logic unit; a first selection circuit that selects and outputs one of the first input data; a first selection control circuit that controls the first selection circuit according to the type of instruction; and a first selection control circuit that selects and outputs one of the first input data; a subtracter that subtracts the output data of the first selection circuit; a second selection circuit that selects and outputs 1 or -1; and a second selection circuit that controls the second selection circuit with second input data. a selection control circuit, an output of the arithmetic logic unit, an output of the subtracter, first input data, second input data, a first constant, a second constant, and an output of the second selection circuit; a third selection circuit that selects and outputs one of them; and a third selection control circuit that controls the third selection circuit based on the type of instruction and the operation results of the arithmetic and logic unit and the subtracter. , and the arithmetic control circuit controls the first, second, and third
, when executing a fourth special instruction, the operation of the arithmetic and logic unit is controlled to subtraction, and when executing a fifth special instruction, the first selection control circuit controls the first input data to the fifth special instruction. When an instruction other than
When the most significant bit of the second input data is 1, the second selection circuit outputs -1, and when the third selection control circuit executes normal arithmetic and logic operations. is the output of the arithmetic and logic unit; when the first special instruction is executed, when the most significant bit of the operation result of the arithmetic and logic unit is 1, the first constant is the output of the arithmetic and logic unit; When the most significant bits of the operation result of the subtractor are both 0, the second input data is used, when the most significant bit of the operation result of the subtractor is 1, the second constant is used, and when the second special instruction is executed, , said second
When the third special instruction is executed, the output data of the selection circuit is
When the most significant bit of the operation result of the arithmetic and logic unit is 1, the second input data is input; when it is 0, the first input data is input;
When the fourth special instruction is executed, when the most significant bit of the operation result of the arithmetic logic unit is 1, the first input data is used, when it is 0, the second input data is used, and the fifth special instruction is executed. When the most significant bit of the operation result of the arithmetic and logic unit is 1, the operation result of the subtracter is output, and when it is 0, the operation result of the arithmetic and logic unit is output from the third selection circuit. an arithmetic and logic unit configured to control
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3072008A JPH04307623A (en) | 1991-04-05 | 1991-04-05 | Arithmetic logical computing device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP3072008A JPH04307623A (en) | 1991-04-05 | 1991-04-05 | Arithmetic logical computing device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH04307623A true JPH04307623A (en) | 1992-10-29 |
Family
ID=13476959
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP3072008A Pending JPH04307623A (en) | 1991-04-05 | 1991-04-05 | Arithmetic logical computing device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH04307623A (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS60142735A (en) * | 1983-12-29 | 1985-07-27 | Matsushita Electric Ind Co Ltd | Overflow detecting and correcting circuit |
| JPS6486238A (en) * | 1987-09-29 | 1989-03-30 | Nec Corp | Subtracter |
| JPH02249025A (en) * | 1989-03-23 | 1990-10-04 | Matsushita Electric Ind Co Ltd | Signal processor |
-
1991
- 1991-04-05 JP JP3072008A patent/JPH04307623A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS60142735A (en) * | 1983-12-29 | 1985-07-27 | Matsushita Electric Ind Co Ltd | Overflow detecting and correcting circuit |
| JPS6486238A (en) * | 1987-09-29 | 1989-03-30 | Nec Corp | Subtracter |
| JPH02249025A (en) * | 1989-03-23 | 1990-10-04 | Matsushita Electric Ind Co Ltd | Signal processor |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH05241792A (en) | System and device for floating point addition and subtraction | |
| JPH04290122A (en) | Numerical expression conversion device | |
| WO2000031621A1 (en) | Arithmetic operations in a data processing system | |
| JPH0690668B2 (en) | Fuzzy computing device | |
| JPH07234778A (en) | Arithmetic circuit | |
| US5432726A (en) | Arithmetic unit for quantization/inverse quantigation | |
| JPS62197868A (en) | Linear approximation conversion circuit for pipeline construction | |
| KR0176883B1 (en) | Complex multiplier | |
| RU2225638C2 (en) | Arithmetic operations in data processing system | |
| JPH0335691B2 (en) | ||
| JP2558721B2 (en) | Input/Output Circuit | |
| JP3773033B2 (en) | Data arithmetic processing apparatus and data arithmetic processing program | |
| KR940007927B1 (en) | Multiplication circuit of digital filter | |
| JP2665067B2 (en) | Floating point adder / subtracter | |
| WO2001016712A1 (en) | Digital signal processing apparatus and method for controlling the same | |
| JP3110072B2 (en) | Pre-normalization circuit | |
| JPH04364525A (en) | Parallel arithmetic unit | |
| JPS6129020B2 (en) | ||
| JPH03226831A (en) | 2↑n times calculation circuit | |
| JPS6244657B2 (en) | ||
| JPH0675767A (en) | Processor | |
| JPS6398071A (en) | Arithmetic circuit | |
| JPH0467650B2 (en) | ||
| JPH0833811B2 (en) | Signal processor | |
| JPH05250400A (en) | Difference absolute value arithmetic circuit |