JPH05265710A - Rounding operation circuit - Google Patents

Rounding operation circuit

Info

Publication number
JPH05265710A
JPH05265710A JP4064453A JP6445392A JPH05265710A JP H05265710 A JPH05265710 A JP H05265710A JP 4064453 A JP4064453 A JP 4064453A JP 6445392 A JP6445392 A JP 6445392A JP H05265710 A JPH05265710 A JP H05265710A
Authority
JP
Japan
Prior art keywords
signal
outputs
rounding
input signal
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP4064453A
Other languages
Japanese (ja)
Other versions
JP3031044B2 (en
Inventor
Akio Yoshida
亜紀夫 吉田
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 JP4064453A priority Critical patent/JP3031044B2/en
Publication of JPH05265710A publication Critical patent/JPH05265710A/en
Application granted granted Critical
Publication of JP3031044B2 publication Critical patent/JP3031044B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To perform O-cutting/1-raising rounding processing of the positive- negative symmetry at a high speed. CONSTITUTION:A 1st decoder 21 inputs a 2nd input signal 12 and outputs the 1st and 2nd decoding signals 13 and 14. A selection circuit 23 outputs the signal 13 as an output signal 16 when the most significant bit 15 showing the code of a 1st input signal 11 is equal to '0' and outputs the signal 14 as the signal 16 when the bit 15 is equal to '1', respectively. An arithmetic logical operation circuit 24 adds both signals 11 and 16 together and outputs this addition result as an output signal 18. A 2nd decoder 22 inputs the signal 12 and outputs a 3rd decoding signal 17 in response to the value of a prescribed table. Then, a mask circuit 25 secures the AND of the signal 17 with the signal 18 and outputs the rounding result as an output signal 19.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、信号処理プロセッサの
演算ユニットにおける任意の丸め位置に対して正負対称
な0捨1入丸めを行う丸め演算回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a rounding arithmetic circuit for performing positive / negative symmetrical rounding to zero rounding to an arbitrary rounding position in an arithmetic unit of a signal processor.

【0002】[0002]

【従来の技術】2の補数表現された値に対する簡単な丸
め演算処理方法として丸め位置のビットに1を加算した
後、丸め位置より上位のビットを切り出す0捨1入丸め
が知られている。この方法では、例えば8ビットの正数
“00001011”に対して丸め位置をLSBより1
ビット上とした場合、丸め位置のビットは“1”でそれ
以外は“0”である“00000010”との加算結果
“00001101”に於ける上位6ビットを切り出す
ことにより“00001100”を得、8ビットの負数
“11110110”に対しては、正数と同様な“00
000010”との加算結果“11111000”に於
ける上位6ビットを切り出すことにより“111110
00”を得る。
2. Description of the Related Art As a simple rounding operation processing method for a value represented by two's complement, there is known a rounding to 0 rounding 1 in which a bit at a rounding position is incremented by 1 and a bit higher than the rounding position is cut out. In this method, for example, for the 8-bit positive number "00001011", the rounding position is 1 from the LSB.
When it is set as a bit, the bit at the rounding position is “1” and the other bits are “0”, which is “00000010”, and the upper 6 bits in the addition result “00001011” are cut out to obtain “00001100”, For a negative bit number "11110110", the same "00" as a positive number
By cutting out the upper 6 bits in the addition result “11111000” with “000010”, “111110” is extracted.
To get 00 ".

【0003】しかし、この処理方法ては、丸めの位置に
関わらず丸めの中心が負方向にLSB/2ずれるため、
データの発生確率が正負等確率であっても誤差の時間平
均が0とならない事が報告されている。文献:望月他、
「動画処理用VISP−LSIでの逆DCT演算」19
90年、信学春季全大、A−192参照。
However, in this processing method, the center of the rounding shifts in the negative direction by LSB / 2 regardless of the rounding position.
It has been reported that the time average of the error does not become 0 even if the probability of occurrence of data is positive / negative. Reference: Mochizuki et al.,
"Inverse DCT operation in VISP-LSI for moving image processing" 19
See 1990, Shin-Gaku Spring University, A-192.

【0004】この文献では、この問題を解決する方法と
して、正負対称な0捨1入丸めが提案されている。これ
は対象とするデータの符号により加算する値を選択し、
正数に対する丸めの中心は負方向にLSB/2、負数に
対する丸めの中心は正方向にLSB/2ずらす丸め特性
を実現する事により、データの発生確率が正負等確率で
あった場合、誤差の時間平均を0とする方式である。
In this document, as a method of solving this problem, positive / negative symmetrical 0 rounding 1 rounding is proposed. This selects the value to add according to the sign of the target data,
The center of rounding for positive numbers is LSB / 2 in the negative direction, and the center of rounding for negative numbers is LSB / 2 in the positive direction. This is a method in which the time average is set to 0.

【0005】この方法では、例えば8ビットの正数“0
0001011”に対して丸め位置をLSBより1ビッ
ト目とした場合、丸め位置のビットは“1”でそれ以外
は“0”である“00000010”との加算結果“0
0001101”に於ける上位6ビットを切り出すこと
により“00001100”を得、8ビットの負数“1
1110110”に対しては、丸め位置より下位のビッ
トは“1”でそれ以外は“0”である“0000000
1”との加算結果“11110111”に於ける上位6
ビットを切り出すことにより“11110100”を得
る。
In this method, for example, an 8-bit positive number "0"
When the rounding position for 0001011 "is the first bit from the LSB, the bit at the rounding position is" 1 ", and the other bits are" 0 ".
"00001100" is obtained by cutting out the upper 6 bits in "0001101", and an 8-bit negative number "1" is obtained.
For 1110110 ", the bits lower than the rounding position are" 1 "and the other bits are" 0 ", which is" 0000000 ".
Higher 6 in addition result "11110111" with 1 "
"11110100" is obtained by cutting out the bit.

【0006】次に、従来の丸め演算回路に就いて、特願
平2−199552号に基づき図3及び表1を参照して
説明する。図3に於いて、11は第一の入力信号、12
は第二の入力信号、13,14は第一,第二のデコード
信号、15は入力信号11の最上位ビット、21aはデ
コーダ、23は選択回路3は算術論理演算回路(AL
U)、16は選択回路23の出力、18はALU24の
出力である。
Next, a conventional rounding operation circuit will be described based on Japanese Patent Application No. 2-199552 with reference to FIG. 3 and Table 1. In FIG. 3, 11 is the first input signal and 12
Is a second input signal, 13 and 14 are first and second decoded signals, 15 is the most significant bit of the input signal 11, 21a is a decoder, 23 is a selection circuit 3 is an arithmetic logic operation circuit (AL
U) and 16 are outputs of the selection circuit 23, and 18 is an output of the ALU 24.

【0007】次の表1は図3に於いて、8ビットの第一
の入力信号11に対する丸め位置を3ビットの第二の入
力信号12にて指定する場合の、第二の入力信号12に
対応する第一,第二のデコード信号13,14を示す。
この表に於いて、第一列は第二の入力信号12を示し、
第二列は第一のデコード信号11を示し、第三列は第二
のデコード信号14を示す。
Table 1 below shows the second input signal 12 when the rounding position for the 8-bit first input signal 11 is designated by the 3-bit second input signal 12 in FIG. The corresponding first and second decode signals 13 and 14 are shown.
In this table, the first column shows the second input signal 12,
The second column shows the first decoded signal 11 and the third column shows the second decoded signal 14.

【0008】[0008]

【表1】 [Table 1]

【0009】次にこの回路の動作を説明する。デコーダ
21aは第二の入力信号12を入力し、表1に示す入力
信号12の値に対応した第一,第二のデコード信号1
3,14を出力する。選択回路23は、第一の入力信号
11の符号を示す最上位ビット15が“0”の場合デコ
ード信号13を選択信号16として出力し、最上位ビッ
ト15が“1”の場合デコード信号14を選択信号16
として出力する。算術論理演算回路24は信号11と信
号16との加算を行い、加算結果18として出力する。
Next, the operation of this circuit will be described. The decoder 21a receives the second input signal 12 and outputs the first and second decoded signals 1 corresponding to the values of the input signal 12 shown in Table 1.
3 and 14 are output. The selection circuit 23 outputs the decode signal 13 as the selection signal 16 when the most significant bit 15 indicating the sign of the first input signal 11 is “0”, and outputs the decode signal 14 when the most significant bit 15 is “1”. Selection signal 16
Output as. The arithmetic logic operation circuit 24 adds the signal 11 and the signal 16 and outputs the addition result 18.

【0010】[0010]

【発明が解決しようとする課題】上述した従来の丸め演
算回路では、正負対称の0捨1入丸め結果を得るために
は、図3に於ける加算結果信号18に対して、更に丸め
位置より上位のビットを切り出す必要がある。このため
実際の丸め結果を得るには、前述の実施例に於ける加算
命令に加え、丸め位置より上位のビットを切り出す命令
を要し、高速処理できないという欠点を有している。
In the above-described conventional rounding operation circuit, in order to obtain a positive / negative symmetrical rounding-down 0 rounding result, the addition result signal 18 in FIG. It is necessary to cut out the upper bits. Therefore, in order to obtain the actual rounding result, in addition to the addition instruction in the above-described embodiment, an instruction for cutting out the bits higher than the rounding position is required, which has a drawback that high-speed processing cannot be performed.

【0011】本発明の目的は、このような欠点を除き、
高速演算処理を可能とした丸め演算回路を提供すること
にある。
The object of the present invention is to eliminate these drawbacks.
It is to provide a rounding operation circuit that enables high-speed operation processing.

【0012】[0012]

【課題を解決するための手段】本発明の丸め演算回路の
構成は、2の補数で表現される第一の入力信号の丸め位
置を指定する第二の入力信号を入力しその丸め位置のビ
ットが“1”でそれ以外は“0”である第二のデコード
信号を出力する第一のデコーダと、前記第二の入力信号
を入力し前記丸め位置より上位のビットが“1”でそれ
以外は“0”である第三のデコード信号出力する第二の
デコーダと、これら第一および第二の各デコード信号を
入力し前記第一の入力信号の最上位ビットが“1”の場
合前記第二のデコード信号を出力し前記第一の入力信号
の最上位ビットが“0”の場合前記第一のデコード信号
を出力する選択回路と、この選択回路の出力と前記第一
の入力信号とを入力としてこれらの加算を行う演算回路
と、この演算回路の出力と前記第三のデコード信号とを
入力しビット毎の論理積結果を出力するマスク回路とを
備え、任意の丸め位置に対して正負対称の0捨1入丸め
を行うようにしたことを特徴とする。
SUMMARY OF THE INVENTION The structure of a rounding arithmetic circuit of the present invention is such that a second input signal designating a rounding position of a first input signal represented by two's complement is inputted and a bit at the rounding position is inputted. Is a "1" and the other is a "0", the second decoder outputs a second decoded signal, and the second input signal is input, and bits higher than the rounding position are "1" Is a second decoder for outputting a third decoded signal which is "0", and these first and second decoded signals are input, and when the most significant bit of the first input signal is "1", the second decoder A selection circuit for outputting the second decoding signal and outputting the first decoding signal when the most significant bit of the first input signal is "0"; and an output of the selection circuit and the first input signal. An arithmetic circuit for performing these additions as inputs, and this arithmetic circuit A mask circuit that receives an output and the third decode signal and outputs a logical product result for each bit is provided, and positive / negative symmetrical 0 rounding 1 rounding is performed with respect to an arbitrary rounding position. And

【0013】[0013]

【実施例】図1は本発明の第一の実施例の構成を示すブ
ロック図である。図に於いては、従来例に対して第二の
入力信号12から第三のデコード信号17を出力する第
二のデコーダ22と、このデコード信号17によりAL
U出力信号18をマスクするマスク回路25が付加され
ている。
1 is a block diagram showing the configuration of a first embodiment of the present invention. In the figure, the second decoder 22 that outputs the third decoded signal 17 from the second input signal 12 as compared with the conventional example, and the AL by the decoded signal 17
A mask circuit 25 for masking the U output signal 18 is added.

【0014】次の表2は図1に於いて8ビットの第一の
入力信号11に対する丸め位置を3ビットの第二の入力
信号12にて指定する場合の、第二の入力信号12に対
応する第一,第二のデコード信号13,14及び第三の
デコード信号17を示す。この表に於いて、第一列は第
二の入力信号12を示し、第四列は第三のデコード信号
17を示す。
The following Table 2 corresponds to the second input signal 12 when the rounding position for the 8-bit first input signal 11 in FIG. 1 is designated by the 3-bit second input signal 12. The first and second decode signals 13 and 14 and the third decode signal 17 are shown. In this table, the first column shows the second input signal 12 and the fourth column shows the third decoded signal 17.

【0015】[0015]

【表2】 [Table 2]

【0016】以下に本実施例の動作を説明する。第一の
デコーダ21は第二の入力信号12を入力とし、表2に
示す入力信号11の値に対応した第一,第二のデコード
信号13,14を出力する。選択回路23は、第一の入
力信号11の符号を示す最上位ビット15が“0”の場
合デコード信号13を出力信号16に出力し、最上位ビ
ット“1”の場合デコード信号14を出力信号16に出
力する。算術論理演算回路24は信号11,信号16の
加算を行い、加算結果を出力18として出力する。第二
のデコーダ22は入力信号12を入力とし、この入力信
号12の値に対応した第三のデコード信号17を表2の
ように出力する。マスク回路25は出力18とデコード
信号17の論理積をとり丸め結果を出力19として出力
する。
The operation of this embodiment will be described below. The first decoder 21 receives the second input signal 12 as an input and outputs first and second decode signals 13 and 14 corresponding to the values of the input signal 11 shown in Table 2. The selection circuit 23 outputs the decode signal 13 to the output signal 16 when the most significant bit 15 indicating the sign of the first input signal 11 is “0”, and outputs the decode signal 14 when the most significant bit “1”. Output to 16. The arithmetic logic operation circuit 24 adds the signals 11 and 16 and outputs the addition result as an output 18. The second decoder 22 receives the input signal 12 as an input and outputs the third decoded signal 17 corresponding to the value of the input signal 12 as shown in Table 2. The mask circuit 25 takes the logical product of the output 18 and the decoded signal 17 and outputs the rounded result as the output 19.

【0017】以上の回路により、正負対称な0捨1入丸
め演算を実行することが可能となる。
With the above circuit, it is possible to execute a positive / negative symmetrical 0 rounding 1 rounding operation.

【0018】図2は本発明の第2の実施例の構成を示す
ブロック図である。図2に於いては、デコーダ21aが
図1と相違し、第二のデコーダ22をなくしている。
FIG. 2 is a block diagram showing the configuration of the second embodiment of the present invention. In FIG. 2, the decoder 21a is different from that of FIG. 1 and the second decoder 22 is eliminated.

【0019】次の表3は図2に於いて8ビットの第一の
入力信号11に対する丸め位置を8ビットの第二の入力
信号12にて指定する場合の、第二の入力信号12に対
応する第一,第二のデコード信号13,14を示す。こ
の表に於いて、第一列は第二の入力信号12、第二列は
第一のデコード信号13、第三列は第二のデコード信号
14を示す。本実施例では、第1の実施例に比較し、第
二のデコーダ22を必要としないため、構成を簡略化で
きるという効果がある。
The following Table 3 corresponds to the second input signal 12 when the rounding position for the 8-bit first input signal 11 in FIG. 2 is designated by the 8-bit second input signal 12. The first and second decode signals 13 and 14 are shown. In this table, the first column shows the second input signal 12, the second column shows the first decoded signal 13, and the third column shows the second decoded signal 14. The present embodiment does not require the second decoder 22 as compared with the first embodiment, and therefore has the effect of simplifying the configuration.

【0020】[0020]

【表3】 [Table 3]

【0021】次に本実施例の動作を説明する。デコーダ
21aは第二の入力信号12を入力し、表3に示す入力
信号12の値に対応した第一,第二のデコード信号1
3,14を出力する。選択回路23は、第一の入力信号
11の符号を示す最上位ビット15が“0”の場合デコ
ード出力13を出力信号16として出力し、最上位ビッ
ト15が“1”の場合デコード出力144を出力信号1
6として出力する。算術論理演算回路24は信号11と
信号16との加算を行い、加算結果を出力信号18とし
て出力する。マスク回路25は信号18と入力信号12
との論理積をとり丸め結果を出力信号18として出力す
る。
Next, the operation of this embodiment will be described. The decoder 21a receives the second input signal 12 and outputs the first and second decoded signals 1 corresponding to the values of the input signal 12 shown in Table 3.
3 and 14 are output. The selection circuit 23 outputs the decode output 13 as the output signal 16 when the most significant bit 15 indicating the sign of the first input signal 11 is “0”, and outputs the decode output 144 when the most significant bit 15 is “1”. Output signal 1
Output as 6. The arithmetic logic operation circuit 24 adds the signal 11 and the signal 16 and outputs the addition result as an output signal 18. The mask circuit 25 receives the signal 18 and the input signal 12
And the rounded result is output as an output signal 18.

【0022】以上の回路により、正負対称な0捨1入丸
め演算を実行することが可能である。
With the above circuit, it is possible to execute positive / negative symmetrical 0 rounding 1 rounding operation.

【0023】[0023]

【発明の効果】以上説明したように本発明によれば、前
述の信号処理で使用される正負対称な0捨1入丸め演算
を実行することができるので、これにより演算精度の維
持に効果的な丸め処理を1命令で実行できるという効果
がある。
As described above, according to the present invention, it is possible to execute the positive / negative symmetrical 0 rounding 1 rounding operation used in the above-mentioned signal processing, which is effective for maintaining the operation accuracy. There is an effect that the rounding process can be executed by one instruction.

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

【図1】本発明の第1の実施例のブロック図。FIG. 1 is a block diagram of a first embodiment of the present invention.

【図2】本発明の第2の実施例のブロック図。FIG. 2 is a block diagram of a second embodiment of the present invention.

【図3】従来例の丸め演算回路の構成を示すブロック
図。
FIG. 3 is a block diagram showing a configuration of a conventional rounding arithmetic circuit.

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

11,12,17 第一,第二および第三の入力信号 13,14 第一,第二のデコード信号 15 第一の入力信号の最上位ビット 16 選択回路出力 18 算術論理演算回路出力 19 マスク回路出力(出力信号) 21,22 第一,第二のデコーダ 23 選択回路 24 算術論理演算回路 25 マスク回路 11, 12, 17 First, second and third input signals 13,14 First, second decoded signal 15 Most significant bit of first input signal 16 Selection circuit output 18 Arithmetic logic operation circuit output 19 Mask circuit Output (output signal) 21, 22 First and second decoders 23 Selection circuit 24 Arithmetic logic operation circuit 25 Mask circuit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 2の補数で表現される第一の入力信号の
丸め位置を指定する第二の入力信号を入力しその丸め位
置のビットが“1”でそれ以外は“0”である第二のデ
コード信号を出力する第一のデコーダと、前記第二の入
力信号を入力し前記丸め位置より上位のビットが“1”
でそれ以外は“0”である第三のデコード信号出力する
第二のデコーダと、これら第一および第二の各デコード
信号を入力し前記第一の入力信号の最上位ビットが
“1”の場合前記第二のデコード信号を出力し前記第一
の入力信号の最上位ビットが“0”の場合前記第一のデ
コード信号を出力する選択回路と、この選択回路の出力
と前記第一の入力信号とを入力としてこれらの加算を行
う演算回路と、この演算回路の出力と前記第三のデコー
ド信号とを入力しビット毎の論理積結果を出力するマス
ク回路とを備え、任意の丸め位置に対して正負対称の0
捨1入丸めを行うようにしたことを特徴とする丸め演算
回路。
1. A second input signal, which designates a rounding position of a first input signal represented by a two's complement, is inputted, and the bit at the rounding position is "1" and the other bits are "0". A first decoder that outputs a second decoded signal, and the second input signal that is input and the upper bits of the rounding position are "1"
And a second decoder which outputs a third decoded signal which is otherwise "0" and these first and second decoded signals are input, and the most significant bit of the first input signal is "1". A selection circuit that outputs the second decoding signal and outputs the first decoding signal when the most significant bit of the first input signal is "0"; and an output of the selection circuit and the first input. An arithmetic circuit that receives signals and inputs them and adds them, and a mask circuit that outputs the output of this arithmetic circuit and the third decode signal and outputs a logical product result for each bit are provided. Positive and negative symmetry 0
A rounding operation circuit characterized by rounding down to one round.
【請求項2】 第二の入力信号が、第一の入力信号の丸
め位置より上位のビットが“1”でそれ以外は“0”で
ある信号を用いて、これをマスク回路の第三のデコード
信号とすることにより、第二のデコーダを削除した請求
項1記載の丸め演算回路。
2. The second input signal is a signal in which the upper bit of the rounding position of the first input signal is "1" and the other bits are "0", and this is used as a third signal of the mask circuit. The rounding operation circuit according to claim 1, wherein the second decoder is eliminated by using a decode signal.
JP4064453A 1992-03-23 1992-03-23 Rounding circuit Expired - Lifetime JP3031044B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4064453A JP3031044B2 (en) 1992-03-23 1992-03-23 Rounding circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4064453A JP3031044B2 (en) 1992-03-23 1992-03-23 Rounding circuit

Publications (2)

Publication Number Publication Date
JPH05265710A true JPH05265710A (en) 1993-10-15
JP3031044B2 JP3031044B2 (en) 2000-04-10

Family

ID=13258681

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4064453A Expired - Lifetime JP3031044B2 (en) 1992-03-23 1992-03-23 Rounding circuit

Country Status (1)

Country Link
JP (1) JP3031044B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011091499A (en) * 2009-10-20 2011-05-06 Hitachi Kokusai Electric Inc Distortion compensating apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011091499A (en) * 2009-10-20 2011-05-06 Hitachi Kokusai Electric Inc Distortion compensating apparatus

Also Published As

Publication number Publication date
JP3031044B2 (en) 2000-04-10

Similar Documents

Publication Publication Date Title
JPH05265709A (en) Rounding operation circuit
JPH02201645A (en) Exception detecting circuit
JPH05134851A (en) Multiplying circuit output system
JPH02278382A (en) Arithmetic and logic mechanism for graphic processor
JPH05265710A (en) Rounding operation circuit
JPH0212327A (en) Mask generator
US5754458A (en) Trailing bit anticipator
JP2991788B2 (en) Decoder
JP2001344100A (en) Central processing unit equipped with plural flag registers
JP2901463B2 (en) Addition device
JPH0619700B2 (en) Arithmetic unit
JPH10198552A (en) Multiplier
JP2546014B2 (en) Digital signal processor
JPS61133476A (en) Operating circuit
JP3198795B2 (en) Adder and addition method
JP3539077B2 (en) Division method by parallel operation method
JPH0523013Y2 (en)
JPH0766261B2 (en) Symmetric decoder
JPH04286023A (en) Arithmetic circuit
JPS6386082A (en) Image processor
JPS63228330A (en) Arithmetic processor
JPH0773015A (en) Fixed-point data adder
JPH0713743A (en) Multiplier
JPS58166444A (en) Large/small discriminating circuit for absolute value
JPH1021054A (en) Arithmetic processor

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000111