JPS607813B2 - Variable length calculation method - Google Patents

Variable length calculation method

Info

Publication number
JPS607813B2
JPS607813B2 JP15932180A JP15932180A JPS607813B2 JP S607813 B2 JPS607813 B2 JP S607813B2 JP 15932180 A JP15932180 A JP 15932180A JP 15932180 A JP15932180 A JP 15932180A JP S607813 B2 JPS607813 B2 JP S607813B2
Authority
JP
Japan
Prior art keywords
byte
mark
bytes
circuit
arithmetic
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
Application number
JP15932180A
Other languages
Japanese (ja)
Other versions
JPS5783846A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP15932180A priority Critical patent/JPS607813B2/en
Publication of JPS5783846A publication Critical patent/JPS5783846A/en
Publication of JPS607813B2 publication Critical patent/JPS607813B2/en
Expired legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/34Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes

Description

【発明の詳細な説明】 本発明は、可変長データを効率良く演算する可変長演算
方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a variable length calculation method for efficiently calculating variable length data.

複数バイトの処理バイト幅を有する演算装置により、そ
の処理バイト幅より短いバイト幅のデータを記憶装置か
ら議出して演算し、その結果を記憶装置に書込む命令を
実行する場合、従来は記憶装置から論出したデータに0
を付加して演算装置の処理バイト幅となるようにし、演
算結果のステータス情報も処理バイト幅で検査し、記憶
装置への書込みはリード・モデイフアィド・ライトによ
り行なうものであった。
When an arithmetic unit with a processing byte width of multiple bytes executes an instruction to retrieve data of a byte width shorter than the processing byte width from a storage device, perform an operation, and write the result to the storage device, conventionally, the storage device 0 to the data discussed from
was added to match the processing byte width of the arithmetic unit, the status information of the arithmetic result was also checked based on the processing byte width, and writing to the storage device was performed by read/modified write.

このようなりード・モディフアィト・ライトは、記憶装
置のアクセスバイト幅で誤り訂正コード(ECC)を作
成する為に必要となるものであり、全バイトストアより
動作が遅くなることになる。本発明はアクセスバイト幅
に満たないデータの演算処理を、0を付加することなく
バイトマークで指定してアクセスバイト幅で行ない、全
バイトストアできるようにして、処理を高速化すること
を目的とするものである。
Such a modified write is necessary to create an error correction code (ECC) in the access byte width of the storage device, and is slower than a full byte store. The purpose of the present invention is to perform arithmetic processing on data that is less than the access byte width by specifying it with a byte mark without adding 0 to the access byte width, and to speed up the processing by making it possible to store all bytes. It is something to do.

以下実施例について詳細に説明する。第1図は本発明の
実施例のブロック線図であり、AI,A2は命令形式を
示し、OPは命令コード、L1,L2は第1及び第2オ
ペランド長、B1,DIは第1オペランドアドレス、B
2,D2は第2オペランドアドレス、いま第1オペラン
ド長と第2オペランド長とが等しいときのオペランド長
である。
Examples will be described in detail below. FIG. 1 is a block diagram of an embodiment of the present invention, where AI and A2 indicate the instruction format, OP is the instruction code, L1 and L2 are the first and second operand lengths, and B1 and DI are the first operand addresses. , B
2, D2 is the second operand address, which is the operand length when the first operand length and the second operand length are equal.

又LRはオペランド長L1,L2又はLをセットするレ
ジスタ、ALUaは演算処理毎にレジスタLRの内容を
処理バイト幅だけ演算する為の演算回路、BMQましジ
スタLRの内容に従ったバイトマークBMを発生するバ
イトマーク発生回路、AL山ま第1オペランドデータO
PRIと第2オペランドデータOPR2との演算を行な
う演算回路、STGはステータス回路、CCGはコンデ
ィションコード作成回路である。以下演算回路ALUの
処理バイト幅が4バイトの場合について説明するが、本
発明に於ける処理バイト幅はこれに限定されるものでは
ない。バイトマーク発生回路BMGはしジスタLRの内
容が4バイト以上を示すとき、バイトマークBM(BM
O〜BM3)をオール“1”として出力し、3バイト以
下を示すときは、バイトマークBMを演算すべきバイト
について“1”として出力する。
LR is a register for setting the operand length L1, L2 or L, ALUa is an arithmetic circuit for calculating the contents of register LR by the processing byte width for each calculation process, and BMQ is a byte mark BM according to the contents of register LR. The generated byte mark generation circuit, the AL mountain, and the first operand data O
STG is a status circuit, and CCG is a condition code generation circuit. A case will be described below in which the processing byte width of the arithmetic circuit ALU is 4 bytes, but the processing byte width in the present invention is not limited to this. Byte mark generation circuit BMG When the contents of register LR indicate 4 bytes or more, byte mark BM (BM
O to BM3) are all output as "1", and when indicating 3 bytes or less, the byte mark BM is output as "1" for the byte to be calculated.

