JPH06208454A - Bit operation circuit - Google Patents

Bit operation circuit

Info

Publication number
JPH06208454A
JPH06208454A JP5003374A JP337493A JPH06208454A JP H06208454 A JPH06208454 A JP H06208454A JP 5003374 A JP5003374 A JP 5003374A JP 337493 A JP337493 A JP 337493A JP H06208454 A JPH06208454 A JP H06208454A
Authority
JP
Japan
Prior art keywords
bit
data
register
selecting
selecting means
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
JP5003374A
Other languages
Japanese (ja)
Inventor
Nobuyuki Sugiura
信行 杉浦
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP5003374A priority Critical patent/JPH06208454A/en
Publication of JPH06208454A publication Critical patent/JPH06208454A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the number of bit operation steps and to improve an execution speed by selecting bit data in N-bit data by a bit operation circuit and rearranging the data. CONSTITUTION:The 1st selecting means 80 to 83 enter the 2nd bit data and the (2n+1)-th bit data from the 1st register 6, select required data based upon selecting information. stored in the 2nd register 7 and set up the selected data as the n-th bit data. The 2nd selecting means 84 to 87 enter the 2nd bit data and the (2n+1)-th bit data from the register 6, select required data based upon the selecting information stored in the register 7 and set up the selected data as the (n+N/2)-th bit data. The 1st selecting means 80 to 83 and the 2nd selecting means 84 to 87 input the data to the 3rd register 9. Consequently the number of bit operation steps can be reduced and the execution speed can be improved.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、複数のビットにより構
成されるデータのビット操作を簡単に行うことができる
ビット操作回路に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a bit operation circuit which can easily perform bit operation on data composed of a plurality of bits.

【0002】[0002]

【従来の技術】図8は、ビット操作回路を持たない従来
のマイクロプロセッサの一例を示す構成ブロック図であ
る。図において、1は命令制御ユニットで、記憶装置
(図示せず)に順番にアドレスを指示する。そして、記
憶装置から命令やデータを取り込んで、マイクロプロセ
ッサ内の装置の制御を行う。2はデータを記憶する汎用
レジスタ、3は算術演算ユニットで、汎用レジスタ2か
らデータである入力オペランドOP1と入力オペランド
OP2とにより、算術演算を行う。入力オペランドOP
2には、汎用レジスタ2からのデータまたは命令制御ユ
ニット1からのデータがある。そして、算術演算ユニッ
ト3は、算術結果を汎用レジスタ2に出力する。4はシ
フトユニットで、入力オペランドOP1を入力オペラン
ドOP2のデータをもとにビットのシフトを行う。そし
て、シフトユニット4は、シフト結果を汎用レジスタ2
に出力する。
2. Description of the Related Art FIG. 8 is a block diagram showing an example of a conventional microprocessor having no bit operation circuit. In the figure, reference numeral 1 denotes an instruction control unit, which sequentially designates addresses to a storage device (not shown). Then, it fetches instructions and data from the storage device and controls the device in the microprocessor. Reference numeral 2 is a general-purpose register for storing data, 3 is an arithmetic operation unit, and arithmetic operation is performed by the input operand OP1 and the input operand OP2 which are data from the general-purpose register 2. Input operand OP
2 contains data from the general purpose register 2 or data from the instruction control unit 1. Then, the arithmetic operation unit 3 outputs the arithmetic result to the general-purpose register 2. A shift unit 4 shifts bits of the input operand OP1 based on the data of the input operand OP2. Then, the shift unit 4 outputs the shift result to the general-purpose register 2
Output to.

