RU2796555C1 - Computing device - Google Patents

Computing device Download PDF

Info

Publication number
RU2796555C1
RU2796555C1 RU2022131139A RU2022131139A RU2796555C1 RU 2796555 C1 RU2796555 C1 RU 2796555C1 RU 2022131139 A RU2022131139 A RU 2022131139A RU 2022131139 A RU2022131139 A RU 2022131139A RU 2796555 C1 RU2796555 C1 RU 2796555C1
Authority
RU
Russia
Prior art keywords
input
inputs
remainder
information
quotient
Prior art date
Application number
RU2022131139A
Other languages
Russian (ru)
Inventor
Вячеслав Иванович Петренко
Original Assignee
федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Filing date
Publication date
Application filed by федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" filed Critical федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Application granted granted Critical
Publication of RU2796555C1 publication Critical patent/RU2796555C1/en

Links

Images

Abstract

FIELD: computer engineering.
SUBSTANCE: digital computing devices, digital signal processing devices, cryptographic applications, as well as devices for generating code sequences, the construction of which is based on the theory of finite fields. The device contains two n/2 - bit shift registers, a quotient and remainder formation unit containing three adders, a four-input multiplexer, a remainder code register, two n/2 - bit shift registers.
EFFECT: increasing the speed of the formation of the remainder of the modulo number and the incomplete quotient.
1 cl, 3 dwg, 2 tbl

Description

Изобретение относится к вычислительной технике и может быть использовано в цифровых вычислительных устройствах, устройствах цифровой обработки сигналов, в криптографических приложениях, а также в устройствах для формирования кодовых последовательностей, построение которых основывается на теории конечных полей.The invention relates to computer technology and can be used in digital computing devices, digital signal processing devices, in cryptographic applications, as well as in devices for generating code sequences, the construction of which is based on the theory of finite fields.

Известно вычислительное устройство [1], содержащее сумматоры и мультиплексоры, позволяющее формировать остаток от числа по модулю и неполное частное. Известно также устройство для формирования остатка по произвольному модулю от числа [2], содержащее регистр и блок формирования частного и остатка, позволяющее формировать остаток от числа по модулю и неполное частное.Known computing device [1], containing adders and multiplexers, allowing you to form the remainder of the number modulo and incomplete quotient. It is also known a device for forming a remainder modulo an arbitrary number [2], containing a register and a unit for generating a quotient and a remainder, allowing you to form a remainder modulo a number and an incomplete quotient.

Недостатками данных устройств являются большой объем оборудования.The disadvantages of these devices are a large amount of equipment.

Наиболее близким по технической сущности к заявляемому изобретению является вычислительное устройство [3], содержащее n – разрядный регистр сдвига, блок формирования частного и остатка, состоящий из одного (n-1) – разрядного регистра, одного (n-1) – разрядного регистра сдвига, n-разрядного сумматора и мультиплексора.The closest in technical essence to the claimed invention is a computing device [3], containing an n - bit shift register, a unit for generating a quotient and a remainder, consisting of one ( n -1) - bit register, one ( n -1) - bit shift register , n -bit adder and multiplexer.

Недостатком данного устройства является низкое быстродействие.The disadvantage of this device is the low speed.

Техническим результатом изобретения является увеличение быстродействия формирования остатка от числа по модулю и неполного частного.The technical result of the invention is to increase the speed of the formation of the remainder of the number modulo and partial quotient.

Для достижения технического результата в вычислительном устройстве, содержащем регистр кода числа, блок формирования частного и остатка, содержащий первый сумматор, регистр кода остатка, регистр кода неполного частного, входы кода числа, входы инверсного кода модуля, выходы кода остатка, выходы кода неполного частного, вход начала вычисления, вход подачи тактовых импульсов, причём входы кода числа соединены с информационными входами регистра кода числа, первые информационные входы блока формирования частного и остатка соединены со входами инверсного кода модуля, первые информационные выходы соединены с выходами кода остатка устройства, вторые информационные выходы соединены с выходами кода неполного частного устройства, первый управляющий вход соединён со входом подачи тактовых импульсов устройства, выходы регистра кода остатка соединены с первыми информационными выходами блока формирования частного и остатка, выходы регистра неполного частного соединены со вторыми информационными выходами блока формирования частного и остатка, вторые информационные входы первого сумматора соединены с первыми информационными входами блока формирования частного и остатка, на вход переноса подаётся сигнал логической единицы, первый управляющий вход регистра кода остатка соединён с первым управляющим входом блока формирования частного и остатка, регистр кода числа выполнен в виде двух n/2 – разрядных регистров сдвига, в блок формирования частного и остатка введены два сумматора, четырехвходовый мультиплексор, а регистр кода остатка выполнен в виде двух n/2 – разрядных регистров сдвига, причём четырехвходовой мультиплексор, содержит три инвертора, три элемента И, четыре ключа, блок элементов ИЛИ, два элемента ИЛИ, при этом чётные разряды входа кода числа устройства соединены с информационными входами первого n/2 – разрядного регистра сдвига, а нечётные разряды соединены с информационными входами второго n/2 – разрядного регистра сдвига, вход подачи тактовых импульсов устройства соединен с первыми управляющими входами первого и второго n/2 – разрядных регистров сдвига, вход начала вычисления устройства соединен со вторыми управляющими входами первого и второго n/2 – разрядных регистров сдвига и со вторым управляющим входом блока формирования частного и остатка, вторые и третьи информационные входы которого соединены соответственно со входами инверсного удвоенного кода модуля устройства и со входами инверсного утроенного кода модуля устройства, выход старшего разряда первого n/2 – разрядного регистра сдвига соединён с четвёртым информационным входом блока формирования частного и остатка, а выход старшего разряда второго n/2 – разрядного регистра сдвига соединён с пятым информационным входом блока формирования частного и остатка, вторые информационные входы второго и третьего сумматоров соединены соответственно со вторыми и третьими информационными входами блока формирования частного и остатка, информационные выходы регистра кода остатка соединены с первым информационным выходом блока формирования частного и остатка и со сдвигом на два разряда в сторону старшего с первыми информационными входами четырехвходового мультиплексора и первого, второго и третьего сумматоров, информационные выходы которых соединены соответственно со вторыми, третьими и четвертыми информационными входами четырехвходового мультиплексора, а выходы переноса соединены соответственно с его первым, вторым и третьим управляющими входами, на входы переноса второго и третьего сумматоров подаётся сигнал логической единицы, первые два младших разряда первых информационных входов четырехвходового мультиплексора, первых информационных входов первого, второго и третьего сумматоров соединены с четвертым и пятым информационными входами блока формирования частного и остатка, первые информационные выходы четырехвходового мультиплексора соединены с информационными входами регистра кода остатка, второй и третий информационные выходы соединены с младшими разрядами информационных входов третьего и четвертого n/2 – разрядных регистров сдвига соответственно, первые управляющие входы которых соединены с первым управляющим входом блока формирования частного и остатка, а вторые управляющие входы соединены со вторым управляющим входом блока формирования частного и остатка и вторым управляющим входом регистра кода остатка, информационные выходы третьего n/2 – разрядного регистра сдвига соединены чётными разрядами вторых информационных выходов блока формирования частного и остатка, а информационная выходы четвертого n/2 – разрядного регистра сдвига соединены с нечётными разрядами его второго информационного выхода, первый управляющий вход четырехвходового мультиплексора соединён со входом первого инвертора и первым входом второго элемента И, второй управляющий вход соединён со входом второго инвертора и с первым входом третьего элемента И, третий управляющий вход соединён со входом третьего инвертора, с управляющим входом четвертого ключа и с первыми входами первого и второго элементов ИЛИ, выход первого инвертора соединён с первым входом первого элемента И, выход второго инвертора соединён со вторыми входами первого и второго элементов И, выход третьего инвертора соединен с третьими входами первого и второго элементов И и со вторым входом третьего элемента И, выход первого элемента И соединен с управляющим входом первого ключа, выход второго элемента И соединён с управляющим входом второго ключа и со вторым входом первого элемента ИЛИ, выход третьего элемента И соединен с управляющим входом третьего ключа и со вторым входом второго элемента ИЛИ, информационные входы первого, второго, третьего и четвертого ключей соединены с первым, вторым, третьим и четвертым информационными входами четырехвходового мультиплексора соответственно, а выходы соединены с первыми, вторыми третьими и четвертыми входами соответственно блока элементов ИЛИ, выходы которого соединены с первыми информационными выходами четырехвходового мультиплексора, выход первого элемента ИЛИ соединен со вторым информационным выходом четырехвходового мультиплексора, а выход второго элемента ИЛИ соединён с его третьим информационным выходом.To achieve a technical result in a computing device containing a number code register, a quotient and remainder generation unit containing the first adder, a remainder code register, an incomplete quotient code register, number code inputs, module inverse code inputs, remainder code outputs, partial quotient code outputs, calculation start input, clock pulse supply input, moreover, number code inputs are connected to information inputs of the number code register, the first information inputs of the quotient and remainder generation unit are connected to the module inverse code inputs, the first information outputs are connected to the device remainder code outputs, the second information outputs are connected with the code outputs of the partial partial device, the first control input is connected to the clock input of the device, the outputs of the remainder code register are connected to the first information outputs of the partial and remainder generation unit, the incomplete private register outputs are connected to the second information outputs of the partial and remainder formation unit, the second information the inputs of the first adder are connected to the first information inputs of the quotient and remainder formation unit, a logical unit signal is applied to the transfer input, the first control input of the remainder code register is connected to the first control input of the quotient and remainder formation unit, the number code register is made in the form of two n / 2 - bit shift registers, two adders, a four-input multiplexer are introduced into the quotient and remainder formation unit, and the remainder code register is made in the form of two n / 2 - bit shift registers, and the four-input multiplexer contains three inverters, three AND elements, four keys, a block of elements OR, two OR elements, while the even bits of the device number code input are connected to the information inputs of the first n /2 - bit shift register, and the odd bits are connected to the information inputs of the second n /2 - bit shift register, the clock input of the device is connected to the first control inputs of the first and second n /2 - bit shift registers, the input of the beginning of the calculation of the device is connected to the second control inputs of the first and second n /2 - bit shift registers and with the second control input of the quotient and remainder formation unit, the second and third information inputs of which are connected respectively to the inputs of the inverse doubled code of the device module and to the inputs of the inverse tripled code of the device module, the output of the most significant bit of the first n /2 - bit shift register is connected to the fourth information input of the quotient and remainder formation unit, and the output of the most significant bit of the second n /2 - bit the shift register is connected to the fifth information input of the quotient and remainder generation unit, the second information inputs of the second and third adders are connected respectively to the second and third information inputs of the quotient and remainder formation unit, the information outputs of the remainder code register are connected to the first information output of the quotient and remainder formation unit, and with a shift by two digits towards the senior with the first information inputs of the four-input multiplexer and the first, second and third adders, the information outputs of which are connected respectively to the second, third and fourth information inputs of the four-input multiplexer, and the transfer outputs are connected respectively to its first, second and third control inputs, a logical unit signal is applied to the transfer inputs of the second and third adders, the first two least significant bits of the first information inputs of the four-input multiplexer, the first information inputs of the first, second and third adders are connected to the fourth and fifth information inputs of the quotient and remainder formation unit, the first information outputs of the four-input multiplexer are connected to the information inputs of the remainder code register, the second and third information outputs are connected to the lower bits of the information inputs of the third and fourth n /2 - bit shift registers, respectively, the first control inputs of which are connected to the first control input of the quotient and remainder formation unit, and the second the control inputs are connected to the second control input of the quotient and remainder formation block and the second control input of the remainder code register, the information outputs of the third n /2 - bit shift register are connected by even bits of the second information outputs of the quotient and remainder formation block, and the information outputs of the fourth n /2 - of the bit shift register are connected to the odd bits of its second information output, the first control input of the four-input multiplexer is connected to the input of the first inverter and the first input of the second AND element, the second control input is connected to the input of the second inverter and to the first input of the third AND element, the third control input is connected to input of the third inverter, with the control input of the fourth key and with the first inputs of the first and second elements OR, the output of the first inverter is connected to the first input of the first element AND, the output of the second inverter is connected to the second inputs of the first and second elements AND, the output of the third inverter is connected to the third inputs of the first and second AND elements and with the second input of the third AND element, the output of the first AND element is connected to the control input of the first key, the output of the second AND element is connected to the control input of the second key and to the second input of the first OR element, the output of the third AND element is connected to the control input of the third key and with the second input of the second OR element, the information inputs of the first, second, third and fourth keys are connected to the first, second, third and fourth information inputs of the four-input multiplexer, respectively, and the outputs are connected to the first, second, third and fourth inputs, respectively, of the block of OR elements , the outputs of which are connected to the first information outputs of the four-input multiplexer, the output of the first OR element is connected to the second information output of the four-input multiplexer, and the output of the second OR element is connected to its third information output.

