[go: up one dir, main page]

RU2156998C1 - Device for modulo addition and subtraction of integers - Google Patents

Device for modulo addition and subtraction of integers Download PDF

Info

Publication number
RU2156998C1
RU2156998C1 RU99102011/09A RU99102011A RU2156998C1 RU 2156998 C1 RU2156998 C1 RU 2156998C1 RU 99102011/09 A RU99102011/09 A RU 99102011/09A RU 99102011 A RU99102011 A RU 99102011A RU 2156998 C1 RU2156998 C1 RU 2156998C1
Authority
RU
Russia
Prior art keywords
input
elements
inputs
output
outputs
Prior art date
Application number
RU99102011/09A
Other languages
Russian (ru)
Inventor
В.П. Ирхин
Е.Б. Глазков
М.А. Лукьянов
А.А. Долгачев
Ю.Г. Крюков
Original Assignee
Воронежский государственный технический университет
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Воронежский государственный технический университет filed Critical Воронежский государственный технический университет
Priority to RU99102011/09A priority Critical patent/RU2156998C1/en
Application granted granted Critical
Publication of RU2156998C1 publication Critical patent/RU2156998C1/en

Links

Landscapes

  • Error Detection And Correction (AREA)

Abstract

FIELD: automation and computer engineering. SUBSTANCE: device may be used for computers and control equipment operating in residual class system. Device has two groups of OR gates, three ring shift registers, size AND gates, differentiating circuit, seven AND gates, four OFF gates, encoder, decoder, unit of OR gates, two NOT gates, two counters, two NOR gates, OR gate, converter of integer

Description

Изобретение относится к области автоматики и вычислительной техники и может быть использовано в вычислительных машинах и устройствах, функционирующих в системе остаточных классов. The invention relates to the field of automation and computer engineering and can be used in computers and devices operating in a system of residual classes.

Известно устройство (аналог) (Авт. св. СССР N 1636844, МКИ G 06 F 7/72, Б. И. N 11, 1991 г.), содержащее дешифраторы, блоки элементов И и ИЛИ, элементы запрета, кольцевой регистр сдвига, схему сравнения, элементы И и ИЛИ, шифраторы. Недостаток устройства - низкое быстродействие выполнения модульных операций. A device (analogue) is known (Aut. St. USSR N 1636844, MKI G 06 F 7/72, B. I. N 11, 1991), containing decoders, blocks of AND and OR elements, prohibition elements, annular shift register, comparison scheme, AND and OR elements, encoders. The disadvantage of this device is the low performance of modular operations.

Известно также устройство (аналог) (Авт. св. СССР N 1683011, МКИ G 06 F 7/72, Б. И. N 37, 1991 г.), содержащее кольцевой регистр сдвига, вычитатель по модулю, блоки элементов И, блок элементов ИЛИ, регистр, схему сравнения, счетчик, элементы запрета, шифратор, преобразователь единичного кода в унитарный код, преобразователь двоичного кода в единичный код. Недостаток устройства - низкое быстродействие выполнения модульных операций. It is also known a device (analogue) (Aut. St. USSR N 1683011, MKI G 06 F 7/72, B. I. N 37, 1991), containing an annular shift register, a subtracter modulo, blocks of elements And, block of elements OR, register, comparison scheme, counter, prohibition elements, encoder, unit code to unitary code converter, binary code to unit code converter. The disadvantage of this device is the low performance of modular operations.

Наиболее близким по технической сущности (прототипом к предлагаемому изобретению) является устройство (Авт.св. СССР N 1820380, МКИ G 06 F 7/72, Б. И. N 21, 1993 г.), содержащее дешифратор, группу элементов ИЛИ, кольцевой регистр сдвига, шифратор, элементы И и ИЛИ, блок элементов И, преобразователи кода, счетчик, элементы ИЛИ-НЕ, элемент запрета, сумматор по модулю два, элементы НЕ. Длительность модульной операции пропорциональна модулю устройства, что обуславливает его основной недостаток. The closest in technical essence (prototype to the proposed invention) is a device (Autost. St. USSR N 1820380, MKI G 06 F 7/72, B. I. N 21, 1993), containing a decoder, a group of elements OR, ring shift register, encoder, AND and OR elements, block of AND elements, code converters, counter, OR-NOT elements, prohibition element, modulo two adder, NOT elements. The duration of the modular operation is proportional to the module of the device, which leads to its main disadvantage.

Недостаток прототипа - низкое быстродействие, которое определяется в худшем случае (m-1)/2, т. е. пропорционально модулю устройства. The disadvantage of the prototype is the low speed, which is determined in the worst case (m-1) / 2, i.e., is proportional to the module of the device.

Задача, на решение которой направлено заявляемое устройство, состоит в повышении производительности перспективных образцов вычислительной техники. The task, which is aimed by the claimed device, is to increase the productivity of promising samples of computer technology.

Технический результат выражается в повышении быстродействия выполнения модульных операций сложения и вычисления за счет уменьшения длительности выполнения каждой операции. The technical result is expressed in improving the performance of modular operations of addition and calculation by reducing the duration of each operation.

