JPH05289852A - Arithmetic unit - Google Patents

Arithmetic unit

Info

Publication number
JPH05289852A
JPH05289852A JP4090545A JP9054592A JPH05289852A JP H05289852 A JPH05289852 A JP H05289852A JP 4090545 A JP4090545 A JP 4090545A JP 9054592 A JP9054592 A JP 9054592A JP H05289852 A JPH05289852 A JP H05289852A
Authority
JP
Japan
Prior art keywords
data
bits
input data
output
barrel shifter
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
JP4090545A
Other languages
Japanese (ja)
Inventor
Maki Toyokura
真木 豊蔵
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 JP4090545A priority Critical patent/JPH05289852A/en
Publication of JPH05289852A publication Critical patent/JPH05289852A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To realize an operation for executing a function output corresponding to the result of addition at a high speed by inputting the result of shifting an output of a decoder by a specific portion by a specific barrel shifter to a memory array part. CONSTITUTION:A decoder 21 decodes first input data 24. In accordance with 00, 01, 10 and 11 being input data binary number expressions of 2 bits, '1' is outputted to four pieces of first - fourth outputs of the decoder, and '0' is outputted to others. These outputs are inputted to a barrel shifter 22, and only a value of second input data 25 is shifted downward. That is, in accordance with 00, 01, 10 and 11 being binary number expressions of second input data of 2 bits, 0-3 bits are shifted downward. In 7 bits of output data of the barrel shifter 22, input data of 4 bits of the barrel shifter is shifted and data of 3 bits outputs '0'. In such a state, '1' is outputted to a position in which values of first and second input data are added, and its result is inputted to a memory array and a function value is read out.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、DSP等のディジタル
LSIで用いられる演算器である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is an arithmetic unit used in a digital LSI such as a DSP.

【0002】[0002]

【従来の技術】ディジタル画像信号等の信号処理は、
(数1)に示されているような演算が多く用いられる。
例えば、分散計算や、ベクトルの距離計算で用いられる
(x1−x2) 2がある。ここで、加算演算は加算器で行
い、関数f(・)は、複雑な関数をメモリによるテーブ
ル引きで行う場合がある。
2. Description of the Related Art Signal processing such as digital image signals is
The calculation as shown in (Equation 1) is often used.
For example, there is (x 1 −x 2) 2 used in variance calculation and vector distance calculation. Here, the addition operation may be performed by an adder, and the function f (•) may be performed by a table lookup by a memory for a complicated function.

【0003】[0003]

【数1】 [Equation 1]

【0004】従来、(数1)のような演算は、図6に示
すように実現していた。図6に示す回路は、2個の2ビ
ットのデータの加算結果に基づいてある関数の結果を出
力する回路である。図6において、61は加算器、62
はデコーダ、63は、加算結果によって決まる関数値が
予め格納されたメモリアレイ部、64は2ビットからな
る第1の入力データ、65は2ビットからなる第2の入
力データ、66は加算器61の出力データ、67は7個
のデコーダ出力信号、68はメモリの出力データであ
る。第1の入力データ64と第2の入力データ65を加
算器61により加算を行い、3ビットからなる加算結果
66を出力する。第1及び第2の入力は2進数表現で0
0から11(10進数表現で0から3)を表すので、加
算結果は00から110(10進数表現で0から6)と
なり、3ビット表現である。次に、この加算結果66を
デコーダ62に入力し、00から110に対応した7個
のデコーダ出力信号を得る。このデコード結果67で予
め加算結果に対応する関数値が格納されているメモリア
レイ部63を読み出すことにより、出力データ68を得
る。
Conventionally, an operation such as (Equation 1) has been realized as shown in FIG. The circuit shown in FIG. 6 is a circuit that outputs the result of a function based on the addition result of two pieces of 2-bit data. In FIG. 6, 61 is an adder, and 62
Is a decoder, 63 is a memory array part in which a function value determined by the addition result is stored in advance, 64 is 2 bits of first input data, 65 is 2 bits of second input data, and 66 is adder 61. Output data, 67 is output signals of seven decoders, and 68 is output data of the memory. The first input data 64 and the second input data 65 are added by the adder 61, and a 3-bit addition result 66 is output. The first and second inputs are binary representations of 0
Since 0 to 11 (0 to 3 in decimal notation) are represented, the addition result is 00 to 110 (0 to 6 in decimal notation), which is a 3-bit expression. Next, the addition result 66 is input to the decoder 62, and seven decoder output signals corresponding to 00 to 110 are obtained. The output data 68 is obtained by reading the memory array section 63 in which the function value corresponding to the addition result is stored in advance as the decoding result 67.

