JPH0225538B2 - - Google Patents
Info
- Publication number
- JPH0225538B2 JPH0225538B2 JP56151706A JP15170681A JPH0225538B2 JP H0225538 B2 JPH0225538 B2 JP H0225538B2 JP 56151706 A JP56151706 A JP 56151706A JP 15170681 A JP15170681 A JP 15170681A JP H0225538 B2 JPH0225538 B2 JP H0225538B2
- Authority
- JP
- Japan
- Prior art keywords
- register
- sign
- absolute value
- augend
- addition
- 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 - Lifetime
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/50—Adding; Subtracting
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Pure & Applied Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Mathematical Optimization (AREA)
- General Engineering & Computer Science (AREA)
Description
本発明は算術論理演算回路を用いた波形合成等
に用いられる加減算回路に関する。
従来、波形合成を行なう場合はソフトウエアで
行なわれていた。即ち、A,B2種類の波形デー
タを合成する場合、Aの符号がASレジスタに、
絶対値がALレジスタに、Bの符号がBSレジスタ
に、Bの絶対値がBLレジスタに格納されており、
合成波形の符号を格納するレジスタをCSレジス
タ、絶対値を格納するレジスタをCLレジスタと
すると、第1図のようにまずASレジスタの内容
とBSレジスタの内容が共に“正”か“負”の場
合ALレジスタの内容とBレジスタの内容を加算
し加算結果をCLレジスタに格納し、CSレジスタ
にはASレジスタの内容がそのまま格納される。
次にASレジスタの内容が“正”でBSレジスタの
内容が“負”又はASレジスタの内容が“負”で
BSレジスタの内容が“正”の場合、CLレジスタ
にはALレジスタからBLレジスタを減算した結果
が格納される。ここで減算時にボロ−B。が発生
したらASレジスタの内容が反転されてCSレジス
タに格納されボロ−が発生しなかつたら、ASレ
ジスタの内容はそのままCSレジスタに格納され
る。ここでかかる動作を詳細にタイミングを追つ
て検討する。第1図のフローチヤートより合成波
形のデータが得られるのは最低で6ステツプ、最
高で9ステツプ必要となることがわかる。例えば
1MHzのタイミングクロツクで動作しているマイ
クロプロセツサでは1ステツプを実行する時間が
1μsであるので、合成波形のデータが得られるま
でには6〜9μsの時間が必要である。しかしなが
ら音声合成やパターン表示等の処理はリアルタイ
ムで加減算を行なわなければならない。この場合
従来のソフトウエアで行なう方法では計算時間が
すぎて、実質的にリアルタイムでの高速処理がで
きないという欠点があつた。
本発明の目的は上記の欠点を解決した極めて高
速度の加減算処理回路を提供することにある。
本発明は、被加減算数の符号レジスタ、被加減
算数の絶対値レジスタ、加減算数の符号レジス
タ、加減算数の絶対値レジスタ、被加減算数およ
び加減算数の各符号レジスタから入力をうける第
1のEXORゲート、この第1のEXORゲートの
出力をうけ、被加減算数と加減算数の各符号が一
致している時は加算演算を、不一致の時は減算演
算を行う加減算器、加減算器からボロ−出力があ
つた時、前記加減算器の絶対値出力の補数をとる
補数回路、およぞ前記加減算器のボロ−出力と前
記被加減算数の符号レジスタの内容とをうける第
2のEXORゲートを有し、前記第2のEXORゲ
ートの出力を演算結果の符号情報報とすることを
特徴とするものである。
次に本発明の実施例を図面を参照して説明す
る。
第2図は本発明の加減算回路の一実施例を示す
機能ブロツク図で8ビツトの加減算数及び被加減
算数を転送するデータバス1と被加減算数の絶対
値が設定される被加減算数の絶対値レジスタ2
と、加減算数の絶対値が設定される加減算数の絶
対値レジスタ3と、加減算器4と、被加減算数の
符号を設定する加減算数の符号レジスタ6と、
EXORゲート7とEXORゲート8と、排他論理
和(以下EXORと記す)ゲート8からの符号出
力データを格納する演算結果の符号レジスタ9と
加減算器4からの演算出力データの補数をとる補
数回路12と、補数回路12の出力を格納するア
キユムレータ10と、前記加減算器4のボロ−出
力を格納するボローフリツプフロツプから構成さ
れる。
この実施例では加減算用絶対値データ、被加減
算用絶対値データを夫々7ビツトとし、加減算用
符号データ被加減算用符号データを夫々1ビツト
とする。一方EXORゲート7はレジスタ5から
読み出されるデータとレジスタ6から読み出され
るデータが一致している時は加減算器4に加算の
命令を送り、不一致の時は減算の命令を送るもの
である。更にEXORゲート8はレジスタ5から
読み出されるデータが“正”で加減算器4でボロ
−B。が発生しなければ“正”を、ボロ−が発生
した場合は“負”を出力し、レジスタ5から読み
出されたデータが“負”で加減算器4でボロ−が
発生しなければ“負”をボロ−が発生した場合は
“正”を出力するものである。又、ボロ−・フリ
ツプフロツプは加減算器4のボロ−出力B。を記
憶するものである。この様子を示したものを第1
表に示す。ここでボロ−はボロ−が発生した時は
“1”発生しなかつつた時は“0”を示す。
The present invention relates to an addition/subtraction circuit used for waveform synthesis using an arithmetic logic circuit. Conventionally, waveform synthesis has been performed using software. In other words, when combining two types of waveform data, A and B, the sign of A is in the AS register,
The absolute value is stored in the AL register, the sign of B is stored in the BS register, and the absolute value of B is stored in the BL register.
Assuming that the register that stores the sign of the composite waveform is the CS register, and the register that stores the absolute value is the CL register, first, as shown in Figure 1, the contents of the AS register and the BS register are both “positive” or “negative”. In this case, the contents of the AL register and the contents of the B register are added, the addition result is stored in the CL register, and the contents of the AS register are stored as they are in the CS register.
Next, if the contents of the AS register are “positive” and the contents of the BS register are “negative”, or the contents of the AS register are “negative”.
If the contents of the BS register are "positive", the CL register stores the result of subtracting the BL register from the AL register. Here, when subtracting, Boro-B. When this occurs, the contents of the AS register are inverted and stored in the CS register, and if no borrow occurs, the contents of the AS register are stored as they are in the CS register. Here, we will examine the timing of such operations in detail. From the flowchart in FIG. 1, it can be seen that it takes a minimum of 6 steps and a maximum of 9 steps to obtain the composite waveform data. for example
In a microprocessor operating with a 1MHz timing clock, the time it takes to execute one step is
Since the time is 1 μs, it takes 6 to 9 μs to obtain the composite waveform data. However, processing such as voice synthesis and pattern display requires addition and subtraction to be performed in real time. In this case, the conventional software method has the drawback that the calculation time is too long and high-speed processing cannot be performed in real time. SUMMARY OF THE INVENTION An object of the present invention is to provide an extremely high-speed addition/subtraction processing circuit that solves the above-mentioned drawbacks. The present invention provides a first EXOR that receives input from the sign register of the augend, the absolute value register of the augend, the sign register of the addendum and subtractive number, the absolute value register of the addendum and subtractive number, and the sign registers of the augend and the addendum and subtractable number. The gate receives the output of this first EXOR gate, and when the signs of the augend and the number to be added and subtracted match, an addition operation is performed, and when they do not match, a subtraction operation is performed.The adder/subtracter performs a boro-output from the adder/subtractor. a complement circuit that takes the complement of the absolute value output of the adder/subtractor when the adder/subtractor is generated, and a second EXOR gate that receives the boro output of the adder/subtractor and the contents of the sign register of the augend. , the output of the second EXOR gate is used as code information of the calculation result. Next, embodiments of the present invention will be described with reference to the drawings. FIG. 2 is a functional block diagram showing one embodiment of the addition/subtraction circuit of the present invention, showing a data bus 1 for transferring 8-bit addition/subtraction numbers and augends, and the absolute value of the augends for setting the absolute value of the augends. value register 2
, an addition/subtraction number absolute value register 3 in which the absolute value of the addition/subtraction number is set, an adder/subtractor 4, and an addition/subtraction number sign register 6 in which the sign of the addition/subtraction number is set.
EXOR gate 7, EXOR gate 8, an operation result sign register 9 that stores the sign output data from the exclusive OR (hereinafter referred to as EXOR) gate 8, and a complement circuit 12 that takes the complement of the operation output data from the adder/subtractor 4. , an accumulator 10 for storing the output of the complement circuit 12, and a borrow flip-flop for storing the borrow output of the adder/subtractor 4. In this embodiment, the absolute value data for addition and subtraction and the absolute value data for addition and subtraction augends are each 7 bits, and the code data for addition and subtraction and the code data for addition and subtraction augends are each 1 bit. On the other hand, the EXOR gate 7 sends an addition command to the adder/subtractor 4 when the data read from the register 5 and the data read from the register 6 match, and sends a subtraction command when they do not match. Further, when the data read from the register 5 is "positive", the EXOR gate 8 outputs BORO-B in the adder/subtractor 4. If the data read from the register 5 is "negative" and no borrow occurs in the adder/subtractor 4, it outputs "positive" and if a borrow occurs, it outputs "negative". If a ``borrow'' occurs, a ``positive'' signal is output. Also, the boro flip-flop is the boro output B of the adder/subtractor 4. It is something to remember. The first one shows this situation.
Shown in the table. Here, the BORO indicates "1" when a BORO occurs, and "0" when no BORO occurs.
【表】
以下に本実施例の動作を説明する。まず7ビツ
トの被加減算数の絶対値をデータバス1より被加
減算数の絶対値レジスタ2にセツトし、同じく加
減算数の絶対値をデータバス1より加減算数の絶
対値レジスタ3にセツトする。ここに加減算命令
が出ると、被加減算数の符号レジスタ5に設定し
た被加減算数の符号が“正”(0)で、加減算数
の符号レジスタ6に設定した加減算数の符号が
“正”(0)の場合、EXOR回路7は、“加算命
令”(0)を加算器4に指令する。加減算器4に
は被加減算数の絶対値レジスタのデータと加減算
数の絶対値レジスタ3のデータが印加されている
ので加算器4の出力Sより被加減算数の絶対値と
加減算数の絶対値とが加算されてアキユムレータ
10に入力される。ここで加減算器4は加算が行
なわれボロ−は発生しないのでボロ−出力B。は
“0”をEXOR回路8ボロー・フリツプフロツプ
11に出力し、被加減算数の符号は“正”(0)
であるからEXOR回路8は“0”(正)を演算結
果の符号レジスタ9に出力する。
次に被加減算数の符号が“負”(1)で加減算
数の符号が“正”(0)の場合、EXOR回路7は
“減算命令”(1)を加減算器4に指令し、被加減
算数の絶対値と加減算数の絶対値は減算される。
ここで被加減算数の絶対値が加減算数の絶対値よ
り小さかつた場合、加減算器のボロ−出力は
“1”を出力し、被加減算数の符号は“負”(1)
であるからEXOR回路8は“0”(正)を演算結
果の符号レジスタ9に出力し、ボロー・フリツプ
フロツプ11に“1”を出力する。さらに、ボロ
−出力に基いて加減算器の絶対値出力の補数が補
数回路12により生成され、アキユムレータ10
に格納される。
以上の構成において、加減算器4はALUでも
よい。又加減算器4のボロ−出力B。からボロ−
フリツプフロツプ11に出力されている反転指令
は加減算数の符号レジスタ5の内容と演算結果の
符号レジスタ9の内容とのEXOR出力でもよい。
以上のようにして加算が実行される。本発明に
よれば、従来ソフトウエアで16ステツプ必要だつ
たのが第3図のように4ステツプで済み、面倒な
ソフトウエアが簡単化される。又1つの演算結果
を出すのにソフトウエアでは6〜9ステツプかか
つていたものが3ステツプで行なわれ、従来のソ
フトウエアによる波形合成演算に比べて2倍から
3倍の演算速度を得ることができる。
従つて本実施例の加減算回路を一般のマイクロ
コンピユータに適用すると従来のものに比べソフ
トウエアの負担が軽減され、約1/2から1/3の時間
で加減算が終了され、リアルタイム処理には極め
て好適である。[Table] The operation of this embodiment will be explained below. First, the absolute value of the 7-bit augend is set from the data bus 1 into the absolute value register 2 of the augend, and similarly the absolute value of the number of addition and subtraction is set from the data bus 1 into the absolute value register 3 of the number of addition and subtraction. When an addition/subtraction instruction is issued here, the sign of the augend set in the sign register 5 of the augend is "positive" (0), and the sign of the number of addition/subtraction set in the sign register 6 of the number of addition/subtraction is "positive" (0). 0), the EXOR circuit 7 issues an "addition command" (0) to the adder 4. Since the data in the absolute value register of the augend and the data in the absolute value register 3 of the number to be added and subtracted are applied to the adder/subtractor 4, the absolute value of the augend and the absolute value of the number to be added/subtracted are obtained from the output S of the adder 4. are added and input to the accumulator 10. Here, the adder/subtractor 4 performs addition and no boro is generated, so the boro output is B. outputs “0” to the EXOR circuit 8 borrow flip-flop 11, and the sign of the augend is “positive” (0).
Therefore, the EXOR circuit 8 outputs "0" (positive) to the sign register 9 of the operation result. Next, if the sign of the augend is “negative” (1) and the sign of the augend is “positive” (0), the EXOR circuit 7 instructs the adder/subtractor 4 to “subtract command” (1), and the sign of the augend is “positive” (0). Absolute value of number and addition/subtractionThe absolute value of number is subtracted.
Here, if the absolute value of the augend is smaller than the absolute value of the augend, the boro output of the adder/subtractor outputs "1", and the sign of the augend is "negative" (1).
Therefore, the EXOR circuit 8 outputs "0" (positive) to the sign register 9 of the operation result, and outputs "1" to the borrow flip-flop 11. Further, the complement of the absolute value output of the adder/subtractor is generated based on the boro output by the complement circuit 12, and the complement of the absolute value output of the adder/subtracter is generated by the
is stored in In the above configuration, the adder/subtractor 4 may be an ALU. Also, the boro-output B of the adder/subtractor 4. Karatara-
The inversion command output to the flip-flop 11 may be an EXOR output of the contents of the sign register 5 of the addition/subtraction number and the contents of the sign register 9 of the operation result. Addition is performed as described above. According to the present invention, the 16 steps required in conventional software are reduced to 4 steps as shown in FIG. 3, simplifying the complicated software. In addition, to produce one calculation result, software now takes 3 steps instead of 6 to 9 steps, which is now 2 to 3 times faster than waveform synthesis calculations using conventional software. can. Therefore, if the addition/subtraction circuit of this embodiment is applied to a general microcomputer, the burden on the software will be reduced compared to the conventional one, and addition/subtraction will be completed in approximately 1/2 to 1/3 of the time, making it extremely suitable for real-time processing. suitable.
第1図は従来の加減算のフローチヤートであ
り、第2図は本発明の一実施例を示すブロツク
図、第3図は本発明におけるフローチヤートであ
る。
1……データバス、2……被加減算数の絶対値
レジスタ、3……加減算数の絶対値レジスタ、4
……加減算器(ALU)、5……加減算数の符号レ
ジスタ、6……被加減算数の符号レジスタ、7,
8……EXOR回路、9……演算結果の符号レジ
スタ、10……アキユムレータ(演算結果の絶対
値レジスタ)、11……ボローフリツプフロツプ、
12……補数回路。
FIG. 1 is a flowchart of conventional addition and subtraction, FIG. 2 is a block diagram showing an embodiment of the present invention, and FIG. 3 is a flowchart of the present invention. 1...Data bus, 2...Absolute value register for the augend, 3...Absolute value register for the number to be added and subtracted, 4
... Addition and subtraction unit (ALU), 5 ... Sign register for addition and subtraction numbers, 6 ... Sign register for addition and subtraction numbers, 7,
8...EXOR circuit, 9...Sign register for operation result, 10...Accumulator (absolute value register for operation result), 11...Borrow flip-flop,
12... Complement circuit.
Claims (1)
対値レジスタ、加減算数の符号レジスタ、加減算
数の絶対値レジスタ、被加減算数および加減算数
の各符号レジスタから入力をうける第1の
EXORゲート、該第1のEXORゲートの出力を
うけ、被加減算数と加減算数の各符号が一致して
いる時は加算演算を、不一致の時は減算演算を行
う加減算器、該加減算器からボロ−出力があつた
時、前記加減算器の絶対値出力の補数をとる補数
回路、および前記加減算器のボロー出力と前記被
加減算数の符号レジスタの内容とをうける第2の
EXORゲートを有し、前記第2のEXORゲート
の出力を演算結果の符号情報とすることを特徴と
する加減算回路。1 The first register that receives input from the sign register of the augend, the absolute value register of the augend, the sign register of the addendum and subtractive number, the absolute value register of the addendum and subtractive number, and the sign registers of the augend and subtractable number.
EXOR gate, receives the output of the first EXOR gate, performs an addition operation when the signs of the augend and the number to be added/subtracted match, and performs a subtraction operation when they do not match; - a complement circuit that takes the complement of the absolute value output of the adder/subtractor when the output is received; and a second complement circuit that receives the borrow output of the adder/subtractor and the contents of the sign register of the augend;
An addition/subtraction circuit comprising an EXOR gate and using the output of the second EXOR gate as sign information of an operation result.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP15170681A JPS5852747A (en) | 1981-09-25 | 1981-09-25 | Adding and subtracting circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP15170681A JPS5852747A (en) | 1981-09-25 | 1981-09-25 | Adding and subtracting circuit |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS5852747A JPS5852747A (en) | 1983-03-29 |
| JPH0225538B2 true JPH0225538B2 (en) | 1990-06-04 |
Family
ID=15524482
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP15170681A Granted JPS5852747A (en) | 1981-09-25 | 1981-09-25 | Adding and subtracting circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5852747A (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5930143A (en) * | 1982-08-11 | 1984-02-17 | Hitachi Ltd | Arithmetic processing method |
| JPS62212080A (en) * | 1986-03-12 | 1987-09-18 | Kawasaki Steel Corp | Control device for flash butt welding machine |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5647841A (en) * | 1979-09-22 | 1981-04-30 | Kokusai Denshin Denwa Co Ltd <Kdd> | Pcm signal operation system |
-
1981
- 1981-09-25 JP JP15170681A patent/JPS5852747A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS5852747A (en) | 1983-03-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4953115A (en) | Absolute value calculating circuit having a single adder | |
| US4992969A (en) | Integer division circuit provided with a overflow detector circuit | |
| US4503511A (en) | Computing system with multifunctional arithmetic logic unit in single integrated circuit | |
| US4677582A (en) | Operation processing apparatus | |
| JPH0225538B2 (en) | ||
| JPH03135627A (en) | Fuzzy arithmetic unit | |
| JPH0380324A (en) | central processing unit | |
| JPH0511980A (en) | Overflow detecting method and circuit | |
| JP2520484B2 (en) | Division circuit | |
| JPS61138334A (en) | Decimal arithmetic processor | |
| JP2575856B2 (en) | Arithmetic circuit | |
| JPH0330170B2 (en) | ||
| JPS6188334A (en) | Divider circuit | |
| JP3110072B2 (en) | Pre-normalization circuit | |
| JP3139011B2 (en) | Fixed-point processor | |
| GB857511A (en) | Improvements in or relating to dividing multiplying arrangements for electronic digital computing machines | |
| JP2604667B2 (en) | Arithmetic unit with prediction function | |
| JP2542120B2 (en) | Information processing device | |
| JPH0316650B2 (en) | ||
| JPS6118219B2 (en) | ||
| JPS6129020B2 (en) | ||
| JPH01240961A (en) | Dma transfer system | |
| JPS60140427A (en) | Decimal notation adding and subtracting system | |
| JPH03150631A (en) | Decimal dividing circuit | |
| JPS5864000A (en) | Waveform synthesization circuit |