JP2001043067A - Arithmetic unit - Google Patents

Arithmetic unit

Info

Publication number
JP2001043067A
JP2001043067A JP11217199A JP21719999A JP2001043067A JP 2001043067 A JP2001043067 A JP 2001043067A JP 11217199 A JP11217199 A JP 11217199A JP 21719999 A JP21719999 A JP 21719999A JP 2001043067 A JP2001043067 A JP 2001043067A
Authority
JP
Japan
Prior art keywords
data
absolute value
block
maximum
value
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.)
Withdrawn
Application number
JP11217199A
Other languages
Japanese (ja)
Inventor
Hiroshi Nakamura
拓 中村
Hiroaki Shirane
弘晃 白根
Eiji Yamamoto
英治 山本
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.)
Hitachi Ltd
Hitachi Advanced Digital Inc
Hitachi Solutions Technology Ltd
Original Assignee
Hitachi Ltd
Hitachi ULSI Systems Co Ltd
Hitachi Video and Information System Inc
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 Hitachi Ltd, Hitachi ULSI Systems Co Ltd, Hitachi Video and Information System Inc filed Critical Hitachi Ltd
Priority to JP11217199A priority Critical patent/JP2001043067A/en
Publication of JP2001043067A publication Critical patent/JP2001043067A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PROBLEM TO BE SOLVED: To make an operation with high calculation accuracy performable even when data are extremely large or small in the case of arithmetically processing the data of a floating point form in the arithmetic processing part of a fixed point form. SOLUTION: When reading the data of the floating point form for one block into a RAM 40, to which series of operation including the operation of data are applied, as one block, a maximum value (r) of an index part is found within that block by an index part comparator 20 and an index part maximum value register 21. With the maximum value (r) as a common index part, a mantissa part is shifted by an ALU 60 so that the index part of all data in the block can be equal to the common index part (r). After shift processing, the mantissa part is handled as data of the fixed point form and prescribed operation is performed by using the ALU 60. After the end of the prescribed operation, bit shift is performed by using the common index part (r) and the final arithmetic result of the fixed point form is provided.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、固定小数点形式に
よって演算を行う装置に関し、特に、DSP(Digital
Signal Processor)を用いたオーディオ・デコード処理
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for performing an arithmetic operation in a fixed-point format, and in particular, to a DSP (Digital).
The present invention relates to an audio decoding process using a signal processor.

【0002】[0002]

【従来の技術】従来から画像や音声などの時系列データ
にフィルタ演算等の処理を行う手段として、DSPが用
いられている。DSPは、デジタル信号処理に適したア
ーキテクチャを有した演算装置であり、プログラム(演
算アルゴリズム)にしたがって、演算処理を行う。DS
Pは、プログラムを替えることによりアルゴリズムの変
更も容易にでき、複数の機能をひとつのハードウェアで
実現可能なため、高機能かつ低廉化が求められるデジタ
ル民生機器などに広く用いられている。
2. Description of the Related Art Conventionally, a DSP has been used as a means for performing processing such as a filter operation on time-series data such as images and sounds. The DSP is an arithmetic device having an architecture suitable for digital signal processing, and performs arithmetic processing according to a program (operation algorithm). DS
Since P can easily change the algorithm by changing programs and can realize a plurality of functions with one piece of hardware, P is widely used in digital consumer equipment and the like that require high performance and low cost.

【0003】このようなDSPは、一般に、固定小数点
形式のデータの演算を行う。固定小数点形式の演算処理
は、浮動小数点形式に比べ簡単であるので、ALU等の
演算回路部の構成を簡略化することができる。
[0003] Such a DSP generally operates on data in a fixed-point format. Since the arithmetic processing in the fixed-point format is simpler than that in the floating-point format, the configuration of the arithmetic circuit unit such as the ALU can be simplified.

【0004】図10は、一般的な固定小数点形式の演算
を行うALUを含む演算装置の構成を示す図である。
FIG. 10 is a diagram showing a configuration of an arithmetic unit including an ALU for performing a general fixed-point arithmetic operation.

【0005】同図に示すように、この演算装置は、プロ
グラムカウンタ01と、プログラムメモリ02と、コマ
ンドデコーダ03と、汎用レジスタ30と、RAM40
と、データセレクタ50,51と、ALU60とを備え
る。
As shown in FIG. 1, the arithmetic unit comprises a program counter 01, a program memory 02, a command decoder 03, a general-purpose register 30, and a RAM 40.
, Data selectors 50 and 51, and an ALU 60.

【0006】プログラムカウンタ01は、逐次的に、実
行すべき演算処理コマンド(インストラクション)のア
ドレスをプログラムメモリ02に供給する。プログラム
メモリ02は、プログラムカウンタ01から供給される
アドレスに格納されている演算処理コマンドを、コマン
ドデコーダ03へ供給する。
[0006] The program counter 01 sequentially supplies the address of the operation processing command (instruction) to be executed to the program memory 02. The program memory 02 supplies the operation processing command stored at the address supplied from the program counter 01 to the command decoder 03.

【0007】コマンドデコーダ03は、入力された演算
処理コマンドをデコードし、演算処理コマンドに応じた
制御信号を演算装置内に供給する。
The command decoder 03 decodes the input operation processing command and supplies a control signal corresponding to the operation processing command to the operation device.

【0008】汎用レジスタ30は、ALU60による演
算処理の対象となるデータや演算結果のデータ等を格納
するレジスタである。
The general-purpose register 30 is a register for storing data to be processed by the ALU 60, data of a calculation result, and the like.

【0009】RAM40は、汎用レジスタ30にくらべ
て大容量のデータ記憶手段であり、所定数(例えば、1
024個)のデータからなるブロックを格納する事がで
きるメモリである。
The RAM 40 is a data storage unit having a larger capacity than the general-purpose register 30, and has a predetermined number (for example, 1).
024 data).

【0010】データセレクタ50は、ALU60の出力
または外部バス70からの入力を前記制御信号に基づい
て選択し、RAM40あるいは汎用レジスタ30に入力
する。
The data selector 50 selects an output of the ALU 60 or an input from the external bus 70 based on the control signal, and inputs the selected signal to the RAM 40 or the general-purpose register 30.

【0011】データセレクタ51は、前記制御信号にし
たがって、RAM40あるいは汎用レジスタ30から演
算処理の対象となるデータを選択し、ALU60へ出力
する。
The data selector 51 selects data to be subjected to arithmetic processing from the RAM 40 or the general-purpose register 30 according to the control signal, and outputs the selected data to the ALU 60.

【0012】ALU60は、データセレクタ51から入
力されたkビットの固定小数点形式で表現されたデータ
を、前記制御信号に従って、加減乗算、ビットシフト演
算などの演算処理を行い、kビットの固定小数点形式で
演算結果を出力する。
The ALU 60 performs arithmetic processing, such as addition, subtraction, multiplication, and bit shift operation, on the k-bit data represented in the fixed-point format input from the data selector 51 in accordance with the control signal. Outputs the calculation result.

【0013】本演算装置は、一般に、外部バス70か
ら、kビットの固定小数点形式のデータを1ブロック
分、RAM40に読み込み、当該1ブロックのデータに
ついて、プログラムメモリ02内のプログラムに従った
演算処理を行う。
The arithmetic unit generally reads one block of k-bit fixed-point format data from the external bus 70 into the RAM 40, and processes the data of the one block in accordance with the program in the program memory 02. I do.

【0014】しかしながら、このような演算装置で行う
演算処理のなかには、浮動小数点形式の入力データを処
理しなければならない場合がある。
However, some of the arithmetic processing performed by such an arithmetic device may require processing of input data in a floating-point format.

