JPH0241051B2 - SAIKINCHIHANTEIKAIRO - Google Patents
SAIKINCHIHANTEIKAIROInfo
- Publication number
- JPH0241051B2 JPH0241051B2 JP10307281A JP10307281A JPH0241051B2 JP H0241051 B2 JPH0241051 B2 JP H0241051B2 JP 10307281 A JP10307281 A JP 10307281A JP 10307281 A JP10307281 A JP 10307281A JP H0241051 B2 JPH0241051 B2 JP H0241051B2
- Authority
- JP
- Japan
- Prior art keywords
- signal
- circuit
- value
- output
- signals
- 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/02—Comparing digital values
- G06F7/026—Magnitude comparison, i.e. determining the relative order of operands based on their numerical value, e.g. window comparator
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Logic Circuits (AREA)
- Complex Calculations (AREA)
Description
本発明はいくつかの信号値の中から与えられた
信号値に対してもつとも近い値をとる信号値を判
定する回路に関する。
3つのデイジタル信号X,AおよびBがあり、
Xに対してAとBのどちらがXにより近い値であ
るかの判定を行なう場合、(X−A)の絶対値|
X−A|と(X−B)の絶対値|X−B|の大小
を比較することによつて判定することができる。
従来、信号Xに対してAとBのどちらがXによ
り近いかの判定を行なう回路(以下、最近値を判
定する回路を最近値判定回路と呼ぶ)は|X−A
|と|X−B|の大小比較をデイジタルの回路素
子を用いて構成することによつて実現していた。
この場合、|X−A|を計算するのに減算回路と
絶対値回路(例えば信号が2の補数で表わされて
いる場合は排他論理和回路と加算回路より構成で
きる。)が必要である。したがつて|X−A|と
|X−B|の大小比較を行なう方法で構成された
最近値判定回路は、各々2つの減算回路と絶対値
回路、および1つの大小比較回路が必要であり回
路規模が大きくなる欠点を有している。
本発明の目的は与えられた信号Xに対して2つ
の信号AとBのどちらが信号Xに近い値を有して
いるかの判定を簡単に構成できる最近値判定回路
を提供することにある。
本発明は信号Xに対して2つの信号AとBのど
ちらがXに近い値を有するかを判定する最近値判
定回路において、信号X,AおよびBから(2X
−A−B)の正負を示す第1の符号信号と(A−
B)の正負を示す第2の符号信号を求め、求めた
第1および第2の符号信号から最近値判定を行な
う手段をそなえた回路より構成される。
本発明によれば最近値判定回路は1例として、
(2X−(A+B))と(A−B)の符号を求めるた
めの1つの加算回路と2つの大小比較回路および
求めた符号から最近値判定を行なうゲート回路と
で最近値判定回路が構成できるため|X−A|と
|X−B|の大小比較より判定する従来の回路構
成に比して回路が簡単になる。また他の利点とし
ては|X−A|と|X−B|の大小比較による方
法ではX,AおよびBの信号は入力してから判定
結果が出力されるまで減算、絶対値および大小比
較の3段の処理がかかる。一方本発明によればX
に対しては大小比較とゲートの処理が、Aおよび
Bに対しては加算と大小比較とゲートの処理です
み処理時間を短かくすることができより高速の演
算が実現できる。
以下、本発明について詳細に説明する。
|X−A|と|X−B|の大小関係は(X−
A)2と(X−B)2の大小関係と一致する。したが
つて(X−A)2と(X−B)2の大小関係がわかれ
ば最近値判定を行なうことができる。いま関数F
を
F=(X−A)2−(X−B)2 (1)
とおきFの正、負または0の符号を求めれば|X
−A|と|X−B|の大小判定が行なえ、したが
つてAとBの中からXへの最近値を判定すること
ができる。
(1)式を変形すれば(2)式のようになる。
F=(X−A)2−(X−B)2
=−2(X−A−B)(A−B)
=−2(X−A+B/2)(A−B) (2)
(2)式より(X−A+B/2)、すなわち(2X−A
−B)、の符号および(A−B)の符号がわかれ
ば関数Fの符号を決定できる。例えば(X−
A+B/2)>0で(A−B)<0の場合F=−2(X
−A+B/2)(A−B)>0となる。すなわち|X
−A|−|X−B|>0であることによりXに対
する最近値はBと判定される。
表1に(X−A+B/2)と(A−B)の関数F、
すなわち|X−A|−|X−B|、の符号関係を
1〜9までに場合分けして示す。
The present invention relates to a circuit that determines, from among several signal values, a signal value that is closest to a given signal value. There are three digital signals X, A and B,
When determining whether A or B is closer to X, the absolute value of (X-A) |
This can be determined by comparing the magnitude of the absolute value |X-B| of X-A| and (X-B). Conventionally, a circuit that determines which of A and B is closer to X with respect to signal X (hereinafter, a circuit that determines the latest value is referred to as the latest value determination circuit) is |X-A
Comparing the magnitudes of | and |X-B| was achieved by constructing digital circuit elements.
In this case, to calculate |X-A|, a subtraction circuit and an absolute value circuit (for example, if the signal is expressed in two's complement, it can be configured with an exclusive OR circuit and an addition circuit) are required. . Therefore, the nearest value determination circuit configured by comparing the magnitudes of |X-A| and |X-B| requires two subtraction circuits, two absolute value circuits, and one magnitude comparison circuit. This has the disadvantage of increasing the circuit scale. An object of the present invention is to provide a nearest value determination circuit that can easily configure a determination as to which of the two signals A and B has a value closer to the signal X with respect to a given signal X. The present invention uses (2X
-A-B) and a first code signal indicating the positive/negative of (A-B);
The second code signal indicating the positive/negative of B) is obtained, and the circuit includes a means for determining the nearest value from the obtained first and second code signals. According to the present invention, the latest value determination circuit, for example,
The latest value determination circuit can be configured with one addition circuit for determining the sign of (2X-(A+B)) and (A-B), two magnitude comparison circuits, and a gate circuit for determining the latest value from the determined sign. Therefore, the circuit becomes simpler than the conventional circuit configuration in which the determination is made by comparing the magnitudes of |X-A| and |X-B|. Another advantage is that in the method of comparing the magnitudes of |X-A| and |X-B|, the signals of It takes three stages of processing. On the other hand, according to the present invention
For A and B, only the magnitude comparison and gate processing are required, and for A and B, addition, magnitude comparison, and gate processing are required, thereby shortening the processing time and realizing faster calculations. The present invention will be explained in detail below. The magnitude relationship between |X-A| and |X-B| is (X-
A) It matches the magnitude relationship between 2 and (X-B) 2 . Therefore, if the magnitude relationship between (X-A) 2 and (X-B) 2 is known, the latest value can be determined. Now function F
Letting F = (X-A) 2 - (X-B) 2 (1) and find the positive, negative, or 0 sign of F, we get |X
It is possible to determine the magnitude of -A| and |X-B|, and therefore it is possible to determine the closest value to X from A and B. If we transform equation (1), we get equation (2). F=(X-A) 2 -(X-B) 2 =-2(X-A-B)(A-B) =-2(X-A+B/2)(A-B) (2) (2 ) If the sign of (X-A+B/2), that is, (2X-A-B), and the sign of (A-B) are known, the sign of the function F can be determined. For example (X-
If A+B/2)>0 and (A-B)<0, then F=-2(X-A+B/2)(A-B)>0. That is, since |X −A|−|X−B|>0, the nearest value for X is determined to be B. Table 1 shows the sign relationship of the function F of (X-A+B/2) and (A-B), that is, |X-A|-|X-B|, in cases 1 to 9.
【表】
X−A+B/2又はA−Bが0の時(2,4,5,
6および8の場合)は関数F=0となりXに対し
てAとBは同じ距離にあることになる。
第1図は本発明の第1の実施例の構成を示すブ
ロツク図である。本実施例においては信号AとB
の中より信号Xに対する最近値判定を行ない判定
結果として大小を示すS信号と等距離を示すZ信
号からなる判定出力信号を出力する場合について
示してある。Aが最近値の時はS=0、Z=0と
なり、Bが最近値の時はS=1、Z=0となり、
AとBがXに対して等距離の時はZ=1でSは0
又は1の値をとり不定となる。
最近値判定回路12の入力端子1に入力された
デイジタルの信号X(例えば正の値を有する3ビ
ツトの信号)は係数が2の乗算回路4へ供給さ
れ、その出力に2倍された信号(2X)を出力す
る。係数が2の乗算回路4は入力信号の各ビツト
を上に1ビツずつ桁シフトすることによつて構成
できる。乗算回路4で2倍された4ビツトの信号
(2X)は大小比較回路6の入力aの端子61へ供
給される。入力端子2へ供給された正の値を有す
る3ビツトの信号Aは加算回路5と大小比較回路
7の入力aの端子71へ供給される。入力端子3
へ供給された正の値を有する3ビツトの信号Bは
加算回路5と大小比較回路7の入力bの端子72
へ供給される。加算回路5に供給された信号Aと
信号Bは加算されて加算回路5の出力に(A+
B)の4ビツトの加算結果を出力し大小比較回路
6の入力bの端子62へ供給する。
大小比較回路6は入力aと入力bに入力された
各ビツトの自然2進数の信号の大小比較を行ない
aとbの大小関係によつて出力端子63〜65に
比較結果を出力する。a>bの時は出力端子63
のみが正論理の1を示すHighレベルとなり出力
端子64および65は0となる。すなわち2X−
(A+B)>0、いいかえるとX−A+B/2>0,
の時出力端子63のみが1となる。同様にa=b
すなわち2X−(A+B)=0の時出力端子64の
みが1となり、a<bすなわち2X−(A+B)<
0の時出力端子65のみが1となる。いいかえる
と大小比較回路6の出力に(2X−A−B)の正、
負または0を示す符号信号が出力される。
大小比較回路7は大小比較回路6と同様の動作
を行ないa>bいいかえるとA−B>0の時出力
端子73のみが1になり、A−B=0の時出力端
子74のみが1になり、A−B>0の時出力端子
75のみが1になる。いいかえると大小比較回路
7の出力に(A−B)の正、負または0を示す符
号信号が出力される。
大小比較回路6の出力端子63より出力された
符号信号は排他論理和回路8へ、出力端子64よ
り出力された符号信号は論理和回路9へ供給され
る。大小比較回路7の73より出力された符号信
号は排他論理和回路8へ、出力端子74より出力
された符号信号は論理和回路9へ供給される。
排他論理和回路8では2つの入力信号の排他論
理和をとつた信号Sを出力し出力端子10に供給
する。論理和回路9では2つの入力信号の論理和
をとつた信号Zを出力し出力端子11に供給す
る。信号Zは(2X−A−B)(A−B)=0の時
にZ=1となり(2X−A−B)・(A−B)≠0
の時Z=0となる。信号Sは(2X−A−B)(A
−B)<0の時1となり(2X−A−B)(A−B)
>0の時0となる。すなわち|X−A|<|X−
B|でAが最近値の時S=0、Z=0となり、|
X−A|>|X−B|でBが最近値の時S=1,
Z=0となり|X−A|=|X−B|でAとBが
Xに対して等距離の時はZ=1でSは不定とな
る。このため出力端子10および11より出力さ
れる信号SとZより信号Xに対する最近値の判定
がわかる。
第2図は本発明の第2の実施例の構成を示すブ
ロツク図である。本実施例は|X−A|=|X−
B|となる場合は最近値として信号AまたはBの
どちらが選らばれてもさしつかえないものとして
信号Sのみを出力する場合である。2の補数で示
された数のMSB(Most Significant Bit)はSign
符号で正又は負の符号を示す。MSBが0の場合
は正の数を、MSBが1の場合は負の数を示し、
数値0はMSBが0となり正の数として扱われる。
参照数字1,2,3,4,5,8および10は第
1図の各参照数字の部分と同じ機能を有する。
第2図の最近値判定回路12の入力端子1,2
および3には2の補数で示された信号X,Aおよ
びBが各々入力される。信号Xは乗算回路4に供
給され、信号AおよびBは加算回路5と減算回路
14の両方へ各々供給される。乗算回路4で入力
を2倍して出力した信号(2X)は減算回路13
へ供給され、加算器5で2つの入力信号を加算し
て出力した信号(A+B)も減算回路13へ供給
される。減算回路13では乗算回路4から供給さ
れた信号(2X)と加算回路5から供給された信
号(A+B)との減算を行ない、処理結果の信号
(2X−A−B)を出力に出力する。信号(2X−
A−B)のMSBはSign符号を示し信号(2X−A
−B)が正の場合は0に、負の場合は1となる。
減算回路13より出力された信号(2X−A−B)
のMSB、すなわち符号信号が排他論理和回路8
へ供給される。減算回路14では信号Aと信号B
の減算を行ない、出力に処理結果の信号(A−
B)を出力する。信号(A−B)のSign符号を
示すMSB、すなわち符号信号、が排他論理和回
路8へ供給される。排他論理和回路8では2つの
入力信号の排他論理和をとつた信号Sを出力し出
力端子10に供給する。信号Sは0の時最近値が
Aであることを示し信号Sが1の時最近値がBで
あることを示している。なお本実施例では信号
(2X−A−B)と(A−B)の各MSB(Signビツ
ト)を用いて判定していることより信号(2X−
A−B)と(A−B)のいずれもが0以上かまた
は0未満となる時信号S=0となり、信号(2X
−A−B)と(A−B)のいずれか一方が0以上
で他方が0未満の時信号S=1となる。
本実施例は第1の実施例において大小比較回路
6の出力65から出力されるa<bの状態を示す
符号信号と大小比較回路7の出力75から出力さ
れるa<bを示す符号信号との排他論理和をとる
ことによつても構成できる。
第3図は本発明の第3実施例の構成を示すブロ
ツク図である。本実施例は信号X,AおよびBの
中で信号Aが信号XおよびBに比して時間的に遅
延して入力される場合で、信号Aが入力してから
最近値判定結果が出力されるまでの時間が短かく
なるように構成したものである。すなわち信号A
が入力してから出力までには大小比較路とゲート
回路の処理が加わるだけである。
入力端子1に入力された信号Xは2の係数を有
する乗算回路4で2倍されたのち減算回路15へ
供給される。入力端子2に入力された信号Aは大
小比較回路6のbの入力端子62と大小比較回路
aの入力端子71へ供給される。入力端子3に入
力された信号Bは減算回路15と大小比較回路7
のbの入力端子72へ供給される。減算回路15
では減算が行なわれ出力に(2X−B)の演算結
果を出力し大小比較回路6のaの入力端子61へ
供給する。大小比較回路6はaとbに入力される
2の補数で表わされた信号の大小比較を行なつて
その結果を符号信号として出力する。a>bすな
わち(2X−B)−A>0の時出力端子63は1と
なり他の出力端子64と65は0となる。同様に
a=bすなわち2X−B−A=0の時出力端子6
4のみが1となり、a<bすなわち2X−B−A
<0の時出力端子65のみが1となる。いいかえ
ると大小比較回路6では(2X−A−B)の符号
判定が行なわれる。大小比較回路7でも信号Aと
信号Bの大小判定、すなわち(A−B)の符号判
定が行なわれ、A−B>0の時出力端子73のみ
が1となり、A−Bの時出力端子74のみが1と
なる。
大小比較回路6および7より出力された符号信
号は排他論理和回路8および論理和回路へ供給さ
れる。排他論理和回路8は2つの入力信号の排他
論理和をとつた信号Sを出力し出力端子10に供
給する。論理和回路9は2つの入力信号の論理和
をとつた信号Zを出力し出力端子11に供給す
る。信号Zは(2X−A−B)(A−B)=0の時
Z=1となり(2X−A−B)(A−B)≠0の時
Z=0となる。一方信号Sは(2X−(A−B))
(A−B)<0の時1となり(2X−(A+B))(A
−B)>0の時0となる。すなわちAが最近値の
時S=0,Z=0となり、Bが最近値の時S=
1,Z=0となり、AとBがXに対して等距離の
時はZ=1でSは不足となる。
以上説明したように本発明によれば信号Xに対
して2つの信号AとBのどちらがXに近い値を有
するかを判定する最近値判定回路において(2X
−A−B)の符号および(A−B)の符号を求
め、求めた符号から最近値判定を行なうように最
近値判定回路を構成することによつて従来の回路
構成に比して回路が簡単にでき、また信号が入力
してから判定結果が出力されるまでの処理時間が
短かくできるので高速の演算が実現できる。
また信号Xに対して2より大きいN個の信号
A1,A2……ANの中のどれが信号Xに一番近い値
を有するかの判定は|X−Aj|と|X−Aj|(但
しiとjは1からNまでの数の2つの組合せ)の
大小関係を本発明の方法によりすべての組合せに
ついて求め、求められたNC2(N個の中の2つの
組合せの数)個の大小関係から最近値の判定を行
なえばよい。このように構成すれば各|X−Ai
|但しiは1からNまでの数)の値を求めてから
大小比較を行なう従来の方法に比して信号が入力
してから判定結果が出力されるまでの処理時間を
短かくできる。[Table] When X-A+B/2 or A-B is 0 (in the case of 2, 4, 5, 6, and 8), the function F=0 and A and B are at the same distance with respect to X. . FIG. 1 is a block diagram showing the configuration of a first embodiment of the present invention. In this embodiment, signals A and B
The case is shown in which a determination is made on the nearest value of the signal X, and a determination output signal consisting of an S signal indicating magnitude and a Z signal indicating equidistance is output as the determination result. When A is the latest value, S = 0, Z = 0, and when B is the latest value, S = 1, Z = 0,
When A and B are equidistant from X, Z=1 and S is 0
Or it takes a value of 1 and becomes undefined. The digital signal X (for example, a 3-bit signal with a positive value) input to the input terminal 1 of the latest value determination circuit 12 is supplied to the multiplication circuit 4 with a coefficient of 2, and its output is a signal ( 2X). The multiplication circuit 4 having a coefficient of 2 can be constructed by shifting each bit of the input signal upward by one bit. The 4-bit signal (2X) doubled by the multiplier circuit 4 is supplied to the input a terminal 61 of the magnitude comparison circuit 6. The 3-bit signal A having a positive value supplied to the input terminal 2 is supplied to the adder circuit 5 and the input terminal 71 of the magnitude comparison circuit 7. Input terminal 3
The 3-bit signal B having a positive value is supplied to the input terminal 72 of the adder circuit 5 and the magnitude comparison circuit 7.
supplied to Signal A and signal B supplied to the adder circuit 5 are added and the output of the adder circuit 5 is (A+
The 4-bit addition result of B) is output and supplied to the input b terminal 62 of the magnitude comparison circuit 6. The magnitude comparison circuit 6 compares the magnitudes of the natural binary signals of the respective bits inputted to the inputs a and b, and outputs the comparison results to output terminals 63 to 65 according to the magnitude relationship between a and b. When a>b, output terminal 63
Only the output terminals 64 and 65 become high level indicating positive logic 1, and the output terminals 64 and 65 become 0. i.e. 2X−
When (A+B)>0, in other words, X-A+B/2>0, only the output terminal 63 becomes 1. Similarly a=b
That is, when 2X-(A+B)=0, only the output terminal 64 becomes 1, and a<b, that is, 2X-(A+B)<
When the signal is 0, only the output terminal 65 becomes 1. In other words, the output of the magnitude comparison circuit 6 has a positive value of (2X-A-B),
A code signal indicating a negative value or 0 is output. The magnitude comparison circuit 7 performs the same operation as the magnitude comparison circuit 6. In other words, when A-B>0, only the output terminal 73 becomes 1, and when A-B=0, only the output terminal 74 becomes 1. Therefore, when A-B>0, only the output terminal 75 becomes 1. In other words, the magnitude comparison circuit 7 outputs a sign signal indicating whether (A-B) is positive, negative, or 0. The code signal output from the output terminal 63 of the magnitude comparison circuit 6 is supplied to the exclusive OR circuit 8, and the code signal output from the output terminal 64 is supplied to the OR circuit 9. The code signal output from the magnitude comparison circuit 73 is supplied to the exclusive OR circuit 8, and the code signal output from the output terminal 74 is supplied to the OR circuit 9. The exclusive OR circuit 8 outputs a signal S obtained by exclusive ORing the two input signals and supplies it to the output terminal 10. The OR circuit 9 outputs a signal Z obtained by ORing the two input signals and supplies it to the output terminal 11. Signal Z becomes Z=1 when (2X-A-B)(A-B)=0, and (2X-A-B)・(A-B)≠0
When , Z=0. The signal S is (2X-A-B)(A
-B) becomes 1 when <0 (2X-A-B) (A-B)
When >0, it becomes 0. That is, |X−A|<|X−
When A is the most recent value in B|, S=0, Z=0, and |
When X-A|>|X-B| and B is the latest value, S=1,
When Z=0 and |X-A|=|X-B|, when A and B are equidistant from X, Z=1 and S becomes indefinite. Therefore, the determination of the latest value for the signal X can be determined from the signals S and Z output from the output terminals 10 and 11. FIG. 2 is a block diagram showing the configuration of a second embodiment of the present invention. In this example, |X−A|=|X−
When B|, it is a case where only the signal S is output, since it does not matter which of the signals A or B is selected as the latest value. The MSB (Most Significant Bit) of the number expressed in two's complement is the Sign
Indicate the positive or negative sign. If the MSB is 0, it indicates a positive number, and if the MSB is 1, it indicates a negative number.
The number 0 has the MSB as 0 and is treated as a positive number. Reference numerals 1, 2, 3, 4, 5, 8 and 10 have the same function as each reference numeral in FIG. Input terminals 1 and 2 of the latest value determination circuit 12 in FIG.
Signals X, A, and B expressed in two's complement numbers are input to 3 and 3, respectively. Signal X is supplied to multiplier circuit 4, and signals A and B are supplied to both adder circuit 5 and subtracter circuit 14, respectively. The signal (2X) output by doubling the input in the multiplication circuit 4 is sent to the subtraction circuit 13
The adder 5 adds the two input signals and outputs the signal (A+B), which is also supplied to the subtraction circuit 13 . The subtraction circuit 13 subtracts the signal (2X) supplied from the multiplication circuit 4 and the signal (A+B) supplied from the addition circuit 5, and outputs the processed signal (2X-A-B). Signal (2X−
The MSB of A-B) indicates the Sign code and the signal (2X-A
-B) is positive, it becomes 0, and when it is negative, it becomes 1.
Signal output from subtraction circuit 13 (2X-A-B)
The MSB of
supplied to In the subtraction circuit 14, the signal A and the signal B
The processing result signal (A-
B) is output. The MSB indicating the sign code of the signal (A-B), that is, the sign signal, is supplied to the exclusive OR circuit 8. The exclusive OR circuit 8 outputs a signal S obtained by exclusive ORing the two input signals and supplies it to the output terminal 10. When the signal S is 0, it indicates that the latest value is A, and when the signal S is 1, it indicates that the latest value is B. Note that in this embodiment, since the determination is made using each MSB (Sign bit) of the signals (2X-A-B) and (A-B), the signal (2X-A-B) and (A-B) are used for determination.
When both A-B) and (A-B) are greater than or equal to 0 or less than 0, the signal S=0, and the signal (2X
-A-B) and (A-B) is 0 or more and the other is less than 0, the signal S=1. In this embodiment, in the first embodiment, a code signal indicating the state a<b outputted from the output 65 of the magnitude comparison circuit 6 and a code signal indicating the state a<b outputted from the output 75 of the magnitude comparison circuit 7 are used. It can also be constructed by taking the exclusive OR of FIG. 3 is a block diagram showing the configuration of a third embodiment of the present invention. In this embodiment, among the signals X, A, and B, the signal A is input with a time delay compared to the signals X and B, and the latest value determination result is output after the signal A is input. It is designed to shorten the time it takes to complete the process. That is, signal A
From input to output, only a magnitude comparison path and gate circuit processing are added. The signal X input to the input terminal 1 is multiplied by 2 in a multiplication circuit 4 having a coefficient of 2, and then supplied to a subtraction circuit 15. The signal A input to the input terminal 2 is supplied to the b input terminal 62 of the magnitude comparison circuit 6 and the input terminal 71 of the magnitude comparison circuit a. The signal B input to the input terminal 3 is sent to the subtraction circuit 15 and the magnitude comparison circuit 7.
is supplied to the input terminal 72 of b. Subtraction circuit 15
Then, subtraction is performed, and the result of the calculation (2X-B) is outputted and supplied to the input terminal a of the magnitude comparison circuit 6. The magnitude comparison circuit 6 compares the magnitudes of the two's complement signals input to a and b, and outputs the result as a code signal. When a>b, that is, (2X-B)-A>0, the output terminal 63 becomes 1 and the other output terminals 64 and 65 become 0. Similarly, when a=b, that is, 2X-B-A=0, output terminal 6
Only 4 becomes 1, and a<b, that is, 2X-B-A
When <0, only the output terminal 65 becomes 1. In other words, the magnitude comparison circuit 6 performs a sign determination of (2X-A-B). The magnitude comparison circuit 7 also determines the magnitude of the signal A and the signal B, that is, the sign of (A-B). When A-B>0, only the output terminal 73 becomes 1, and when A-B, the output terminal 74 only becomes 1. The code signals output from the magnitude comparison circuits 6 and 7 are supplied to an exclusive OR circuit 8 and an OR circuit. The exclusive OR circuit 8 outputs a signal S obtained by exclusive ORing the two input signals and supplies it to the output terminal 10. The OR circuit 9 outputs a signal Z obtained by ORing the two input signals and supplies it to the output terminal 11. Signal Z becomes Z=1 when (2X-A-B)(AB)=0, and becomes Z=0 when (2X-A-B)(AB)≠0. On the other hand, the signal S is (2X-(A-B))
When (A-B) < 0, it becomes 1 (2X-(A+B)) (A
-B) becomes 0 when > 0. That is, when A is the latest value, S = 0, Z = 0, and when B is the latest value, S =
1, Z=0, and when A and B are equidistant from X, Z=1 and S is insufficient. As explained above, according to the present invention, in the nearest value determination circuit that determines which of the two signals A and B has a value closer to the signal X, (2X
- By configuring the nearest value judgment circuit to find the sign of A-B) and the sign of (A-B) and make the nearest value judgment from the obtained sign, the circuit is simpler than the conventional circuit configuration. It is easy to perform, and since the processing time from inputting a signal to outputting a determination result can be shortened, high-speed calculation can be realized. Also, for signal X, N signals greater than 2
The determination of which one of A 1 , A 2 ...A N has the closest value to the signal It is sufficient to determine the magnitude relationship between all the combinations (two combinations of N) using the method of the present invention, and determine the nearest value from the determined magnitude relationship of NC 2 (the number of two combinations out of N). . With this configuration, each |X−Ai
|However, i is a number from 1 to N)) Compared to the conventional method of calculating the value and then comparing the magnitude, the processing time from inputting a signal to outputting a determination result can be shortened.
第1図は本発明の第1の実施例の構成を示すブ
ロツク図、第2図は本発明の第2の実施例の構成
を示すブロツク図、第3図は本発明の第3の実施
例の構成を示すブロツク図である。
1,2,3,61,62,71および72は入
力端子、10,11,63,64,65,73,
74および75は出力端子、4は乗算回路、5は
加算回路、13,14および15は減算回路、6
および7は大小比較回路、8は排他論理和回路、
9は論理和回路、12は最近値判定回路である。
FIG. 1 is a block diagram showing the configuration of a first embodiment of the present invention, FIG. 2 is a block diagram showing the configuration of a second embodiment of the present invention, and FIG. 3 is a block diagram showing the configuration of a second embodiment of the present invention. FIG. 1, 2, 3, 61, 62, 71 and 72 are input terminals, 10, 11, 63, 64, 65, 73,
74 and 75 are output terminals, 4 is a multiplication circuit, 5 is an addition circuit, 13, 14 and 15 are subtraction circuits, 6
and 7 is a magnitude comparison circuit, 8 is an exclusive OR circuit,
9 is an OR circuit, and 12 is a nearest value determination circuit.
Claims (1)
信号Xに近い値を有するかを判定する回路におい
て、信号X,AおよびBから(2X−A−B)の
正負を示す第1の符号信号と(A−B)の正負を
示す第2の符号信号を求め、求めた第1および第
2の符号信号から最近値判定を行なう手段をそな
えたことを特徴とする最近値判定回路。1. In a circuit that determines which of two signals A and B has a value closer to signal X with respect to signal X, the first sign indicating the positive or negative of (2X-A-B) from signals 1. A latest value determination circuit comprising means for determining a second code signal indicating whether a signal and (A-B) are positive or negative, and determining the latest value from the determined first and second code signals.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10307281A JPH0241051B2 (en) | 1981-07-01 | 1981-07-01 | SAIKINCHIHANTEIKAIRO |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10307281A JPH0241051B2 (en) | 1981-07-01 | 1981-07-01 | SAIKINCHIHANTEIKAIRO |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS584433A JPS584433A (en) | 1983-01-11 |
| JPH0241051B2 true JPH0241051B2 (en) | 1990-09-14 |
Family
ID=14344441
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10307281A Expired - Lifetime JPH0241051B2 (en) | 1981-07-01 | 1981-07-01 | SAIKINCHIHANTEIKAIRO |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0241051B2 (en) |
-
1981
- 1981-07-01 JP JP10307281A patent/JPH0241051B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS584433A (en) | 1983-01-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0472139B1 (en) | A floating-point processor | |
| EP1058184A2 (en) | High radix division | |
| US5177703A (en) | Division circuit using higher radices | |
| US20210064340A1 (en) | Arithmetic circuit | |
| US3842250A (en) | Circuit for implementing rounding in add/subtract logic networks | |
| EP0332215A2 (en) | Operation circuit based on floating-point representation | |
| US5463571A (en) | Multi-nary OR logic device | |
| US5463572A (en) | Multi-nary and logic device | |
| JPH0241051B2 (en) | SAIKINCHIHANTEIKAIRO | |
| JPH0511980A (en) | Overflow detecting method and circuit | |
| US5781465A (en) | Method and apparatus for fast carry generation detection and comparison | |
| JP2645422B2 (en) | Floating point processor | |
| EP0442220B1 (en) | Decoder | |
| US3975624A (en) | Two's complement subtracting system | |
| EP0353041A2 (en) | Signal processing apparatus and method using modified signed digit arithmetic | |
| KR0182169B1 (en) | Log value calculation circuit | |
| JPS5966790A (en) | Operating circuit | |
| US5253194A (en) | Digital multiplier | |
| JP2569976B2 (en) | Digital filter | |
| JP2605848B2 (en) | Non-restoring divider | |
| KR950010822B1 (en) | Exclusive logic adding system and its method of binary level logic and multiple level logic | |
| KR0182038B1 (en) | Division circuit | |
| JP3077880B2 (en) | Sticky bit detection circuit | |
| KR0138856B1 (en) | Multi-nary not logic device | |
| JPH05165605A (en) | Floating point multiplier and multiplying method |