【0005】[0005]

【発明が解決しようとする課題】しかしながら図6のよ
うな方法では、加算器及びデコーダの演算時間に多くの
演算時間を必要とし、全体として演算時間の多くかかる
ものとなる。
However, in the method as shown in FIG. 6, a large amount of calculation time is required for the adder and the decoder, resulting in a large amount of calculation time as a whole.

【0006】本発明では、演算時間の少ない、加算結果
に対応した関数出力を行う演算装置を提供することを目
的とする。
It is an object of the present invention to provide an arithmetic unit which outputs a function corresponding to an addition result, which requires a short calculation time.

【0007】[0007]

【課題を解決するための手段】本発明は、第1の入力デ
ータをデコーダに入力し、このデコーダの出力を第1か
ら第(N−1)のバレルシフタにより、第2から第Nの
入力データ分シフトした結果を、メモリアレイ部に入力
することにより関数結果を読み出す。
According to the present invention, first input data is input to a decoder, and the output of the decoder is supplied to the second to Nth input data by the first to (N-1) th barrel shifters. The function result is read by inputting the result shifted by the amount to the memory array section.

【0008】[0008]

【作用】本発明によると、加算器の代わりにバレルシフ
タを用いているので演算時間が短くなる。
According to the present invention, since the barrel shifter is used instead of the adder, the calculation time is shortened.

【0009】[0009]

【実施例】図1に請求項1記載の演算装置のブロック図
を示す。図1において、11はデコーダ、12−1〜1
2−(N−1)は第1から第(N−1)のバレルシフ
タ、13はメモリアレイ、14−1〜14−Nは第1か
ら第Nの入力データ、15はデコーダ11の出力、16
−1〜16−(N−1)は第1から第(N−1)のバレ
ルシフタの出力である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 shows a block diagram of an arithmetic unit according to claim 1. In FIG. 1, 11 is a decoder, 12-1 to 1
2- (N-1) is a first to (N-1) th barrel shifter, 13 is a memory array, 14-1 to 14-N are first to Nth input data, 15 is an output of the decoder 11, 16
-1 to 16- (N-1) are outputs of the first to (N-1) th barrel shifters.

【0010】以下、図1に基づいて動作を説明する。第
1,第2,…,第Nの入力データは、それぞれM1
2,…,MNビットの正値の2進データとする。まず、
デコーダ11は、2M1種類の第1の入力データに従っ
て、デコーダ11の2M1個からなる出力データ15の中
で1個だけ1を出力し、その他は0を出力する。
The operation will be described below with reference to FIG. The first, second, ..., Nth input data are respectively M 1 ,
M 2, ..., and binary data of the positive values of M N bits. First,
The decoder 11 outputs only 1 out of 2 M1 output data 15 of the decoder 11 according to 2 M1 types of first input data, and outputs 0 in other cases.