【0015】例えば、ISO/IEC 13818-7(以後、MPEG-2
AACと略記する)の復号化では、まず、MPEG-2 AACスト
リームに対し、ハフマン符号によるエントロピー復号を
行い、このデータを逆量子化テーブルにより逆量子化を
行うことによって、浮動小数点形式による周波数データ
を得る。
For example, ISO / IEC 13818-7 (hereinafter referred to as MPEG-2
In the decoding of AAC, the MPEG-2 AAC stream is first subjected to entropy decoding using Huffman coding, and this data is subjected to inverse quantization using an inverse quantization table, thereby obtaining frequency data in floating-point format. Get.

【0016】そして、この周波数データから、逆高速フ
ーリエ変換(Inverse Fast FourierTransform)により
PCM(Pulse Code Modulation)データを得る。この
処理を固定小数点型の演算装置で行うためには、浮動小
数点形式の周波数データを、固定小数点形式のデータに
変換する必要がある。
Then, PCM (Pulse Code Modulation) data is obtained from the frequency data by inverse fast Fourier transform. In order for this processing to be performed by a fixed-point arithmetic device, it is necessary to convert frequency data in a floating-point format into data in a fixed-point format.

【0017】図11は、浮動小数点形式によるデータ表
現を示す図である。同図に示すように、データは、正規
化された数値を格納する仮数部(mビット)と、指数を
格納する指数部(nビット)とから構成される。仮数部
には、正規化されたデータが格納されるため、小数点位
置は、符号ビットの右側に存在することになる。
FIG. 11 is a diagram showing a data representation in a floating-point format. As shown in the figure, the data includes a mantissa part (m bits) for storing a normalized numerical value and an exponent part (n bits) for storing an exponent. Since the mantissa part stores the normalized data, the decimal point position exists on the right side of the sign bit.

【0018】図12は、固定小数点形式によるデータ表
現を示す図である。この場合、データは、正規化されて
おらず、同図に示すように、小数点位置は、データがオ
ーバーフローしないような位置である、符号ビットから
jビット離れた位置に配置する。
FIG. 12 shows a data representation in a fixed-point format. In this case, the data is not normalized, and the decimal point is located j bits away from the sign bit, as shown in FIG.

【0019】以上のような構成を有する浮動小数点形式
から固定小数点形式への変換は、予め定められた固定小
数点形式の小数点位置と浮動小数点形式の各データの指
数部に格納されている値とに基づいて、浮動小数点形式
の各データの仮数部をシフトすることで行われる。
The conversion from the floating-point format having the above configuration to the fixed-point format is performed by converting a predetermined fixed-point format decimal point position and a value stored in the exponent part of each data in the floating-point format. This is performed by shifting the mantissa of each data in the floating-point format based on the data.

【0020】[0020]

【発明が解決しようとする課題】このとき、仮数部のデ
ータは、ビットシフトにより失われる可能性がある。た
とえば、入力された浮動小数点形式のデータの指数部が
非常に大きい場合や非常に小さい場合、仮数部のデータ
の大半が、左あるいは右へのビットシフトにより失われ
てしまう。
At this time, the data of the mantissa may be lost due to the bit shift. For example, when the exponent part of the input floating-point format data is very large or very small, most of the data of the mantissa part is lost due to the bit shift to the left or right.

【0021】このように浮動小数点形式から固定小数点
形式への変換は、有効桁数を減少させ、計算精度を劣化
させる場合がある。
As described above, the conversion from the floating-point format to the fixed-point format may reduce the number of significant digits and degrade the calculation accuracy.

【0022】本発明の目的は、有効桁数の減少を最小限
にしつつ、浮動小数点形式から固定小数点形式への変換
ができる演算装置を提供することにある。
An object of the present invention is to provide an arithmetic unit capable of converting a floating-point format to a fixed-point format while minimizing the reduction in the number of significant digits.

【0023】[0023]

【課題を解決するための手段】本発明に係る演算装置
は、固定小数点形式で表現されたデータの演算を行う演
算処理部と、複数のデータから構成されるブロックを格
納する記憶部と、当該記憶部に格納されるkビットのデ
ータを、仮数部mビット、指数部nビットの浮動小数点
形式のデータとして解釈し、前記ブロック内のデータの
指数部の最大値rを検出する指数部最大値検出部とを備
え、前記ブロック内の各データを、前記指数部の最大値
rと仮数部との組で表現される浮動小数点形式となるよ
うに変換し、当該変換後のデータの仮数部について、前
記演算処理部により演算処理を行い、前記ブロック内の
データについての所定の演算処理を終了し外部に出力を
行う前に、前記最大値rに基づいて、各データを固定小
数点形式に変換することを特徴とする。
An arithmetic unit according to the present invention includes an arithmetic processing unit that performs an operation on data represented in a fixed-point format, a storage unit that stores a block composed of a plurality of data, An exponent maximum value for interpreting k-bit data stored in the storage unit as floating-point data having an m-bit mantissa and an n-bit exponent, and detecting a maximum value r of an exponent of data in the block. And converting each data in the block into a floating-point format represented by a set of a maximum value r of the exponent part and a mantissa part. The arithmetic processing unit performs arithmetic processing, converts each data into a fixed-point format based on the maximum value r before terminating a predetermined arithmetic processing on the data in the block and outputting the data to the outside. And wherein the door.

【0024】この場合、前記指数部最大値検出部は、指
数部比較器と、当該指数部比較器が出力するデータを格
納する指数部最大値レジスタとを備え、前記指数部比較
器は、浮動小数点形式のデータとして解釈したデータの
指数部の値と前記指数部最大値レジスタの値とを比較
し、大きい方を出力するようにしてもよい。
In this case, the exponent part maximum value detection unit includes an exponent part comparator and an exponent part maximum value register for storing data output by the exponent part comparator. The value of the exponent part of the data interpreted as the data in the decimal point format may be compared with the value of the exponent part maximum value register, and the larger one may be output.

【0025】また、前記演算処理部の出力を固定小数点
形式のデータとして解釈し、前記ブロック内で最大の絶
対値を検出する最大絶対値検出部を更に備え、前記ブロ
ック内のデータに対する加減算の実行に先立ち、前記最
大絶対値を用いてオーバーフローの可能性があるか否か
を判定し、当該判定の結果、オーバーフローの可能性が
ある場合は、前記ブロック内の各データを右にシフトす
るようにしてもよい。
The apparatus further comprises a maximum absolute value detecting section for interpreting an output of the arithmetic processing section as data in a fixed point format and detecting a maximum absolute value in the block, and executing addition / subtraction to the data in the block. Prior to, using the maximum absolute value to determine whether there is a possibility of overflow, as a result of the determination, if there is a possibility of overflow, shift each data in the block to the right You may.

【0026】更に、この場合、前記最大絶対値検出部
は、絶対値比較器と、当該絶対値比較器が出力するデー
タを格納する最大絶対値レジスタとを備え、前記絶対値
比較器は、固定小数点形式のデータとして解釈したデー
タの絶対値と前記最大絶対値レジスタの値とを比較し、
大きい方を出力するようにしてもよい。
Further, in this case, the maximum absolute value detector includes an absolute value comparator and a maximum absolute value register for storing data output by the absolute value comparator, and the absolute value comparator has a fixed value. Compare the absolute value of the data interpreted as decimal point format data and the value of the maximum absolute value register,
The larger one may be output.

【0027】また、前記最大絶対値検出部は、論理和回
路と、当該論理和回路が出力する1ビットのデータを格
納する最上位ビットレジスタとを備え、前記論理和回路
は、固定小数点形式のデータとして解釈したデータの絶
対値の最上位ビットと、前記最上位ビットレジスタの値
の論理和を出力するようにしてもよい。
The maximum absolute value detector includes an OR circuit and a most significant bit register for storing 1-bit data output from the OR circuit. The OR circuit has a fixed-point format. The logical sum of the most significant bit of the absolute value of the data interpreted as data and the value of the most significant bit register may be output.

【0028】また、前記最大絶対値レジスタ及び前記指
数部最大値レジスタとして、同一のレジスタを時分割に
より利用するようにしてもよいし、前記最大絶対値レジ
スタ及び前記指数部最大値レジスタとして、演算装置が
備える汎用レジスタの一部を、利用するようにしてもよ
い。
The same register may be used as the maximum absolute value register and the exponent part maximum value register in a time-sharing manner, or the same register may be used as the maximum absolute value register and the exponent part maximum value register. A part of the general-purpose register provided in the device may be used.

【0029】本発明に係るオーディオデコーダは、前述
した演算装置を備え、圧縮符号化されたオーディオデー
タから、仮数部mビット、指数部nビットの浮動小数点
形式の周波数係数データを得る復号処理と、前記周波数
係数データからkビットの固定小数点形式のオーディオ
データ出力を得る処理を行うことを特徴とする。
An audio decoder according to the present invention includes the above-described arithmetic unit, and performs a decoding process of obtaining floating-point frequency coefficient data of a mantissa part m bits and an exponent part n bits from compression-encoded audio data; A process of obtaining k-bit fixed-point format audio data output from the frequency coefficient data is performed.

【0030】本発明に係る演算方法は、複数の浮動小数
点形式のデータから構成されるブロック内のデータにつ
いて、指数部の最大値rを検出し、前記ブロック内の各
データを、前記指数部の最大値rと仮数部との組で表現
される浮動小数点形式となるように変換し、当該変換後
のデータの仮数部について、固定小数点形式の演算処理
を行い、前記ブロック内のデータについての所定の演算
処理を終了し外部に出力を行う前に、前記最大値rに基
づいて、各データを固定小数点形式に変換することを特
徴とする。
According to the operation method of the present invention, the maximum value r of the exponent part is detected for data in a block composed of a plurality of data in floating-point format, and each data in the block is converted to the exponent part. The data is converted to a floating-point format represented by a set of a maximum value r and a mantissa, and the mantissa of the converted data is subjected to arithmetic processing in a fixed-point format. Before completion of the arithmetic processing and output to the outside, each data is converted into a fixed-point format based on the maximum value r.

【0031】この場合において、前記指数部の最大値r
と仮数部との組で表現される浮動小数点形式となるよう
に変換したデータの仮数部の最大絶対値を検出し、前記
ブロック内のデータに対する加減算の実行に先立ち、前
記最大絶対値を用いてオーバーフローの可能性があるか
否かを判定し、当該判定の結果、オーバーフローの可能
性がある場合は、前記ブロック内の各データを右にシフ
トするようにしてもよい。
In this case, the maximum value r of the exponent part
Detect the maximum absolute value of the mantissa part of the data converted to be a floating-point format represented by a set of a mantissa and a mantissa, and execute the addition / subtraction for the data in the block, using the maximum absolute value. It may be determined whether or not there is a possibility of overflow, and as a result of the determination, if there is a possibility of overflow, each data in the block may be shifted to the right.

【0032】更に、この場合、前記最大絶対値が予め定
めた値より大きいとき、オーバーフローの可能性がある
と判断するようにしてもよいし、前記最大絶対値の最上
位ビットが1のとき、オーバーフローの可能性があると
判断するようにしてもよい。
Further, in this case, when the maximum absolute value is larger than a predetermined value, it may be determined that there is a possibility of overflow, and when the most significant bit of the maximum absolute value is 1, It may be determined that there is a possibility of overflow.

【0033】[0033]

【発明の実施の形態】以下、本発明の実施の形態につい
て、図面を参照しつつ、詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0034】まず、本発明の第一の実施形態について説
明する。
First, a first embodiment of the present invention will be described.

【0035】図1は、本発明による第1の演算装置を示
す図である。
FIG. 1 is a diagram showing a first arithmetic unit according to the present invention.

【0036】同図に示すように、本演算装置は、プログ
ラムカウンタ01と、プログラムメモリ02と、コマン
ドデコーダ03と、絶対値比較器10と、最大絶対値レ
ジスタ11と、指数部比較器20と、指数部最大値レジ
スタ21と、汎用レジスタ30と、RAM40と、デー
タセレクタ50,51と、ALU60とを備える。
As shown in the figure, the arithmetic unit includes a program counter 01, a program memory 02, a command decoder 03, an absolute value comparator 10, a maximum absolute value register 11, an exponent part comparator 20, , An exponent maximum value register 21, a general-purpose register 30, a RAM 40, data selectors 50 and 51, and an ALU 60.

【0037】構成要素のうち、プログラムカウンタ0
1、プログラムメモリ02、コマンドデコーダ03、汎
用レジスタ30、RAM40、データセレクタ50、デ
ータセレクタ51及びALU60に関しては、図10に
示した演算装置と同様であるので、説明を省略する。
Among the constituent elements, the program counter 0
1, the program memory 02, the command decoder 03, the general-purpose register 30, the RAM 40, the data selector 50, the data selector 51, and the ALU 60 are the same as those in the arithmetic device shown in FIG.

【0038】絶対値比較器10は、データセレクタ50
からのkビットの出力を固定小数点形式のデータとして
解釈し、その絶対値と最大絶対値レジスタ11の値を比
較し、大きいほうを最大絶対値レジスタ11に出力す
る。最大絶対値レジスタ11は、絶対値比較器10から
出力されるkビットのデータを保持するレジスタであ
る。
The absolute value comparator 10 includes a data selector 50
Is interpreted as fixed-point format data, the absolute value thereof is compared with the value of the maximum absolute value register 11, and the larger one is output to the maximum absolute value register 11. The maximum absolute value register 11 is a register that holds k-bit data output from the absolute value comparator 10.

【0039】指数部比較器20は、データセレクタ50
からのkビットの出力を仮数部mビット、指数部nビッ
トの浮動小数点形式のデータとして解釈し、その指数部
nビットと指数部最大値レジスタ21の値を比較し、大
きい方を指数部最大値レジスタ21に出力する。指数部
最大値レジスタ21は、指数部比較器20が出力するn
ビットのデータを保持するレジスタである。
The exponent part comparator 20 includes a data selector 50
Is interpreted as floating-point data having m bits of mantissa and n bits of exponent, and the n bits of the exponent and the value of the exponent maximum value register 21 are compared. Output to the value register 21. The exponent part maximum value register 21 stores n
This register holds bit data.

【0040】図2は、絶対値比較器10の構成を示す図
である。
FIG. 2 is a diagram showing a configuration of the absolute value comparator 10. As shown in FIG.

【0041】同図に示すように、絶対値比較器10は、
データセレクタ100と減算器110と絶対値化器12
0とを備える。絶対値化器120は、データセレクタ5
0から与えられるデータの絶対値aを出力する。減算器
110は、絶対値化器120が出力する値aから最大絶
対値レジスタ11の値bを減算し、得られたa−bの符
号ビットをデータセレクタ100に出力する。データセ
レクタ100は、減算器110の出力が0のとき、すな
わち、a>bのときは、aを選択し、減算器110の出
力が1のとき、すなわち、a<bのときは、bを選択し
て出力する。したがって、aとbのうち、大きい方が絶
対値比較器10から出力される。
As shown in the figure, the absolute value comparator 10
Data selector 100, subtractor 110, and absolute value converter 12
0. The absolute value converter 120 is a data selector 5
The absolute value a of the data given from 0 is output. The subtracter 110 subtracts the value b of the maximum absolute value register 11 from the value a output from the absolute value converter 120, and outputs the obtained a-b sign bit to the data selector 100. When the output of the subtractor 110 is 0, that is, when a> b, the data selector 100 selects a. When the output of the subtractor 110 is 1, that is, when a <b, b is selected. Select and output. Therefore, the larger one of a and b is output from the absolute value comparator 10.

【0042】図3は、指数部比較器20の構成を示す図
である。
FIG. 3 is a diagram showing the configuration of the exponent part comparator 20.

【0043】同図に示すように、指数部比較器20は、
データセレクタ200と減算器210とを備える。減算
器210は、データセレクタ50から与えられるnビッ
トの指数部aから指数部最大値レジスタ21の値bを減
算し、得られたa−bの符号ビットをデータセレクタ2
00に出力する。データセレクタ200は、減算器21
0の出力が0のとき、すなわち、a>bのときは、aを
選択し、減算器210の出力が1のとき、すなわち、a
<bのときは、bを選択して出力する。したがって、a
とbのうち、大きい方が指数部比較器20から出力され
る。
As shown in the figure, the exponent part comparator 20
It includes a data selector 200 and a subtractor 210. The subtractor 210 subtracts the value b of the exponent part maximum value register 21 from the n-bit exponent part a given from the data selector 50, and converts the obtained a-b sign bit into the data selector 2
Output to 00. The data selector 200 includes the subtractor 21
When the output of 0 is 0, that is, when a> b, a is selected, and when the output of the subtractor 210 is 1, that is, a
When <b, b is selected and output. Therefore, a
The larger one of b and b is output from the exponent comparator 20.

【0044】図4は、本実施形態におけるデータ処理の
流れを示す図である。ここでのデータ処理は、RAM4
0に読み込まれた1ブロックのデータに対して、データ
同士の演算を含む所定の演算処理を行うブロック演算処
理である。
FIG. 4 is a diagram showing the flow of data processing in this embodiment. The data processing here is performed in the RAM 4
This is a block operation process for performing a predetermined operation process including an operation between data on one block of data read into 0.

【0045】まず、メインメモリ等から外部バス70及
びデータセレクタ50を介して仮数部mビット、指数部
nビットで表現された浮動小数点形式のデータのブロッ
クをRAM40に読み込む(ステップS101)。その
際、同時に、各データは、指数部比較器20にも供給さ
れる。指数部比較器20は、各データのnビットの指数
部と、指数部最大値レジスタに格納されているnビット
の値とを比較し、大きい方のデータを指数部最大値レジ
スタ21に出力する。指数部比較器20から出力された
nビットのデータは、対応するデータがRAM40に書
き込まれるのと同じタイミングで、指数部最大値レジス
タ21に書き込まれる。
First, a block of floating-point data represented by m bits of mantissa and n bits of exponent is read into the RAM 40 from the main memory or the like via the external bus 70 and the data selector 50 (step S101). At this time, each data is also supplied to the exponent comparator 20 at the same time. The exponent part comparator 20 compares the n-bit exponent part of each data with the n-bit value stored in the exponent part maximum value register, and outputs the larger data to the exponent part maximum value register 21. . The n-bit data output from the exponent part comparator 20 is written to the exponent part maximum value register 21 at the same timing as the corresponding data is written to the RAM 40.

【0046】ブロックデータの読み込みを開始する前
に、指数部最大値レジスタ21を(例えば、0に)初期
化しておけば、ブロック内の全データのRAM40への
読み込みが終了したとき、指数部最大値レジスタ21に
は入力されたブロック内の指数部の最大値rが格納され
ていることになる。従って、ブロックデータの読み込み
終了後に、指数部最大値レジスタ21を参照して、ブロ
ック内で最大の指数部rを検出する(S102)。
If the exponent part maximum value register 21 is initialized (for example, to 0) before the reading of the block data is started, when the reading of all the data in the block into the RAM 40 is completed, the exponent part maximum value register 21 is initialized. The value register 21 stores the maximum value r of the exponent part in the input block. Therefore, after the reading of the block data is completed, the largest exponent r in the block is detected with reference to the exponent maximum value register 21 (S102).

【0047】本演算装置は、指数部比較器20を備えて
いるので、データの入力と指数部最大値rの検出を同時
に実行でき、ソフトウェアによって同比較処理を行う場
合に比べて大幅にステップ数を削減することができる。
Since the present arithmetic unit is provided with the exponent part comparator 20, data input and detection of the exponent part maximum value r can be executed at the same time, and the number of steps is significantly larger than when the same comparison processing is performed by software. Can be reduced.

【0048】次に、固定小数点形式で演算を行うALU
60で演算処理を行うために、入力された仮数部mビッ
ト、指数部nビットの浮動小数点形式のデータを固定小
数点形式のデータに変換する処理を行う(ステップS1
03)。
Next, the ALU which performs the operation in the fixed-point format
In order to perform the arithmetic processing at 60, a process of converting the input floating-point format data of the mantissa part m bits and the exponent part n bits to fixed-point format data is performed (step S1).
03).

