JPS61234428A - Data shift circuit - Google Patents

Data shift circuit

Info

Publication number
JPS61234428A
JPS61234428A JP60075607A JP7560785A JPS61234428A JP S61234428 A JPS61234428 A JP S61234428A JP 60075607 A JP60075607 A JP 60075607A JP 7560785 A JP7560785 A JP 7560785A JP S61234428 A JPS61234428 A JP S61234428A
Authority
JP
Japan
Prior art keywords
data
shift
bit
significant bit
selector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP60075607A
Other languages
Japanese (ja)
Inventor
Kiyoshi Maenobu
前信 潔
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 JP60075607A priority Critical patent/JPS61234428A/en
Publication of JPS61234428A publication Critical patent/JPS61234428A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To execute various shift operations in a prescribed processing time independently of the shift amount by selecting and generating data to be buried to an idle bit from the result of operation in response to the shift operation mode and direction by a selector group. CONSTITUTION:Data except the most significant bit 2 of n-bit data 1 to be shifted, or a bit 2 of the data 1, or an immediate 5 is selected by an (n-1)-bit selector group 3. Data except the least significant bit of the data 1 or the immediate 5 is selected and outputted by an (n-1)-bit selector group 4. Data of continuous (2n-2)-bit being an output of the selector group 4 is inputted to a level shifter 6 in the least significant bit of the output of the selector group 3. The shifter 6 selects and outputs n-bit data according to a control signal 22 from a decoder 21 inputting the shift amount command signal 18 and the shift direction signal 8, and the most significant bit of the shifter 6 or the bit 2 of the data 1 is selected and outputted by a selector 7. A control signal to the selectors 3,4,7 is outputted from the control circuit 12 inputting the signal 8 and the shift mode command signals 9-11.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は複数ビットのディジタルデータを任意ビットだ
け左右両方向にシフト可能なデータシフト回路に関する
ものである。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a data shift circuit capable of shifting a plurality of bits of digital data by arbitrary bits in both left and right directions.

従来の技術 従来ディジタルデータをシフトあるいは回転するために
は、被シフトデータのビット数だけフリップフロップを
直列に接続し、1回のシフトパルスにつき1ビツトずつ
シフトあるいは回転を行なうシフトレジスタ方式が採用
されている(例えば、情報処理学会編「新版情報処理ハ
ンドブック」昭和56年3月30日、オーム社、P76
3など)0また左右両方向へのシフトあるいは回転を可
能とするためには、各ビットに対応するフリップフロッ
プ毎にセレクタを設けたシ、左方向、右方向各々に対し
てシフトレジスタを設けどちらか一方の出力を選択する
などの方法が採られている。
BACKGROUND ART Conventionally, in order to shift or rotate digital data, a shift register method has been adopted in which flip-flops are connected in series for the number of bits of the data to be shifted, and one bit is shifted or rotated for each shift pulse. (For example, "New Edition Information Processing Handbook" edited by Information Processing Society of Japan, March 30, 1981, Ohmsha, p. 76)
3, etc.) In order to enable shifting or rotation in both the left and right directions, either a selector is provided for each flip-flop corresponding to each bit, or a shift register is provided for each of the left and right directions. A method such as selecting one output is adopted.

発明が解決しようとする問題点 しかしながら上記のような方式では、データを複数ビッ
トシフトあるいは回転する場合にはシフト量に比例した
処理時間が必要となシ、シフト量の大きい場合には処理
時間が長くなるという欠点がある。更に、左右両方向へ
のシフトあるいは回転を行なうためにハードウェアが複
雑や冗長となり回路の集積化に不利である。
Problems to be Solved by the Invention However, with the above method, when data is shifted or rotated by multiple bits, a processing time proportional to the shift amount is required, and when the shift amount is large, the processing time is It has the disadvantage of being long. Furthermore, shifting or rotating in both left and right directions requires complicated and redundant hardware, which is disadvantageous to circuit integration.

本発明はかかる点に鑑み、種々のシフト演算をシフト量
に依存しない一定の処理時間で実行でき、ハードウェア
の冗長性がなく左右両方向にシフト演算を行なえるデー
タシフト回路を提供することを目的とする。
In view of the above, an object of the present invention is to provide a data shift circuit that can perform various shift operations in a fixed processing time independent of the shift amount, and that can perform shift operations in both left and right directions without hardware redundancy. shall be.