Сущность изобретения заключается в реализации следующего способа вычисления остатка R и неполного частного Q от числа A по модулю P. ПустьThe essence of the invention lies in the implementation of the following method for calculating the remainder R and partial quotient Q of the number A modulo P . Let

Figure 00000001
Figure 00000001

где A – целое положительное число, от которого необходимо вычислить остаток; where A is a positive integer from which it is necessary to calculate the remainder;

P – целое положительное число, называемое модулем; P is a positive integer called the modulus;

Q – целое положительное число, являющееся неполным частным от деления A на P; Q is a positive integer that is the incomplete quotient of dividing A by P ;

R – целое положительное число, являющееся остатком от деления A на P. R is a positive integer that is the remainder of dividing A by P .

ПричемAnd

Figure 00000002
Figure 00000002

Figure 00000003
Figure 00000003

где a i ,

Figure 00000004
– коэффициенты, принимающие значение 0 или 1 в зависимости от значения числа A; where a i ,
Figure 00000004
- coefficients that take the value 0 or 1 depending on the value of the number A ;

p i ,

Figure 00000004
– коэффициенты, принимающие значение 0 или 1 в зависимости от значения модуля P; p i ,
Figure 00000004
– coefficients that take the value 0 or 1 depending on the value of the module P ;

q i ,

Figure 00000004
– коэффициенты, принимающие значение 0 или 1 в зависимости от значения неполного частного Q; q i ,
Figure 00000004
- coefficients that take the value 0 or 1 depending on the value of the partial quotient Q ;

r i ,

Figure 00000004
– коэффициенты, принимающие значение 0 или 1 в зависимости от значения остатка R; r i ,
Figure 00000004
– coefficients that take the value 0 or 1 depending on the value of the remainder R ;

n – количество разрядов в представлении чисел. n is the number of digits in the representation of numbers.

Задача состоит в том, чтобы по известным A и P отыскать остаток R и неполное частное Q. Остаток R является в терминах теории чисел вычетом числа A по модулю P, поэтому говорят, что A сравнимо с R:The task is to find the remainder R and the incomplete quotient Q from the known A and P. The remainder R is, in terms of number theory, the residue of the number A modulo P , so we say that A is congruent with R :

Figure 00000005
Figure 00000005

Значение остатка R может быть вычислено следующим образом:The value of the remainder R can be calculated as follows:

Figure 00000006
Figure 00000006

Перепишем выражение (2) в следующем виде, объединив по два соседних слагаемых:Let us rewrite expression (2) in the following form by combining two neighboring terms:

Figure 00000007
Figure 00000007

Из каждой суммы в скобках в выражении (8) вынесем 2 i за скобки, где

Figure 00000008
, принимает только четные значения:From each sum in brackets in expression (8), we take 2 i out of brackets, where
Figure 00000008
, takes only even values:

Figure 00000009
Figure 00000009

В выражении (9) перед каждой из n/2 образовавшихся сумм вида (a i +1 ·2+a i ), получаем множитель 2 i , где

Figure 00000008
, принимает только четные значения.In expression (9) before each of n /2 formed sums of the form ( a i +1 2+ a i ), we obtain a factor 2 i , where
Figure 00000008
, takes only even values.

Далее вынесем в (9) наименьшую ненулевую степень 2 за скобки:Next, we take out the smallest nonzero power 2 in (9):

Figure 00000010
Figure 00000010

Выполняя последовательно преобразование (10) (n/2)-2 раз получим:Performing successively the transformation (10) ( n /2)-2 times we get:

Figure 00000011
Figure 00000011

где 22 встречается (n/2)-1 раз.where 2 2 occurs ( n /2)-1 times.

Тогда выражение (7) может быть представлено в следующем виде:Then expression (7) can be represented as follows:

Figure 00000012
Figure 00000012

Из теории чисел известно, что операция приведения по модулю инвариантна к сложению и умножению, т. е. величина остатка не зависит от того, вычислен ли он от суммы (произведения) или от каждого слагаемого (сомножителя), затем соответствующие частичные остатки могут быть просуммированы (перемножены) и от результата вычислен остаток по модулю.It is known from number theory that the modulo reduction operation is invariant to addition and multiplication, i.e. the value of the remainder does not depend on whether it is calculated from the sum (product) or from each term (factor), then the corresponding partial remainders can be summed (multiplied) and the modulo remainder is calculated from the result.

Исходя из вышесказанного, выражение (12) может быть вычислено следующим образом.Based on the foregoing, expression (12) can be calculated as follows.

Вначале на первом такте вычисляют величинуFirst, on the first cycle, the value is calculated

Figure 00000013
Figure 00000013

На втором такте вычисляют величинуOn the second cycle, the value is calculated

Figure 00000014
Figure 00000014

На третьем такте вычисляют величинуOn the third cycle, the value is calculated

Figure 00000015
Figure 00000015

