Claims (2)
Изобретение относитс к автоматик и ВЕЛчислительной технике и может быть использовано при реализации тех нических средств сравнени двоичных кодов, а также дл определений принадлежности кода к заданной группе кодов с общим групповьм признаком Известно устройство дл сравнени п-разр дных двоичных чисел содержащее п счетных триггеров со входами установки в единичное и нулевое сост ние, выходы которых соединены со входами злемента ИЛИ/ выход которого подключен к первой выходной шине устройства, одни из входов установки в нулевое состо ние триггеров объединены между собой и подключе ы к шине Сброс ClJ. Наиболее близким -к предлагаемому вл етс устройство дл сравнени чи сел, содержащее п счетных триггеров со входами установки в единичное и нулевое состо ние, выходы кото рых соединены со входами элемента ИЛИ, выход которого подключен к пер вой выходной шине устройства, одни из входов установки в нулевое сое- то ние триггеров объединены между собой и подключены к шине Сброс, входные шины первого числа соединены со входами установки в единич-ное ;состо ние триггеров, а входные шины второго числа подключены к счетным входам триггеров, другие входы установки в нулевое состо ние соединены с шинами определени групповой принадлежности сравниваемых чисел 2 . Недостатком этого устройства вл етс ограниченность класса реша емых задач, так как устройство осуществл ет сравнение двух гт-разр дных двоичных чисел А и В только на равенство (А-В ) и проверку- принадлежности кода к заданной группе кодов с общими групповыми признаками, но не определ ет при неравенстве большего (или меньшего) из них (А7В или ). Цель изобретени - расширение функциональных возможностей за счет обеспечени сравнени на больше и меньше с общим групповым признаком . Это достигаетс тем, что в него введено 4 синхронных триггеров, причем пр мой выход каждого -го счетного триггера соединен с информационным входом -i -го синхронного триггера , пр мой выход каждого из которых подключен к (i +2)-ому входу ( )-Г9... счетных триггеров и к -ому входу второго элемента ИЛИ, выход которого соединен с управл ющим входом элемента ЗАПРЕТ и с первым входом элемента ИЛИ-НЕ, выход первого элемента ИЛИ подключен к информационному входу, элемента ЗАПРЕТ, выход которого сое динен со вторым входом элемента ИЛИ-НЕ, а первые входы установки в нулевое, состо ние всех синхронных триггеров подключены к шине сброса , пр мой выход каждого счет ного триггера соединен с ( входом установки в нулевое состо ни ( 4 4-1)-го, ()-ГО. . ., п-го синхро ных триггеров. На чертеже, представлена схема устройства, о Устройство состоит из п счетных триггеров 1у, Ij, ...1ц синхронных элементов триггеров 2, ИЛИ 3,4 элемента ЗАПРЕТ 5, элемента ИЛИ-НЕ б, выходов 7-9, шины сброса 10, входных шин первого числа 11/, lljp, ... 11ц входных шин второго числа 12;|, 12, ... вторых шин кода маски 13, ...13. (вход с; l-ro. Устройство работает следующим об разом. В исходном -состо нии триггеры 1 находгтс в..нулевс « состо нии, что обеспечиваетс установочным сигналом по шине 10. При вводе в устройство первого, сравниваемого кода А по шинам 11 триггеры 1 принимают состо ние , повтор ющее значени соответствующих разр дов этого кода. После этого по шинам 12, соединенным со счетными входами счетных триггеров 1 и входами синхронизации синхр ных триггеров 2, в устройство ввод второе сравниваемое число Б. В результате -1 -и счетный триггер ведет в состо ние О, если состо ние, прин тое им после ввода первого кода , совпадает со значением -i-ro раз р да второго.вводимого кода. В прот ном случае -и счетный триггер находитс в состо нии 1. В состо нии О будет также синхронный триггер, если в состо нии О - ч счетный триггер, так как перевод синхронного триггера в состо ние 1 возможен при условии подачи сигнала 1 на синхронный вход С одновремен с переходом выходного сигнала -f -го счетного триггера иэ состо ни О в состо ние 1. Переход выходного сигнала 1 -го счетного триггера из состо ни О состо ние 1 имее место в случае подачи на вход 5 I-r счетного триггера по шине сигнал 1 и в случае подачи на этот вход сигнала О с последующей подачей на счетный вход по шине B-j сигнала 1. В первсм случае 1-й синхронный триггер 2 остаетс в состо нии О, так как на его синхронном входе отсутствует сигнал 1. Во втором случае i -и синхронный триггер переведен в состо ние 1, так как выполнено условие перехода входного сигнала на пр мом динамическом входе 4-го синхронного триггера из состо ни О в состо ние 1 одновременно с подачей сигнала 1 на синхронный вход этого триггера. Таким образом, если значени всех разр дов сравнивае1 Нэ1Х кодов совпадают то после ввода этих кодов в устройство все триггеры 1 и 2 наход тс в состо нии О, сигнал Q сн т также с выхода элемента ИЛИ 4 и с выходов соединенных последовательно элементов ИЛИ 3 и ЗАПРЕТ 5, а на выходной шине 9 А-В по вл етс сигнал 1 с выхода элемента ИЛИ-НЕ 6. Если сравниваемые коды не совпадгиот хот бы в одном разр де сравнени и при этом А7Б, то триггер 1 этого разр да находитс в состо ний 1. Сигнал 1 с выхода этого триггера одновременно поступает на другие входы (или могут быть вторые ипоследующие входы) установки в состо ние О синхронных триггеров 2 всех младших разр дов сравнени на вход элемента ИЛИ 3. С выхода элемента ИЛИ 3 оигналчерез элемент ЗАПРЕТ 5, на инверсном входе которого при этом есть сигнал О, поступает на выходную шину 8 А-уБ и на один из входов элемента ИЛИ-НЕ 6, на выходе которого и соответственно на шине 9 находитс сигнал О. И дл случа , если сравниваемые коды не совпадают хот бы в одном разр де, то триггеры счетный 1 и синхронный 2: этого разр да наход тс в состо нии 1. Сигналы 1 с выходов счетного и синхронного триггеров одновременно поступеио на другие входы (или могут быть вторые и.:последующие %ходы) установки в состо ние О соответственно синхрюнных 2 и счетных 1 триггеров всех младших разр дов сравнени и на входы элементов ИЛИ 3 и ИЛИ 4. С выхода элемента ИЛИ 4 сигнал 1 поступает на выходную шину и при этом поступает на инверсный вход элемента ЗАПРЁТ 5, запреща этим прохождение . сигнала 1 с выхода элемента ИЛИ 3 череэ элемент ЗАПРЕТ 5 на выходную шину 8, Также сигнал 1 с выхода элемента ИЛИ 4 поступает на один из входов элемента ИЛИ-НЕ 6. На выходе этого элемента и соответственно на шине 9 будет сигнал О. Устройство может быть применено также дл определени принадлежности кода к группе кодов с общим групповым признаком в виде некоторых разр дов, значени которых безразличны . При этом номера безразличных разр дов задаютс дополнительным |кодом, имеющим 1 в тех разр дах, значени которых безразличны дл заданной группы кодов, и О в остальных разр дах, в этом режиме после введени в регистр сравниваемых кодов, состо щий из счетных триггеров 1, по шинам 13, соединенным со вторыми входами установки сче ;ных триггеров в состо ние О, одновременно с подачей кода Б в него записываетс дополнительное число группового кода, в результате счетные триггеры 1, соответствующие разр дам , значени которых дл заданной группы кодов безразличны, переведены в состо ние О независимо от их предшествующего значени , а синхронные триггеры 2, соответствукедие этим разр дам, остаютс в состо нии О, так как не выполнено условие перехода сигналов на пр мых динамических входах этих синхронных триггеров из состо ни Q в состо ние 1 одновременно с подачей сигналов 1 на их синхронные входа. Следовательно все тригге{Ж1 регистров наход тс в состо нии б, если асе разр ды сравниваенелх кодов, по которым производитс сравнение, совпадаю независиАЮ от того совпадают или не значени безразличных разр дов. Если сравниваемые коды не совпадают хот бы в одном разр де, значение которо не безразлично, то соответствующий счетный триггер или соответствующие счетный и синхронный триггеры наход тс в состо нии 1. В первом слу чае с-выхода 9 сн т сигнал равенства кодов А-В, во втором - с выхода 8 сигнал, подтверждакиций или с выхода 7 - сигнал, подтверждающий А. В . . Устройство осуществл ет .сравне .ние двух чисел на равенство, провер ку принадлежности кода к заданной группе кодов с общим групповымоПризнаком и в отличие от прототипа определ ет принеравенстве двух сравниваемых чисел большее (или меньйее из них.. Формула изобретени Устройство дл сравнени Ч1|сел, содержащее элементы ИЛИ, .ИЛЙ-НЕг ЗАПРЕТ, п с-четных триггеров, пр мые выходы которых соединены со входами первого элемента ИЛИ, входна шина каждого а -го разр да первого числа, где 4 1,2...п подключена .ко входу установки в единичное состо ние -t -то счетного триггера, входна шина кгикдого t-i -го разр да второго числа соединена с инфа(мационным входом 1-го счетного триггера, входна шина i -го разр да кода маски подключе|на к первому входу установки в нулеjBoe состо ние i-го счетного триггера , шина сброса соединена со вторыми входами установки в нулевое состо ние всех счетных триггеров, отличающеес тем, что, с целью расширени функциональных возможностей за счет обеспечени сравнени на Больше и Меньше с общим групповым признаком, в него введено А синхронных триггеров, причем пр мой выход калщого -го счетного триггера соединен с информационным входом 4 -го синхронного триггера, пр мой выход каждого из которых подключен кО +2) входу(1+1)-го,(1+2)-го, ... и-гр счетных триггеров и .к 1-ому входу второго элемента ИЛИ, выход которого соединен с управл ющим входст элемента ЗАПРЕТ и с первьш вводом элемента ШШ-НЕ, выход первого элементаИЛИ подключен к информгщионному входу элемента ЗАПРЕТ . выход которого соединен со вторым входом элемента ИЛИ-НЕ, а первые входы установки в нулевое состо ние всех синхронных триггеров подключены к ш,ине сброса, пр мой выход кгос-о дого i -,го счетного триггера соединен с(+1)-ым входом установки в нулевое состо ние (ч- -го/С 1+2)-го, ... и-го синхронных триггеров. Источники ИНфОрМсЩИИу, прин тые во внимание при экспертизе 1.Авторское свидетельство СССР 341032,. кл. G06 F 7/02, 1970. The invention relates to automation and technology and can be used in the implementation of technical means for comparing binary codes, as well as for determining whether a code belongs to a given group of codes with a common group of signs. A device for comparing n-bit binary numbers containing n counting triggers with inputs is known. units in the single and zero state, the outputs of which are connected to the inputs of the element OR / whose output is connected to the first output bus of the device, one of the inputs of the installation in the zero state triggers are interconnected and connected to the Reset ClJ bus. The closest to the present invention is a device for comparing numbers of villages, containing n counting triggers with installation inputs in single and zero state, the outputs of which are connected to the inputs of the OR element, the output of which is connected to the first output bus of the device, one of the installation inputs in the zero connection of the flip-flops are interconnected and connected to the Reset bus, the input buses of the first number are connected to the unit inputs to the unit; the status of the flip-flops, and the input buses of the second number are connected to the counting inputs of the flip-flops, O ther inputs of a null state are connected to the buses belonging group determining two numbers being compared. A disadvantage of this device is the limitedness of the class of tasks to be solved, since the device compares two rt-bit binary numbers A and B only for equality (A-B) and the verification that the code belongs to a given group of codes with common group features, but does not determine if the inequality is greater (or smaller) of them (A7B or). The purpose of the invention is to expand the functionality by providing a comparison of more and less with a common group attribute. This is achieved by the fact that 4 synchronous triggers are entered into it, and the direct output of each -th counting trigger is connected to the information input of the i -th synchronous trigger, the direct output of each of which is connected to the (i + 2) -th input () -G9 ... counting triggers and to the -th input of the second element OR, the output of which is connected to the control input of the BANNER element and to the first input of the OR element NOT, the output of the first element OR connected to the information input of the BAN element whose output is connected with the second input of the element OR NOT, and the first inputs set to zero, the state of all synchronous triggers are connected to the reset bus, the direct output of each counting trigger is connected to (the setting input to the zero state (4 4-1) -th, () -H..., n-th synchronous triggers. In the drawing, a diagram of the device, o The device consists of n counting triggers 1у, Ij, ... 1c synchronous elements of triggers 2, OR 3.4 BANNER element 5, element OR NOT B, outputs 7-9, reset tires 10, input tires of the first 11 /, lljp, ... 11c input buses of the second 12; |, 12, ... second buses of the mask code 13, ... 13. (input from; l-ro. The device operates as follows. In the initial state, the triggers 1 are in the "zero" state, which is provided by the setup signal on the bus 10. When the first, compared code A is entered on the bus, 11 the triggers 1 take the state that repeats the values of the corresponding bits of this code.Then, bus 12 connected to the counting inputs of the counting triggers 1 and the synchronization inputs of the synchronous triggers 2 into the device enters the second compared number B. As a result, -1 and counting trigger leads to O, if the state accepted by it after entering the first code coincides with the value of -i-ro times the number of the second entered code. In the simple case, the counting trigger is in state 1. The O state will also be synchronous the trigger, if in the state O - h the counting trigger, since the synchronous trigger transfer to state 1 is possible under the condition that signal 1 is supplied to the synchronous input C simultaneously with the output signal switching from the ff counting trigger and state O to state 1 . The transition of the output signal of the 1st counting trigger from the state O state 1 and less place in case of input to input 5 Ir of a counting trigger via bus signal 1 and in case input to this input of signal O followed by feeding signal to bus 1 via bus Bj. In the first case, the 1st synchronous trigger 2 remains in state O , since its synchronous input has no signal 1. In the second case, the i -th and synchronous trigger is transferred to state 1, since the condition of the input signal on the forward dynamic input of the 4th synchronous trigger from state O to state 1 is satisfied simultaneously with the signal 1 to the synchronous input of this trigger Thus, if the values of all bits compare 1 Ne1X codes, then after these codes are entered into the device, all the triggers 1 and 2 are in the O state, the Q signal is also removed from the output of the OR 4 element and from the outputs of the series-connected OR 3 elements and BAN 5, and on output bus 9 A-B signal 1 appears from the output of the element OR NOT 6. If the compared codes do not match at least in one comparison bit and at the same time A7B, then the trigger 1 of this bit is 1. Signal 1 from the output of this trigger simultaneously enters the other inputs (or there can be second and subsequent inputs) of the installation into the state O synchronous triggers 2 all lower comparison bits to the input of the element OR 3. From the output of the element OR 3 the signal through the element BANE 5, on the inverse input of which there is a signal O, goes to the output bus 8 A-UB and to one of the inputs of the element OR-NOT 6, the output of which and, accordingly, bus 9 contains the signal O. And for the case if the compared codes do not match at least in one bit, then the triggers are counting 1 and synchronous 2: of this bit are in state 1. Signals 1 with output s of the counting and synchronous triggers simultaneously arrive at other inputs (or there may be second and.: subsequent% moves) set to state O, respectively, of synchronic 2 and counting 1 triggers of all lower-order comparison digits and to the inputs of the OR 3 and OR 4 elements. the output of the element OR 4 signal 1 is fed to the output bus and at the same time it arrives at the inverse input of the element BLOCK 5, prohibiting it from passing. signal 1 from the output of the element OR 3 through the element BANCH 5 on the output bus 8; Also the signal 1 from the output of the element OR 4 goes to one of the inputs of the element OR NOT HE 6. At the output of this element and accordingly on the bus 9 there will be a signal O. The device can It can also be used to determine whether a code belongs to a group of codes with a common group attribute in the form of some bits whose values are indifferent. In this case, the indifferent bit numbers are specified by an additional | code, having 1 in those bits, the values of which are indifferent for a given group of codes, and O in the remaining bits, in this mode, after entering into the register of compared codes consisting of counting triggers 1, bus 13 connected to the second inputs of the installation of triggering triggers in the state O, simultaneously with the filing of the code B, an additional number of the group code is written to it, as a result the counting triggers 1 corresponding to the bits whose values for the given group to They are indifferent, transferred to the state O regardless of their previous value, and synchronous triggers 2, corresponding to this bit, remain in the state O, because the condition of signal transition on the direct dynamic inputs of these synchronous triggers from the state Q to state 1 at the same time as signals 1 are sent to their synchronous inputs. Consequently, all the triggers {F1 registers are in state b, if the bit of the comparison compares the same codes for which the comparison is made, the match is independent of whether the values of the indifferent digits match or not. If the compared codes do not coincide at least in one bit, the value of which is not indifferent, then the corresponding counting trigger or the corresponding counting and synchronous triggers are in state 1. In the first case, from the output 9, the signal of equality of codes А-В is removed. , in the second - from output 8 a signal, confirmation or from output 7 - a signal confirming A. В. . The device compares two numbers for equality, checks whether a code belongs to a given group of codes with a common Group Acceptance and, unlike the prototype, determines if the two compared numbers are larger than or the least of them. Formula of the device for comparison 1 | containing the elements OR, .ILY-NON-BANNING, n with even-numbered triggers, the direct outputs of which are connected to the inputs of the first element OR, the input bus of each a -th bit of the first number, where 4 1.2 ... n is connected. to unit setup input -t the counting trigger, the input bus of the tik-th digit of the second number is connected to the infa (the main input of the 1st counting trigger, the input bus of the i-th digit of the mask code connected to the first input of the setting in the zero iBoe state of the i-th the counting trigger, the reset bus is connected to the second inputs of setting all counting triggers to zero state, characterized in that, in order to extend the functionality by providing a comparison of More and Less with the general group attribute, A synchronous triggers are entered into it, andThe second output of each counting trigger is connected to the information input of the 4th synchronous trigger, the direct output of each of which is connected to the O +2) input of the (1 + 1) -th, (1 + 2) -th, ... and- The counting triggers and the 1st input of the second element OR, the output of which is connected to the control input of the BANNER element and with the first input of the W-NO element, the output of the first element OR is connected to the informative input of the BAN element. the output of which is connected to the second input of the OR-NOT element, and the first inputs of the installation to the zero state of all synchronous triggers are connected to w, non-reset, the direct output of the kgos-dogo i -, th counting trigger is connected to (+1) th the installation input to the zero state (h -th / C 1 + 2) -th, ... and -th synchronous triggers. Sources of INFORMATION, taken into account during the examination 1. Author's certificate of the USSR 341032 ,. cl. G06 F 7/02, 1970.
2.Авторское свидетельство СССР №561959, кл. G06 F 7/04, 1975 ( прототип).2. USSR author's certificate No. 561959, cl. G06 F 7/04, 1975 (prototype).