問題点を解決するための手段 本発明は上記問題点を解決するために、与えられたシフ
トデータの最上位ビットを除くデータかあるいは被シフ
トデータの最上位ビットデータかあるいは即値″o″を
選択出力するだめの(n−1)ビットの第1のセレクタ
群と、最下位ビットを除く被シフトデータあるいは即値
″0”を選択出力するための(n−1)ビットの第2の
セレクタ群と、シフト量指示信号及びシフト方向指示信
号に従って後記のバレルシ7りへの制御信号を生成する
デコーダと、(2n−2)ビットの入力データの連続す
るnビットのデータを前記デコーダの出力する制御信号
に従って選択するためのバレルシフタと、このバレルシ
フタの出力の最上位ビットデータと被シフトデータの最
上位ビットデータを選択出力するためのセレクタと、シ
フト方向指示信号及びシフト演算モード指示信号に従っ
て前記のセレクタ群における選択制御信号を生成するた
めの制御回路を備えたデータシフト回路である。
Means for Solving the Problems In order to solve the above problems, the present invention selects data excluding the most significant bit of the given shift data, the most significant bit data of the shifted data, or the immediate value "o". A first selector group of (n-1) bits for output, and a second selector group of (n-1) bits for selectively outputting the shifted data excluding the least significant bit or the immediate value "0". , a decoder that generates a control signal for a barrel shift (described later) according to a shift amount instruction signal and a shift direction instruction signal, and a control signal that outputs consecutive n bits of (2n-2) bits of input data from the decoder. a barrel shifter for selectively outputting the most significant bit data of the output of the barrel shifter and the most significant bit data of the shifted data; and a group of selectors according to the shift direction instruction signal and the shift operation mode instruction signal. This is a data shift circuit equipped with a control circuit for generating a selection control signal.

作用 本発明は上記の構成により、第1及び第2のセレクタ群
によりシフト演算のモード及びシフト方向に応じて、シ
フト演算の結果生じるあきビットへの埋め込みデータを
選択的に生成し、この埋め込ミテータと被シフトデータ
をバレルシフタニ入力し、指示されたシフト量に応じた
ビット位置から連続するnビットを選択出力し、バレル
シ7り出力データの最上位ビットデータに対して第3の
セレクタにより補正を加えることにより、最終的なシフ
ト演算結果を、シフト演算の方向、モード。
According to the above-described configuration, the present invention selectively generates data to be embedded in empty bits resulting from a shift operation using the first and second selector groups according to the mode and shift direction of the shift operation. The mitator and shifted data are input to the barrel shifter, and consecutive n bits are selected and output from the bit position according to the specified shift amount, and the third selector corrects the most significant bit data of the barrel shifter output data. The final shift operation result by adding the direction and mode of the shift operation.

シフト量に関係なく一定の処理時間で生成するものであ
る。
It is generated in a constant processing time regardless of the amount of shift.

実施例 第1図は本発明のデータシフト回路の一実施例を示すブ
ロック図である。
Embodiment FIG. 1 is a block diagram showing an embodiment of the data shift circuit of the present invention.

1はシフト演算の対象となる長さnビットの入力データ
、3は最上位ビットを除く被シフトデータ1あるいは被
シフトデータ最上位ビットデータ2あるいは即値データ
10#5から1つのデータを選択制御信号16に従って
出力する(n−1)個のセレクタから成るセレクタ群、
4は最下位ビットを除く被シフトデータ1かあるいは即
値データ″0″6を選択制御信号16に従って出力する
(n−1)個のセレクタから成るセレクタ群、6はセレ
クタ群3の出力19の最下位ビット側にセレクタ群4の
出力20を連結した(2n−2)ビットのデータからバ
レルシフタ制御信号22に従ったビット位置から連続す
るnピットのデータを選択出力するバレルシフタ、21
はシフト方向制御信号8及びシフト量指示信号18から
パレシフタ制御信号22を生成するデコーダ、7はバレ
ルシフタ出力最上位ビットデータ13あるいは被シフト
データ最上位ビットデータ2を選択制御信号17に従っ
て出力するセレクタ、14は最終的なシフト演算結果、
12はシフト方向指示信号8及びシフトモード指示信号
9,10.11に従って選択制御信号15,16.17
を生成する制御回路である。シフト方向指示信号は論理
″1′で右方向シフトを、論理″01で左方向シフトを
表わすものとする。シフトモード指示信号9,10゜1
1は各々論理′″11のとき論理シフト演算、算術シフ
ト演算2圓転シフト演算であることを示し、2つ以上の
シフトモード指示信号が同時に論理″1″となることは
ないものとする。
1 is input data of length n bits to be subjected to shift operation, 3 is a control signal to select one data from shifted data 1 excluding the most significant bit, shifted data most significant bit data 2, or immediate data 10#5 a selector group consisting of (n-1) selectors that output according to 16;
4 is a selector group consisting of (n-1) selectors that output shifted data 1 excluding the least significant bit or immediate data "0" 6 according to the selection control signal 16; 6 is the highest output of the output 19 of selector group 3; A barrel shifter 21 that selects and outputs data of n consecutive pits from bit positions according to a barrel shifter control signal 22 from (2n-2) bit data connected to the output 20 of the selector group 4 on the lower bit side.
7 is a decoder that generates the barrel shifter control signal 22 from the shift direction control signal 8 and the shift amount instruction signal 18; 7 is a selector that outputs the barrel shifter output most significant bit data 13 or the shifted data most significant bit data 2 in accordance with the selection control signal 17; 14 is the final shift operation result,
12 is a selection control signal 15, 16.17 according to the shift direction instruction signal 8 and the shift mode instruction signal 9, 10.11.
This is a control circuit that generates It is assumed that the shift direction instruction signal indicates a rightward shift when the logic is "1", and a leftward shift when the logic is "01". Shift mode instruction signal 9, 10°1
1 indicates a logical shift operation, an arithmetic shift operation, and a two-round shift operation when the logic is ``11'', and it is assumed that two or more shift mode instruction signals will not become logic ``1'' at the same time.