На последнем n/2-м такте вычисляют величинуOn the last n /2-th cycle, the value is calculated

Figure 00000016
Figure 00000016

которая и является искомым остатком R от числа A по модулю P.which is the required remainder R of the number A modulo P .

Операция приведения по модулю P на каждой ступени преобразования выполняется исходя из следующих соображений.The operation of reduction modulo P at each stage of the transformation is performed on the basis of the following considerations.

По определению величина t i -1 лежит в диапазоне 0≤t i -1P-1, поэтому в соответствии с выражениями (13)-(15) величинаBy definition, the value of t i -1 lies in the range 0≤ t i -1P -1, therefore, in accordance with expressions (13)-(15), the value

Figure 00000017
Figure 00000017

до приведения ее по модулю может принимать значения в диапазоне от 0 до 4P-1. Приведение по модулю величины t i осуществляется по следующим правиламbefore bringing it modulo can take values in the range from 0 to 4 P -1. Modulo reduction of the value t i is carried out according to the following rules

Figure 00000018
Figure 00000018

Разряды неполного частного Q на каждом этапе вычислений принимают значения в соответствии с таблицей 1.The digits of the partial quotient Q at each stage of the calculations take values in accordance with Table 1.

Таблица 1.Table 1.

старший разрядsenior rank младший разрядjunior rank Значение t i Value t i 00 00 0 ≤ t i < P 0 ≤ t i < P 00 11 Pt i < 2P Pt i < 2 P 11 00 2P t i < 3P 2 Pt i < 3 P 11 11 3P t i < 4P 3 Pt i < 4 P

Условия попадания значения t i в один из указанных в таблице 1 интервалов определяются значениями сигналов переноса на выходах переноса сумматоров, осуществляющих операцию вычитания (t i kP), где k=1, 2, 3 в соответствии с таблицей 2.The conditions for the value t i to fall into one of the intervals indicated in Table 1 are determined by the values of the transfer signals at the transfer outputs of the adders that perform the subtraction operation ( t i - kP ), where k =1, 2, 3 in accordance with Table 2.

Таблица 2.Table 2.

tt ii t i P t i P t i – 2P t i – 2 P t i – 3P t i – 3 P 0 ≤ t i < P 0 ≤ t i < P 00 00 00 Pt i < 2P Pt i < 2 P 11 00 00 2P t i < 3P 2 Pt i < 3 P 11 11 00 3P t i < 4P 3 Pt i < 4 P 11 11 11

Таким образом, если значение сигналов переноса равно «1» на выходах переноса всех трех сумматоров, то t i (mod P)=t i - 3P, если значение сигналов переноса равно «1» на выходах переноса двух сумматоров, то
t i (mod P)=t i - 2P, если значение сигнала переноса равно «1» на выходах переноса одного сумматора, то t i (mod P)=t i P. Если значение сигналов переноса равно «0» на выходах переноса всех трех сумматоров, то тогда
t i (mod P)=t i , т.е. операция вычитания не выполняется.
Thus, if the value of the carry signals is "1" at the carry outputs of all three adders, thent i (modP)=t i - 3P, if the value of the carry signals is "1" at the carry outputs of two adders, then
t i (modP)=t i - 2P, if the value of the carry signal is "1" at the carry outputs of one adder, thent i (modP)=t i -P. If the value of the carry signals is "0" at the carry outputs of all three adders, then
t i (modP)=t i , i.e. subtraction operation is not performed.

На фиг. 1 представлена схема вычислительного устройства.In FIG. 1 shows a diagram of a computing device.

Вычислительное устройство содержит первый n/2 – разрядный регистр сдвига 1.1, второй n/2 – разрядный регистр сдвига 1.2, блок формирования частного и остатка 2, входы кода числа устройства 3, входы инверсного кода модуля устройства 4, входы инверсного удвоенного кода модуля устройства 5, входы инверсного утроенного кода модуля устройства 6, выходы кода остатка устройства 7, выходы кода неполного частного устройства 8, вход начала вычисления устройства 9, вход подачи тактовых импульсов устройства 10.The computing device contains the first n /2 - bit shift register 1.1, the second n /2 - bit shift register 1.2, the unit for generating the quotient and remainder 2, the inputs of the device number code 3, the inputs of the inverse code of the device module 4, the inputs of the inverse doubled code of the device module 5 , inputs of the inverse tripled code of the device module 6, outputs of the remainder code of the device 7, outputs of the code of an incomplete private device 8, input of the beginning of the calculation of the device 9, input of the clock pulses of the device 10.

Чётные разряды входа кода числа устройства 3 соединены с информационными входами первого n/2 – разрядного регистра сдвига 1.1, нечётные разряды соединены с информационными входами второго n/2 – разрядного регистра сдвига 1.2.The even bits of the input of the device number code 3 are connected to the information inputs of the first n /2 - bit shift register 1.1, the odd bits are connected to the information inputs of the second n /2 - bit shift register 1.2.

Входы инверсного кода модуля устройства 4, входы инверсного удвоенного кода модуля устройства 5 и входы инверсного утроенного кода модуля устройства 6 соединены соответственно с первыми, вторыми и третьими информационными входами блока формирования частного и остатка 2. The inputs of the inverse code of the device module 4, the inputs of the inverse doubled code of the device module 5 and the inputs of the inverse tripled code of the device module 6 are connected respectively to the first, second and third information inputs of the quotient and remainder 2 generation unit.

Вход начала вычисления устройства 9 соединен со вторыми управляющими входами первого 1.1 и второго 1.2 n/2 – разрядных регистров сдвига и со вторым управляющим входом блока формирования частного и остатка 2. Вход подачи тактовых импульсов устройства 10 соединен с первыми управляющими входами 1.1 и второго 1.2 n/2 – разрядных регистров сдвига и с первым управляющим входом блока формирования частного и остатка 2.The input of the beginning of the calculation of the device 9 is connected to the second control inputs of the first 1.1 and second 1.2 n /2 - bit shift registers and to the second control input of the block for forming the quotient and the remainder 2. The clock input of the device 10 is connected to the first control inputs 1.1 and the second 1.2 n /2 - bit shift registers and with the first control input of the block for the formation of quotient and remainder 2.

Первые информационные выходы блока формирования частного и остатка 2 соединены с выходами кода остатка устройства 7, вторые информационные выходы соединены с выходами кода неполного частного устройства 8.The first information outputs of the quotient and remainder 2 generation unit are connected to the device 7 remainder code outputs, the second information outputs are connected to the incomplete private device 8 code outputs.

Выход старшего разряда первого n/2 – разрядного регистра сдвига 1.1 соединён с четвёртым информационным входом блока формирования частного и остатка 2, а выход старшего разряда второго n/2 – разрядного регистра сдвига 1.2 соединён с пятым информационным входом блока формирования частного и остатка 2.The output of the most significant bit of the first n /2 - bit shift register 1.1 is connected to the fourth information input of the quotient and remainder formation unit 2, and the output of the most significant bit of the second n /2 - bit shift register 1.2 is connected to the fifth information input of the quotient and remainder formation unit 2.

На фиг. 2 представлена схема блока формирования частного и остатка 2.In FIG. 2 shows a block diagram for the formation of quotient and remainder 2.

Блок формирования частного и остатка 2 содержит три сумматора 11.1, 11.2 и 11.3, четырехвходовый мультиплексор 12, регистр кода остатка 13, два n/2 – разрядных регистра сдвига 14.1 и 14.2.The quotient and remainder forming unit 2 contains three adders 11.1, 11.2 and 11.3, a four-input multiplexer 12, a remainder code register 13, two n /2 bit shift registers 14.1 and 14.2.

Вторые информационные входы первого 11.1, второго 11.2 и третьего 11.3 сумматоров соединены соответственно с первыми, вторыми и третьими информационными входами блока формирования частного и остатка 2.The second information inputs of the first 11.1, second 11.2 and third 11.3 adders are connected respectively to the first, second and third information inputs of the quotient and remainder 2 generation unit.

Выходы регистра кода остатка 13 соединены с первым информационным выходом блока формирования частного и остатка 2 и со сдвигом на два разряда в сторону старшего с первыми информационными входами четырехвходового мультиплексора 12 и первого 11.1, второго 11.2 и третьего 11.3 сумматоров, информационные выходы которых соединены соответственно со вторыми, третьими и четвертыми информационными входами четырехвходового мультиплексора 12, а выходы переноса соединены соответственно с его первым, вторым и третьим управляющими входами.The outputs of the remainder code register 13 are connected to the first information output of the quotient and remainder 2 generation unit and with a two-bit shift towards the older one with the first information inputs of the four-input multiplexer 12 and the first 11.1, the second 11.2 and the third 11.3 adders, the information outputs of which are connected respectively to the second , third and fourth information inputs of the four-input multiplexer 12, and the transfer outputs are connected to its first, second and third control inputs, respectively.

