JPH0799493B2 - Digital signal processor - Google Patents

Digital signal processor

Info

Publication number
JPH0799493B2
JPH0799493B2 JP29524185A JP29524185A JPH0799493B2 JP H0799493 B2 JPH0799493 B2 JP H0799493B2 JP 29524185 A JP29524185 A JP 29524185A JP 29524185 A JP29524185 A JP 29524185A JP H0799493 B2 JPH0799493 B2 JP H0799493B2
Authority
JP
Japan
Prior art keywords
register
shift number
bit
input
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.)
Expired - Lifetime
Application number
JP29524185A
Other languages
Japanese (ja)
Other versions
JPS62151920A (en
Inventor
なつめ 松崎
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 JP29524185A priority Critical patent/JPH0799493B2/en
Publication of JPS62151920A publication Critical patent/JPS62151920A/en
Publication of JPH0799493B2 publication Critical patent/JPH0799493B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、正規化の処理を行なう際に用いられるデータ
の有効ビットの最上位を検索する装置に関するものであ
り、処理を入力されたデータによらず、一定の時間に行
なうものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for searching the most significant bit of effective bits of data used when performing normalization processing. Instead, it is done at a fixed time.

従来の技術 計算機などでは、計算の途中で比較的下位のビットに有
効なデータが位置するに至ったとき、符号の延長のビッ
トを削って、有効ビットを上位に上げる正規化の処理を
行なうことが多い。特に、固定小数点体系から、広いレ
ンジの値を扱うことの出来る浮動小数点体系への変換
は、正規化の処理そのものである。この時、データの有
効ビットの最上位を検索するプライオリティエンコーダ
の働き(以後、これを最上位有効ビット検索と称する)
をする装置が必要である。従来の最上位有効ビット検索
の処理をするディジタル信号処理装置としては、最上位
ビットよりデータを順次しらべていくものが特開昭60−
537号公報に示されている。第4図に同公報で従来例と
して上げられているディジタル信号処理装置を示す。こ
の公報の発明も同公報に従来例として上げられているも
のも入力データを最上位ビットより1ビットずつ調べて
いくといった概念は同じなので、ここでは説明のしやす
い第4図の例で説明する。12は入力レジスタ10に格納さ
れているデータを1ビットずつ左にシフトアップするシ
フト回路であり、EXCLUSIVE ORゲート14は前記入力レジ
スタの値の最上位ビットとそのすぐ下位の値が一致して
いるかを調べるゲートである。レジスタ20は、前記ゲー
トの出力が“0"となる回数が格納される構成になってい
る。この様に構成されたディジタル信号処理装置の動作
を第5図に示す。まず、30で出力レジスタ20をクリアし
ておき、入力データをレジスタ10に代入する。入力デー
タは、シフト回路12で符号ビットを1ビットずつ削って
いく。EXCLUSIVE ORゲート14では、データの最上位ビッ
ト(符号)とは違った値を持つビットを摘出し(第5図
31)、インクリメント回路22によりこのビット数を1ビ
ットずつ数える(第5図32)。第4図,第5図における
出力値Aが仮数部、mが指数部となる。
Conventional technology In a computer, etc., when valid data is located in relatively low-order bits in the middle of calculation, the extension bit of the code is deleted and normalization processing is performed to raise the valid bit to the higher-order. There are many. In particular, the conversion from the fixed point system to the floating point system that can handle a wide range of values is the normalization process itself. At this time, the function of the priority encoder that searches the most significant bit of the data (hereinafter referred to as the most significant bit search)
A device to do this is required. As a conventional digital signal processing device for processing the most significant bit search, there is a digital signal processing device that sequentially examines data from the most significant bit.
No. 537 is disclosed. FIG. 4 shows a digital signal processing device disclosed in the publication as a conventional example. The invention disclosed in this publication and the one disclosed in the publication as a conventional example have the same concept of examining the input data bit by bit from the most significant bit, and therefore the example of FIG. 4 which is easy to explain will be described here. . Reference numeral 12 is a shift circuit that shifts up the data stored in the input register 10 to the left one bit at a time, and the EXCLUSIVE OR gate 14 determines whether the most significant bit of the value of the input register matches the value immediately below it. It is a gate to check. The register 20 is configured to store the number of times that the output of the gate becomes “0”. The operation of the digital signal processing device thus constructed is shown in FIG. First, the output register 20 is cleared at 30 and the input data is substituted into the register 10. In the input data, the shift circuit 12 deletes the code bit one bit at a time. The EXCLUSIVE OR gate 14 extracts bits having a value different from the most significant bit (sign) of the data (Fig. 5).
31), the increment circuit 22 counts the number of bits one by one (FIG. 32 in FIG. 5). The output value A in FIGS. 4 and 5 is the mantissa part, and m is the exponent part.