【0049】そのために、まず、仮数部に対してビット
シフト処理を行うときのビットシフト量を算出する。従
来は、仮数部に対してビットシフト処理を行うときのシ
フト量は、固定小数点形式の小数点位置と指数部の値の
差により決定していたが、本実施形態では、ステップS
102で得られたブロック内の指数部の最大値rから各
データの指数部の値を減算し、その差を仮数部のシフト
量とする。
For this purpose, first, the bit shift amount when performing the bit shift processing on the mantissa is calculated. Conventionally, the shift amount when performing the bit shift process on the mantissa part is determined by the difference between the decimal point position in the fixed-point format and the value of the exponent part.
The value of the exponent part of each data is subtracted from the maximum value r of the exponent part in the block obtained in 102, and the difference is used as the shift amount of the mantissa part.

【0050】次に、以上のようにして算出されたビット
シフト量に従って、ブロック内の各データのシフト処理
を行う。このシフト処理は、ALU60によって行われ
る。この処理により、ブロック内の全データは、共通の
指数部rとそれに対応した仮数部で表されることにな
る。そして、以後、この仮数部のデータを、固定小数点
形式と解釈し、ALU60で演算処理を行う。
Next, each data in the block is shifted according to the bit shift amount calculated as described above. This shift processing is performed by the ALU 60. By this processing, all data in the block is represented by a common exponent r and a corresponding mantissa. Thereafter, the data of the mantissa is interpreted as a fixed-point format, and the ALU 60 performs an arithmetic process.