【0011】次に第1のバレルシフタ12−1は、デコ
ーダ11の2M1ビットからなる出力データ15を、第2
の入力14−2で表された数だけ下方にシフトする。第
2のバレルシフタ12−2は、第1のバレルシフタ12
ー1の(2M1+2M2−1)ビットからなる出力データ1
6−1を、第3の入力14−3で表された数だけ下方に
シフトする。以下同様に第nのバレルシフタ12−n
は、第(n−1)のバレルシフタ12−(n−1)の
(2M1+2M2+…+2Mn−(n−1))ビットからなる
出力データ16−(n−1)を、第(n+1)の入力1
4−(n+1)で表された数だけ下方にシフトする操作
をn=3〜(N−1)まで繰り返す。第(N−1)のバ
レルシフタの(2M1+2M2+…+2MN−(N−1))ビ
ットからなる出力データ16−(N−1)でメモリアレ
イ13を選択し、予めメモリアレイ部13に格納された
関数値に対応する値を読み出し、出力データ17を出力
するものである。
Next, the first barrel shifter 12-1 outputs the output data 15 consisting of 2 M1 bits of the decoder 11 to the second
14-2 is shifted downward by the number represented by the input 14-2. The second barrel shifter 12-2 is the first barrel shifter 12
Output data 1 consisting of (2 M1 +2 M2 -1) bits of -1
Shift 6-1 downward by the number represented by the third input 14-3. Similarly, the n-th barrel shifter 12-n
Is the output data 16- (n-1) consisting of (2 M1 +2 M2 + ... +2 Mn- (n-1)) bits of the (n-1) -th barrel shifter 12- (n-1). n + 1) input 1
The operation of shifting downward by the number represented by 4- (n + 1) is repeated from n = 3 to (N-1). The memory array 13 is selected in advance by the output data 16- (N-1) consisting of (2 M1 +2 M2 + ... +2 MN- (N-1)) bits of the (N-1) th barrel shifter. The value corresponding to the function value stored in is read and the output data 17 is output.

【0012】次に、簡略化のために、N=2、第1の入
力データをM1=2ビット、第2の入力データをM2=2
ビットとした場合について動作の原理を説明する。図2
に示す回路は、2個の2ビットのデータの加算結果に基
づいてある関数の結果を出力する回路である。図2にお
いて、21はデコーダ、22はバレルシフタ、23は加
算結果によって決まる関数値が予め格納されたメモリア
レイ部、24は2ビットからなる第1の入力データ、2
5は2ビットからなる第2の入力データ、26はデコー
ダ21の4ビットからなる出力データ、27はバレルシ
フタ22の7ビットからなる出力データ、28はメモリ
の出力データである。
Next, for simplification, N = 2, the first input data is M 1 = 2 bits, and the second input data is M 2 = 2.
The principle of operation in the case of using bits will be described. Figure 2
The circuit shown in is a circuit which outputs the result of a certain function based on the addition result of two 2-bit data. In FIG. 2, reference numeral 21 is a decoder, 22 is a barrel shifter, 23 is a memory array section in which a function value determined by an addition result is stored in advance, 24 is first input data consisting of 2 bits, 2
Reference numeral 5 is second input data of 2 bits, 26 is output data of 4 bits of the decoder 21, 27 is output data of 7 bits of the barrel shifter 22, and 28 is output data of the memory.

