СХ. ЧCX H
СО 00 4 Изобретение относитс к автомати ке, вычислительной технике и может быть использовано в различных управ л ющих, программных, вычислительных измерительных и других устройствах. Известно устройство дл сравнени чисел, содержащее логические элемен ты ИЛИ-НЕ, НЕ, J-К-триггеры си. Недостатком этого устройства вл етс его сложность, обусловленна большим количеством св зей, Наиболее близким по технической сущности к предлагаемому вл етс устройство дл сравнени чисел, содержащее элементы И-НЕ, ИЛИ-НЕ, ИСКЛЮЧАЮЩЕЕ ИЛИ, триггеры, первый информационный вход устройства соединен с первым входом первого элемента И-НЕ и через первый элемент НЕ - с первь - входом второго элемента И-НЕ, второй информационный вход устройства подключен к второму входу второго элемента И-НЕ и через второй элемент НЕ - к второму входу первого элемента И-НЕ, выход которо го соединен с первым входом третьег элемента И-НЕ, с первым входом четв того элемента И-НЕ с первым входом первого элемента ИСКЛЮЧАЮЩЕЕ ИЛИ, выход второго элемента И-НЕ подключ к первому входу п того элемента И-НЕ, К второму входу четвертого элемента И-НЕ и ко второму входу пе вого элемента ИСКЛЮЧАЮЩЕЕ ИЛИ, выхо которого соединен со вторыми входами третьего и п того элементов И-НЕ выходы третьего и п того элементов .И-НЕ соединены с информационными вх дами первого и второго триггеров соответственно, выход четвертого эл мента И-НЕ подключен через третий элемент НЕ к- первому входу элемента ИЛИ-НЕ, выход которого соединен с . входами синхронизации первого и вто рого триггеров, пр мые выходы которых подключены к входам второго элемента ИСКЛЬЭЧАЮЩЕЕ ИЛИ., выход которого соединен с информационным входом третьего триггера, пр мой выход которого подключен к третьему входу четвертого элемента И-НЕ, шина начальной установки соединена с входами установки в единичное состо ние первого и второго триггеров и со входом установки в нулевое состо ние третьего триггера, шина син ронизации устройства подключена к второму входу элемента ИЛИ-НЕ и ко входу синхронизации третьего триггера С2 . Недостатком известного устройств вл етс низкое быстродействие, Целью изобретени вл етс повышение быстродействи устройства дл сравнени чисел. Поставленна цель достигаетс тем, что в устройство дл сравнени чисел, содержащее элементы НЕ, триггеры , причем входы первого и второго сравниваемых чисел устройства соединены соответственно с входами первого и второго элементов НЕ, шина начальной установки устройства соединена с входами установки триггеров в единичное состо ние, введены третий элемент НЕ, первый, второй, третий и четвертый элементы ИЛИ-НЕ, причем входы первого и второго сравниваемых чисе устройства соединены с первымивхойами соответственно первого и второго элементов ИЛИ-НЕ и информационными входами соответственно первого и второго триггеров, инверсные выходы которых подключены к выходам несравнени устройства и входам третьего элемента ИЛИ-НЕ, выход которого вл етс выходом равенства чисел устройства, выходы первого и второго элементов НЕ соединены с вторыми входами соответственно второго и первого элементов ИЛИ-НЕ, третьи входы которых объединены и через третий элемент НЕ подключены К шине синхронизации устройства , а выходы - к входам четвертого элемента ИЛИ-НЕ выход которого соединен с входами синхронизации триггеров , На чертеже приведена структурна схема устройства дл сравнени чисел . Устройство дл сравнени чисел содержит первый, второй и третий элементы НЕ 1-3, первый, второй, третий и четвертый элементы ИЛИ-НЕ 4-7, триггеры 8 и 9, входы первого и второго сравниваемых чисел устройства 10 vi 11, выход 12 несравнени , выход 13 сравнени , выход 14 несравнени , шину 15 синхронизации устройства , шину 16 начальной установки. Устройство работает следукнцим образом. Исходное состо ние устройства устанавливаетс импульсным сигналом, приход щим на шину 16 начальной установки. При этом триггеры 8 и 9 устанавливаютс в состо ние 1. Затем синхронно по тактовым импульсам, поступающим на шину 15 синхронизации устройства, на информационные входы устройства 10 и 11 подаютс последовательно, начина с младших разр дов, сравниваемые числа А и В соответственно. Если значени сравниваемых i-ых разр дов чисел (,2,...,п) не равны между собой, т.е. , ъ 0 (, ), то на первом и втором входах элемента ИЛИ-НЕ 4 действуют потенциалы логического нул (логической единицы), а на первом и втором входах элемента ИЛИ-НЕ 5 - потенциал логической единицы (логического нул ). Одновременно.с выхода элемента НЕ 3 на третьи входы элементов ИЛИ-НЕ 4 и 5 подаетс инвертированны тактовый импульс в виде кратковремен ного нулевого уровн . Поскольку на первых двух входах элемента ИЛИ-НЕ 4 (элемента ИЛИ-НЕ 5) действуют потенциалы логического нул , то на выходе элемента ИЛИ-НЕ 4 (элемента ИЛИ-НЕ 5 формируетс тактовый импульс в виде кратковременного единичного уровн , который поступает на первый (второй) вход, элемента ИЛИ-НЕ 6. В то же врем на выходе элемента ИЛИ-НЕ 5 (элемента ИЛИ-НЕ 4) действует потенциал логического нул , который обеспечивает прохождение импульса с выхода эле мента ИЛИ-НЕ 4 (элемента ИЛИ-НЕ 5) через элемент ИЛИ-НЕ б на входы синх рониэации триггеров 8 и 9. Под воздействием этого импульса в триггеры 8 и 9 записываютс значени срав ниваемых разр дов 1 и О (О и 1) соответственно. Если зна:че.ни сравниваемых i-ых разр дов чисел равны между собой, т.е. (), то на первых входах элементов ИЛИ-НЕ 4 и 5 присутствуют потенциалы логического нул (логической единицы), а на вторых входах - потенциалы логической единицы (логического нул ). Поэтому на выходах этих элементов действуют нулевые уровни, в результате чего в триггерах 8 и 9 запись значений сравниваемых разр дов чксеп не производитс . Таким образом, через п тактов работы устройства в случае равенства сравниваемых чисел триггеры 8 и 9 сохран т свое исходное состо ние и на выходе 13 сравнени с помощью элемента ИЛИ-НЕ 7 формируетс потенциал логической единицы, который вл етс признаком равенства чисел . В случае неравенства сравниваемых чисел триггеры 8 и 9 зафиксируют значени самых старших из неравных между собой разр дов сравниваемых чисел, что вл етс признаком несравнени чисел. Признаком неравенства чисел А В вл етс наличие на втором выходе 12 несравнени логической единицы, а признаком неравенстна чисел А В - наличие логической единицы на первом выходе 14 несравнени . Применение предлагаемого устройства дл сравнени чисел обеспечивает повышение быстродействи на 50%. Кроме того, дл его реализации требуетс на 48% меньше оборудовани , чем дл известного устройства дл сравнени чисел.CO 00 4 The invention relates to automation, computer technology and can be used in various control, software, computational measuring and other devices. A device for comparing numbers is known, which contains logical elements OR-NOT, NOT, J-K-triggers si. The disadvantage of this device is its complexity, due to the large number of links. The closest in technical essence to the present invention is a device for comparing numbers, containing the elements AND-NOT, OR-NOT, EXCLUSIVE OR, triggers, the first information input of the device is connected to the first the input of the first element AND-NOT and through the first element NOT - with the first input of the second element AND-NOT; the second information input of the device is connected to the second input of the second AND-NOT element and through the second element NOT - to the second input of the first about the NAND element whose output is connected to the first input of the third NAND element, to the first input of the fourth NAND element to the first input of the first element EXCLUSIVE OR, the output of the second NAND element is connected to the first input of the 5th element AND -NO, To the second input of the fourth element AND-NOT and to the second input of the first element EXCLUSIVE OR, the output of which is connected to the second inputs of the third and fifth elements AND-NOT the outputs of the third and fifth elements. AND-NOT connected to information inputs the first and second triggers respectively, the output is four That element is NOT connected via the third element NOT to the first input of the element OR NOT, the output of which is connected to. synchronization inputs of the first and second triggers, the direct outputs of which are connected to the inputs of the second element EXCLUSIVE OR., the output of which is connected to the information input of the third trigger, the direct output of which is connected to the third input of the fourth element NAND, the initial setup bus is connected to the inputs setting the first and second triggers to a single state and with the input of setting the third trigger to the zero state, the device synchronization bus is connected to the second input of the OR-NOT element and to the sync input t etego flop C2. A disadvantage of the known devices is the low speed. The aim of the invention is to increase the speed of the device for comparing numbers. The goal is achieved by the fact that in a device for comparing numbers, containing elements NOT, triggers, the inputs of the first and second compared numbers of the device are connected respectively to the inputs of the first and second elements NOT, the device initial installation bus is connected to the inputs of the installation of triggers in a single state, the third element is NOT, the first, second, third and fourth elements are OR NOT, and the inputs of the first and second compared devices are connected to the first elements of the first and second elements, respectively ILO OR NOT and information inputs of the first and second triggers, respectively, the inverse outputs of which are connected to the device non-comparison outputs and the inputs of the third OR-NOT element, whose output is the equality output of the device numbers, the outputs of the first and second elements are NOT connected to the second inputs of the second one, respectively and the first element OR-NOT, the third inputs of which are combined and through the third element are NOT connected to the device's sync bus, and the outputs are connected to the inputs of the fourth element OR-NOT whose output is connected with trigger trigger inputs. The drawing shows a block diagram of a device for comparing numbers. The device for comparing contains first, second and third elements NOT 1-3, first, second, third and fourth elements OR NOT 4-7, triggers 8 and 9, inputs of the first and second comparable numbers of the device 10 vi 11, output 12 incomparable , comparison output 13, non-comparison output 14, device synchronization bus 15, initial installation bus 16. The device works in the following way. The initial state of the device is established by a pulse signal arriving on the initial bus 16. In this case, the triggers 8 and 9 are set to state 1. Then synchronously on the clock pulses arriving on the device synchronization bus 15, the information inputs of the device 10 and 11 are sequentially started, starting with the least significant bits, compared numbers A and B, respectively. If the values of the compared i-th bits of the numbers (, 2, ..., n) are not equal to each other, i.e. , ъ 0 (,), then the potentials of a logical zero (logical unit) act on the first and second inputs of the OR-NOT 4 element, and the potential of a logical unit (logical zero) on the first and second inputs of the OR-NOT 5 element. Simultaneously, from the output of the element HE 3 to the third inputs of the elements OR NONE 4 and 5, an invert clock pulse is applied in the form of a short-term zero level. Since the first two inputs of an OR-NOT 4 element (an OR-NOT 5 element) are affected by logical zero potentials, the output of an OR-NOT 4 element (an OR-NOT 5 element produces a clock pulse in the form of a short-term unit level, which goes to the first ( second) the input of the element OR NOT 6. At the same time, the output of the element OR NONE 5 (element OR NONE 4) is the potential of a logical zero, which ensures the passage of a pulse from the output of the element OR NONE 4 (element OR NONE 5) through the element OR-NOT to the inputs of the synchronization of the triggers 8 and 9. Under the influence of When this pulse is triggered, the values of the compared bits 1 and 0 (0 and 1), respectively, are recorded in triggers 8 and 9. If the numbers: of the compared i-th bits of the numbers are equal, i.e. (), then The first inputs of the elements OR NOT 4 and 5 contain the potentials of a logical zero (logical unit), and the second inputs contain the potentials of a logical unit (logical zero). Therefore, the outputs of these elements have zero levels, resulting in the triggers 8 and 9 writing values no matching bits are produced. Thus, in the event of equality of the compared numbers, the triggers 8 and 9 retain their initial state and, at the output 13 of the comparison, the potential of a logical unit is generated using the OR-NOT 7 element, which is a sign of the equality of the numbers. In the case of the inequality of the compared numbers, the triggers 8 and 9 fix the values of the most senior unequal bits of the compared numbers, which is a sign of the comparison of the numbers. A sign of the inequality of the numbers A B is the presence of a logical unit at the second output 12, and a sign of the inequality of the numbers B B at the second output 12 - the presence of a logical unit at the first exit 14 of the comparison. The use of the proposed device for comparing numbers provides an increase in speed by 50%. In addition, its implementation requires 48% less equipment than the known device for comparing numbers.