発明が解決しようとする問題点 しかしながら、前記のような構成では、入力データの値
によって処理時間が違ってくる。符号ビトのすぐ下が有
効ビットの場合は1サイクルの時間で処理が出来るが、
最下位にしか有効なビットがないnビットのデータの場
合は処理に(n−2)サイクルの時間がかかる。
Problems to be Solved by the Invention However, in the above configuration, the processing time varies depending on the value of the input data. If there is a valid bit immediately below the code bit, it can be processed in one cycle time,
In the case of n-bit data in which only the least significant bit is valid, processing takes (n-2) cycles.

本発明はかかる点に鑑み、最上位有効ビット検索の処理
をデータによらずlog2nサイクルで行なうディジタル信
号処理装置を提供することを目的とする。
In view of the above point, the present invention has an object to provide a digital signal processing device for performing the most significant bit search processing in log 2 n cycles regardless of data.

問題点を解決するための手段 最下位ビットのみが、“1"で、その他のビットが“0"で
ある定数を発生する“1"発生部と、前記“1"発生部に接
続するバレルシフタと、入力レジスタと、前記バレルシ
フタと前記入力レジスタの出力を入力とし、その計算結
果のボローを出力する減算部と、前記減算部のボローを
入力としバレルシフタのシフト数を制御するシフト数制
御部とを備えたディジタル信号処理装置である。
Means for Solving the Problem A "1" generating section that generates a constant in which only the least significant bit is "1" and the other bits are "0", and a barrel shifter connected to the "1" generating section. An input register, a subtracting unit that receives the output of the barrel shifter and the input register, and outputs a borrow of the calculation result, and a shift number control unit that controls the shift number of the barrel shifter by using the borrow of the subtracting unit as an input. It is a digital signal processing device provided.

作用 本発明は前記した構成により、nビットの入力データに
対し、まず、バレルシフタのシフト数をn/2に設定する
ことにより、減算器にてn/2ビット目だけに“1"がセッ
トされたデータと入力データを比較し、もし入力データ
のほうが大きければ次のシフト数を3n/4にし、小さけれ
ばシフト数をn/4にして、今度はそのビットにのみ“1"
がセットされたデータと入力データを比較する。バレル
シフタのシフト数は、減算器のボローを用いて木検索的
に変化させる。このシフト数に従ってシフトした値つま
りシフト数制御部により示されるビットのみが“1"であ
るデータと、入力データとを比較していくことにより、
最上位有効ビット検索の処理を実現する。
Operation According to the present invention, by setting the shift number of the barrel shifter to n / 2 for n-bit input data, "1" is set only at the n / 2-th bit by the subtractor. If the input data is larger, the next shift number is set to 3n / 4, and if the input data is smaller, the shift number is set to n / 4, and only "1" is set for that bit this time.
Compare the set data with the input data. The shift number of the barrel shifter is changed by a tree search using the borrow of the subtractor. By comparing the value shifted according to this shift number, that is, the data in which only the bit indicated by the shift number control unit is "1", with the input data,
Realize the processing of the most significant bit search.

実施例 第1図は本発明の一実施例に於けるディジタル信号処理
装置の構成図を示すものである。1は最下位のみが“1"
でその他のビットが“0"である定数を発生する“1"発生
部、2は左に指定ビット一度にシフトするバレルシフ
タ、3は入力データXを格納する入力レジスタ、4は入
力レジスタの値からバレルシフタの出力データを減算し
てボローを出力する減算器、5は前記ボローにより前記
バレルシフタのシフト数を木検索的に変化させるシフト
数制御部である。
Embodiment FIG. 1 shows a block diagram of a digital signal processing device in an embodiment of the present invention. Only 1 is the lowest "1"
, "1" generator that generates a constant whose other bits are "0", 2 is a barrel shifter that shifts the designated bit to the left at a time, 3 is an input register that stores the input data X, 4 is the value of the input register A subtracter 5 for subtracting the output data of the barrel shifter and outputting a borrow is a shift number control unit for changing the shift number of the barrel shifter by a tree search.