【0051】なお、ALU60によるシフト処理の際、
シフトされた各データは、RAM40に格納されるとと
もに、絶対値比較器10に供給される。絶対値比較器1
0は、各データの絶対値と、最大絶対値レジスタ11に
格納されている値とを比較し、大きい方のデータを最大
絶対値レジスタ11に出力する。絶対値比較器10から
出力されたデータは、対応するデータがRAM40に書
き込まれるのと同じタイミングで、最大絶対値レジスタ
11に書き込まれる。
In the shift processing by the ALU 60,
Each shifted data is stored in the RAM 40 and supplied to the absolute value comparator 10. Absolute value comparator 1
0 compares the absolute value of each data with the value stored in the maximum absolute value register 11 and outputs the larger data to the maximum absolute value register 11. The data output from the absolute value comparator 10 is written to the maximum absolute value register 11 at the same timing as the corresponding data is written to the RAM 40.

【0052】ブロックデータのシフト処理を開始する前
に、最大絶対値レジスタ11を(例えば、0に)初期化
しておけば、ブロック内の全データのシフト処理が終了
したとき、最大絶対値レジスタ11にはブロック内のデ
ータの最大絶対値が格納されていることになる。従っ
て、ブロックデータのシフト処理終了後に、最大絶対値
レジスタ11を参照することにより、ブロック内の最大
絶対値が検出できる。当該最大絶対値は、後述するオー
バーフローを防ぐための処理に使われる。
If the maximum absolute value register 11 is initialized (for example, to 0) before the shift processing of the block data is started, when the shift processing of all data in the block is completed, the maximum absolute value register 11 is reset. Stores the maximum absolute value of the data in the block. Therefore, the maximum absolute value in the block can be detected by referring to the maximum absolute value register 11 after the shift processing of the block data is completed. The maximum absolute value is used in a process for preventing an overflow described later.

【0053】本演算装置は、絶対値比較器10を備えて
いるので、ビットシフト処理等の演算処理と同時に絶対
値の最大値を検出することができ、ソフトウェアによっ
て同処理を行う場合に比べて、大幅にステップ数を削減
することができる。
Since the present arithmetic unit is provided with the absolute value comparator 10, it is possible to detect the maximum value of the absolute value at the same time as the arithmetic processing such as the bit shift processing. , Can greatly reduce the number of steps.

【0054】次に、プログラムメモリに記憶されたプロ
グラムによりブロック内のデータについて、各種演算処
理を行う(ステップS104)。
Next, various arithmetic processings are performed on the data in the block by the program stored in the program memory (step S104).

【0055】なお、当該演算処理の最中も、ALU60
による演算結果データは、RAM40に格納されるとと
もに、絶対値比較器10に供給される。そのため、ブロ
ック内の全データが一連の演算処理により更新された場
合、最大絶対値レジスタ11には、ブロック内の最大の
絶対値が格納されていることになる。
During the operation, the ALU 60
Is stored in the RAM 40 and supplied to the absolute value comparator 10. Therefore, when all data in a block is updated by a series of arithmetic processing, the maximum absolute value register 11 stores the maximum absolute value in the block.