Технический результат достигается тем, что в устройство для сложения и вычитания чисел по модулю, содержащее дешифратор, первую группу элементов ИЛИ, с первого по третий блоки элементов И, первый счетчик, первый элемент ИЛИ-НЕ, первый элемент запрета, с первого по четвертый элементы И, первый и второй элементы НЕ, первый кольцевой регистр сдвига, элемент ИЛИ, шифратор, блок элементов ИЛИ и три преобразователя, причем первый информационный вход устройства соединен со входом дешифратора, 1-ые выходы которого (1 = (t•k+d) < m;

Figure 00000004
m - модуль операции; k - внутренний модуль устройства) соединены с t-ми входами d-ых элементов ИЛИ первой группы, выходы которых соединены с первыми входами соответствующих элементов И первого блока, вторые входы которых соединены с входом начальной установки устройства и с входом разрешения записи первого кольцевого регистра сдвига, входы d-ых разрядов которого соединены с соответствующими выходами первого блока элементов И, первый вход второго элемента И соединен со входом первого элемента НЕ, выход которого соединен с первым входом первого элемента И, второй вход которого соединен с вторым входом второго элемента И, с выходом первого элемента запрета и с вычитающим входом первого счетчика, выходы разрядов которого соединены с соответствующими входами первого элемента ИЛИ-НЕ, выход которого соединен с управляющим входом первого элемента запрета, выходы второго и первого элементов И соединены соответственно с входами задания сдвига вправо и сдвига влево содержимого первого кольцевого регистра сдвига, введены вторая группа элементов ИЛИ, с четвертого по шестой блоки элементов И, дифференцирующая цепочка, с пятого по седьмой элементы И, второй и третий кольцевой регистры сдвига, со второго по четвертый элементы запрета, один из преобразователей выполнен в виде преобразователя кода числа
Figure 00000005
в код [X/k), другой является преобразователем кода числа X в код Xmodk и третий - преобразователем кода числа в дополнительный код по модулю, второй счетчик, второй элемент ИЛИ-НЕ, причем 1-е выходы дешифратора соединены с d-ми входами t-ых элементов ИЛИ второй группы, выходы которых соединены с первыми входами соответствующих элементов И пятого блока, вторые входы которых соединены с входом начальной установки устройства и с входом разрешения записи второго кольцевого регистра сдвига, входы разрядов которого соединены с выходами соответствующих элементов И пятого блока, а выходы разрядов - с первыми входами соответствующих элементов И шестого блока, n-ые выходы которого
Figure 00000006
соединены с (k•n•mod m)-ми входами разрядов третьего кольцевого регистра сдвига, выходы разрядов которого соединены с первыми входами соответствующих элементов И четвертого блока, выходы которого соединены со входами шифратора, выход которого является выходом устройства, второй информационный вход устройства соединен с первыми входами второго и третьего блоков элементов И, выходы которого соединены со входами преобразователя кода числа в дополнительный код по модулю, выход которого соединен с первым входом блока элементов ИЛИ, второй вход которого соединен с выходом второго блока элементов И, входы задания вычитания и сложения устройства соединены со вторыми входами соответственно второго и третьего блоков элементов И, выход блока элементов ИЛИ соединен с преобразователем кода числа X в код Xmodk и преобразователем кода числа X в код [X/k), выходы которых соединены с установочными входами соответственно первого и второго счетчиков, выходы разрядов последнего из которых соединены с соответствующими входами второго элемента ИЛИ-НЕ, выход которого соединен с управляющим входом второго элемента запрета, выход которого соединен с вычитающим входом второго счетчика и входом разрешения сдвига второго кольцевого регистра сдвига, выходы первого и второго элементов ИЛИ-НЕ соединены соответственно с первым и вторым входами шестого элемента И, выход которого соединен с первыми входами пятого и седьмого элементов И, второй вход которого соединен с выходом третьего элемента запрета и информационными входами первого и второго элементов запрета, а выход - с информационным входом четвертого элемента запрета, управляющий вход которого соединен с выходом нулевого разряда первого кольцевого регистра сдвига, со вторыми входами разрядов четвертого блока элементов И и управляющим входом третьего элемента запрета, информационный вход которого соединен с тактовым входом устройства, выход пятого элемента И соединен с входом первого элемента НЕ, p-ые
Figure 00000007
выходы первого кольцевого регистра сдвига соединены с соответствующими входами элемента ИЛИ, выход которого соединен со вторым входом пятого элемента И, первым входом четвертого элемента И и входом второго элемента НЕ, выход которого соединен с первым входом третьего элемента И, выход четвертого элемента запрета соединен с первым входом второго элемента И и вторыми входами третьего и четвертого элементов И, выходы которых соединены соответственно со входами сдвига вправо и влево содержимого третьего кольцевого регистра сдвига, входы разрешения записи разрядов которого и вторые входы разрядов шестого блока элементов И соединены с выходом дифференцирующей цепочки, вход которой соединен с выходом второго элемента ИЛИ-НЕ.The technical result is achieved by the fact that in a device for adding and subtracting numbers modulo containing a decoder, a first group of OR elements, from the first to third blocks of AND elements, the first counter, the first OR-NOT element, the first prohibition element, the first to fourth elements And, the first and second elements are NOT, the first ring shift register, the OR element, the encoder, the block of OR elements and three converters, the first information input of the device connected to the decoder input, the first outputs of which (1 = (t • k + d) <m;
Figure 00000004
m is the modulus of the operation; k is the internal module of the device) connected to the t-th inputs of the d-th elements OR of the first group, the outputs of which are connected to the first inputs of the corresponding elements AND of the first block, the second inputs of which are connected to the input of the initial installation of the device and to the write enable input of the first ring shift register the inputs of the d-th bits of which are connected to the corresponding outputs of the first block of elements AND, the first input of the second element AND is connected to the input of the first element NOT, the output of which is connected to the first input of the first element AND, second the first input of which is connected to the second input of the second AND element, with the output of the first inhibit element and with the subtracting input of the first counter, the outputs of the discharges of which are connected to the corresponding inputs of the first element OR NOT, the output of which is connected to the control input of the first inhibit element, the outputs of the second and first And elements are connected respectively to the inputs of the task of shifting to the right and shifting to the left of the contents of the first annular shift register, a second group of OR elements is introduced, from the fourth to sixth blocks of And elements, different uyuschaya chain, the fifth to seventh AND gates, the second and third ring shift registers, the second to fourth elements prohibition, one of the transducers is in the form of a code converter
Figure 00000005
to the code [X / k), the other is the code converter of the number X into the Xmodk code and the third is the code converter of the number into an additional modulo code, the second counter, the second element OR NOT, with the 1st outputs of the decoder connected to the d-inputs of the t-th elements OR of the second group, the outputs of which are connected to the first inputs of the corresponding elements AND of the fifth block, the second inputs of which are connected to the input of the initial installation of the device and to the write enable input of the second ring shift register, the inputs of the bits of which are connected to the outputs of the corresponding elements of the fifth block, and the outputs of the bits with the first inputs of the corresponding elements of the sixth block, the nth outputs of which
Figure 00000006
connected to the (k • n • mod m) -th bit inputs of the third annular shift register, the outputs of the bits of which are connected to the first inputs of the corresponding elements AND of the fourth block, the outputs of which are connected to the inputs of the encoder, the output of which is the output of the device, the second information input of the device is connected with the first inputs of the second and third blocks of AND elements, the outputs of which are connected to the inputs of the code converter of the number into an additional modulo code, the output of which is connected to the first input of the block of OR elements, the second input One of which is connected to the output of the second block of AND elements, the inputs of the task of subtraction and addition of the device are connected to the second inputs of the second and third blocks of AND elements, respectively, the output of the block of OR elements is connected to the code converter of the number X in the Xmodk code and the code for the number X in the code [X / k), the outputs of which are connected to the installation inputs of the first and second counters, respectively, the outputs of the bits of the last of which are connected to the corresponding inputs of the second OR-NOT element, the output of which is connected to the control input m of the second prohibition element, the output of which is connected to the subtracting input of the second counter and the shift enable input of the second annular shift register, the outputs of the first and second elements OR NOT connected respectively to the first and second inputs of the sixth AND element, the output of which is connected to the first inputs of the fifth and seventh AND elements, the second input of which is connected to the output of the third prohibition element and the information inputs of the first and second prohibition elements, and the output - to the information input of the fourth prohibition element, which control the first input of which is connected to the zero-bit output of the first annular shift register, with the second inputs of the bits of the fourth block of AND elements and the control input of the third inhibit element, the information input of which is connected to the clock input of the device, the output of the fifth element And is connected to the input of the first element NOT, p- s
Figure 00000007
the outputs of the first annular shift register are connected to the corresponding inputs of the OR element, the output of which is connected to the second input of the fifth element AND, the first input of the fourth element AND and the input of the second element NOT, the output of which is connected to the first input of the third element AND, the output of the fourth inhibit element is connected to the first the input of the second element And and the second inputs of the third and fourth elements And, the outputs of which are connected respectively to the inputs of the shift to the right and left of the contents of the third ring shift register, the inputs p which permits the recording of bits of which and the second inputs of the bits of the sixth block of elements AND are connected to the output of the differentiating chain, the input of which is connected to the output of the second element OR NOT.

Сущность изобретения состоит в уменьшении каждого операнда в k раз, и после нахождения результата производится его увеличение в k раз с последующей коррекцией в зависимости от соотношения Amodk и Bmodk (A, B - операнды), ввиду чего происходит уменьшение количества тактов, необходимых для реализации модульной операции. Обозначим A' = [A/k], B' = [B/k], ΔA = Amodk, ΔB = Bmodk. Тогда для любого внутреннего модуля k устройства можно записывать в общем виде
(A-B)modm = [k(A′-B′)+(ΔAB)]modm (1)
Операция модульного сложения реализуется при помощи следующего соотношения:
(A+B)modm=[A-(m-B)]modm.
The essence of the invention consists in reducing each operand by a factor of k, and after finding the result, it is increased by a factor of k, followed by correction depending on the ratio of Amodk and Bmodk (A, B are operands), which reduces the number of clock cycles required to implement modular operations. Let A '= [A / k], B' = [B / k], Δ A = Amodk, Δ B = Bmodk. Then, for any internal module k, the devices can be written in the general form
(AB) modm = [k (A′-B ′) + (Δ AB )] modm (1)
The operation of modular addition is implemented using the following ratio:
(A + B) modm = [A- (mB)] modm.

Для модуля m = 11 и внутреннего модуля k = 3 имеем следующие основные параметры устройства:
- первая 3 группа элементов ИЛИ состоит из трех элементов (нулевой объединяет 0, 3, 6 и 9 выходы дешифратора 2; первый - 1, 4, 7 и 10 выходы дешифратора 2; второй - 2, 5 и 8 выходы дешифратора 2);
- вторая 13 группа элементов ИЛИ состоит из четырех элементов (нулевой объединяет 0, 1 и 2 выходы дешифратора 2; первый - 3, 4 и 5 выходы дешифратора 2; второй - 6, 7 и 8 выходы дешифратора 2; третий - 9 и 10 выходы дешифратора 2);
первый 6 кольцевой регистр сдвига, в котором проводится операция (ΔAB)mod11, состоит из 5 разрядов с номерами соответственно 0, 1, 2, 9 и 10;
- второй 15 кольцевой регистр сдвига, в котором проводится операция (A' - B') mod 11, состоит из 7 разрядов с номерами соответственно 0, 1, 2, 3, 8, 9 и 10;
- третий 17 кольцевой регистр сдвига, в котором получается окончательный результат операции (A - B)mod 11 состоит из 11 разрядов, соединение которых с разрядами второго 15 кольцевого регистра сдвига показано условно

