-го элемента ИЛИ группы, выходы триггеров вл ютс инверсные , разности сравниваемых чисел устройвыходами 1167603 element of the OR group, the outputs of the triggers are inverse, the differences of the compared numbers of the device outputs 1167603
Изобретение относитс в автомати ке и вычислительной технике и может быть использована при реализации технических средств дискретной авто матики и ЭВМ. Целью изобретени вл етс расши рение области применени за счет получени разности сравниваемых чисел дл любых комбинаций сравниваемых чисел за счет использовани нового алгоритма формировани разности сра ниваемых чисел, реализуемого дополнительными элементам. На чертеже схематически показано предлагаемое устройство. Устройство содержит кольцевые сдвигающие регистры 1 и 2, элементы И 3 и 4, триггеры 5 и 6,.элементы 7-10, элементы ИЛИ 11 и 12, элемент НЕ 13, счетчик 14, дешифратор 15, группу входных элементов И 16, группу элементов задержки 17, группу элементов ИЛИ 18, группу триггеров 19, группу элементов И переноса 20. , Устройство работает следующим образом. Старшие разр ды сравниваемых чисел поступают на элементы И 3 и 4. При равенстве старших разр дов на рыходах элементов И 3 и 4 сигнал ра вен ОЧ Если старший разр д числа, наход щегос в регистре 1 больше, чем старший разр д числа в регистре 2, то срабатывает элемент И 3. Единичный сигнал с этого элемента, проход через элемент И 7, ввиду того, что триггер 5 находитс в сос то нии О, поступает на вход S триггера 6 и переводит его в единич ное состо ние. Б дальнейшем, при сравнении последующих разр дов чисе состо ние триггеров 5 и 6 не мен ет с . Если же сказываетс большим ста ший разр д числа, наход щегос в регистре 2, то срабатывает элемент И 4, что, в свою очередь, приводит к установлению в единичное состо ни триггера 5. Поэтому состо ние триггеров несет информацию о том, какое число больше. Если триггер 6 находитс в единичном состо нии, то больше число, наход щеес в регистре 1,. если триггер 5 находитс в единичном состо нии, то больше число, наход щеес в регистре 2, Триггеры 5 и 6 совместно с элементами И 7-10 осуществл ют коммутацию результата сравнени чисел таким образом, что на вход элемента ИЛИ 11 поступает единичный сигнал, если соответствующий разр д большего числа больше, чем тот же разр д меньшего числа, а на вход элемента ИЛИ 12 поступает единичный сигнал, если соответствующий разр д меньшего числа больше, чем тот же разр д большего числа. Сигналы с выходов элементов ИЛИ 11 и 12, с элемента ИЛИ 11 через инвертор 13, соответственно через элементы И 16-1 и И 16-2 поступают на общий вход триггера 19-1, состо ние инверсного выхода которого отражает значение старшего разр да разности сравниваемых чисел Д . При этом сигнал с выхода элемента И 16-2 поступает на вход триггера через элемент задержки 17-1, с временем задержки на длительность импульса сдвига. Объединение сигналов на входе триггера 19-1 осуществл етс элементом ИЛИ 18-1. После поступлени 1-го импульса сдвига присутствует сигнал на 2-м выходе дешифратора 15, сигнал с выходов элементов ИЛИ 11 и 12, с элемента ИЛИ 11 через инвертор 13, поступают через соответствующие логические элементы 16-3 и 16-4, 17-2, 18-2 на общий вход триггера 19-2, состо ние инверсного выхода которого отрал ает значение следующего разр да разности сравниваемых чисел. После поступлени 2-го импульса сдвига сигнал по вл етс на 3-м выходе дешифратора, что при3 водит к поступлению сигналов с выхо дов элементов ИЛИ 11 и 12, с элемен та ИЛИ 11 через инвертор 13, на общий вход триггера 19-3 и т.д. В про цессе формировани очередного знака разр да разности, если с обоих элементов ИЛИ 11 и 12, с элемента ИЛИ через инвертор 13, на общий вход соответствующего триггера поступают .единичные сигналы, происходит перенос 1 в старший разр д, через соответствующий злемент И группы 20. Дл осуществлени этой операции триггер должен срабатывать по заднему фронту импульса. Результат разности сравниваемых чисел формируетс на инверсных выходах триггеров группы 19 после поступлени (h -1)го импульса сдвига, где гг -разр дность сравниваемых двоичных чисел. Применение данного устройства позвол ет получить результат сравнени двоичных чисел с фиксацией как качественного результата сравнени . ( , , ), так и количественного результата в виде модул разности 4 дл всевозможных комбинатдий сравниваемых чисел. Цель изобретени достигаетс за счет введени дополнительных элементов 13-15, группы элементов И 16, группы элементов задержки 17, группы элементов ИЛИ 18, группы триггеров 19 и группы элементов И 20. Эти элементы реализуют новый алгоритм получени разности сравниваемых чисел из сигналов, присутствующих на выходах 034 элементов ИЛИ 11 и 12. Алгоритм заключаетс в следующем: сигнал с выхода элемента ИЛИ 11 инвертируетс и суммируетс с сигналом, поступающим с элемента ИЛИ 12, результат разности сравниваемых чисел получаетс равным обратному коду, который получаетс в результате суммировани . Пример сравнени двоичных чисел: Af2j 101110 и 011011. В этом случае на выходе элемента ИЛИ 11 -присутствует следующа двоична последовательность F. 100100, а на выходе элемента ИЛИ 12 - следующа Е,2 010001. Б соответствии с предлагаемым алгоритмом получаем: двоична последовательность на выходе инвертора 13 F.,3 011011, результат cyм шpoвaни двоичных последовательностей дает результат 011011 010001 101100 обратный код результат сравнени 010011 , что соответствует правильному результату. Действительно (А - В)j равно 101110 011011 010011The invention relates to automation and computer technology and can be used in the implementation of discrete automatics and computer hardware. The aim of the invention is to expand the field of application by obtaining the difference of the compared numbers for any combinations of the compared numbers by using the new algorithm for forming the difference of the scored numbers realized by the additional elements. The drawing schematically shows the proposed device. The device contains an annular shift registers 1 and 2, elements And 3 and 4, triggers 5 and 6, elements 7-10, elements OR 11 and 12, element NOT 13, counter 14, decoder 15, group of input elements AND 16, group of elements delay 17, a group of elements OR 18, a group of triggers 19, a group of elements AND transfer 20. The device works as follows. The highest bits of the numbers being compared are received at the elements 3 and 4. If the high bits on the outputs of the elements 3 and 4 are equal, the signal is equal to black if the highest bit of the number in register 1 is greater than the highest bit in register 2 , then element 3 is triggered. A single signal from this element, the passage through element 7, in view of the fact that trigger 5 is in the O state, enters input S of trigger 6 and translates it into a single state. Further, when comparing subsequent bits, the state of triggers 5 and 6 does not change with. If, on the other hand, the large digit of the number in register 2 is affected, then element 4 is triggered, which in turn leads to the establishment of trigger one in one state. Therefore, the state of triggers carries information about which number is greater than . If trigger 6 is in a single state, then the number in register 1 is greater. if trigger 5 is in the single state, then the number in register 2 is greater, Triggers 5 and 6, together with elements 7–10, switch the result of the comparison of numbers in such a way that the input signal OR 11 receives a single signal if the corresponding bit of the larger number is greater than the same bit of the smaller number, and a single signal is received at the input of the element OR 12 if the corresponding bit of the smaller number is greater than the same bit of the larger number. The signals from the outputs of the elements OR 11 and 12, from the element OR 11 through the inverter 13, respectively, through the elements AND 16-1 and AND 16-2 arrive at the common input of the trigger 19-1, the state of the inverse output of which reflects the value of the higher bit difference compared numbers d. The signal from the output of the element And 16-2 is fed to the trigger input through the delay element 17-1, with a delay time for the duration of the shift pulse. The combination of the signals at the input of the trigger 19-1 is performed by the element OR 18-1. After the arrival of the 1st shift pulse, there is a signal at the 2nd output of the decoder 15, the signal from the outputs of the elements OR 11 and 12, from the element OR 11 through the inverter 13, is received through the corresponding logic elements 16-3 and 16-4, 17-2 , 18-2 to the common input of the trigger 19-2, the state of the inverse output of which corresponds to the value of the next bit of the difference of the compared numbers. After the arrival of the 2nd shift pulse, a signal appears at the 3rd output of the decoder, which at 3 leads to the arrival of signals from the outputs of the OR 11 and 12 elements, from the OR 11 element through the inverter 13, to the common trigger input 19-3 and etc. In the process of forming the next digit of the difference of the difference, if both elements OR 11 and 12, from the OR element through the inverter 13, single signals are sent to the common input of the corresponding trigger, 1 is transferred to the senior bit, through the corresponding element AND of group 20 To perform this operation, the trigger must trigger on the falling edge of the pulse. The result of the difference of the compared numbers is formed on the inverse outputs of the flip-flops of group 19 after the arrival of the (h -1) th shift pulse, where yy is the size of the binary numbers being compared. The use of this device allows to obtain the result of comparing binary numbers with fixation as a qualitative result of comparison. (,,), and quantitative result in the form of a modulus of the difference of 4 for all sorts of combines of compared numbers. The purpose of the invention is achieved by the introduction of additional elements 13-15, the group of elements AND 16, the group of delay elements 17, the group of elements OR 18, the group of flip-flops 19 and the group of elements AND 20. These elements implement a new algorithm for obtaining the difference of compared numbers from the signals present in outputs 034 of the elements OR 11 and 12. The algorithm is as follows: the signal from the output of the element OR 11 is inverted and summed with the signal from the element OR 12, the result of the difference of the compared numbers is equal to the reverse code, ing is obtained as a result of summing. An example of comparing binary numbers: Af2j 101110 and 011011. In this case, the output of the OR 11 element is the following binary sequence F. 100100, and the output of the OR 12 element is the next E, 2 010001. According to the proposed algorithm, we get: the binary sequence on the output of the inverter is 13 F., 3 011011, the result of the combination of binary sequences gives the result 011011 010001 101100 the reverse code is the result of comparison 010011, which corresponds to the correct result. Indeed (A - B) j equals 101110 011011 010011