На входы переноса первого 11.1, второго 11.2 и третьего 11.3 сумматоров подаётся сигнал логической единицы. The transfer inputs of the first 11.1, second 11.2 and third 11.3 adders are fed a logical unit signal.

Первые два младших разряда первых информационных входов четырехвходового мультиплексора 12, первых информационных входов первого 11.1, второго 11.2 и третьего 11.3 сумматоров соединены с четвертым и пятым информационными входами блока формирования частного и остатка 2.The first two least significant bits of the first information inputs of the four-input multiplexer 12, the first information inputs of the first 11.1, the second 11.2 and the third 11.3 adders are connected to the fourth and fifth information inputs of the quotient and remainder 2 generation unit.

Первые информационные выходы четырехвходового мультиплексора 12 соединены с информационными входами регистра кода остатка 13, второй и третий информационные выходы соединены с младшими разрядами информационных входов третьего 14.1 и четвертого 14.2 n/2 – разрядных регистров сдвига соответственно, первые управляющие входы которых соединены с первым управляющим входом блока формирования частного и остатка 2 и первым управляющим входом регистра кода остатка 13, а вторые управляющие входы соединены со вторым управляющим входом блока формирования частного и остатка 2 и вторым управляющим входом регистра кода остатка 13.The first information outputs of the four-input multiplexer 12 are connected to the information inputs of the remainder code register 13, the second and third information outputs are connected to the lower bits of the information inputs of the third 14.1 and fourth 14.2 n /2 bit shift registers, respectively, the first control inputs of which are connected to the first control input of the block quotient and remainder 2 formation and the first control input of the remainder code register 13, and the second control inputs are connected to the second control input of the quotient and remainder 2 generation unit and the second control input of the remainder code register 13.

Информационные выходы третьего n/2 – разрядного регистра сдвига 14.1 соединены чётными разрядами вторых информационных выходов блока формирования частного и остатка 2, а информационная выходы четвертого n/2 – разрядного регистра сдвига 14.2 соединены с нечётными разрядами его второго информационного выхода.The information outputs of the third n /2 - bit shift register 14.1 are connected by even bits of the second information outputs of the quotient and remainder 2 generation unit, and the information outputs of the fourth n /2 - bit shift register 14.2 are connected to the odd bits of its second information output.

На фиг. 3 представлена схема четырехвходового мультиплексора 12.In FIG. 3 shows a diagram of a four-input multiplexer 12.

Четырехходовой мультиплексор 12, содержит три инвертора 15.1, 15.2 и 15.3, три элемента И 16, 17 и 18, четыре ключа 19.1, 19.2, 19.3 и 19.4, блок элементов ИЛИ 20, два элемента ИЛИ 21.1 и 21.2.The four-way multiplexer 12 contains three inverters 15.1, 15.2 and 15.3, three AND elements 16, 17 and 18, four keys 19.1, 19.2, 19.3 and 19.4, a block of OR elements 20, two OR elements 21.1 and 21.2.

Первый управляющий вход четырехвходового мультиплексора 12 соединён со входом первого инвертора 15.1 и первым входом второго элемента И 17, второй управляющий вход соединён со входом второго инвертора 15.2 и с первым входом третьего элемента И 18, третий управляющий вход соединён со входом третьего инвертора 15.3, с управляющим входом четвертого ключа 19.4 и с первыми входами первого 21.1 и второго 21.2 элементов ИЛИ.The first control input of the four-input multiplexer 12 is connected to the input of the first inverter 15.1 and the first input of the second element And 17, the second control input is connected to the input of the second inverter 15.2 and the first input of the third element And 18, the third control input is connected to the input of the third inverter 15.3, with the control input of the fourth key 19.4 and with the first inputs of the first 21.1 and second 21.2 elements OR.

Выход первого инвертора 15.1 соединён с первым входом первого элемента И 16, выход второго инвертора 15.2 соединён со вторыми входами первого 16 и второго 17 элементов И, выход третьего инвертора 15.3 соединен с третьими входами первого 16 и второго 17 элементов И, а также со вторым входом третьего элемента И 18.The output of the first inverter 15.1 is connected to the first input of the first element And 16, the output of the second inverter 15.2 is connected to the second inputs of the first 16 and second 17 elements And, the output of the third inverter 15.3 is connected to the third inputs of the first 16 and second 17 elements And, as well as to the second input third element AND 18.

Выход первого элемента И 16 соединен с управляющим входом первого ключа 19.1, выход второго элемента И 17 соединён с управляющим входом второго ключа 19.2 и со вторым входом первого элемента ИЛИ 21.1, выход третьего элемента И 18 соединен с управляющим входом третьего ключа 19.3 и со вторым входом второго элемента ИЛИ 21.2.The output of the first element And 16 is connected to the control input of the first key 19.1, the output of the second element And 17 is connected to the control input of the second key 19.2 and to the second input of the first element OR 21.1, the output of the third element And 18 is connected to the control input of the third key 19.3 and to the second input second element OR 21.2.

Информационные входы первого 19.1, второго 19.2, третьего 19.3 и четвертого 19.4 ключей соединены с первым, вторым, третьим и четвертым информационными входами четырехвходового мультиплексора 12 соответственно, а выходы соединены с первыми, вторыми третьими и четвертыми входами соответственно блока элементов ИЛИ 20, выходы которого соединены с первыми информационными выходами четырехвходового мультиплексора 12.The information inputs of the first 19.1, second 19.2, third 19.3 and fourth 19.4 keys are connected to the first, second, third and fourth information inputs of the four-input multiplexer 12, respectively, and the outputs are connected to the first, second, third and fourth inputs, respectively, of the block of elements OR 20, the outputs of which are connected with the first information outputs of the four-input multiplexer 12.

Выход первого элемента ИЛИ 21.1 соединен со вторым информационным выходом четырехвходового мультиплексора 12, а выход второго элемента ИЛИ 21.2 соединён с его третьим информационным выходом.The output of the first element OR 21.1 is connected to the second information output of the four-input multiplexer 12, and the output of the second element OR 21.2 is connected to its third information output.

Вычислительное устройство работает следующим образом (см. Фиг. 1).The computing device operates as follows (see Fig. 1).

На входы кода числа 3 устройства подается двоичный код числа A, от которого необходимо сформировать остаток R и неполное частное Q по произвольному модулю P. На входы инверсного кода модуля 4 устройства подается инверсный код модуля

Figure 00000019
, поступая далее на первые информационные входы блока 2 формирования частного и остатка. На входы инверсного удвоенного кода модуля 5 устройства подается инверсный удвоенный код модуля
Figure 00000020
, поступая далее на вторые информационные входы блока 2 формирования частного и остатка. На входы инверсного утроенного кода модуля 6 устройства подается инверсный утроенный код модуля
Figure 00000021
, поступая далее на третьи информационные входы блока 2 формирования частного и остатка.The binary code of the number 3 is fed to the inputs of the number 3 code of the deviceA, from which it is necessary to form the remainderRand incomplete quotientQ moduloP. The inverse code of the module is fed to the inputs of the inverse code of module 4 of the device
Figure 00000019
, proceeding further to the first information inputs of block 2 for the formation of the quotient and the remainder. The inverse doubled code of the module 5 of the device is fed to the inputs of the inverse doubled code of the module
Figure 00000020
, proceeding further to the second information inputs of the block 2 forming the quotient and the remainder. The inverse triple code of the module 6 of the device is fed to the inputs of the inverse triple code of the module
Figure 00000021
, proceeding further to the third information inputs of block 2 for the formation of the quotient and the remainder.

Затем на вход начала вычисления устройства 9 подается сигнал, под воздействием которого в первый n/2 – разрядный регистр сдвига 1.1 записываются четные разряды двоичного кода числа A, а во второй n/2 – разрядный регистр сдвига 1.2 записываются нечетные разряды двоичного кода числа A. Под воздействием этого же сигнала регистр кода остатка 13, третий 14.1 и четвертый 14.2 n/2 – разрядные регистры сдвига блока 2 формирования частного и остатка устанавливаются в нулевое состояние.Then, a signal is applied to the input of the beginning of the calculation of the device 9, under the influence of which even bits of the binary code of the number A are written to the first n /2 - bit shift register 1.1, and odd bits of the binary code of the number A are written to the second n /2 - bit shift register 1.2. Under the influence of the same signal, the remainder code register 13, the third 14.1 and the fourth 14.2 n /2 - the bit shift registers of the block 2 for the formation of the quotient and the remainder are set to the zero state.