以上のように構成された本実施例のデータシフト回路に
ついて以下にその動作を説明する。
The operation of the data shift circuit of this embodiment configured as described above will be explained below.

まず最初に本発明のデータシフト回路が行なう3種のシ
フト演算について説明する。
First, three types of shift operations performed by the data shift circuit of the present invention will be explained.

論理シフト演算とは右あるいは左へ指示されたシフト量
だけ入力データをシフトし、最下位ビット(右シフトの
場合)あるいは最上位ビット(左シフトの場合)からあ
ふれたビットは捨てられ、あらたkあいた部分にao1
が埋め込まれる演算とする。
A logical shift operation shifts input data to the right or left by the specified shift amount, discards the bits that overflow from the least significant bit (in the case of a right shift) or the most significant bit (in the case of a left shift), and creates a new k ao1 in the open part
is an operation in which is embedded.

算術シフト演算とは最上位ビットを符号ビットと見なし
てシフトにおいて固定とし、最上位ビットを除く入力デ
ータを右あるいは左へ指示されたシフト量だけシフトし
、最下位ビット(右シフトの場合)あるいは最上位ビッ
トの次位ビット(左シフトの場合)からあふれたビット
は捨てられ、右シフトの場合は、あらたにあいた部分に
符号ビットと同じデータが埋めこまれ、左シフトの場合
は、@0”が埋め込まれる演算とする。
Arithmetic shift operation considers the most significant bit as the sign bit and fixes it in the shift, shifts the input data excluding the most significant bit to the right or left by the specified shift amount, and shifts the least significant bit (in the case of a right shift) or The bits that overflow from the bit next to the most significant bit (in the case of left shift) are discarded, and in the case of right shift, the newly vacant part is filled with the same data as the sign bit, and in the case of left shift, it is @0. ” is an operation that is embedded.

回転シフト演算とは右あるいは左へ指示されたシフト量
だけ入力データをシフトし、最下位ビット(右シフトの
場合)あるいは最上位ビット(左シフトの場合)からあ
ふれたビットがあらたにあいた部分にあふれた順に埋め
込まれる演算とする。
A rotational shift operation shifts the input data by the specified shift amount to the right or left, and the bits that overflow from the least significant bit (in the case of a right shift) or the most significant bit (in the case of a left shift) are placed in the newly vacant part. The operations are embedded in the order of overflow.

nビットの被シフトデータをA ” (a□ 、 a 
1 、・・・。
The n-bit shifted data is A'' (a□, a
1,...

−n 、)(但し添字が小さいほど上位のビットを示す
)とし、シフト量をm(1<:m<、n−1)とすると
、前記のシフト演算結果A′は以下のように表わされる
-n, ) (however, the smaller the subscript, the higher the bit), and the shift amount is m (1<:m<, n-1), the above shift operation result A' is expressed as follows. .

