JPH0432924A - Maximum value detector and minimum value detector - Google Patents

Maximum value detector and minimum value detector

Info

Publication number
JPH0432924A
JPH0432924A JP13341090A JP13341090A JPH0432924A JP H0432924 A JPH0432924 A JP H0432924A JP 13341090 A JP13341090 A JP 13341090A JP 13341090 A JP13341090 A JP 13341090A JP H0432924 A JPH0432924 A JP H0432924A
Authority
JP
Japan
Prior art keywords
bit
value
register
bit position
data
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
Application number
JP13341090A
Other languages
Japanese (ja)
Inventor
Mikio Ogisu
荻須 幹雄
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 JP13341090A priority Critical patent/JPH0432924A/en
Publication of JPH0432924A publication Critical patent/JPH0432924A/en
Pending legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

PURPOSE:To search for a maximum value with a constant machine cycle by searching for discordance information from the MSB to the LSB, storing a numeral which is 1 at the closest discordant bit position to the MSB, and deleting a numeral which is 0 from the storage at each discordant bit position in order thereafter. CONSTITUTION:A bit searching circuit 13 starts the search at the MSB of a 1st decision register 11 and stores plural numerals which are 1 at the bit position where discordant information is stored for the 1st time in storage means X15, Y16, and Z17, and W18. At every following bit position where 2nd or succeeding discordant information is stored, a corresponding bit position of a 2nd decision register 12 is searched for to carry on operation for deleting numerals which are 0 at the bit position from the storage when presence information is found or regards the remaining numeral left in the storage by performing retrieval up to the LSB as a maximum value when no presence information is found. Consequently, maximum value detection is speeded up.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は複数の値の中から最大値、最小値を高速検出す
る最大値・最小値装置に関する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a maximum value/minimum value device that detects maximum and minimum values from a plurality of values at high speed.

従来の技術 従来、複数の値の中から最大値あるいは最小値を捜し出
す場合、2つの値を選び出して、大小関係を明らかにし
て、最大値であれば大きい方を、最小値であれば小さい
方を残し、これを順次繰り返して、最終的に大きい値、
小さい値を選び出す。2つの値の大小関係を明らかにす
る方法として算術論理演算装置(以下ALU)により引
算を行なう方法が考えられているが、大小比較する回数
分の比較サイクルを必要とし、かつ、ソフトウェアによ
り、順次比較していくという処理が必要になってくる。
Conventional technology Conventionally, when searching for the maximum or minimum value from among multiple values, two values are selected, their magnitude relationship is clarified, and if the value is the maximum value, the larger one is selected, and if the value is the minimum value, the smaller value is selected. , and repeat this one after another to finally obtain a large value,
Select small values. A method of subtracting using an arithmetic logic unit (hereinafter referred to as ALU) has been considered as a method of clarifying the magnitude relationship between two values, but this method requires comparison cycles equal to the number of times the magnitude comparison is performed, and it is difficult to do so using software. A process of sequential comparison is required.

大小比較する回数分のALUを設けた場合でも、回路規
模が増大し、かつ、何回か比較を繰り返さないと、最大
値あるいは最小値が求まらず、データの数が増えればそ
の中から最大値・最小値を見つけ出すサイクルも比例し
て増加していた。
Even if ALUs are provided for the number of times of size comparison, the circuit scale will increase and the maximum or minimum value cannot be determined unless the comparison is repeated several times. The number of cycles to find the maximum and minimum values also increased proportionally.

発明が解決しようとする課題 本発明は上記従来の課題を解決するもので、データの数
が変わっても一定のマシンサイクルで最大値または最小
値を探し出すことができる最大値・最小値装置を提供す
ることを目的とする。
Problems to be Solved by the Invention The present invention solves the above conventional problems, and provides a maximum value/minimum value device that can find the maximum value or minimum value in a constant machine cycle even if the number of data changes. The purpose is to