Figure 00000008

Эти связи реализуют операцию умножения на k величины (A' - B') из формулы (1), а k = 3;
- элемент ИЛИ 39 объединяет выходы разрядов 9 и 10 первого 6 кольцевого регистра сдвига.For the module m = 11 and the internal module k = 3, we have the following main parameters of the device:
- the first 3 group of OR elements consists of three elements (zero combines the outputs 0, 3, 6 and 9 of the decoder 2; the first - 1, 4, 7 and 10 outputs of the decoder 2; the second - 2, 5 and 8 outputs of the decoder 2);
- the second 13th group of OR elements consists of four elements (zero combines the outputs 0, 1 and 2 of the decoder 2; the first - 3, 4 and 5 outputs of the decoder 2; the second - 6, 7 and 8 outputs of the decoder 2; the third - 9 and 10 outputs decoder 2);
the first 6 ring shift register, in which the operation (Δ AB ) mod11 is performed, consists of 5 bits with the numbers 0, 1, 2, 9 and 10, respectively;
- the second 15 ring shift register, in which the operation (A '- B') mod 11 is performed, consists of 7 bits with the numbers 0, 1, 2, 3, 8, 9 and 10, respectively;
- the third 17 ring shift register, in which the final result of operation (A - B) mod 11 is obtained consists of 11 bits, the connection of which with the bits of the second 15 ring shift register is conditionally shown
Figure 00000008

These bonds realize the operation of multiplying by k the quantities (A '- B') from formula (1), and k = 3;
- the element OR 39 combines the outputs of bits 9 and 10 of the first 6 ring shift register.

Дифференцирующая 43 цепочка производит преобразование постоянного сигнала в одиночный импульс, на месте которой может быть использован ждущий мультивибратор. Преобразователи 28 и 29 выполнены на программируемых логических матрицах (ПЛМ), в которых используются не все логические элементы матрицы постоянных запоминающих устройств (ПЗУ), что при выполнении специализированных функций уменьшает потребляемую мощность и время распространения сигналов. Differentiating 43 chain converts a constant signal into a single pulse, in place of which a standby multivibrator can be used. The converters 28 and 29 are made on programmable logic arrays (PLM), which do not use all the logical elements of the matrix of read-only memory devices, which, when performing specialized functions, reduces power consumption and signal propagation time.

Выходы нулевого, первого и второго элементов первой 3 группы элементов ИЛИ соединены через первый 4 блок элементов И с выходами соответствующих разрядов первого 6 кольцевого регистра сдвига, а выходы нулевого, первого, второго и третьего элементов второй 13 группы элементов ИЛИ - через пятый 14 блок элементов И с выходами соответствующих разрядов второго 15 кольцевого регистра сдвига. The outputs of the zero, first and second elements of the first 3 group of OR elements are connected through the first 4 block of AND elements to the outputs of the corresponding bits of the first 6 ring shift register, and the outputs of the zero, first, second and third elements of the second 13 group of OR elements are connected through the fifth 14 block of elements And with the outputs of the corresponding bits of the second 15 ring shift register.

Определим оптимальную по быстродействию величину внутреннего модуля устройства (К). Нижнюю границу быстродействия устройства выразим через количество тактов N, необходимых для проведения одной модульной операции:

Figure 00000009

Figure 00000010

при этом
Figure 00000011

следовательно, при выборе внутреннего модуля устройства k равным
Figure 00000012
быстродействие заявляемого устройства существенно выше, чем у прототипа, у которого количество тактов, необходимых для проведения модульной операции, растет пропорционально модулю устройства. Изменяя величину k, возможно управлять соотношением между быстродействием и количеством оборудования предлагаемого устройства.Determine the optimal speed for the value of the internal module of the device (K). The lower bound on the speed of the device is expressed in terms of the number of clock cycles N required for one modular operation:
Figure 00000009

Figure 00000010

wherein
Figure 00000011

therefore, when choosing the internal module of the device k equal
Figure 00000012
the speed of the claimed device is significantly higher than that of the prototype, in which the number of clock cycles required for the modular operation grows in proportion to the device module. By changing the value of k, it is possible to control the relationship between speed and the amount of equipment of the proposed device.