演算回路ALUはバイトマークBMに従ってバイト単位
の演算処理を行ない、バイト単位のステータス情報ST
をステータス回路STGに加える。又ステータス回路S
TGは演算回路ALUからのステータス情報STとバイ
トマーク発生回路BMGからのバイトマークBMとによ
り、演算結果の零、キャリー、オーバーフロー、ネガテ
ィブ等のステータス情報を作成してコンディションコー
ド作成回路CCGに加え、コンディションコードCCが
出力されてプログラム等に通知される。又演算回路AL
Uの演算結果ARは4バイトのデータであるので、全バ
イトストアが可能となる。第2図は概略動作説明図であ
り、記憶装置MSのアクセスバイト幅が4バイトで、a
,b’c’dの4バイトのデータ中のデータdについて
演算する場合、従来はRDIに示すように、演算すべき
1バイトのデータdが読出され、他の3バイトは0とし
、4バイトのデータが第1オペランドヂータOPRIと
して演算回路ALUに加えられる。
The arithmetic circuit ALU performs arithmetic processing on a byte basis according to the byte mark BM, and generates status information ST on a byte basis.
is added to the status circuit STG. Also status circuit S
The TG uses the status information ST from the arithmetic circuit ALU and the byte mark BM from the byte mark generation circuit BMG to create status information such as zero, carry, overflow, negative, etc. of the operation result, and adds it to the condition code generation circuit CCG. Condition code CC is output and notified to the program, etc. Also, the arithmetic circuit AL
Since the operation result AR of U is 4-byte data, all bytes can be stored. FIG. 2 is a schematic explanatory diagram of the operation, in which the access byte width of the storage device MS is 4 bytes, and a
, b'c'd, when calculating data d in 4 bytes of data, conventionally, as shown in RDI, 1 byte of data d to be calculated is read out, the other 3 bytes are set to 0, and 4 bytes are data is applied to the arithmetic circuit ALU as the first operand data OPRI.

一方本発明に於いては、RD2に示すように、4バイト
のデータa,b,c,dが読出されて演算回路ALUに
加えられる。このとき、オペランド長が1バイトとして
指示されるので、バイトマ−クBMは1バイトについて
の演算を示す内容となる。又第2オペランドデータかO
PR2で示す場合、従来はRDIで示す読出データと第
2オペランドデータOPR2との演算結果はARIで示
すものとなり、1バイトの演算結果データR以外の3バ
イトのデータは0となる。
On the other hand, in the present invention, as shown in RD2, 4 bytes of data a, b, c, d are read out and applied to the arithmetic circuit ALU. At this time, since the operand length is specified as 1 byte, the byte mark BM has contents indicating an operation for 1 byte. Also, the second operand data?
In the case indicated by PR2, conventionally, the result of operation between the read data indicated by RDI and the second operand data OPR2 is indicated by ARI, and 3 bytes of data other than 1 byte of operation result data R become 0.

従って記憶装置MSに演算結果ARIをストアするとき
は、リード・モディフアィト・ライトにより書込みを行
なわなければならないことになる。一方本発明に於いて
な、RD2で示す読出データと第2オペランドデータO
PR2との演算結果は、バイトマークBMにより4バイ
ト目のデータdについての演算が指示されるので、AR
2に示すものとなり、この4バイトのデータa,b,c
,dは記憶装置MSにそのままストアすることができる
ことになる。第3図は本発明の実施例の演算回路部分の
ブロック線図であり、AR,BRは第1及び第2オペラ
ンドデー夕○PR1,OPR2をセットするレジスタ、
ALUO〜ALU3はバイト単位の演算回路、RRは演
算結果をセットするレジスタ、…VI〜mV4はインバ
ー夕、GI〜G8,GI3〜GI5はアンドゲート、G
9〜GI2はオアゲートである。バイトマークBMO〜
BM3はオペランド長が4バイト以上のときオール“1
”となり、アンドゲートG2,G4,G6,G8が開か
れるので、各演算回路ALUO〜ALU3の演算結果が
レジスタRRにセットされる。
Therefore, when storing the operation result ARI in the storage device MS, writing must be performed by read-modify-write. On the other hand, in the present invention, the read data indicated by RD2 and the second operand data O
The result of the operation with PR2 is AR because the byte mark BM instructs the operation on the 4th byte data d.
2, and these 4 bytes of data a, b, c
, d can be stored as they are in the storage device MS. FIG. 3 is a block diagram of the arithmetic circuit portion of the embodiment of the present invention, where AR and BR are registers for setting the first and second operand data PR1 and OPR2;
ALUO to ALU3 are byte unit arithmetic circuits, RR is a register to set the arithmetic results, ... VI to mV4 are inverters, GI to G8, GI3 to GI5 are AND gates, G
9-GI2 is an or gate. Byte Mark BMO~
BM3 is all “1” when the operand length is 4 bytes or more.
'', and the AND gates G2, G4, G6, and G8 are opened, so the operation results of each operation circuit ALUO to ALU3 are set in the register RR.