Вначале на первом такте работы устройства на четвёртый информационный вход блока 2 формирования частного и остатка с выхода старшего разряда первого n/2 – разрядного регистра сдвига 1.1 поступает значение (a n -1)-го разряда числа A, а на пятый информационный вход с выхода старшего разряда второго n/2 – разрядного регистра сдвига 1.2 поступает значение (a n -2)-го разряда числа A. В блоке 2 формирования частного и остатка формируется значение t 1=(a n -1 ·2+a n -2) mod P и разряды q n -1 и q n -2 неполного частного, которые записываются в младшие разряды третьего 14.1 и четвертого 14.2 n/2 – разрядных регистров сдвига соответственно.First, on the first cycle of the device operation, the fourth information input of block 2 for forming the quotient and the remainder from the output of the highest digit of the first n /2 - bit shift register 1.1 receives the value of the ( a n -1 )-th digit of the number A , and the fifth information input from the output the most significant bit of the second n /2 - bit shift register 1.2 receives the value of ( a n -2 )-th bit of the number A . In block 2 of forming the quotient and the remainder, the value t 1 =( a n -1 2+ a n -2 ) mod P and bits q n -1 and q n -2 of the partial quotient are formed, which are written in the lower digits of the third 14.1 and fourth 14.2 n /2 - bit shift registers, respectively.

На втором такте работы устройства на четвёртый информационный вход блока 2 формирования частного и остатка с выхода старшего разряда первого n/2 – разрядного регистра сдвига 1.1 поступает значение (a n -3)-го разряда числа A, а на пятый информационный вход с выхода старшего разряда второго n/2 – разрядного регистра сдвига 1.2 поступает значение (a n -4)-го разряда числа A. В блоке 2 формирования частного и остатка формируется значение
t 2=(22 t 1+(a n -3 ·2+a n -4)) mod P и разряды q n -3 и q n -4 неполного частного. При этом разряды q n -1 и q n -2 неполного частного сдвигаются на один разряд в сторону старших в третьем 14.1 и четвертом 14.2 n/2 – разрядном регистрах сдвига соответственно, а в младшие разряды этих регистров записываются соответственно разряды q n -3 и q n -4 неполного частного.
On the second cycle of operation of the device, the value of the ( a n -3 )-th bit of the number A arrives at the fourth information input of block 2 for forming the quotient and the remainder from the output of the highest digit of the first n /2 - bit shift register 1.1 , and the fifth information input from the output of the highest bit of the second n /2 - bit shift register 1.2 receives the value of ( a n -4 )-th bit of the number A . In block 2 of forming the quotient and the remainder, the value is formed
t 2 =(2 2 t 1 +( a n -3 2+ a n -4 )) mod P and digits q n -3 and q n -4 of the incomplete quotient. In this case, the bits q n -1 and q n -2 of the incomplete quotient are shifted by one bit towards the older ones in the third 14.1 and fourth 14.2 n / 2 - bit shift registers, respectively, and the bits q n -3 and q n -4 incomplete quotient.

На последнем n/2-м такте работы устройства на четвёртый информационный вход блока 2 формирования частного и остатка с выхода старшего разряда первого n/2 – разрядного регистра сдвига 1.1 поступает значение a 1 - го разряда числа A, а на пятый информационный вход с выхода старшего разряда второго n/2 – разрядного регистра сдвига 1.2 поступает значение a 0 - го разряда числа A. В блоке 2 формирования частного и остатка формируется значение t n /2=(22 t n /2-1+(a 1 ·2+a 0)) mod P, которое и является искомым остатком R от числа A по модулю P, а также формируются разряды q 1 и q 0 неполного частного. При этом значение t n /2 будет записано в регистр 13 кода остатка и поступит на выходы 7 кода остатка устройства, четные разряды неполного частного будут записаны в третий 14.1 n/2 – разрядный регистр сдвига, а нечетные разряды неполного частного будут записаны в четвертый 14.2 n/2 – разрядный регистр сдвига и поступят на выходы 8 кода неполного частного устройства.On the last n /2-th cycle of the device operation, the fourth information input of the block 2 for forming the quotient and the remainder from the output of the most significant bit of the first n /2 - bit shift register 1.1 receives the value a of the 1st bit of the number A , and the fifth information input from the output the most significant bit of the second n /2 - bit shift register 1.2 receives the value a of the 0 -th bit of the number A . In block 2 of forming the quotient and the remainder, the value t n /2 =(2 2 t n /2-1 +( a 1 2+ a 0 )) mod P is formed, which is the desired remainder R of the number A modulo P , and bits q 1 and q 0 of the incomplete quotient are also formed. In this case, the value t n /2 will be written to the register 13 of the remainder code and will go to the outputs 7 of the remainder code of the device, the even bits of the partial quotient will be written to the third 14.1 n /2 - bit shift register, and the odd bits of the incomplete quotient will be written to the fourth 14.2 n /2 is a bit shift register and will go to the outputs 8 of the incomplete private device code.

Блок 2 формирования частного и остатка работает следующим образом (см. Фиг. 2).Block 2 of the formation of the private and the remainder works as follows (see Fig. 2).

На вторые информационные входы первого 11.1, второго 11.2 и третьего 11.3 сумматоров в течение всего цикла вычисления остатка R и неполного частного Q от числа A по модулю P с первых, вторых и третьих информационных входов блока 2 формирования частного и остатка подается соответственно инверсный код модуля

Figure 00000019
, инверсный удвоенный код модуля
Figure 00000020
и инверсный утроенный код модуля
Figure 00000021
. На входы переноса первого 11.1, второго 11.2 и третьего 11.3 сумматоров подается сигнал логической единицы. В результате первый 11.1, второй 11.2 и третий 11.3 сумматоры выполняют фактически операцию арифметического вычитания из числа, подаваемого на их первые информационные входы, модуля P, 2P или 3P соответственно. В случае, если число на первых информационных входах сумматоров 11.1, 11.2 и 11.3 больше или равно чем число на их вторых информационных входах, то на выходе переноса соответствующего сумматора появляется сигнал логической единицы.The second information inputs of the first 11.1, second 11.2 and third 11.3 adders during the entire cycle of calculating the remainder R and partial quotient Q from the number A modulo P from the first, second and third information inputs of the block 2 forming the quotient and the remainder are fed, respectively, the inverse code of the module
Figure 00000019
, inverse double module code
Figure 00000020
and inverse triple module code
Figure 00000021
. The transfer inputs of the first 11.1, second 11.2 and third 11.3 adders are fed a logical unit signal. As a result, the first 11.1, second 11.2 and third 11.3 adders actually perform the operation of arithmetic subtraction from the number supplied to their first information inputs, module P , 2 P or 3 P respectively. If the number at the first information inputs of the adders 11.1, 11.2 and 11.3 is greater than or equal to the number at their second information inputs, then a logical one signal appears at the transfer output of the corresponding adder.

На первом такте работы устройства c четвёртого и пятого информационных входов блока 2 формирования частного и остатка значения (a n -1)-го и (a n -2)-го разряда числа A поступают на младшие разряды первых информационных входов четырехвходового мультиплексора 12, первого 11.1, второго 11.2 и третьего 11.3 сумматоров. На вторые, третьи и четвёртые информационные входы четырехвходового мультиплексора 12, с информационных выходов первого 11.1, второго 11.2 и третьего 11.3 сумматоров поступают соответственно значения (a n -12+ a n -2)-P, (a n -12+ a n -2)-2P и (a n -12+ a n -2)-3P, а на первый, второй и третий управляющие входы с выходов переноса первого 11.1, второго 11.2 и третьего 11.3 сумматоров поступают соответственно значения сигналов переноса. На первых информационных выходах четырехвходового мультиплексора 12 окажется величина
t 1=(a n -1 ·2+a n -2) mod P, которая под воздействием тактового импульса с первого управляющего входа блока 2 формирования частного и остатка будет записана в регистр кода остатка 13, а на втором и третьем информационных выходах будут сформированы разряды q n -1 и q n -2 неполного частного, которые под воздействием этого же тактового импульса будут записаны в младшие разряды третьего 14.1 и четвертого 14.2 n/2 – разрядных регистров сдвига.
On the first cycle of operation of the device from the fourth and fifth information inputs of the block 2 for forming the quotient and the remainder of the value of the ( a n -1 )-th and ( a n -2 )-th digit of the number A are fed to the lower digits of the first information inputs of the four-input multiplexer 12, the first 11.1, second 11.2 and third 11.3 adders. The second, third and fourth information inputs of the four-input multiplexer 12, from the information outputs of the first 11.1, the second 11.2 and the third 11.3 adders, respectively, receive the values ( a n -1 2+ a n -2 ) - P , ( a n -1 2+ a n -2 )-2 P and ( a n -1 2+ a n -2 )-3 P , and the first, second and third control inputs from the transfer outputs of the first 11.1, second 11.2 and third 11.3 adders receive respectively the values of the transfer signals . The first information outputs of the four-input multiplexer 12 will be the value
t 1 =( a n -1 2+ a n -2 ) mod P , which, under the influence of a clock pulse from the first control input of the block 2 for forming the quotient and the remainder, will be written to the remainder code register 13, and the second and third information outputs will bits q n -1 and q n -2 of the incomplete quotient are formed, which, under the influence of the same clock pulse, will be written to the lower digits of the third 14.1 and fourth 14.2 n /2 - bit shift registers.