На чертеже представлена структурная схема устройства, где 1 - первый информационный вход устройства, 2 - дешифратор, 3 - первая группа элементов ИЛИ, 4 - первый блок элементов И, 5 - вход начальной установки устройства, 6 - первый кольцевой регистр сдвига, 7 - второй элемент И, 8 - первый элемент НЕ, 9 - первый элемент И, 10 - первый элемент запрета, 11 - первый счетчик, 12 - первый элемент ИЛИ-НЕ, 13 - вторая группа элементов ИЛИ, 14 - пятый блок элементов И, 15 - второй кольцевой регистр сдвига, 16 - шестой блок элементов И, 17 - третий кольцевой регистр сдвига, 18 - четвертый блок элементов И, 19 - шифратор, 20 - выход устройства, 21 - второй информационный вход устройства, 22 - второй блок элементов И, 23 - третий блок элементов И, 24 - преобразователь кода числа в дополнительный код по модулю, 25 - блок элементов ИЛИ, 26 - вход задания вычитания устройства, 27 - вход задания сложения устройства, 28 - преобразователь кода числа X в код Xmodk, 29 - преобразователь кода числа X в код [X/k], 30 - второй счетчик, 31 - второй элемент ИЛИ-НЕ, 32 - второй элемент запрета, 33 - шестой элемент И, 34 - пятый элемент И, 35 - седьмой элемент И, 36 - третий элемент запрета, 37 - четвертый элемент запрета, 38 - тактовый вход устройства, 39 - элемент ИЛИ, 40 - четвертый элемент И, 41 - второй элемент НЕ, 42 - третий элемент И, 43 - дифференцирующая цепочка. Первый 1 информационный вход устройства соединен со входом дешифратора 2, 1-ые выходы которого (1 = (t-k + d) < m;

Figure 00000013
m - модуль операции; k - внутренний модуль устройства) соединены с t-ми входами d-ых элементов ИЛИ первой 3 группы, выходы которых соединены с первыми входами соответствующих элементов первого 4 блока элементов И, вторые входы элементов которого соединены с входом 5 начальной установки устройства и с входом разрешения записи первого 6 кольцевого регистра сдвига, входы d-ых разрядов которого соединены с выходами соответствующих элементов первого 4 блока элементов И, первый вход второго 7 элемента И соединен со входом первого 8 элемента НЕ, выход которого соединен с первым входом первого 9 элемента И, второй вход которого соединен со вторым входом второго 7 элемента И, с выходом первого 10 элемента запрета и с вычитающим входом первого 11 счетчика, выходы разрядов которого соединены с соответствующими входами первого 12 элемента ИЛИ-НЕ, выход которого соединен с управляющим входом первого 10 элемента запрета, выходы второго 7 и первого 9 элементов И соединены соответственно с входами задания сдвига вправо и сдвига влево содержимого первого 6 кольцевого регистра сдвига, причем 1-е выходы дешифратора 2 соединены с d-ми входами t-ых элементов ИЛИ второй 13 группы, выходы которых соединены с первыми входами соответствующих элементов пятого 14 блока элементов И, вторые входы разрядов которого соединены с входом 5 начальной установки устройства и с входом разрешения записи второго 15 кольцевого регистра сдвига, входы разрядов которого соединены с выходами соответствующих элементов пятого 14 блока элементов И, а выходы разрядов - с первыми входами соответствующих элементов шестого 16 блока элементов И, n-ые выходы разрядов
Figure 00000014
соединены с (knmodm)-ми входами разрядов третьего 17 кольцевого регистра сдвига, выходы разрядов которого соединены с первыми входами соответствующих элементов четвертого 18 блока элементов И, выход которого соединен со входом шифратора 19, выход которого является выходом 20 устройства, второй 21 информационный вход устройства соединен с первыми входами второго 22 и третьего 23 блоков элементов И, выход которого соединен со входом преобразователя кода 24 числа в дополнительный код по модулю, выход которого соединен с первым входом блока 25 элементов ИЛИ, второй вход которого соединен с выходом второго 22 блока элементов И, входы задания вычитания 26 и сложения 27 устройства соединены с вторыми входами соответственно второго 22 и третьего 23 блоков элементов И, выход блока 25 элементов ИЛИ соединен с преобразователем кода 28 числа X в код Xmodk и преобразователем кода числа в код [X/k}, выходы которых соединены с установочными входами соответственно первого 11 и второго 30 счетчиков, выходы разрядов которого соединены с соответствующими входами второго 31 элемента ИЛИ-НЕ, выход которого соединен с управляющим входом второго 32 элемента запрета, выход которого соединен с вычитающим входом второго 30 счетчика и входом разрешения сдвига второго 15 кольцевого регистра сдвига, вход разрешения записи которого соединен со входом начальной установки устройства, выходы первого 12 и второго 31 элементов ИЛИ-НЕ соединены соответственно с первым и вторым входами шестого 33 элемента И, выход которого соединен с первыми входами пятого 34 и седьмого 35 элементов И, второй вход которого соединен с выходом третьего 36 элемента запрета и информационными входами первого 10 и второго 32 элементов запрета, а выход - с информационным входом четвертого 37 элемента запрета, управляющий вход которого соединен с выходом нулевого разряда первого 6 кольцевого регистра сдвига, со вторыми входами элементов четвертого 18 блока элементов И и управляющим входом третьего 36 элемента запрета, информационный вход которого соединен с тактовым входом 38 устройства, выход пятого 34 элемента И соединен со вторым входом второго 7 элемента И и входом первого 8 элемента НЕ, p-ые
Figure 00000015
выходы первого 6 кольцевого регистра сдвига соединены с соответствующими входами элемента ИЛИ 39, выход которого соединен со вторым входом пятого 34 элемента И, первым входом четвертого 40 элемента И и входом второго 41 элемента НЕ, выход которого соединен с первым входом третьего 42 элемента И, выход четвертого 37 элемента запрета соединен с первым входом второго 7 элемента И и вторыми входами третьего 42 и четвертого 40 элементов И, выходы которых соединены соответственно со входами сдвига вправо и влево содержимого третьего 17 кольцевого регистра сдвига, входы разрешения записи разрядов которого и вторые входы элементов шестого 16 блока элементов И соединены с выходом дифференцирующей 43 цепочки, вход которой соединен с выходом второго 31 элемента ИЛИ-НЕ.The drawing shows a structural diagram of the device, where 1 is the first information input of the device, 2 is the decoder, 3 is the first group of OR elements, 4 is the first block of AND elements, 5 is the input of the initial installation of the device, 6 is the first ring shift register, 7 is the second AND element, 8 - the first element of NOT, 9 - the first element of AND, 10 - the first element of the ban, 11 - the first counter, 12 - the first element of OR-NOT, 13 - the second group of OR elements, 14 - the fifth block of AND elements, 15 - the second circular shift register, 16 - the sixth block of And elements, 17 - the third circular shift register, 18 - the four th block of AND elements, 19 - encoder, 20 - device output, 21 - second information input of the device, 22 - second block of AND elements, 23 - third block of AND elements, 24 - module of the code of the number into an additional code modulo, 25 - block of elements OR, 26 - input of the task of subtracting the device, 27 - input of the job of adding the device, 28 - converter of the code of the number X into the code Xmodk, 29 - converter of the code of the number X into the code [X / k], 30 - the second counter, 31 - the second element OR -NE 32 - the second element of the ban, 33 - the sixth element of And, 34 - the fifth element of And, 35 - the seventh element of And, 36 - the third element of ETA, 37 - the fourth element of the ban, 38 - clock input device 39 - an OR gate, 40 - the fourth AND gate 41 - a second NOT member, 42 - a third AND gate, 43 - differentiating chain. The first 1 information input of the device is connected to the input of the decoder 2, the first outputs of which (1 = (tk + d) <m;
Figure 00000013
m is the modulus of the operation; k - the internal module of the device) are connected to the t-th inputs of the d-th elements OR of the first 3 groups, the outputs of which are connected to the first inputs of the corresponding elements of the first 4 block of AND elements, the second inputs of the elements of which are connected to the input 5 of the initial installation of the device and to the permission input records of the first 6 ring shift register, the inputs of the d-th bits of which are connected to the outputs of the corresponding elements of the first 4 block of elements AND, the first input of the second 7 element AND is connected to the input of the first 8 element NOT, the output of which is connected to the first input of the first 9 AND element, the second input of which is connected to the second input of the second 7 AND element, with the output of the first 10 inhibit element and with the subtracting input of the first 11 counter, the discharge outputs of which are connected to the corresponding inputs of the first 12 OR-NOT element, the output of which is connected with the control input of the first 10 inhibit elements, the outputs of the second 7 and the first 9 And elements are connected respectively to the inputs of the task of shifting to the right and shifting to the left of the contents of the first 6 ring shift register, and the 1st outputs of the decoder 2 are connected are connected with the d-inputs of the t-th elements OR of the second 13 group, the outputs of which are connected to the first inputs of the corresponding elements of the fifth 14 block of AND elements, the second inputs of the bits of which are connected to the input 5 of the initial installation of the device and to the recording permission input of the second 15 ring shift register , the inputs of the discharges of which are connected to the outputs of the corresponding elements of the fifth 14 block of elements And, and the outputs of the discharges with the first inputs of the corresponding elements of the sixth 16 block of elements And, n-th outputs of the discharges
Figure 00000014
connected to the (knmodm) th bit inputs of the third 17 ring shift register, the bit outputs of which are connected to the first inputs of the corresponding elements of the fourth 18 block of AND elements, the output of which is connected to the input of the encoder 19, the output of which is the output 20 of the device, the second 21 information input of the device connected to the first inputs of the second 22 and third 23 blocks of elements And, the output of which is connected to the input of the code converter 24 numbers into an additional code modulo, the output of which is connected to the first input of the block 25 elements OR, the second input of which is connected to the output of the second 22 block of AND elements, the inputs of the subtraction job 26 and addition 27 of the device are connected to the second inputs of the second 22 and third 23 blocks of AND elements, respectively, the output of the block of 25 OR elements is connected to the code converter 28 of the number X into code Xmodk and code to number converter [X / k}, the outputs of which are connected to the installation inputs of the first 11 and second 30 counters, respectively, the outputs of the digits of which are connected to the corresponding inputs of the second 31 elements OR NOT, the output of which is connected to the branching input of the second 32 inhibit element, the output of which is connected to the subtracting input of the second 30 counter and the shift enable input of the second 15 ring shift register, the write enable input of which is connected to the initial setup input of the device, the outputs of the first 12 and second 31 elements are NOT connected respectively the first and second inputs of the sixth 33 AND element, the output of which is connected to the first inputs of the fifth 34 and the seventh 35 AND elements, the second input of which is connected to the output of the third 36 ban element and information inputs the first 10 and second 32 prohibition elements, and the output is with the information input of the fourth 37 prohibition element, the control input of which is connected to the zero-bit output of the first 6 ring shift register, with the second inputs of the fourth element 18 of the AND block and the control input of the third 36 prohibition element the information input of which is connected to the clock input 38 of the device, the output of the fifth 34th element AND is connected to the second input of the second 7th element AND and the input of the first 8th element is NOT, pth
Figure 00000015
the outputs of the first 6 circular shift register are connected to the corresponding inputs of the OR element 39, the output of which is connected to the second input of the fifth 34 AND element, the first input of the fourth 40 AND element and the input of the second 41 HE element, the output of which is connected to the first input of the third 42 AND element, output the fourth 37 prohibition element is connected to the first input of the second 7 And element and the second inputs of the third 42 and the fourth 40 And elements, the outputs of which are connected respectively to the inputs of the shift to the right and left of the contents of the third 17 ring register and shear inputs write enable bits and whose second inputs of the sixth element 16 of the AND block connected to the output of the differentiating chain 43 having its input connected to the output 31 of the second OR-NO element.

Работу устройства удобно рассматривать в двух режимах. The operation of the device is conveniently considered in two modes.