又オペランド長Lが3以下又は演算処理によるレジスタ
LRの内容が更新されて3以下となり、例えば1を示す
とき、バイトマークBMO〜BM2は“0’、バイトマ
ークBM3が“1”となり、記憶装置MSから4バイト
のデータが読出されてレジスタARにセットされていて
も、バイト0〜2はアンドゲートGI,G3,G5が関
されるので、そのままレジスタRRにセットされ、バイ
ト3のみが演算回路ALU3にに於いて演算され、アン
ドゲートG8及びオアゲートGI2を介してレジスタR
Rにセットされる。即ち第2図について説明した場合と
同様のレジスタRRの内容となる。又演算回路ALUO
〜ALU3間にはアンドゲ−トGI3〜GI5、及びオ
アゲートGI6〜GI8等が接続され、バイトマークB
MI〜BM3に対応してキャリールツクアヘッド(キャ
リの予測)用の信号GBI〜GB3がGI〜G3として
、また信号PBI〜PB3がP1〜P3として、上位バ
イト位置の演算回路ALUO〜2に接続される。
Also, when the operand length L is 3 or less or the contents of the register LR are updated by arithmetic processing and become 3 or less, indicating 1, for example, byte marks BMO to BM2 become "0", byte mark BM3 becomes "1", and the storage device Even if 4 bytes of data are read from MS and set in register AR, bytes 0 to 2 are related to AND gates GI, G3, and G5, so they are set in register RR as they are, and only byte 3 is stored in the arithmetic circuit. It is calculated in ALU3 and sent to register R via AND gate G8 and OR gate GI2.
Set to R. That is, the contents of register RR are the same as those described with reference to FIG. Also, the arithmetic circuit ALUO
AND gates GI3 to GI5 and OR gates GI6 to GI8 are connected between ALU3 and byte mark B.
Corresponding to MI-BM3, signals GBI-GB3 for carry lookup (carry prediction) are connected as GI-G3, and signals PBI-PB3 are connected as P1-P3 to arithmetic circuits ALUO-2 at upper byte positions. Ru.

接続される信号PI〜P3,GI〜G3に基き、演算回
路ALUO〜ALU2のキャリー入力(桁上げ信号)は
以下の論理で作成される。ALUO:P1・P2・P3
・Cin+P1・P2・G3十Pl.G2十GIALU
I:P2・P3・C:n+P2・G3十G2ALU2:
P3・Cin十G3尚CinはALUO〜ALU3に全
体に対してのキャリ入力(桁上げ信号)である。
Based on the connected signals PI to P3 and GI to G3, carry inputs (carry signals) of the arithmetic circuits ALUO to ALU2 are created using the following logic. ALUO: P1, P2, P3
・Cin+P1・P2・G30 Pl. G20 GIALU
I:P2・P3・C:n+P2・G3+G2ALU2:
P3.Cin+G3 Cin is a carry input (carry signal) for all ALUO to ALU3.

第4図はステータス回路STGの一例のブロック線図で
あり、ゲートG20〜G27とフリツプフロツプFFI
により、キヤリー、オーバーフロー、ネガティブのステ
ータス情報CONを出力し、ゲートG28〜G32とフ
リツプフロツプFF2により零のステータス情報Zを出
力するものであり、バイトマークBMO〜BM3とバイ
ト単位の演算回路ALUO〜ALU3からのステータス
情報BOS〜B3Sとの論理により得られるものである
FIG. 4 is a block diagram of an example of the status circuit STG, with gates G20 to G27 and flip-flop FFI.
This outputs carry, overflow, and negative status information CON, and outputs zero status information Z from gates G28 to G32 and flip-flop FF2, and outputs zero status information Z from byte marks BMO to BM3 and byte unit arithmetic circuits ALUO to ALU3. This is obtained by logic with the status information BOS to B3S.