На втором такте работы устройства на первых информационных входах четырехвходового мультиплексора 12, первого 11.1, второго 11.2 и третьего 11.3 сумматоров будет сформировано значение 22 t 1+(a n -3 ·2+a n -4), причем значение t 1 поступит с выхода регистра кода остатка 13 со сдвигом на два разряда в сторону старших, а значения a n -3·и a n -4 поступят на младшие разряды с четвертого и пятого информационных входов блока 2 формирования частного и остатка. В результате суммирования на вторых, третьих и четвертых информационных входах четырехвходового мультиплексора 12 окажутся величины 22 t 1+(a n -3 ·2+a n -4)-P, 22 t 1+(a n -3 ·2+a n -4)-2P и
22 t 1+(a n -3 ·2+a n -4)-3P соответственно, а на первом, втором и третьем управляющем входах окажутся сигналы переноса с выходов переноса первого 11.1, второго 11.2 и третьего 11.3 сумматоров. Четырехвходовый мультиплексор 12 в соответствии с логикой своей работы сформирует на своих первых информационных выходах величину t 2=(22 t 1+(a n -32+a n -4)) mod P, которая под воздействием тактового импульса с первого управляющего входа блока 2 формирования частного и остатка будет записана в регистр кода остатка 13, а на втором и третьем информационных выходах будут сформированы разряды q n -3 и q n -4 неполного частного, которые под воздействием этого же тактового импульса будут записаны в младшие разряды третьего 14.1 и четвертого 14.2 n/2 – разрядных регистров сдвига. При этом разряды q n -1 и q n -2 неполного частного в третьем 14.1 и четвертом 14.2 n/2 – разрядных регистров сдвига соответственно будут сдвинуты на один в сторону старших.
On the second cycle of operation of the device on the first information inputs of the four-input multiplexer 12, the first 11.1, the second 11.2 and the third 11.3 adders, the value 2 2 t 1 +( a n -3 2+ a n -4 ) will be generated, and the value t 1 will come from the output of the register code of the remainder 13 with a shift of two bits in the direction of the senior, and the values of a n -3 ·and a n -4 go to the low bits from the fourth and fifth information inputs of the block 2 of the formation of private and remainder. As a result of summation on the second, third and fourth information inputs of the four-input multiplexer 12 will be the values 2 2 t 1 +( a n -3 2+ a n -4 )- P , 2 2 t 1 +( a n -3 2+ a n -4 )-2 P and
2 2 t 1 +( a n -3 2+ a n -4 )-3 P respectively, and the first, second and third control inputs will be the transfer signals from the transfer outputs of the first 11.1, second 11.2 and third 11.3 adders. The four-input multiplexer 12, in accordance with the logic of its operation, will generate at its first information outputs the value t 2 =(2 2 t 1 +( a n -3 2+ a n -4 )) mod P , which, under the influence of a clock pulse from the first control input block 2 forming the private and the remainder will be written to the remainder code register 13, and the second and third information outputs will generate digits q n -3 and q n -4 of the incomplete quotient, which, under the influence of the same clock pulse, will be written to the lower digits of the third 14.1 and fourth 14.2 n /2 - bit shift registers. In this case, the bits q n -1 and q n -2 of the incomplete quotient in the third 14.1 and fourth 14.2 n /2 - bit shift registers, respectively, will be shifted by one towards the older ones.

На последнем n/2-м такте работы устройства на первых информационных входах четырехвходового мультиплексора 12, первого 11.1, второго 11.2 и третьего 11.3 сумматоров будет сформировано значение
22 t n /2-1+(a 1 ·2+a 0), причем значение t n /2-1 поступит с выхода регистра кода остатка 13 со сдвигом на два разряда в сторону старших, а значения a 1·и a 0 поступят на младшие разряды с четвертого и пятого информационных входов блока 2 формирования частного и остатка. В результате суммирования на вторых, третьих и четвертых информационных входах четырехвходового мультиплексора 12, окажутся величины 22 t n /2-1+(a 1 ·2+a 0)-P, 22 t n /2-1+(a 1 ·2+a 0)-2P и 22 t n /2-1+(a 1 ·2+a 0)-3P соответственно, а на первом, втором и третьем управляющем входах окажутся сигналы переноса с выходов переноса первого 11.1, второго 11.2 и третьего 11.3 сумматоров. Четырехвходовый мультиплексор 12 в соответствии с логикой своей работы сформирует на своих первых информационных выходах величину t n /2=(22 t n /2-1+(a 12+a 0))mod P, которая под воздействием тактового импульса с первого управляющего входа блока 2 формирования частного и остатка будет записана в регистр кода остатка 13, а на втором и третьем информационных выходах будут сформированы разряды q 1 и q 0 неполного частного, которые под воздействием этого же тактового импульса будут записаны в младшие разряды третьего 14.1 и четвертого 14.2 n/2 – разрядных регистров сдвига с одновременным сдвигом ранее записанных разрядов на один в сторону старших.
On the last n /2-th cycle of operation of the device on the first information inputs of the four-input multiplexer 12, the first 11.1, the second 11.2 and the third 11.3 adders will generate the value
2 2 t n /2-1 +( a 1 2+ a 0 ), moreover, the value t n /2-1 will come from the output of the remainder code register 13 with a two-digit shift towards higher ones, and the values a 1 and a 0 will go to the least significant digits from the fourth and fifth information inputs of the block 2 for the formation of the quotient and the remainder. As a result of summation on the second, third and fourth information inputs of the four-input multiplexer 12, there will be values 2 2 t n /2-1 +( a 1 2+ a 0 )- P , 2 2 t n /2-1 +( a 1 2+ a 0 )-2 P and 2 2 t n /2-1 +( a 1 2+ a 0 )-3 P respectively, and the first, second and third control inputs will contain the transfer signals from the transfer outputs of the first 11.1 , second 11.2 and third 11.3 adders. The four-input multiplexer 12, in accordance with the logic of its operation, will generate at its first information outputs the value t n /2 =(2 2 t n /2-1 +( a 1 2+ a 0 ))mod P , which, under the influence of a clock pulse from the first of the control input of block 2 for the formation of a private and the remainder will be written to the register of the remainder code 13, and on the second and third information outputs bits q 1 and q 0 of an incomplete private will be generated, which, under the influence of the same clock pulse, will be written to the lower digits of the third 14.1 and fourth 14.2 n /2 - bit shift registers with a simultaneous shift of previously recorded bits by one in the direction of the older ones.

В результате после n/2 – го такта работы на первых информационных выходах блока 2 формирования частного и остатка будет сформирован код остатка R от числа A по модулю P, а на вторых информационных выходах неполное частное Q.As a result, after the n /2th cycle of operation, at the first information outputs of block 2 for the formation of the quotient and the remainder, the remainder code R from the number A modulo P will be generated, and at the second information outputs, the incomplete quotient Q .

Четырехвходовый мультиплексор 12 работает следующим образом (см. Фиг. 3).Four-input multiplexer 12 operates as follows (see Fig. 3).

На i-м такте работы устройства, где

Figure 00000022
, на первом информационном входе четырехвходового мультиплексора 12 образуется значение t i =22 t i -1+(a n -2 i -1 ·2+a n -2 i ), на втором, третьем и четвертом информационных входах образуются значения t i -P, t i -2P и t i -3P соответственно, при этом t 0=0.On the i -th cycle of the device, where
Figure 00000022
, at the first information input of the four-input multiplexer 12 the value t i =2 2 t i -1 +( a n -2 i -1 2+ a n -2 i ) is formed, at the second, third and fourth information inputs the values t i - P , t i -2 P and t i -3 P respectively, while t 0 =0.

Управляющие сигналы четырехвходового мультиплексора 12 открывают один из ключей 19.1-19.4. The control signals of the four-input multiplexer 12 open one of the keys 19.1-19.4.

Если управляющий сигнал появляется на всех трех управляющих входах четырехвходового мультиплексора 12, то окажется открытым четвертый ключ 19.4. Управляющий сигнал с третьего управляющего входа откроет четвертый ключ 19.4 и через третий инвертор 15.3 в виде логического нуля поступит на третьи входы элементов 16 и 17 И, а также на второй вход элемента И 18, запрещая прохождение управляющих сигналов с их первых входов на их выходы. В результате первый 19.1, второй 19.2 и третий 19.3 ключи окажутся закрытыми и на выход четырехвходового мультиплексора 12 поступит значение t i -3P с его четвертых информационных входов. If the control signal appears on all three control inputs of the four-input multiplexer 12, then the fourth key 19.4 will be open. The control signal from the third control input will open the fourth key 19.4 and through the third inverter 15.3 in the form of a logical zero will go to the third inputs of the elements 16 and 17 And, as well as to the second input of the element And 18, prohibiting the passage of control signals from their first inputs to their outputs. As a result, the first 19.1, the second 19.2 and the third 19.3 keys will be closed and the output of the four-input multiplexer 12 will receive the value t i -3 P from its fourth information inputs.