課題を解決するための手段 本発明は上記目的を達成するために、 (1)  各ビットが0または1で構成されたパラレル
データで表わされる数値の複数個が、それぞれの数値入
力端にパラレルデータとして同時に入力され、その中の
最大値を検出する装置において、前記数値の桁数を有す
る判定レジスタと、記憶手段を備え、前記複数個の数値
から同位ビットの値を入力して不一致を検出して前記判
定レジスタの対応するビット位置に不一致情報を記憶さ
せる不一致判定手段と、前記判定レジスタの内容を検索
して前記記憶を制御するビットサーチ回路を設け、前記
ビットサーチ回路は前記判定レジスタのMSBから検索
を行ない、前記判定レジスタで1番目に不一致情報を記
憶するビット位置において1を有する前記複数の数値を
前記記憶手段に記憶し、以下、2番目以下の不一致情報
を記憶するビット位置ごとに、そのビット位置で0を有
する数値を前記記憶から抹消する動作を続け、LSBま
で検索して前記記憶に残った数値を最大値とする最大値
検出装置とし、また、 (2)  各ビットが0または1で構成されたパラレル
データで表わされる数値の複数個が、それぞれの数値入
力端にパラレルデータとして同時に入力され、その中の
最大値を検出する装置において、前記数値の桁数を有す
る判定レジスタと、記憶手段を備え、前記複数個の数値
から同位ビットの値を入力して不一致を検出して前記判
定レジスタの対応するビット位置に不一致情報を記憶さ
せる不一致判定手段と、前記判定レジスタの内容を検索
して前記記憶を制御するビットサーチ回路を設け、前記
ビットサーチ回路は前記判定レジスタのMSBから検索
を行ない、前記判定レジスタで1番目に不一致情報を記
憶するビット位置において0を有する前記複数の数値を
前記記憶手段に記憶し、以下、2番目以下の不一致情報
を記憶するビット位置ごとに、そのビット位置で1を有
する数値を前記記憶から抹消する動作を続け、LSBま
で検索して前記記憶に残った数値を最小値とする最小値
検出装置とする。
Means for Solving the Problems In order to achieve the above objects, the present invention provides the following: (1) A plurality of numerical values represented by parallel data in which each bit is composed of 0 or 1 are connected to each numerical input terminal as parallel data. A device for detecting the maximum value of the plurality of numerical values inputted at the same time, comprising a determination register having the number of digits of the numerical value and a storage means, for detecting a mismatch by inputting the value of the same significant bit from the plurality of numerical values. and a bit search circuit for searching the content of the judgment register and controlling the storage, the bit search circuit storing the MSB of the judgment register. , and store the plurality of numerical values having 1 in the bit position where the first mismatch information is stored in the determination register in the storage means, and thereafter, for each bit position where the second and subsequent mismatch information is stored. , continues the operation of deleting the numerical value having 0 at that bit position from the memory, searches up to the LSB, and uses the numerical value remaining in the memory as the maximum value, and (2) each bit is 0. A determination register having the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number of digits of the number detected is detected. a discrepancy determining unit, comprising a storage unit, inputting values of the same bits from the plurality of numerical values, detecting discrepancies, and storing discrepancy information in corresponding bit positions of the determination register; and contents of the determination register. A bit search circuit is provided to search for and control the storage, and the bit search circuit searches from the MSB of the determination register, and the plurality of bits having 0 in the bit position where mismatch information is stored first in the determination register. The numerical value of 1 is stored in the storage means, and thereafter, for each bit position where the second and subsequent mismatch information is stored, the operation of deleting the numerical value having 1 at that bit position is continued from the memory, and searching up to the LSB is performed. A minimum value detection device that takes the memorized numerical value as the minimum value.

作用 前記構成において、不一致判定手段が大小関係に関連す
るビット位置を検出して判定レジスタに記憶する(すべ
て0または1なら大小関係の発生しないビット位置であ
る。)。ビットサーチ回路は前記判定レジスタをMSB
からLSHに向かって前記不一致情報をサーチし、MS
Bに最も近い不一致ビット位置で、1または0を有する
数値(最大値または最小値の可能性のある数値)を記憶
手段に記憶させ、以降、順次不一致ビット位置ごとに0
または1を有する数値(最大値または最小値の可能性の
無い数値)を前記記憶の中から削除していくこととなる
Operation In the above configuration, the mismatch determining means detects the bit position related to the magnitude relationship and stores it in the determination register (if all are 0 or 1, it is a bit position where no magnitude relationship occurs). The bit search circuit selects the determination register from the MSB
MS
A numerical value having 1 or 0 (possible maximum value or minimum value) at the mismatching bit position closest to B is stored in the storage means, and from then on, 0 is sequentially stored at each mismatching bit position.
Alternatively, numerical values having 1 (numerical values that have no possibility of being the maximum value or the minimum value) are deleted from the memory.

実施例 以下、本発明の一実施例の最大値検出装置について図面
を参照しながら説明する。第1図は本発明の一実施例の
最大値検出装置の構成を示すフロック図である。この実
施例では、上記記憶手段としてフラグを立てる手段を用
いている。また、不一致情報の検索に、補助的な第2の
判定レジスタを用いているが、本発明の手段に反するも
のではない。また、入力する数値の個数が4個の場合に
ついて説明するが、他の個数であっても同様に構成する
ことができる。
EXAMPLE Hereinafter, a maximum value detection device according to an example of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing the configuration of a maximum value detection device according to an embodiment of the present invention. In this embodiment, means for setting a flag is used as the storage means. Further, although the auxiliary second determination register is used to search for mismatch information, this is not contrary to the means of the present invention. Further, although a case will be described in which the number of numerical values to be input is four, the same configuration can be made even if other numbers are input.

データAI+  データB2+  データC3,データ
D4は入力データであり、4ビツトで構成されている。
Data AI+data B2+data C3 and data D4 are input data and are composed of 4 bits.