【0013】以下、図2に基づいて動作を説明する。デ
コーダ21は第1の入力データ24をデコードする。2
ビットの入力データ2進数表現である00,01,1
0,11に対応して、デコーダの4個の出力の第1番目
〜第4番目にのみ1を出力し、他は0を出力する。次に
これら4個のデコーダの出力をバレルシフタ22に入力
し、第2の入力データ25の値だけ下方へシフトする。
即ち、2ビットの第2の入力データの2進数表現である
00,01,10,11に対応して0〜3ビット下方へ
シフトする。バレルシフタ22の出力データ7ビットの
内、バレルシフタの4ビットの入力データがシフトされ
て4ビットの出力データとなる以外の3ビットのデータ
は、0を出力する。こうして得られたバレルシフタの結
果を図3に示す。図3(a),(b),(c),(d)
に、それぞれ、第2の入力データが00,01,10,
11に対応して0ビット、1ビット、2ビット、3ビッ
トシフトして得られるバレルシフタの出力を示す。こう
して第1の入力データの値に第2の入力データの値を加
えた位置に1を出力することになる。この結果をメモリ
アレイのワード線に入力することにより、予め格納され
た関数値を読み出す。結果として(数2)の結果を出力
することができる。
The operation will be described below with reference to FIG. The decoder 21 decodes the first input data 24. Two
00, 01, 1 which is the binary representation of the input data in bits
Corresponding to 0 and 11, 1 is output only to the first to fourth of the four outputs of the decoder, and 0 is output to the others. Next, the outputs of these four decoders are input to the barrel shifter 22 and are shifted downward by the value of the second input data 25.
That is, 0 to 3 bits are shifted downward corresponding to 00, 01, 10, and 11 which are binary representations of 2-bit second input data. Of the 7-bit output data of the barrel shifter 22, 3-bit data other than the 4-bit input data of the barrel shifter being shifted to 4-bit output data outputs 0. The results of the barrel shifter thus obtained are shown in FIG. 3 (a), (b), (c), (d)
The second input data is 00, 01, 10,
The output of the barrel shifter obtained by shifting 0 bit, 1 bit, 2 bits, and 3 bits corresponding to 11 is shown. Thus, 1 is output at the position where the value of the second input data is added to the value of the first input data. By inputting this result to the word line of the memory array, the previously stored function value is read. As a result, the result of (Equation 2) can be output.

【0014】[0014]

【数2】 [Equation 2]

【0015】図4にデコーダの一例を示す。図4におい
て41−1,41−2は反転器、42−1〜42−4は
論理積回路、43は2ビットの入力データ、44は4ビ
ットからなるデコーダ出力データである。2ビットの入
力データをそれぞれ反転器41,41−2で反転する。
2ビットの入力データと反転データから構成される4個
のデータから2個選ぶ4通りの組合せを、4個の論理積
回路42−1〜42−4によりそれぞれ論理積演算を行
い、デコーダ結果を生成する。この結果、図4に示した
ように、入力データが、00,01,10,11に対応
してデコード結果は、1000,0100,0010,
0001を出力する。
FIG. 4 shows an example of the decoder. In FIG. 4, 41-1 and 41-2 are inverters, 42-1 to 42-4 are AND circuits, 43 is 2-bit input data, and 44 is 4-bit decoder output data. The 2-bit input data is inverted by the inverters 41 and 41-2, respectively.
Four combinations of two selected from four data composed of 2-bit input data and inverted data are logically ANDed by the four logical product circuits 42-1 to 42-4, and the decoder result is obtained. To generate. As a result, as shown in FIG. 4, the input data corresponds to 00, 01, 10, 11 and the decoding results are 1000, 0100, 0010,
Output 0001.

【0016】図5にMOSトランジスタ構成のバレルシ
フタの一例を示す。図5において、51−1及び51−
2は反転器、52−1〜52−24はNチャネルトラン
ジスタ、53−1〜53−24はPチャネルトランジス
タ、54−1〜54−4はバッファ回路、55は2ビッ
トからなるシフト量データ、56は0データ、57は4
ビットからなる被シフトデータ、58は7ビットからな
る出力データである。シフト量データの上位データによ
り4ビットの被シフトデータを、0ビット下方にシフト
するか2ビット下方にシフトするかの選択を行い、シフ
ト量データの下位データにより4ビットの被シフトデー
タを、0ビット下方にシフトするか1ビット下方にシフ
トするかの選択を行う。これらを直列に接続することに
より0ビットから3ビットの任意ビットシフトを実現す
る。バレルシフタの出力データ7ビットの内、バレルシ
フタの4ビットの入力データがシフトされて4ビットの
出力データとなる以外の3ビットのデータとして0を出
力するために、56のデータを入力している。
FIG. 5 shows an example of a barrel shifter having a MOS transistor structure. In FIG. 5, 51-1 and 51-
2 is an inverter, 52-1 to 52-24 are N-channel transistors, 53-1 to 53-24 are P-channel transistors, 54-1 to 54-4 are buffer circuits, 55 is shift amount data consisting of 2 bits, 56 is 0 data, 57 is 4
Bits are shifted data, and 58 is output data having 7 bits. The upper data of the shift amount data is used to select whether the 4-bit shifted data is shifted 0 bits downward or 2 bits downward, and the 4-bit shifted data is set to 0 by the lower data of the shift amount data. It is selected whether to shift down one bit or shift down one bit. Arbitrary bit shift from 0 bit to 3 bit is realized by connecting these in series. Of the 7-bit output data of the barrel shifter, 56 data is input in order to output 0 as 3-bit data other than the 4-bit input data of the barrel shifter being shifted to become 4-bit output data.

