JP3525582B2 - Bit operation circuit - Google Patents

Bit operation circuit

Info

Publication number
JP3525582B2
JP3525582B2 JP27247595A JP27247595A JP3525582B2 JP 3525582 B2 JP3525582 B2 JP 3525582B2 JP 27247595 A JP27247595 A JP 27247595A JP 27247595 A JP27247595 A JP 27247595A JP 3525582 B2 JP3525582 B2 JP 3525582B2
Authority
JP
Japan
Prior art keywords
data
bit
input
output
line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP27247595A
Other languages
Japanese (ja)
Other versions
JPH09114640A (en
Inventor
耕治 加藤
晴継 福本
裕章 田中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP27247595A priority Critical patent/JP3525582B2/en
Publication of JPH09114640A publication Critical patent/JPH09114640A/en
Application granted granted Critical
Publication of JP3525582B2 publication Critical patent/JP3525582B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

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 for executing bit operation in a microcomputer or the like realized by an integrated circuit.

【0002】[0002]

【従来の技術】例えばCPUにおける任意の1ビット操
作とは、任意の1ビットデータに対してセット、リセッ
ト、または他の信号との論理演算、或いは複数の1ビッ
トデータのうちから任意の1ビットデータを抽出するこ
とである。
2. Description of the Related Art For example, an arbitrary 1-bit operation in a CPU is set, reset, or a logical operation with another signal for arbitrary 1-bit data, or an arbitrary 1-bit from a plurality of 1-bit data. It is to extract data.

【0003】従来より、CPUのセット、リセットに関
しては、演算処理装置(以下、ALUと称する)にて、
ソフト的手法で処理することが一般的である。例えば、
4ビットデータ“abcd”に対し、最下位1ビット
“d”をセットするには、4ビットデータ“abcd”
と4ビット定数“0001”をALUを用いてORすれ
ばよい。同様に、リセットするならば、4ビットデータ
“abcd”と4ビット定数“1110”をANDする
ことで処理できる。また、他の信号との論理演算、或い
は任意の1ビットを1ビットデータとして抽出するため
には、被演算数の各ビットを選択することができるビッ
ト選択回路と、選択されたビットに対して他の信号と論
理演算するための論理演算回路とを有する構成とするこ
とが一般的である。
Conventionally, regarding the setting and resetting of the CPU, an arithmetic processing unit (hereinafter referred to as ALU) has been used.
It is common to process by a soft method. For example,
To set the least significant 1 bit "d" for 4-bit data "abcd", 4-bit data "abcd"
And the 4-bit constant “0001” may be ORed using the ALU. Similarly, if resetting, it can be processed by ANDing the 4-bit data "abcd" and the 4-bit constant "1110". In addition, in order to perform a logical operation with another signal or to extract an arbitrary 1 bit as 1-bit data, a bit selection circuit that can select each bit of the operand and a selected bit It is common to have a configuration including a logic operation circuit for performing a logic operation with other signals.

【0004】また、被演算数の任意の1ビットに対して
論理演算するハード的手法も考えられており、その一例
として特公平5−45978号公報のものがある。この
ものは、図12に示すように、被演算数を記憶するテン
ポラリレジスタ1、アドレスデータを保持する選択レジ
スタ2、演算結果を記憶するセットリセット機能付きフ
リップフロップ3、任意ビットを選択するビット選択回
路4、論理演算回路5、前記各回路を制御する制御回路
6から構成される。
A hardware method for logically operating an arbitrary 1 bit of the operand is also considered, and an example thereof is Japanese Patent Publication No. 5-45978. As shown in FIG. 12, this is a temporary register 1 for storing the operand, a selection register 2 for holding the address data, a flip-flop 3 with a set / reset function for storing the operation result, and a bit selection for selecting an arbitrary bit. It is composed of a circuit 4, a logical operation circuit 5, and a control circuit 6 for controlling each circuit.

【0005】ここで、図12に示す実施例のデータ長は
8ビット長であり、8ビットのデータはテンポラリレジ
スタ1に保持されると共に、上位3ビットがアドレスと
して選択レジスタに保持される。ビット選択回路4は選
択レジスタの保持アドレスをデコードすることにより選
択するビットを決定し、テンポラリレジスタ1から1ビ
ットデータを取出して論理演算回路5に出力する。
Here, the data length of the embodiment shown in FIG. 12 is 8 bits, and the 8-bit data is held in the temporary register 1, and the upper 3 bits are held as an address in the selection register. The bit selection circuit 4 determines the bit to be selected by decoding the address held in the selection register, extracts 1-bit data from the temporary register 1 and outputs it to the logical operation circuit 5.

【0006】そして、論理演算回路5において、セット
リセット機能付きフリップフロップ3の出力とテンポラ
リレジスタ1から取出した1ビットデータとを用いて論
理演算を行い、その結果を必要に応じてスイッチである
NMOS7、ビット選択回路4を介してテンポラリレジ
スタ1に出力する。以上のような処理手順によって、論
理演算回路5により様々なビット操作を行うことができ
る。
Then, in the logical operation circuit 5, a logical operation is performed using the output of the flip-flop 3 with the set / reset function and the 1-bit data fetched from the temporary register 1, and the result is switched as necessary by the NMOS 7 which is a switch. , To the temporary register 1 via the bit selection circuit 4. By the processing procedure as described above, various bit operations can be performed by the logical operation circuit 5.

【0007】[0007]

【発明が解決しようとする課題】しかしながら、CPU
においてALUを用いたソフト的手法では、ビット操作
をセット・リセットのみに限定すれば、回路を追加する
ことなく実施できる点で優れているものの、他の信号と
の論理演算、或いは任意の1ビットを1ビットデータと
して抽出することは難しく、実施することができたとし
ても、回路の追加、命令の複数サイクル化が必要とな
る。このため、ビット操作命令を含んで構成されるCP
U等のパフォーマンス(能率)を低下させるという問題
がある。
However, the CPU
In the software method using the ALU, if the bit operation is limited to only set / reset, it is excellent in that it can be performed without adding a circuit, but it is a logical operation with another signal or an arbitrary 1 bit. Is difficult to extract as 1-bit data, and even if it can be implemented, it is necessary to add a circuit and make an instruction into multiple cycles. Therefore, a CP including a bit manipulation instruction
There is a problem of lowering the performance (efficiency) of U and the like.

【0008】また、ハード的手法として、ビット選択回
路、選択されたビットに対し他の信号と論理演算する論
理演算回路を被演算データの各ビット毎に有する構成で
は、1ビット毎の回路が大きくなり、レイアウト面積が
増大する問題がある。特に、特公平5−45978号公
報のものでは、テンポラリレジスタ1及びフリップフロ
ップ3を構成要素としており、データ保持を必要としな
い用途から考えると、不必要に回路が大きくなると共に
レイアウト面積が増大する問題がある。
As a hardware method, in a configuration having a bit selection circuit and a logical operation circuit for performing a logical operation on the selected bit with other signals for each bit of the data to be operated, the circuit for each bit is large. Therefore, there is a problem that the layout area increases. Particularly, in Japanese Patent Publication No. 5-45978, the temporary register 1 and the flip-flop 3 are used as constituent elements, and in view of the application that does not require data retention, the circuit becomes unnecessarily large and the layout area increases. There's a problem.

【0009】本発明は上記事情に鑑みてなされたもの
で、その目的は、ビット操作を高速に実行しながら、素
子数の増加或いはレイアウト面積の増大を抑制すること
ができるビット操作回路を提供することにある。
The present invention has been made in view of the above circumstances, and an object thereof is to provide a bit operation circuit capable of suppressing an increase in the number of elements or an increase in layout area while executing a bit operation at high speed. Especially.

【0010】[0010]

【課題を解決するための手段】請求項1の発明によれ
ば、論理演算回路は、外部から与えられる1ビットデー
タに対して被演算データとしての1,0の両方に対して
所定の論理演算を実行すると共に両方の論理演算データ
を夫々出力する。このとき、ビット選択回路は、入力線
から入力する1ビットデータが1の場合は前記論理演算
回路から出力される被演算データが1に対応した論理演
算データを選択し、0の場合は被演算データが0に対応
した論理演算データを選択して出力線に出力する。
According to a first aspect of the present invention, a logical operation circuit performs a predetermined logical operation for both 1 and 0 as operand data for 1-bit data given from the outside. Is executed and both logical operation data are output respectively. At this time, the bit selection circuit selects the logical operation data corresponding to 1 when the 1-bit data input from the input line is 1 and the operated data output from the logical operation circuit is 1; data selects the logic operation data corresponding to 0 you output to the output line.

【0011】ここで、アドレスデコーダは、入力するア
ドレスデータに基づいてビット選択回路のうちから所定
のものを択一的に選択する。すると、アドレスデコーダ
により選択されたビット選択回路は、入力線から入力す
る1ビットデータに応じて論理演算回路からの論理演算
データを選択して出力線に出力する。従って、複数のビ
ットデータのうちの1ビットデータに対して1サイクル
で高速に論理演算を実行することができる。
Here, the address decoder selectively selects a predetermined one of the bit selection circuits based on the input address data. Then, the bit selection circuit selected by the address decoder selects the logical operation data from the logical operation circuit according to the 1-bit data input from the input line and outputs it to the output line. Therefore, a logical operation can be executed at high speed for one bit data of a plurality of bit data in one cycle.

【0012】請求項2の発明によれば、論理演算回路
は、ビット抽出命令を受けたときは論理演算データとし
て1及び0を夫々を出力する。このとき、アドレス選択
回路により選択されたビット選択回路は、入力線から入
力する1ビットデータを抽出データ線に出力する。ま
た、入力線から入力する1ビットデータが1のときは論
理演算開路から出力される1を選択し、0のときは0を
選択して出力する。
According to the second aspect of the invention , the logical operation circuit outputs 1 and 0 as logical operation data when receiving the bit extraction instruction. At this time, the bit selection circuit selected by the address selection circuit outputs the 1-bit data input from the input line to the extraction data line. When the 1-bit data input from the input line is 1, 1 output from the logical operation circuit is selected, and when 0, 0 is selected and output.

【0013】一方、アドレス選択回路により選択されな
かったビット選択回路は、入力線から入力する1ビット
データを出力線に出力すると共に抽出データ線を遮断す
る。ここで、各ビット選択回路の抽出データ線は全て1
本の抽出データ出力線に接続されているので、入力線か
ら入力する複数ビットデータのうちの任意の1ビットデ
ータを抽出データ出力線から抽出することができる。
On the other hand, the bit selection circuit not selected by the address selection circuit outputs the 1-bit data input from the input line to the output line and shuts off the extraction data line. Here, all the extracted data lines of each bit selection circuit are 1
Since it is connected to the extracted data output line of the book, it is possible to extract arbitrary 1-bit data of the plurality of bit data input from the input line from the extracted data output line.

【0014】[0014]

【発明の実施の形態】本発明を図1を参照して説明す
る。図1は本発明の基本構成を示している。この図1
は、複数ビットのビット操作回路を示すものであり、信
号線としては、複数ビットデータを並列入力する入力線
11、この入力線11に対応して設けられ複数ビットデ
ータを並列出力する出力線12、nビットのアドレス線
13、選択された1ビットの論理演算内容を決定するm
ビットの論理演算制御線14、選択された1ビットと共
に論理演算される1ビットデータを入力する論理演算入
力線15が設けられている。
DETAILED DESCRIPTION OF THE INVENTION The present invention will be described with reference to FIG. FIG. 1 shows the basic configuration of the present invention. This Figure 1
Shows a bit operation circuit for a plurality of bits, and as a signal line, an input line 11 for inputting a plurality of bits of data in parallel, and an output line 12 provided corresponding to the input line 11 for outputting a plurality of bits of data in parallel. , N-bit address line 13, m for deciding the content of the selected 1-bit logical operation
A bit logical operation control line 14 and a logical operation input line 15 for inputting 1-bit data to be logically operated with the selected 1 bit are provided.

【0015】また、上記各信号線に接続された回路とし
ては、入力線11と出力線12との間に介在された複数
のビット選択回路16、アドレス線13と接続されたア
ドレスレコーダ17、論理演算制御線14及び論理演算
入力線15と接続された論理演算回路18が設けられて
いる。
The circuits connected to the signal lines include a plurality of bit selection circuits 16 interposed between the input line 11 and the output line 12, an address recorder 17 connected to the address line 13, and a logic. A logic operation circuit 18 connected to the operation control line 14 and the logic operation input line 15 is provided.

【0016】論理演算回路18は、論理演算入力線15
から被演算データとして入力する1ビットデータと被演
算データとしての“1”及び“0”を論理演算制御線1
4で決定された論理演算により演算するもので、論理演
算結果を演算結果ノード19として各ビット選択回路1
6に出力する。この場合、演算結果ノード19は、論理
演算入力線15から入力する1ビットデータと“1”と
の論理演算結果を示す演算結果1ノードと1ビットデー
タと“0”との論理演算結果を示す演算結果0ノードと
からなる。
The logical operation circuit 18 includes a logical operation input line 15
1-bit data to be input as data to be operated from and "1" and "0" as data to be operated are logical operation control line 1
The operation is performed by the logical operation determined in step 4, and the logical operation result is used as the operation result node 19 for each bit selection circuit 1
Output to 6. In this case, the operation result node 19 shows the result of the logical operation of the 1-bit data input from the logical operation input line 15 and "1", and the result of the operation 1 node, the 1-bit data and the logical operation result of "0". Computation result 0 node.

【0017】アドレスデコーダ17はnビットのアドレ
スデータをデコードし、各ビット選択回路16と接続さ
れたビット選択ノードのうちの1つのみをセットし、他
のビット選択ノードをリセットする。
The address decoder 17 decodes n-bit address data, sets only one of the bit selection nodes connected to each bit selection circuit 16, and resets the other bit selection nodes.

【0018】ビット選択回路16は、アドレスレコーダ
17からのビット選択ノード20がセットされたときは
対応する入力線11から入力する1ビットデータが
“1”か“0”かに応じて論理演算回路18からの演算
結果1ノード若しくは演算結果0ノードを選択し、選択
した演算結果1ノード若しくは演算結果0ノードを入力
線11からの入力データに代えて出力線12から出力す
る。つまり入力ビットが“1”の場合は演算結果1ノー
ドが出力線12から出力され、入力ビットが“0”の場
合は演算結果0ノードが出力線12から出力される。こ
の場合、アドレスレコーダ17からのビット選択ノード
20がリセットされているビット選択回路16は、入力
線11からの入力データを出力線12に出力する。
When the bit selection node 20 from the address recorder 17 is set, the bit selection circuit 16 operates according to whether the 1-bit data input from the corresponding input line 11 is "1" or "0". The operation result 1 node or operation result 0 node from 18 is selected, and the selected operation result 1 node or operation result 0 node is output from the output line 12 instead of the input data from the input line 11. That is, when the input bit is "1", the operation result 1 node is output from the output line 12, and when the input bit is "0", the operation result 0 node is output from the output line 12. In this case, the bit selection circuit 16 from which the bit selection node 20 from the address recorder 17 is reset outputs the input data from the input line 11 to the output line 12.

【0019】従って、論理演算回路18が被演算データ
としての1ビットデータと“1”及び“0”との論理演
算を実行すると同時に、ビット選択回路16が入力線1
1から入力する被演算データとしての1ビットデータに
応じて論理演算回路18からの論理結果ノード19を選
択して出力線12に出力するので、1ビットデータの入
出力動作と論理演算動作という2つの動作を高速に実行
することができる。従って、任意の入力線11から入力
した1ビットデータに対する論理演算を1サイクルで完
了することができる。
Therefore, at the same time the logical operation circuit 18 executes the logical operation of 1-bit data as the data to be operated and "1" and "0", the bit selection circuit 16 causes the input line 1 to operate.
Since the logical result node 19 from the logical operation circuit 18 is selected and output to the output line 12 in accordance with the 1-bit data as the data to be input inputted from 1, the 1-bit data input / output operation and the logical operation operation One operation can be executed at high speed. Therefore, the logical operation for 1-bit data input from the arbitrary input line 11 can be completed in one cycle.

【0020】次に、本発明の第1実施例を図2乃至図8
を参照して説明する。図2は4ビットのビット操作回路
を示すものであり、図1に示す構成と同一部分には同一
符号を付して説明を省略する。このビット操作回路はC
PUの論理回路として構成されている。ここで、入力線
11は、一般的にはレジスタファイルの出力(リードさ
れたデータが出力されるバス)に接続されている。ま
た、出力線12は、ALUの一方の入力に接続されてい
るが、CPUの構成により一概には規定されない。
Next, a first embodiment of the present invention will be described with reference to FIGS.
Will be described with reference to. FIG. 2 shows a 4-bit bit operation circuit. The same parts as those shown in FIG. This bit manipulation circuit is C
It is configured as a PU logic circuit. Here, the input line 11 is generally connected to the output of the register file (the bus to which the read data is output). Further, although the output line 12 is connected to one input of the ALU, it is not unconditionally specified depending on the configuration of the CPU.

【0021】一方、論理演算入力線15からはフラグ
(オーバーフロー、キャリー、ネガティブ、ゼロ等)、
或いはイミーデート(オペランドから直接入力されるデ
ータ)が入力されるが、CPUの構成により一概に規定
されない。尚、入力線11及び出力線12と接続される
回路、並びに論理演算入力線15から入力されるデータ
は一例であり、それらに規定されるものではない。
On the other hand, from the logical operation input line 15, flags (overflow, carry, negative, zero, etc.),
Alternatively, an immediate date (data directly input from the operand) is input, but it is not generally defined depending on the CPU configuration. The circuits connected to the input line 11 and the output line 12 and the data input from the logical operation input line 15 are examples, and are not limited to these.

【0022】さて、入力線11は4ビットデータを並列
入力するために4本、出力線12は4ビットデータを並
列出力するために4本、アドレス線は4ビットのうちの
1ビットを選択するために2本、論理演算制御線14は
複数の論理演算内容から1つの論理演算内容を決定する
ために2本設けられている。
The input line 11 selects four to input 4-bit data in parallel, the output line 12 selects four to output 4-bit data in parallel, and the address line selects 1 bit out of 4 bits. Therefore, two logical operation control lines 14 are provided to determine one logical operation content from a plurality of logical operation contents.

【0023】この場合、アドレスデコーダ17は2ビッ
トのアドレスデータをデコードすることにより4個のビ
ット選択ノード20のうちの1つをセットする。ビット
選択回路16は、アドレスデコーダ17からのビット選
択ノードがセットされている場合は、対応する入力線1
1からのデータに代えて論理演算回路18からの演算結
果ノード19を選択して出力線12から出力する。
In this case, the address decoder 17 sets one of the four bit selection nodes 20 by decoding the 2-bit address data. When the bit selection node from the address decoder 17 is set, the bit selection circuit 16 receives the corresponding input line 1
Instead of the data from 1, the operation result node 19 from the logical operation circuit 18 is selected and output from the output line 12.

【0024】次に上記各回路について説明する。図3及
び図4はビット選択回路16の一例を示している。これ
らの図3及び図4において、ビット選択回路16には、
入力線11及び出力線12が接続されていると共に、ビ
ット選択ノード20、演算結果1ノード19a及び演算
結果0ノード19bが接続されている。
Next, each of the above circuits will be described. 3 and 4 show an example of the bit selection circuit 16. In FIGS. 3 and 4, the bit selection circuit 16 includes:
The input line 11 and the output line 12 are connected, and the bit selection node 20, the operation result 1 node 19a, and the operation result 0 node 19b are connected.

【0025】ここで、ビット選択回路16は、演算結果
セレクタ21及び出力セレクタ22から構成されてい
る。演算結果セレクタ21は2個のアナログスイッチ2
3及び1個のインバータ24から構成されており、入力
線11からの入力ビットデータが“1”の場合は演算結
果1ノード19aを演算結果ノード25に接続し、
“0”の場合は演算結果0ノード19bを演算結果ノー
ド25に接続する。
The bit selection circuit 16 is composed of a calculation result selector 21 and an output selector 22. The calculation result selector 21 includes two analog switches 2
When the input bit data from the input line 11 is "1", the operation result 1 node 19a is connected to the operation result node 25.
In the case of "0", the operation result 0 node 19b is connected to the operation result node 25.

【0026】また、出力セレクタ22は2個のアナログ
スイッチ26及び1個のインバータ27から構成されて
おり、ビット選択ノード20が“1”、即ちこのビット
選択回路16が選択されている場合は演算結果セレクタ
21の出力である演算結果ノード25を出力線12に接
続し、ビット選択ノード20が“0”、即ちこのビット
選択回路16が選択されていない場合は入力線11を出
力線12に接続するので、入力線11から入力する1ビ
ットデータが出力線12に出力される。
The output selector 22 is composed of two analog switches 26 and one inverter 27, and operates when the bit selection node 20 is "1", that is, when the bit selection circuit 16 is selected. The operation result node 25 which is the output of the result selector 21 is connected to the output line 12, and the input line 11 is connected to the output line 12 when the bit selection node 20 is "0", that is, when the bit selection circuit 16 is not selected. Therefore, 1-bit data input from the input line 11 is output to the output line 12.

【0027】従って、アドレスデコーダ17により選択
されたビット選択回路16は、入力線11から入力する
1ビットデータが“1”の場合は演算結果1ノード19
aを出力線12に出力し、“0”の場合は演算結果0ノ
ード19bを出力線12に出力する。
Therefore, the bit selection circuit 16 selected by the address decoder 17 outputs the operation result 1 node 19 when the 1-bit data input from the input line 11 is "1".
a is output to the output line 12, and when it is "0", the operation result 0 node 19b is output to the output line 12.

【0028】図5及び図6はアドレスデコーダ17の一
例を示している。これらの図5及び図6において、アド
レスレコーダ17には2本のアドレス線13が接続され
ている。このアドレスレコーダ17は、4個の2入力N
OR28と2個のインバータ29とから構成される。2
入力NOR28は、全ての入力が“0”の場合のみ出力
を“1”とし、それ以外は全て出力を“0”とするの
で、2ビットのアドレス線13のうち図中の上側のアド
レス線13が“1”、下側のアドレス線13が“0”の
場合はNOR28の出力線のうち図示左から2本目のみ
が“1”を出力する。
FIGS. 5 and 6 show an example of the address decoder 17. In FIG. 5 and FIG. 6, two address lines 13 are connected to the address recorder 17. This address recorder 17 has four 2-input N
It is composed of an OR 28 and two inverters 29. Two
The input NOR 28 sets the output to “1” only when all the inputs are “0”, and sets the outputs to “0” in all other cases. Therefore, of the 2-bit address lines 13, the upper address line 13 in the figure is used. Is "1" and the lower address line 13 is "0", only the second line from the left of the NOR 28 output lines outputs "1".

【0029】図7及び図8は論理演算回路18の一例を
示している。これらの図7及び図8において、論理演算
回路18はAND回路30及びOR回路31から構成さ
れている。AND回路30は2個のアナログスイッチ3
2と1個のインバータ33とから構成されており、図示
上側の論理演算制御線14が“1”の場合はアナログス
イッチ32がオンすることによりANDを実行すること
ができる。また、OR回路31は2個のアナログスイッ
チ34と1個のインバータ35とから構成されており、
図示下側の論理演算制御線14が“1”の場合はアナロ
グスイッチ34がオンすることによりORを実行するこ
とができる。
7 and 8 show an example of the logical operation circuit 18. 7 and 8, the logical operation circuit 18 is composed of an AND circuit 30 and an OR circuit 31. The AND circuit 30 has two analog switches 3
It is composed of two and one inverter 33. When the logical operation control line 14 on the upper side in the figure is "1", AND can be executed by turning on the analog switch 32. Further, the OR circuit 31 is composed of two analog switches 34 and one inverter 35,
When the logical operation control line 14 on the lower side of the drawing is "1", the OR can be executed by turning on the analog switch 34.

【0030】ここで、論理演算入力線15に対するもう
一方の被演算データである入力線11からの入力データ
は“1”若しくは“0”であるので、論理演算回路18
は、入力データを1,0と仮定し、論理演算入力線15
から入力する1ビットデータと“1”及び“0”とを先
見的に同時に演算する。従って、論理演算回路18から
の出力は2出力となり、入力データを“1”と仮定した
場合の結果を演算結果1ノード19a、“0”と仮定し
た結果を演算結果0ノード19bとする。
Here, since the input data from the input line 11 which is the other processed data to the logical operation input line 15 is "1" or "0", the logical operation circuit 18
Assumes that the input data is 1, 0, the logical operation input line 15
The 1-bit data input from and the "1" and "0" are prospectively simultaneously calculated. Therefore, the output from the logical operation circuit 18 is two, and the result assuming that the input data is "1" is the operation result 1 node 19a, and the result assuming that the input data is "0" is the operation result 0 node 19b.

【0031】この場合、入力線11からの入力データを
1,0と仮定するため、論理演算回路18の構成を簡素
化することができる。つまり、例えば論理演算としてA
NDを実行する場合、入力データが“0”と仮定すれ
ば、もう一方の被演算データがいかなる値でも演算結果
は“0”となり、入力データが“1”と仮定すれば、も
う一方の被演算データが演算結果となる。
In this case, since the input data from the input line 11 is assumed to be 1,0, the structure of the logical operation circuit 18 can be simplified. That is, for example, as a logical operation A
When performing ND, if the input data is assumed to be "0", the operation result is "0" regardless of the value of the other operated data, and if the input data is assumed to be "1", the other operated data is processed. The calculation data is the calculation result.

【0032】同様に、論理演算としてORを実行する場
合は、入力データが“0”と仮定すれば、もう一方の被
演算データが演算結果となり、入力データが“1”と仮
定すれば、“1”が演算結果となる。
Similarly, when OR is executed as a logical operation, if the input data is assumed to be "0", the other operated data becomes the operation result, and if the input data is assumed to be "1", " 1 ”is the calculation result.

【0033】従って、全てのデータを先見的に論理演算
を実行する場合は、論理演算回路18は通常の2倍の演
算回路を必要とするのが一般的であるが、前記のように
論理演算回路18を論理的に簡素化できるため、回路規
模としては先見しない場合とほぼ同程度に抑制すること
ができる。
Therefore, when performing logical operation on all data in advance, the logical operation circuit 18 generally requires twice the normal operation circuit, but as described above, the logical operation is required. Since the circuit 18 can be logically simplified, the circuit scale can be suppressed to almost the same level as in the case of not looking ahead.

【0034】次に、作用の一例として入力線11からの
4ビット目のデータをセットする場合を説明する。尚、
論理演算回路18の回路例である図は、この説明の内
容に該当しない。CPUがメモリに記憶されている命令
を読取って図示しないデコーダにラッチすると、デコー
ダは、入力線の4ビット目を指し示すアドレスをアドレ
スデコーダ17へ渡すと共に、データをセットする指示
を論理演算回路18へ渡す。
Next, as an example of the operation, the case of setting the 4th bit data from the input line 11 will be described. still,
FIG. 8 , which is a circuit example of the logical operation circuit 18, does not correspond to the contents of this description. When the CPU reads the instruction stored in the memory and latches it in a decoder (not shown), the decoder passes an address indicating the 4th bit of the input line to the address decoder 17, and at the same time issues an instruction to set data to the logical operation circuit 18. hand over.

【0035】すると、アドレスデコーダ17は、アドレ
スから4ビット目のビット選択回路16へのビット選択
ノード20のみセットし、それ以外のビットのビット選
択ノード20をリセットする。また、同時に、論理演算
回路18は、論理演算制御線14による指示に応じて入
力線11からの入力する1ビットデータを“1”若しく
は“0”と夫々仮定した2つの論理演算を実行すると共
に、2つの演算結果ノード19a,19bを出力する。
ここでの論理演算では、2つの演算結果ノード19a,
19bを共に“1”とする。
Then, the address decoder 17 sets only the bit selection node 20 from the address to the bit selection circuit 16 of the 4th bit, and resets the bit selection nodes 20 of the other bits. At the same time, the logical operation circuit 18 executes two logical operations assuming that 1-bit data input from the input line 11 is “1” or “0”, respectively, according to an instruction from the logical operation control line 14. Two operation result nodes 19a and 19b are output.
In the logical operation here, two operation result nodes 19a,
Both 19b are set to "1".

【0036】さらに、同時に、4ビット目のビット選択
回路16は、入力線11からの入力データ“1”若しく
は“0”に応じて演算結果1ノード19a若しくは演算
結果0ノード19bを択一的に選択して出力線12に出
力する。つまり、入力線11からの入力データが“1”
の場合は演算結果1ノード19aを出力線12に接続
し、入力データが“0”の場合は演算結果0ノード19
bを出力線12に接続する。この場合、4ビット目以外
のビット選択回路16は、入力線11を出力線12に接
続する。以上の動作により、入力線11のうちの4ビッ
ト目に入力する1ビットデータのみをセットした状態で
出力線12から出力することができる。
Further, at the same time, the bit selection circuit 16 of the 4th bit selectively selects the operation result 1 node 19a or the operation result 0 node 19b according to the input data "1" or "0" from the input line 11. It is selected and output to the output line 12. That is, the input data from the input line 11 is "1".
In the case of, the operation result 1 node 19a is connected to the output line 12, and when the input data is “0”, the operation result 0 node 19
b is connected to the output line 12. In this case, the bit selection circuits 16 other than the 4th bit connect the input line 11 to the output line 12. With the above operation, it is possible to output from the output line 12 only the 1-bit data input to the 4th bit of the input line 11 is set.

【0037】上記構成のものによれば、CPUのデコー
ダが命令を解読するサイクルに続くサイクルで、アドレ
スデコーダ17、論理演算回路18及びビット選択回路
16が同時に動作するので、ビット操作を1サイクルで
実行することが可能となる。換言すれば、アドレスデコ
ーダ17、論理演算回路18及びビット選択回路16は
データの入力タイミングで出力結果が決定されるセレク
タのように機能させることができる。
According to the above configuration, since the address decoder 17, the logical operation circuit 18 and the bit selection circuit 16 operate simultaneously in the cycle following the cycle in which the decoder of the CPU decodes the instruction, the bit operation is performed in one cycle. It becomes possible to execute. In other words, the address decoder 17, the logical operation circuit 18, and the bit selection circuit 16 can function as a selector whose output result is determined by the data input timing.

【0038】図9乃至図11は本発明の第2実施例を示
しており、第1実施例と同一部分には同一符号を付して
説明を省略する。この第2実施例は、入力線11からの
入力データのうち被演算データとして選択された入力デ
ータを1ビットデータとして抽出して出力する機能を付
加したことを特徴とする。
9 to 11 show a second embodiment of the present invention, in which the same parts as those in the first embodiment are designated by the same reference numerals and the description thereof will be omitted. The second embodiment is characterized in that a function of extracting the input data selected as the data to be operated among the input data from the input line 11 as 1-bit data and outputting the 1-bit data is added.

【0039】図9及び図10はビット選択回路16を示
している。これらの図9及び図10において、ビット選
択回路16は、1ビットデータの出力機能を付加して構
成されている。即ち、出力セレクタ22にアナログスイ
ッチ36を新規に設け、アナログスイッチ36がオンし
た状態で入力線11からの入力データを1ビットデータ
の抽出データ線37に出力する。このアナログスイッチ
36はビット選択ノード20に応じてオンオフするの
で、ビット選択ノード20が“1”となることにより選
択されたビット選択回路16では、アナログスイッチ3
6がオンして入力線11からの入力データが抽出データ
線37に出力される。また、選択されていないビット選
択回路16では、アナログスイッチ36がオフして抽出
データ線37は遮断状態(ハイインピーダンス)にな
る。
9 and 10 show the bit selection circuit 16. 9 and 10, the bit selection circuit 16 is configured by adding a 1-bit data output function. That is, an analog switch 36 is newly provided in the output selector 22 and the input data from the input line 11 is output to the 1-bit data extraction data line 37 while the analog switch 36 is turned on. Since the analog switch 36 is turned on / off according to the bit selection node 20, in the bit selection circuit 16 selected when the bit selection node 20 becomes "1", the analog switch 3
6 is turned on, and the input data from the input line 11 is output to the extracted data line 37. Further, in the bit selection circuit 16 which is not selected, the analog switch 36 is turned off and the extraction data line 37 is turned off (high impedance).

【0040】図11において、各ビット選択回路16の
抽出データ線37は全て抽出データ出力線38に接続さ
れており、1ビットデータとして抽出データ出力線38
から出力されている。従って、抽出データ出力線38に
は、選択されたビット選択回路16に対応する入力線1
1から入力する1ビットデータが出力されるので、入力
線11からの入力する複数の1ビットデータのうちの任
意の1ビットデータを抽出することができる。
In FIG. 11, the extracted data lines 37 of each bit selection circuit 16 are all connected to the extracted data output line 38, and the extracted data output line 38 is 1-bit data.
Is output from. Therefore, the extracted data output line 38 is connected to the input line 1 corresponding to the selected bit selection circuit 16.
Since the 1-bit data input from 1 is output, any 1-bit data can be extracted from the plurality of 1-bit data input from the input line 11.

【0041】次に、演算動作の一例として、図11に基
づいて入力線11からの入力データのうちの4ビット目
のデータを抽出する場合を説明する。ビット選択回路1
6としては図10に示す回路を用いる。
Next, as an example of the arithmetic operation, the case of extracting the 4th bit data of the input data from the input line 11 will be described with reference to FIG. Bit selection circuit 1
The circuit shown in FIG. 10 is used as 6.

【0042】図示しないデコーダが4ビット目のデータ
抽出を実行する命令を読込むと、デコーダは、入力線1
1の4ビット目を指し示すアドレスをアドレスデコーダ
17へ渡すと共に、データをスルーする指示を論理演算
回路18へ渡す。すると、アドレスデコーダ17は、ア
ドレスから4ビット目のビット選択回路16へのビット
選択ノード20のみをセットし、それ以外のビットのビ
ット選択ノード20をリセットする。同時に論理演算回
路18では、論理演算制御線14による指示に応じて選
択ビットを“1”,“0”と夫々仮定した2つの演算結
果ノード19a,19bを夫々“1”,“0”とする。
When a decoder (not shown) reads an instruction to execute the data extraction of the 4th bit, the decoder reads the input line 1
An address indicating the 4th bit of 1 is passed to the address decoder 17, and an instruction to pass data is passed to the logical operation circuit 18. Then, the address decoder 17 sets only the bit selection node 20 from the address to the bit selection circuit 16 of the fourth bit, and resets the bit selection nodes 20 of the other bits. At the same time, in the logical operation circuit 18, the two operation result nodes 19a and 19b, which assume that the selected bits are "1" and "0", respectively, are set to "1" and "0" in response to the instruction from the logical operation control line 14, respectively. .

【0043】さらに、4ビット目のビット選択回路16
は、入力線11からの入力データが“1”か“0”かに
応じて2つの演算結果ノード19a,19bを選択して
出力線12に出力する。つまり、入力が1の場合は1を
仮定した側の演算結果1ノード19aを選択して出力す
るので1となり、入力が0の場合は0を仮定した側の演
算結果0ノード19bを選択して出力するので0とな
る。即ち、入力線11からの入力データを出力線12に
スルーしたのと同義となる。
Further, the bit selection circuit 16 for the fourth bit
Selects two operation result nodes 19a and 19b according to whether the input data from the input line 11 is "1" or "0" and outputs them to the output line 12. In other words, when the input is 1, the operation result 1 node 19a on the side assuming 1 is selected and output, so that it becomes 1. When the input is 0, the operation result 0 node 19b on the side assuming 0 is selected. It is 0 because it is output. That is, it is synonymous with passing the input data from the input line 11 to the output line 12.

【0044】このとき、ビット選択ノード20により選
択された4ビット目のビット選択回路16は、アナログ
スイッチ36を介して入力データを抽出データ線37に
出力する。また、4ビット目以外のビット選択回路16
では、入力線11のデータを出力線12に出力する。
At this time, the bit selection circuit 16 for the fourth bit selected by the bit selection node 20 outputs the input data to the extracted data line 37 via the analog switch 36. The bit selection circuit 16 other than the 4th bit
Then, the data of the input line 11 is output to the output line 12.

【0045】以上の動作の結果、入力線11からの入力
データが出力線12に出力データとして出力されると同
時に、4ビット目の1ビットデータが抽出データ出力線
38から出力される。
As a result of the above operation, the input data from the input line 11 is output to the output line 12 as output data, and at the same time, the 1-bit data of the fourth bit is output from the extracted data output line 38.

【0046】このようにして抽出された1ビットデータ
の利用方法としては、例えば内部バス32ビットのCP
Uにおいて、特定のレジスタが各種外部装置の所定の状
態を“1”若しくは“0”で表していると仮定した場合
には、この特定のレジスタは32個の外部装置に関する
状態を表現することができるので、例えば24ビット目
に相当する装置の状態に応じて特定の処理を実行するに
は、32ビットのデータの中から24ビット目の1ビッ
トデータを抽出し、その抽出した1ビットデータに応じ
て条件分岐等の命令を用いて処理する。換言すれば、抽
出したビットデータは、フラグのように利用することが
できる。
As a method of using the 1-bit data extracted in this way, for example, a CP of 32-bit internal bus is used.
In U, assuming that a specific register represents a predetermined state of various external devices by "1" or "0", this specific register may represent the states of 32 external devices. Therefore, for example, in order to execute a specific process according to the state of the device corresponding to the 24th bit, the 1st bit data of the 24th bit is extracted from the 32bit data, and the extracted 1bit data is converted into the extracted 1bit data. Accordingly, processing is performed using an instruction such as a conditional branch. In other words, the extracted bit data can be used like a flag.

【0047】本発明は、上記実施例に限定されるもので
はなく、次のように変形または拡張できる。入力線11
及び出力線12を1本ずつ設け、それに対応してビット
選択回路16を1個だけ設けた上で、アドレスデコーダ
17を省略するようにしてもよい。CPU以外のICに
適用するようにしてもよい。
The present invention is not limited to the above embodiment, but can be modified or expanded as follows. Input line 11
Alternatively, the address decoder 17 may be omitted after providing one output line 12 and one output selection line 12 correspondingly. You may make it apply to IC other than CPU.

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

【図1】本発明の基本構成を示すブロック図FIG. 1 is a block diagram showing the basic configuration of the present invention.

【図2】本発明の第1実施例を示す図1相当図FIG. 2 is a view corresponding to FIG. 1 showing a first embodiment of the present invention.

【図3】ビット選択回路を示すブロック図FIG. 3 is a block diagram showing a bit selection circuit.

【図4】ビット選択回路の構成を示す電気回路図FIG. 4 is an electric circuit diagram showing a configuration of a bit selection circuit.

【図5】アドレスデコーダを示すブロック図FIG. 5 is a block diagram showing an address decoder.

【図6】アドレスデコーダの構成を示す電気回路図FIG. 6 is an electric circuit diagram showing a configuration of an address decoder.

【図7】論理演算回路を示すブロック図FIG. 7 is a block diagram showing a logical operation circuit.

【図8】論理演算回路の構成を示す電気回路図FIG. 8 is an electric circuit diagram showing a configuration of a logical operation circuit.

【図9】本発明の第2実施例を示す図3相当図FIG. 9 is a view corresponding to FIG. 3 showing a second embodiment of the present invention.

【図10】図4相当図FIG. 10 is a view corresponding to FIG.

【図11】図2相当図FIG. 11 is a view corresponding to FIG.

【図12】従来例を示す図2相当図FIG. 12 is a view corresponding to FIG. 2 showing a conventional example.

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

11は入力線、12は出力線、16はビット選択回路、
17はアドレスデコーダ、18は論理演算回路、37は
抽出データ線、38は抽出データ出力線である。
11 is an input line, 12 is an output line, 16 is a bit selection circuit,
Reference numeral 17 is an address decoder, 18 is a logical operation circuit, 37 is an extracted data line, and 38 is an extracted data output line.

フロントページの続き (56)参考文献 特開 平3−129425(JP,A) 特開 平7−160498(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 7/00 Continuation of the front page (56) Reference JP-A-3-129425 (JP, A) JP-A-7-160498 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB name) G06F 7 / 00

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 1ビットデータが入力する入力線と、1
ビットデータを出力する出力線とを備え、前記入力線か
ら入力する1ビットデータと外部から与えられる1ビッ
トデータとを論理演算した論理演算データを前記出力線
に出力するビット操作回路において、前記入力線及び出力線は複数本設けられていると共に、
前記ビット選択回路は前記入力線及び出力線に対応して
複数設けられ、 外部から与えられる1ビットデータに対して被演算デー
タとしての1,0の両方に対して所定の論理演算を実行
すると共に両方の論理演算データを夫々出力する論理演
算回路と、入力するアドレスデータに基づいて前記ビット選択回路
のうちから所定のものを択一的に選択するアドレスデコ
ーダと、 このアドレスデコーダにより選択された状態で 前記入力
線から入力する1ビットデータが1の場合は前記論理演
算回路から出力される被演算データが1に対応した論理
演算データを選択し、0の場合は被演算データが0に対
応した論理演算データを選択して前記出力線に出力する
と共に、選択されない場合は前記入力線から入力する1
ビットデータを前記出力線に出力するビット選択回路と
を備えたことを特徴とするビット操作回路。
1. An input line for inputting 1-bit data and 1
And an output line for outputting the bit data, the bit manipulation circuit for outputting a logical operation data logical operation and one bit data supplied from the 1-bit data and the external input from the input line to the output line, said input There are multiple lines and output lines,
The bit selection circuit corresponds to the input line and the output line.
A plurality of 1-bit data externally applied, which performs a predetermined logical operation on both 1 and 0 as the operand data and outputs both logical operation data, and an input. The bit selection circuit based on the address data
Address deco that selectively selects a predetermined one from among
And 1-bit data input from the input line in a state of being selected by the address decoder, the logical operation data output from the logical operation circuit selects the logical operation data corresponding to 1. If it is 0, the logical operation data corresponding to 0 is selected and output to the output line.
At the same time, if not selected, input from the input line 1
And a bit selection circuit for outputting bit data to the output line .
【請求項2】 前記論理演算回路は、ビット抽出命令を
受けたときは論理演算データとして1及び0を夫々出力
するように構成され、 前記ビット選択回路は、前記アドレスデコーダにより選
択された場合は前記入力線から入力する1ビットデータ
を抽出データ線に出力すると共に前記入力線から入力す
る1ビットデータが1のときは前記論理演算回路から出
力される1を選択し、0のときは0を選択して前記出力
線に出力し、且つ選択されない場合は前記入力線から入
力する1ビットデータを前記出力線に出力すると共に抽
出データ線を遮断状態(ハイインピーダンス)とするよ
うに構成され、 前記各ビット選択回路からの抽出データ線を全て1本の
抽出データ出力線に接続したことを特徴とする 請求項1
記載のビット操作回路。
2. The logic operation circuit executes a bit extraction instruction.
When received, outputs 1 and 0 respectively as logical operation data
The bit selection circuit is selected by the address decoder.
1-bit data input from the input line when selected
To the extracted data line and input from the input line
When the 1-bit data is 1, the output from the logical operation circuit
Output 1 by selecting 1 to be applied and 0 when 0
Output to the input line, and input from the input line if not selected.
The 1-bit data to be output is output to the output line and extracted.
The output data line is cut off (high impedance).
Configured urchin, the all one extraction data lines from the bit selection circuit
The output data output line is connected to the extraction data output line.
The described bit operation circuit.
JP27247595A 1995-10-20 1995-10-20 Bit operation circuit Expired - Fee Related JP3525582B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27247595A JP3525582B2 (en) 1995-10-20 1995-10-20 Bit operation circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27247595A JP3525582B2 (en) 1995-10-20 1995-10-20 Bit operation circuit

Publications (2)

Publication Number Publication Date
JPH09114640A JPH09114640A (en) 1997-05-02
JP3525582B2 true JP3525582B2 (en) 2004-05-10

Family

ID=17514448

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27247595A Expired - Fee Related JP3525582B2 (en) 1995-10-20 1995-10-20 Bit operation circuit

Country Status (1)

Country Link
JP (1) JP3525582B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10051243A1 (en) * 2000-10-17 2002-04-25 Philips Corp Intellectual Pty Method of puncturing data bits

Also Published As

Publication number Publication date
JPH09114640A (en) 1997-05-02

Similar Documents

Publication Publication Date Title
EP0766169B1 (en) Processor and control method for performing proper saturation operation
US5784585A (en) Computer system for executing instruction stream containing mixed compressed and uncompressed instructions by automatically detecting and expanding compressed instructions
JPH08305568A (en) Information processing unit
JPH09231070A (en) Information processing circuit, semiconductor integrated circuit device, microcomputer and electronic equipment
US5704052A (en) Bit processing unit for performing complex logical operations within a single clock cycle
JPH03218523A (en) Data processor
JP2983542B2 (en) Processing speed-up device
US5938759A (en) Processor instruction control mechanism capable of decoding register instructions and immediate instructions with simple configuration
JPH0769791B2 (en) Microprocessor
US6282558B1 (en) Data processing system and register file
US5764550A (en) Arithmetic logic unit with improved critical path performance
JP2006518060A (en) Method and computer program for single command multiple data management
JP3525582B2 (en) Bit operation circuit
US5479620A (en) Control unit modifying micro instructions for one cycle execution
JP2594130B2 (en) Semiconductor circuit
KR940011040B1 (en) Microcomputer
JPH1091395A (en) Processor
US6005502A (en) Method for reducing the number of bits needed for the representation of constant values in a data processing device
US5301345A (en) Data processing system for performing a shifting operation and a constant generation operation and method therefor
US20030233384A1 (en) Arithmetic apparatus for performing high speed multiplication and addition operations
US5220670A (en) Microprocessor having ability to carry out logical operation on internal bus
US5784634A (en) Pipelined CPU with instruction fetch, execution and write back stages
JPH0831033B2 (en) Data processing device
JPH0683618A (en) Flag control circuit
JPH0233173B2 (en)

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040127

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040209

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110227

Year of fee payment: 7

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120227

Year of fee payment: 8

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130227

Year of fee payment: 9

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140227

Year of fee payment: 10

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees