А. 8 л 0 Изобретение относитс к вычисли тельной технике и может быть испол зовано в системах сбора данных в качестве кодового устройства. Известно устройство дл сравнени двоичных чисел, содержащее че ки поразр дного сравнени , состо щие из инвертирующих транзисторов и диодно-резистивных элементов. Сравнение поступающих двоичных чис осуществл етс попарно. Недостатком этого устройства в л етс отсутствие количественной оценки результата сравнени . Известно также устройство дл вычислени разности близких по величине двоичных чисел, содержащее два параллельных регистра и схему определени знака разности 2 . Недостатком данного устройства вл етс ограниченный диапазон рпр делени разности двух двоичных чисел . Наиболее близким к изобретению вл етс устройство дл сравнени , содержащее три элемента И-НЕ, на базе которых выполнен трехстабильный триггер, два элемента И-НЕ дл управлени триггером, два элемента И-НЕ, сто щие в цепи обратной св з и элемент ИСКЛЮЧДЮЩЕЕ ИЛИ в цепи совпадени поступающих двоичных чисел. Три состо ни триггера обоз начают результат сравнени : равно,больше или меньше з . Однако в известном устройстве при неравенстве кодов констатирует с неравенство без указани на величину этого неравенства, что суживает функциональные возможности устройства. Целью изобретени вл етс расш рение функциональных возможностей за счет количественной оценки резул тата сравнени . Дл достижени поставленной цели устройство, содержащее блок срав нени , входы которого подключены к входам пр мых значений первого и второго чисел устройства, а первый второй и третий выходы вл ютс выходами качественного результата сравнени устройства, содержит элемент И-ИЛИ, счетчик и дешифратор, первый и второй выходы которого в ш ютс выходами количественной оцен ки результата сравнени устройства входы первой группы элемента И-ИЛИ соединены с входами пр мых значений первого и второго чисел устройства и вторымвыходом блока сравнени , входы второй группы элемента И ИЛИ соединены с входами инверсных значений первого и второго чисел устройства и BTOJXJM выходом блока сравнени , входы третьей группы эле мента И-НЛИ соединены;с входами пр мого значени первого числа и инверсного значени второго числа устройства и третьим выходом блока сравнени , входы четвертой группы элемента И-ИЛИ соединены с входами инверсного значени первого числа и пр мого значени второго числа устройс.тва и первым выходом блока сравнени , выход элемента ИИЛИ подключен к счетному входу счет-:; чина, вход управлени выдачей результата которого соединен с входом опроса .устройства, а выходы разр дов счетчика подключены к входам дешифратора . На чертеже представлена схема устройства дл сравнени . Устройство содержит блок 1 сравнени , элемент И-ИЛИ 2, счетчик 3 и даиифратор 4. Устройство работает следующим образом. На входы блока 1 сравнени и элемента И-ИЛИ 2 поступают пр мые и инверсные значени кодов первого и второго чисел соответственно А,В и А,В. В случае равенства кодов А и В :на втором выходе блока 1 сравнени по&то нно присутствует сигнал качественного результата сравнени , открывающий-первые две. группы входов элемента И-ИЛИ 2, разреша тем caNKiM прохождение на счетный вход счетчика 3 импульсов совпадени чисел А- и В или А и В. По импуль су Опрос на перво.выходе дешифратора 4 по вл етс сигнал равенства кодов чисел. В случае расхождени чисел А и В на единицу младшего разр да устройство работает аналогично до первого неравенства кодов. Так как схема предназначена дл сравнени последовательных двоичных чисел, постуПсцощих старшим разр дом вперед, то относительна величина чисел определ етс первой разностью в значении разр дов. В рассматриваемом примере это происходит на четвертом такте; первые две группы входов элемента И-ИЛИ 2 блокируютс из-за пропадани сигнала AsB и открываетс четверта группа сигналом с первого выхода блока 1 сравнени . На счетный вход счетчика 3 проход т импульсы сравнёни тактированнных чисел А и Bg (всего дев ть, импульсов).Таким образом,на втором выходе дешифратора 4 по вл етс сигнал, который сигнализирует о разнице двоичных чисел Ag и Bj на единицу младшего разр да. В случае разницы в двоичных кодах на две единицы младшего разр да схема работает аналогично.. На счетчик 3 проход т восемь импульсов совпадени , при второй выход дешифратора 4 должен сигнализировать о заполнении счетчика 3 до восьми, аA. 8 liters 0 The invention relates to computing technology and can be used in data acquisition systems as a code device. A device for comparing binary numbers, containing bitwise comparisons, consisting of inverting transistors and diode-resistive elements is known. Comparison of incoming binary numbers is carried out in pairs. The disadvantage of this device is the absence of a quantitative evaluation of the result of the comparison. It is also known a device for calculating the difference of similarly large binary numbers, which contains two parallel registers and a circuit for determining the sign of the difference 2. The disadvantage of this device is the limited range of dividing the difference of two binary numbers. The closest to the invention is a comparison device comprising three AND-NES elements, on the basis of which a three-stage trigger is made, two AND-NOT elements for controlling the trigger, two AND-NES elements in the feedback circuit and an EXCLUSIVE OR element in a chain of matching binary numbers. Three states of the trigger begin the comparison result: equal, more or less h. However, in the known device, with inequality of codes, the inequality is ascertained without indicating the magnitude of this inequality, which narrows the functionality of the device. The aim of the invention is to extend the functionality by quantifying the result of the comparison. To achieve this goal, a device containing a comparison block, whose inputs are connected to the direct inputs of the first and second numbers of the device, and the first second and third outputs are the outputs of the quality comparison result of the device, contains an AND-OR element, a counter and a decoder, the first and the second outputs of which are provided by the outputs of quantitative evaluation of the result of comparing the device, the inputs of the first group of the element AND-OR are connected to the inputs of the direct values of the first and second numbers of the device and the second output of the block comparison, the inputs of the second group of the element OR OR are connected to the inputs of the inverse values of the first and second numbers of the device and BTOJXJM output of the comparison block, the inputs of the third group of the AND-NLI element are connected; to the inputs of the direct value of the first number and the inverse value of the second number of the device and the third output the comparison unit, the inputs of the fourth group of the AND-OR element are connected to the inputs of the inverse value of the first number and the direct value of the second number of the device and the first output of the comparison unit, the output of the ORI element is connected to the counting input counters :; A control output of which is connected to the interrogation input of the device, and the bits of the counter are connected to the inputs of the decoder. The drawing shows a diagram of the device for comparison. The device comprises a comparison unit 1, an AND-OR 2 element, a counter 3 and a daifter 4. The device operates as follows. The inputs of the comparison unit 1 and the element AND-OR 2 receive the direct and inverse values of the codes of the first and second numbers, A, B and A, B, respectively. In case of equality of codes A and B: at the second output of block 1 of comparison, & there is a signal of a qualitative result of comparison, which opens the first two. a group of inputs of the AND-OR element 2, by allowing caNKiM to pass the counter 3 pulses to the counting input counter A and B or A and B. By the impulse A poll on the initial output of the decoder 4 shows the equality signal of the number codes. If the numbers A and B differ by one least significant bit, the device operates similarly until the first inequality of codes. Since the circuit is designed to compare consecutive binary numbers, preceded by the most significant bit ahead, the relative value of the numbers is determined by the first difference in the value of bits. In this example, this happens on the fourth clock; The first two groups of inputs of the AND-OR 2 element are blocked due to the loss of the AsB signal and the fourth group is opened with a signal from the first output of the comparison unit 1. At the counting input of counter 3, pulses are compared to the clocked numbers A and Bg (nine in total, pulses). Thus, at the second output of the decoder 4, a signal appears that signals the difference in binary numbers Ag and Bj per unit of the least significant bit. In the case of a difference in binary codes for two units of the least significant bit, the circuit operates similarly. At counter 3, eight coincidence pulses are transmitted, with the second output of decoder 4 it should signal that counter 3 is full to eight, and
310436314310436314
опрос происходит на такт раньше пре-чисел не только по качественному кридыдущего случа , т.е. по дев тому терию (больше,равно,меньше),но и по разр дуколичественной оценке результатовThe survey takes place to the clock before the pre-numbers not only in the qualitative case of the current case by nine terms (greater, equal, less), but also according to the quantitative estimation of the results
В общем случае, перестраива вто-iсравнени с произвольной точностью рой выход дешифратора- 4 на опреде- + единиц младших разр дов двоичных ленное заполнение счетчика 3 с соот- 5 чисел. Это позвол ет отказатьс от ветствукхцим сдвигом сигнала Опрос, специализированных вычислителей, ;можно получить сравнение двоичных примен емых дл этих целей.In the general case, rebuilding the second comparing with an arbitrary precision, the swarm output of the decoder is 4 to a certain + fewer bits of the binary filling of the counter 3 with the corresponding 5 numbers. This makes it possible to reject the response to a shift of the signal of the interrogation, specialized calculators, and one can obtain a comparison of the binary used for these purposes.