1. Режим определения результата операции модульного вычитания. 2. Режим определения результата операции модульного сложения. В первом режиме операнд A со входа 1 поступает на вход дешифратора 2, а с A-го выхода которого -на [A/k] -ый вход (A-[A/k)K)-го элемента ИЛИ первой 3 группы. С его выхода сигнал поступает на первый вход (Amodk)-го элемента первого 4 блока элементов И. С A-го выхода дешифратора 2 сигнал также поступает на (A-[A/k]K)-ый вход [A/k] -го элемента ИЛИ второй 13 группы, с выхода которого сигнал поступает на первый вход [A/k]-го элемента пятого 14 блока элементов И. По одиночному импульсу, поступающему со входа 5 начальной установки устройства в [A/'k]-ый разряд второго 15 кольцевого регистра сдвига и в (Amodk)-ый разряд первого 6 кольцевого регистра сдвига, производится запись единицы. Операнд B в двоичном коде через открытый второй 22 блок элементов И (сигнал на входе 26 задания вычитания присутствует) поступает на второй вход блока 25 элементов ИЛИ, с выхода которого B поступает на входы преобразователя 28 кода числа X в код Xmodk и преобразователя 29 кода числа X в код [X/k]. Величины Вmodk и [B/k] в двоичном коде поступают на установочные входы соответственно первого 11 и второго 30 счетчиков. Импульсы с тактового входа 38 устройства через третий 36 элемент запрета поступают на вычитающие входы второго 30 и первого 11 счетчиков через соответствующие второй 32 и первый 10 элементы запрета, с выходов которых они поступают также соответственно на вход разрешения сдвига второго 15 кольцевого регистра сдвига и второй вход первого 9 элемента И, с выхода которого импульсы поступают на вход задания сдвига влево первого 6 кольцевого регистра сдвига. Когда содержимое второго 30 счетчика станет равным нулю, то на выходе второго 31 элемента ИЛИ-НЕ будет сигнал, который поступит на управляющий вход второго 32 элемента запрета, прекращая поступление тактовых импульсов как на вычитающий вход второго 30 счетчика, так и на вход разрешения сдвига второго 15 кольцевого регистра сдвига. Одновременно этот сигнал поступит на вход дифференцирующей 43 цепочки, с выхода которой одиночный импульс, поступивший на вторые входы элементов шестого 16 блока элементов И и входы разрешения записи третьего 17 кольцевого регистра сдвига, произведет запись полученного результата (A' - B')modm (см. ф-лу (1)) из второго 15 кольцевого регистра сдвига в виде k: (A' - B')modm (см. ф-лу (1)) в третий 17 кольцевой регистр сдвига. Когда содержимое первого 11 счетчика станет равным нулю, то с выхода первого 12 элемента ИЛИ-НЕ сигнал поступит на управляющий вход первого 10 элемента запрета, прекращая поступление тактовых импульсов на вычитающий вход первого 11 счетчика и вход задания сдвига влево первого 6 кольцевого регистра сдвига. При этом образуется другая цепочка прохождения тактовых импульсов на входы задания сдвига первого 6 и третьего 17 кольцевых регистров сдвига. Тактовые импульсы с выхода третьего 36 элемента запрета поступают через второй вход седьмого 35 элемента И (сигнал на первом входе которого присутствует) и далее через четвертый 37 элемент запрета. При этом, если результат операции (ΔAB)modm, см. ф-лу(1)), реализуемый первым 6 кольцевым регистром сдвига, оказывается в p-ых разрядах его, то для повышения быстродействия устройства и уменьшения количества разрядов первого 6 кольцевого регистра сдвига при проведении коррекции (см. ф-лу (1)) производится изменение направления сдвига в первом 6 и третьем 17 кольцевых регистрах сдвига. При этом сигнал с выхода элемента ИЛИ 39 поступает на второй вход второго 7 элемента И и первый вход четвертого 40 элемента И, обеспечивая сдвиг вправо содержимого первого 6 кольцевого регистра сдвига и сдвиг влево содержимого третьего 17 кольцевого регистра сдвига. При отсутствии сигнала с выхода элемента ИЛИ 39 сдвиг содержимого кольцевых регистров 6 и 17 происходит в противоположных направлениях. Когда единица оказывается в нулевом разряде первого 6 кольцевого регистра сдвига, то соответствующий сигнал с его выхода поступает на управляющий вход четвертого 37 элемента запрета, прекращая поступление тактовых импульсов, и одновременно поступает на вторые входы элементов четвертого 18 блока элементов И.1. The mode of determining the result of the operation of modular subtraction. 2. The mode of determining the result of the operation of modular addition. In the first mode, operand A from input 1 goes to the input of decoder 2, and from the A-th output of which is the [A / k] -th input of the (A- [A / k) K) -th OR element of the first 3 groups. From its output, the signal goes to the first input of the (Amodk) -th element of the first 4 block of elements I. From the A-th output of the decoder 2, the signal also goes to the (A- [A / k] K) -th input [A / k] - of the first element OR of the second 13th group, from the output of which the signal goes to the first input of the [A / k] -th element of the fifth 14th block of elements I. By a single pulse coming from input 5 of the initial installation of the device in the [A / 'k] -th discharge second 15 ring shift register and in (Amodk) -th discharge of the first 6 ring shift register, a unit is recorded. The operand B in binary code through the open second 22 block of AND elements (a signal at the input 26 of the subtraction job is present) is fed to the second input of the block of 25 OR elements, the output of which B goes to the inputs of the converter 28 of the code of the number X in the code Xmodk and the converter 29 of the code of the number X to the code [X / k]. The values of Bmodk and [B / k] in binary code go to the installation inputs of the first 11 and second 30 counters, respectively. The pulses from the clock input 38 of the device through the third 36 ban element are fed to the subtractive inputs of the second 30 and first 11 counters through the corresponding second 32 and first 10 ban elements, from the outputs of which they also go respectively to the shift enable input of the second 15 ring shift register and the second input the first 9 element And, the output of which the pulses are fed to the input of the left shift of the first 6 ring shift register. When the content of the second 30 counter becomes zero, then the output of the second 31 element OR-NOT will be a signal that goes to the control input of the second 32 inhibit elements, stopping the receipt of clock pulses both to the subtracting input of the second 30 counter and to the input of the resolution of the shift of the second 15 ring shift register. At the same time, this signal will go to the input of the differentiating circuit 43, from the output of which a single pulse received at the second inputs of the elements of the sixth 16 block of elements And and the recording permission inputs of the third 17 ring shift register will record the result (A '- B') modm (see f-lu (1)) from the second 15 ring shift register in the form k: (A '- B') modm (see f-lu (1)) into the third 17 ring shift register. When the contents of the first 11 counters become equal to zero, then from the output of the first 12 OR-NOT elements, the signal will go to the control input of the first 10 inhibit elements, stopping the arrival of clock pulses to the subtracting input of the first 11 counters and the left shift input of the first 6 ring shift register. In this case, another chain of passage of clock pulses to the inputs of the shift job of the first 6 and third 17 ring shift registers is formed. Clock pulses from the output of the third 36 ban element are supplied through the second input of the seventh 35 And element (the signal at the first input of which is present) and then through the fourth 37 ban element. Moreover, if the result of the operation (Δ AB ) modm, see file (1)), implemented by the first 6 ring shift register, is in the pth bits of it, then to increase the speed of the device and reduce the number of bits of the first 6 of the circular shift register during correction (see file (1)), the shift direction is changed in the first 6 and third 17 circular shift registers. In this case, the signal from the output of the OR element 39 is supplied to the second input of the second 7 element And and the first input of the fourth 40 element And, providing a right shift of the contents of the first 6 ring shift register and a left shift of the contents of the third 17 ring shift register. In the absence of a signal from the output of the OR element 39, the shift of the contents of the ring registers 6 and 17 occurs in opposite directions. When the unit is in the zero bit of the first 6 ring shift register, the corresponding signal from its output goes to the control input of the fourth 37 inhibit elements, stopping the arrival of clock pulses, and simultaneously enters the second inputs of the elements of the fourth 18 block of elements I.

Результат операции модульного вычитания с выходов разрядов третьего 17 кольцевого регистра сдвига поступает в унитарном коде на вход шифратора 19, с выхода которого в двоичном коде поступает на выход 20 устройства. The result of the operation of modular subtraction from the outputs of the bits of the third 17 ring shift register is received in a unitary code at the input of the encoder 19, from the output of which in binary code is sent to the output 20 of the device.

В режиме определения результата операции модульного сложения (сигнал на шине 27 присутствует) на выход блока 25 элементов ИЛИ поступает не операнд B, а число (m-B) в двоичном коде, т.е. все происходит аналогично первому режиму, но с операндами A и (m-B) (см. ф-лу (2)). In the mode of determining the result of the operation of modular addition (a signal on the bus 27 is present), the output of the block of 25 elements OR does not receive the operand B, but the number (m-B) in the binary code, i.e. everything happens similarly to the first mode, but with operands A and (m-B) (see f-lu (2)).