データA、はMSBから順にA blllt+ A b
o3+A b p 21 A b p + +  (以
下A< 、A3 、A2.AI)のビットデータを持ち
、データB2はB4 、  B3 。
Data A is A blllt + A b in order from MSB
It has bit data of o3+A b p 21 A b p + + (hereinafter referred to as A<, A3, A2.AI), and data B2 is B4, B3.

B2 +  B+ 1データC3はC4,C3,C2、
CデータD4はD4 、D3 、D2.D+のデータか
ら成る。データA+、データB2.データC3,データ
D4のMSHの各ビットはピット比較判定回路5に入力
される。ピット比較判定回路5は排他的NOR回路9と
AND−OR回路10からなり、データA4.B4.C
4,D4が全て“1”または“0”のとき排他的NOR
回路9により判定レジスタAllのビットポジション(
以下bp)4に′1“がセットされる。またデータA<
 、B4 。
B2 + B+ 1 data C3 is C4, C3, C2,
C data D4 is D4, D3, D2 . Consists of D+ data. Data A+, data B2. Each bit of MSH of data C3 and data D4 is input to pit comparison/judgment circuit 5. The pit comparison/judgment circuit 5 consists of an exclusive NOR circuit 9 and an AND-OR circuit 10, and the pit comparison/judgment circuit 5 consists of an exclusive NOR circuit 9 and an AND-OR circuit 10. B4. C
4. Exclusive NOR when D4 is all “1” or “0”
The bit position (
Hereinafter, ``1'' is set in bp)4. Also, data A<
,B4.

C4,D4のうち2つ以上が“1”のときAND−OR
回路10により判定レジスタB12のbp4に“1”が
セットされる。各データのbp3゜bp2.bplも同
様にビット比較判定回路6.7゜8によって判定レジス
タA 11.  B 12に値がセットされる例として
、データA1が(1010)、データB2が(1001
)、データC3が(101,0)、データD4が(10
11)の場合を考えると、ビット比較判定回路5,6,
7.8により判定レジスタA 11には(1100)、
判定レジスタB1゜には(1011)がセットされる。
AND-OR when two or more of C4 and D4 are “1”
The circuit 10 sets bp4 of the determination register B12 to "1". bp3°bp2 of each data. bpl is similarly determined by the bit comparison/judgment circuit 6.7°8 in the determination register A11. As an example where a value is set to B12, data A1 is (1010) and data B2 is (1001).
), data C3 is (101,0), data D4 is (10
Considering the case of 11), the bit comparison judgment circuits 5, 6,
According to 7.8, judgment register A 11 has (1100):
(1011) is set in the judgment register B1°.

ビットサーチ回路13は、まず判定レジスタA 、1の
内容を調べる。
The bit search circuit 13 first examines the contents of the determination register A1.

ビットサーチ回路13はレジスタを構成するビットの値
をMSBまたはLSB方向から順に調べていき1ビツト
サーチ“1”の場合、最初に“1”があったビット位置
情報を出力データとし、ビットサーチ“0”の場合、最
初に“0″があったピント位置情報を出力データとする
機能を持つ。判定レジスタAllのビットサーチはMS
Bから行なわれ、最初の“0”の位置を検出する。前記
例の場合、判定レジスタA 11の値は(1100)で
あるからbp2を検出する。このとき、判定レジスタB
1゜の値が(1011)でありbp2は“1”である。
The bit search circuit 13 examines the values of the bits configuring the register in order from the MSB or LSB direction, and in the case of 1 bit search "1", outputs the bit position information where "1" is found first, and performs the bit search "0". ”, it has the function of outputting the focus position information with the first “0”. Bit search of judgment register All is MS
The process starts from B and detects the position of the first "0". In the case of the above example, since the value of the determination register A11 is (1100), bp2 is detected. At this time, judgment register B
The value of 1° is (1011) and bp2 is "1".

これは判定レジスタA++の値から各データのbp2の
値を調べることによりデータAI、B2゜C3,D4の
中から最大値を決定できることを示すが、判定レジスタ
B12の値から各データのbp2が“1”であるものが
複数あり、bp2だけを調べるだけでは判定ができない
ことを示す。各データAI、B2+  C3+  C4
には最大値である可能であるが、さらにLSBを調べな
い場合に、最大値データ候補であることを示すフラグX
 +s、  Y 16+  Z 17゜W+8を持つ。
This indicates that the maximum value can be determined from data AI, B2°C3, and D4 by checking the bp2 value of each data from the value of the judgment register A++, but the bp2 of each data is " There are multiple cases where the value is 1'', indicating that it is not possible to make a determination just by examining bp2. Each data AI, B2+ C3+ C4
is the maximum value, but if the LSB is not checked further, the flag X indicating that it is the maximum value data candidate.
+s, Y 16+ Z 17°W+8.

フラグX量St  y16.  Z、+7. w18の
セット動作はフラグセット部X 19.  Y 20.
  Z 2W22によって行なわれる。ビットサーチ回
