RU2710936C2 - Method of finding the largest and smallest number in arbitrary array of binary multi-digit numbers and device for implementing said method - Google Patents
Method of finding the largest and smallest number in arbitrary array of binary multi-digit numbers and device for implementing said method Download PDFInfo
- Publication number
- RU2710936C2 RU2710936C2 RU2016148073A RU2016148073A RU2710936C2 RU 2710936 C2 RU2710936 C2 RU 2710936C2 RU 2016148073 A RU2016148073 A RU 2016148073A RU 2016148073 A RU2016148073 A RU 2016148073A RU 2710936 C2 RU2710936 C2 RU 2710936C2
- Authority
- RU
- Russia
- Prior art keywords
- sorting
- largest
- values
- max
- data
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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/06—Arrangements for sorting, selecting, merging, or comparing data on individual record carriers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/30021—Compare instructions, e.g. Greater-Than, Equal-To, MINMAX
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
Изобретение относится к автоматике и вычислительной технике и может быть использовано при построении соответствующих конечных автоматов. Техническим результатом является упрощение сравнения многоразрядных двоичных чисел за счет использования последовательности одинаковых операций, регулярности структуры вычислений. Способ заключается в следующем: для нахождения наибольшего и наименьшего чисел в массиве (в области памяти) выделяются наибольшее и наименьшее числа среди трех (в трех последовательных ячейках памяти) элементов массива, к этим выделенным числам добавляется очередной элемент массива, вновь находятся среди них наибольшее и наименьшее, и так далее до последнего сравниваемого элемента массива (ячейки памяти), а результатом, наибольшим и наименьшим элементами всего массива являются последние из полученных наибольших и наименьших значений. Изобретение относится к автоматике и вычислительной технике и может быть использовано при построении соответствующих конечных автоматов. Известны способы сравнения двоичных чисел (см., например, Справочник по цифровой вычислительной технике. Малиновский Б.Н., Александров В.Я., Боюн В.П. и др. / Под ред. Б.Н. Малиновского. Киев: Техника, 1974 г.), Шевкопляс Б.В. Микропроцессорные структуры. Инженерные решения: Справочник. М.: Радио и связь, 1990 г., патент RU 2300134). К причине, препятствующей достижению заявляемого технического результата, относится то, что эти способы ориентированы только на однозначные двоичные числа.The invention relates to automation and computer engineering and can be used in the construction of the corresponding finite state machines. The technical result is to simplify the comparison of multi-bit binary numbers by using a sequence of identical operations, the regularity of the structure of calculations. The method consists in the following: to find the largest and smallest numbers in the array (in the memory area), the largest and smallest numbers are selected among the three (in three consecutive memory cells) array elements, the next array element is added to these selected numbers, the largest and the smallest, and so on, until the last element of the array being compared (memory cell), and the result, the largest and smallest elements of the entire array are the last of the received largest and smallest values. The invention relates to automation and computer engineering and can be used in the construction of the corresponding finite state machines. Known methods for comparing binary numbers (see, for example, Handbook of Digital Computing. Malinovsky B.N., Aleksandrov V.Ya., Boyun V.P. et al. / Edited by B.N. Malinovsky. Kiev: Technique , 1974), Shevkoplyas B.V. Microprocessor structures. Engineering Solutions: Reference. M .: Radio and communications, 1990, patent RU 2300134). The reason that impedes the achievement of the claimed technical result is that these methods are focused only on single-digit binary numbers.
Известны также способы сравнения и нахождения наибольших и наименьших чисел и устройства для их реализации (Патенты RU 2298219, 2300133, 2361266, 2363034, 2365975, 2389063). К причине, препятствующей достижению заявляемого технического результата при использовании этих известных селекторов двоичных чисел, относятся ограниченные функциональные возможности, обусловленные тем, что выполняется селекция только большего или только меньшего из указанных двоичных чисел.There are also known methods of comparing and finding the largest and smallest numbers and devices for their implementation (Patents RU 2298219, 2300133, 2361266, 2363034, 2365975, 2389063). The reason that impedes the achievement of the claimed technical result when using these known binary number selectors is limited functionality, due to the fact that only the largest or only the smallest of these binary numbers is selected.
Наиболее близким способом и устройством для его реализации того же назначения к заявленному изобретению по совокупности признаков является, принятый за прототип, селектор двоичных чисел (патент РФ 2365975, кл. G06F 7/02, 2007 г.), состоящий в том, что технический результат при осуществлении изобретения достигается тем, в что включает 2n-1 элементов «2ИЛИ», 4n элементов «Запрет», 2n замыкающих и 2n размыкающих ключей, причем все элементы и ключи сгруппированы в n групп так, что j-я группа содержит два элемента «2ИЛИ», четыре элемента «Запрет», два замыкающих и два размыкающих ключа, в j-й группе выход i-го элемента «Запрет», подключенного инвертирующим входом к неинвертирующему входу (3-i)-го элемента «Запрет», и выход (2+i)-го элемента «Запрет», подключенного инвертирующим входом к второму входу (3-i)-го элемента «2ИЛИ», соединены соответственно с неинвертирующим входом (2+i)-го элемента «Запрет» и первым входом i-го элемента «2ИЛИ», подсоединенного выходом к входу управления объединенных выходами i-ых замыкающего и размыкающего ключей, входы которых соединены соответственно с неинвертирующим и инвертирующим входами первого элемента «Запрет», выход i-го элемента «2ИЛИ» предыдущей группы соединен с вторым входом i-го элемента «2ИЛИ» последующей группы, а второй вход i-го элемента «2ИЛИ» первой группы, неинвертирующие входы первого, второго элементов «Запрет» и выходы первого, второго замыкающих ключей j-и группы соединены соответственно с шиной нулевого потенциала, j-ым, (n+j)-ым входами и j-ым, (n+j)-ым выходами селектора двоичных чисел. Недостатками этого способа и устройства его реализующего являются невозможность получения наибольшего или наименьшего значений массива данных и относительная сложность реализации. Техническим результатом данного изобретения является упрощение сравнения двоичных чисел за счет четырех элементов селекции, входами которых являются три исходных числа, а выходами два - наибольшее и наименьшее из этих трех. Указанный технический результат при осуществлении изобретения достигается тем, что в способе сравнения двоичных чисел формируются две пары из трех чисел а3, а2, a1, например, < max{а3, а2}, min{а3, а2} > и < max{a2, a1}, min{a2, a1} > (фиг. 1), а затем находят наибольшее max{max{а3, а2}, max{a2, a1}} и наименьшее min{min{а3, а2}, min{a2, a1}} значения чисел а, b с. Полученная таким образом ячейка 2i (фиг. 1) используется для завершения операции поиска наибольшего и наименьшего чисел во всем массиве (фиг. 2).The closest method and device for its implementation of the same purpose to the claimed invention according to the totality of features is the binary number selector (RF patent 2365975, class G06F 7/02, 2007), adopted in the prototype, consisting in the fact that the technical result in the implementation of the invention is achieved by the fact that it includes 2n-1 elements "2OR", 4n elements "Prohibition", 2n locking and 2n disconnecting keys, and all elements and keys are grouped into n groups so that the j-th the group contains two “2OR” elements, four “Prohibition” elements, two locking and two disconnecting keys, in the j-th group the output of the i-th the “Inhibit” element connected by an inverting input to the non-inverting input of the (3rd-i) -th “Inhibit” element, and the output of the (2 + i) -th element of “Prohibition” connected by an inverting input to the second input of the (3rd-i) -th of the “2OR” element, respectively connected to the non-inverting input of the (2 + i) -th element of “Prohibition” and the first input of the i-th element of “2OR”, connected by an output to the control input of the combined outputs of the i-th closing and opening keys, the inputs of which are connected Accordingly, with the non-inverting and inverting inputs of the first “Prohibition” element, you the course of the i-th element “2OR” of the previous group is connected to the second input of the i-th element “2OR” of the next group, and the second input of the i-th element “2OR” of the first group, non-inverting inputs of the first, second elements of the “Ban” and the outputs of the first, the second closing keys of the jth group are connected respectively to the zero potential bus, the jth, (n + j) th inputs and the jth, (n + j) th outputs of the binary number selector. The disadvantages of this method and the device implementing it are the impossibility of obtaining the largest or smallest values of the data array and the relative complexity of the implementation. The technical result of this invention is to simplify the comparison of binary numbers due to four elements of selection, the inputs of which are three source numbers, and the outputs of two are the largest and smallest of these three. The specified technical result in the implementation of the invention is achieved by the fact that in the method of comparing binary numbers two pairs of three numbers a 3 and 2 , a 1 , for example, <max {a 3 , a 2 }, min {a 3 , a 2 } are formed > and <max {a 2 , a 1 }, min {a 2 , a 1 }> (Fig. 1), and then find the largest max {max {a 3 , a 2 }, max {a 2 , a 1 } } and the smallest min {min {a 3 , a 2 }, min {a 2 , a 1 }} the values of the numbers a, b c. Thus obtained cell 2 i (Fig. 1) is used to complete the search operation for the largest and smallest numbers in the entire array (Fig. 2).
В качестве формирователя max/min из двух чисел может быть использовано устройство (патент RU 2365975 G06F 7/02).As a shaper max / min of two numbers, a device can be used (patent RU 2365975 G06F 7/02).
Сведения, подтверждающие возможность осуществления изобретения с получением вышеуказанного технического результата, заключаются в следующем.Information confirming the possibility of carrying out the invention with obtaining the above technical result are as follows.
В заявляемом способе сравнения двоичных чисел для нахождения наибольшего и наименьшего чисел из массива реализуются две последовательности:In the inventive method for comparing binary numbers to find the largest and smallest numbers from an array, two sequences are implemented:
1. max {an, max{an-1, max{an-2, max{… max{а4, max{а3, а2, а1}…}}}1. max {a n , max {a n-1 , max {a n-2 , max {... max {a 4 , max {a 3 , a 2 , a 1 } ...}}}
2. min {an, min{an-1, min{an-2, min{… min{a4, min{a3, a2, a1}}…}}} Вышеизложенные сведения позволяют сделать вывод, что предлагаемый способ сравнения двоичных чисел обеспечивает нахождение наибольшего и наименьшего чисел из массива данных.2. min {a n , min {a n-1 , min {a n-2 , min {... min {a 4 , min {a 3 , a 2 , a 1 }} ...}}} The above information allows us to conclude that the proposed method for comparing binary numbers ensures finding the largest and smallest numbers from the data array.
Алгоритм реализации заявляемого способа включает:The implementation algorithm of the proposed method includes:
1) перенос элементов массива исходных данных из памяти (ячейки 3i ) на внутренний носитель - регистры 4; (фиг. 2);1) transfer of elements of the array of source data from memory (cells 3 i ) on internal media - registers 4; (Fig. 2);
2) пересылку первых трех элементов массива данных с регистров 41-43 на входы a1, а2, ai ячейки 21 (фиг. 1);2) transfer of the first three elements of the data array from registers 4 1 -4 3 to the inputs a 1 and 2 , a i of cell 2 1 (Fig. 1);
3) поиск наибольшего и наименьшего значений среди трех элементов массива данных и подачу результатов этого поиска на входы, соответственно, а1 и а2 ячейки 22;3) the search for the largest and smallest values among the three elements of the data array and the submission of the results of this search to the inputs, respectively, a 1 and a 2
4) подача значения очередного элемента данных на вход я, ячейки 22;4) supplying the value of the next data element to input i,
5) продолжение операций пп. 3 и 4 до тех пор, пока не будут обработаны все n элементы массива. На выходах max и min ячейки 2n-2 окажутся наибольшее и наименьшее значения исходного массива данных.5) continuation of
Примеры выполнения вычислений по данному способу.Examples of performing calculations by this method.
1. Пусть а3>а2>a1>а4, тогда на выходах ячейки 21 окажутся значения, соответственно, max=а3, min=a1. На выходах ячейки 22, соответственно, max=а3, min=а4.1. Let a 3 > a 2 > a 1 > a 4 , then at the outputs of
2. Пусть а3=а2>a1>а4, тогда на выходах ячейки 21 окажутся значения, соответственно, max=а3, min=а1. На выходах ячейки 22, соответственно, max=а3, min=а4,2. Let a 3 = a 2 > a 1 > a 4 , then at the outputs of
3. Пусть а3=а2>a1=а4, тогда на выходах ячейки 21 окажутся значения, соответственно, max=а3, min=a1. На выходах ячейки 22, соответственно, max=а3, min=a1.3. Let a 3 = a 2 > a 1 = a 4 , then at the outputs of
4. Пусть а3=а2=а1>а4, тогда на выходах ячейки 21 окажутся значения, соответственно, max=а3, min=а3. На выходах ячейки 22, соответственно, max=а3, min=а4. 4. Let a 3 = a 2 = a 1 > a 4 , then at the outputs of
Предложенный способ нахождения наибольшего и наименьшего элементов массива данных произвольного объема n позволяет использовать устройства его реализующие как для сортировки данных, так и в процедурах обработки нечеткой информации, в частности, для операций объединения и пересечения при мягких вычислениях.The proposed method for finding the largest and smallest elements of a data array of arbitrary volume n allows using devices that implement it both for sorting data and in fuzzy information processing procedures, in particular, for union and intersection operations during soft calculations.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2016148073A RU2710936C2 (en) | 2016-12-07 | 2016-12-07 | Method of finding the largest and smallest number in arbitrary array of binary multi-digit numbers and device for implementing said method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2016148073A RU2710936C2 (en) | 2016-12-07 | 2016-12-07 | Method of finding the largest and smallest number in arbitrary array of binary multi-digit numbers and device for implementing said method |
Publications (3)
Publication Number | Publication Date |
---|---|
RU2016148073A RU2016148073A (en) | 2018-06-08 |
RU2016148073A3 RU2016148073A3 (en) | 2018-08-08 |
RU2710936C2 true RU2710936C2 (en) | 2020-01-14 |
Family
ID=62557374
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
RU2016148073A RU2710936C2 (en) | 2016-12-07 | 2016-12-07 | Method of finding the largest and smallest number in arbitrary array of binary multi-digit numbers and device for implementing said method |
Country Status (1)
Country | Link |
---|---|
RU (1) | RU2710936C2 (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20010013048A1 (en) * | 2000-01-06 | 2001-08-09 | Imbert De Tremiolles Ghislain | Method and circuits for performing the quick search of the minimum/maximum value among a set of numbers |
US20030188143A1 (en) * | 2002-03-28 | 2003-10-02 | Intel Corporation | 2N- way MAX/MIN instructions using N-stage 2- way MAX/MIN blocks |
US20060242215A1 (en) * | 2001-05-25 | 2006-10-26 | Sun Microsystems, Inc. | Circuit for selectively providing maximum or minimum of a pair of floating point operands |
RU2298219C1 (en) * | 2005-12-02 | 2007-04-27 | Государственное образовательное учреждение высшего профессионального образования "Ульяновский государственный технический университет" | Device for selecting maximal one out of two binary numbers |
RU2300133C1 (en) * | 2005-12-02 | 2007-05-27 | Государственное образовательное учреждение высшего профессионального образования "Ульяновский государственный технический университет" | Device for picking minimal one of two binary numbers |
RU2365975C1 (en) * | 2008-01-09 | 2009-08-27 | Государственное образовательное учреждение высшего профессионального образования "Ульяновский государственный технический университет" | Binary number selector |
-
2016
- 2016-12-07 RU RU2016148073A patent/RU2710936C2/en not_active IP Right Cessation
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20010013048A1 (en) * | 2000-01-06 | 2001-08-09 | Imbert De Tremiolles Ghislain | Method and circuits for performing the quick search of the minimum/maximum value among a set of numbers |
US20060242215A1 (en) * | 2001-05-25 | 2006-10-26 | Sun Microsystems, Inc. | Circuit for selectively providing maximum or minimum of a pair of floating point operands |
US20030188143A1 (en) * | 2002-03-28 | 2003-10-02 | Intel Corporation | 2N- way MAX/MIN instructions using N-stage 2- way MAX/MIN blocks |
RU2298219C1 (en) * | 2005-12-02 | 2007-04-27 | Государственное образовательное учреждение высшего профессионального образования "Ульяновский государственный технический университет" | Device for selecting maximal one out of two binary numbers |
RU2300133C1 (en) * | 2005-12-02 | 2007-05-27 | Государственное образовательное учреждение высшего профессионального образования "Ульяновский государственный технический университет" | Device for picking minimal one of two binary numbers |
RU2365975C1 (en) * | 2008-01-09 | 2009-08-27 | Государственное образовательное учреждение высшего профессионального образования "Ульяновский государственный технический университет" | Binary number selector |
Also Published As
Publication number | Publication date |
---|---|
RU2016148073A3 (en) | 2018-08-08 |
RU2016148073A (en) | 2018-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112070222B (en) | Processing device, accelerator and method for federal learning | |
Lincoln et al. | Deterministic Time-Space Tradeoffs for k-SUM | |
Roy et al. | Application of cellular automata in symmetric key cryptography | |
CN111597054B (en) | Information processing method, system, electronic equipment and storage medium | |
Hematian et al. | Zero-delay FPGA-based odd-even sorting network | |
RU2710936C2 (en) | Method of finding the largest and smallest number in arbitrary array of binary multi-digit numbers and device for implementing said method | |
US7370046B2 (en) | Sort processing method and sort processing apparatus | |
WO2022252876A1 (en) | A hardware architecture for memory organization for fully homomorphic encryption | |
CN116090568A (en) | Method and device for determining size relation between quantum data and classical floating point data | |
Majumder et al. | Investigation on Quine McCluskey method: A decimal manipulation based novel approach for the minimization of Boolean function | |
RU2300137C1 (en) | Majority module | |
RU2633110C1 (en) | Device for determining number of senior units (zeros) in binary number | |
CN110780849B (en) | Matrix processing method, device, equipment and computer readable storage medium | |
CN113988279A (en) | Output current reading method and system of storage array supporting negative value excitation | |
Cabessa et al. | Interactive evolving recurrent neural networks are super-Turing universal | |
CN106502627A (en) | A kind of pseudo-random number seed generation method | |
Lada et al. | Implementation of a method for synthesizing groups of symmetric double-operand operations of cryptographic information coding for block encryption systems | |
Santoro et al. | Search for optimal five-neighbor FPGA-based cellular automata random number generators | |
Sileshi et al. | Accelerating hardware Gaussian random number generation using Ziggurat and CORDIC algorithms | |
RU2606311C2 (en) | Selector of binary numbers | |
RU2300130C1 (en) | Device for selecting the lesser one of two binary numbers | |
Silviyasara et al. | Efficient architecture reverse converter design using Han Carlson structure with carry look ahead adder | |
CN110022242B (en) | Keyword determination method and device | |
RU2703352C1 (en) | Device for selecting binary numbers | |
CN115622795B (en) | File encryption method based on chaotic encryption algorithm, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | The patent is invalid due to non-payment of fees |
Effective date: 20190617 |