例えばバイトマークBMO〜BM3が“1”で4バイト
総てについて演算する場合、バイト0のステータス情報
BOSによってのみフリップフロップFFIが動作され
、又バイト0〜3のステータス情報BOS〜B3Sが総
て0を示すときのみフリツプフロツプFF2がセットさ
れて零のステータス情報Zが出力される。又バイトマー
クBMO〜BM2が“0”でバイトマークBM3が“1
”即ち1バイトについての演算を行なう場合は、、バイ
ト3のステータス情報B3Sによってのみフリップフロ
ップFFIが動作され、又ステータス情報B3Sが0を
示すときのみフリツプフロツプFF2がセットされる。
コンディションコード作成回路CCGでは、ステータス
回路STGの出力に応じて、例えば演算結果が零のとき
“0び、負のとき“01”、正のとき“1び、オーバー
フローのとき‘‘11”のコンデイションコードを出力
する。
For example, when byte marks BMO to BM3 are "1" and calculation is performed on all 4 bytes, the flip-flop FFI is operated only by the status information BOS of byte 0, and the status information BOS to B3S of bytes 0 to 3 are all 0. Flip-flop FF2 is set and status information Z of zero is output only when this is indicated. Also, bite marks BMO to BM2 are “0” and bite mark BM3 is “1”.
``In other words, when performing an operation on one byte, flip-flop FFI is operated only by status information B3S of byte 3, and flip-flop FF2 is set only when status information B3S indicates 0.''
The condition code generation circuit CCG generates a condition code according to the output of the status circuit STG. output the option code.

第5図はしングス即ちステータス長とバイトマークBM
、ステータス情報等の関係の一例を示すものであり、ゼ
ロチェツクとキヤリー出力とに於ける×印はそのビット
位置に対応するバイト単位の演算回路ALUO〜ALU
3のステータスを考慮する必要がないことを示すもので
ある。
Figure 5 shows status length and byte mark BM
, status information, etc., and the x mark in the zero check and carry output indicates the byte unit arithmetic circuit ALUO to ALU corresponding to that bit position.
This indicates that there is no need to consider status 3.

以上説明したように、本発明は、複数バイトの処理バイ
ト幅の演算回路ALU(ALUO〜ALU3)と、命令
語のオペランド長L又はL1,L2と処理バイト幅との
関係によりバイトマ−クBM(BMO〜BM3)を発生
するバイトマーク発生回路BMGと、バイトマークBM
(BMO〜BM3)と演算回路ALU(ALUO〜AL
U3)のバイト単位のステータス情報ST(BOS〜B
3S)とにより演算結果のステータス情報CON,Zを
作成するステータス回路STGとを備え、記憶回路MS
からは演算回路の処理バイト幅のデータ、即ちアクセス
バイト幅のデータが謙出されて、バイトマークBM(B
MO〜BM3)で指示されたバイト単位で演算され、前
記バイトマークで指示されないバイトについてはそのま
ま出力するもので、演算回路ALUからは記憶装置MS
のアクセスアドレス幅のデ−夕が出力されることになる
ので、1バイト演算に於いても、全バイトストアが可能
となり、可変長データの演算処理を高速化することがで
きることになる。
As explained above, the present invention has an arithmetic circuit ALU (ALUO to ALU3) with a processing byte width of multiple bytes, and a byte mark BM ( A bite mark generation circuit BMG that generates BMO to BM3) and a bite mark BM
(BMO to BM3) and arithmetic circuit ALU (ALUO to AL
Status information ST (BOS~B) in bytes of U3)
3S) and a status circuit STG for creating status information CON, Z of the calculation results, and a storage circuit MS.
The processing byte width data of the arithmetic circuit, that is, the access byte width data is extracted from byte mark BM (B
The calculation is performed in units of bytes specified by MO to BM3), and the bytes not specified by the byte mark are output as they are.
Since data with an access address width of 2 is output, all bytes can be stored even in a 1-byte operation, making it possible to speed up variable-length data arithmetic processing.

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