路13により最大値候補が存在すると、最大値候補を選
出したときに調へたビット位置(例ではb p 2)の
情報信号14がフラグセット部X +9.  Y 20
. 22W 2 Mに対し出力され、ビット位置情報信
号14と、ビット位置信号14の情報に基づくデータA
I、B2.C3,D4のデータによりフラグX15゜Y
 1111. 2171 W Illにセットされる。
Flag X amount St y16. Z, +7. The setting operation of w18 is performed by the flag setting section X19. Y20.
Performed by Z2W22. When the maximum value candidate is found by the bit search circuit 13, the information signal 14 at the bit position (b p 2 in the example) determined when the maximum value candidate was selected is sent to the flag set section X+9. Y 20
.. 22W 2 M, the bit position information signal 14 and the data A based on the information of the bit position signal 14
I, B2. The flag X15°Y is set by the data of C3 and D4.
1111. 2171 W Ill is set.

前記例の場合、テ9 A I、  B2. C3,D4
ノb I) 2 ノデータはそれぞれ1,0,1.1で
あるのでフラグセット部X+9・ Y2O・ Z Q 
l・W 22によりフラグX15には1、フラグYI6
には0、フラグZ17には1、フラグW+8には1がセ
ットされ、データAI、C3゜D4の3データが最大値
データ候補であることをを示される。次にビットサーチ
回路13は判定レジスタ八、のbplを調べる。前記例
の場合″0″であり、各データのbplを調べることに
より最大値が判定されることがわかる。ビットサーチ回
路13からビット位置(例ではbpl)の情報信号14
がフラグセット部X19. Y2O,z211 W22
に出力され、このビット位置情報信号14と、各データ
AI、B2.C3,D<の値と現在のフラグX+s・Y
+a+  z171 W2B(’)値ニヨリ新シイフラ
クX151Y 16+ 217. WHの値が決定され
る。前記例では各データA+、B2.C3,D4のbp
iの値は0.1.0. 1であり、フラグX 15+ 
 Y 16+  Z +7゜W + sの値は、1,0