【0056】演算処理がすべて終了すると、外部バス7
0に出力を行う前に、ブロック内の全データについて、
共通の指数部rにしたがって、ビットシフトを行い、デ
ータの小数点位置が最終的な固定小数点形式の小数点位
置と等しくなるようにする(ステップS105)。この
処理により、ブロック内の全データは、最終的なkビッ
トの固定小数点形式へ変換される。
When all the arithmetic processing is completed, the external bus 7
Before outputting to 0, for all data in the block,
Bit shift is performed according to the common exponent part r so that the decimal point position of the data becomes equal to the final fixed point format decimal point position (step S105). By this process, all data in the block is converted into the final k-bit fixed-point format.

【0057】本実施形態では、ブロック内の各データの
仮数部を、指数部の最大値rにあわせてシフトさせるこ
とで、シフト量を抑えているので、データによっては、
演算処理途中で、オーバーフローが発生する可能性があ
る。このため、上記ステップS104の演算処理途中で
加減算を行うとき、オーバーフローを防ぐための処理を
行う。
In the present embodiment, the mantissa part of each data in the block is shifted in accordance with the maximum value r of the exponent part to suppress the shift amount.
Overflow may occur during the arithmetic processing. For this reason, when addition and subtraction are performed during the arithmetic processing in step S104, processing for preventing overflow is performed.

【0058】図5は、本実施形態における加減算処理の
流れを示す図である。
FIG. 5 is a diagram showing the flow of the addition / subtraction processing in this embodiment.

【0059】まず、ブロック内の全データに対して加減
算処理を行う前に、最大絶対値レジスタ11の値を参照
し、ブロック内のデータの最大絶対値が予め定めた値以
上であるか否かを判定する(ステップS201)。その
結果、最大絶対値レジスタ11の値が予め定めた所定値
以上の場合は、加減算の結果、オーバーフローが発生す
る可能性があると判断して、加減算処理を行う前に全デ
ータを1ビット右シフトする(ステップS202)。ま
た、全データを1ビット右シフトしたことにより、仮数
部データの小数点位置が左に1ビットシフトするため、
ブロック内で共通の指数部rの値を1増やす(ステップ
S203)。そして、シフト後の仮数部をkビットの固
定小数点形式のデータとして解釈して、ブロック内のデ
ータに対し、演算を行う(ステップS204)。
First, before performing addition / subtraction processing on all the data in the block, the value of the maximum absolute value register 11 is referred to determine whether or not the maximum absolute value of the data in the block is equal to or greater than a predetermined value. Is determined (step S201). As a result, when the value of the maximum absolute value register 11 is equal to or larger than a predetermined value, it is determined that overflow may occur as a result of addition and subtraction, and all data is shifted right by one bit before performing addition and subtraction processing. The shift is performed (step S202). Also, by shifting all data one bit to the right, the decimal point position of the mantissa data is shifted one bit to the left.
The value of the common exponent r in the block is increased by 1 (step S203). Then, the mantissa after the shift is interpreted as k-bit fixed-point format data, and an operation is performed on the data in the block (step S204).

【0060】このようにブロック単位の演算を行う前
に、当該ブロック内のデータの最大絶対値の値に応じ
て、ビットシフト処理をすることで、オーバーフローの
発生を未然に防ぐことができる。
As described above, by performing the bit shift processing according to the value of the maximum absolute value of the data in the block before performing the operation in block units, it is possible to prevent the occurrence of overflow.

【0061】以上説明したように、本実施形態によれ
ば、各種演算処理を行う前に、一度にビットシフトを行
って有効桁数を少なくしていた従来の方法に比べ、演算
前に行うビットシフト量を最小限に止めることにより、
ブロック内の各データの仮数部をできるだけ失わないよ
うにしている。その結果、各種演算処理を行うデータの
有効桁数が大きくなり、計算精度が向上する。
As described above, according to the present embodiment, before performing various arithmetic processing, the bit shift performed at a time before the operation is performed as compared with the conventional method in which the number of significant digits is reduced by performing a bit shift at a time. By minimizing the shift amount,
The mantissa of each data in the block is minimized. As a result, the number of significant digits of data on which various arithmetic processing is performed is increased, and the calculation accuracy is improved.

【0062】また、演算回路部(ALU)を固定小数点
方式で構成できるので、全データを浮動小数点形式で取
り扱う演算装置に比べ、簡単に構成できる。
Further, since the arithmetic circuit unit (ALU) can be configured in a fixed-point system, it can be configured more easily than an arithmetic unit that handles all data in a floating-point format.

【0063】また、ブロック内の最大絶対値の検出と指
数部最大値の検出を簡単なハードウェアによって実現す
ることにより、検出処理を演算処理等と並行して実行で
き、ソフトウェアにより検出処理を実現する場合に比
べ、処理時間を大幅に短縮することができる。
Also, the detection of the maximum absolute value in the block and the detection of the maximum value of the exponent part are realized by simple hardware, so that the detection processing can be executed in parallel with the arithmetic processing and the like, and the detection processing is realized by software. The processing time can be greatly reduced as compared with the case where the processing is performed.

【0064】続いて、本発明の第二の実施形態について
説明する。
Next, a second embodiment of the present invention will be described.

【0065】図6は、本発明による第2の演算装置の構
成を示す図である。
FIG. 6 is a diagram showing a configuration of the second arithmetic unit according to the present invention.

【0066】同図に示すように、本演算装置が図1に示
した演算装置と異なるのは、絶対値比較器10aと最大
絶対値レジスタ11aであり、その他は同じである。そ
こで、同一部分については、同一符号を付して説明を省
略する。
As shown in the figure, the present arithmetic unit differs from the arithmetic unit shown in FIG. 1 in an absolute value comparator 10a and a maximum absolute value register 11a, and the others are the same. Therefore, the same portions are denoted by the same reference numerals and description thereof will be omitted.

【0067】最大絶対値レジスタ11aは、1ビットの
ビット幅を持つレジスタである。絶対値比較器10a
は、最大絶対値レジスタ11aの出力とALU60の出
力の絶対値の最上位ビット(以下、MSBという)との
論理和を最大絶対値レジスタ11aに出力する。
The maximum absolute value register 11a is a register having a bit width of 1 bit. Absolute value comparator 10a
Outputs the logical sum of the output of the maximum absolute value register 11a and the MSB of the absolute value of the output of the ALU 60 to the maximum absolute value register 11a.

【0068】第1の実施形態においては、加減算による
オーバーフローを防ぐためにブロック内のデータの最大
絶対値が所定値以上である場合は、オーバーフローの危
険性があるとして、ブロック内の全データを1ビット右
シフトした。
In the first embodiment, if the maximum absolute value of data in a block is equal to or more than a predetermined value in order to prevent overflow due to addition and subtraction, it is determined that there is a risk of overflow and all data in the block is replaced by one bit. Right shift.

【0069】これに対して、本実施形態においては、ブ
ロック内に絶対値のMSBが1であるデータが1つでも
含まれる場合は、オーバーフローの危険性があるとし
て、加減算処理を行う前に、ブロック内の各データの右
シフトを行うようにする。
On the other hand, in the present embodiment, if at least one data whose absolute value MSB is 1 is included in the block, it is determined that there is a risk of overflow, and before the addition / subtraction processing is performed, Each data in the block is shifted right.

【0070】この場合、第一の実施形態では、kビット
必要だった最大絶対値レジスタ11のビット幅が、MS
Bを格納するための1ビットで済む。また、絶対値比較
器10を、値の比較器ではなく、論理和で構成すること
ができる。従って、図1に示した演算装置に比べ、回路
が簡略化され、回路の規模を小さくすることができる。
In this case, in the first embodiment, the bit width of the maximum absolute value register 11 required k bits is set to MS
Only one bit for storing B is required. Further, the absolute value comparator 10 can be constituted by a logical sum instead of a value comparator. Therefore, the circuit is simplified and the circuit scale can be reduced as compared with the arithmetic device shown in FIG.

【0071】続いて、本発明の第三の実施形態について
説明する。
Next, a third embodiment of the present invention will be described.

【0072】図7は、本発明による第3の演算装置の構
成を示す図である。本演算装置は、最大絶対値レジスタ
11と指数部最大値レジスタ21とが同時に使用されな
いことに着目し、最大絶対値レジスタ11を時分割で指
数部最大値レジスタ21としても利用することにより、
レジスタの共有化を図り、回路規模を削減するものであ
る。
FIG. 7 is a diagram showing a configuration of a third arithmetic unit according to the present invention. This arithmetic unit focuses on the fact that the maximum absolute value register 11 and the exponent part maximum value register 21 are not used at the same time, and uses the maximum absolute value register 11 as the exponent part maximum value register 21 in a time-sharing manner.
The purpose is to share the registers and reduce the circuit scale.

