JPH07225672A - Barrel shifter and control method - Google Patents
Barrel shifter and control methodInfo
- Publication number
- JPH07225672A JPH07225672A JP6018672A JP1867294A JPH07225672A JP H07225672 A JPH07225672 A JP H07225672A JP 6018672 A JP6018672 A JP 6018672A JP 1867294 A JP1867294 A JP 1867294A JP H07225672 A JPH07225672 A JP H07225672A
- Authority
- JP
- Japan
- Prior art keywords
- shift
- bit
- selecting means
- signal
- selection
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
(57)【要約】
【目的】 大規模なハードウェアの追加や演算時間の増
加を招く事なく、同一資源の有効利用を図ることができ
るバレルシフタ及びその制御方法を提供すること。
【構成】 入力データに対してシフト側データ又は非シ
フト側データを選択する5段の選択手段1〜4,105
と、5段の選択手段1〜4,105のうち、何れの選択
手段によってもシフト側データが選択されない場合は、
入力されたマスクパターン13のマスク信号17を出力
し、5段の選択手段1〜4,105のうち、少なくとも
1つの選択手段によりシフト側データが選択された場合
は、第5の選択手段105に対するシフト許可信号16
に応じて、シフト側データ又は非シフト側データを選択
するマスク信号17を出力する制御部15を備える。
(57) [Summary] [Purpose] To provide a barrel shifter and a control method thereof that can effectively use the same resource without adding large-scale hardware or increasing the calculation time. [Structure] Five-stage selecting means 1-4, 105 for selecting shift side data or non-shift side data with respect to input data
If the shift side data is not selected by any of the selection means 1 to 4, 105 of the five stages,
The mask signal 17 of the input mask pattern 13 is output, and when the shift-side data is selected by at least one of the five-stage selecting means 1 to 4, 105, the fifth selecting means 105 is selected. Shift permission signal 16
The control unit 15 outputs a mask signal 17 for selecting shift-side data or non-shift-side data.
Description
【0001】[0001]
【産業上の利用分野】本発明は、高速な信号処理等で必
要となるデータの桁合わせを柔軟に行うことができるバ
レルシフタ及びその制御方法に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a barrel shifter capable of flexibly performing digit alignment of data required for high-speed signal processing and the like, and a control method thereof.
【0002】[0002]
【従来の技術】近年の信号処理アルゴリズムの複雑化に
より、高速な信号処理システムが求められている。従来
このような信号処理で扱うデータの桁合わせを柔軟に行
なう為に図4に示すようなバレルシフタが考案され、こ
れを応用したディジタル信号処理プロセッサが数多く考
案されている。2. Description of the Related Art Due to the complexity of signal processing algorithms in recent years, high-speed signal processing systems are required. Conventionally, a barrel shifter as shown in FIG. 4 has been devised in order to flexibly perform digit alignment of data handled in such signal processing, and many digital signal processors applying this have been devised.
【0003】以下、図面を参照しながら、上記した従来
のバレルシフタの一例について説明する。An example of the above-mentioned conventional barrel shifter will be described below with reference to the drawings.
【0004】図4は、バレルシフタのブロック図であ
る。図4に示すように、バレルシフタは、入力データ1
1に対して左1ビットシフトを行なうための第1の選択
手段1、その第1の選択手段の出力データに対して左2
ビットシフトを行なうための第2の選択手段2、以下同
様に、左4ビットシフトを行なうための第3の選択手段
3、左8ビットシフトを行なうための第4の選択手段
4、右16ビットシフトを行なうための第5の選択手段
5により構成されている。FIG. 4 is a block diagram of the barrel shifter. As shown in FIG. 4, the barrel shifter has input data 1
1st selecting means 1 for shifting left 1 bit to 1 and left 2 to the output data of the first selecting means
The second selecting means 2 for performing the bit shift, hereafter, similarly, the third selecting means 3 for performing the left 4 bit shift, the fourth selecting means 4 for performing the left 8 bit shift, and the right 16 bits. It is composed of fifth selecting means 5 for performing the shift.
【0005】各選択手段には、第1の選択手段1の選択
制御を行なう第1の選択信号6、第2の選択手段2の選
択制御を行なう第2の選択信号7、第3の選択手段3の
選択制御を行なう第3の選択信号8、第4の選択手段4
の選択制御を行なう第4の選択信号9、第5の選択手段
5の選択制御を行なう第5の選択信号10が、それぞれ
入力される。入力データ11は、第1の選択手段1に入
力された後、各選択信号に応じてシフトされ、その結果
として出力データ12が第5の選択手段5から出力され
る。Each selection means has a first selection signal 6 for controlling the selection of the first selection means 1, a second selection signal 7 for controlling the selection of the second selection means 2, and a third selection means. Third selection signal 8 for performing selection control of No. 3 and fourth selection means 4
The fourth selection signal 9 for controlling the selection and the fifth selection signal 10 for controlling the selection of the fifth selecting means 5 are input. The input data 11 is input to the first selecting means 1 and then shifted according to each selection signal, and as a result, the output data 12 is output from the fifth selecting means 5.
【0006】図5は、図4に示すバレルシフタの第1選
択手段1から第5の選択手段5の内部構成を示すブロッ
ク図である。すなわち、各選択手段1〜5は、それぞれ
選択信号の反転信号を生成するインバータゲート100
及び信号を選択するマルチプレクサ101により構成さ
れ、ビットk(k:0〜15)の信号(非シフト側デー
タ)102及び、ビットk−i(i:1,2,4,8,
−16)の信号(シフト側データ)103の何れかを、
選択信号に応じて選択する。FIG. 5 is a block diagram showing the internal structure of the first to fifth selecting means 1 to 5 of the barrel shifter shown in FIG. That is, each of the selection means 1 to 5 has an inverter gate 100 that generates an inverted signal of the selection signal.
And a multiplexer 101 for selecting a signal, and a signal (non-shift side data) 102 of a bit k (k: 0 to 15) and a bit k-i (i: 1, 2, 4, 8,
-16) signal (shift side data) 103,
Select according to the selection signal.
【0007】次に、以上のように構成された従来のバレ
ルシフタの動作について説明する。 (ケース1)まず、図4で第5の選択信号10から第1
の選択信号6がx”1f”の右1ビットシフトの場合の
動作を説明する。Next, the operation of the conventional barrel shifter configured as described above will be described. (Case 1) First, the fifth selection signal 10 to the first in FIG.
The operation in the case where the selection signal 6 of (1) is right 1 bit shift of x "1f" will be described.
【0008】入力データ11が16ビットデータで第1
の選択信号6から第5の選択信号10の値が全て”1”
の時、第1の選択手段1から第5の選択手段5まで全て
シフト動作を選択する。Input data 11 is 16-bit data and is first
The values of the selection signal 6 to the fifth selection signal 10 are all "1"
At this time, all the shift operations from the first selecting means 1 to the fifth selecting means 5 are selected.
【0009】この時、第1の選択手段1は入力データ1
1の各ビットk(k:0〜15)に対してビットk−1
の値を選択し、結果として左1ビットシフトが実行され
る。At this time, the first selection means 1 uses the input data 1
Bit k-1 for each bit k of 1 (k: 0 to 15)
, The result is a 1-bit left shift.
【0010】次に、第2の選択手段2は入力データの各
ビットkに対してビットk−2の値を選択し、結果とし
て左2ビットシフトが実行される。Next, the second selecting means 2 selects the value of the bit k-2 for each bit k of the input data, and as a result, the left 2 bit shift is executed.
【0011】次に、第3の選択手段3は入力データの各
ビットkに対してビットk−4の値を選択し、結果とし
て左4ビットシフトが実行される。Next, the third selecting means 3 selects the value of bit k-4 for each bit k of the input data, and as a result, the left 4-bit shift is executed.
【0012】次に、第4の選択手段4は入力データの各
ビットkに対してビットk−8の値を選択し、結果とし
て左8ビットシフトが実行される。Next, the fourth selecting means 4 selects the value of the bit k-8 for each bit k of the input data, and as a result, the left 8-bit shift is executed.
【0013】次に、第5の選択手段5は入力データの各
ビットkに対してビットk+16の値を選択し、結果と
して右16ビットシフトが実行される。Next, the fifth selecting means 5 selects the value of bit k + 16 for each bit k of the input data, and as a result, the right 16-bit shift is executed.
【0014】以上のように、全ての選択手段1〜5がシ
フト動作を行なうことで最終的に右1ビットシフトが実
行される。 (ケース2)次に、右16ビットシフトの場合の動作を
説明する。As described above, all the selecting means 1 to 5 perform the shift operation so that the right one bit shift is finally executed. (Case 2) Next, the operation in the case of right 16-bit shift will be described.
【0015】入力データ11が16ビットデータで第5
の選択信号10から第1の選択信号6の値がx”10”
の時、第1の選択手段1から第4の選択手段4までは全
て非シフト動作を選択し、第5の選択手段5のみシフト
動作を選択する。The fifth input data 11 is 16-bit data
The value of the first selection signal 6 from the selection signal 10 of x is “10”
At this time, the non-shift operation is selected for all of the first selecting means 1 to the fourth selecting means 4, and only the fifth selecting means 5 selects the shift operation.
【0016】この時、第1の選択手段1は入力データ1
1の各ビットk(k:0〜15)に対してビットkの値
を選択し、結果としてシフト処理は実行されない。At this time, the first selection means 1 uses the input data 1
The value of the bit k is selected for each bit k of 1 (k: 0 to 15), and as a result, the shift processing is not executed.
【0017】次に、第2の選択手段2は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理は実行されない。Next, the second selecting means 2 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0018】次に、第3の選択手段3は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理は実行されない。Next, the third selecting means 3 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0019】次に、第4の選択手段4は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the fourth selecting means 4 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0020】次に、第5の選択手段5は入力データの各
ビットkに対してビットk+16の値を選択し、結果と
して右16ビットシフトが実行される。Next, the fifth selecting means 5 selects the value of bit k + 16 for each bit k of the input data, and as a result, the right 16-bit shift is executed.
【0021】以上のように、第1の選択手段1から第4
の選択手段4まではシフト処理を行なわず、第5の選択
手段5だけがシフト動作を行なうことで最終的に右16
ビットシフトが実行される。 (ケース3)次に、左1ビットシフトの場合の動作を説
明する。As described above, the first to fourth selecting means 1 to 4
No shift processing is performed up to the selecting means 4 of the above, and only the fifth selecting means 5 performs the shift operation, so that the right 16
Bit shift is executed. (Case 3) Next, the operation in the case of left 1-bit shift will be described.
【0022】入力データ11が16ビットデータで第5
の選択信号10から第1の選択信号6の値がx”01”
の時、第2の選択手段2から第5の選択手段5までは全
て非シフト動作を選択し、第1の選択手段1のみシフト
動作を選択する。The fifth input data 11 is 16-bit data.
The value of the first selection signal 6 from the selection signal 10 of x is “01”
At this time, the second selecting means 2 to the fifth selecting means 5 all select the non-shift operation, and only the first selecting means 1 selects the shift operation.
【0023】この時、第1の選択手段1は入力データ1
1の各ビットk(k:0〜15)に対してビットk−1
の値を選択し、結果として左1ビットシフトが実行され
る。At this time, the first selection means 1 uses the input data 1
Bit k-1 for each bit k of 1 (k: 0 to 15)
, The result is a 1-bit left shift.
【0024】次に、第2の選択手段2は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理は実行されない。Next, the second selecting means 2 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0025】次に、第3の選択手段3は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理は実行されない。Next, the third selecting means 3 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0026】次に、第4の選択手段4は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the fourth selecting means 4 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0027】次に、第5の選択手段5は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the fifth selecting means 5 selects the value of the bit k for each bit k of the input data, and as a result, the shift process is not executed.
【0028】以上のように、第1の選択手段1だけがシ
フト処理を行ない、第2の選択手段2から第5の選択手
段5まではシフト処理を行なわないことで最終的に左1
ビットシフトが実行される。(ケース4)最後にシフト
処理を実行しない場合の動作を説明する。As described above, only the first selecting means 1 performs the shift processing, and the second selecting means 2 to the fifth selecting means 5 do not perform the shift processing, so that the left 1 is finally obtained.
Bit shift is executed. (Case 4) Finally, the operation when the shift process is not executed will be described.
【0029】入力データ11が16ビットデータで第1
の選択信号6から第5の選択信号10の値が全て”0”
の時、第1の選択手段1から第5の選択手段5まで全て
非シフト動作を選択する。First input data 11 is 16-bit data
The values of the selection signal 6 to the fifth selection signal 10 are all "0"
At this time, all the non-shift operations from the first selecting means 1 to the fifth selecting means 5 are selected.
【0030】この時、第1の選択手段1は入力データの
各ビットk(k:0〜15)に対してビットkの値を選
択し、結果としてシフト処理は実行されない。At this time, the first selecting means 1 selects the value of the bit k for each bit k (k: 0 to 15) of the input data, and as a result, the shift processing is not executed.
【0031】次に、第2の選択手段2は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理は実行されない。Next, the second selecting means 2 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0032】次に、第3の選択手段3は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理は実行されない。Next, the third selecting means 3 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0033】次に、第4の選択手段4は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the fourth selecting means 4 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0034】次に、第5の選択手段5は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the fifth selecting means 5 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0035】以上のように、第1の選択手段1から第5
の選択手段5までの全てがシフト処理を行なわないこと
で最終的にシフト処理が実行されず、入力データ11が
そのまま出力データ12として出力される。As described above, the first selection means 1 to the fifth
Since all of the selection means 5 do not perform the shift process, the shift process is not finally executed, and the input data 11 is directly output as the output data 12.
【0036】[0036]
【発明が解決しようとする課題】しかしながら、上記の
ような従来の構成では、シフト処理を必要としない演算
ではバレルシフタは単なるデータの経路でしかなく演算
器として意味をなさない為、資源の利用効率が悪いとい
った課題を有していた。However, in the conventional configuration as described above, the barrel shifter is a mere data path and does not make sense as an arithmetic unit in an arithmetic operation that does not require shift processing. It had a problem that it was bad.
【0037】本発明は、従来のバレルシフタのこのよう
な課題を考慮し、大規模なハードウェアの追加や演算時
間の増加を招く事なく、同一資源の有効利用を図ること
ができるバレルシフタ及びその制御方法を提供すること
を目的とするものである。In consideration of such problems of the conventional barrel shifter, the present invention makes it possible to effectively utilize the same resource without causing addition of large-scale hardware and increase in calculation time, and the barrel shifter and its control. It is intended to provide a method.
【0038】[0038]
【課題を解決するための手段】本発明は、選択信号に応
じて、入力データに対してシフト側データ又は非シフト
側データを選択するN段の選択手段を有し、右2N-1ビ
ット、左2N-1−1ビットのシフトが可能なバレルシフ
タにおいて、N段の選択手段のうち、何れの選択手段に
よってもシフト側データが選択されない場合は、入力さ
れたマスク信号を出力し、N段の選択手段のうち、少な
くとも1つの選択手段によりシフト側データが選択され
た場合は、最終段の選択手段に対する選択信号に応じ
て、シフト側データ又は非シフト側データを選択するマ
スク信号を出力する制御部を備えたバレルシフタであ
る。The present invention has N stages of selection means for selecting shift-side data or non-shift-side data for input data in accordance with a selection signal, and right 2 N-1 bits. , Left 2 N-1 -1 bit shiftable barrel shifter outputs the input mask signal when the shift-side data is not selected by any of the N-stage selecting means. When the shift side data is selected by at least one of the stage selecting means, a mask signal for selecting the shift side data or the non-shift side data is output according to the selection signal for the final stage selecting means. It is a barrel shifter equipped with a control unit for controlling.
【0039】[0039]
【作用】本発明は、制御部が、N段の選択手段のうち、
何れの選択手段によってもシフト側データが選択されな
い場合は、入力されたマスク信号を出力し、N段の選択
手段のうち、少なくとも1つの選択手段によりシフト側
データが選択された場合は、最終段の選択手段に対する
選択信号に応じて、シフト側データ又は非シフト側デー
タを選択する。According to the present invention, the control unit is one of N-stage selection means.
If the shift-side data is not selected by any of the selecting means, the input mask signal is output, and if the shift-side data is selected by at least one of the N-stage selecting means, the final stage is selected. The shift-side data or the non-shift-side data is selected according to the selection signal for the selection means.
【0040】[0040]
【実施例】以下に、本発明をその実施例を示す図面に基
づいて説明する。DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to the drawings showing its embodiments.
【0041】図1は、本発明にかかる一実施例のバレル
シフタのブロック図である。図1において、第1の選択
手段1から第4の選択手段4は、従来例の図4で述べた
構成と同じであり、同様の動作を行なう。FIG. 1 is a block diagram of a barrel shifter according to an embodiment of the present invention. In FIG. 1, the first to fourth selecting means 1 to 4 have the same configuration as that of the conventional example described in FIG. 4, and perform the same operation.
【0042】従来例のバレルシフタと異なる点は、第5
の選択手段105の構成と、制御部15が付加されてい
る点である。制御部15は、マスク処理時のマスクパタ
ーン13、シフト実行を要求するシフト実行信号14及
び、第5の選択信号10が入力し、それら第5の選択信
号10、マスクパターン13、及びシフト実行信号14
に基づいて、後述のシフト許可信号16とマスク信号1
7とを第5の選択手段105へ出力する(図2は制御部
15における入力信号と出力信号との関係を示す図であ
る)。すなわち、シフト許可信号16はシフト実行時に
有効となり、マスク信号17は非シフト処理実行時に有
効となる。The difference from the conventional barrel shifter is the fifth one.
The configuration of the selection means 105 and the control unit 15 are added. The control unit 15 receives the mask pattern 13 at the time of mask processing, the shift execution signal 14 requesting the shift execution, and the fifth selection signal 10, and inputs the fifth selection signal 10, the mask pattern 13, and the shift execution signal. 14
Based on the shift enable signal 16 and the mask signal 1 described later.
7 and 7 are output to the fifth selecting means 105 (FIG. 2 is a diagram showing a relationship between an input signal and an output signal in the control section 15). That is, the shift permission signal 16 is valid when the shift is executed, and the mask signal 17 is valid when the non-shift processing is executed.
【0043】図3は、本実施例のバレルシフタにおける
第5の選択手段105の内部構成図である。第5の選択
手段105が他の選択手段(図5参照)と異なる点は、
インバータゲートにより反転された反転選択信号の替わ
りにマスク信号17が入力されている点である。FIG. 3 is an internal block diagram of the fifth selecting means 105 in the barrel shifter of this embodiment. The difference between the fifth selecting means 105 and the other selecting means (see FIG. 5) is that
The point is that the mask signal 17 is input instead of the inverted selection signal inverted by the inverter gate.
【0044】次に、上記実施例のバレルシフタの動作に
ついて、図2を用いて説明する。 (図2のケース11の場合)まず、図2で第5の選択信
号10から第1の選択信号6がx”1f”でシフト実行
信号14が”1”の右1ビットシフトの場合の動作を説
明する。Next, the operation of the barrel shifter of the above embodiment will be described with reference to FIG. (Case 11 in FIG. 2) First, in FIG. 2, the operation in the case where the fifth selection signal 10 to the first selection signal 6 are x "1f" and the shift execution signal 14 is "1" for right 1-bit shift Will be explained.
【0045】入力データ11が16ビットデータで第1
の選択信号6から第4の選択信号9の値が全て”1”の
時、第1の選択手段1から第4の選択手段4まで全てシ
フト動作を選択する。First input data 11 is 16-bit data
When all the values of the selection signals 6 to 9 are "1", the shift operation is selected from the first selection unit 1 to the fourth selection unit 4.
【0046】この時、第1の選択手段1は入力データの
各ビットk(k:0〜15)に対してビットk−1の値
を選択し、結果として左1ビットシフトが実行される。At this time, the first selecting means 1 selects the value of the bit k-1 for each bit k (k: 0 to 15) of the input data, and as a result, the left one bit shift is executed.
【0047】次に、第2の選択手段2は入力データの各
ビットkに対してビットk−2の値を選択し、結果とし
て左2ビットシフトが実行される。Next, the second selecting means 2 selects the value of the bit k-2 for each bit k of the input data, and as a result, the left 2 bit shift is executed.
【0048】次に、第3の選択手段3は入力データの各
ビットkに対してビットk−4の値を選択し、結果とし
て左4ビットシフトが実行される。Next, the third selecting means 3 selects the value of the bit k-4 for each bit k of the input data, and as a result, the left 4-bit shift is executed.
【0049】次に、第4の選択手段4は入力データの各
ビットkに対してビットk−8の値を選択し、結果とし
て左8ビットシフトが実行される。Next, the fourth selecting means 4 selects the value of bit k-8 for each bit k of the input data, and as a result, the left 8-bit shift is executed.
【0050】次に、第5の選択手段105は制御部15
から出力されるシフト許可信号16が”1”で、マスク
信号17がx”0000”であるため、非シフト側デー
タ(図3の信号102側)は無効とされ、入力データの
各ビットkに対してビットk+16の値(シフト側デー
タ、図3の信号103側)を選択し、結果として右16
ビットシフトが実行される。Next, the fifth selecting means 105 includes the control unit 15
Since the shift enable signal 16 output from is "1" and the mask signal 17 is x "0000", the non-shift side data (the signal 102 side in FIG. 3) is invalid, and each bit k of the input data is On the other hand, the value of bit k + 16 (shift side data, signal 103 side in FIG. 3) is selected, and as a result, right 16
Bit shift is executed.
【0051】従って、最終的に右1ビットシフトが実行
される。 (図2のケース12の場合)次に、図2で第5の選択信
号10から第1の選択信号6がx”10”でシフト実行
信号14が”1”の右16ビットシフトの場合の動作を
説明する。Therefore, the right one bit shift is finally executed. (Case 12 in FIG. 2) Next, in the case of the right 16-bit shift in which the fifth selection signal 10 to the first selection signal 6 are x "10" and the shift execution signal 14 is "1" in FIG. The operation will be described.
【0052】入力データ11が16ビットデータで第1
の選択信号6から第4の選択信号9の値が全て”0”の
時、第1の選択手段1から第4の選択手段4まで全て非
シフト動作を選択する。The input data 11 is 16-bit data and is the first
When all the values of the selection signals 6 to 9 are "0", all the non-shift operations from the first selection unit 1 to the fourth selection unit 4 are selected.
【0053】この時、第1の選択手段1は入力データの
各ビットk(k:0〜15)に対してビットkの値を選
択し、結果としシフト処理が実行されない。At this time, the first selecting means 1 selects the value of the bit k for each bit k (k: 0 to 15) of the input data, and as a result, the shift process is not executed.
【0054】次に、第2の選択手段2は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the second selecting means 2 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0055】次に、第3の選択手段3は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the third selecting means 3 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0056】次に、第4の選択手段4は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the fourth selecting means 4 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0057】次に、第5の選択手段105は制御部15
から出力されるシフト許可信号16が”1”で、マスク
信号17がX”0000”であるため、前述のケース1
と同様に、入力データの各ビットkに対してビットk+
16の値を選択し、結果として右16ビットシフト処理
が実行される。Next, the fifth selecting means 105 includes the control unit 15
Since the shift permission signal 16 output from is 1 and the mask signal 17 is X “0000”,
Similarly, for each bit k of input data, bit k +
A value of 16 is selected and, as a result, right 16-bit shift processing is executed.
【0058】従って、最終的に右16ビットシフトが実
行される。 (図2のケース13の場合)次に、図2で第5の選択信
号10から第1の選択信号6がx”01”でシフト実行
信号14が”1”の左1ビットシフトの場合の動作を説
明する。Therefore, the right 16-bit shift is finally executed. (Case 13 in FIG. 2) Next, in FIG. 2, in the case of the 1st left shift of the fifth selection signal 10 to the first selection signal 6 is x "01" and the shift execution signal 14 is "1". The operation will be described.
【0059】入力データ11が16ビットデータで第2
の選択信号7から第5の選択信号10の値が全て”0”
の時、第2の選択手段2から第5の選択手段105まで
全て非シフト動作を選択する。If the input data 11 is 16-bit data and the second
All the values of the selection signal 7 to the fifth selection signal 10 are “0”
At this time, all the non-shift operations from the second selecting means 2 to the fifth selecting means 105 are selected.
【0060】この時、第1の選択手段1は入力データの
各ビットk(k:0〜15)に対してビットk−1の値
を選択し、結果とし左1ビットシフトが実行される。At this time, the first selecting means 1 selects the value of the bit k-1 for each bit k (k: 0 to 15) of the input data, and as a result, the left one bit shift is executed.
【0061】次に、第2の選択手段2は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the second selecting means 2 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0062】次に、第3の選択手段3は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the third selecting means 3 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0063】次に、第4の選択手段4は入力データの各
ビットkに対してビットkの値を選択し、結果としてシ
フト処理が実行されない。Next, the fourth selecting means 4 selects the value of the bit k for each bit k of the input data, and as a result, the shift processing is not executed.
【0064】次に、第5の選択手段105は制御部15
から出力されるシフト許可信号16が”0”で、マスク
信号17がX”ffff”であるため、入力データの各
ビットkに対してビットkの値(図3の信号102側)
を選択し、結果としてシフト処理が実行されない。Next, the fifth selecting means 105 controls the control unit 15
Since the shift enable signal 16 output from is "0" and the mask signal 17 is X "ffff", the value of the bit k for each bit k of the input data (on the signal 102 side in FIG. 3)
Is selected, and as a result, the shift process is not executed.
【0065】従って、最終的に左1ビットシフトが実行
される。 (図2のケース14の場合)次に、図2で第4の選択信
号9から第1の選択信号6がx”0”でシフト実行信号
14が”0”の全てのビットをイネーブルにするマスク
処理の場合の動作を説明する。Therefore, the left one bit shift is finally executed. (Case 14 in FIG. 2) Next, in FIG. 2, all the bits from the fourth selection signal 9 to the first selection signal 6 x "0" and the shift execution signal 14 "0" are enabled. The operation in the case of mask processing will be described.
【0066】入力データ11が16ビットデータで第1
の選択信号6から第4の選択信号9の値が全て”0”の
時、第1の選択手段1から第4の選択手段4まで全て非
シフト動作を選択する。First input data 11 is 16-bit data
When all the values of the selection signals 6 to 9 are "0", all the non-shift operations from the first selection unit 1 to the fourth selection unit 4 are selected.
【0067】この時、第1の選択手段1から第4の選択
手段4までは入力データの各ビットk(k:0〜15)
に対してビットkの値を選択し、結果としシフト処理が
実行されない。At this time, each bit k (k: 0 to 15) of the input data is input from the first selecting means 1 to the fourth selecting means 4.
, The value of bit k is selected, and as a result, the shift processing is not executed.
【0068】次に、第5の選択手段105は制御部15
から出力されるシフト許可信号16が”0”で、マスク
信号17がX”ffff”であるため、入力データの各
ビットに対してマスク処理を行ない全てのデータが有効
となる。従って、最終的に入力データ11がそのまま出
力データ12として出力される。 (図2のケース15の場合)次に、図2で第4の選択信
号9から第1の選択信号6がx”0”でシフト実行信号
14が”0”のビット4から7の4ビットのみ有効にす
るマスク処理の場合の動作を説明する。Next, the fifth selecting means 105 controls the control unit 15
Since the shift permission signal 16 output from is "0" and the mask signal 17 is X "ffff", mask processing is performed on each bit of the input data, and all the data becomes valid. Therefore, finally, the input data 11 is directly output as the output data 12. (Case 15 in FIG. 2) Next, in FIG. 2, 4 bits of 4th selection signal 9 to 1st selection signal 6 are x "0" and shift execution signal 14 is "0" The operation in the case of the mask processing that is enabled only will be described.
【0069】入力データ11が16ビットデータで第1
の選択信号6から第4の選択信号9の値が全て”0”の
時、前述のケース14と同様に、第1の選択手段1から
第4の選択手段4まで全て非シフト動作を選択する。The first input data 11 is 16-bit data.
When all the values of the selection signals 6 to 9 are "0", the non-shift operation is selected from the first selection means 1 to the fourth selection means 4 as in the case 14 described above. .
【0070】この時、第1の選択手段1から第4の選択
手段4までは入力データの各ビットk(k:0〜15)
に対してビットkの値を選択し、結果としシフト処理が
実行されない。At this time, each bit k (k: 0 to 15) of the input data is input from the first selecting means 1 to the fourth selecting means 4.
, The value of bit k is selected, and as a result, the shift processing is not executed.
【0071】次に、第5の選択手段105は制御部15
から出力されるシフト許可信号16が”0”で、マスク
信号17がX”00f0”であるため、入力データのビ
ット4から7に対してマスク処理を行なう。従って、最
終的にはビット0から3、及びビット8から15は0が
出力され、入力データ11の内ビット4からビット7の
データがそのまま出力データ12として出力される。こ
れによってビット4から7のデータの切り出しが実現で
きたことになる。Next, the fifth selecting means 105 includes the control unit 15
Since the shift enable signal 16 output from is "0" and the mask signal 17 is X "00f0", mask processing is performed on bits 4 to 7 of the input data. Therefore, finally, 0 is output to bits 0 to 3 and bits 8 to 15, and the data of bits 4 to 7 of the input data 11 is output as the output data 12 as it is. This means that the data of bits 4 to 7 can be cut out.
【0072】以上のように、本実施例によれば、バレル
シフタを構成するN段の選択手段の内、最終段の選択手
段に対し、入力されるシフト実行信号が有効でない時に
は、非シフト側の入力データに対するマスク処理を行な
うためのマスク信号を出力し、入力されるシフト実行信
号が有効である時にはシフト側の入力データを選択する
ためのシフト許可信号を出力する制御部を設けることに
よって、従来のシフト処理に加え、非シフト処理実行時
には、バレルシフタの最終段で制御部から出力されるマ
スク信号によって特定ビットのマスク処理あるいはビッ
ト切り出しを同一ハードウェアにより行ない、非シフト
処理実行時にも資源の利用効率を高めることができる。As described above, according to the present embodiment, when the shift execution signal input to the final stage selecting means of the N stage selecting means constituting the barrel shifter is not valid, the non-shift side is selected. Conventionally, by providing a control unit that outputs a mask signal for performing mask processing on input data, and outputs a shift permission signal for selecting input data on the shift side when the input shift execution signal is valid, In addition to the shift processing of the above, when the non-shift processing is executed, the mask signal of the specific bit is masked or cut out by the same hardware at the final stage of the barrel shifter by the same hardware, and the resource is used even when the non-shift processing is executed The efficiency can be increased.
【0073】なお、上記実施例では、選択手段にマルチ
プレクサを用いたが、これに限らず、同様の機能を果た
す別の回路、装置等でもよい。Although the multiplexer is used as the selection means in the above embodiment, the present invention is not limited to this, and another circuit, device or the like having the same function may be used.
【0074】また、上記実施例では、制御部と最終段の
選択手段を独立に持たせる構成としたが、これに限ら
ず、一体化した構成としてもよい。Further, in the above embodiment, the control section and the selection means at the final stage are independently provided, but the present invention is not limited to this and may be an integrated configuration.
【0075】また、上記実施例では、係数N=5として
5段の選択手段により構成したが、これに限らず、他の
値でもよく、いくつでもよい。Further, in the above embodiment, the coefficient N = 5 and the selection means of five stages are used, but the present invention is not limited to this, and any other value may be used.
【0076】[0076]
【発明の効果】以上述べたところから明らかなように本
発明は、N段の選択手段のうち、何れの選択手段によっ
てもシフト側データが選択されない場合は、入力された
マスク信号を出力し、N段の選択手段のうち、少なくと
も1つの選択手段によりシフト側データが選択された場
合は、最終段の選択手段に対する選択信号に応じて、シ
フト側データ又は非シフト側データを選択するマスク信
号を出力する制御部を備えているので、大規模なハード
ウェアの追加や演算時間の増加を招く事なく、同一資源
の有効利用を図ることができるという長所を有する。As is apparent from the above description, the present invention outputs the input mask signal when the shift side data is not selected by any of the N-stage selecting means. When shift-side data is selected by at least one of the N-stage selecting means, a mask signal for selecting shift-side data or non-shift-side data is selected in accordance with the selection signal for the final-stage selecting means. Since the output control unit is provided, there is an advantage that the same resource can be effectively used without causing large-scale addition of hardware and increase in calculation time.
【図1】本発明にかかる一実施例のバレルシフタのブロ
ック図である。FIG. 1 is a block diagram of a barrel shifter according to an embodiment of the present invention.
【図2】同実施例における制御部の動作を説明する図で
ある。FIG. 2 is a diagram explaining an operation of a control unit in the embodiment.
【図3】同実施例における第5の選択手段の内部構成図
である。FIG. 3 is an internal block diagram of a fifth selecting means in the embodiment.
【図4】従来のバレルシフタのブロック図である。FIG. 4 is a block diagram of a conventional barrel shifter.
【図5】従来のバレルシフタにおける選択手段の内部構
成図である。FIG. 5 is an internal configuration diagram of a selection unit in a conventional barrel shifter.
1 第1の選択手段 2 第2の選択手段 3 第3の選択手段 4 第4の選択手段 5 第5の選択手段 15 制御部 16 シフト許可信号 17 マスク信号 100 インバータゲート 101 マルチプレクサ 102 ビットkの信号 103 ビットk−iの信号 105 第5の選択手段 DESCRIPTION OF SYMBOLS 1 1st selection means 2 2nd selection means 3 3rd selection means 4 4th selection means 5 5th selection means 15 Control part 16 Shift permission signal 17 Mask signal 100 Inverter gate 101 Multiplexer 102 Bit k signal 103-bit k-i signal 105 Fifth selection means
Claims (2)
シフト側データ又は非シフト側データを選択するN段の
選択手段を有し、右2N-1ビット、左2N-1−1ビットの
シフトが可能なバレルシフタにおいて、前記N段の選択
手段のうち、何れの選択手段によってもシフト側データ
が選択されない場合は、入力されたマスク信号を出力
し、前記N段の選択手段のうち、少なくとも1つの選択
手段によりシフト側データが選択された場合は、最終段
の選択手段に対する選択信号に応じて、シフト側データ
又は非シフト側データを選択するマスク信号を出力する
制御部を備えたことを特徴とするバレルシフタ。1. An N-stage selection means for selecting shift-side data or non-shift-side data for input data according to a selection signal, and has right 2 N-1 bits and left 2 N-1 -1. In the barrel shifter capable of shifting bits, when the shift-side data is not selected by any of the N-stage selecting means, the input mask signal is output to select one of the N-stage selecting means. In the case where the shift side data is selected by at least one selecting means, a control section for outputting a mask signal for selecting the shift side data or the non-shift side data is provided according to the selection signal to the final stage selecting means. Barrel shifter characterized by that.
シフト側データ又は非シフト側データを選択するN段の
選択手段によって、右2N-1ビット、左2N-1−1ビット
のシフトが可能なバレルシフタ制御方法において、前記
N段の選択手段のうち、何れの選択手段によってもシフ
ト側データが選択されない場合は、入力されたマスク信
号を出力し、前記N段の選択手段のうち、少なくとも1
つの選択手段によりシフト側データが選択された場合
は、最終段の選択手段に対する選択信号に応じて、シフ
ト側データ又は非シフト側データを選択するマスク信号
を出力することを特徴とするバレルシフタ制御方法。2. Right 2 N-1 bits and left 2 N-1 -1 bits are selected by N stages of selection means for selecting shift side data or non-shift side data for input data according to a selection signal. In the shiftable barrel shifter control method, when the shift-side data is not selected by any of the N-stage selecting means, the input mask signal is output to select one of the N-stage selecting means. , At least 1
When the shift side data is selected by one of the selecting means, a mask signal for selecting the shift side data or the non-shift side data is output according to the selection signal to the selecting means at the final stage. .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP6018672A JPH07225672A (en) | 1994-02-15 | 1994-02-15 | Barrel shifter and control method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP6018672A JPH07225672A (en) | 1994-02-15 | 1994-02-15 | Barrel shifter and control method |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH07225672A true JPH07225672A (en) | 1995-08-22 |
Family
ID=11978103
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP6018672A Pending JPH07225672A (en) | 1994-02-15 | 1994-02-15 | Barrel shifter and control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07225672A (en) |
-
1994
- 1994-02-15 JP JP6018672A patent/JPH07225672A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2983542B2 (en) | Processing speed-up device | |
| JP3378444B2 (en) | Shift circuit | |
| US5764550A (en) | Arithmetic logic unit with improved critical path performance | |
| US4878191A (en) | Multiplication circuit capable of operating at a high speed with a small amount of hardware | |
| US5719802A (en) | Adder circuit incorporating byte boundaries | |
| JPS63219227A (en) | Arithmetic operation device | |
| JP4278320B2 (en) | Shift operation apparatus and system | |
| US5623434A (en) | Structure and method of using an arithmetic and logic unit for carry propagation stage of a multiplier | |
| JPS6017534A (en) | Floating-point numeral normalized circuit | |
| KR0166403B1 (en) | Computing device | |
| JPH0799808B2 (en) | Arithmetic logic unit | |
| JPS60253315A (en) | Variable delay circuit | |
| JP2856791B2 (en) | Barrel shifter and floating point unit | |
| JPS622328B2 (en) | ||
| JP3111695B2 (en) | Arithmetic processing unit | |
| US6041341A (en) | Method and circuit for adding operands of multiple size | |
| JP3284717B2 (en) | Barrel shifter | |
| JP3109080B2 (en) | Word length limiting circuit | |
| JPH02293928A (en) | Microcomputer | |
| JPH01259415A (en) | data correction circuit | |
| JPH051498B2 (en) | ||
| JPH08137669A (en) | Arithmetic circuit | |
| JPH0318926A (en) | Arithmetic circuit | |
| JPH0335691B2 (en) | ||
| JPH06214758A (en) | Arithmetic circuit |