JPH0635669A - Central processing unit - Google Patents
Central processing unitInfo
- Publication number
- JPH0635669A JPH0635669A JP4214750A JP21475092A JPH0635669A JP H0635669 A JPH0635669 A JP H0635669A JP 4214750 A JP4214750 A JP 4214750A JP 21475092 A JP21475092 A JP 21475092A JP H0635669 A JPH0635669 A JP H0635669A
- Authority
- JP
- Japan
- Prior art keywords
- data
- register
- bit
- held
- adder
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
(57)【要約】
【目的】 複数組のデータを同時に加算処理して、演算
速度を向上する。
【構成】 並列加算器を構成する各1ビット全加算器1
3a〜13dの桁上がり信号を次の桁の1ビット全加算
器13a〜13dに伝えず、その桁上がり信号をフラグ
レジスタ16のキャリービットに反映させることによ
り、CPU11に、並列加算器12に与える1組のデー
タ(2つのデータ)のそれぞれを、その1組のデータの
データサイズより小さいサイズの複数のデータの集まり
とみなして、それぞれのデータを同時に干渉することな
く加算させる。
(57) [Summary] [Purpose] To improve the calculation speed by simultaneously adding multiple sets of data. [Structure] Each 1-bit full adder 1 forming a parallel adder
The carry signal of 3a to 13d is not transmitted to the 1-bit full adders 13a to 13d of the next digit, and the carry signal is reflected in the carry bit of the flag register 16 to give the CPU 11 to the parallel adder 12. Each of the one set of data (two data) is regarded as a set of a plurality of data having a size smaller than the data size of the one set of data, and the respective data are added simultaneously without interfering with each other.
Description
【0001】[0001]
【産業上の利用分野】この発明は、マイクロコンピュー
タにおいて、高速な加算および乗算を可能とする中央演
算処理装置に関するものである。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a central processing unit capable of high speed addition and multiplication in a microcomputer.
【0002】[0002]
【従来の技術】図6は従来の算術論理演算ユニットを有
する中央演算処理装置を示すブロック図であり、図にお
いて、1は並列加算器を内蔵する算術論理演算ユニット
(以下、ALUという)、2はデータバス、3,4はA
LU1に入力するデータを一時保持するレジスタで、そ
れぞれAレジスタおよびBレジスタ、5は乗算のときに
用いるMレジスタ、6はALU1による演算結果を一時
保持するSレジスタである。2. Description of the Related Art FIG. 6 is a block diagram showing a central processing unit having a conventional arithmetic logic operation unit, in which 1 is an arithmetic logic operation unit (hereinafter referred to as ALU) having a parallel adder. Is a data bus, 3 and 4 are A
Registers for temporarily holding data to be input to LU1, A register and B register, 5 are M registers used for multiplication, and 6 are S registers for temporarily holding operation results by ALU1.
【0003】また、7はALU1と各レジスタ3〜6、
命令の解読を行う図示しない命令解読部、およびこの命
令解読部で解読された結果によりALU1と各レジスタ
3〜6を制御する制御部から構成された中央演算処理装
置(以下、CPUという)、8はメモリである。なお、
ALU1は32ビットのデータの加算,乗算および他の
処理を行う。また、各レジスタ3〜6は32ビットのレ
ジスタである。Reference numeral 7 is an ALU 1 and registers 3 to 6,
A central processing unit (hereinafter referred to as CPU), which is composed of an instruction decoding unit (not shown) that decodes an instruction, and a control unit that controls the ALU 1 and each of the registers 3 to 6 according to the result decoded by the instruction decoding unit, 8 Is memory. In addition,
The ALU1 performs addition, multiplication and other processing of 32-bit data. Each of the registers 3 to 6 is a 32-bit register.
【0004】次に動作について説明する。まず、加算方
法について、図7のメモリマップを用いて説明する。図
7に示すメモリマップにおいて、データ格納領域Cに格
納された16ビットのデータ(データ)C とデータ格納
領域C’に格納された16ビットのデータ(データ)C'
を加算し、データ格納領域C''に格納する操作と、デー
タ格納領域Dに格納された16ビットのデータ(デー
タ)D とデータ格納領域D’に格納された16ビットの
データ(データ)D'を加算し、データ格納領域D''に格
納する操作が行われる場合について、図8を用いて説明
する。Next, the operation will be described. First, the addition method will be described with reference to the memory map of FIG. In the memory map shown in FIG. 7, 16-bit data (data) C stored in the data storage area C and 16-bit data (data) C ′ stored in the data storage area C ′
Adding, 'operations and stored in a 16-bit data stored in the data storage area D (data) D and a data storage area D' data storage area C '16-bit data stored in the (data) D A case where the operation of adding "and storing in the data storage area D" is performed will be described with reference to FIG.
【0005】上記の2つの加算を行うために、CPU7
は2つの命令(ADD C C’C'')と(ADD D
D’D'')を実行する。はじめに命令(ADD C
C’C'')を実行する(図8(a))。命令(ADD
C C’ C'')が実行されると、まず、Aレジスタ3
にデータ(データ)C が保持され、続いてBレジスタ4
にデータ(データ)C'が保持される。In order to perform the above two additions, the CPU 7
Is two instructions (ADD C C'C '') and (ADD D
D'D '') is executed. Introduction Command (ADD C
C'C '') is executed (FIG. 8A). Command (ADD
C C'C '') is executed, first, A register 3
Data (data) C is stored in the
The data (data) C 'is stored in.
【0006】ここで、Aレジスタ3とBレジスタ4にそ
れぞれ保持されているデータ(データ)C と(データ)
C'をALU1が加算し、結果をSレジスタ6に出力す
る。Sレジスタ6に保持された加算結果をメモリ8のデ
ータ格納領域C''に格納して、命令(ADD C C’
C'')の実行を終了する。Here, the data (data) C and (data) held in the A register 3 and the B register 4, respectively.
The ALU 1 adds C ′ and outputs the result to the S register 6. The addition result held in the S register 6 is stored in the data storage area C ″ of the memory 8 and the instruction (ADD C C ′
C ″) ends.
【0007】次に、命令(ADD D D’D'')を実
行する(図8(b))。命令(ADD D D’D'')
が実行されると、まず、Aレジスタ3にデータ(デー
タ)Dが保持され、続いてBレジスタ4にデータ(デー
タ)D'が保持される。Next, the instruction (ADD D D'D '') is executed (FIG. 8B). Command (ADD D D'D '')
Is executed, first, the data (data) D is held in the A register 3, and subsequently, the data (data) D ′ is held in the B register 4.
【0008】ここで、Aレジスタ3とBレジスタ4にそ
れぞれ保持されたデータ(データ)D と(データ)D'を
ALU1が加算し、結果をSレジスタ6に出力する。S
レジスタ6に保持されたデータをメモリ8のデータ格納
領域C''に格納して、命令(ADD D D’D'')の
実行を終了する。Here, the ALU 1 adds the data (data) D and (data) D' held in the A register 3 and the B register 4, respectively, and outputs the result to the S register 6. S
The data held in the register 6 is stored in the data storage area C ″ of the memory 8 and the execution of the instruction (ADD D D′ D ″) ends.
【0009】なお、命令(ADD C C’ C'')と
(ADD D D’D'')が実行される順番は逆でもか
まわない。以上の操作は、図示しない手段によりCPU
7に与えられた命令を、CPU7の図示しない命令解読
部が解読し、解読した結果を用いて図示しない制御部が
ALU1と各レジスタ3〜6を制御することにより行わ
れる。The order in which the instructions (ADD C C'C '') and (ADD D D'D '') are executed may be reversed. The above operation is performed by the CPU by means not shown.
The instruction given to the CPU 7 is decoded by an instruction decoding unit (not shown) of the CPU 7, and the control unit (not shown) controls the ALU 1 and the registers 3 to 6 using the decoded result.
【0010】次に、従来の並列加算器を内蔵するALU
1を有するCPU7による乗算方法を、図9を用いて説
明する。図9は各レジスタ3〜6に保持されるデータの
変化のみを示す。まず、CPU1に図示しない手段によ
り乗算命令(MUL E F)を与える。ここで、Eお
よびFは、図示しないが、データ格納領域を示す。この
データ格納領域はメモリでもレジスタでもよい。Next, an ALU incorporating a conventional parallel adder
A multiplication method by the CPU 7 having 1 will be described with reference to FIG. FIG. 9 shows only changes in the data held in the registers 3 to 6. First, a multiplication instruction (MUL EF) is given to the CPU 1 by means not shown. Here, although not shown, E and F indicate data storage areas. This data storage area may be a memory or a register.
【0011】データ格納領域EおよびFには、16ビッ
トの2つのデータ(データ)E =(E15,E14,・・
・,E1 ,E0 )(EX =0または1)と(データ)F
=(F15,F14,・・・,F1 ,F0 )(FX =0また
は1)がそれぞれ格納されており、この命令において
は、(データ)E が被乗数、(データ)F が乗数である
とする。In the data storage areas E and F, two 16-bit data (data) E = (E 15 , E 14 , ...
., E 1 , E 0 ) (EX = 0 or 1) and (data) F
= (F 15 , F 14 , ..., F 1 , F 0 ) (FX = 0 or 1) are stored respectively, and in this instruction, (data) E is a multiplicand and (data) F is a multiplier. Suppose
【0012】次に(データ)E をAレジスタ3に、(デ
ータ)F をMレジスタ5にそれぞれ保持し、値`0´を
Bレジスタに保持する(図9)。ALU1は、Bレジ
スタ4に保持されているデータ`0´を取り込み、Aレ
ジスタ3に格納されているデータ(データ)E か、また
はデータ(データ)E の代わりにデータ`0´を加算し
て、Bレジスタ4に再び保持する操作を行う(図9
)。どちらのデータを加算するかは、Mレジスタ5に
保持されているデータの最下位ビットによって決まる。Next, the (data) E is held in the A register 3, the (data) F is held in the M register 5, and the value "0 '" is held in the B register (FIG. 9). The ALU 1 fetches the data “0 ′” held in the B register 4, and adds the data “data E ” stored in the A register 3 or the data “0 ′” instead of the data (data) E. , B register 4 is again held (see FIG. 9).
). Which data is added depends on the least significant bit of the data held in the M register 5.
【0013】すなわち、図9の矢印αで示すように、、
図示しない制御部がMレジスタ5に保持されているデー
タの最下位ビットを監視しており、この最下位ビットが
`1´であれば、(データ)E の加算を行い、`0´で
あればデータ`0´の加算を行う。That is, as indicated by the arrow α in FIG.
A control unit (not shown) monitors the least significant bit of the data held in the M register 5. If this least significant bit is "1", (data) E is added and if it is "0". For example, data “0 ′” is added.
【0014】続いて、Bレジスタ4に保持されたデータ
を1ビット右にシフトする。このときBレジスタ4から
1ビット外に出てしまうことになるが、この1ビットは
Mレジスタ5の最上位ビットに入れられる。このため、
Mレジスタに保持されている(データ)F も1ビット右
にシフトし、最下位ビット`F0´はMレジスタ5の外
に捨てられる(図9)。Subsequently, the data held in the B register 4 is shifted right by 1 bit. At this time, one bit out of the B register 4 comes out, but this one bit is put in the most significant bit of the M register 5. For this reason,
The (data) F held in the M register is also shifted right by 1 bit, and the least significant bit `F0 'is discarded outside the M register 5 (FIG. 9).
【0015】次に、ALU1は、Bレジスタ4に保持さ
れているデータをALU1内部に取り込み、Aレジスタ
3に格納されているデータ(データ)E かまたは、デー
タ(データ)E の代わりにデータ`0´を加算し、Bレ
ジスタ4に再び保持する操作を行う(図9)。どちら
のデータを加算するかの判断は上記と同様にして行われ
る。Next, the ALU 1 takes in the data held in the B register 4 into the ALU 1 and stores the data (data) E stored in the A register 3 or the data ‘data‘ E ’instead of the data E. The operation of adding 0'and holding it in the B register 4 again is performed (FIG. 9). The determination of which data to add is made in the same manner as above.
【0016】続いて、Bレジスタ4に保持されたデータ
を1ビット右にシフトする。このときもBレジスタ4か
ら1ビット外に出てしまうことになるが、この1ビット
はMレジスタ5の最上位ビットに入れられる。このため
Mレジスタ5に保持されているデータ(データ)F も1
ビット右にシフトし、最下位ビットはMレジスタ5の外
に捨てられる(図9)。Then, the data held in the B register 4 is shifted right by 1 bit. At this time, the B register 4 also comes out to the outside of 1 bit, but this 1 bit is put into the most significant bit of the M register 5. Therefore, the data (data) F held in the M register 5 is also 1
It shifts to the right by a bit and the least significant bit is discarded out of the M register 5 (FIG. 9).
【0017】このようにして、図9と図9に示す2
つの操作を14回繰り返した後の、図9の斜線で示し
たBレジスタ4とMレジスタ5にまたがるデータが乗算
結果である。In this way, FIG. 9 and 2 shown in FIG.
After one operation is repeated 14 times, the data spanning the B register 4 and the M register 5 shown by the diagonal lines in FIG. 9 is the multiplication result.
【0018】[0018]
【発明が解決しようとする課題】従来の中央演算処理装
置は以上のように構成されているので、加算器が加算で
きるデータサイズよりも小さいデータサイズの1組のデ
ータ(2つのデータ)の加算を複数回行う場合、2組以
上のデータの加算を同時に行うことができず、結果的に
加算および乗算の演算速度が遅くなるなどの問題点があ
った。Since the conventional central processing unit is configured as described above, addition of one set of data (two data) having a data size smaller than the data size that can be added by the adder is added. However, there is a problem that the addition of two or more sets of data cannot be performed at the same time, resulting in a slower operation speed of addition and multiplication.
【0019】この発明は上記のような問題点を解消する
ためになされたもので、2つ以上のデータを同時に加算
処理することによって、加算および乗算の演算処理速度
を迅速化できる中央演算処理装置を得ることを目的とす
る。The present invention has been made to solve the above problems, and a central processing unit capable of speeding up the processing speed of addition and multiplication by simultaneously processing two or more data. Aim to get.
【0020】[0020]
【課題を解決するための手段】この発明に係る中央演算
処理装置は、複数の1ビット全加算器により構成された
並列加算器を内蔵する算術論理演算ユニットと、該算術
論理演算ユニットの入出力データを一時保持する複数の
レジスタとを備えて、与えられた命令に従って上記算術
論理演算ユニットおよび上記各レジスタの動作を制御す
るものにおいて、上記並列加算器による加算動作におい
て、上記各1ビット全加算器の桁上がり信号を次の1ビ
ット全加算器に伝えずに、フラグレジスタのキャリービ
ットに反映させるようにしたものである。A central processing unit according to the present invention includes an arithmetic logic operation unit having a parallel adder formed of a plurality of 1-bit full adders, and an input / output of the arithmetic logic operation unit. A plurality of registers for temporarily holding data and controlling the operations of the arithmetic logic operation unit and the respective registers according to a given instruction. In the adding operation by the parallel adder, the 1-bit full addition is performed. The carry signal of the multiplier is reflected on the carry bit of the flag register without being transmitted to the next 1-bit full adder.
【0021】[0021]
【作用】この発明における中央演算処理装置は、加算器
に与える1組のデータ(2つのデータ)のそれぞれを、
その1組のデータのデータサイズより小さいサイズの複
数のデータの集まりとみなして、それぞれのデータを同
時に干渉することなく加算する。The central processing unit according to the present invention supplies one set of data (two data) to the adder,
It is regarded as a set of a plurality of data having a size smaller than the data size of the one set of data, and the respective data are added simultaneously without interfering with each other.
【0022】[0022]
実施例1.以下、この発明の一実施例を図について説明
する。図2はこの発明における並列加算器を示す。図2
において、12は1ビット全加算器32個で構成された
32ビットの並列加算器であり、これが32個の1ビッ
ト全加算器13a〜13b,13c〜13dおよび1ビ
ット全加算器13a〜13dの桁上がり信号線14a〜
14dをそれぞれ有する。Example 1. An embodiment of the present invention will be described below with reference to the drawings. FIG. 2 shows a parallel adder according to the present invention. Figure 2
12 is a 32-bit parallel adder composed of 32 1-bit full adders. This is one of 32 1-bit full adders 13a to 13b, 13c to 13d and 1 bit full adders 13a to 13d. Carry signal line 14a-
14d respectively.
【0023】また、3,4は上記並列加算器12に入力
するデータを一時保持するレジスタで、Aレジスタおよ
びBレジスタ、6は加算結果を一時保持するSレジスタ
である。各レジスタ3,4および6は図6に示すものと
同じものである。Further, 3 and 4 are registers for temporarily holding the data inputted to the parallel adder 12, A and B registers, and 6 is an S register for temporarily holding the addition result. Each register 3, 4 and 6 is the same as that shown in FIG.
【0024】次に動作を説明する。ここでは、並列加算
器12により32ビットのデータGとHを加算する場合
の動作について、図1を用いて説明する。図2におい
て、15は全加算器FA15の桁上がり信号14bの接
続を切り換えるためのスイッチであり、データGの上位
16ビットをG1、下位16ビットを62、データHの
上位16ビットをH1、下位16ビットをH2とする。Next, the operation will be described. Here, the operation when the parallel adder 12 adds the 32-bit data G and H will be described with reference to FIG. In FIG. 2, reference numeral 15 denotes a switch for switching the connection of the carry signal 14b of the full adder FA15. The upper 16 bits of the data G are G1, the lower 16 bits are 62, and the upper 16 bits of the data H are H1 and the lower. 16 bits are set to H2.
【0025】いま、データGとHがAレジスタ3とBレ
ジスタ4に図1に示すように保持されているとする。図
示しない制御部は、スイッチ手段としてのスイッチ15
を図1に示すように切り換えると、これにより1ビット
全加算器13bで桁上がりが生じた場合は、この桁上が
り情報は1ビット全加算器13cには伝わらずに、フラ
グレジスタ16に伝えられて、桁上がりフラグ(以下、
キャリーフラグと称す)CF0をセットする。Now, assume that the data G and H are held in the A register 3 and the B register 4 as shown in FIG. The control unit (not shown) includes a switch 15 as a switch unit.
1 is switched as shown in FIG. 1, and if a carry occurs in the 1-bit full adder 13b, the carry information is transmitted to the flag register 16 without being transmitted to the 1-bit full adder 13c. The carry flag (hereinafter,
CF0 is set (referred to as carry flag).
【0026】次に、データG,Hの上位16ビットG
1,H1を1ビット全加算器13c〜13dに、下位1
6ビットG2,H2を全加算器FA0〜FA15に入力
し加算を行い、結果をSレジスタ6に出力する。1ビッ
ト全加算器13bの桁上がりを全加算器13cに伝えな
いため、Sレジスタ6に保持されるデータの上位16ビ
ットはG1とH1を加算した値となり、Sレジスタ6に
保持されるデータの下位16ビットはG2とH2を加算
した値となる。Next, the upper 16 bits G of the data G and H
1, H1 to the 1-bit full adders 13c to 13d
The 6 bits G2 and H2 are input to the full adders FA0 to FA15 to perform addition, and the result is output to the S register 6. Since the carry of the 1-bit full adder 13b is not transmitted to the full adder 13c, the upper 16 bits of the data held in the S register 6 becomes a value obtained by adding G1 and H1, and the data held in the S register 6 The lower 16 bits have a value obtained by adding G2 and H2.
【0027】また、1ビット全加算器13bで桁上がり
が生じた場合は、スイッチ15によりこの桁上がり情報
がフラグレジスタ16に伝えられて、キャリーフラグC
F0をセットする。1ビット全加算器13dで桁上がり
が生じた場合は、桁上がり信号線14dによりこの桁上
がり情報がフラグレジスタ16に伝えられて、キャリー
フラグCF1をセットする。When a carry occurs in the 1-bit full adder 13b, the switch 15 transmits the carry information to the flag register 16 to carry the flag C.
Set F0. When a carry occurs in the 1-bit full adder 13d, the carry signal line 14d transmits the carry information to the flag register 16 to set the carry flag CF1.
【0028】すなわち、図2に示した並列加算器12で
は、Aレジスタ3およびBレジスタ4に保持される32
ビットのデータの下位16ビットと上位16ビットとを
別々のデータとみなし、上位の16ビットのデータどう
しと下位の16ビットどうしをそれぞれ独立に、しかも
同時に加算することができ、加算結果は、それぞれSレ
ジスタの上位16ビットと下位16ビットに出力され
る。That is, in the parallel adder 12 shown in FIG. 2, 32 held in the A register 3 and the B register 4 is held.
The lower 16 bits and the upper 16 bits of the bit data can be regarded as separate data, and the upper 16 bits and the lower 16 bits can be added independently and simultaneously, and the addition results are It is output to the upper 16 bits and the lower 16 bits of the S register.
【0029】図3は図2における並列加算器12を内蔵
するALU21を有するCPU11とメモリ8の接続を
示す。同図において、符号2〜6および8は図6におけ
るものと同じものである。また、21は図2における並
列加算器12を内蔵する上記のALU、16は図1に示
すものと同様のフラグレジスタである。ここでCPU1
1は、ALU21,データバス2,各レジスタ3,4,
5,6,16により構成される。FIG. 3 shows the connection between the CPU 11 having the ALU 21 containing the parallel adder 12 shown in FIG. 2 and the memory 8. In the figure, reference numerals 2 to 6 and 8 are the same as those in FIG. Further, 21 is the above-mentioned ALU incorporating the parallel adder 12 in FIG. 2, and 16 is a flag register similar to that shown in FIG. CPU1 here
1 is an ALU 21, a data bus 2, respective registers 3, 4,
It is composed of 5, 6, and 16.
【0030】また、図3において、図7に示したメモリ
マップのデータ格納領域Cに格納された16ビットのデ
ータ(データ)C とデータ格納領域C’に格納された1
6ビットのデータ(データ)C'を加算し、データ格納領
域C''に格納する操作と、データ格納領域Dに格納され
た16ビットのデータ(データ)D とデータ格納領域
D’に格納された16ビットのデータ(データ)D'を加
算し、データ格納領域D''に格納する操作が行われる。In FIG. 3, 16-bit data (data) C stored in the data storage area C of the memory map shown in FIG. 7 and 1 stored in the data storage area C '.
The operation of adding 6-bit data (data) C'and storing it in the data storage area C '' and the 16-bit data (data) D stored in the data storage area D and the data storage area D ' The operation of adding the 16-bit data (data) D ′ and storing it in the data storage area D ″ is performed.
【0031】以上の操作を行うために、図3に示すCP
U11には加算命令(ADDW II’I'')が用意さ
れている。ここで、Iはデータ格納領域Cとデータ格納
領域Dを合わせた32ビットのデータの格納領域、I’
はデータ格納領域C’とデータ格納領域D’を合わせた
32ビットのデータ格納領域、I''はデータ格納領域
C''とデータ格納領域D''を合わせた32ビットのデー
タの格納領域である。In order to perform the above operation, the CP shown in FIG.
An addition instruction (ADDW II'I '') is prepared in U11. Here, I is a 32-bit data storage area including the data storage area C and the data storage area D, and I ′.
Is a 32-bit data storage area including the data storage area C ′ and the data storage area D ′, and I ″ is a 32-bit data storage area including the data storage area C ″ and the data storage area D ″. is there.
【0032】いま、加算命令(ADDW I I’
I'')が実行されると、まず、データ格納領域Iに格納
されているデータ(データ)C と(データ)D がAレジ
スタ3に保持され、続いてデータ格納領域I’に格納さ
れているデータ(データ)C'と(データ)D'がBレジス
タ4に保持される。Now, the addition instruction (ADDW I I '
I ″) is executed, first, the data (data) C and (data) D stored in the data storage area I are held in the A register 3, and subsequently stored in the data storage area I ′. The stored data (data) C'and (data) D' is held in the B register 4.
【0033】ALU21はAレジスタ3とBレジスタ4
に保持されている32ビットのデータの上位16ビット
どうし((データ)C と(データ)C')と、下位16ビ
ットどうし((データ)D と(データ)D')を独立にし
かも同時に加算して、Sレジスタ6に出力する。The ALU 21 has an A register 3 and a B register 4
The upper 16 bits ((data) C and (data) C ') and the lower 16 bits ((data) D and (data) D ') of the 32-bit data held in are added independently and simultaneously. And outputs it to the S register 6.
【0034】このとき、上位16ビットの加算で桁上げ
が生じた場合はフラグレジスタ16のキャリーフラグC
F1をセットし、下位16ビットの加算で桁上げが生じ
た場合はフラグレジスタ16のキャリーフラグCF0を
セットする。Sレジスタ6に保持された加算結果をメモ
リ8のデータ格納領域I''に格納して、命令(ADDW
I I’I'')の実行を終了する。At this time, if a carry occurs in the addition of the upper 16 bits, the carry flag C of the flag register 16 is used.
F1 is set, and if a carry occurs in the addition of the lower 16 bits, the carry flag CF0 of the flag register 16 is set. The addition result held in the S register 6 is stored in the data storage area I ″ of the memory 8 and the instruction (ADDW
I I'I '') ends.
【0035】実施例2.図4は図2に示す並列加算器1
2を内蔵するALU21を有するCPU28において、
乗算が行われるときの構成を示し、同図において、2は
データバス、6はSレジスタ、21は並列加算器12を
内蔵する上記のALUである。Example 2. FIG. 4 is a parallel adder 1 shown in FIG.
In the CPU 28 having the ALU 21 incorporating 2
The configuration when multiplication is performed is shown. In the figure, 2 is a data bus, 6 is an S register, and 21 is the above ALU incorporating a parallel adder 12.
【0036】また、22,23,24,25はALU2
1に入力するデータを一時保持する16ビットのレジス
タで、それぞれA1レジスタ,A2レジスタ,B1レジ
スタ,B2レジスタ、26,27は乗算のときに用いる
レジスタで、それぞれM1レジスタ,M2レジスタ、2
8はALU21,データバス2,各レジスタ22〜2
7、図示しない命令解読部および図示しない制御部によ
って構成される上記のCPUである。Reference numerals 22, 23, 24 and 25 are ALU2.
16-bit registers for temporarily holding the data to be input to 1, A1 register, A2 register, B1 register, B2 register, 26 and 27 are registers used at the time of multiplication, respectively, M1 register, M2 register, 2
8 is an ALU 21, a data bus 2, and registers 22 to 2
7. The CPU is composed of an instruction decoding unit (not shown) and a control unit (not shown).
【0037】さらに、A1レジスタ22およびA2レジ
スタ23は図6におけるAレジスタ3を半分ずつに分割
したもの、B1レジスタ24およびB2レジスタ25は
図6におけるBレジスタ4を半分ずつに分割したもの、
M1レジスタ26およびM2レジスタ27は図6におけ
るMレジスタ5を半分ずつに分割したものである。Further, the A1 register 22 and the A2 register 23 are obtained by dividing the A register 3 in FIG. 6 into halves, and the B1 register 24 and the B2 register 25 are obtained by dividing the B register 4 in FIG. 6 into halves.
The M1 register 26 and the M2 register 27 are obtained by dividing the M register 5 in FIG. 6 into halves.
【0038】各レジスタ22〜27は通常は分割されて
おらず、図6と同じ構成になっており、以下に示す乗算
命令を実行するときに分割されて、図4に示す構成とな
る。また、ALU21は図2に示す並列加算器12を内
蔵しており、図示しないが、A1レジスタ22とB1レ
ジスタ24は並列加算器12の上位16ビットに、A2
レジスタ23とB2レジスタ25は並列加算器12の下
位16ビットに接続されている。Each of the registers 22 to 27 is not normally divided, and has the same structure as that of FIG. 6, and is divided when the multiplication instruction shown below is executed to have the structure shown in FIG. The ALU 21 has the built-in parallel adder 12 shown in FIG. 2, and although not shown, the A1 register 22 and the B1 register 24 have the upper 16 bits of the parallel adder 12 as A2.
The register 23 and the B2 register 25 are connected to the lower 16 bits of the parallel adder 12.
【0039】このため、ALU21は乗算を行うとき、
A1レジスタ22とB1レジスタ24に保持される16
ビットのデータ加算と、A2レジスタ23とB2レジス
タ25に保持される16ビットのデータの加算を同時に
独立して行うことができる。Therefore, when the ALU 21 performs multiplication,
16 held in A1 register 22 and B1 register 24
Bit data addition and 16-bit data held in the A2 register 23 and the B2 register 25 can be added simultaneously and independently.
【0040】次に、図4に示すCPU28による乗算方
法を図5を用いて説明する。図5では、各レジスタ22
〜27に保持されるデータの変化のみを示す。まずCP
U28に図示しない手段により乗算命令(MULW E
F)が与えられる。ここで、E,Fは図示しないデー
タ格納領域を示す(このデータ格納領域はメモリでもレ
ジスタでもよい)。Next, the multiplication method by the CPU 28 shown in FIG. 4 will be described with reference to FIG. In FIG. 5, each register 22
Only changes in data held in ~ 27 are shown. First CP
The U28 executes a multiplication instruction (MULTIW E by means not shown).
F) is given. Here, E and F indicate a data storage area (not shown) (this data storage area may be a memory or a register).
【0041】データ格納領域EおよびFには、16ビッ
トの2つのデータ(データ)E =(E15,E14,・・
・,E1 ,E0 )(EX =0または1)と(データ)F
=(F15,F14,・・・,F1 ,F0 )(FX =0また
は1)がそれぞれ格納されている。この命令において、
(データ)E が被乗数、(データ)F が乗数であるとす
る。In the data storage areas E and F, two 16-bit data (data) E = (E 15 , E 14 , ...
., E 1 , E 0 ) (EX = 0 or 1) and (data) F
= (F 15 , F 14 , ..., F 1 , F 0 ) (FX = 0 or 1) are stored. In this command,
Let (data) E be the multiplicand and (data) F be the multiplier.
【0042】次に(データ)E をA1レジスタ22とA
2レジスタ23に保持する。(データ)F の上位ビット
(データ)F1をM1レジスタ26に、下位8ビット(デ
ータ)F2をM2レジスタ27にそれぞれ保持する。B1
レジスタ24とB2レジスタ25はクリアする(図5
)。Next, (data) E is transferred to the A1 register 22 and A
2 It is held in the register 23. (Data) F upper bits of the (data) F1 to M1 register 26, respectively holding the lower 8 bits (data) F2 to M2 register 27. B1
The register 24 and the B2 register 25 are cleared (see FIG. 5).
).
【0043】図5に示すように、ALU21はB1レ
ジスタ24に保持されているデータ`0´を取り込み、
A1レジスタ22に格納されている(データ)E かまた
は、(データ)E の代わりにデータ`0´を加算して、
B1レジスタ24に再び保持する操作を行う。どちらの
データを加算するかは、M1レジスタ26に保持されて
いるデータの最下位ビットによって決まる。As shown in FIG. 5, the ALU 21 takes in the data "0 '" held in the B1 register 24,
Add (data) E stored in the A1 register 22 or add data ‘0’ instead of (data) E ,
The operation of holding again in the B1 register 24 is performed. Which data is added depends on the least significant bit of the data held in the M1 register 26.
【0044】すなわち、図5の矢印α1で示すように、
図示しない制御部がM1レジスタ26に保持されている
データの最下位ビットを監視しており、この最下位ビッ
トが`1´であれば(データ)E の加算を行い、`0´
であればデータ`0´の加算を行う。That is, as indicated by the arrow α1 in FIG.
A control unit (not shown) monitors the least significant bit of the data held in the M1 register 26, and if this least significant bit is "1 ', (data) E is added and" 0 "
If so, the addition of the data “0 ′” is performed.
【0045】これと同時に、ALU21は、B2レジス
タ25に保持されているデータ`0´を取り込み、A2
レジスタ23に格納されているデータ(データ)E かま
たは、データ(データ)E の代わりにデータ`0´を加
算して、B2レジスタ25に再び保持する操作を行う。
ここでも、どちらのデータを加算するかは、M2レジス
タ27に保持されているデータの最下位ビットによって
決まる。At the same time, the ALU 21 takes in the data "0 '" held in the B2 register 25 and stores it in A2.
An operation of adding the data (data) E stored in the register 23 or data “0 ′” instead of the data (data) E and holding it in the B2 register 25 again is performed.
Here again, which data to add is determined by the least significant bit of the data held in the M2 register 27.
【0046】すなわち、図5の矢印α2で示すように、
図示しない制御部がM2レジスタ27に保持されている
データの最下位ビットを監視しており、この最下位ビッ
トが`1´であればデータ(データ)E の加算を行い、
`0´であればデータ`0´の加算を行う。That is, as shown by the arrow α2 in FIG.
A control unit (not shown) monitors the least significant bit of the data held in the M2 register 27, and if this least significant bit is "1 ', the data (data) E is added,
If it is "0", the data "0" is added.
【0047】続いて、B1レジスタ24に保持されたデ
ータを1ビット右にシフトする。このときB1レジスタ
24から1ビット外に出てしまうことになるが、この1
ビットは、M1レジスタ26の最上位ビットに入れられ
る。このためM1レジスタ26に保持されている(デー
タ)F1も1ビット右にシフトし、最下位ビット`F8´
はM1レジスタ26の外に捨てられる。これと同様の操
作がB2レジスタ25とM2レジスタ27に対しても行
われる(図5)。Then, the data held in the B1 register 24 is shifted right by 1 bit. At this time, one bit out of the B1 register 24, but this 1
The bits are placed in the most significant bits of M1 register 26. Therefore, the (data) F1 held in the M1 register 26 is also shifted right by 1 bit, and the least significant bit'F8 '
Are discarded out of the M1 register 26. The same operation is performed on the B2 register 25 and the M2 register 27 (FIG. 5).
【0048】次に、図5に示すように、ALU21は
B1レジスタ24に保持されているデータをALU21
内部に取り込みA1レジスタ22に保持されているデー
タ(データ)E かまたは、データ(データ)E の代わり
にデータ`0´を加算し、B1レジスタ24に再び保持
する操作を行う。どちらのデータを加算するかの判断は
上記と同様にして行われる。Next, as shown in FIG. 5, the ALU 21 transfers the data held in the B1 register 24 to the ALU 21.
An operation is performed in which the data (data) E which is fetched inside and held in the A1 register 22 or data "0 '" is added instead of the data (data) E and the data is held in the B1 register 24 again. The determination of which data to add is made in the same manner as above.
【0049】これと同時に、ALU21は、B2レジス
タ25に保持されているデータをALU21内部に取り
込み、A2レジスタ23に保持されているデータ(デー
タ)E かまたは、データ(データ)E の代わりにデータ
`0´を加算し、B2レジスタ25に再び保持する操作
を行う。どちらのデータを加算するかの判断は上記と同
様にして行われる。At the same time, the ALU 21 takes in the data held in the B2 register 25 into the ALU 21, and stores the data (data) E held in the A2 register 23 or the data (data) E instead of the data (data) E. An operation of adding “0 ′” and holding it again in the B2 register 25 is performed. The determination of which data to add is made in the same manner as above.
【0050】続いて、図5に示すように、B1レジス
タ24に保持されたデータを1ビット右にシフトする。
このときもB1レジスタ24から1ビット外に出てしま
うことになるが、この1ビットはM1レジスタ26の最
上位ビットに入れられる。このためM1レジスタ26に
保持されている(データ)F1も1ビット右にシフトし、
最下位ビットF9はM1レジスタ26の外に捨てられ
る。これと同様の操作がB2レジスタ25とM2レジス
タ27に対しても行われる。Then, as shown in FIG. 5, the data held in the B1 register 24 is shifted to the right by one bit.
At this time, the B1 register 24 also comes out of the 1 bit, but the 1 bit is put in the most significant bit of the M1 register 26. Therefore, the (data) F1 held in the M1 register 26 is also shifted right by 1 bit,
The least significant bit F9 is discarded out of the M1 register 26. The same operation is performed on the B2 register 25 and the M2 register 27.
【0051】以上のとに示す2つの操作を7回繰り
返した後、B2レジスタ25とM2レジスタ27に保持
されたデータを右に4ビットシフトする。この結果、斜
線βで示した位置にシフトされる。最後に斜線γとδで
示したデータを加算したものが乗算結果となる。After repeating the above two operations 7 times, the data held in the B2 register 25 and the M2 register 27 is shifted to the right by 4 bits. As a result, the position is shifted to the position indicated by the shaded β. Finally, the result obtained by adding the data indicated by the diagonal lines γ and δ is the multiplication result.
【0052】[0052]
【発明の効果】以上のように、この発明によれば、複数
の1ビット全加算器により構成された並列加算器を内蔵
する算術論理演算ユニットと、該算術論理演算ユニット
の入出力データを一時保持する複数のレジスタとを備え
て、与えられた命令に従って上記算術論理演算ユニット
および上記各レジスタの動作を制御するものにおいて、
上記並列加算器による加算動作において、上記各1ビッ
ト全加算器の桁上がり信号を次の1ビット全加算器に伝
えずに、フラグレジスタのキャリービットに反映させる
ように構成したので、1つの加算で2つ以上のデータの
集まりの加算を行うことができるため、加算および乗算
を高速に行うことができるものが得られる効果がある。As described above, according to the present invention, an arithmetic logic operation unit having a parallel adder formed of a plurality of 1-bit full adders and input / output data of the arithmetic logic operation unit are temporarily stored. A plurality of registers for holding and controlling the operation of the arithmetic logic operation unit and each of the registers according to a given instruction,
In the addition operation by the parallel adder, the carry signal of each 1-bit full adder is configured to be reflected in the carry bit of the flag register without being transmitted to the next 1-bit full adder. Since it is possible to perform addition of two or more sets of data, it is possible to obtain one that can perform addition and multiplication at high speed.
【図1】この発明の一実施例による中央演算処理装置内
の並列加算器を示すブロック図を示す。FIG. 1 is a block diagram showing a parallel adder in a central processing unit according to an embodiment of the present invention.
【図2】図1に示す並列加算器の概略を示すブロック図
である。FIG. 2 is a block diagram showing an outline of a parallel adder shown in FIG.
【図3】この発明の一実施例における中央演算処理装置
によるデータの加算方法を示すブロック図である。FIG. 3 is a block diagram showing a data addition method by the central processing unit in the embodiment of the present invention.
【図4】この発明の一実施例における中央演算処理装置
によるデータの乗算方法を示すブロック図である。FIG. 4 is a block diagram showing a data multiplication method by the central processing unit in the embodiment of the present invention.
【図5】図4において乗算が行われるときの演算方法を
示す説明図である。5 is an explanatory diagram showing a calculation method when multiplication is performed in FIG.
【図6】従来の中央演算処理装置を示すブロック図であ
る。FIG. 6 is a block diagram showing a conventional central processing unit.
【図7】図6におけるメモリのデータ内容を示すメモリ
マップ図である。FIG. 7 is a memory map diagram showing data contents of the memory in FIG.
【図8】図6における中央演算処理装置によるデータの
加算方法を示すブロック図である。8 is a block diagram showing a method of adding data by the central processing unit in FIG.
【図9】図6における中央演算処理装置によるデータの
乗算方法を示す説明図である。9 is an explanatory diagram showing a data multiplication method by the central processing unit in FIG.
【符号の説明】 3 Aレジスタ(レジスタ) 4 Bレジスタ(レジスタ) 5 Mレジスタ(レジスタ) 6 Sレジスタ(レジスタ) 12 並列加算器 13a〜13d 1ビット全加算器 15 スイッチ(スイッチ手段) 16 フラグレジスタ 21 ALU(算術論理演算ユニット) 22 A1レジスタ(レジスタ) 23 A2レジスタ(レジスタ) 24 B1レジスタ(レジスタ) 25 B2レジスタ(レジスタ) 26 M1レジスタ(レジスタ) 27 M2レジスタ(レジスタ)[Description of Reference Signs] 3 A register (register) 4 B register (register) 5 M register (register) 6 S register (register) 12 Parallel adder 13a to 13d 1-bit full adder 15 Switch (switch means) 16 Flag register 21 ALU (arithmetic and logic unit) 22 A1 register (register) 23 A2 register (register) 24 B1 register (register) 25 B2 register (register) 26 M1 register (register) 27 M2 register (register)
【手続補正書】[Procedure amendment]
【提出日】平成4年12月8日[Submission date] December 8, 1992
【手続補正1】[Procedure Amendment 1]
【補正対象書類名】明細書[Document name to be amended] Statement
【補正対象項目名】特許請求の範囲[Name of item to be amended] Claims
【補正方法】変更[Correction method] Change
【補正内容】[Correction content]
【特許請求の範囲】[Claims]
【手続補正2】[Procedure Amendment 2]
【補正対象書類名】明細書[Document name to be amended] Statement
【補正対象項目名】0052[Correction target item name] 0052
【補正方法】変更[Correction method] Change
【補正内容】[Correction content]
【0052】[0052]
【発明の効果】以上のように、この発明によれば、複数
の1ビット全加算器により構成された並列加算器を内蔵
する算術論理演算ユニットと、該算術論理演算ユニット
の入出力データを一時保持する複数のレジスタとを備え
て、与えられた命令に従って上記算術論理演算ユニット
および上記各レジスタの動作を制御するものにおいて、
上記並列加算器による加算動作において、上記1ビット
全加算器の桁上がり信号を次段の1ビット全加算器に伝
えずに、フラグレジスタのキャリービットに反映させる
ように構成したので、1つの加算で2つ以上のデータの
集まりの加算を行うことができるため、加算および乗算
を高速に行うことができるものが得られる効果がある。As described above, according to the present invention, an arithmetic logic operation unit having a parallel adder formed of a plurality of 1-bit full adders and input / output data of the arithmetic logic operation unit are temporarily stored. A plurality of registers for holding and controlling the operation of the arithmetic logic operation unit and each of the registers according to a given instruction,
In the addition operation by the parallel adder, the 1 bit
Since the carry signal of the full adder is reflected to the carry bit of the flag register without being transmitted to the 1-bit full adder of the next stage, one addition adds two or more data groups. Therefore, it is possible to obtain the one capable of performing addition and multiplication at high speed.
Claims (1)
た並列加算器を内蔵する算術論理演算ユニットと、該算
術論理演算ユニットの入出力データを一時保持する複数
のレジスタとを備えて、与えられた命令に従って上記算
術論理演算ユニットおよび上記各レジスタの動作を制御
する中央演算処理装置において、上記並列加算器による
加算動作において、上記各1ビット全加算器の桁上がり
信号を次の1ビット全加算器に伝えずに、フラグレジス
タのキャリービットに反映させるスイッチ手段を設けた
ことを特徴とする中央演算処理装置。1. An arithmetic logic operation unit containing a parallel adder composed of a plurality of 1-bit full adders, and a plurality of registers for temporarily holding input / output data of the arithmetic logic operation unit are provided. In a central processing unit for controlling the operations of the arithmetic logic operation unit and the respective registers according to the instruction, the carry signal of each 1-bit full adder is added to the next 1-bit full in the addition operation by the parallel adder. A central processing unit, comprising switch means for reflecting the carry bit of a flag register without transmitting it to an adder.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4214750A JPH0635669A (en) | 1992-07-21 | 1992-07-21 | Central processing unit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP4214750A JPH0635669A (en) | 1992-07-21 | 1992-07-21 | Central processing unit |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0635669A true JPH0635669A (en) | 1994-02-10 |
Family
ID=16660959
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP4214750A Pending JPH0635669A (en) | 1992-07-21 | 1992-07-21 | Central processing unit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0635669A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2010057019A (en) * | 2008-08-29 | 2010-03-11 | Sony Corp | Imaging element, and imaging apparatus |
| US7844654B2 (en) | 2004-11-12 | 2010-11-30 | Seiko Epson Corporation | Arithmetic unit of arbitrary precision, operation method for processing data of arbitrary precision and electronic equipment |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6186839A (en) * | 1984-10-05 | 1986-05-02 | Hitachi Ltd | arithmetic processing unit |
| JPS6355627A (en) * | 1986-08-27 | 1988-03-10 | Toshiba Corp | Semiconductor logic arithmetic unit |
| JPS63278136A (en) * | 1987-05-11 | 1988-11-15 | Hitachi Ltd | Arithmetic circuit |
| JPH01134528A (en) * | 1987-11-19 | 1989-05-26 | Mitsubishi Electric Corp | Multiplier |
| JPH043222A (en) * | 1990-04-19 | 1992-01-08 | Mitsubishi Electric Corp | Data processor |
| JPH0462635A (en) * | 1990-06-29 | 1992-02-27 | Matsushita Electric Ind Co Ltd | Microcomputer |
-
1992
- 1992-07-21 JP JP4214750A patent/JPH0635669A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6186839A (en) * | 1984-10-05 | 1986-05-02 | Hitachi Ltd | arithmetic processing unit |
| JPS6355627A (en) * | 1986-08-27 | 1988-03-10 | Toshiba Corp | Semiconductor logic arithmetic unit |
| JPS63278136A (en) * | 1987-05-11 | 1988-11-15 | Hitachi Ltd | Arithmetic circuit |
| JPH01134528A (en) * | 1987-11-19 | 1989-05-26 | Mitsubishi Electric Corp | Multiplier |
| JPH043222A (en) * | 1990-04-19 | 1992-01-08 | Mitsubishi Electric Corp | Data processor |
| JPH0462635A (en) * | 1990-06-29 | 1992-02-27 | Matsushita Electric Ind Co Ltd | Microcomputer |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7844654B2 (en) | 2004-11-12 | 2010-11-30 | Seiko Epson Corporation | Arithmetic unit of arbitrary precision, operation method for processing data of arbitrary precision and electronic equipment |
| JP2010057019A (en) * | 2008-08-29 | 2010-03-11 | Sony Corp | Imaging element, and imaging apparatus |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5132898A (en) | System for processing data having different formats | |
| EP0239081B1 (en) | Pipelined data processor capable of decoding and executing plural instructions in parallel | |
| JPH02300983A (en) | Fast arithmetic processing for central processing unit | |
| JPH0850575A (en) | Programmable processor,method for execution of digital signal processing by using said programmable processor and its improvement | |
| US4713750A (en) | Microprocessor with compact mapped programmable logic array | |
| JP2000227858A (en) | Processor and instruction processing method thereof | |
| JP2001516916A (en) | Data processing device with digital signal processing capability | |
| US4755962A (en) | Microprocessor having multiplication circuitry implementing a modified Booth algorithm | |
| US5704052A (en) | Bit processing unit for performing complex logical operations within a single clock cycle | |
| US4821225A (en) | Arithmetic and logic unit with prior state dependent logic operations | |
| US4954947A (en) | Instruction processor for processing branch instruction at high speed | |
| JP2001027945A (en) | Floating point unit using standard mac unit for executing simd operation | |
| JP3578883B2 (en) | Data processing device | |
| US4631672A (en) | Arithmetic control apparatus for a pipeline processing system | |
| JP3479385B2 (en) | Information processing device | |
| US4771376A (en) | Processor | |
| US5077659A (en) | Data processor employing the same microprograms for data having different bit lengths | |
| EP2093661B1 (en) | Generation and use of status flags in a data processor | |
| JP2520882B2 (en) | Data processing device and data processing method | |
| JPH1091432A (en) | Program execution method and device therefor | |
| JPH05108345A (en) | Branch instruction processor | |
| US5086406A (en) | Circuit arrangement for decimal arithmetic | |
| JPS5995646A (en) | Arithmetic control system | |
| JPH0683618A (en) | Flag control circuit | |
| JPS6250853B2 (en) |