Рассмотрим примеры конкретного выполнения модульных операций при m = 11, K = 3. Consider examples of the specific implementation of modular operations with m = 11, K = 3.

Пример 1. Пусть необходимо определить результат модульного вычитания для A = 7, B = 4 (A и B - операнды). Example 1. Let it be necessary to determine the result of modular subtraction for A = 7, B = 4 (A and B are operands).

Операнд A = 01112 поступает на вход дешифратора 2 и с седьмого выхода его на второй вход первого элемента ИЛИ первый 3 группы. С его выхода сигнал поступает на первый вход первого элемента первого 4 блока элементов И. С седьмого выхода дешифратора 2 сигнал также поступает на первый вход второго элемента ИЛИ второй 13 группы, с выхода которого сигнал поступает на первый вход второго элемента пятого 14 блока элементов И. По одиночному импульсу, поступающему со входа 5 начальной установки во второй разряд второго 15 кольцевого регистра сдвига и в первый разряд первого 6 кольцевого регистра сдвига производится запись единицы. Операнд B = 01002 через открытый второй 22 блок элементов И поступает на входы преобразователя 28 кода числа X в код Xmod3 и преобразователя 29 кода числа X в код [X/3]. Величины Bmod3=0012 и [B/3] = 0012 поступают на установочные входы соответственно первого 11 и второго 30 счетчиков. Исходное состояние первого 6 и второго 15 кольцевых регистров сдвига (КРС1, КРС2) следующее:

Figure 00000016

С тактового входа 38 устройства поступает импульс через третий 36 элемент запрета на вычитающие входы второго 30 и первого 11 счетчиков через соответствующие второй 32 и первый 10 элементы запрета, с выходов которых он поступает также соответственно на вход разрешения сдвига второго 15 кольцевого регистра сдвига и второй вход первого 9 элемента И, с выхода которого импульс поступает на вход задания сдвига влево первого 6 кольцевого регистра сдвига. Состояние первого 6 и второго 15 кольцевых регистров сдвига следующее:
Figure 00000017

Содержимое первого 11 и второго 30 счетчиков равно нулю. На выходе второго 31 элемента ИЛИ-НЕ будет сигнал, который поступит на управляющий вход второго 32 элемента запрета, прекращая поступление следующих импульсов как на вычитающий вход второго 30 счетчика, так как и на вход разрешения сдвига второго 15 кольцевого регистра сдвига. Этот сигнал поступит также на вход дифференцирующей 43 цепочки, с выхода которой одиночный импульс, поступивший на вторые входы элементов шестого 16 блока элементов И и входы разрешения записи третьего 17 кольцевого регистра сдвига, производит запись (2 - l)mod11 из второго 15 кольцевого регистра сдвига в виде (3•1)mod11 в третий 17 кольцевого регистра сдвига. Ввиду того, что содержимое первого 11 счетчика равно нулю и единица находится в нулевом разряде первого 6 кольцевого регистра сдвига, сигнал с его выхода поступает на управляющий вход четвертого 37 элемента запрета, запрещая поступление тактовых импульсов на входы сдвига вправо и влево содержимого третьего 17 кольцевого регистра сдвига. Одновременно этот сигнал поступает на вторые входы элементов четвертого 18 блока элементов И. Результат операции модульного вычитания с выходов разрядов третьего 17 кольцевого регистра сдвига поступает в унитарном коде на вход шифратора 19, с выхода которого результат операции (7 - 4)mod11 =00112 поступает на выход 20 устройства.The operand A = 0111 2 goes to the input of the decoder 2 and from the seventh output to the second input of the first element OR the first 3 groups. From its output, the signal goes to the first input of the first element of the first 4 block of elements I. From the seventh output of the decoder 2, the signal also goes to the first input of the second element OR of the second 13 group, from the output of which the signal goes to the first input of the second element of the fifth 14 block of elements I. On a single pulse coming from the input 5 of the initial installation in the second bit of the second 15 ring shift register and in the first bit of the first 6 ring shift register is recorded. The operand B = 0100 2 through the open second 22 block of elements And enters the inputs of the converter 28 of the code of the number X into the code Xmod3 and the converter 29 of the code of the number X into the code [X / 3]. The values Bmod3 = 001 2 and [B / 3] = 001 2 are supplied to the installation inputs of the first 11 and second 30 counters, respectively. The initial state of the first 6 and second 15 ring shift registers (KRS1, KRS2) is as follows:
Figure 00000016

The pulse input 38 of the device receives a pulse through the third 36 ban element for subtracting inputs of the second 30 and first 11 counters through the corresponding second 32 and first 10 ban elements, from the outputs of which it also goes to the shift enable input of the second 15 ring shift register and the second input, respectively the first 9 element And, the output of which the pulse is fed to the input of the left shift of the first 6 ring shift register. The state of the first 6 and second 15 ring shift registers is as follows:
Figure 00000017

The contents of the first 11 and second 30 counters are zero. At the output of the second 31 element, there will be a signal that will go to the control input of the second 32 inhibit elements, stopping the receipt of the next pulses as the subtracting input of the second 30 counters, as well as the shift resolution input of the second 15 ring shift register. This signal will also go to the input of the differentiating circuit 43, from the output of which a single pulse arriving at the second inputs of the elements of the sixth 16 block of elements And and the recording permission inputs of the third 17 ring shift register, writes (2 - l) mod11 from the second 15 ring shift register in the form of (3 • 1) mod11 in the third 17 ring shift register. Due to the fact that the content of the first 11 counters is zero and the unit is in the zero bit of the first 6 ring shift register, the signal from its output goes to the control input of the fourth 37 inhibit element, prohibiting the arrival of clock pulses to the left and left shift inputs of the contents of the third 17 ring register shear. At the same time, this signal is supplied to the second inputs of the elements of the fourth 18 block of elements I. The result of the operation of modular subtraction from the outputs of the bits of the third 17 ring shift register is received in unitary code at the input of the encoder 19, from the output of which the result of operation (7 - 4) mod11 = 0011 2 arrives output 20 of the device.

Пример 2. Пусть необходимо определить результат модульного сложения для A = 7, B =3 (A и B - операнды). Example 2. Let it be necessary to determine the result of modular addition for A = 7, B = 3 (A and B are operands).

В этом случае прохождение операнда A = 01112 и запись A' и ΔA в кольцевые регистры сдвига соответственно второй 15 и первый 6 в унитарном коде аналогично первому примеру. Следовательно, исходное состояние первого 6 и второго кольцевых регистров сдвига (КРС1, КРС2) следующее:

Figure 00000018

Операнд В = 00112 через открытый третий 27 блок элементов И поступает на вход преобразователя 24 кода числа в дополнительный код по модулю, с выхода которого число 10002 через блок 25 элементов ИЛИ поступает на входы преобразователя 28 кода числа X в код Xmod3 = 0102 и преобразователя 29 кода числа X в код [X/3] = 0102. Эти величины поступают на установочные входы соответственно первого 11 и второго 30 счетчиков. С тактового входа 38 устройства поступает импульс через третий 36 элемент запрета на вычитающие входы второго 30 и первого 11 счетчиков через соответствующие второй 32 и первый 10 элементы запрета, с выходов которых он поступает также соответственно на вход разрешения сдвига второго 15 кольцевого регистра сдвига и второй вход первого 9 элемента И, с выхода которого импульс поступает на вход задания сдвига влево первого 6 кольцевого регистра сдвига. Состояние первого 6 и второго 15 кольцевого регистра сдвига следующие:
Figure 00000019

После прохождения второго импульса состояние кольцевых регистров сдвига 6 и 15 будет следующее:
Figure 00000020

На выходе второго 31 элемента ИЛИ-НЕ будет сигнал, который поступит на управляющий вход второго 32 элемента запрета, прекращая поступление тактовых импульсов на вычитающий вход второго 30 счетчика, так и на вход разрешения сдвига второго 15 кольцевого регистра сдвига. Одновременно этот сигнал поступит на вход дифференцирующей 43 цепочки, с выхода которой одиночный импульс, поступивший на вторые входы элементов шестого 16 блока элементов И и входы разрешения записи третьего 17 кольцевого регистра сдвига, произведет запись полученного результата (2-2)mod11= 0mod11 из второго 15 кольцевого регистра сдвига в виде 3•0mod11=0mod11 в третий 17 кольцевой регистр сдвига. Так как на управляющем входе первого 10 элемента запрета есть сигнал, то тактовые импульсы с выхода третьего 36 элемента запрета поступают на второй вход седьмого 35 элемента И (сигнал на первом входе которого присутствует) и далее на информационный вход четвертого 37 элемента запрета. При этом с выхода элемента ИЛИ 39 поступает сигнал на второй вход второго 7 элемента И и первый вход четвертого 40 элемента И, обеспечивая сдвиг вправо содержимого первого 6 кольцевого регистра сдвига и сдвиг влево содержимого третьего 17 кольцевого регистра сдвига. После прохождения одного тактового импульса состояние первого 6 и третьего 17 кольцевых регистров сдвига будет следующее:
Figure 00000021