右論理シフト演算 A’=(0,0,・、O、ao、al、・、 anm−
1)左論理シフト演算 A’=(a−、a!!&+1.−・−、an、 、O,
−、O、O)右算術シフト演算 ”” (”Oj ”OP ”” # ”Op ”OP 
”1 m ”” e ”n−m−1)左算術シフト演算 ”=(”Oe”m+1 ’ ”m+2’ ”” ”n 
110”” ” )右回転シフト演算 ” ” (” n−m s ” n−m−1−1”・’
# ”n −1”O’a1 p ””−n−m−1) 左回転シフト演算 ”” (”m’ ”m+1 # ”°9  ”n−1t
”Qt”1 # ”” e”m−1) 以上のシフト演算を一般化すると、右シフト演算は被シ
フトデータAの最上位ビット側に、シフトのためにあく
部分に埋め込まれるべきデータ(長さnビット)を連結
した2nビツトのデータの第(n−m)ビット目から連
続したnピ歩トのデータを選択することと等しい。第2
図に右論理シフト演算の場合を示す。1o1は埋め込み
データであり、本例の場合は全ビット@o”である01
02は被シフトデータ、103はシフト演算結果を示す
。同様に右算術シフト演算の場合の埋め込みデータは全
ビットが被シフトデータの最上位ビット(即ち符号ビッ
ト)に等しい値を持つデータであり、右回転シフト演算
の場合の埋め込みデータは被シフトデータ自身である。
Right logical shift operation A'=(0, 0, ., O, ao, al, ., anm-
1) Left logical shift operation A'=(a-, a!!&+1.-・-, an, ,O,
-, O, O) Right arithmetic shift operation ""("Oj"OP""#"Op"OP
"1m"" e "n-m-1) left arithmetic shift operation" = ("Oe"m+1 '"m+2'"""n
110""") Right rotation shift operation ""("n-ms"nm-1-1"・'
#"n-1"O'a1 p ""-n-m-1) Left rotation shift operation ""("m'"m+1#"°9"n-1t
"Qt"1#""e"m-1) Generalizing the above shift operation, the right shift operation inserts the data (long The second
The figure shows the case of right logical shift operation. 1o1 is embedded data, and in this example, all bits @o'' are 01
02 indicates the data to be shifted, and 103 indicates the shift operation result. Similarly, in the case of a right arithmetic shift operation, the embedded data is data in which all bits have a value equal to the most significant bit (i.e., the sign bit) of the shifted data, and in the case of a right rotation shift operation, the embedded data is data that is the shifted data itself. It is.

一方、左シフト演算は被シフトデータAの最下位ビット
側に、シフトのためにあく部分に埋め込まれるべきデー
タ(長さnビット)を連結した2nビツトのデータの第
mビット目から連続したnビットのデータを選択するこ
とと等しい。第3図に左回転シフト演算の場合を示す。
On the other hand, the left shift operation is performed by concatenating data (length n bits) to be embedded in the empty part for the shift to the least significant bit side of the data to be shifted A. Equivalent to selecting bits of data. FIG. 3 shows the case of counterclockwise rotation shift calculation.

201は被シフトデータ、202は埋め込みデータであ
り本例の場合は被シフトデータに等しい。2o3はシフ
ト演算結果を示す。同様に左論理シフト演算の場合の埋
め込みデータは全ビット@0”であり、左算術シフト演
算の場合の埋め込みデータもまた全ビット″ojである
201 is shifted data, and 202 is embedded data, which in this example is equal to the shifted data. 2o3 indicates the shift operation result. Similarly, the embedded data in the case of a left logical shift operation is all bits @0'', and the embedded data in the case of a left arithmetic shift operation is also all bits ``oj''.

従って上記の各シフト演算は長さ2nビツトのデータか
ら指定されたビット位置から連続するnビットを選択出
力子る゛という機能を有するバレルシフタを用いて行な
えることがわかる。第4図にMOSFETを用いた良く
知られているバレルシフタの例を示す。第4図の例は8
ピツトの入力デ−夕から4ピツトの出力を選択するバレ
ルシフタである。3o1は入力データ、302は出力デ
ータ、303は制御信号である。制御信号303は同時
に2本以上が1”となることはない。例えば制御信号s
2が1″となったとき、出力データ302は02. C
3+ C4,Csに等しくなる。
Therefore, it can be seen that each of the above shift operations can be performed using a barrel shifter having the function of selecting and outputting n consecutive bits from a designated bit position from data having a length of 2n bits. FIG. 4 shows an example of a well-known barrel shifter using MOSFETs. The example in Figure 4 is 8
This is a barrel shifter that selects the output of 4 pits from the input data of the pits. 3o1 is input data, 302 is output data, and 303 is a control signal. Two or more control signals 303 do not become 1" at the same time. For example, the control signal s
When 2 becomes 1'', the output data 302 is 02.C
It becomes equal to 3+ C4, Cs.

なお本発明の実施例では、nビットデータに対してシフ
ト量が0のシフト演算やシフト量がn以上のシフト演算
は意味をもたないと考えシフト量mを1<;:m<;:
n−1の範囲に限定する。従って前記の被シフトデータ
と埋め込みデータを連結した2nビツトのデータのうち
、左側に連結されるデータの最上位ビット及び右側に連
結されるデータの最下位ビットは選択されることがない
。故にバレルシフタの入力データ長は(2n−2)ビッ
トあれば良い。
In the embodiment of the present invention, the shift amount m is set to 1<;:m<;: considering that a shift operation with a shift amount of 0 or a shift operation with a shift amount of n or more has no meaning for n-bit data.
limited to the range n-1. Therefore, of the 2n-bit data obtained by concatenating the shifted data and the embedded data, the most significant bit of the data concatenated on the left side and the least significant bit of the data concatenated on the right side are not selected. Therefore, the input data length of the barrel shifter only needs to be (2n-2) bits.

次に第1図に従って本発明の実施例の動作を以下に説明
する。
Next, the operation of the embodiment of the present invention will be described below with reference to FIG.

被シフトデータ1はセレクタ群3及びセレクタ群4に入
力される。セレクタ群3ではバレルシ7り6への(2n
−2)ビットの入力データのうちの左側(n−1)ビッ
ト分が選択される。上記のように右シフト演算の場合に
は埋め込みデータが選ばれ、左シフト演算の場合には被
シフトデータが選ばれる。セレクタ群3を構成する個々
のセレクタをSAI (i=1 、2 、+++、 n
  1 ) 、被シフトデータ1をai(L=0,1−
、 n −1)とすると、シフト方向及びシフト演算モ
ードとSAiにおいて選択されるデータの関係は第6図
のようになる。シフト方向指示信号8をRIと表わし、
RIが論理″11のとき右シフトを、論理″0″のとき
左シフトを表わすものとする。またシフトモード信号9
.10.11を各々1.OG、ARI、ROTと表わし
、各々論理@ I J+のとき論理シフト演算、算術シ
フト演算2囲転シフト演算を表わすものとする。このと
きSA1の出力は次の論理式で表現できる。
Shifted data 1 is input to selector group 3 and selector group 4. In selector group 3, (2n
-2) The left side (n-1) bits of the input data are selected. As described above, in the case of a right shift operation, the embedded data is selected, and in the case of a left shift operation, the shifted data is selected. The individual selectors constituting selector group 3 are SAI (i=1, 2, +++, n
1), shift data 1 as ai(L=0,1-
, n -1), the relationship between the shift direction, shift operation mode, and data selected in SAi is as shown in FIG. The shift direction instruction signal 8 is expressed as RI,
When RI is logic "11", it indicates a right shift, and when it is logic "0", it indicates a left shift.
.. 10.11 each 1. Let OG, ARI, and ROT represent a logical shift operation, an arithmetic shift operation, and a rotation shift operation when logic @I J+, respectively. At this time, the output of SA1 can be expressed by the following logical formula.

RI 、Lα2+10+RI 5ARI *aO+RI
 5fLOT*a、1−RI aa。
RI, Lα2+10+RI 5ARI *aO+RI
5fLOT*a, 1-RI aa.

・・・・・・(1) 式(1)を実現するセレクタの一例を第6図aに示す。・・・・・・(1) An example of a selector that implements equation (1) is shown in FIG. 6a.

401は被シフトデータ、402は即値@ OII。401 is the shifted data, 402 is the immediate value @OII.

403は被シフトデータ最上位ビットデータ、404は
選択制御信号、405は選択出力であり、各々第1図の
1.5,2,15,19に相当する。
403 is the most significant bit data of the data to be shifted, 404 is a selection control signal, and 405 is a selection output, which correspond to 1.5, 2, 15, and 19 in FIG. 1, respectively.

第6図aの例は第6図すのように簡単化してもよい。ま
た式(1)はトライステートゲートなどの他の論理素子
を用いても実現できることは言うまでもない。
The example of FIG. 6a may be simplified as shown in FIG. It goes without saying that equation (1) can also be realized using other logic elements such as tri-state gates.

・同様にセレクタ群4ではバレルシフタ6への(2n−
2)ビットの入力データのうちの右側(n−1)ビット
分が選択される0上記のように右シフト演算の場合には
被シフトデータが選ばれ、左シフト演算の場合には埋め
込みデータが選ばれる。セレクタ群4を構成する個々の
セレクタを5B1(1==o t 1 、”・、 n 
 2 )とすると、シフト方向及びシフト演算モードと
SB、において選択されるデータの関係は第7図のよう
になる。上記と同様にSB、の出力は次の論理式で表現
できる。
・Similarly, in selector group 4, (2n-
2) The right (n-1) bits of the bit input data are selected.0 As mentioned above, in the case of a right shift operation, the shifted data is selected, and in the case of a left shift operation, the embedded data is selected. To be elected. The individual selectors constituting the selector group 4 are expressed as 5B1 (1==o t 1 , ”・, n
2), the relationship between the shift direction, shift operation mode, and data selected in SB is as shown in FIG. Similarly to the above, the output of SB can be expressed by the following logical formula.

・・・・・・(2) 式(2)を実現するセレクタの一例を第8図aに示す。・・・・・・(2) An example of a selector that implements equation (2) is shown in FIG. 8a.

501は被シフトデータ、502は即値lIO”。501 is the data to be shifted, and 502 is the immediate value lIO.

503は選択制御信号、504は選択出力であシ、各々
第1図の1.5,16.20に相当する。第8図aの例
は第8図すのように簡単化してもよい。
503 is a selection control signal, and 504 is a selection output, which correspond to 1.5 and 16.20 in FIG. 1, respectively. The example of FIG. 8a may be simplified as shown in FIG.

セレクタ群3及びセレクタ群4で選択された出力19 
、20はセレクタ群出力19を左側に、セレクタ群出力
2oを右側に、互いに連結した(2n−2)ビットのデ
ータとしてバレルシフタ6に入力される。バレルシフタ
6は前記第4図で示した例のように構成され、入力デー
タ長が(2n−2)ビット、出力データ長がnビット、
制御信号が(n−1)本となる。入力データをci(i
=1゜・・・、2n−2)、出力データを’J(j=1
t・・・。
Output 19 selected by selector group 3 and selector group 4
, 20 are input to the barrel shifter 6 as (2n-2) bit data connected to each other, with the selector group output 19 on the left side and the selector group output 2o on the right side. The barrel shifter 6 is configured as shown in the example shown in FIG. 4, and has an input data length of (2n-2) bits, an output data length of n bits,
The number of control signals is (n-1). The input data is ci(i
= 1゜..., 2n-2), output data as 'J (j=1
T...

n)、制御信号を5i(t=1.・・・、n−1)とす
ると、8iが論理″1”のときC1から始まるnビット
のデータ(’i” i+110’ P ’i+n −1
)がblからbnに選択出力される。バレルシフタ6の
制御信号22はデコーダ21において、シフト方向指示
信号8とシフト量指示信号18に従って生成される。シ
フト方向とシフト量とそのとき論理″11となる制御信
号の関係を第9図に示す。
n), and the control signal is 5i (t=1..., n-1), when 8i is logic "1", n-bit data starting from C1 ('i'i+110' P 'i+n -1
) is selectively output from bl to bn. A control signal 22 for the barrel shifter 6 is generated in the decoder 21 according to the shift direction instruction signal 8 and the shift amount instruction signal 18. FIG. 9 shows the relationship between the shift direction, the shift amount, and the control signal that becomes logic "11" at that time.

バレルシフタ6で選択されたnビットの出力す。Outputs n bits selected by barrel shifter 6.

は、左算術シフト演算の場合を除いて最終的なシフト演
算結果14に等しい。しかし、左算術シフト演算の場合
にはバレルシフタ6の出力の最上位ビットデータb1は
被シフトデータ最上位ビットデータ(即ち符号ビット)
2に等しくない。従ってセレクタ7において補正を行な
う。セレクタ7の出力は次の論理式で表現できる。
is equal to the final shift operation result 14 except in the case of left arithmetic shift operations. However, in the case of left arithmetic shift operation, the most significant bit data b1 of the output of the barrel shifter 6 is the most significant bit data (i.e., sign bit) of the shifted data.
Not equal to 2. Therefore, the selector 7 performs correction. The output of the selector 7 can be expressed by the following logical formula.

式(3)を実現するセレクタの一例を第10図に示す。FIG. 10 shows an example of a selector that implements equation (3).

601は被シフトデータ最上位ビットデータ、602は
バレルシフタ出力最上位ビットデータ、603は選択制
御信号であシ第1図の17に相当する。604は選択出
力であり、この出力とバレルシフタ6の出力の最上位ビ
ットを除<(n−1)ビットを合わせたものが最終的な
シフト演算結果14となる。
601 is the most significant bit data of the data to be shifted, 602 is the most significant bit data output from the barrel shifter, and 603 is a selection control signal, which corresponds to 17 in FIG. 604 is a selection output, and the sum of this output and the output of the barrel shifter 6 excluding the most significant bit (n-1) bits becomes the final shift operation result 14.

制御回路12は各セレクタ群に対する選択制御信号を生
成する回路である。セレクタ群3として上記第6図すの
例を、セレクタ群4として上記第8図すの例を、セレク
タ7として上記第10図の例を採用した場合の制御回路
12の一例を第11図に示す0701はシフト方向指示
信号、702はシフトモード信号である。703.70
4 。
The control circuit 12 is a circuit that generates selection control signals for each selector group. FIG. 11 shows an example of the control circuit 12 when the selector group 3 is the example shown in FIG. 6, the selector group 4 is the example shown in FIG. 8, and the selector 7 is the example shown in FIG. 10. 0701 is a shift direction instruction signal, and 702 is a shift mode signal. 703.70
4.

705は選択制御信号で、各々第1図の16゜17.1
6に相当する。
705 is a selection control signal, which corresponds to 16°17.1 in FIG.
Corresponds to 6.

発明の効果 以上のように、本発明によれば、ディジタルデータの左
右両方向の論理シフト演算、算術シフト演算1回転シフ
ト演算をシフト量によらず同一の処理時間で実行でき、
かつ従来のシフトレジスタ方式のデータシフト回路に比
してシフト量が大きい場合に特に有効である。また、セ
レクタ部やバレルシフタ部は回路が規則的でありLSI
化に有利である。
Effects of the Invention As described above, according to the present invention, logical shift operations in both left and right directions of digital data, arithmetic shift operations, and one-rotation shift operations can be executed in the same processing time regardless of the amount of shift.
Moreover, it is particularly effective when the amount of shift is large compared to a conventional shift register type data shift circuit. In addition, the circuits in the selector section and barrel shifter section are regular and LSI
It is advantageous for

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

第1図は本発明の一実施例におけるデータシフト回路の
ブロック図、第2図、第3図は本発明で用いるシフト方
式の例を示す説明図、第4図は本発明の構成要素である
バレルシフタの例を示す回路図、第6図及び第7図は本
発明の構成要素であるセレクタによる論理関係を示す関
係図、第6図及び第8図は各々第5図及び第7図に示す
セレクタを示す回路図、第9図は本発明の構成要素であ
るデコーダによる論理関係を示す関係図、第10図は第
9図に示すセレクタを示す回路図、第11図は上記の各
セレクタを制御する制御回路の例を示す回路図である。 1・・・・・・被シフトデータ、3,4・・・・・・セ
レクタ群、6・・・・・・バレルシフタ、7・・・・・
・セレクタ、8,9〜11.18・・・・・・シフト演
算の種類を指示する各種信号、12・・・・・・セレク
タ制御回路、14・・・・・・シフト演算結果、21・
・・・・・デコーダ。 代理人の氏名 弁理士 中 尾 敏 男 ほか1名第5
図 第7図 第 81!! (a) 第9図 第10図 第11図′
FIG. 1 is a block diagram of a data shift circuit in an embodiment of the present invention, FIGS. 2 and 3 are explanatory diagrams showing an example of a shift method used in the present invention, and FIG. 4 is a component of the present invention. A circuit diagram showing an example of a barrel shifter, FIGS. 6 and 7 are relational diagrams showing logical relationships by selectors that are constituent elements of the present invention, and FIGS. 6 and 8 are shown in FIGS. 5 and 7, respectively. FIG. 9 is a circuit diagram showing the selector, FIG. 9 is a relational diagram showing the logical relationship by the decoder which is a component of the present invention, FIG. 10 is a circuit diagram showing the selector shown in FIG. 9, and FIG. 11 is a diagram showing each of the above selectors. FIG. 2 is a circuit diagram illustrating an example of a control circuit for controlling. 1...Data to be shifted, 3, 4...Selector group, 6...Barrel shifter, 7...
・Selector, 8, 9 to 11.18...Various signals indicating the type of shift operation, 12...Selector control circuit, 14...Shift operation result, 21.
·····decoder. Name of agent: Patent attorney Toshio Nakao and 1 other person No. 5
Figure 7 Figure 81! ! (a) Figure 9, Figure 10, Figure 11'

Claims (1)

【特許請求の範囲】[Claims] 与えられたnビットの被シフトデータの最上位ビットを
除くデータまたは前記被シフトデータの最上位ビットデ
ータ、または即値“O”を選択出力する(n−1)ビッ
トの第1のセレクタ群と、前記被シフトデータの最下位
ビットを除くデータ、または即値“O”を選択出力する
(n−1)ビットの第2のセレクタ群と、シフト量指示
信号及びシフト方向指示信号に従って制御信号を生成す
るデコーダと、前記第1のセレクタ群の出力の最下位ビ
ット側に前記第2のセレクタ群の出力を連結した(2n
−2)ビットのデータを入力データとし、前記デコーダ
の生成する制御信号に従って前記入力データから連続す
るnビットのデータを選択出力するバレルシフタと、前
記バレルシフタの出力の最上位ビットデータ、または前
記被シフトデータの最上位ビットデータを選択出力する
第3のセレクタと、前記シフト方向指示信号及びシフト
演算モード指示信号に従って前記第1、第2、第3のセ
レクタ群へ供給する選択制御信号を生成する制御回路と
を具備したことを特徴とするデータシフト回路。
a first selector group of (n-1) bits that selectively outputs data excluding the most significant bit of the given n-bit shifted data, the most significant bit data of the shifted data, or an immediate value "O"; a second selector group of (n-1) bits that selects and outputs data excluding the least significant bit of the shifted data or an immediate value "O", and generates a control signal in accordance with a shift amount instruction signal and a shift direction instruction signal. A decoder and the output of the second selector group were connected to the least significant bit side of the output of the first selector group (2n
-2) a barrel shifter that takes bit data as input data and selects and outputs continuous n-bit data from the input data according to a control signal generated by the decoder; and the most significant bit data of the output of the barrel shifter, or the shifted target data. A third selector that selectively outputs the most significant bit data of data, and control that generates a selection control signal to be supplied to the first, second, and third selector groups in accordance with the shift direction instruction signal and shift operation mode instruction signal. A data shift circuit characterized by comprising a circuit.
JP60075607A 1985-04-10 1985-04-10 Data shift circuit Pending JPS61234428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60075607A JPS61234428A (en) 1985-04-10 1985-04-10 Data shift circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60075607A JPS61234428A (en) 1985-04-10 1985-04-10 Data shift circuit

Publications (1)

Publication Number Publication Date
JPS61234428A true JPS61234428A (en) 1986-10-18

Family

ID=13581064

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60075607A Pending JPS61234428A (en) 1985-04-10 1985-04-10 Data shift circuit

Country Status (1)

Country Link
JP (1) JPS61234428A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63121922A (en) * 1986-11-12 1988-05-26 Hitachi Ltd Barrel shift circuit

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS52132644A (en) * 1976-02-20 1977-11-07 Intel Corp Method of processing plural digital signals at a time and digital logical circuit for processing digital signals
JPS58184649A (en) * 1982-04-22 1983-10-28 Toshiba Corp Shifting circuit
JPS59195741A (en) * 1983-04-22 1984-11-06 Nec Corp Shifter circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS52132644A (en) * 1976-02-20 1977-11-07 Intel Corp Method of processing plural digital signals at a time and digital logical circuit for processing digital signals
JPS58184649A (en) * 1982-04-22 1983-10-28 Toshiba Corp Shifting circuit
JPS59195741A (en) * 1983-04-22 1984-11-06 Nec Corp Shifter circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63121922A (en) * 1986-11-12 1988-05-26 Hitachi Ltd Barrel shift circuit

Similar Documents

Publication Publication Date Title
US3961750A (en) Expandable parallel binary shifter/rotator
US4829460A (en) Barrel shifter
US4472788A (en) Shift circuit having a plurality of cascade-connected data selectors
US4807172A (en) Variable shift-count bidirectional shift control circuit
JPH05134848A (en) Data shift circuit for central processing unit
US5309382A (en) Binary shifter
US4149263A (en) Programmable multi-bit shifter
US4817029A (en) Multiple-precision Booth&#39;s recode multiplier
US4760517A (en) Thirty-two bit, bit slice processor
US6715066B1 (en) System and method for arranging bits of a data word in accordance with a mask
US6877019B2 (en) Barrel shifter
JPH0421025A (en) Left and right shifter
US5129066A (en) Bit mask generator circuit using multiple logic units for generating a bit mask sequence
US4130880A (en) Data storage system for addressing data stored in adjacent word locations
JPH05191291A (en) Multiplexer
JPS6120890B2 (en)
JPS61234428A (en) Data shift circuit
US5991786A (en) Circuit and method for shifting or rotating operands of multiple size
JPH0697431B2 (en) Barrel shifter
US4291407A (en) Parity prediction circuitry for a multifunction register
EP0350966B1 (en) Barrel shifter
JP5253406B2 (en) Digital electronic binary rotator and inverter
JP2503017B2 (en) Barrel shifter circuit
US5926407A (en) Combined add/shift structure
JPS59180732A (en) Data processing device