以上のように構成された本実施例のディジタル信号処理
装置について、以下その動作を簡単のために入力が、
“00010100"の時を例にあげて説明する。この時入力が
8ビットのデータ幅なので、シフト数制御部は第2図の
木構造に沿って変化する。シフト数制御部は前記減算器
4のボローが“1"のときは、木構造に沿って左に降り、
“0"のときは右に降りたところの値を出力する。第3図
に各サイクルでのデータの流れを示す。1サイクル目、
“1"発生部の値はシフト数制御部の出力する第2図にお
ける木構造のトップの値4ビット左にシフトされ、“00
010000"が減算器4に入力される。減算器4は入力レジ
スタのデータ“00010100"からこのデータを減算し、そ
の結果、ボロー“0"を出力する。2サイクル目、シフト
数制御部ではこのボローをうけ、第2図の木構造を右に
降り、“6"をその出力とする。“1"発生部からの定数は
6ビットシフトされ、“01000000"が減算器に入力され
る。減算の結果ボローは“1"で、シフト数制御部の出力
は“5"となる。3サイクル目、“1"発生部の出力定数は
5ビットシフトされる。その値“00100000"と入力デー
タは比較されボローが“0"、よって二進木の最終結果
“4"を得る。この“4"は入力データの最上位から調べて
一番初めに“1"のセットされているビットの位置(下位
から0,1,2…と数えたときのビット位)を示している。
尚、シフト数制御部のデータを符号なしの3ビットとす
ると、このシフト数制御部の出力データ“100"をインバ
ートして出力すると(“011")、入力の上位から“0"の
セットされているビット数“3"を求めることが出来る。
For the digital signal processing device of the present embodiment configured as described above, input is given below for the sake of simplicity of operation.
The case of "00010100" will be described as an example. At this time, since the input has a data width of 8 bits, the shift number control unit changes according to the tree structure of FIG. When the borrow of the subtracter 4 is "1", the shift number control unit descends to the left along the tree structure,
When it is "0", the value when descending to the right is output. FIG. 3 shows the data flow in each cycle. The first cycle,
The value of the "1" generation part is shifted to the left by 4 bits from the value of the top of the tree structure in FIG.
010000 "is input to the subtractor 4. The subtractor 4 subtracts this data from the data" 00010100 "in the input register, and outputs a borrow" 0 "as a result. After receiving borrow, descend to the right in the tree structure in Fig. 2 and output "6" .The constant from the "1" generation part is shifted by 6 bits and "01000000" is input to the subtractor. As a result, the borrow is “1”, the output of the shift number control unit is “5.” In the third cycle, the output constant of the “1” generation unit is shifted by 5 bits. Compared, the borrow is “0”, and thus the final result of the binary tree is “4”, which is the bit position (1) that is set to “1” at the very beginning of the input data. It shows the bit position when counted from the lower order as 0, 1, 2.
If the data of the shift number control unit is 3 bits with no sign, the output data "100" of this shift number control unit is inverted and output ("011"), then "0" is set from the upper input. It is possible to obtain the number of bits "3".

発明の効果 以上説明したように、本発明によれば処理時間がデータ
によらず一定であり、nビットの入力データなら、log2
nの処理時間で最上位有効ビット検索の処理を行なうこ
とが出来る。よって入力データ幅nが大きくなると平均
的にいっても処理速度が速くなり、その実用効果は大き
い。
EFFECTS OF THE INVENTION As described above, according to the present invention, the processing time is constant regardless of the data, and if the input data is n bits, log 2
The most significant bit search process can be performed in the processing time of n. Therefore, if the input data width n is large, the processing speed is high even on average, and the practical effect is large.

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

第1図は本発明に於ける一実施例のディジタル信号処理
装置の構成図、第2図は本実施例のシフト数制御部の動
作説明図、第3図は本実施例の動作説明図、第4図は従
来のディジタル信号処理装置の構成図、第5図は従来の
ディジタル信号処理装置の動作説明図である。 1……“1"発生部、2……バレルシフタ、3……入力レ
ジスタ、4……減算器、5……シフト数制御部。
FIG. 1 is a block diagram of a digital signal processing apparatus according to an embodiment of the present invention, FIG. 2 is an operation explanatory view of a shift number control section of the present embodiment, and FIG. 3 is an operation explanatory view of the present embodiment. FIG. 4 is a configuration diagram of a conventional digital signal processing device, and FIG. 5 is an operation explanatory diagram of the conventional digital signal processing device. 1 ... "1" generator, 2 ... Barrel shifter, 3 ... Input register, 4 ... Subtractor, 5 ... Shift number controller.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】nを正整数とするとき、最下位のビットの
みが‘1'で、その他のビットが‘0'であるnビットの定
数を格納する第1のレジスタと、前記第1のレジスタに
接続し、前記定数をシフトするバレルシフタと、nビッ
トの入力データを格納する第2のレジスタと、前記第2
のレジスタと前記バレルシフタの出力を入力とする減算
器と、前記減算器のボロー信号により前記バレルシフタ
のシフト数を制御するシフト数制御部を備え、前記シフ
ト数制御部は、前記バレルシフタの左シフト数として、
初期値にn/2を設定し、1回目の前記ボロー信号の結
果、前記第2のレジスタに格納している入力データのほ
うが大きいまたは等しい場合には、2回目のシフト数と
して初期値にn/4を加算した3n/4を設定し、そうでない
場合には2回目のシフト数として初期値からn/4を減算
したn/4を設定し、以降同様に、L回目の前記ボロー信
号の結果、前記第2のレジスタに格納している値のほう
が大きいまたは等しい場合には(L+1)回目のシフト
数として、L回目のシフト数に、nを2の(L+1)乗
で除した値を加算し、そうでない場合には(L+1)回
目のシフト数として、L回目のシフト数から、nを2の
(L+1)乗で除した値を減算した値を設定し、log2n
回の操作の後に前記シフト制御部に格納されているシフ
ト数を、前記第2のレジスタに格納されている入力デー
タの最上位ビットの位置として出力する、前記第2のレ
ジスタに格納された入力データの最上位の有効ビットを
木検索法で検索するディジタル信号処理装置。
1. When n is a positive integer, a first register for storing an n-bit constant in which only the least significant bit is "1" and the other bits are "0", and the first register A barrel shifter connected to the register for shifting the constant; a second register for storing n-bit input data;
Of the register and a subtracter that receives the output of the barrel shifter as input, and a shift number control unit that controls the shift number of the barrel shifter by the borrow signal of the subtractor, and the shift number control unit is the left shift number of the barrel shifter. As
When the initial value is set to n / 2, and as a result of the borrow signal for the first time, the input data stored in the second register is larger or equal, the initial value is set to n as the shift number for the second time. Set 3n / 4 by adding / 4, otherwise set n / 4 by subtracting n / 4 from the initial value as the shift number for the second time, and thereafter similarly, for the Lth borrow signal. As a result, when the value stored in the second register is larger or equal, the value obtained by dividing n by the (L + 1) th power of 2 as the (L + 1) th shift number is set as the (L + 1) th shift number. Otherwise, as the (L + 1) th shift number, a value obtained by subtracting the value obtained by dividing n by the (L + 1) th power of 2 is set as the (L + 1) th shift number, and log 2 n
The input stored in the second register, which outputs the number of shifts stored in the shift control unit after one operation as the position of the most significant bit of the input data stored in the second register. A digital signal processor that searches the most significant bit of data using a tree search method.
JP29524185A 1985-12-25 1985-12-25 Digital signal processor Expired - Lifetime JPH0799493B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP29524185A JPH0799493B2 (en) 1985-12-25 1985-12-25 Digital signal processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP29524185A JPH0799493B2 (en) 1985-12-25 1985-12-25 Digital signal processor

Publications (2)

Publication Number Publication Date
JPS62151920A JPS62151920A (en) 1987-07-06
JPH0799493B2 true JPH0799493B2 (en) 1995-10-25

Family

ID=17818040

Family Applications (1)

Application Number Title Priority Date Filing Date
JP29524185A Expired - Lifetime JPH0799493B2 (en) 1985-12-25 1985-12-25 Digital signal processor

Country Status (1)

Country Link
JP (1) JPH0799493B2 (en)

Also Published As

Publication number Publication date
JPS62151920A (en) 1987-07-06

Similar Documents

Publication Publication Date Title
EP0127988B1 (en) A normalizing circuit
US4926369A (en) Leading 0/1 anticipator (LZA)
JP3487903B2 (en) Arithmetic device and arithmetic method
US5477480A (en) Carry look ahead addition method and carry look ahead addition device
JPH0746310B2 (en) Semiconductor logic circuit
JP3304971B2 (en) Absolute value calculation circuit
US6298368B1 (en) Method and apparatus for efficient calculation of an approximate square of a fixed-precision number
US7296048B2 (en) Semiconductor circuit for arithmetic processing and arithmetic processing method
US5530664A (en) Method and apparatus for automatically designing logic circuit, and multiplier
JPH07234778A (en) Arithmetic circuit
JPH0690668B2 (en) Fuzzy computing device
JPH0799493B2 (en) Digital signal processor
US4041296A (en) High-speed digital multiply-by-device
JPH024944B2 (en)
EP0442220B1 (en) Decoder
KR0182169B1 (en) Log arithmathic value calculator
KR0147433B1 (en) Leading-one detector
JPH11102284A (en) Method and circuit for selection
JP3121609B2 (en) Digital signal processor
JP2907276B2 (en) Arithmetic processing unit
JP2599375B2 (en) Vector quantization method
SU881741A1 (en) Digital logarithmic converter
JP3539077B2 (en) Division method by parallel operation method
JP3125436B2 (en) Bit offset calculator
JP2002268873A (en) Divider and selection device used therefor

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term