Если управляющий сигнал появляется на первом и втором управляющих входах четырехвходового мультиплексора 12, то аналогичным образом окажется открытым только третий 19.3, а первый 19.1, второй 19.2 и четвертый ключи 19.4 окажутся закрытыми. В результате на выход четырехвходового мультиплексора 12 поступит значение t i -2P с его третьих информационных входов. If the control signal appears on the first and second control inputs of the four-input multiplexer 12, then in the same way only the third 19.3 will be open, and the first 19.1, the second 19.2 and the fourth keys 19.4 will be closed. As a result, the output of the four-input multiplexer 12 will receive the value t i -2 P from its third information inputs.

Если управляющий сигнал появляется только на первом управляющем входе четырехвходового мультиплексора 12, то аналогичным образом окажется открытым только второй ключ 19.2, а первый 19.1, третий 19.3 и четвертый 19.4 ключи окажутся закрытыми. В результате на выход четырехвходового мультиплексора 12 поступит значение t i -P с его вторых информационных входов.If the control signal appears only on the first control input of the four-input multiplexer 12, then in the same way only the second key 19.2 will be open, and the first 19.1, third 19.3 and fourth 19.4 keys will be closed. As a result, the output of the four-input multiplexer 12 will receive the value t i - P from its second information inputs.

Если же на управляющих входах четырехвходового мультиплексора 12 будут только нулевые сигналы, то они, поступая через инверторы 15.1-15.3 и первый элемент И 16, откроют первый ключ 19.1 и на выход четырехвходового мультиплексора 12 поступит значение t i с его первых информационных входов.If there are only zero signals at the control inputs of the four-input multiplexer 12, then they, coming through the inverters 15.1-15.3 and the first element And 16, open the first key 19.1 and the output of the four-input multiplexer 12 will receive the value t i from its first information inputs.

Значения с выходов ключей 19.1-19.4 поступают через блок элементов ИЛИ 20 на первые информационные выходы четырехвходового мультиплексора 12. The values from the outputs of the keys 19.1-19.4 are fed through the block of elements OR 20 to the first information outputs of the four-input multiplexer 12.

В результате на первом информационном выходе четырехвходового мультиплексора 12 всегда образуется значение (22 t i -1+(a n -2 i -1 ·2+a n -2 i )) mod P.As a result, the value (2 2 t i -1 +( a n -2 i -1 · 2+ a n -2 i )) mod P is always formed at the first information output of the four-input multiplexer 12 .

Разряды неполного частного Q формируются на втором и третьем информационных выходах четырехвходового мультиплексора 12 с помощью первого 21.1 и второго 21.2 элементов ИЛИ в соответствии с логикой таблиц 1 и 2.The digits of the partial partial Q are formed on the second and third information outputs of the four-input multiplexer 12 using the first 21.1 and second 21.2 OR elements in accordance with the logic of tables 1 and 2.

Технико-экономическая эффективность изобретения заключается в увеличении быстродействия формирования остатка от числа по модулю и неполного частного. Так устройство прототип осуществляет вычисление остатка от n – разрядного числа по произвольному n – разрядному модулю за n тактов работы. Изобретение аналогичное вычисление осуществляет за n/2 тактов работы за счет параллельной обработки четных и нечетных разрядов входного числа. При этом увеличение быстродействия произойдет в 2 раза.Technical and economic efficiency of the invention is to increase the speed of the formation of the remainder of the number modulo and partial quotient. So the prototype device calculates the remainder of the n - bit number for an arbitrary n - bit module for n cycles of work. The invention performs a similar calculation for n /2 cycles of work due to the parallel processing of even and odd digits of the input number. In this case, the speed increase will occur in 2 times.

Источники информацииInformation sources

1. Петренко В.И., Сидорчук А.В. Вычислительное устройство // Патент России №2348965. Опубл. 10.03.2009. Бюл. №7.1. Petrenko V.I., Sidorchuk A.V. Computing device // Patent of Russia No. 2348965. Published 03/10/2009. Bull. No. 7.

2. Петренко В.И., Чипига А.Ф. Устройство для формирования остатка по произвольному модулю от числа. Патент России №2012137. Опубл. 30.04.1994.2. Petrenko V.I., Chipiga A.F. A device for forming the remainder modulo an arbitrary number. Russian patent No. 2012137. Published 04/30/1994.

3. Петренко В.И. Вычислительное устройство // Патент России №2661797. Опубл. 19.07.2018. Бюл. № 20.3. Petrenko V.I. Computing device // Patent of Russia No. 2661797. Published 07/19/2018. Bull. No. 20.

Claims (1)

