Изобретение относитс к автоматике и вычислительной технике и может использоватьс при реализации технических средств дискретной автоматики и вычислительной техники, Известно устройство дл сравнени чисел, содержащее два регистра, две группы элементов И и элемент ИЛИ, причем пр мой выход каждого раз р да первого регистра и инверсный, выход соответствующего разр да, второго регистра соединены с входами соответствующего элемента И первой группы, инверсный выход каждого разр да первого регистра и пр мой выход соответствующего разр да второго регистра соединены с входами соот ветствующего элемента И второй .группы , выходы элемелтов И первой и второй групп соединены с входами элемента ИЛИ, выход которого вл е.тс .выходом устройства l . Однако это устройство неудобно в том случае, когда сравниваемые числа поступают в унитарном коде. Тогда требуетс первоначально производить преобразование, что увеличивает врем сравнени и усложн ет аппаратурный состав устройства. Наиболее близким к изобретению вл етс устройство дл сравнени , содержащее мультиплексор, на информа ционные входы которого поступает первое число, заданное унитарным кодом, а на управл ющие входы - второе число, заданное двоичным кодом| 2 Недостатком известного устройства вл етс его сложность, а также объе оборудовани сильно возрастает при увеличении разр дности сравниваемых чисел, поскольку оно осуществл ет их параллельное сравнение. . Цель изобретени - упрощение уст ройства. Поставленна цель достигаетс тем что устройство дл сравнени , содержащее мультиплексор, информационные входы которого соединены с информационными входами устройства, и две группы регистров, содержит генератор тактовых импульсов, счетчик, группу схем сравнени , две группы элементов И, элемент ИЛИ и распределитель сигналов , причем выход генератора такто вых импульсов соединен с входом счет чика, выходы разр дов которого подкл . чены к управл ющим входам мультиПлШ сора и информационным входам регистров первой и второй групп, выходы которых соединены с первыми и группами информационных входов соответствующих схем сравнени группы, вход разрешени каждой схемы сравнени группы подключен к выходу предыдущей схемы сравнени группы,выход последней схемы сравнени группы вл етс выходом устройства, информационные входы ,которого подключены к входам элемента ИЛИ, выход которого . соединен с входом распределител сигналов , выходы которого подключены к йервым входам соответствующих элементов И первой группы, вторые входы которых соединены с выходом мультиплексора , а выходы подключены к входам управлени записью соответствую-, щих регистров первой группы .и первым входам элементов И второй группы,вторые входы которых соединены с входом управлени записью устройства, а выходы подключены к входам управлени записью регистров второй группы. На. чертеже показана функциональна схема предлагаемого устройства-. Устройство содержит генератор 1 тактовых импульсов, выход которого соединен с входом счетчика 2, выходы разр дов KOTOpdt-o подключены к управ|л ющим входам мультиплексора 3 и ин- i формационным входам регистров 4 и 5 |Первой,и второй групп, выходы которых соединены с первыми и вторыми группами информационных входов соответствующих схем 6 сравнени .группы. Вход разрешени каждой схемы б сравнени подключен к выходу предыдущей схемы 6 сравнени . Выход последней схемы 6 сравнени вл етс выходом 7устройства, информационные входы 8которого подключены к входам .элемента ИЛИ 9, которого соединен с входом распределител 10 сигналов, выходы которого подключены к первым входам соответствующих элементов И 11 пеовой группы, вторые входы которых соединены с выходом мультиплексора 3, а выходы подключены к входам управлени записью соотнетствукидих регистров 4 и первым входам элементов И 12 второй группы, вторые входы которых соединены с входом 13 управлени записью устройства, а выходы подключены к входам управлени записью регистров 5 второй группы. Устройство работает следующим образом . Входной сигнал с одного из входов 8 поступает на один из информационных входов мультиплексора 3, управл ющие входы которого управл ютс через счетчик 2 генератором 1 тактовых импульсов. Входной .сигнал с одного из входов8 поступает также на один из входов элемента ИЛИ 9 и соответственно на выходе элемента ИЛИ 9 по вл етс сигнал, который через распределитель 10 сигналов открывает по первому входу первый элемент И 11 первой группы. В момент совпадени значени кода в счетчике 2 со значением унитарногЬ кода на входах 8 на выходе мультиплексора 3 по вл етс разрешакиций сигнал, , поступающий на второй вход первого The invention relates to automation and computer technology and can be used in the implementation of technical equipment of discrete automation and computer technology. A device for comparing numbers is known, containing two registers, two groups of AND elements and an OR element, and the direct output of each bit of the first register and inverse , the output of the corresponding bit, the second register is connected to the inputs of the corresponding element AND of the first group, the inverse output of each bit of the first register and the direct output of the corresponding bit and a second register connected to the inputs of the corresponding AND gate second .gruppy, elemeltov outputs AND of the first and second groups are connected to inputs of the OR gate, whose output is e.ts Yield device l. However, this device is inconvenient in the case when the compared numbers come in a unitary code. Then it is required to initially perform the conversion, which increases the comparison time and complicates the instrumental composition of the device. Closest to the invention is a comparison device containing a multiplexer, the information inputs of which receive the first number specified by the unitary code, and the control inputs the second number specified by the binary code | 2 The disadvantage of the known device is its complexity, as well as the amount of equipment increases greatly with increasing the size of the compared numbers, since it carries out their parallel comparison. . The purpose of the invention is to simplify the device. The goal is achieved by comparing a multiplexer, the information inputs of which are connected to the information inputs of the device, and two groups of registers, contains a clock, a counter, a group of comparison circuits, two groups of AND elements, an OR element and a signal distributor, and the output The clock pulse generator is connected to the counter input, the bit outputs of which are connected. The control inputs of the multiplus log and information inputs of the registers of the first and second groups, whose outputs are connected to the first and groups of information inputs of the corresponding group comparison circuits, the resolution input of each group comparison circuit are connected to the output of the previous group comparison circuit, the output of the last group comparison circuit is the output of the device, the information inputs, which are connected to the inputs of the OR element, the output of which. connected to the input of the signal distributor, the outputs of which are connected to the first inputs of the corresponding elements AND of the first group, the second inputs of which are connected to the output of the multiplexer, and the outputs are connected to the recording control inputs of the corresponding, registers of the first group and the first inputs of the elements of the second group, the second the inputs of which are connected to the recording control input of the device, and the outputs are connected to the recording control inputs of registers of the second group. On. The drawing shows a functional diagram of the proposed device. The device contains a generator of 1 clock pulses, the output of which is connected to the input of counter 2, the outputs of the KOTOpdt-o bits are connected to the control inputs of multiplexer 3 and the information inputs of registers 4 and 5 | of the First and second groups, the outputs of which are connected with the first and second groups of information inputs of the respective circuits 6 of the comparison group. The resolution input of each comparison circuit B is connected to the output of the previous comparison circuit 6. The output of the last comparison circuit 6 is the output 7 of the device, the information inputs 8 of which are connected to the inputs of the OR element 9, which is connected to the input of the signal distributor 10, the outputs of which are connected to the first inputs of the corresponding elements AND 11 of the pitch group, the second inputs of which are connected to the output of the multiplexer 3 and the outputs are connected to the recording control inputs of matching registers 4 and the first inputs of elements 12 of the second group, the second inputs of which are connected to the recording control input 13 of the device, and the outputs yucheny registers to the control inputs of recording 5 of the second group. The device works as follows. The input signal from one of the inputs 8 is fed to one of the information inputs of the multiplexer 3, the control inputs of which are controlled through the counter 2 by the generator 1 of clock pulses. The input signal from one of the inputs 8 also goes to one of the inputs of the element OR 9 and, accordingly, at the output of the element OR 9, a signal appears which, through the distributor 10 of the signals, opens the first element 11 of the first group through the first input. At the moment of coincidence of the code value in counter 2 with the value of the unitary code, at the inputs 8 at the output of multiplexer 3, a signal appears, allowing the second input of the first
элемента И 11 первой группы и открьавающий его. Сигнал разрешени посту-; пает с выхода первого элемента И 11 первой группы на вход разрешени записи первого регистра 4, в которыйзаписываетс код из счетчика 2. При поступлении следующего числа на входы 8 в распределителе 10 происходит сдвиг и по перврму входу оказываетс открытым второй элемент и 11 первой группы. В остальном работа устройства аналогична описанной и зна чение второго числа записываетс во второй регистр 4.element And 11 of the first group and revealing it. Post-enable signal; It goes from the output of the first element 11 of the first group to the input of the resolution of the record of the first register 4, into which the code from counter 2 is written. When the next number arrives at the inputs 8 in the distributor 10, a shift occurs and the first element and 11 of the first group are open at the first input. Otherwise, the operation of the device is similar to that described and the value of the second number is written to the second register 4.
Во второй группе регистров 5 заданное значение регулируемого парамет ра или заданное число записываетс при поступлении сигнала управлени записью с входа 13 аналогичным обра-. зом. Сигналы с выходов регистров 4 и 5 поступают на входы соответствующих схем 6- сравнени , которые сранивают число, записанное в регистра 5, с числом, записанным в регистрах 4.При равенстве чисел,.записанных в регистрах 4 и 5, схемы 6 сравнени вырабатывают сигнал равенства на своих входах и каскад схем б сравнени сформирует на выходе 7 сигнал совпадени чисел, записанных в пам ти, и вводимых чисел.In the second group of registers 5, the specified value of the adjustable parameter or the specified number is recorded when the recording control signal is received from input 13 in the same way. zom. The signals from the outputs of registers 4 and 5 are fed to the inputs of the corresponding comparison circuits 6, which match the number recorded in register 5 with the number recorded in registers 4. When the numbers written in registers 4 and 5 are equal, the comparison circuits 6 produce a signal equality at its inputs and a cascade of comparison schemes b will, at output 7, form a coincidence signal of the numbers recorded in the memory and the numbers entered.
Поскольку устройство осуществл ет последовательный ввод цифр, заданных унитарным кодом (например, дес тичных), объем его оборудовани не возрастает при увеличении количества разр дов, в то врем как в известном устройстве, с увеличением разр дности сравниваемых чисел объе оборудовани возрастает экспоненциально . Устройство может быть использовано в схемах электронных кодовых замков.Since the device sequentially inputs the numbers specified by the unitary code (for example, decimals), the amount of its equipment does not increase with an increase in the number of bits, while in the known device, with an increase in the size of the compared numbers of equipment, it increases exponentially. The device can be used in electronic code lock circuits.