.1.1である。この2つの値が共に1″のときフラグ
X+s+ YI6+217、W2Bがセットされ、フラ
グX +5+  Y 、6゜Z l 71 W + s
の値が“0”のビット位置のところにのみ各データA、
、B2.c3.D確の値が“1″である場合、フラグX
I5. Yes、  Zl?、 W+8の値は変化しな
い。新たにセットされたフラグX15゜Yes、  Z
17. W蔦8に対し、ビットサーチ回路13によりサ
ーチ動作が行われ(図示せず)、1″がセットされてい
るデータが最大値となる。通常、フラグX’s・ Y+
a+  Z17. W2Bに対するピッ トサーチ動作
により、一つのフラグのみ“1”がセットされている場
合、もしくは、判定レジスタAzのLSB (bpl)
までサーチが行なわれた場合、動作が終了する。データ
の数が変化しても、一定サイクルで最大値を求めること
ができ、ソフトウェアの負担を軽減することができる。
In the case of the above example, Te9 A I, B2. C3, D4
Nob I) 2 The data are 1, 0, and 1.1, respectively, so the flag set section X+9・Y2O・ZQ
1 for flag X15 and flag YI6 due to l・W 22
is set to 0, flag Z17 is set to 1, and flag W+8 is set to 1, indicating that the three data of data AI and C3°D4 are maximum value data candidates. Next, the bit search circuit 13 checks the bpl of the judgment register 8. In the case of the above example, it is "0", and it can be seen that the maximum value is determined by checking the bpl of each data. Information signal 14 of the bit position (bpl in the example) from the bit search circuit 13
is the flag set part X19. Y2O,z211 W22
This bit position information signal 14 and each data AI, B2 . C3, D< value and current flag X+s・Y
+a+ z171 W2B(') value Niyori new shift rack X151Y 16+ 217. The value of WH is determined. In the above example, each data A+, B2 . bp of C3, D4
The value of i is 0.1.0. 1, flag X 15+
The value of Y 16 + Z + 7°W + s is 1,0
.. It is 1.1. When these two values are both 1'', flags X+s+ YI6+217 and W2B are set, and flags X +5+ Y, 6°Z l 71 W + s
Each data A, only at the bit position where the value is “0”
, B2. c3. If the value of D is “1”, the flag
I5. Yes, Zl? , the value of W+8 does not change. Newly set flag X15゜Yes, Z
17. A search operation is performed by the bit search circuit 13 (not shown) for the W vine 8, and the data set to 1" becomes the maximum value. Normally, the flags X's and Y+
a+ Z17. If only one flag is set to “1” by the pit search operation for W2B, or if the LSB (bpl) of judgment register Az
If the search has been performed up to this point, the operation ends. Even if the number of data changes, the maximum value can be determined in a fixed cycle, reducing the burden on the software.

第2図は本発明の最小値装置の構成を示したブロック図
である。データAI、B2+  C3,D4のMSBの
各ビットはピット比較判定回路24に入力される。ピッ
ト比較判定回路24は排他的NOR回路9とN0R−O
R回路23からなり、データA4 、Bc、C4、D4
が全て1”または“0”のとき排他的NOR回路9によ
り判定レジスタAllのbp4に“1′″がセットされ
る。また、データA4 、B1.C4、D4のうち2つ
以上が“0”のときN0R−OR回路23により判定レ
ジスタ1312のbp4に′1″がセットされる。各デ
ータのbp3.bp2.bplも同様にビット比較判定
回路25,26 27.28によって判定レジスタA目
、B12. に値がセットされる。例として、データA
1が(1010)、データB、、(1001)、データ
C3(1010)、データD、(1011)の場合を考
えると、ビット比較判定回路24,25,26.27に
より判定レジスタA 11には(1100)、判定レジ
スタB+2には(0101)がセットされる。ビットサ
ーチ回路13は、まず判定レジスタA目の内容を調べる
。ビットサーチ動作はMSBから行なわれ、最初の“0
”の位置を検出する。前記例の場合、判定レジスタAl
lの値は(1100)であるからbp2を検出する。こ
のとき、判定レジスタ1312の値が(0101)であ
りbp2は0”である。これは、判定レジスタA1□の
値から各データのbp2の値を調べることによりデータ
AlB2 、C3、D4の中から最小値を決定できるこ
とを示し、判定レジスタBI2の値から各データのbp
2が0”のものが1つであり、各データのbp2を調べ
、“0”であるものが最小値であることを示している。
FIG. 2 is a block diagram showing the configuration of the minimum value device of the present invention. The MSB bits of data AI, B2+C3, and D4 are input to the pit comparison and determination circuit 24. The pit comparison/judgment circuit 24 includes the exclusive NOR circuit 9 and N0R-O.
Consists of R circuit 23, data A4, Bc, C4, D4
are all 1'' or 0, the exclusive NOR circuit 9 sets bp4 of the determination register All to 1'. Also, two or more of the data A4, B1, C4, and D4 are 0. At this time, the N0R-OR circuit 23 sets bp4 of the determination register 1312 to '1'. bp3 of each data. bp2. Similarly, bit comparison and judgment circuits 25, 26, 27, and 28 select judgment registers A, B12, . The value is set to . As an example, data A
1 is (1010), data B, , (1001), data C3 (1010), data D, (1011). (1100), and (0101) is set in the determination register B+2. The bit search circuit 13 first examines the contents of the A-th determination register. The bit search operation is performed starting from the MSB, and the first “0”
” is detected. In the above example, the determination register Al
Since the value of l is (1100), bp2 is detected. At this time, the value of the judgment register 1312 is (0101) and bp2 is 0". This can be determined by checking the value of bp2 of each data from the value of the judgment register A1□. Indicates that the minimum value can be determined, and the bp of each data is determined from the value of the determination register BI2.
2 is 0" is one, and the bp2 of each data is checked, and the one with "0" is the minimum value.

各データのbp2を調べればよいという情報はビット位
置情報信号14によりフラグセット部X 19.  Y
 20.  Z 21. W22に伝送され、各データ
A+、B=、C3、D4のbp2の値が“0”のデータ
に対応するフラグX + s + Y + 6+217
、 W+8に“1″がセットされる。前記例の場合、フ
ラグY16にのみ“1”がセットされ、データB2が最
小値であることを示す。データの数が変化しても、一定
サイクルで最小値を求めることができ、ソフトウェアの
負担を軽減することができる。
The information that it is necessary to check bp2 of each data is sent to the flag set section X19 by the bit position information signal 14. Y
20. Z21. Flag X + s + Y + 6 + 217 that is transmitted to W22 and corresponds to data where the bp2 value of each data A+, B=, C3, D4 is "0"
, "1" is set in W+8. In the case of the above example, only the flag Y16 is set to "1", indicating that the data B2 is the minimum value. Even if the number of data changes, the minimum value can be found in a constant cycle, reducing the burden on the software.

このように本発明の実施例の最大値検出装置によれば、
各ビットが0または1で構成されたパラレルデータで表
わされる数値の複数個が、それぞれの数値入力端にパラ
レルデータとして同時に入力され、その中の最大値を検
出する装置において、前記数値の桁数を有する第1の判
定レジスタおよび第2の判定レジスタと、記憶手段を備
え、前記複数個の数値から同位ビットの値を入力して不
一致を検出して前記第1の判定レジスタの対応するビッ
ト位置に不一致情報を記憶させる不一致判定手段と、前
記同位ビットにおいて1が二つ以上存在する場合に対応
して存在情報を前記第2の判定レジスタに記憶させる有
無判定手段を設け、前記第1および第2の判定レジスタ
の内容を検索して前記記憶を制御するビットサーチ回路
を設け、前記ビットサーチ回路は前記第1の判定レジス
タのMSBから検索を行い、前記第1の判定レジスタで
1番目に不一致情報を記憶するビット位置において1を
有する前記複数の数値を前記記憶手段に記憶し、以下、
2番目以下の不一致情報を記憶するビット位置ごとに前
記第2の判定レジスタの対応するビット位置を検索し、
存在情報があるときはそのビット位置で0を有する数値
を前記記憶から抹消する動作を続け、存在情報がないと
き、またはLSBまで検索して前記記憶に残った数値を
最大値とする最大値検出装置とすることにより、最大値
検出動作のマシンサイクルはビットサーチ回路が前記第
1と第2の判定レジスタをMSBからLSBまで検索す
るサイクルとなり(実施例では4ビツトである)、比較
する数値の個数がいかに増加してもマシンサイクルは同
じであり、最大値検出が高速にできる効果がある。最小
値検出においても同様の効果がある。
As described above, according to the maximum value detection device according to the embodiment of the present invention,
In a device that detects the maximum value among a plurality of numerical values represented by parallel data in which each bit is 0 or 1 and is simultaneously input as parallel data to each numerical input terminal, the number of digits of the numerical value is a first determination register and a second determination register having the following values; and a storage means, inputting the values of the same bits from the plurality of numerical values, detecting a mismatch, and detecting the corresponding bit position of the first determination register. and presence/absence determining means for storing existence information in the second determination register in response to the presence of two or more 1's in the same bits; A bit search circuit is provided to search the contents of the second judgment register and control the storage, and the bit search circuit searches from the MSB of the first judgment register to find the first mismatch in the first judgment register. storing the plurality of numerical values having 1 in the bit position storing information in the storage means;
searching for a corresponding bit position in the second determination register for each bit position storing second and subsequent mismatch information;
When there is existence information, the operation of erasing the numerical value having 0 at that bit position is continued from the memory, and when there is no existence information, or the maximum value is detected by searching up to the LSB and making the numerical value remaining in the memory the maximum value. By using this device, the machine cycle for the maximum value detection operation becomes a cycle in which the bit search circuit searches the first and second determination registers from the MSB to the LSB (4 bits in the embodiment), and the machine cycle for the maximum value detection operation is a cycle in which the bit search circuit searches the first and second determination registers from the MSB to the LSB (in the embodiment, it is 4 bits). No matter how much the number increases, the machine cycle remains the same, which has the effect of speeding up maximum value detection. A similar effect can be obtained in minimum value detection.

なお、実施例では記憶手段としてフラグを立てる手段を
用いたが、該当する数値そのものを記憶してもよく、ま
た、数値に与えた付番で記憶してもよいことはいうまで
もない。また、実施例では、第2の判定レジスタを設け
て、その検索結果で次の不一致情報検索に移行するよう
にし、最大値がLSBまでに決定する場合で次の不要な
不一致検索を避けたが、課題解決の手段で記載したよう
に、第1の判定レジスタのみを設けて、順次LSBまで
不一致ビット位置を検出する構成で最大値検出ができる
ことは言うまでもない。なお、入力した数値がすべて同
一であるときは、最大値、または最小値は定義できない
が、このような場合に対して本発明は、記憶手段に数値
が記憶されることがなく、不都合は発生しない。
In the embodiment, means for setting a flag is used as the storage means, but it goes without saying that the corresponding numerical value itself may be stored, or the number assigned to the numerical value may be stored. In addition, in the embodiment, a second judgment register is provided, and the search result is used to proceed to the next mismatch information search, thereby avoiding the next unnecessary mismatch search when the maximum value is determined up to the LSB. It goes without saying that the maximum value can be detected by providing only the first determination register and sequentially detecting mismatched bit positions up to the LSB, as described in . Note that if all the entered numerical values are the same, the maximum value or minimum value cannot be defined, but in such a case, the present invention prevents the numerical value from being stored in the storage means, causing no inconvenience. do not.

発明の効果 以上の実施例から明らかなように、各ビットが0または
1で構成されたパラレルデータで表わされる数値の複数
個が、それぞれの数値入力端にパラレルデータとして同
時に入力され、その中の最大値を検出する装置において
、前記数値の桁数を有する判定レジスタと、記憶手段を
備え、前記複数個の数値から同位ビットの値を入力して
不一致を検出して前記判定レジスタの対応するビット位
置に不一致情報を記憶させる不一致判定手段と、前記判
定レジスタの内容を検索して前記記憶を制御するビット
サーチ回路を設け、前記ビットサーチ回路は前記判定レ
ジスタのMSBから検索を行い、前記判定レジスタで1
番目に不一致情報を記憶するビット位置において1を有
する前記複数の数値を前記記憶手段に記憶し、以下、2
番目以下の不一致情報を記憶するビット位置ごとに、そ
のビット位置で0を有する数値を前記記憶から抹消する
動作を続け、LSBまで検索して前記記憶に残った数値
を最大値とする最大値検出装置とするコトにより、最大
値検出動作のマシンサイクルはビットサーチ回路が前記
第1と第2の判定レジスタをMSBからLSBまで検索
するサイクルとなり(実施例では4ビツトである)、比
較する数値の個数がいかに増加してもマシンサイクルは
同しであり、最大値検出が高速にできる効果がある。
Effects of the Invention As is clear from the embodiments described above, a plurality of numerical values represented by parallel data in which each bit is 0 or 1 are simultaneously input as parallel data to each numerical input terminal. A device for detecting a maximum value, comprising a determination register having the number of digits of the numerical value, and a storage means, inputting the values of the same bits from the plurality of numerical values, detecting a mismatch, and detecting the corresponding bit of the determination register. A discrepancy determining means for storing discrepancy information in a position, and a bit search circuit for searching the contents of the determination register and controlling the storage, the bit search circuit searching from the MSB of the determination register, de1
The plurality of numerical values having 1 at the bit position where the mismatch information is stored in the storage means are stored in the storage means;
For each bit position where mismatch information below the th is stored, the operation of deleting the numerical value having 0 at that bit position from the memory is continued, and the maximum value is detected by searching up to the LSB and making the numerical value remaining in the memory the maximum value. Due to the nature of the device, the machine cycle for the maximum value detection operation is a cycle in which the bit search circuit searches the first and second determination registers from the MSB to the LSB (4 bits in this embodiment), and No matter how much the number increases, the machine cycle remains the same, which has the effect of speeding up maximum value detection.

また最小値検出においても同様の効果がある。A similar effect can also be achieved in minimum value detection.

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

第1図は本発明の一実施例の最大値検出装置の構成を示
すブロック図、第2図は本発明の一実施例の最小値検出
装置の構成を示すブロック図である。 1・・・・・・数値のパラレルデータ入力、2・・・・
・・数値のパラレルデータ入力、3・・・・・・数値の
パラレルデータ入力、4・・・・・・数値のパラレルデ
ータ入力、9・・・・・・排他的NOR回路(不一致判
定手段)、23・・・・・・排他的NOR回路(不一致
判定手段)、24・・・・・・排他的NOR回路(不一
致判定手段)、25・・・・・・排他的NOR回路(不
一致判定手段)、11・・・・・・判定レジスタ、13
・・・・・・ビットサーチ回路、15・・・・・・フラ
グ(記憶手段)、16・・・・・・フラグ(記憶手段) 17・・ ・・・フラグ ・・・・・・フラグ (記憶手段) (記憶手段)
FIG. 1 is a block diagram showing the configuration of a maximum value detection device according to an embodiment of the present invention, and FIG. 2 is a block diagram showing the configuration of a minimum value detection device according to an embodiment of the present invention. 1... Parallel numerical data input, 2...
... Parallel numerical data input, 3... Parallel numerical data input, 4... Parallel numerical data input, 9... Exclusive NOR circuit (discrepancy judgment means) , 23... Exclusive NOR circuit (mismatch determining means), 24... Exclusive NOR circuit (mismatch determining means), 25... Exclusive NOR circuit (mismatch determining means) ), 11... Judgment register, 13
...Bit search circuit, 15...Flag (storage means), 16...Flag (storage means) 17...Flag...Flag ( (memory means) (memory means)

Claims (2)

【特許請求の範囲】[Claims] (1)各ビットが0または1で構成されたパラレルデー
タで表わされる数値の複数個が、それぞれの数値入力端
にパラレルデータとして同時に入力され、その中の最大
値を検出する装置において、前記数値の桁数を有する判
定レジスタと、記憶手段を備え、前記複数個の数値から
同位ビットの値を入力して不一致を検出して前記判定レ
ジスタの対応するビット位置に不一致情報を記憶させる
不一致判定手段と、前記判定レジスタの内容を検索して
前記記憶を制御するビットサーチ回路を設け、前記ビッ
トサーチ回路は前記判定レジスタのMSBから検索を行
ない、前記判定レジスタで1番目に不一致情報を記憶す
るビット位置において1を有する前記複数の数値を前記
記憶手段に記憶し、以下、2番目以下の不一致情報を記
憶するビット位置ごとに、そのビット位置で0を有する
数値を前記記憶から抹消する動作を続け、LSBまで検
索して前記記憶に残った数値を最大値とするようにした
最大値検出装置。
(1) In a device that detects the maximum value among a plurality of numerical values represented by parallel data in which each bit is 0 or 1, which is simultaneously input as parallel data to each numerical input terminal, the numerical value a determination register having a number of digits, and a storage means, a discrepancy determination unit that inputs the value of the same bit from the plurality of numerical values, detects a discrepancy, and stores discrepancy information in a corresponding bit position of the determination register. and a bit search circuit that searches the contents of the judgment register and controls the storage, and the bit search circuit searches from the MSB of the judgment register to find the first bit in the judgment register that stores the mismatch information. The plurality of numerical values having 1 in the position are stored in the storage means, and thereafter, for each bit position in which the second and subsequent mismatch information is stored, the operation of deleting the numerical value having 0 in that bit position is continued from the memory. , LSB and sets the stored numerical value as the maximum value.
(2)各ビットが0または1で構成されたパラレルデー
タで表わされる数値の複数個が、それぞれの数値入力端
にパラレルデータとして同時に入力され、その中の最大
値を検出する装置において、前記数値の桁数を有する判
定レジスタと、記憶手段を備え、前記複数個の数値から
同位ビットの値を入力して不一致を検出して前記判定レ
ジスタの対応するビット位置に不一致情報を記憶させる
不一致判定手段と、前記判定レジスタの内容を検索して
前記記憶を制御するビットサーチ回路を設け、前記ビッ
トサーチ回路は前記判定レジスタのMSBから検索を行
ない、前記判定レジスタで1番目に不一致情報を記憶す
るビット位置において0を有する前記複数の数値を前記
記憶手段に記憶し、以下、2番目以下の不一致情報を記
憶するビット位置ごとに、そのビット位置で1を有する
数値を前記記憶から抹消する動作を続け、LSBまで検
索して前記記憶に残った数値を最小値とするようにした
最小値検出装置。
(2) In a device that detects the maximum value among a plurality of numerical values represented by parallel data in which each bit is 0 or 1, which is simultaneously input as parallel data to each numerical input terminal, the numerical value a determination register having a number of digits, and a storage means, a discrepancy determination unit that inputs the value of the same bit from the plurality of numerical values, detects a discrepancy, and stores discrepancy information in a corresponding bit position of the determination register. and a bit search circuit that searches the contents of the judgment register and controls the storage, and the bit search circuit searches from the MSB of the judgment register to find the first bit in the judgment register that stores the mismatch information. The plurality of numerical values having 0 in the position are stored in the storage means, and thereafter, for each bit position in which the second and subsequent mismatch information is stored, the operation of deleting the numerical value having 1 in that bit position is continued from the memory. , LSB and sets the stored numerical value as the minimum value.
JP13341090A 1990-05-23 1990-05-23 Maximum value detector and minimum value detector Pending JPH0432924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13341090A JPH0432924A (en) 1990-05-23 1990-05-23 Maximum value detector and minimum value detector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13341090A JPH0432924A (en) 1990-05-23 1990-05-23 Maximum value detector and minimum value detector

Publications (1)

Publication Number Publication Date
JPH0432924A true JPH0432924A (en) 1992-02-04

Family

ID=15104115

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13341090A Pending JPH0432924A (en) 1990-05-23 1990-05-23 Maximum value detector and minimum value detector

Country Status (1)

Country Link
JP (1) JPH0432924A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010073471A1 (en) * 2008-12-22 2010-07-01 株式会社エスグランツ Bit string data sorting system, method, and program
US8515976B2 (en) 2008-12-22 2013-08-20 KOUSOKUYA, Inc. Bit string data sorting apparatus, sorting method, and program

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63285628A (en) * 1987-05-19 1988-11-22 Nec Corp Maximum value detecting circuit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63285628A (en) * 1987-05-19 1988-11-22 Nec Corp Maximum value detecting circuit

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010073471A1 (en) * 2008-12-22 2010-07-01 株式会社エスグランツ Bit string data sorting system, method, and program
JP2010146472A (en) * 2008-12-22 2010-07-01 S Grants Co Ltd Bit stream data sorting device, method, and program
US8515976B2 (en) 2008-12-22 2013-08-20 KOUSOKUYA, Inc. Bit string data sorting apparatus, sorting method, and program

Similar Documents

Publication Publication Date Title
JPS6051948A (en) Branch destination buffer storage device
JPH05113930A (en) Flexible n-way-memory interleaving method
US5761521A (en) Processor for character strings of variable length
US4876646A (en) Data processor having multilevel address translation tables
US4617641A (en) Operation unit for floating point data having a variable length exponent part
WO1999066423A1 (en) Data calculating device
US7200712B2 (en) Associative memory system, network device, and network system
JPH0432924A (en) Maximum value detector and minimum value detector
US6513053B1 (en) Data processing circuit and method for determining the first and subsequent occurences of a predetermined value in a sequence of data bits
JPH09128241A (en) Method and apparatus for arrangement with reference to belonging function value of language input value of fuzzy logic processor
EP0442220B1 (en) Decoder
JPS62237523A (en) Sorting circuit
JPS5844417Y2 (en) Change detector input module
JP2752220B2 (en) String processing unit
JPH04184535A (en) Parallel arithmetic units
JPH02162419A (en) Data retrieving circuit
JP3541498B2 (en) Data processing device
JPH06161708A (en) Floating point arithmetic unit
JP2002351821A (en) Mediation control method and circuit
JPH0458323A (en) Minimum value data retrieving circuit
JP2000122845A (en) Semiconductor integrated circuit
JPH0764768A (en) Absolute value accumulator
JPH01100634A (en) Data processor
JPS622317A (en) Multilevel comparison and coincidence detecting circuit
JPH0833812B2 (en) Sorting device