На управляющем входе четвертого 37 элемента запрета будет сигнал, который прекращает прохождение тактовых импульсов и открывает четвертый 18 блок элементов И. Результат операции модульного сложения (7+3)mod11=10102 с выхода шифратора 19 поступает на вход 20 устройства.In this case, passing the operand A = 0111 2 and writing A 'and Δ A in the ring shift registers, respectively, the second 15 and the first 6 in the unitary code is similar to the first example. Therefore, the initial state of the first 6 and second ring shift registers (KRS1, KRS2) is as follows:
Figure 00000018

The operand B = 0011 2 through the open third 27 block of elements AND is fed to the input of the converter 24 of the number code in an additional module code, the output of which the number 1000 2 through the block of 25 elements OR is fed to the inputs of the converter 28 of the code of the number X in the code Xmod3 = 010 2 and converter 29 of the code of the number X into the code [X / 3] = 010 2 . These values are supplied to the installation inputs of the first 11 and second 30 counters, respectively. The pulse input 38 of the device receives a pulse through the third 36 ban element for subtracting inputs of the second 30 and first 11 counters through the corresponding second 32 and first 10 ban elements, from the outputs of which it also goes to the shift enable input of the second 15 ring shift register and the second input, respectively the first 9 element And, the output of which the pulse is fed to the input of the left shift of the first 6 ring shift register. The state of the first 6 and second 15 ring shift register is as follows:
Figure 00000019

After the passage of the second pulse, the state of the circular shift registers 6 and 15 will be as follows:
Figure 00000020

At the output of the second 31 element, there will NOT be a signal that will go to the control input of the second 32 inhibit elements, stopping the arrival of clock pulses to the subtracting input of the second 30 counter, and to the shift enable input of the second 15 ring shift register. At the same time, this signal will go to the input of the differentiating circuit 43, from the output of which a single pulse arriving at the second inputs of the elements of the sixth 16 block of elements And and the recording permission inputs of the third 17 ring shift register will record the result (2-2) mod11 = 0mod11 from the second 15 ring shift register in the form 3 • 0mod11 = 0mod11 in the third 17 ring shift register. Since there is a signal at the control input of the first 10 inhibit element, clock pulses from the output of the third 36 inhibit element are fed to the second input of the seventh 35 And element (the signal at the first input of which is present) and then to the information input of the fourth 37 inhibit element. In this case, the output of the OR element 39 receives a signal at the second input of the second 7 And element and the first input of the fourth 40 And element, providing a right shift of the contents of the first 6 ring shift register and a left shift of the contents of the third 17 ring shift register. After passing through one clock pulse, the state of the first 6 and third 17 ring shift registers will be as follows:
Figure 00000021

At the control input of the fourth 37 ban element there will be a signal that stops the passage of clock pulses and opens the fourth 18 block of elements I. The result of the operation of modular addition (7 + 3) mod11 = 1010 2 from the output of the encoder 19 is fed to the input 20 of the device.

Claims (1)

Устройство для сложения и вычитания чисел по модулю, содержащее дешифратор, первую группу элементов ИЛИ, с первого по третий блоки элементов И, первый счетчик, первый элемент ИЛИ-НЕ, первый элемент запрета, с первого по четвертый элементы И, первый и второй элементы НЕ, первый кольцевой регистр сдвига, элемент ИЛИ, шифратор, блок элементов ИЛИ и три преобразователя, причем, первый информационный вход устройства соединен со входом дешифратора, 1-е выходы которого (1=(t•k+d) < m;
Figure 00000022
m - модуль операции; k - внутренний модуль устройства) соединены с t-ми входами d-х элементов ИЛИ первой группы, выходы которых соединены с первыми входами соответствующих элементов И первого блока, вторые входы которых соединены с входом начальной установки устройства и с входом разрешения записи первого кольцевого регистра сдвига, входы d-х разрядов которого соединены с соответствующими выходами первого блока элементов И, первый вход второго элемента И соединен со входом первого элемента НЕ, выход которого соединен с первым входом первого элемента И, второй вход которого соединен с вторым входом второго элемента И, с выходом первого элемента запрета и с вычитающим входом первого счетчика, выходы разрядов которого соединены с соответствующими входами первого элемента ИЛИ-НЕ, выход которого соединен с управляющим входом первого элемента запрета, выходы второго и первого элементов И соединены соответственно с входами задания сдвига вправо и сдвига влево содержимого первого кольцевого регистра сдвига, отличающийся тем, что в него введены вторая группа элементов ИЛИ, с четвертого по шестой блоки элементов И, дифференцирующая цепочка, с пятого по седьмой элементы И, второй и третий кольцевой регистры сдвига, со второго по четвертый элементы запрета, один из преобразователей выполнен в виде преобразователя кода числа
Figure 00000023
в код [X/k] , другой - является преобразователем кода числа X в код Xmodk и третий - преобразователем кода числа в дополнительный код по модулю, второй счетчик, второй элемент ИЛИ-НЕ, причем 1-е выходы дешифратора соединены с d-ми входами t-х элементов ИЛИ второй группы, выходы которых соединены с первыми входами соответствующих элементов И пятого блока, вторые входы которых соединены с входом начальной установки устройства и с входом разрешения записи второго кольцевого регистра сдвига, входы разрядов которого соединены с выходами соответствующих элементов И пятого блока, а выходы разрядов - с первыми входами соответствующих элементов И шестого блока, n-е выходы которого
Figure 00000024
соединены с (k • n • mod m)-ми входами разрядов третьего кольцевого регистра сдвига, выходы разрядов которого соединены с первыми входами соответствующих элементов И четвертого блока, выходы которого соединены со входами шифратора, выход которого является выходом устройства, второй информационный вход устройства соединен с первыми входами второго и третьего блоков элементов И, выходы которого соединены со входами преобразователя кода числа в дополнительный код по модулю, выход которого соединен с первым входом блока элементов ИЛИ, второй вход которого соединен с выходом второго блока элементов И, входы задания вычитания и сложения устройства соединены со вторыми входами соответственно второго и третьего блоков элементов И, выход блока элементов ИЛИ соединен с преобразователем кода числа Х в код Xmodk и преобразователем кода числа Х в код [X/k], выходы которых соединены с установочными входами соответственно первого и второго счетчиков, выходы разрядов последнего из которых соединены с соответствующими входами второго элемента ИЛИ-НЕ, выход которого соединен с управляющим входом второго элемента запрета, выход которого соединен с вычитающим входом второго счетчика и входом разрешения сдвига второго кольцевого регистра сдвига, выходы первого и второго элементов ИЛИ-НЕ соединены соответственно с первым и вторым входами шестого элемента И, выход которого соединен с первыми входами пятого и седьмого элементов И, второй вход которого соединен с выходом третьего элемента запрета и информационными входами первого и второго элементов запрета, а выход - с информационным входом четвертого элемента запрета, управляющий вход которого соединен с выходом нулевого разряда первого кольцевого регистра сдвига, со вторыми входами разрядов четвертого блока элементов И и управляющим входом третьего элемента запрета, информационный вход которого соединен с тактовым входом устройства, выход пятого элемента И соединен с входом первого элемента НЕ, p-е
Figure 00000025
выходы первого кольцевого регистра сдвига соединены с соответствующими входами элемента ИЛИ, выход которого соединен со вторым входом пятого элемента И, первым входом четвертого элемента И и входом второго элемента НЕ, выход которого соединен с первым входом третьего элемента И, выход четвертого элемента запрета соединен с первым входом второго элемента И и вторыми входами третьего и четвертого элементов И, выходы которых соединены соответственно со входами сдвига вправо и влево содержимого третьего кольцевого регистра сдвига, входы разрешения записи разрядов которого и вторые входы разрядов шестого блока элементов И соединены с выходом дифференцирующей цепочки, вход которой соединен с выходом второго элемента ИЛИ-НЕ.
A device for adding and subtracting numbers modulo containing a decoder, a first group of OR elements, first to third blocks of AND elements, a first counter, a first OR-NOT element, a first prohibition element, first to fourth AND elements, the first and second elements NOT , the first circular shift register, the OR element, the encoder, the block of OR elements and three converters, moreover, the first information input of the device is connected to the input of the decoder, the first outputs of which (1 = (t • k + d) <m;
Figure 00000022
m is the modulus of the operation; k - the internal module of the device) are connected to the t-inputs of d-elements OR of the first group, the outputs of which are connected to the first inputs of the corresponding elements AND of the first block, the second inputs of which are connected to the input of the initial installation of the device and to the write enable input of the first ring shift register the inputs of which d-bits are connected to the corresponding outputs of the first block of AND elements, the first input of the second AND element is connected to the input of the first element NOT, the output of which is connected to the first input of the first AND element, the second the stroke of which is connected to the second input of the second AND element, with the output of the first inhibit element and with the subtracting input of the first counter, the outputs of the bits of which are connected to the corresponding inputs of the first element OR NOT, the output of which is connected to the control input of the first inhibit element, the outputs of the second and first elements And they are connected respectively to the inputs of the task of shifting to the right and shifting to the left of the contents of the first annular shift register, characterized in that a second group of OR elements is introduced into it, from the fourth to the sixth block and an element, a differentiating circuit, the fifth to seventh AND gates, the second and third ring shift registers, the second to fourth elements prohibition, one of the transducers is in the form of a code converter
Figure 00000023
into the code [X / k], the other is the code converter of the number X into the Xmodk code, and the third is the code converter of the number into an additional modulo code, the second counter, the second element OR NOT, with the 1st outputs of the decoder connected to d the inputs of t-elements OR of the second group, the outputs of which are connected to the first inputs of the corresponding elements AND of the fifth block, the second inputs of which are connected to the input of the initial installation of the device and to the write enable input of the second ring shift register, the inputs of the bits of which are connected to the outputs And fifth block elements, and discharges the outputs - the first inputs of respective AND gates of the sixth block, n-th outputs of which
Figure 00000024
connected to the (k • n • mod m) -th bit inputs of the third annular shift register, the outputs of the bits of which are connected to the first inputs of the corresponding elements AND of the fourth block, the outputs of which are connected to the inputs of the encoder, the output of which is the output of the device, the second information input of the device is connected with the first inputs of the second and third blocks of AND elements, the outputs of which are connected to the inputs of the number code converter into an additional modulo code, the output of which is connected to the first input of the OR block of elements, the second the input of which is connected to the output of the second block of AND elements, the inputs of the task of subtracting and adding the device are connected to the second inputs of the second and third blocks of AND elements, respectively, the output of the block of OR elements is connected to the code converter of the number X in the code Xmodk and the code converter for the number X in the code [X / k], the outputs of which are connected to the installation inputs of the first and second counters, respectively, the outputs of the bits of the last of which are connected to the corresponding inputs of the second OR-NOT element, the output of which is connected to the control in the ode of the second inhibit element, the output of which is connected to the subtracting input of the second counter and the shift enable input of the second annular shift register, the outputs of the first and second elements are NOT connected to the first and second inputs of the sixth element And, the output of which is connected to the first inputs of the fifth and seventh AND elements, the second input of which is connected to the output of the third prohibition element and the information inputs of the first and second prohibition elements, and the output - to the information input of the fourth prohibition element, control the input of which is connected to the zero-bit output of the first annular shift register, with the second inputs of the bits of the fourth block of AND elements and the control input of the third inhibit element, the information input of which is connected to the clock input of the device, the output of the fifth element AND is connected to the input of the first element NOT, p- e
Figure 00000025
the outputs of the first annular shift register are connected to the corresponding inputs of the OR element, the output of which is connected to the second input of the fifth element AND, the first input of the fourth element AND and the input of the second element NOT, the output of which is connected to the first input of the third element AND, the output of the fourth inhibit element is connected to the first the input of the second element And and the second inputs of the third and fourth elements And, the outputs of which are connected respectively to the inputs of the shift to the right and left of the contents of the third ring shift register, the inputs p which permits the recording of bits of which and the second inputs of the bits of the sixth block of elements AND are connected to the output of the differentiating chain, the input of which is connected to the output of the second element OR NOT.
RU99102011/09A 1999-02-02 1999-02-02 Device for modulo addition and subtraction of integers RU2156998C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU99102011/09A RU2156998C1 (en) 1999-02-02 1999-02-02 Device for modulo addition and subtraction of integers

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU99102011/09A RU2156998C1 (en) 1999-02-02 1999-02-02 Device for modulo addition and subtraction of integers