【0003】このような構成の装置の動作を以下に示
す。図9は図8の装置の動作説明図である。図における
ビット操作は、データの裏返し操作である。つまり、デ
ータD=d 76543210をビット単位で左右
を逆転させると以下のようになる。(D,D’:データ
(8ビット),di:データDのi番目のビットデータ
(1あるいは0)) データD’=d01234567 図において、実行ステップは命令制御ユニット1の制御
の順番、命令は命令制御ユニット1に対する命令を示し
ている。ここで、ANDは論理積、ORは論理和、SR
Rは右論理シフト、SRLは左論理シフトの命令を表
す。レジスタA,B,Cとは、汎用レジスタ2のアドレ
スを示す。そして、レジスタA,B,Cの内容とは、そ
れぞれに格納されているデータを意味する。
The operation of the device having such a configuration is shown below.
You FIG. 9 is a diagram for explaining the operation of the apparatus shown in FIG. In the figure
A bit operation is a data flip operation. That is,
Data D = d 7d6dFivedFourd3d2d1d0Left and right in bit units
It becomes as follows when is reversed. (D, D ': data
(8 bits), di: i-th bit data of data D
(1 or 0)) Data D '= d0d1d2d3dFourdFived6d7 In the figure, the execution step is the control of the instruction control unit 1.
The order, the command indicates the command to the command control unit 1.
ing. Here, AND is a logical product, OR is a logical sum, SR
R is a logical shift right instruction, and SRL is a logical shift left instruction.
You Registers A, B, and C are the addresses of general-purpose register 2.
Shows the space. And the contents of registers A, B, C
Means the data stored in each.

【0004】命令制御ユニット1は汎用レジスタ2のレ
ジスタAにデータDを格納する。そして、実行ステップ
1で、命令制御ユニット1は、算術論理ユニット3にレ
ジスタAのデータDと10000000とを送り、論理
積をとらせる。その結果を、算術論理ユニット3は汎用
レジスタ2のレジスタBに格納する。実行ステップ2に
おいて、命令制御ユニット1は、レジスタBのデータと
シフト量とをシフトユニット4に送り、レジスタBのデ
ータを右に7つシフトさせる。シフトユニット4は、シ
フトさせたデータを汎用レジスタ2のレジスタCに格納
する。実行ステップ3において、命令制御ユニット1
は、算術論理ユニット3にレジスタAのデータDと01
000000とを送り、論理積をとらせる。その結果
を、算術論理ユニット3は汎用レジスタ2のレジスタB
に格納する。実行ステップ4において、命令制御ユニッ
ト1は、レジスタBのデータとシフト量とをシフトユニ
ット4に送り、レジスタBのデータを右に5つシフトさ
せる。シフトユニット4は、シフトさせたデータを汎用
レジスタ2のレジスタBに格納する。実行ステップ5に
おいて、命令制御ユニット1は、算術論理ユニット3に
レジスタBのデータとレジスタCのデータとを送り、論
理和をとらせる。その結果を、算術論理ユニット3は汎
用レジスタ2のレジスタCに格納する。以上と同様な操
作を順次行い、全部で、23ステップを要する。
The instruction control unit 1 stores the data D in the register A of the general-purpose register 2. Then, in the execution step 1, the instruction control unit 1 sends the data D of the register A and 10000000 to the arithmetic logic unit 3 to take a logical product. The arithmetic logic unit 3 stores the result in the register B of the general-purpose register 2. In the execution step 2, the instruction control unit 1 sends the data in the register B and the shift amount to the shift unit 4, and shifts the data in the register B by 7 to the right. The shift unit 4 stores the shifted data in the register C of the general-purpose register 2. In the execution step 3, the instruction control unit 1
Is the data D and 01 of the register A in the arithmetic logic unit 3.
And 000000 are sent, and the logical product is taken. The arithmetic logic unit 3 outputs the result to the register B of the general-purpose register 2.
To store. In the execution step 4, the instruction control unit 1 sends the data in the register B and the shift amount to the shift unit 4, and shifts the data in the register B by 5 to the right. The shift unit 4 stores the shifted data in the register B of the general-purpose register 2. In the execution step 5, the instruction control unit 1 sends the data of the register B and the data of the register C to the arithmetic logic unit 3 to take the logical sum. The arithmetic logic unit 3 stores the result in the register C of the general-purpose register 2. The same operation as described above is sequentially performed, and a total of 23 steps are required.

【0005】[0005]

【発明が解決しようとする課題】このような構成のマイ
クロプロセッサでは、データの裏返し操作を行うには2
3ステップの命令をプログラムする必要がある。また、
23ステップの命令を実行すると、多くの処理時間を費
やすという問題点があった。
With the microprocessor having such a configuration, it is necessary to perform two operations to reverse the data.
It is necessary to program a three step instruction. Also,
Executing a 23-step instruction has a problem that it consumes a lot of processing time.