【0073】同図に示すように、本演算装置が図1に示
した演算装置と異なるのは、指数部最大値レジスタ21
をなくしたかわりにデータセレクタ52を設けた点であ
り、その他は同じである。そこで、同一部分について
は、同一符号を付して説明を省略する。以下に変更部分
の説明を行う。
As shown in the figure, the present arithmetic unit is different from the arithmetic unit shown in FIG.
In that a data selector 52 is provided in place of the above, and the other is the same. Therefore, the same portions are denoted by the same reference numerals and description thereof will be omitted. The changed parts will be described below.

【0074】データセレクタ52は、選択制御信号に応
じて、絶対値比較器10からの出力と指数部比較器20
からの出力のいずれかを選択し、最大絶対値レジスタ1
1に出力する。選択制御信号は、例えば、演算装置の動
作モードによって切り替えられる。
The data selector 52 outputs the output from the absolute value comparator 10 and the exponent part comparator 20 according to the selection control signal.
Select one of the outputs from
Output to 1. The selection control signal is switched according to, for example, the operation mode of the arithmetic device.

【0075】データセレクタ52は、浮動小数点形式の
データのブロックをRAM40に読み込む際は、指数部
比較器20の出力を最大絶対値レジスタ11に出力す
る。これにより、ブロックデータのRAM40への読み
込みが終了した時点で、最大絶対値レジスタ11には、
ブロック内のデータの指数部の最大値rが格納されてい
ることになる。
The data selector 52 outputs the output of the exponent part comparator 20 to the maximum absolute value register 11 when reading the data block in the floating point format into the RAM 40. Thus, when the reading of the block data into the RAM 40 is completed, the maximum absolute value register 11 stores
This means that the maximum value r of the exponent part of the data in the block is stored.

【0076】また、データセレクタ52は、ブロック内
の指数部の最大値rと各データの指数部の値との差だけ
仮数部を右にビットシフトする際は、絶対値比較器10
の出力を最大絶対値レジスタ11に出力する。これによ
り、ブロックデータのシフト処理が終了した時点で、最
大絶対値レジスタ11には、ブロック内のデータの最大
絶対値が格納されていることになる。
When the mantissa part is bit-shifted to the right by the difference between the maximum value r of the exponent part in the block and the value of the exponent part of each data, the data selector 52 sets the absolute value comparator 10
Is output to the maximum absolute value register 11. As a result, when the shift processing of the block data is completed, the maximum absolute value of the data in the block is stored in the maximum absolute value register 11.

【0077】本演算装置のその他の動作は、前述した演
算装置と同様である。
The other operations of the arithmetic unit are the same as those of the arithmetic unit described above.

【0078】続いて、本発明の第四の実施形態について
説明する。
Next, a fourth embodiment of the present invention will be described.

【0079】図8は、本発明による第4の演算装置の構
成を示す図である。本演算装置は、汎用レジスタ30内
の特定のレジスタを、最大絶対値レジスタ及び指数部最
大値レジスタとして利用するものである。
FIG. 8 is a diagram showing the configuration of the fourth arithmetic unit according to the present invention. This arithmetic unit uses a specific register in the general-purpose register 30 as a maximum absolute value register and an exponent part maximum value register.

【0080】同図に示すように、本演算装置が、図1に
示した演算装置と異なるのは、絶対値レジスタ11及び
指数部最大値レジスタ21をなくしたかわりに、データ
セレクタ53を設けた点であり、その他は同じである。
そこで、同一部分については同一符号を付して説明を省
略する。以下に変更部分の説明を行う。
As shown in the figure, the present arithmetic unit differs from the arithmetic unit shown in FIG. 1 in that a data selector 53 is provided instead of eliminating the absolute value register 11 and the exponent maximum value register 21. The other points are the same.
Therefore, the same portions are denoted by the same reference numerals and description thereof will be omitted. The changed parts will be described below.

【0081】データセレクタ53は、データセレクタ5
0の出力、絶対値比較器10の出力、指数部比較器20
の出力を、選択制御信号により選択し、汎用レジスタ3
0に出力する。
The data selector 53 includes a data selector 5
Output of 0, output of absolute value comparator 10, exponent part comparator 20
Is selected by the selection control signal, and the general-purpose register 3
Output to 0.

【0082】データセレクタ53は、ブロック内のデー
タの指数部の最大値rを求める際は、指数部比較器20
の出力を、指数部最大値レジスタに割り当てられた汎用
レジスタ30内の特定のレジスタに出力する。また、ブ
ロック内のデータの最大絶対値を求める際は、絶対値比
較器10の出力を、最大絶対値レジスタに割り当てられ
た汎用レジスタ30内の特定のレジスタに出力する。
When calculating the maximum value r of the exponent part of the data in the block, the data selector 53 uses the exponent part comparator 20
Is output to a specific register in the general-purpose register 30 assigned to the exponent maximum value register. When obtaining the maximum absolute value of the data in the block, the output of the absolute value comparator 10 is output to a specific register in the general-purpose register 30 assigned to the maximum absolute value register.

【0083】本演算装置のその他の動作は、前述した演
算装置と同様である。
Other operations of the present arithmetic unit are the same as those of the arithmetic unit described above.

【0084】本演算装置は、最大絶対値レジスタ及び指
数部最大値レジスタを汎用レジスタ30内に置くことに
よって、演算処理で加減算が行われないときなど最大絶
対値レジスタや指数部最大値レジスタが必要ない場合
は、汎用レジスタとして使用することで回路の削減を図
るものである。
In the present arithmetic unit, by placing the maximum absolute value register and the exponent part maximum value register in the general-purpose register 30, the maximum absolute value register and the exponent part maximum value register are required when addition / subtraction is not performed in the arithmetic processing. If not, the circuit is reduced by using it as a general-purpose register.

【0085】続いて、本発明を利用したオーディオデコ
ーダについて説明する。
Next, an audio decoder using the present invention will be described.

【0086】図9は、本発明による演算装置を利用した
オーディオデコーダの例を示す図である。同図におい
て、演算装置90の構成は、前述した演算装置と同様で
ある。
FIG. 9 is a diagram showing an example of an audio decoder using the arithmetic unit according to the present invention. In the figure, the configuration of the arithmetic unit 90 is the same as that of the arithmetic unit described above.

【0087】この場合、同図に示すように、プログラム
メモリ02は、エントロピ復号処理を行うプログラム0
4と、逆高速フーリエ変換を行うプログラム05を記憶
している。
In this case, as shown in the figure, the program memory 02 stores a program 0 for performing entropy decoding processing.
4 and a program 05 for performing inverse fast Fourier transform.

【0088】圧縮符号化された1フレーム分のオーディ
オデータ80は、エントロピ復号処理を行うプログラム
04により、それぞれ、仮数部mビット、指数部nビッ
トを持つ1フレーム分の周波数係数データ81に復号さ
れる。ここで、1フレーム分の周波数係数データ81を
1ブロックとして扱うことにより、上記の実施形態で述
べたように、ブロック内で共通の指数部rを求め、ブロ
ック内のすべてのデータの指数部がrとなるように、仮
数部を右シフトし、以後、仮数部をkビットの固定小数
点形式のデータとして扱う。
The compressed and encoded audio data 80 for one frame is decoded by the program 04 for performing entropy decoding processing into frequency coefficient data 81 for one frame having m-bit mantissa and n-bit exponent, respectively. You. Here, by treating the frequency coefficient data 81 for one frame as one block, as described in the above embodiment, a common exponent r is obtained in the block, and the exponents of all data in the block are The mantissa is shifted to the right so as to be r, and thereafter, the mantissa is handled as k-bit fixed-point data.