Publications (1)

Publication Number Publication Date
RU2156998C1 true RU2156998C1 (en) 2000-09-27

Family

ID=20215377

Family Applications (1)

Application Number Title Priority Date Filing Date
RU99102011/09A RU2156998C1 (en) 1999-02-02 1999-02-02 Device for modulo addition and subtraction of integers

Country Status (1)

Country Link
RU (1) RU2156998C1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2220501C1 (en) * 2002-04-17 2003-12-27 Воронежский государственный технический университет Method for converting residual-class system code into voltage
RU2220441C1 (en) * 2002-04-17 2003-12-27 Воронежский государственный технический университет Device for modulo p addition of n numbers

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3752394A (en) * 1972-07-31 1973-08-14 Ibm Modular arithmetic and logic unit
US4025773A (en) * 1974-07-19 1977-05-24 Burroughs Corporation Enhanced apparatus for binary quotient, binary product, binary sum and binary difference generation
SU1636844A1 (en) * 1989-04-11 1991-03-23 Харьковское Высшее Военное Командно-Инженерное Училище Ракетных Войск Им.Маршал Советского Союза Крылова Н.И. Device for modulo addition and subtraction
RU2018935C1 (en) * 1991-07-08 1994-08-30 Краснобаев Виктор Анатольевич Device for modulo addition and subtraction

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3752394A (en) * 1972-07-31 1973-08-14 Ibm Modular arithmetic and logic unit
US4025773A (en) * 1974-07-19 1977-05-24 Burroughs Corporation Enhanced apparatus for binary quotient, binary product, binary sum and binary difference generation
SU1636844A1 (en) * 1989-04-11 1991-03-23 Харьковское Высшее Военное Командно-Инженерное Училище Ракетных Войск Им.Маршал Советского Союза Крылова Н.И. Device for modulo addition and subtraction
RU2018935C1 (en) * 1991-07-08 1994-08-30 Краснобаев Виктор Анатольевич Device for modulo addition and subtraction

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2220501C1 (en) * 2002-04-17 2003-12-27 Воронежский государственный технический университет Method for converting residual-class system code into voltage
RU2220441C1 (en) * 2002-04-17 2003-12-27 Воронежский государственный технический университет Device for modulo p addition of n numbers

Similar Documents

Publication Publication Date Title
US6970897B2 (en) Self-timed transmission system and method for processing multiple data sets
RU2156998C1 (en) Device for modulo addition and subtraction of integers
RU2227931C1 (en) Logical computer
RU2319297C1 (en) D-trigger with self-synchronous preset
RU2242044C1 (en) Majority module
RU2174700C1 (en) Apparatus for program control of electric drives, electronic switches and alarm system
JPH04299B2 (en)
RU2157589C1 (en) Modulo-n remainder driver
RU2282234C1 (en) Logical computing device
RU2018935C1 (en) Device for modulo addition and subtraction
SU1030798A1 (en) Device for number order equalization
RU2110087C1 (en) Modulo adder
SU1305702A1 (en) Device for generating all possible combinations
RU1809437C (en) Modulo arithmetic device
RU2254603C1 (en) Device for building programmable digital microprocessor systems
SU896623A1 (en) Device for control of conveyer computing device
SU1756881A1 (en) Modulo arithmetic unit
RU2260836C1 (en) Unary signals adder
SU1411740A1 (en) Device for computing exponential function
SU1748146A2 (en) Generator of systems of basal functions
RU1805463C (en) Device for comparison of binary digits
US5191654A (en) Microprocessor for high speed data processing
RU2242085C1 (en) DEVICE FOR CONVERTING n-BIT POSITIONAL BINARY CODE INTO MODULO m REMAINDER BINARY CODE
KR100418574B1 (en) Loadable up/down counter circuit
SU960954A1 (en) Logic memory device