【0006】本発明の目的は、複数のビットにより構成
されるデータのビット操作を少ないステップ数でプログ
ラムでき、かつ、処理時間のかからないビット操作回路
を実現することにある。
An object of the present invention is to realize a bit operation circuit that can program bit operations of data composed of a plurality of bits with a small number of steps and that does not require processing time.

【0007】[0007]

【課題を解決するための手段】本発明は、Nビット
(N:偶数)で構成されるデータを格納する第1のレジ
スタと、前記データのどのビットを有効にするかどうか
を選択するNビットの選択情報を格納する第2のレジス
タと、N/2個設けられていて、それぞれは前記第2の
レジスタのいずれか1つのビットと対応していて、前記
第1のレジスタから2n番目のビットデータと2n+1
番目のビットデータとが入力され(n:0〜N/2−1
の整数)、前記第2のレジスタの対応するビットの選択
情報が、1のときは2n番目のビットと2n+1番目の
ビットの一方を選択し、0のときは他方を選択し、選択
したビットのデータを0からN/2−1番目のビットデ
ータとする第1の選択手段と、N/2個設けられてい
て、それぞれは前記第2のレジスタのいずれか1つのビ
ットと対応していて、前記第1のレジスタから2n番目
のビットデータと2n+1番目のビットデータとが入力
され、前記第2のレジスタの対応するビットの選択情報
が、1のときは2n番目のビットと2n+1番目のビッ
トの他方を選択し、0のときは一方を選択し、選択した
ビットのデータをN/2からN−1番目のビットデータ
とする第2の選択手段と、前記第1の選択手段と前記第
2の選択手段との出力を格納する第3のレジスタと、を
有することを特徴とするものである。
According to the present invention, there is provided a first register for storing data composed of N bits (N: even number) and N bits for selecting which bit of the data is valid. Second register for storing the selection information of the second register and N / 2 pieces are provided, each of which corresponds to any one bit of the second register, and the 2nth bit from the first register. Data and 2n + 1
The second bit data and is input (n: 0 to N / 2-1
Integer) of the second register, when the selection information of the corresponding bit of the second register is 1, one of the 2n-th bit and the 2n + 1-th bit is selected, and when the selection information is 0, the other is selected. First selection means for setting data to bit data 0 to N / 2−1 and N / 2 pieces of data are provided, each of which corresponds to any one bit of the second register, When the 2n-th bit data and the 2n + 1-th bit data are input from the first register and the selection information of the corresponding bit of the second register is 1, the 2n-th bit and the 2n + 1-th bit are selected. Second selecting means for selecting the other, selecting one when 0, and selecting the selected bit data as the N-1th to (N-1) th bit data, the first selecting means, and the second selecting means. Out of the means of selection A third register for storing, is characterized in that it has a.

【0008】[0008]

【作用】このような本発明では、第1の選択手段が第1
のレジスタから2n番目のビットデータと2n+1番目
のビットデータとを取り込んで、第2のレジスタの選択
情報を基に選択を行い、n(n:0〜N/2−1)番目
のビットデータとする。また、第2の選択手段が第1の
レジスタから2n番目のビットデータと2n+1番目の
ビットデータとを取り込んで、第2のレジスタの選択情
報を基に選択を行い、n+N/2(n+N/2:N/2
〜N−1)番目のビットデータとする。そして、第1の
選択手段と第2の選択手段とは、第3のレジスタにデー
タを入力する。
In the present invention as described above, the first selecting means is the first
The 2n-th bit data and the 2n + 1-th bit data are fetched from the register No. 1 and the selection is performed based on the selection information of the second register, and the n (n: 0 to N / 2−1) th bit data To do. Further, the second selection means fetches the 2n-th bit data and the 2n + 1-th bit data from the first register, and selects based on the selection information of the second register, n + N / 2 (n + N / 2 : N / 2
~ N-1) th bit data. Then, the first selecting means and the second selecting means input data to the third register.

【0009】[0009]