【0089】このデータを逆高速フーリエ変換を行うプ
ログラム05を用いて復号を行う。なお、途中で加減算
が実行されるときは、上記実施形態で述べたように最大
絶対値レジスタに従い、オーバーフローが起きないよう
にビットシフトを行いながら演算を行う。逆高速フーリ
エ変換終了後、ブロック内で共通の指数部rに基づきブ
ロック内の全データをシフトして、kビット固定小数点
形式のオーディオデータ82を出力する。
The data is decoded using the program 05 for performing the inverse fast Fourier transform. When the addition / subtraction is performed in the middle, the operation is performed according to the maximum absolute value register while performing the bit shift so as not to cause the overflow, as described in the above embodiment. After the completion of the inverse fast Fourier transform, all the data in the block is shifted based on the common exponent part r in the block, and the audio data 82 in the k-bit fixed point format is output.

【0090】本実施形態では、1オーディオフレームを
1ブロックとみなし、浮動小数点形式で与えられた各デ
ータを、1ブロック内の指数部の最大値に基づいて、ビ
ットシフトして演算を行うことにより、一度にビットシ
フトして固定小数点形式に変換して演算を行う場合に比
べて有効桁の欠落が抑えられるため、高精度な音声出力
を得ることができる。
In this embodiment, one audio frame is regarded as one block, and each data given in the floating-point format is bit-shifted and operated based on the maximum value of the exponent part in one block. Since loss of significant digits is suppressed as compared with the case where a bit shift is performed at a time and conversion is performed to a fixed-point format to perform an operation, a highly accurate audio output can be obtained.

【0091】[0091]

【発明の効果】以上詳細に説明したように、本発明によ
れば、浮動小数点形式の入力データに演算を施す装置に
おいて、浮動小数点形式から最終的な固定小数点形式へ
の変換を段階的に行うことにより、演算精度を向上させ
ることができる。更に、ブロック内の最大絶対値を管理
することにより、オーバーフローを未然に防止すること
が可能になる。
As described above in detail, according to the present invention, in a device for performing an operation on input data in a floating-point format, conversion from a floating-point format to a final fixed-point format is performed stepwise. Thereby, the calculation accuracy can be improved. Furthermore, by managing the maximum absolute value in the block, it is possible to prevent overflow.

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

【図1】 本発明による第1の演算装置の構成を示すブ
ロック図である。
FIG. 1 is a block diagram showing a configuration of a first arithmetic unit according to the present invention.

【図2】 絶対値比較器10の構成を示すブロック図で
ある。
FIG. 2 is a block diagram illustrating a configuration of an absolute value comparator 10.

【図3】 指数部比較器20の構成を示すブロック図で
ある。
FIG. 3 is a block diagram showing a configuration of an exponent part comparator 20.

【図4】 ブロック演算処理の流れを示すフローチャー
トである。
FIG. 4 is a flowchart illustrating a flow of a block calculation process.

【図5】 加減算処理の流れを示すフローチャートであ
る。
FIG. 5 is a flowchart illustrating a flow of an addition / subtraction process.

【図6】 本発明による第2の演算装置の構成を示すブ
ロック図である。
FIG. 6 is a block diagram showing a configuration of a second arithmetic unit according to the present invention.

【図7】 本発明による第3の演算装置の構成を示すブ
ロック図である。
FIG. 7 is a block diagram showing a configuration of a third arithmetic unit according to the present invention.

【図8】 本発明による第4の演算装置の構成を示すブ
ロック図である。
FIG. 8 is a block diagram showing a configuration of a fourth arithmetic unit according to the present invention.

【図9】 本発明を適用したオーディオデコーダの例を
示す図である。
FIG. 9 is a diagram illustrating an example of an audio decoder to which the present invention has been applied.

【図10】 従来の演算装置の構成を示すブロック図で
ある。
FIG. 10 is a block diagram illustrating a configuration of a conventional arithmetic device.

【図11】 浮動小数点形式によるデータ表現を示す図
である。
FIG. 11 is a diagram showing a data representation in a floating-point format.

【図12】 固定小数点形式によるデータ表現を示す図
である。
FIG. 12 is a diagram showing a data representation in a fixed-point format.

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

10 絶対値比較器 11 最大絶対値レジスタ 20 指数部比較器 21 指数部最大値レジスタ Reference Signs List 10 absolute value comparator 11 maximum absolute value register 20 exponent part comparator 21 exponent part maximum value register