【0017】図6に示した従来例では、2ビット加算器
61を構成する全加算器2段の遅延時間に対し、本願発
明では図5の様なバレルシフタ1段の遅延で済む。ま
た、デコーダのビット数が3ビットから2ビットにな
り、デコーダの演算時間も削減される。
In the conventional example shown in FIG. 6, the delay time of two stages of full adders constituting the 2-bit adder 61 is one delay of one barrel shifter as shown in FIG. 5 in the present invention. Further, the number of bits of the decoder is changed from 3 bits to 2 bits, and the operation time of the decoder is reduced.

【0018】図1の演算装置は、図2の演算装置を直列
に多段組み合わせることにより構成され、加算が多入力
の場合に適用するものである。
The arithmetic unit of FIG. 1 is constructed by combining the arithmetic units of FIG. 2 in multiple stages in series, and is applied when the addition has a large number of inputs.

【0019】[0019]

【発明の効果】以上述べたように、本発明によれば、加
算結果に対応した関数出力を行う演算を高速に実現する
ことができ、本発明の実用的効果は大きい。
As described above, according to the present invention, it is possible to realize at high speed the operation for outputting the function corresponding to the addition result, and the practical effect of the present invention is great.

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

【図1】本発明請求項1記載の演算装置の構成図FIG. 1 is a block diagram of an arithmetic unit according to claim 1 of the present invention.

【図2】本発明請求項1記載の演算装置の一実施例FIG. 2 is an embodiment of the arithmetic unit according to claim 1 of the present invention.

【図3】本発明請求項1記載の演算装置の原理の説明図FIG. 3 is an explanatory diagram of the principle of the arithmetic unit according to claim 1 of the present invention.

【図4】デコーダ回路の一例を示す図FIG. 4 is a diagram showing an example of a decoder circuit.

【図5】バレルシフタの一例を示す図FIG. 5 is a diagram showing an example of a barrel shifter.

【図6】従来の演算装置の構成図FIG. 6 is a block diagram of a conventional arithmetic unit

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