【実施例】以下図面を用いて本発明を説明する。図1
は、本発明のビット操作回路を用いたマイクロプロセッ
サの一実施例を示す構成図である。図8と同一のものは
同一符号を付す。図において、5はビット操作回路で、
汎用レジスタ2からデータである入力オペランドOP1
と入力オペランドOP2とにより、ビット操作を行う。
入力オペランドOP2には、汎用レジスタ2からのデー
タまたは命令制御ユニット1からのデータがある。そし
て、ビット操作回路5は、ビット操作結果を汎用レジス
タ2に出力する。
The present invention will be described below with reference to the drawings. Figure 1
FIG. 3 is a configuration diagram showing an embodiment of a microprocessor using the bit operation circuit of the present invention. The same parts as those in FIG. 8 are designated by the same reference numerals. In the figure, 5 is a bit operation circuit,
Input operand OP1 which is data from general register 2
And bit operation is performed by the input operand OP2.
The input operand OP2 has data from the general register 2 or data from the instruction control unit 1. Then, the bit manipulation circuit 5 outputs the bit manipulation result to the general-purpose register 2.

【0010】図2は図1の装置のビット操作回路5の構
成を示した図である。図において、6は8ビットで構成
されるデータを格納する第1のレジスタ、7はデータの
どのビットを有効にするかを選択する8ビットの選択情
報Sを格納する第2のレジスタである。80から83は
第1の選択手段で、それぞれ第2のレジスタ7の1つの
ビットと対応していて、第1のレジスタ6から2n番目
のビットデータと2n+1番目のビットデータとが入力
される(n:0〜3)。そして、第1の選択手段8n
は、sn=1(sn:第2のレジスタ7の選択情報Sの
n番目のビットデータ)のとき、2n番目のビットを選
択し、sn=0のとき、2n+1番目のビットを選択す
る。第1の選択手段は、選択したビットのデータを0か
ら3番目のビットデータとする。84から87は第2の
選択手段で、それぞれ第2のレジスタ7の1つのビット
に対応していて、第1のレジスタ6から2n番目のビッ
トデータと2n+1番目のビットデータとが入力され
る。そして、第2の選択手段8iは、si=0(選択情
報Sのi番目のビットデータ、i:4〜7)のとき、2
n番目のビットを選択し、si=1のとき、2n+1番
目のビットを選択する。第2の選択手段は、選択したビ
ットのデータを4から7番目のビットデータとする。9
は第1の選択手段6と第2の選択手段7との出力を格納
する第3のレジスタである。つまり、第1の選択手段8
0から83は、データの下位ビット0から3ビットのデ
ータとなる出力をする。第2の選択手段84から87
は、データの上位ビット4から7ビットのデータとなる
出力をする。
FIG. 2 is a diagram showing the configuration of the bit operating circuit 5 of the apparatus shown in FIG. In the figure, 6 is a first register for storing 8-bit data, and 7 is a second register for storing 8-bit selection information S for selecting which bit of the data is valid. Reference numerals 80 to 83 denote first selecting means, each of which corresponds to one bit of the second register 7 and receives the 2nth bit data and the 2n + 1th bit data from the first register 6 ( n: 0-3). Then, the first selection means 8n
Selects the 2n-th bit when sn = 1 (sn: the n-th bit data of the selection information S of the second register 7) and selects the 2n + 1-th bit when sn = 0. The first selecting means sets the selected bit data to the 0th to 3rd bit data. The second selection means 84 to 87 correspond to one bit of the second register 7, and the 2nth bit data and the 2n + 1th bit data are input from the first register 6. Then, the second selecting means 8i, when si = 0 (i-th bit data of the selection information S, i: 4 to 7), 2
The nth bit is selected, and when si = 1, the 2n + 1th bit is selected. The second selecting means sets the selected bit data to the 4th to 7th bit data. 9
Is a third register for storing the outputs of the first selecting means 6 and the second selecting means 7. That is, the first selection means 8
0 to 83 output the lower bits 0 to 3 bits of data. Second selection means 84 to 87
Outputs data of upper 4 bits to 7 bits of data.