第1図は本発明の実施例のブロック線図、第2図は従来
例と対比した概略動作説明図、第3図は本発明の実施例
の演算回路部分のブロック線図、第4図は本発明の実施
例のステータス回路の要部ブロック線図、第5図はしン
グスとバイトマーク、ステ−タス情報との説明図である
。 ALU,ALUO〜ALU3は演算回路、BMGはバイ
トマーク発生回路、STGはステータス回路、LR,A
R,BR,RRはしジスタ、CCGはコンデイションコ
ード作成回路である。 第1図 第2図 第3図 第4図 第5図
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a schematic operational explanatory diagram in comparison with a conventional example, FIG. 3 is a block diagram of an arithmetic circuit portion of an embodiment of the present invention, and FIG. FIG. 5 is a block diagram of the main part of the status circuit according to the embodiment of the present invention, and is an explanatory diagram of signs, bite marks, and status information. ALU, ALUO to ALU3 are arithmetic circuits, BMG is a byte mark generation circuit, STG is a status circuit, LR, A
R, BR, and RR are registers, and CCG is a condition code generation circuit. Figure 1 Figure 2 Figure 3 Figure 4 Figure 5

Claims (1)

【特許請求の範囲】[Claims] 1 複数バイトの処理バイト幅の演算回路と、オペラン
ド長と前記処理バイト幅との関係によりバイトマークを
発生するバイトマーク発生回路と、該バイトマーク発生
回路からのバイトマークと前記演算回路からのバイト単
位のステータス情報とにより演算結果のステータス情報
を作成するステータス回路とを備え、前記演算回路の処
理バイト幅のオペランドデータについて前記バイトマー
クで指示されたバイト単位の演算を行ない、前記バイト
マークで指示されないバイトについてはそのまま出力す
ることを特徴とする可変長演算方式。
1. An arithmetic circuit with a processing byte width of multiple bytes, a byte mark generation circuit that generates a byte mark based on the relationship between the operand length and the processing byte width, and a byte mark from the byte mark generation circuit and a byte from the arithmetic circuit. and a status circuit that creates status information of the operation result based on the status information of the unit, and performs the operation in the byte unit indicated by the byte mark on the operand data of the processing byte width of the arithmetic circuit, and performs the operation in the byte unit indicated by the byte mark. A variable length arithmetic method that is characterized by outputting bytes that are not processed as is.
JP15932180A 1980-11-12 1980-11-12 Variable length calculation method Expired JPS607813B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15932180A JPS607813B2 (en) 1980-11-12 1980-11-12 Variable length calculation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15932180A JPS607813B2 (en) 1980-11-12 1980-11-12 Variable length calculation method

Publications (2)

Publication Number Publication Date
JPS5783846A JPS5783846A (en) 1982-05-25
JPS607813B2 true JPS607813B2 (en) 1985-02-27

Family

ID=15691241

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15932180A Expired JPS607813B2 (en) 1980-11-12 1980-11-12 Variable length calculation method

Country Status (1)

Country Link
JP (1) JPS607813B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE3479356D1 (en) * 1983-12-23 1989-09-14 Hitachi Ltd A data processor with control of the significant bit lenghts of general purpose registers
JPH0512821Y2 (en) * 1987-09-25 1993-04-05
JPH01230125A (en) * 1988-03-10 1989-09-13 Nec Corp Data processor having partial updating function of register

Also Published As

Publication number Publication date
JPS5783846A (en) 1982-05-25

Similar Documents

Publication Publication Date Title
JPS6097435A (en) Arithmetic processor
US4542476A (en) Arithmetic logic unit
US4620274A (en) Data available indicator for an exhausted operand string
JP2669158B2 (en) Data processing device
JPH1049369A (en) Data processor
JPS607813B2 (en) Variable length calculation method
US4598359A (en) Apparatus for forward or reverse reading of multiple variable length operands
JPH10260840A (en) Method for coding and storing fuzzy logic rule, and circuit architecture for processing the rule
JPS6227412B2 (en)
US4608633A (en) Method for decreasing execution time of numeric instructions
JPH034936B2 (en)
JP3630804B2 (en) Data processing device
JPH08212075A (en) Information processor
JPS61110240A (en) Optimization compiler
US7103751B1 (en) Method and apparatus for representation of an address in canonical form
JP3140812B2 (en) Five-operand shift instruction method
GB1593136A (en) Data processing
JPH0991118A (en) Floating point arithmetic unit
JPH07253874A (en) Arithmetic unit
JPS6141014B2 (en)
JPH08272605A (en) Address branch circuit, microcomputer and its address branch method
JPS61169934A (en) Method for storing arithmetic result of bit row data in register
JP3522167B2 (en) Arithmetic processing circuit and arithmetic processing method
JPS6148036A (en) Processing unit
JPS59142646A (en) Calculation processing device