Вычислительное устройство, содержащее регистр кода числа, блок формирования частного и остатка, содержащий первый сумматор, регистр кода остатка, регистр кода неполного частного, входы кода числа, входы инверсного кода модуля, выходы кода остатка, выходы кода неполного частного, вход начала вычисления, вход подачи тактовых импульсов, причём входы кода числа соединены с информационными входами регистра кода числа, первые информационные входы блока формирования частного и остатка соединены со входами инверсного кода модуля, первые информационные выходы соединены с выходами кода остатка устройства, вторые информационные выходы соединены с выходами кода неполного частного устройства, первый управляющий вход соединён со входом подачи тактовых импульсов устройства, выходы регистра кода остатка соединены с первыми информационными выходами блока формирования частного и остатка, выходы регистра неполного частного соединены со вторыми информационными выходами блока формирования частного и остатка, вторые информационные входы первого сумматора соединены с первыми информационными входами блока формирования частного и остатка, на вход переноса подаётся сигнал логической единицы, первый управляющий вход регистра кода остатка соединён с первым управляющим входом блока формирования частного и остатка, отличающееся тем, что регистр кода числа выполнен в виде двух n/2 – разрядных регистров сдвига, в блок формирования частного и остатка введены два сумматора, четырехвходовый мультиплексор, а регистр кода остатка выполнен в виде двух n/2 – разрядных регистров сдвига, причём четырехвходовой мультиплексор содержит три инвертора, три элемента И, четыре ключа, блок элементов ИЛИ, два элемента ИЛИ, при этом чётные разряды входа кода числа устройства соединены с информационными входами первого n/2 – разрядного регистра сдвига, а нечётные разряды соединены с информационными входами второго n/2 – разрядного регистра сдвига, вход подачи тактовых импульсов устройства соединен с первыми управляющими входами первого и второго n/2 – разрядных регистров сдвига, вход начала вычисления устройства соединен со вторыми управляющими входами первого и второго n/2 – разрядных регистров сдвига и со вторым управляющим входом блока формирования частного и остатка, вторые и третьи информационные входы которого соединены соответственно со входами инверсного удвоенного кода модуля устройства и со входами инверсного утроенного кода модуля устройства, выход старшего разряда первого n/2 – разрядного регистра сдвига соединён с четвёртым информационным входом блока формирования частного и остатка, а выход старшего разряда второго n/2 – разрядного регистра сдвига соединён с пятым информационным входом блока формирования частного и остатка, вторые информационные входы второго и третьего сумматоров соединены соответственно со вторыми и третьими информационными входами блока формирования частного и остатка, выходы регистра кода остатка соединены с первым информационным выходом блока формирования частного и остатка и со сдвигом на два разряда в сторону старшего с первыми информационными входами четырехвходового мультиплексора и первого, второго и третьего сумматоров, информационные выходы которых соединены соответственно со вторыми, третьими и четвертыми информационными входами четырехвходового мультиплексора, а выходы переноса соединены соответственно с его первым, вторым и третьим управляющими входами, на входы переноса второго и третьего сумматоров подаётся сигнал логической единицы, первые два младших разряда первых информационных входов четырехвходового мультиплексора, первых информационных входов первого, второго и третьего сумматоров соединены с четвертым и пятым информационными входами блока формирования частного и остатка, первые информационные выходы четырехвходового мультиплексора соединены с информационными входами регистра кода остатка, второй и третий информационные выходы соединены с младшими разрядами информационных входов третьего и четвертого n/2 – разрядных регистров сдвига соответственно, первые управляющие входы которых соединены с первым управляющим входом блока формирования частного и остатка, а вторые управляющие входы соединены со вторым управляющим входом блока формирования частного и остатка и вторым управляющим входом регистра кода остатка, информационные выходы третьего n/2 – разрядного регистра сдвига соединены чётными разрядами вторых информационных выходов блока формирования частного и остатка, а информационные выходы четвертого n/2 – разрядного регистра сдвига соединены с нечётными разрядами его второго информационного выхода, первый управляющий вход четырехвходового мультиплексора соединён со входом первого инвертора и первым входом второго элемента И, второй управляющий вход соединён со входом второго инвертора и с первым входом третьего элемента И, третий управляющий вход соединён со входом третьего инвертора, с управляющим входом четвертого ключа и с первыми входами первого и второго элементов ИЛИ, выход первого инвертора соединён с первым входом первого элемента И, выход второго инвертора соединён со вторыми входами первого и второго элементов И, выход третьего инвертора соединен с третьими входами первого и второго элементов И и со вторым входом третьего элемента И, выход первого элемента И соединен с управляющим входом первого ключа, выход второго элемента И соединён с управляющим входом второго ключа и со вторым входом первого элемента ИЛИ, выход третьего элемента И соединен с управляющим входом третьего ключа и со вторым входом второго элемента ИЛИ, информационные входы первого, второго, третьего и четвертого ключей соединены с первым, вторым, третьим и четвертым информационными входами четырехвходового мультиплексора соответственно, а выходы соединены с первыми, вторыми, третьими и четвертыми входами соответственно блока элементов ИЛИ, выходы которого соединены с первыми информационными выходами четырехвходового мультиплексора, выход первого элемента ИЛИ соединен со вторым информационным выходом четырехвходового мультиплексора, а выход второго элемента ИЛИ соединён с его третьим информационным выходом.A computing device containing a number code register, a quotient and remainder generating unit, containing a first adder, a remainder code register, an incomplete quotient code register, number code inputs, module inverse code inputs, remainder code outputs, partial quotient code outputs, calculation start input, input supply of clock pulses, moreover, the number code inputs are connected to the information inputs of the number code register, the first information inputs of the quotient and remainder generation unit are connected to the module inverse code inputs, the first information outputs are connected to the device remainder code outputs, the second information outputs are connected to the partial quotient code outputs device, the first control input is connected to the clock input of the device, the outputs of the remainder code register are connected to the first information outputs of the quotient and remainder generation unit, the outputs of the partial quotient register are connected to the second information outputs of the quotient and remainder formation unit, the second information inputs of the first adder are connected to the first information inputs of the quotient and remainder formation block, a logical unit signal is applied to the transfer input, the first control input of the remainder code register is connected to the first control input of the quotient and remainder formation block, characterized in that the number code register is made in the form of two n / 2 - bit shift registers, two adders, a four-input multiplexer are introduced into the quotient and remainder formation unit, and the remainder code register is made in the form of two n / 2 - bit shift registers, and the four-input multiplexer contains three inverters, three AND elements, four keys, a block of OR elements, two OR elements, while the even bits of the device number code input are connected to the information inputs of the first n/2 bit shift register, and the odd bits are connected to the information inputs of the second n/2 bit shift register, the device clock input is connected to the first control inputs of the first and second n/2 - bit shift registers, the input of the beginning of the calculation of the device is connected to the second control inputs of the first and second n/2 - bit shift registers and to the second control input of the quotient and remainder formation unit, the second and third information inputs of which are connected respectively with the inputs of the inverse doubled code of the device module and with the inputs of the inverse tripled code of the device module, the output of the high order bit of the first n/2 bit shift register is connected to the fourth information input of the quotient and remainder formation unit, and the high bit output of the second n/2 bit shift register is connected to the fifth information input of the quotient and remainder generation unit, the second information inputs of the second and third adders are connected to the second and third information inputs of the quotient and remainder formation unit, respectively, the outputs of the remainder code register are connected to the first information output of the quotient and remainder formation unit and with a shift by two digits in the direction of the senior with the first information inputs of the four-input multiplexer and the first, second and third adders, the information outputs of which are connected respectively to the second, third and fourth information inputs of the four-input multiplexer, and the transfer outputs are connected respectively to its first, second and third control inputs, a logical one signal is applied to the transfer inputs of the second and third adders, the first two least significant bits of the first information inputs of the four-input multiplexer, the first information inputs of the first, second and third adders are connected to the fourth and fifth information inputs of the quotient and remainder formation unit, the first information outputs of the four-input multiplexer are connected with the information inputs of the remainder code register, the second and third information outputs are connected to the lower bits of the information inputs of the third and fourth n/2-bit shift registers, respectively, the first control inputs of which are connected to the first control input of the quotient and remainder formation unit, and the second control inputs are connected with the second control input of the quotient and remainder formation block and the second control input of the remainder code register, the information outputs of the third n / 2 - bit shift register are connected by even bits of the second information outputs of the quotient and remainder formation block, and the information outputs of the fourth n / 2 - bit shift register connected to the odd bits of its second information output, the first control input of the four-input multiplexer is connected to the input of the first inverter and the first input of the second AND element, the second control input is connected to the input of the second inverter and to the first input of the third AND element, the third control input is connected to the input of the third inverter , with the control input of the fourth key and with the first inputs of the first and second OR elements, the output of the first inverter is connected to the first input of the first AND element, the output of the second inverter is connected to the second inputs of the first and second AND elements, the output of the third inverter is connected to the third inputs of the first and second elements AND and with the second input of the third element AND, the output of the first element AND is connected to the control input of the first key, the output of the second element AND is connected to the control input of the second key and to the second input of the first element OR, the output of the third element AND is connected to the control input of the third key and with the second input of the second OR element, the information inputs of the first, second, third and fourth keys are connected to the first, second, third and fourth information inputs of the four-input multiplexer, respectively, and the outputs are connected to the first, second, third and fourth inputs, respectively, of the block of OR elements, the outputs which are connected to the first information outputs of the four-input multiplexer, the output of the first OR element is connected to the second information output of the four-input multiplexer, and the output of the second OR element is connected to its third information output.
RU2022131139A 2022-11-30 Computing device RU2796555C1 (en)

Publications (1)

Publication Number Publication Date
RU2796555C1 true RU2796555C1 (en) 2023-05-25

Family

ID=

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6807555B2 (en) * 1999-11-01 2004-10-19 Kabushiki Kaisha Toshiba Modular arithmetic apparatus and method having high-speed base conversion function
RU2348965C1 (en) * 2007-05-25 2009-03-10 Государственное образовательное учреждение высшего профессионального образования "Ставропольский государственный университет" Computing mechanism
CN103699358A (en) * 2013-12-05 2014-04-02 西安交通大学 Rapid modular square arithmetic circuit applicable to great number
RU2661797C1 (en) * 2017-06-13 2018-07-19 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing device
RU2739338C1 (en) * 2020-05-15 2020-12-23 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing device
RU2756408C1 (en) * 2020-07-29 2021-09-30 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6807555B2 (en) * 1999-11-01 2004-10-19 Kabushiki Kaisha Toshiba Modular arithmetic apparatus and method having high-speed base conversion function
RU2348965C1 (en) * 2007-05-25 2009-03-10 Государственное образовательное учреждение высшего профессионального образования "Ставропольский государственный университет" Computing mechanism
CN103699358A (en) * 2013-12-05 2014-04-02 西安交通大学 Rapid modular square arithmetic circuit applicable to great number
RU2661797C1 (en) * 2017-06-13 2018-07-19 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing device
RU2739338C1 (en) * 2020-05-15 2020-12-23 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing device
RU2756408C1 (en) * 2020-07-29 2021-09-30 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing apparatus

Similar Documents

Publication Publication Date Title
KR100267009B1 (en) Method and device for modular multiplication
EP0576262A2 (en) Apparatus for multiplying integers of many figures
US20030140077A1 (en) Logic circuits for performing modular multiplication and exponentiation
Hong et al. Cellular-array modular multiplier for fast RSA public-key cryptosystem based on modified Booth's algorithm
Gokhale et al. Design of Vedic-multiplier using area-efficient Carry Select Adder
EP2037357A2 (en) Montgomery modular multiplier and method thereof using carry save addition
Gokhale et al. Design of area and delay efficient Vedic multiplier using Carry Select Adder
Patronik et al. Design of Reverse Converters for the New RNS Moduli Set $\{2^{n}+ 1, 2^{n}-1, 2^{n}, 2^{n-1}+ 1\} $($ n $ odd)
Nayeem et al. Efficient reversible Montgomery multiplier and its application to hardware cryptography
RU2796555C1 (en) Computing device
Hong et al. Radix-4 modular multiplication and exponentiation algorithms for the RSA public-key cryptosystem
RU2717915C1 (en) Computing device
RU2696223C1 (en) Arithmetic logic unit for generating residual by arbitrary module from number
RU2299461C1 (en) Modulus multiplexer
Rouhifar et al. Fast overflow detection in moduli set {2n–1, 2n, 2n+ 1}
RU2348965C1 (en) Computing mechanism
RU2798746C1 (en) Computing device
RU2791440C1 (en) Pipeline generator of remainders by an arbitrary modulus
RU2804380C1 (en) Pipeline calculator
RU2661797C1 (en) Computing device
RU2739338C1 (en) Computing device
RU2756408C1 (en) Computing apparatus
RU2797163C1 (en) Pipeline calculator
RU2797164C1 (en) Pipeline module multiplier
Monfared et al. A new multiplicative inverse architecture in normal basis using novel concurrent serial squaring and multiplication