【0011】図3は図2の装置の選択手段の具体的構成
を示した図である。選択手段の具体的構成は、全部同じ
なので、ここでは、選択手段80を例にして示す。図に
おいて、801はANDゲートで、オペランドデータO
P1のd0とオペランドデータOP2のs0の論理積であ
る。802はANDゲートで、オペランドデータOP1
のd1とオペランドデータOP2のs0の負論理であるN
OTゲート803を介したビットとの論理積である。8
04はORゲートで、ANDゲート801の出力とAN
Dゲート802の出力との論理和である。ここで、第2
のレジスタ7の選択情報の入力端をsとし、s=1で選
択手段の出力として選択される入力端のデータをdu
(u:整数)、s=0で選択手段の出力として選択され
る入力端のデータをdv(v:整数)とする。
FIG. 3 is a diagram showing a specific configuration of the selecting means of the apparatus shown in FIG. Since the specific configuration of the selecting means is the same in all cases, the selecting means 80 is shown here as an example. In the figure, 801 is an AND gate, which is an operand data O
It is the logical product of d 0 of P1 and s 0 of the operand data OP2. 802 is an AND gate, which is operand data OP1
Of the negative logic of d 1 of s 0 and s 0 of the operand data OP 2
It is a logical product with the bit through the OT gate 803. 8
Reference numeral 04 is an OR gate, which is the output of the AND gate 801 and AN.
It is a logical sum with the output of the D gate 802. Where the second
The input end of the selection information of the register 7 is set to s, and the data of the input end selected as the output of the selection means when s = 1 is du.
(U: integer), the data at the input terminal selected as the output of the selecting means when s = 0 is dv (v: integer).

【0012】このような装置の動作を以下で説明する。
図4は図2の装置の動作説明図である。例えば、第2の
レジスタ7の選択情報をS=00000001とする。
選択手段80〜87の入力端du,dv,sは、以下の
ようになる。 選択手段80:d0,d1,s0 選択手段81:
2,d3,s1 選択手段82:d4,d5,s2 選択手段83:
6,d7,s3 選択手段84:d1,d0,s4 選択手段85:
3,d2,s5 選択手段86:d5,d4,s6 選択手段87:
7,d6,s7 選択手段の出力は、s=1のときはdu、s=0のとき
はdvである。したがって、選択手段の出力により第3
のレジスタ9に格納されるデータは、d64 207
530となる。
The operation of such a device will be described below.
FIG. 4 is a diagram for explaining the operation of the apparatus shown in FIG. For example, the second
The selection information of the register 7 is S = 00000001.
The input terminals du, dv, s of the selection means 80-87 are as follows.
Like Selection means 80: d0, D1, S0 Selection means 81:
d2, D3, S1 Selection means 82: dFour, DFive, S2 Selection means 83:
d6, D7, S3 Selection means 84: d1, D0, SFour Selection means 85:
d3, D2, SFive Selection means 86: dFive, DFour, S6 Selection means 87:
d7, D6, S7 The output of the selecting means is du when s = 1, and when s = 0
Is dv. Therefore, the output of the selecting means causes the third
The data stored in the register 9 of6dFourd 2d0d7
dFived3d0Becomes