11 デコーダ 12−1〜12−(N−1) 第1から第(N−1)の
バレルシフタ 13 メモリアレイ 14−1〜14−N 第1から第Nの入力データ 15 デコーダの出力 16−1〜16−(N−1) 第1から第(N−1)の
バレルシフタの出力 21 デコーダ 22 バレルシフタ 23 メモリアレイ 24 第1の入力データ 25 第2の入力データ 26 デコーダの出力データ 27 バレルシフタの出力データ 28 メモリの出力データ 41−1、41−2 反転器 42−1〜42−4 論理積回路 43 入力データ 44 デコーダの出力データ 51−1、51−2 反転器 52−1〜52−24 Nチャネルトランジスタ 53−1〜53−24 Pチャネルトランジスタ 54−1〜54−4 バッファ回路 55 シフト量データ 56 0データ 57 被シフトデータ 58 出力データ
11 Decoders 12-1 to 12- (N-1) First to (N-1) th barrel shifters 13 Memory arrays 14-1 to 14-N First to Nth input data 15 Decoder outputs 16-1 to 16- (N-1) First to (N-1) th barrel shifter output 21 Decoder 22 Barrel shifter 23 Memory array 24 First input data 25 Second input data 26 Decoder output data 27 Barrel shifter output data 28 Memory output data 41-1, 41-2 Inverter 42-1 to 42-4 AND circuit 43 Input data 44 Decoder output data 51-1 and 51-2 Inverter 52-1 to 52-24 N-channel transistor 53-1 to 53-24 P-channel transistor 54-1 to 54-4 Buffer circuit 55 Shift amount data 56 0 data 57 Shifted data 58 Output data

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】N個の2進データの加算結果に対応してテ
ーブルに格納された値を出力する演算装置であって、第
1の入力データをデコーダに入力し、該デコーダの出力
を第1のバレルシフタで第2の入力データで表される数
だけシフトし、第nのバレルシフタの出力を第n+1の
バレルシフタで第n+2の入力データで表される数だけ
シフトする操作をn=1,2,…,N−2について行
い、第(N−1)のバレルシフタの出力を、テーブルの
値が格納されたメモリアレイのワード線に入力し、該メ
モリアレイの出力を出力とする演算装置。
1. An arithmetic unit for outputting a value stored in a table corresponding to an addition result of N binary data, wherein first input data is input to a decoder, and an output of the decoder is input to a first unit. The operation of shifting the output of the first barrel shifter by the number represented by the second input data and the output of the nth barrel shifter by the number represented by the n + 2th input data by the (n + 1) th barrel shifter are n = 1,2. , ..., N−2, and inputs the output of the (N−1) th barrel shifter to the word line of the memory array in which the values in the table are stored, and outputs the output of the memory array.
JP4090545A 1992-04-10 1992-04-10 Arithmetic unit Pending JPH05289852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4090545A JPH05289852A (en) 1992-04-10 1992-04-10 Arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4090545A JPH05289852A (en) 1992-04-10 1992-04-10 Arithmetic unit

Publications (1)

Publication Number Publication Date
JPH05289852A true JPH05289852A (en) 1993-11-05

Family

ID=14001390

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4090545A Pending JPH05289852A (en) 1992-04-10 1992-04-10 Arithmetic unit

Country Status (1)

Country Link
JP (1) JPH05289852A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7418601B2 (en) 2002-06-18 2008-08-26 Sanyo Electric Co., Ltd. Data transfer control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7418601B2 (en) 2002-06-18 2008-08-26 Sanyo Electric Co., Ltd. Data transfer control system

Similar Documents

Publication Publication Date Title
US4953115A (en) Absolute value calculating circuit having a single adder
US7308470B2 (en) Smaller and lower power static mux circuitry in generating multiplier partial product signals
JPH0215088B2 (en)
US4845655A (en) Carry circuit suitable for a high-speed arithmetic operation
US5070471A (en) High speed multiplier which divides multiplying factor into parts and adds partial end products
US5231415A (en) Booth's multiplying circuit
US4890251A (en) Arithmetic shifter with sign extend facility
US7024445B2 (en) Method and apparatus for use in booth-encoded multiplication
JP3356613B2 (en) Addition method and adder
JPH05289852A (en) Arithmetic unit
JPH0697431B2 (en) Barrel shifter
US4507749A (en) Two's complement multiplier circuit
JP3159349B2 (en) Addition decoding device
US5818894A (en) High speed barrel shifter
JPH0661871A (en) Parallel serial data conversion circuit
JPH03229320A (en) Incremental circuit
EP0610259B1 (en) 1-bit adder
US5216424A (en) Binary data converter
US6522690B1 (en) Zero determination signal generating circuit
JP2838326B2 (en) Digital multiplier
JPH07118630B2 (en) Signal processing circuit for multiplication
US5239499A (en) Logical circuit that performs multiple logical operations in each stage processing unit
JP3008691B2 (en) Code conversion circuit
KR100216319B1 (en) Driving circuit of lcd panel
CN113609801A (en) Asynchronous sequential control circuit design method and device