───────────────────────────────────────────────────── フロントページの続き (72)発明者 中村 拓 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立製作所マルチメディアシステム 開発本部内 (72)発明者 白根 弘晃 神奈川県横浜市戸塚区吉田町292番地 株 式会社日立画像情報システム内 (72)発明者 山本 英治 東京都小平市上水本町五丁目20番1号 株 式会社日立超エル・エス・アイ・システム ズ内 Fターム(参考) 5B022 AA00 BA01 BA02 CA01 CA03 CA04 CA07 DA02 DA06 FA05 FA06  ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Taku Nakamura 292 Yoshida-cho, Totsuka-ku, Yokohama-shi, Kanagawa Prefecture Inside the Multimedia System Development Division, Hitachi, Ltd. (72) Inventor Hiroaki Shirane Yoshida-cho, Totsuka-ku, Yokohama-shi, Kanagawa 292 Hitachi Image Information System Co., Ltd. (72) Eiji Yamamoto Inventor 5-2-1, Kamizuhoncho, Kodaira-shi, Tokyo F-term (reference) 5B022 AA00 BA01 BA02 CA01 CA03 CA04 CA07 DA02 DA06 FA05 FA06

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 固定小数点形式で表現されたデータの演
算を行う演算処理部と、 複数のデータから構成されるブロックを格納する記憶部
と、 当該記憶部に格納されるkビットのデータを、仮数部m
ビット、指数部nビットの浮動小数点形式のデータとし
て解釈し、前記ブロック内のデータの指数部の最大値r
を検出する指数部最大値検出部とを備え、 前記ブロック内の各データを、前記指数部の最大値rと
仮数部との組で表現される浮動小数点形式となるように
変換し、 当該変換後のデータの仮数部について、前記演算処理部
により演算処理を行い、 前記ブロック内のデータについての所定の演算処理を終
了し外部に出力を行う前に、前記最大値rに基づいて、
各データを固定小数点形式に変換することを特徴とする
演算装置。
1. An arithmetic processing unit for performing an operation on data represented in a fixed-point format, a storage unit for storing a block composed of a plurality of data, and k-bit data stored in the storage unit. Mantissa m
Bit, exponent part interpreted as n-bit floating point data, and the maximum value r of the exponent part of the data in the block
And converting each data in the block to a floating-point format represented by a set of a maximum value r of the exponent part and a mantissa. For the mantissa part of the subsequent data, the arithmetic processing is performed by the arithmetic processing unit, and before the predetermined arithmetic processing for the data in the block is completed and output to the outside, based on the maximum value r,
An arithmetic unit for converting each data into a fixed-point format.
【請求項2】 前記指数部最大値検出部は、 指数部比較器と、 当該指数部比較器が出力するデータを格納する指数部最
大値レジスタとを備え、 前記指数部比較器は、浮動小数点形式のデータとして解
釈したデータの指数部の値と前記指数部最大値レジスタ
の値とを比較し、大きい方を出力することを特徴とする
請求項1に記載の演算装置。
2. The exponent part maximum value detection unit includes: an exponent part comparator; and an exponent part maximum value register that stores data output by the exponent part comparator. 2. The arithmetic unit according to claim 1, wherein the value of the exponent part of the data interpreted as the format data is compared with the value of the exponent part maximum value register, and the larger one is output.
【請求項3】 前記演算処理部の出力を固定小数点形式
のデータとして解釈し、前記ブロック内で最大の絶対値
を検出する最大絶対値検出部を更に備え、 前記ブロック内のデータに対する加減算の実行に先立
ち、前記最大絶対値を用いてオーバーフローの可能性が
あるか否かを判定し、 当該判定の結果、オーバーフローの可能性がある場合
は、前記ブロック内の各データを右にシフトすることを
特徴とする請求項1又は2に記載の演算装置。
3. A maximum absolute value detecting unit for interpreting an output of the arithmetic processing unit as data in a fixed-point format and detecting a maximum absolute value in the block, performing addition and subtraction on data in the block. Prior to the above, it is determined whether or not there is a possibility of overflow using the maximum absolute value, and as a result of the determination, if there is a possibility of overflow, each data in the block is shifted to the right. The arithmetic device according to claim 1 or 2, wherein
【請求項4】 前記最大絶対値検出部は、 絶対値比較器と、 当該絶対値比較器が出力するデータを格納する最大絶対
値レジスタとを備え、 前記絶対値比較器は、固定小数点形式のデータとして解
釈したデータの絶対値と前記最大絶対値レジスタの値と
を比較し、大きい方を出力することを特徴とする請求項
3に記載の演算装置。
4. The maximum absolute value detector includes: an absolute value comparator; and a maximum absolute value register that stores data output by the absolute value comparator, wherein the absolute value comparator has a fixed-point format. 4. The arithmetic unit according to claim 3, wherein an absolute value of the data interpreted as data is compared with a value of the maximum absolute value register, and a larger one is output.
【請求項5】 前記最大絶対値検出部は、 論理和回路と、 当該論理和回路が出力する1ビットのデータを格納する
最上位ビットレジスタとを備え、 前記論理和回路は、固定小数点形式のデータとして解釈
したデータの絶対値の最上位ビットと、前記最上位ビッ
トレジスタの値の論理和を出力することを特徴とする請
求項3に記載の演算装置。
5. The maximum absolute value detection unit includes: a logical sum circuit; and a most significant bit register that stores 1-bit data output from the logical sum circuit, wherein the logical sum circuit has a fixed-point format. 4. The arithmetic unit according to claim 3, wherein a logical sum of the most significant bit of the absolute value of the data interpreted as data and the value of the most significant bit register is output.
【請求項6】 前記最大絶対値レジスタ及び前記指数部
最大値レジスタとして、同一のレジスタを時分割により
利用することを特徴とする請求項4又は5に記載の演算
装置。
6. The arithmetic unit according to claim 4, wherein the same register is used as the maximum absolute value register and the exponent part maximum value register by time division.
【請求項7】 請求項1〜6のいずれか一項に記載の演
算装置を備え、 圧縮符号化されたオーディオデータから、仮数部mビッ
ト、指数部nビットの浮動小数点形式の周波数係数デー
タを得る復号処理と、 前記周波数係数データからkビットの固定小数点形式の
オーディオデータ出力を得る処理を行うことを特徴とす
るオーディオデコーダ。
7. An arithmetic unit according to any one of claims 1 to 6, wherein floating-point frequency coefficient data having a mantissa part of m bits and an exponent part of n bits is obtained from compression-encoded audio data. An audio decoder comprising: a decoding process for obtaining; and a process for obtaining k-bit fixed-point format audio data output from the frequency coefficient data.
【請求項8】 複数の浮動小数点形式のデータから構成
されるブロック内のデータについて、指数部の最大値r
を検出し、 前記ブロック内の各データを、前記指数部の最大値rと
仮数部との組で表現される浮動小数点形式となるように
変換し、 当該変換後のデータの仮数部について、固定小数点形式
の演算処理を行い、 前記ブロック内のデータについての所定の演算処理を終
了し外部に出力を行う前に、前記最大値rに基づいて、
各データを固定小数点形式に変換することを特徴とする
演算方法。
8. A maximum value r of an exponent part of data in a block composed of a plurality of data in a floating-point format
And converts each data in the block into a floating-point format represented by a set of the maximum value r of the exponent part and the mantissa, and fixes the mantissa of the converted data. Perform arithmetic processing in a decimal point format, and before performing predetermined arithmetic processing on data in the block and outputting the data to the outside, based on the maximum value r,
An arithmetic method characterized by converting each data into a fixed-point format.
【請求項9】 前記指数部の最大値rと仮数部との組で
表現される浮動小数点形式となるように変換したデータ
の仮数部の最大絶対値を検出し、 前記ブロック内のデータに対する加減算の実行に先立
ち、前記最大絶対値を用いてオーバーフローの可能性が
あるか否かを判定し、 当該判定の結果、オーバーフローの可能性がある場合
は、前記ブロック内の各データを右にシフトすることを
特徴とする請求項8に記載の演算方法。
9. Detecting a maximum absolute value of a mantissa of data converted into a floating-point format represented by a set of a maximum value r of the exponent and a mantissa, and adding / subtracting the data in the block Prior to the execution of the above, it is determined whether or not there is a possibility of overflow using the maximum absolute value. If the result of the determination is that there is a possibility of overflow, each data in the block is shifted to the right. The method according to claim 8, wherein:
【請求項10】 前記最大絶対値が予め定めた値より大
きいとき、オーバーフローの可能性があると判断するこ
とを特徴とする請求項9に記載の演算方法。
10. The method according to claim 9, wherein when the maximum absolute value is larger than a predetermined value, it is determined that there is a possibility of overflow.
【請求項11】 前記最大絶対値の最上位ビットが1の
とき、オーバーフローの可能性があると判断することを
特徴とする請求項9に記載の演算方法。
11. The method according to claim 9, wherein when the most significant bit of the maximum absolute value is 1, it is determined that there is a possibility of overflow.
JP11217199A 1999-07-30 1999-07-30 Arithmetic unit Withdrawn JP2001043067A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11217199A JP2001043067A (en) 1999-07-30 1999-07-30 Arithmetic unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11217199A JP2001043067A (en) 1999-07-30 1999-07-30 Arithmetic unit

Publications (1)

Publication Number Publication Date
JP2001043067A true JP2001043067A (en) 2001-02-16

Family

ID=16700424

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11217199A Withdrawn JP2001043067A (en) 1999-07-30 1999-07-30 Arithmetic unit

Country Status (1)

Country Link
JP (1) JP2001043067A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009099084A (en) * 2007-10-19 2009-05-07 Kyocera Corp Conversion device
US8434036B2 (en) 2009-01-20 2013-04-30 Sony Corporation Arithmetic program conversion apparatus, arithmetic program conversion method, and program
CN111580867A (en) * 2020-04-30 2020-08-25 中国科学院微电子研究所 Block floating point processing method and device for FFT (fast Fourier transform) operation
WO2024106556A1 (en) * 2022-11-14 2024-05-23 주식회사 사피온코리아 Method and device for floating-point data compression

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009099084A (en) * 2007-10-19 2009-05-07 Kyocera Corp Conversion device
US8434036B2 (en) 2009-01-20 2013-04-30 Sony Corporation Arithmetic program conversion apparatus, arithmetic program conversion method, and program
CN111580867A (en) * 2020-04-30 2020-08-25 中国科学院微电子研究所 Block floating point processing method and device for FFT (fast Fourier transform) operation
CN111580867B (en) * 2020-04-30 2023-07-18 中国科学院微电子研究所 Block floating point processing method and device for FFT operation
WO2024106556A1 (en) * 2022-11-14 2024-05-23 주식회사 사피온코리아 Method and device for floating-point data compression

Similar Documents

Publication Publication Date Title
US7949696B2 (en) Floating-point number arithmetic circuit for handling immediate values
US5880979A (en) System for providing the absolute difference of unsigned values
US6844834B2 (en) Processor, encoder, decoder, and electronic apparatus
US20150113027A1 (en) Method for determining a logarithmic functional unit
US6360204B1 (en) Method and apparatus for implementing rounding in decoding an audio signal
JP2001043067A (en) Arithmetic unit
KR100623956B1 (en) Instruction address generation and tracking in a pipelined processor
US5923575A (en) Method for eletronically representing a number, adder circuit and computer system
KR100509009B1 (en) A fifo write/lifo read trace buffer with software and hardware loop compression
JP2513139B2 (en) Signal processor
JP2002519957A (en) Method and apparatus for processing a sign function
JP2675010B2 (en) Information processing device
JP4243277B2 (en) Data processing device
JPH09128213A (en) Block floating processing system/method
KR100637055B1 (en) Processor
US5432726A (en) Arithmetic unit for quantization/inverse quantigation
US6331827B1 (en) Huffman decoder using two priority encoder to reduce circuit scale
EP1087290B1 (en) Absolute value comparator
JP3221252B2 (en) Huffman decoder
JP2002342308A (en) Arithmetic unit, program, and function value calculating method
JPH03131924A (en) Information processor
CN115658004A (en) Method and apparatus for performing floating point data operations
JPH0784753A (en) Fixed point type digital signal processor
JP3287461B2 (en) Variable length code decoding method and apparatus
JP2006252287A (en) Operation method, program and arithmetic unit

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20061003