JPH03144725A - Remainder arithmetic unit - Google Patents

Remainder arithmetic unit

Info

Publication number
JPH03144725A
JPH03144725A JP28326589A JP28326589A JPH03144725A JP H03144725 A JPH03144725 A JP H03144725A JP 28326589 A JP28326589 A JP 28326589A JP 28326589 A JP28326589 A JP 28326589A JP H03144725 A JPH03144725 A JP H03144725A
Authority
JP
Japan
Prior art keywords
output
value
remainder
multiplexer
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.)
Granted
Application number
JP28326589A
Other languages
Japanese (ja)
Other versions
JP2507094B2 (en
Inventor
Riichi Suzuki
利一 鈴木
Katsuhiko Ueda
勝彦 上田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP28326589A priority Critical patent/JP2507094B2/en
Publication of JPH03144725A publication Critical patent/JPH03144725A/en
Application granted granted Critical
Publication of JP2507094B2 publication Critical patent/JP2507094B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

PURPOSE:To rapidly execute remainder operation by executing the adding operation of two values and the subtraction of a remainder base from the added result of two values in parallel. CONSTITUTION:An adder 16 adds the values, i.e. the output value of an up counter and an offset value N (0<=N<=M-1) applied from the external and inputs the added value to a multiplexer 18. In parallel with the addition, a subtractor 17 subtracts the output value of a down counter from an offset value N and inputs the subtracted value to the multiplexer 18. A control means for detecting the positive/negative of the output value of the subtractor 17 and instructing selection to the multiplexer 18 instructs the multiplexer 18 to select and output the output of the adder 16 when the output of the subtractor 17 is negative or select and output the subtractor output when the subtractor output is positive or '0' as the remainder computing result of the added value of two values, i.e. the output value of the up counter and the offset value N applied from the external. Thus, the operation rapidly is executed.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は 加算値の剰余演算を行なう剰余演算装置に関
する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a remainder arithmetic device that performs remainder arithmetic on addition values.

従来の技術 2つの数の加算値の剰余計算を行なう従来の剰余演算装
置として(よ 例えば 特開昭61−223946号公
報に示されていも 第2図はこの従来の剰余演算装置の構成図を示すもので
あり、21は2つの数A及びBを入カレ加算値Sと中間
桁上げビットCを出力する加算器である。22は加算器
21の加算値出力Sと剰余基数Mを入力L  S−Mを
求める減算器であ瓜22は加算器21の出力Sと減算器
22の出力SMのいずれか一方を出力するマルチプレク
サ、24は制御論理回路であり、その出力はマルチプレ
クサ23に接続されている。
BACKGROUND OF THE INVENTION A conventional remainder arithmetic device for calculating the remainder of the sum of two numbers (for example, as shown in Japanese Patent Laid-Open No. 61-223946, FIG. 2 shows a block diagram of this conventional remainder arithmetic device). 21 is an adder that inputs two numbers A and B and outputs an added value S and an intermediate carry bit C. 22 is an adder that inputs two numbers A and B and outputs an added value S and an intermediate carry bit C. It is a subtracter for calculating SM, and 22 is a multiplexer that outputs either the output S of the adder 21 or the output SM of the subtracter 22, and 24 is a control logic circuit whose output is connected to the multiplexer 23. ing.

以上の様に構成された従来の剰余演算装置において(よ
 2数の和A+Bの剰余基数Mに対する剰余をY(0≦
Y≦M−1)とすると、剰余Yの演算を A+B<M  の場合、Y=A+B A十B≧M の場合、Y=A十B−M の値をそれぞれ採用することで実現している。即板 加
算器21が2つの数A及びBの加算値A十Bを出力し 
減算器22が(A十B)−Mの値を出力する。更に 制
御論理回路24が加算器21の中間桁上げビットを用い
て、A+Bの値が剰余の上限を越えたかどうかを検出し
てマルチプレクサ23を制′aL、  マルチプレクサ
23からA+B<M  の場合に(よ 加算器21の出
力を、A十B≧M の場合に(友 減算器22の出力を
出力すも 発明が解決しようとする課題 しかしながら上記のような構成で(よ 先ず、2つの数
の加算を加算器21で行な(\ 然る後にその加算結果
を減算器22に入力し 剰余基数値との減算を行なって
いるので、剰余演算速度がこの2つの演算器の演算速度
の合計で決定されも それ故、特に演算を行なう2つの
数のビット数が増加する毘 剰余演算速度が低下すると
いう問題点を有していた 本発明の目的ji  A、  Bいずれか一方の数が連
続的に変化する2つの数の加算値の剰余計算を行なう際
に 演算回数を減少し 演算の高速化を実現できる剰余
演算装置を提供することにある。
In the conventional remainder arithmetic device configured as described above, the remainder of the sum of two numbers A+B with respect to the remainder base M is calculated by
When Y≦M-1), the calculation of the remainder Y is realized by adopting the following values: When A+B<M, Y=A+B; When A0B≧M, Y=A0B-M. . Adder 21 outputs the sum of two numbers A and B, A and B.
The subtracter 22 outputs the value (A+B)-M. Furthermore, the control logic circuit 24 uses the intermediate carry bit of the adder 21 to detect whether the value of A+B exceeds the upper limit of the remainder and controls the multiplexer 23. The output of the adder 21 is output when A0B≧M.The problem to be solved by the invention is, however, when the output of the subtractor 22 is is performed by the adder 21 (\ After that, the addition result is input to the subtracter 22 and subtracted from the remainder base value, so the remainder calculation speed is determined by the sum of the calculation speeds of these two calculation units. Therefore, the object of the present invention has the problem that the speed of remainder calculation decreases especially when the number of bits of the two numbers to be operated on increases. It is an object of the present invention to provide a remainder arithmetic device capable of reducing the number of operations and realizing faster arithmetic operations when performing a remainder calculation of an added value of two changing numbers.

課題を解決するための手段 本発明(上 外部から与えられるクロック信号を、0を
初期値とし 周期Mでカウントするアップカウンタと、
前記クロック信号を、Mを初期値とし前記アップカウン
タと同期する周期Mでカウントするダウンカウンタと、
前記アップカウンタ出力と外部から与えられるオフセッ
ト値N(0≦N≦M−1)の加算を行なう加算器と、前
記オフセット値Nから前記ダウンカウンタ出力を減算す
る減算器と、前記加算器記山分 前記減算器出力のどち
らか一方を出力するマルチプレクサと、前記減算器出力
が負数の場合は前記加算器出力を選択することを、前記
減算器出力が正数もしくは0の場合は前記減算器出力を
選択することを、前記マルチプレクサに指示する制御手
段とを備えた剰余演算装置 作   用 本発明は前記した構成により、アップカウンタ出力値と
外部から与えられるオフセット値N(0≦N≦M−1)
との2値の加算を加算器が行ない加算値をマルチプレク
サに人力する。これと並列に オフセット値Nからのダ
ウンカウンタ出力値の減算を減算器が行ない減算値をマ
ルチプレクサに入力する。減算器出力値の正負を検出し
マルチプレクサに選択を指示する制御手段(よ 減算器
出力が負数の場合は加算器出力を、減算器出力が正数も
しくは0の場合は減算器出力を、アップカウンタ出力値
と外部から与えられるオフセット値Nとの2値の加算値
の剰余演算結果として選択、出力することをマルチプレ
クサに指示する。
Means for Solving the Problems The present invention (Part 1) An up counter that counts a clock signal applied from the outside at a period M with an initial value of 0;
a down counter that counts the clock signal at a period M synchronized with the up counter, with M as an initial value;
an adder for adding the up-counter output and an externally given offset value N (0≦N≦M-1); a subtracter for subtracting the down-counter output from the offset value N; and the adder recorder. a multiplexer that outputs either one of the subtracter outputs, and selects the adder output when the subtracter output is a negative number; and selects the adder output when the subtracter output is a positive number or 0; The present invention has the above-described configuration, so that the up-counter output value and the offset value N (0≦N≦M-1 )
The adder performs the addition of the two values, and the added value is manually input to the multiplexer. In parallel with this, a subtracter subtracts the down counter output value from the offset value N, and inputs the subtracted value to the multiplexer. A control means that detects whether the subtracter output value is positive or negative and instructs the multiplexer to select it. The multiplexer is instructed to select and output the remainder calculation result of the binary addition value of the output value and the offset value N given from the outside.

実施例 第1図は本発明の実施例における剰余演算装置のブロッ
ク図を示すものである。
Embodiment FIG. 1 shows a block diagram of a remainder calculation device in an embodiment of the present invention.

第1図において、 !■は外部から与えられるクロック
信号。 12は同じく外部から与えられるリセット信号
 13はリセット信号12人力時にその内容を0とし 
リセット信号12が解除されるとクロック信号]1を周
期Mでカウントレ その内容を 0、 1. 2.   ・・、  M−2,M−1,0
,1゜2、 ・・・ とするアップカラン久 14はリセット信号12人力時
にその内容をMとし リセット信号12が解除されると
クロック信号11をアップカウンタ13と同期する周期
Mでカウントし その内容をM、  M−1,M−2,
・ 、  2. 1.  M。
In Figure 1, ! ■ is a clock signal given externally. 12 is a reset signal that is also given from the outside. 13 is a reset signal whose contents are set to 0 when 12 is manually operated.
When the reset signal 12 is released, the clock signal]1 is counted with a period M and its contents are set to 0, 1. 2. ..., M-2, M-1,0
, 1゜2, . . . When the reset signal 12 is manually operated, the content is M. When the reset signal 12 is released, the clock signal 11 is counted at a period M that is synchronized with the up counter 13. M, M-1, M-2,
・ , 2. 1. M.

M−1,M−2,・・ とするダウンカラン久 15は外部から与えられるオフ
セット値N (0≦N≦M−1)、 16はアップカウ
ンタ13出力とオフセット値I5を人力ヒ その加算値
を出力する加算器 17はダウンカウンタ14出力とオ
フセット値15を入カレオフセット値15からダウンカ
ウンタ14出力値を引いた値を出力する減算器 18は
加算器16出力及び減算器17出力のいずれか一方を出
力するマルチプレクサ、 19は減算器17出力の符号
ビットを人力し その正負を判定 マルチプレクサ18
に制御信号を出力する正負判定回路である。
15 is the offset value N (0≦N≦M-1) given from the outside, and 16 is the sum of the output of the up counter 13 and the offset value I5 manually. An adder 17 outputs the output of the down counter 14 and an offset value 15. A subtractor outputs the value obtained by subtracting the output value of the down counter 14 from the offset value 15. 18 is either the output of the adder 16 or the output of the subtracter 17. A multiplexer 19 outputs one of the subtracters 17 and 19 manually inputs the sign bit of the subtracter 17 output and determines whether it is positive or negative. Multiplexer 18
This is a positive/negative determination circuit that outputs a control signal to the

以上の様に構成された本実施例の剰余演算装置について
、以下その動作を説明する。
The operation of the remainder arithmetic device of this embodiment configured as described above will be explained below.

アップカウンタ13及びダウンカウンタ14がリセット
信号12の解除後、クロック信号11のカウントをはじ
ム アップカウンタ11の内容がmとなるとダウンカウ
ンタ12の内容ははM−mとなっていも これに伴ない
加算器16はN+mを出力し 同時に減算器14はN−
(M−m)=N+m−Mを出力する。
After the reset signal 12 is released, the up counter 13 and the down counter 14 start counting the clock signal 11. When the content of the up counter 11 becomes m, even though the content of the down counter 12 becomes M-m. Adder 16 outputs N+m, and at the same time subtracter 14 outputs N-
(M-m)=N+m-M is output.

従って、剰余演算結果として(よ N + m < M  の場合に(よ 加算器16の出
力値N+mを、 N十m≧M の場合に(よ 減算器17の出力値N+m
−Mを 選択すれば良し1 そこで正負判定回路191戴  減算器17の出力値N
十m−Mの正負を判定よ マルチプレクサ16において
、 N+m−M< 0  即tshN+m<Mの場合には加
算器16の出力値を N+m−M≧0 節板 N十m≧Mの場合に(戴減算器
17の出力値を 剰余演算結果として出力するようにマルチプレクサ18
に制御信号を出力する。
Therefore, as the result of the remainder operation, if N + m < M, then the output value N+m of the adder 16, and if N0m≧M, then the output value N+m of the subtracter 17,
-M should be selected 1 Therefore, the positive/negative judgment circuit 191 The output value N of the subtracter 17
Determine whether 10m-M is positive or negative.In the multiplexer 16, if N+m-M<0, that is, tshN+m<M, the output value of the adder 16 is changed to N+m-M≧0. A multiplexer 18 outputs the output value of the subtracter 17 as a remainder calculation result.
Outputs a control signal to.

以上のように 本実施例によれ(′L 2つの数N及び
mの加算値力丈 剰余の上限を越えない場合の演算結果
を加算器16において、剰余の上限を越えた場合の演算
結果を減算器17において、それぞれ並列に演算するこ
とにより、剰余演算の高速化を可能としている。
As described above, according to the present embodiment, the adder 16 uses the calculation result when the upper limit of the remainder is not exceeded, and the calculation result when the upper limit of the remainder is exceeded. In the subtracter 17, by performing each calculation in parallel, it is possible to speed up the remainder calculation.

発明の詳細 な説明したように 本発明によれば 2つの数の加算値
の演算と、 2つの数の加算値からの剰余基数の減算を
並列に行なうことによって剰余演算を高速化することが
でき、その実用的効果は大き鶏
As described in detail, according to the present invention, it is possible to speed up the remainder calculation by performing the calculation of the sum of two numbers and the subtraction of the number of remainder bases from the sum of the two numbers in parallel. , its practical effect is great

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

第1図は本発明に於ける一実施例の剰余演算装置のブロ
ックは 第2図は従来の剰余演算装置のブロック図であ
る。 13・・・アップカラン久 14・・・ダウンカラン久
16・・・加算5. 17・・・減算器19・・・正負
判定回1%  18・・・マルチプレクサ。
FIG. 1 is a block diagram of a remainder calculation device according to an embodiment of the present invention. FIG. 2 is a block diagram of a conventional remainder calculation device. 13...up callan kyu 14...down callan kyu16...addition 5. 17... Subtractor 19... Positive/negative judgment times 1% 18... Multiplexer.

Claims (1)

【特許請求の範囲】[Claims] 外部から与えられるクロック信号を、0を初期値とし、
周期Mでカウントするアップカウンタと、前記クロック
信号を、Mを初期値とし前記アップカウンタと同期する
周期Mでカウントするダウンカウンタと、前記アップカ
ウンタ出力と外部から与えられるオフセット値N(0≦
N≦M−1)の加算を行なう加算器と、前記オフセット
値Nから前記ダウンカウンタ出力を減算する減算器と、
前記加算器記出力、前記減算器出力のどちらか一方を出
力するマルチプレクサと、前記減算器出力が負数の場合
は前記加算器出力を選択することを、前記減算器出力が
正数もしくは0の場合は前記減算器出力を選択すること
を、前記マルチプレクサに指示する制御手段とを備えた
ことを特徴とする剰余演算装置。
The clock signal given from the outside is set to 0 as an initial value,
an up counter that counts with a cycle M; a down counter that counts the clock signal with a cycle M that synchronizes with the up counter with M as an initial value; and an offset value N (0≦
an adder that performs addition (N≦M-1); a subtracter that subtracts the down counter output from the offset value N;
A multiplexer that outputs either the adder output or the subtracter output, and selects the adder output when the subtracter output is a negative number, and when the subtracter output is a positive number or 0. and control means for instructing the multiplexer to select the output of the subtracter.
JP28326589A 1989-10-30 1989-10-30 Remainder calculation device Expired - Lifetime JP2507094B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28326589A JP2507094B2 (en) 1989-10-30 1989-10-30 Remainder calculation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28326589A JP2507094B2 (en) 1989-10-30 1989-10-30 Remainder calculation device

Publications (2)

Publication Number Publication Date
JPH03144725A true JPH03144725A (en) 1991-06-20
JP2507094B2 JP2507094B2 (en) 1996-06-12

Family

ID=17663218

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28326589A Expired - Lifetime JP2507094B2 (en) 1989-10-30 1989-10-30 Remainder calculation device

Country Status (1)

Country Link
JP (1) JP2507094B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010044398A (en) * 1999-04-07 2010-02-25 Panasonic Corp Multiple precision arithmetic device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010044398A (en) * 1999-04-07 2010-02-25 Panasonic Corp Multiple precision arithmetic device

Also Published As

Publication number Publication date
JP2507094B2 (en) 1996-06-12

Similar Documents

Publication Publication Date Title
JPS60140422A (en) Arithmetic processing unit
JPH03144725A (en) Remainder arithmetic unit
JP2556904B2 (en) High-speed adder / subtractor
JP3530418B2 (en) Multiplier
JP2605715B2 (en) Division circuit
JP3034385B2 (en) Tone control information gradual change circuit
JPS60235241A (en) Floating point adding circuit
JPS6152493B2 (en)
JPH0213129A (en) Counter circuit
JPS5825458Y2 (en) index display device
JPS6027025A (en) Division circuit
JPH01185726A (en) Divider
JPH0797312B2 (en) Arithmetic unit
JP3122622B2 (en) Division device
SU1617445A1 (en) Device for substracting polynomials
KR100198783B1 (en) Driving method of serial operating divider
JPH03135362A (en) Control of cycle of ac voltage
JPH0348331A (en) Floating point arithmetic unit
JP2552029B2 (en) Arithmetic circuit device
JPH052470A (en) Adder-subtractor device
JPH04114232A (en) Microcomputer
JPH066193A (en) Pulse width modulation circuit
JPS5985539A (en) Division processor
JPH05100825A (en) Normalization floating point adder/subtracter
JPH04369726A (en) Arithmetic control circuit