【0013】以下にビット操作の具体的な例を示す。 (1)ビット単位左右反転。 図5は図1の装置の動作説明図である。図において、実
行ステップは命令制御ユニット1の制御の順番、命令は
命令制御ユニット1に対する命令を示している。ここ
で、BITはビット操作の命令を表す。レジスタA,B
とは、汎用レジスタ2のアドレスを示す。そして、レジ
スタA,Bの内容とは、それぞれに格納されているデー
タを意味する。(以下の図面においても同じことを意味
する。) 命令制御ユニット1は汎用レジスタ2のレジスタAにデ
ータDを格納し、レジスタBに選択情報S=00000
000を格納する。実行ステップ1で、命令制御ユニッ
ト1は、ビット操作回路5にレジスタAのデータDとレ
ジスタBの選択情報Sとを送り、ビット操作を行わせ
る。その結果(d64207531)を、ビット
操作回路5は汎用レジスタ2のレジスタAに格納する。
そして、実行ステップ2で、命令制御ユニット1は、再
びレジスタAのデータとレジスタBの選択情報とを送
り、ビット操作を行わせる。その結果(d40 51
6273)を、ビット操作回路5は汎用レジスタ2の
レジスタAに格納する。実行ステップ3で、命令制御ユ
ニット1は、同上の操作をもう一度行うことにより、最
終結果(d01234567)を得る。このよう
に、従来例では実行ステップが23ステップ必要であっ
たのが、3ステップで行うことができるので、実行速度
が格段に早くなる。
A specific example of bit manipulation will be shown below. (1) Bitwise left / right inversion. FIG. 5 is an operation explanatory diagram of the apparatus of FIG. In the figure,
The line step is the control order of the instruction control unit 1, and the instruction is
The commands to the command control unit 1 are shown. here
Thus, BIT represents a bit manipulation instruction. Register A, B
Indicates the address of the general-purpose register 2. And cash register
The contents of Stars A and B are the data stored in each.
Means ta. (Meaning the same in the following drawings
To do. The instruction control unit 1 stores the data in the register A of the general-purpose register 2.
Data D is stored, and the selection information S = 00000 is stored in the register B.
000 is stored. In the execution step 1, the instruction control unit
1 to the bit operation circuit 5 with the data D in the register A.
Send selection information S of register B to perform bit operation.
It As a result (d6dFourd2d0d7dFived3d1), A bit
The operation circuit 5 stores it in the register A of the general-purpose register 2.
Then, in the execution step 2, the instruction control unit 1
And register A data and register B selection information.
To make bit manipulations. As a result (dFourd0d Fived1d
6d2d7d3), The bit operation circuit 5
Store in register A. In the execution step 3, the instruction control unit
The knit 1 can be
Final result (d0d1d2d3dFourdFived6d7) Get. like this
In addition, the conventional example requires 23 execution steps.
Because it can be done in 3 steps, execution speed
Will be much faster.

【0014】(2)全部のビットをd2にする。 図6は図1の装置の動作説明図である。レジスタC,D
とは、汎用レジスタ2のアドレスを示す。そして、レジ
スタC,Dの内容とは、それぞれに格納されているデー
タを意味する。(以下の図面においても同じことを意味
する。) 命令制御ユニット1は汎用レジスタ2のレジスタAにデ
ータDを格納し、レジスタB,C,Dにそれぞれ選択情
報S=00000010,01010000,0000
1111を格納する。実行ステップ1で、命令制御ユニ
ット1は、ビット操作回路5にレジスタAのデータDと
レジスタBの選択情報Sとを送り、ビット操作を行わせ
る。その結果(d64207521)を、ビット
操作回路5は汎用レジスタ2のレジスタAに格納する。
そして、実行ステップ2で、命令制御ユニット1は、再
びレジスタAのデータとレジスタCの選択情報Sとを送
り、ビット操作を行わせる。その結果(d4252
6272)を、ビット操作回路5は汎用レジスタ2の
レジスタAに格納する。実行ステップ3で、命令制御ユ
ニット1は、再びレジスタAのデータとレジスタDの選
択情報Sとを送り、ビット操作を行わせる。そして、最
終結果(d22222222)を得る。
(2) All bits are set to d 2 . FIG. 6 is a diagram for explaining the operation of the apparatus shown in FIG. Registers C and D
Indicates the address of the general-purpose register 2. The contents of the registers C and D mean the data stored in each. (This also applies to the following drawings.) The instruction control unit 1 stores the data D in the register A of the general-purpose register 2 and the selection information S = 00000010, 01010000000 in the registers B, C, and D, respectively.
1111 is stored. In the execution step 1, the instruction control unit 1 sends the data D of the register A and the selection information S of the register B to the bit operation circuit 5 to perform the bit operation. The bit manipulation circuit 5 stores the result (d 6 d 4 d 2 d 0 d 7 d 5 d 2 d 1 ) in the register A of the general-purpose register 2.
Then, in the execution step 2, the instruction control unit 1 again sends the data of the register A and the selection information S of the register C to perform the bit operation. As a result (d 4 d 2 d 5 d 2 d
The bit manipulation circuit 5 stores 6 d 2 d 7 d 2 ) in the register A of the general-purpose register 2. In the execution step 3, the instruction control unit 1 again sends the data of the register A and the selection information S of the register D to perform a bit operation. Then, the final result (d 2 d 2 d 2 d 2 d 2 d 2 d 2 d 2 ) is obtained.

【0015】(3)d2を左端にし、他を右詰め。 図7は図1の装置の動作説明図である。命令制御ユニッ
ト1は汎用レジスタ2のレジスタAにデータDを格納
し、レジスタB,C,Dにそれぞれ選択データS=00
010001,01110111,01110111を
格納する。 (2)と同じ操作を行うと以下の結果を得る。 実行ステップ1で、結果(d64217530
を得る。そして、実行ステップ2で、結果(d427
36150)を得る。実行ステップ3で、最終結
果(d27654310)を得る。
(3) Set d 2 to the left end and right-justify the others. FIG. 7 is an operation explanatory diagram of the apparatus of FIG. The instruction control unit 1 stores the data D in the register A of the general-purpose register 2, and the selection data S = 00 in the registers B, C, and D, respectively.
010001, 01110111, and 01110111 are stored. When the same operation as (2) is performed, the following results are obtained. Result of execution step 1 (d 6 d 4 d 2 d 1 d 7 d 5 d 3 d 0 )
To get Then, in the execution step 2, the result (d 4 d 2 d 7
d 3 d 6 d 1 d 5 d 0 ) is obtained. In the execution step 3, the final result (d 2 d 7 d 6 d 5 d 4 d 3 d 1 d 0 ) is obtained.

【0016】[0016]

【発明の効果】本発明によれば、ビット操作回路によ
り、Nビットデータのビットデータを選択してデータを
並び変えるので、ビット操作のステップ数が減少し、実
行速度が格段に早くなるという効果がある。
According to the present invention, since the bit manipulation circuit selects the bit data of N-bit data and rearranges the data, the number of steps of bit manipulation is reduced and the execution speed is remarkably increased. There is.

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

【図1】本発明のビット操作回路を用いたマイクロプロ
セッサの一実施例を示す構成図である。
FIG. 1 is a configuration diagram showing an embodiment of a microprocessor using a bit operation circuit of the present invention.

【図2】図1の装置のビット操作回路5の構成を示した
図である。
FIG. 2 is a diagram showing a configuration of a bit operation circuit 5 of the device shown in FIG.

【図3】図2の装置の選択手段の具体的構成を示した図
である。
FIG. 3 is a diagram showing a specific configuration of a selection unit of the apparatus shown in FIG.

【図4】図2の装置の動作説明図である。4 is an operation explanatory diagram of the apparatus of FIG. 2. FIG.

【図5】図1の装置の動作説明図である。5 is an operation explanatory view of the apparatus of FIG. 1. FIG.

【図6】図1の装置の動作説明図である。FIG. 6 is an operation explanatory diagram of the apparatus of FIG.

【図7】図1の装置の動作説明図である。7 is an operation explanatory diagram of the apparatus of FIG. 1. FIG.

【図8】ビット操作回路を持たない従来のマイクロプロ
セッサの一例を示す構成ブロック図である。
FIG. 8 is a configuration block diagram showing an example of a conventional microprocessor having no bit operation circuit.

【図9】図8の装置の動作説明図である。9 is an explanatory diagram of the operation of the apparatus in FIG.

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

5 ビット操作回路 6 第1のレジスタ 7 第2のレジスタ 9 第3のレジスタ 80〜83 第1の選択手段 84〜87 第2の選択手段 5-bit operation circuit 6 First register 7 Second register 9 Third register 80-83 First selecting means 84-87 Second selecting means

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 Nビット(N:偶数)で構成されるデー
タを格納する第1のレジスタと、 前記データのどのビットを有効にするかどうかを選択す
るNビットの選択情報を格納する第2のレジスタと、 N/2個設けられていて、それぞれは前記第2のレジス
タのいずれか1つのビットと対応していて、前記第1の
レジスタから2n番目のビットデータと2n+1番目の
ビットデータとが入力され(n:0〜N/2−1の整
数)、前記第2のレジスタの対応するビットの選択情報
が、1のときは2n番目のビットと2n+1番目のビッ
トの一方を選択し、0のときは他方を選択し、選択した
ビットのデータを0からN/2−1番目のビットデータ
とする第1の選択手段と、 N/2個設けられていて、それぞれは前記第2のレジス
タのいずれか1つのビットと対応していて、前記第1の
レジスタから2n番目のビットデータと2n+1番目の
ビットデータとが入力され、前記第2のレジスタの対応
するビットの選択情報が、1のときは2n番目のビット
と2n+1番目のビットの他方を選択し、0のときは一
方を選択し、選択したビットのデータをN/2からN−
1番目のビットデータとする第2の選択手段と、 前記第1の選択手段と前記第2の選択手段との出力を格
納する第3のレジスタと、を有することを特徴とするビ
ット操作回路。
1. A first register for storing data composed of N bits (N: an even number), and a second register for storing N-bit selection information for selecting which bit of the data is valid. And N / 2 pieces of registers are provided, each of which corresponds to one bit of the second register, and 2n-th bit data and 2n + 1-th bit data from the first register. Is input (n: an integer of 0 to N / 2−1), and when the selection information of the corresponding bit of the second register is 1, one of the 2nth bit and the 2n + 1th bit is selected, When the value is 0, the other is selected, and N / 2 pieces of first selecting means for selecting the data of the selected bit as 0 to N / 2−1th bit data are provided, and each of the second selecting means is provided. One of the registers 2n-th bit data and 2n + 1-th bit data are input from the first register and the corresponding bit selection information of the second register is 1, the 2n-th bit Of the selected bit and 2n + 1th bit are selected, and when 0, one is selected and the data of the selected bit is selected from N / 2 to N−.
A bit operation circuit comprising: a second selection means for setting the first bit data; and a third register for storing the outputs of the first selection means and the second selection means.
JP5003374A 1993-01-12 1993-01-12 Bit operation circuit Pending JPH06208454A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5003374A JPH06208454A (en) 1993-01-12 1993-01-12 Bit operation circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5003374A JPH06208454A (en) 1993-01-12 1993-01-12 Bit operation circuit

Publications (1)

Publication Number Publication Date
JPH06208454A true JPH06208454A (en) 1994-07-26

Family

ID=11555581

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5003374A Pending JPH06208454A (en) 1993-01-12 1993-01-12 Bit operation circuit

Country Status (1)

Country Link
JP (1) JPH06208454A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100847209B1 (en) * 2000-10-17 2008-07-17 엔엑스피 비 브이 Method for the selection puncturing of data bits

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100847209B1 (en) * 2000-10-17 2008-07-17 엔엑스피 비 브이 Method for the selection puncturing of data bits

Similar Documents

Publication Publication Date Title
US4074351A (en) Variable function programmed calculator
US5706483A (en) Run-time code compiler for data block transfer
US4037213A (en) Data processor using a four section instruction format for control of multi-operation functions by a single instruction
US5249148A (en) Method and apparatus for performing restricted modulo arithmetic
EP0122739B1 (en) List vector control apparatus
JPH06208454A (en) Bit operation circuit
JPH034936B2 (en)
US4974188A (en) Address sequence generation by means of reverse carry addition
JPH02162422A (en) Preference branch circuit
JPH0290349A (en) Address space controller for virtual memory system
JP3332606B2 (en) Microprocessor
JPS6260755B2 (en)
JPS59112334A (en) Sequence generator
JP2566009B2 (en) Data processing device
JPH04148372A (en) Hash value calculation processing system
JPH0588887A (en) Data processor
JP3331682B2 (en) Arithmetic unit
JPH05143326A (en) Bank processor
JP2643576B2 (en) Address generation circuit for fast Fourier transform
JPH0895781A (en) Arithmetic and logic unit of processor
JPS62237523A (en) Sorting circuit
JPH01284926A (en) Instruction reading system for arithmetic unit
JPH0566922A (en) Decimal arithmetic circuit
JPS622364A (en) Arithmetic unit
JPH06131448A (en) V-ram device and pattern matching processor using same