Nothing Special   »   [go: up one dir, main page]

RU2829089C1 - Modulus multiplier - Google Patents

Modulus multiplier Download PDF

Info

Publication number
RU2829089C1
RU2829089C1 RU2024115290A RU2024115290A RU2829089C1 RU 2829089 C1 RU2829089 C1 RU 2829089C1 RU 2024115290 A RU2024115290 A RU 2024115290A RU 2024115290 A RU2024115290 A RU 2024115290A RU 2829089 C1 RU2829089 C1 RU 2829089C1
Authority
RU
Russia
Prior art keywords
input
information
adders
outputs
inputs
Prior art date
Application number
RU2024115290A
Other languages
Russian (ru)
Inventor
Вячеслав Иванович Петренко
Мария Валерьевна Небесская
Original Assignee
федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Filing date
Publication date
Application filed by федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" filed Critical федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Application granted granted Critical
Publication of RU2829089C1 publication Critical patent/RU2829089C1/en

Links

Images

Abstract

FIELD: computer engineering.
SUBSTANCE: device comprises switches, adders, three-input adders, which contain single-bit full adders and (m+1)-bit adder, and five-input multiplexers; wherein when calculating the product of numbers modulo P by successively performing (n/2) operations, where n is the number of bits of the input number A, reduction of calculation results by an arbitrary modulus at each conversion stage is performed in one step, simultaneously with the operation of summation of intermediate calculations.
EFFECT: faster operation of the device.
1 cl, 2 dwg

Description

ОбластьRegion техники,techniques, кTo которойwhich относитсяrefers to изобретениеinvention

Изобретение относится к вычислительной технике и может быть использовано в цифровых вычислительных устройствах, в криптографических приложениях, а также в устройствах цифровой обработки сигналов и в системах управления.The invention relates to computing technology and can be used in digital computing devices, in cryptographic applications, as well as in digital signal processing devices and in control systems.

УровеньLevel техникиtechniques

Известен умножитель на два по модулю, содержащий сумматор и мультиплексор [1]. Устройство представляет собой решение в области умножения чисел на два по произвольному модулю. В его состав входят сумматор и мультиплексор, которые совместно обеспечивают повышенную эффективность и быстродействие процесса умножения. Недостатком данного устройства являются его ограниченные функциональные возможности, а именно отсутствие возможности умножения на число, отличное от двух.A multiplier by two modulo is known, containing an adder and a multiplexer [1]. The device is a solution in the field of multiplying numbers by two modulo an arbitrary number. It includes an adder and a multiplexer, which together provide increased efficiency and speed of the multiplication process. The disadvantage of this device is its limited functionality, namely the lack of the ability to multiply by a number other than two.

Известно устройство для умножения чисел по произвольному модулю, содержащее сумматоры, мультиплексоры, ключи, блоки сдвига, инвертор и сумматор по модулю [2]. Устройство является эффективным решением для умножения чисел по произвольному модулю. Это устройство предлагает расширенные функциональные возможности, которые могут быть применены в цифровых вычислительных устройствах и системах для формирования элементов конечных полей. Недостатком данного устройства является низкое быстродействие, так как умножение осуществляется за (n−1) последовательных шагов преобразования, где n – разрядность устройства.A device for multiplying numbers by an arbitrary modulus is known, containing adders, multiplexers, keys, shift units, an inverter and an adder by modulus [2]. The device is an effective solution for multiplying numbers by an arbitrary modulus. This device offers advanced functionality that can be used in digital computing devices and systems for forming elements of finite fields. The disadvantage of this device is low performance, since multiplication is performed in ( n − 1) successive conversion steps, where n is the capacity of the device.

Наиболее близким по технической сущности к заявляемому изобретению является умножитель по модулю, содержащий ключи, сумматоры, мультиплексоры [3], выбранный в качестве прототипа. Умножитель по модулю позволяет умножать два числа по произвольному модулю за n/2 этапов преобразования, образующих ступени преобразования, где n – разрядность устройства, одновременно обрабатывая два разряда множимого. Однако на каждой ступени преобразования приведение результатов вычисления по произвольному модулю выполняется за два шага, вначале выполняется операция суммирования промежуточных вычислений, а затем осуществляется приведение полученного значения по модулю, что снижает быстродействие устройства.The closest in technical essence to the claimed invention is a modulo multiplier containing keys, adders, multiplexers [3], selected as a prototype. A modulo multiplier allows multiplying two numbers by an arbitrary modulus in n /2 stages of conversion, forming conversion steps, where n is the bit depth of the device, simultaneously processing two digits of the multiplicand. However, at each conversion step, the reduction of the calculation results by an arbitrary modulus is performed in two steps, first the operation of summing the intermediate calculations is performed, and then the reduction of the obtained value by modulus is performed, which reduces the speed of the device.

Техническим результатом изобретения является повышение быстродействия.The technical result of the invention is increased performance.

РаскрытиеDisclosure сущностиentities изобретенияinventions

Для достижения технического результата в умножитель по модулю, содержащий входы кодов множимого, входы кодов множителя, выходы кодов произведения, n/2 ступеней преобразования, где n-разрядность устройства, причем первая ступень преобразования содержит n/2 узлов, а (2…n/2)-е ступени преобразования содержат по одному узлу, каждый узел преобразования первой ступени преобразования содержит первый и второй ключи, двухвходовый сумматор и трехвходовый мультиплексор, а узлы преобразования (2…n/2)-й ступеней преобразования содержат двухвходовые сумматоры и пятивходовые мультиплексоры, информационные входы всех ключей первой ступени преобразования соединены со входами кода множителя, управляющие входы соединены с соответствующими разрядами кода множимого, информационные выходы первых ключей каждого узла первой ступени преобразования соединены с первыми информационными входами соответствующих двухвходовых сумматоров со сдвигом на один разряд в сторону старших, информационные выходы вторых ключей каждого узла первой ступени преобразования соединены со вторыми информационными входами соответствующих двухвходовых сумматоров, информационные выходы двухвходовых сумматоров соединены с первыми информационными входами соответствующих трехвходовых мультиплексоров, информационные выходы трехвходового мультиплексора первого узла первой ступени преобразования соединены со сдвигом на два разряда в сторону старших с первыми информационными входами двухвходового сумматора второй ступени преобразования, информационные выходы трехвходовых мультиплексоров j-го узла первой ступени преобразования, где j=2…n/2, соединены со вторыми информационными входами двухвходовых сумматоров j-й ступени преобразования, информационные выходы двухвходовых сумматоров j-й ступени преобразования соединены с первыми информационными входами соответствующих пятивходовых мультиплексоров, информационные выходы пятивходовых мультиплексоров j-й ступени преобразования, где j=2,…, n/2−1 соединены со сдвигом на два разряда в сторону старших с первыми информационными входами двухвходовых сумматоров (j+1)-й ступени преобразования, а n/2-й ступени преобразования являются выходами кодов произведения дополнительно введены на первой ступени преобразования в каждый узел первый и второй трехвходовые сумматоры, а на (2…n/2)-й ступени преобразования введены первый, второй, третий и четвертый трехвходовые сумматоры, причем первые информационные входы первых и вторых трехвходовых сумматоров первой ступени преобразования соединены с информационными выходами первых ключей соответствующего узла со сдвигом на один разряд в сторону старших, вторые информационные входы соединены с информационными выходами вторых ключей соответствующего узла, на третьи информационные входы первых трехвходовых сумматоров подается инверсный код модуля, а на третьи информационные входы вторых трехвходовых сумматоров подается инверсный код удвоенного модуля, информационные выходы первых трехвходовых сумматоров соединены со вторыми информационными входами соответствующих трехвходовых мультиплексоров, информационные выходы вторых трехвходовых сумматоров соединены с третьими информационными входами соответствующих трехвходовых мультиплексоров, выходы переноса первых трехвходовых сумматоров соединены с первыми управляющими входами соответствующих трехвходовых мультиплексоров, выходы переноса вторых трехвходовых сумматоров соединены со вторыми управляющими входами соответствующих трехвходовых мультиплексоров, первые информационные входы первых, вторых, третьих и четвертых трехвходовых сумматоров второй ступени преобразования соединены со сдвигом на два разряда в сторону старших с информационными выходами трехвходового мультиплексора первого узла первой ступени преобразования, вторые информационные входы первого, второго, третьего и четвертого трехвходовых сумматоров j-й ступени преобразования, где j=2…n/2, соединены с информационными выходами трехвходового мультиплексора j-го узла первой ступени преобразования, на третьи информационные входы первых, вторых, третьих и четвертых трехвходовых сумматоров j-й ступени преобразования, подаются соответственно инверсные коды модуля, инверсные коды удвоенного модуля, инверсные коды утроенного модуля и инверсные коды учетверенного модуля, на входы переноса всех трехвходовых сумматоров подается сигнал логической единицы, причем каждый трехвходовый сумматор содержит m полных одноразрядных сумматоров и (m+1)-разрядный сумматор, (1…m)-й разряды информационных выходов которого являются информационными выходами трехвходового сумматора, а (m+1)-й разряд является выходом переноса трехвходового сумматора, первые информационные входы полных одноразрядных сумматоров соединены с соответствующими разрядами первых информационных входов трехвходового сумматора, вторые информационные входы соединены с соответствующими разрядами вторых информационных входов трехвходового сумматора, третьи информационные входы соединены с соответствующими разрядами третьих информационных входов трехвходового сумматора, информационные выходы (1…m)-го полных одноразрядных сумматоров соединены с (1…m)-м разрядами первых информационных входов (m+1)-разрядного сумматора, а выходы переноса соединены с (2…m+1)-м разрядами вторых информационных входов (m+1)-разрядного сумматора, первый разряд которых соединен со входом переноса трехвходового сумматора, на (m+1)-й разряд первых информационных входов (m+1)-разрядного сумматора подается сигнал логического нуля.In order to achieve the technical result in a modulo multiplier containing multiplicand code inputs, multiplier code inputs, product code outputs, n /2 conversion stages, where n is the device bit depth, and the first conversion stage contains n /2 nodes, and the (2… n /2)-th conversion stages contain one node each, each conversion node of the first conversion stage contains the first and second keys, a two-input adder and a three-input multiplexer, and the conversion nodes of the (2… n /2)-th conversion stages contain two-input adders and five-input multiplexers, the information inputs of all keys of the first conversion stage are connected to the multiplier code inputs, the control inputs are connected to the corresponding bits of the multiplicand code, the information outputs of the first keys of each node of the first conversion stage are connected to the first information inputs of the corresponding two-input adders with a shift of one bit toward the higher ones, the information outputs of the second keys of each node of the first conversion stage are connected to the second information inputs of the corresponding two-input adders, the information outputs of the two-input adders are connected to the first information inputs of the corresponding three-input multiplexers, the information outputs of the three-input multiplexer of the first node of the first conversion stage are connected with a shift of two bits toward higher digits to the first information inputs of the two-input adder of the second conversion stage, the information outputs of the three-input multiplexers of the j -th node of the first conversion stage, where j = 2… n /2, are connected to the second information inputs of the two-input adders of the j -th conversion stage, the information outputs of the two-input adders of the j -th conversion stage are connected to the first information inputs of the corresponding five-input multiplexers, the information outputs of the five-input multiplexers of the j -th conversion stage, where j = 2,…, n /2−1 are connected with a shift of two bits toward higher digits to the first information inputs of the two-input adders of the ( j +1)-th conversion stage, and n /2-th stage of the transformation are the outputs of the product codes additionally introduced at the first stage of the transformation into each node the first and second three-input adders, and at the (2… n /2)-th stage of the transformation the first, second, third and fourth three-input adders are introduced, wherein the first information inputs of the first and second three-input adders of the first stage of the transformation are connected to the information outputs of the first keys of the corresponding node with a shift of one bit towards the most significant, the second information inputs are connected to the information outputs of the second keys of the corresponding node, the inverse code of the modulus is fed to the third information inputs of the first three-input adders, and the inverse code of the doubled modulus is fed to the third information inputs of the second three-input adders, the information outputs of the first three-input adders are connected to the second information inputs of the corresponding three-input multiplexers, the information outputs of the second three-input adders are connected to the third information inputs of the corresponding three-input multiplexers, the carry outputs of the first three-input adders are connected to the first control inputs of the corresponding three-input multiplexers, the carry outputs of the second three-input adders are connected to the second control inputs of the corresponding three-input multiplexers, the first information inputs of the first, second, third and fourth three-input adders of the second conversion stage are connected with a shift of two bits toward the higher bits to the information outputs of the three-input multiplexer of the first node of the first conversion stage, the second information inputs of the first, second, third and fourth three-input adders of the j -th conversion stage, where j = 2… n /2, are connected to the information outputs of the three-input multiplexer of the j -th node of the first conversion stage, the third information inputs of the first, second, third and fourth three-input adders of the j -th conversion stage are fed, respectively, with the inverse codes of the modulus, the inverse codes of the doubled modulus, the inverse codes of the tripled modulus and the inverse codes of the quadrupled modulus, the carry inputs of all three-input adders are supplied with a logical one signal, wherein each three-input adder contains m full single-bit adders and an ( m +1)-bit adder, the (1… m )-th bits of the information outputs of which are the information outputs of the three-input adder, and the ( m +1)-th bit is the carry output of the three-input adder, the first information inputs of the full single-bit adders are connected to the corresponding bits of the first information inputs of the three-input adder, the second information inputs are connected to the corresponding bits of the second information inputs of the three-input adder, the third information inputs are connected to the corresponding bits of the third information inputs of the three-input adder, the information outputs of the (1… m )-th full single-bit adders are connected to the (1… m )-th bits of the first information inputs of the ( m +1)-bit adder, and the carry outputs are connected to the (2… m +1)-th bits of the second information inputs of the ( m +1)-bit adder, the first bit of which is connected to the carry input of the three-input adder, a logical zero signal is fed to the ( m +1)-th bit of the first information inputs of the ( m +1)-bit adder.

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

(A·B) ≡ R (mod P), (1) ( A B ) ≡ R (mod P ), (1)

где A – неотрицательное целое число, являющееся множимым; where A is a non-negative integer which is the multiplicand;

B – неотрицательное целое число, являющееся множителем, причем B<P; B is a non-negative integer that is a factor, where B<P ;

P – неотрицательное целое число, называемое модулем; P is a non-negative integer called the modulus;

R – неотрицательное целое число, являющееся остатком от произведения чисел A и B по модулю P, R <P. R is a non-negative integer that is the remainder of the product of numbers A and B modulo P , R <P .

При этом пустьIn this case, let

A = a n −1 ·2 n −1+a n −2 ·2 n −2+ a n −3 ·2 n −3+a n −4 ·2 n −4+ . . . +a 3 ·23+a 2 ·22+a 1 ·2+a 0, (2) A = a n −1 2 n −1 + a n −2 2 n −2 + a n −3 2 n −3 + a n −4 2 n −4 + . . . + a 3 2 3 + a 2 2 2 + a 1 2+ a 0 , (2)

B = b m −1 ·2 m −1+ . . . + b 1 ·2+b 0, (3) B = b m −1 · 2 m −1 + . . . + b 1 2+ b 0 , (3)

P = p m −1 ·2 m −1+ . . . +p 1 ·21+p 0, (4) P = p m −1 · 2 m −1 + . . . + p 1 2 1 + p 0 , (4)

R = r m −1 ·2 m −1+ . . . +r 1 ·21+r 0, (5) R = r m −1 · 2 m −1 + . . . + r 1 2 1 + r 0 , (5)

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

n – количество разрядов в представлении множимого, n – четное; n is the number of digits in the representation of the multiplicand, n is even;

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

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

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

m – количество разрядов в представлении множителя B, модуля P и остатка R. m is the number of digits in the representation of the multiplier B , the modulus P and the remainder R.

Представим произведение чисел A и B следующим образом:Let us represent the product of numbers A and B as follows:

A·B = (a n −1 ·2 n −1+a n −2 ·2 n −2+ a n −3 ·2 n −3+a n −4 ·2 n −4+ . . . +a 3 ·23+a 2 ·22+a 1 ·2+a 0B. (6) A · B = ( a n −1 · 2 n −1 + a n −2 · 2 n −2 + a n −3 · 2 n −3 + a n −4 · 2 n −4 + . . + a 3 2 3 + a 2 2 2 + a 1 2+ a 0 ) B. (6)

Перепишем выражение (6) следующим образом:Let us rewrite expression (6) as follows:

A·B = (a n −1 ·2 n −1·B +a n −2 ·2 n −2·B + a n −3 ·2 n −3·B +a n −4 ·2 n −4·B + ... A B = ( a n −1 2 n −1 B + a n −2 2 n −2 B + a n −3 2 n −3 B + a n −4 2 n −4 B +...

... +a 3 ·23·B +a 2 ·22·B +a 1 ·B +a 0·B), (7) ... + a 3 2 3 B + a 2 2 2 B + a 1 2 B + a 0 B ), (7)

Преобразуем выражение (7) в следующий вид, объединив по два соседних слагаемых:Let us transform expression (7) into the following form by combining two adjacent terms:

A·B = (a n −1 ·2 n −1·B +a n −2 ·2 n −2·B)+ (a n −3 ·2 n −3·B +a n −4 ·2 n −4·B)+ . . . A·B= (a n -1 ·2 n -1·B+a n -2 ·2 n -2·B)+ (a n -3 ·2 n -3·B+a n -4 ·2 n -4·B)+ . . .

. . . +(a 3 ·23·B +a 2 ·22·B)+(a 1 ·B +a 0·B), (8) . . . +( a 3 2 3 B + a 2 2 2 B )+( a 1 2 B + a 0 B ), (8)

Из каждой суммы в скобках в выражении (8) вынесем 2 i за скобки, где , принимает только четные значения:From each sum in brackets in expression (8), we take 2 i out of the brackets, where , takes only even values:

A·B = 2 n −2(a n −1 ·B +a n −2·B)+2 n −4(a n −3 ·B +a n −4·B)+ . . . A · B = 2 n −2 ( a n −1 · 2 · B + a n −2 · B )+2 n −4 ( a n −3 · 2 · B + a n −4 · B )+ . . .

. . . +22(a 3 ·B +a 2·B)+(a 1 ·B +a 0·B), (9) . . . +2 2 ( a 3 2 B + a 2 B )+( a 1 2 B + a 0 B ), (9)

В выражении (9) перед каждой из n/2 образовавшихся сумм вида
(a i +1 ·B+a i ·B), получаем множитель 2 i , где , принимает только четные значения.
In expression (9), before each of the n /2 resulting sums of the form
( a i +1 ·B + a i · B ), we obtain the factor 2 i , where , takes only even values.

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

A·B = 22(2 n −4(a n −1 ·B +a n −2·B)+ 2 n −6 (a n −3 ·B +a n −4·B)+ . . . A·B= 22(2 n -4(a n -1 ·B+a n -2·B)+ 2 n -6(a n -3 ·B+a n -4·B)+ . . .

. . . + (a 3 ·B +a 2·B))+(a 1 ·B +a 0·B), (10) . . . + ( a 3 2 B + a 2 B ))+( a 1 2 B + a 0 B ), (10)

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

A·B = 22(22…(22(a n -1 ·B +a n -2·B)+(a n -3 ·B +a n -4·B))+ . . . A · B = 2 2 (2 2 …(2 2 ( a n -1 ·B + a n -2 · B )+( a n -3 ·B + a n -4 · B ))+ .

. . . + (a 3 ·B +a 2·B))+(a 1 ·B +a 0·B), (11) . . . + ( a 3 2 B + a 2 B ))+( a 1 2 B + a 0 B ), (11)

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

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

A·B ≡ (22(22…(22(a n −1 ·B +a n −2·B)+(a n −3 ·B +a n −4·B))+ . . . A · B ≡ (2 2 (2 2 …(2 2 ( a n −1 ·B + a n −2 · B )+( a n −3 ·B + a n −4 · B )) + .

. . . + (a 3 ·B +a 2·B))+(a 1 ·B +a 0·B)) mod P. (12) . . . + ( a 3 2 B + a 2 B ))+( a 1 2 B + a 0 B )) mod P . (12)

Из теории чисел известно, что операция приведения по модулю инвариантна к сложению и умножению, т. е. величина остатка не зависит от того, вычислен ли он от суммы (произведения) или от каждого слагаемого (сомножителя), а затем соответствующие частичные остатки просуммированы (перемножены) и от результата вычислен остаток по модулю.From number theory it is known that the operation of modulo reduction 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), and then the corresponding partial remainders are summed (multiplied) and the remainder is calculated from the result modulo.

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

Вначале на первой ступени преобразования одновременно в (n/2) узлах вычисляют величины t 1 i , :At the first stage of the transformation, the values t 1 i are calculated simultaneously in ( n /2) nodes, :

t 11=(a n −1 ·B +a n −2·B) mod P, t 11 =( a n −1 · 2 · B + a n −2 · B ) mod P ,

t 12=(a n −3 ·B +a n −4·B) mod P, (13) t 12 =( a n −3 · 2 · B + a n −4 · B ) mod P , (13)

… , … ,

t 1( n /2)=(a 1 ·B +a 0·B) mod P. t 1( n /2) =( a 1 ·B + a 0 · B ) mod P .

На второй ступени преобразования вычисляют величину At the second stage of the transformation, the value is calculated

t 2=(22 t 11+t 12) mod P. (14) t 2 =(2 2 t 11 + t 12 ) mod P . (14)

Аналогичным образом производят вычисления на последующих ступенях преобразования.Calculations are performed in a similar manner at subsequent stages of transformation.

На последней (n/2)-й ступени преобразования вычисляют величинуAt the last ( n /2)-th stage of the transformation, the value is calculated

t n /2=(22 t n /2−1+t 1( n /2)) mod P, (15) t n /2 =(2 2 t n /2−1 + t 1( n /2) ) mod P , (15)

которая и является искомым произведением чисел A и B по модулю P.which is the desired product of numbers A and B modulo P.

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

По определению величина множителя B лежит в диапазоне 0≤ BP-1. Поэтому значение любой величины t 1 i в (13) до приведения ее по модулю находится в диапазоне от 0 до 3P-3.By definition, the value of the multiplier B lies in the range 0≤ BP -1. Therefore, the value of any quantity t 1 i in (13) before reducing it by modulus is in the range from 0 to 3 P -3.

Приведение по модулю величины t 1 i , осуществляется по следующим правилам:Modulo reduction of the quantity t 1 i , is carried out according to the following rules:

t 1 i (mod P)= t 1 i , если 0 ≤ t 1 i < P, (16) t 1 i (modP)=t 1 i , if 0 ≤t 1 i <P, (16)

t 1 i (mod P)= t 1 i P, если P t 1 i < 2P, t 1 i (modP)=t 1 i -P, If Pt 1 i < 2P,

t 1 i (mod P)= t 1 i − 2P, если 2P t 1 i ≤ (3− 3), t 1 i (modP)=t 1 i - 2P, if 2Pt 1 i ≤ (3P- 3),

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

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

tt 11 ii t 1 i P t 1 i -P t 1 i − 2P t 1 i - 2P 0 ≤ t 1 i < P 0 ≤ t 1 i < P 00 00 Pt 1 i < 2P Pt 1 i < 2 P 11 00 2P t 1 i < (3P- 3)2 Pt 1 i < (3 P - 3) 11 11

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

Операция приведения по модулю P на второй и последующих ступенях преобразования выполняется следующим образом. Значение величин t i , в (14), (15) до приведения по модулю находится в диапазоне от 0 до 5P-5. The operation of reduction modulo P at the second and subsequent stages of the transformation is performed as follows. The value of the quantities t i , in (14), (15) before the modulo reduction is in the range from 0 to 5 P -5.

Приведение по модулю P величины t i , осуществляется по следующим правиламModulo P reduction of the quantity t i , is carried out according to the following rules

t i (mod P)=t i , если 0 ≤ t i < P, (17) t i (mod P )= t i , if 0 ≤ t i < P , (17)

t i (mod P)=t i P, если Pt i < 2P, t i (modP)=t i -P, If Pt i < 2P,

t i (mod P)=t i − 2P, если 2P t i < 3P, t i (modP)=t i - 2P, if 2Pt i < 3P,

t i (mod P)=t i − 3P, если 3P t i < 4P, t i (modP)=t i - 3P, if 3Pt i < 4P,

t i (mod P)=t i − 4P, если 4P t i ≤ (5P−5). t i (modP)=t i - 4P, if 4Pt i ≤ (5P-5).

Условия попадания значения t i в один из указанных в (17) интервалов определяются значениями сигналов переноса на выходах переноса сумматоров, осуществляющих операцию вычитания (t i kP), где k=1, 2, 3, 4 в соответствии с таблицей 2.The conditions for the value t i to fall into one of the intervals specified in (17) are determined by the values of the carry signals at the carry outputs of the adders that perform the subtraction operation ( t i kP ), where k = 1, 2, 3, 4 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 t i − 4P t i − 4 P 0 ≤ t i < P 0 ≤ t i < P 00 00 00 00 Pt i < 2P Pt i < 2 P 11 00 00 00 2P t i < 3P 2 Pt i < 3 P 11 11 00 00 3P t i < 4P 3 Pt i < 4 P 11 11 11 00 4P t i ≤ (5P−5) 4Pt i ≤ (5 P −5) 11 11 11 11

Таким образом, если значение сигналов переноса равно «1» на выходах переноса всех четырех сумматоров, то t i (mod P)=t i − 4P, если значение сигналов переноса равно «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 equal to “1” at the carry outputs of all four adders, thent i (modP)=t i - 4P, if the value of the carry signals is equal to “1” at the carry outputs of the three adders, then
t i (modP)=t i - 3P, if the value of the carry signals is equal to “1” at the carry outputs of the two adders, thent i (modP)=t i - 2P, if the carry signal value is equal to “1” at the carry outputs of one adder, then
t i (modP)=t i -P. If the value of the carry signals is "0" at the carry outputs of all four adders, thent i (modP)=t i , i.e. the subtraction operation is not performed.

В устройстве прототипе на каждой ступени преобразования приведение результатов вычисления по произвольному модулю по выражениям (13)-(15) выполняется за два шага – вначале выполняется операция суммирования промежуточных вычислений, а затем осуществляется приведение полученного значения по модулю. В предлагаемом устройстве операция суммирования промежуточных вычислений и операция приведения по модулю выполняются одновременно.In the prototype device, at each stage of the transformation, the reduction of the calculation results by an arbitrary modulus according to expressions (13)-(15) is performed in two steps - first, the operation of summing up the intermediate calculations is performed, and then the reduction of the obtained value by modulus is performed. In the proposed device, the operation of summing up the intermediate calculations and the operation of reduction by modulus are performed simultaneously.

КраткоеBrief описаниеdescription чертежейdrawings

На фиг. 1 представлена схема умножителя по модулю.Fig. 1 shows the circuit diagram of a modulo multiplier.

Умножитель по модулю содержит входы кодов множимого 7, входы кодов множителя 6, выходы кодов произведения 8, n/2 ступеней преобразования, где n - разрядность кода множимого. Первая ступень преобразования содержит n/2 узлов включающих n ключей 1, n/2 сумматоров 2, n трехвходовых сумматоров 3 и n/2 трехвходовых мультиплексоров 4. Вторая и последующая ступени преобразования содержат каждая сумматор 2, четыре трехвходовых сумматора 3 и пятивходовый мультиплексор 5. Управляющие входы ключей 1 соединены с соответствующими разрядами входов кода множимого 7, а информационные входы соединены со входами кода множителя 6. Информационные выходы первого ключа 1 каждого узла первой ступени преобразования соединены со сдвигом на один разряд в сторону старших с первыми информационными входами сумматора 2, а также первого и второго трехвходовых сумматоров 3 этого же узла. Информационные выходы второго ключа 1 каждого узла первой ступени преобразования соединены со вторыми информационными входами сумматора 2 и первого и второго трехвходовых сумматоров 3. На третьи информационные входы первых трехвходовых сумматоров 3 подается инверсный код модуля, а на третьи информационные входы вторых трехвходовых сумматоров подается инверсный код удвоенного модуля. Информационные выходы сумматора 2 каждого узла первой ступени преобразования соединены с первыми информационными входами трехвходового мультиплексора 4. Информационные выходы первых трехвходовых сумматоров 3 соединены со вторыми информационными входами соответствующих трехвходовых мультиплексоров 4, информационные выходы вторых трехвходовых сумматоров 3 соединены с третьими информационными входами соответствующих трехвходовых мультиплексоров 4, выходы переноса первых трехвходовых сумматоров 3 соединены с первыми управляющими входами соответствующих трехвходовых мультиплексоров 4, выходы переноса вторых трехвходовых сумматоров 3 соединены со вторыми управляющими входами соответствующих трехвходовых мультиплексоров 4. Информационные выходы трехвходового мультиплексора 4 первого узла первой ступени преобразования соединены со сдвигом на два разряда в сторону старших с первыми информационными входами сумматора 2, первого, второго, третьего и четвертого трехвходовых сумматоров 3 второй ступени преобразования. Информационные выходы трехвходового мультиплексора 4 j-го узла первой ступени преобразования, где j=2, ..., n/2, соединены со вторыми информационными входами сумматора 2, первого, второго, третьего и четвертого трехвходовых сумматоров 3 j-й ступени преобразования. На третьи информационные входы первого, второго, третьего и четвертого трехвходовых сумматоров 3 j-й ступени преобразования, подаются соответственно инверсные коды модуля, инверсные коды удвоенного модуля, инверсные коды утроенного модуля и инверсные коды учетверенного модуля. На входы переноса трехвходовых сумматоров 3 всех ступеней преобразования подается сигнал логической единицы. Информационные выходы сумматора 2, первого, второго, третьего и четвертого трехвходовых сумматоров 3 j-й ступени преобразования, соединены соответственно с первым, вторым, третьим, четвертым и пятым информационными входами пятивходового мультиплексора 5 этой же ступени преобразования, а выходы переносов первого, второго, третьего и четвертого трехвходовых сумматоров 3 соединены соответственно с первым, вторым, третьим и четвертым управляющими входами пятивходового мультиплексора 5. Информационные выходы пятивходового мультиплексора 5 j-й ступени преобразования, где j=2, …, n/2-1, соединены со сдвигом на два разряда в сторону старших с первыми информационными входами сумматора 2, первого, второго, третьего и четвертого трехвходовых сумматоров 3 (j+1)-й ступени преобразования. Информационные выходы пятивходового мультиплексора 5 n/2-й ступени преобразования соединены с выходами кодов произведения 8 устройства.The modulo multiplier contains inputs of the multiplicand code 7, inputs of the multiplier code 6, outputs of the product code 8, n /2 conversion stages, where n is the bit depth of the multiplicand code. The first conversion stage contains n /2 nodes including n switches 1, n /2 adders 2, n three-input adders 3 and n /2 three-input multiplexers 4. The second and subsequent conversion stages each contain an adder 2, four three-input adders 3 and a five-input multiplexer 5. The control inputs of switches 1 are connected to the corresponding bits of the inputs of the multiplicand code 7, and the information inputs are connected to the inputs of the multiplier code 6. The information outputs of the first switch 1 of each node of the first conversion stage are connected with a shift of one bit toward the higher ones with the first information inputs of adder 2, as well as the first and second three-input adders 3 of the same node. The information outputs of the second switch 1 of each node of the first stage of the transformation are connected to the second information inputs of the adder 2 and the first and second three-input adders 3. The inverse code of the module is fed to the third information inputs of the first three-input adders 3, and the inverse code of the doubled module is fed to the third information inputs of the second three-input adders. The information outputs of adder 2 of each node of the first stage of conversion are connected to the first information inputs of three-input multiplexer 4. The information outputs of the first three-input adders 3 are connected to the second information inputs of the corresponding three-input multiplexers 4, the information outputs of the second three-input adders 3 are connected to the third information inputs of the corresponding three-input multiplexers 4, the carry outputs of the first three-input adders 3 are connected to the first control inputs of the corresponding three-input multiplexers 4, the carry outputs of the second three-input adders 3 are connected to the second control inputs of the corresponding three-input multiplexers 4. The information outputs of three-input multiplexer 4 of the first node of the first stage of conversion are connected with a shift of two bits toward the higher ones with the first information inputs of adder 2, the first, second, third and fourth three-input adders 3 of the second stage of conversion. The information outputs of the three-input multiplexer 4 of the j -th node of the first stage of conversion, where j = 2, ..., n /2, are connected to the second information inputs of the adder 2, the first, second, third and fourth three-input adders 3 of the j -th stage of conversion. The inverse codes of the modulus, inverse codes of the doubled modulus, inverse codes of the tripled modulus and inverse codes of the quadrupled modulus are fed to the third information inputs of the first, second, third and fourth three-input adders 3 of the j -th stage of conversion, respectively. A logical one signal is fed to the carry inputs of the three-input adders 3 of all stages of conversion. The information outputs of adder 2, the first, second, third and fourth three-input adders 3 of the j -th conversion stage are connected, respectively, to the first, second, third, fourth and fifth information inputs of five-input multiplexer 5 of the same conversion stage, and the carry outputs of the first, second, third and fourth three-input adders 3 are connected, respectively, to the first, second, third and fourth control inputs of the five-input multiplexer 5. The information outputs of the five-input multiplexer 5 of the j -th conversion stage, where j = 2, …, n /2-1, are connected with a shift of two bits toward the higher ones to the first information inputs of adder 2, the first, second, third and fourth three-input adders 3 of the ( j +1)-th conversion stage. The information outputs of the five-input multiplexer 5 of the n /2-th conversion stage are connected to the outputs of the product codes 8 of the device.

На фиг. 2 представлена схема трехвходового сумматора.Fig. 2 shows the circuit diagram of a three-input adder.

Трехвходовый сумматор содержит m полных одноразрядных сумматоров 9.1÷9.m и (m+1)-разрядный сумматор 10, (1…m)-й разряды информационных выходов которого являются информационными выходами трехвходового сумматора 3, а (m+1)-й разряд является выходом переноса трехвходового сумматора 3. Первые, вторые и третьи информационные входы полных одноразрядных сумматоров 9.1÷9.m соединены с соответствующими разрядами первых, вторых и третьих информационных входов трехвходового сумматора 3. Информационные выходы полных одноразрядных сумматоров 9.1÷9.m соединены соответственно с (1…m)-м разрядами первых информационных входов (m+1)-разрядного сумматора 10, а выходы переноса соединены соответственно со (2…m+1)-м разрядами вторых информационных входов (m+1)-разрядного сумматора 10, первый разряд которых соединен со входом переноса трехвходового сумматора 3. На (m+1)-й разряд первых информационных входов (m+1)-разрядного сумматора 10 подается сигнал логического нуля. The three-input adder contains m full single-bit adders 9.1÷9. m and an ( m +1)-bit adder 10, the (1… m )-th bits of the information outputs of which are the information outputs of the three-input adder 3, and the ( m +1)-th bit is the carry output of the three-input adder 3. The first, second, and third information inputs of the full single-bit adders 9.1÷9. m are connected to the corresponding bits of the first, second, and third information inputs of the three-input adder 3. The information outputs of the full single-bit adders 9.1÷9. m are connected respectively to the (1… m )-th bits of the first information inputs of the ( m +1)-bit adder 10, and the carry outputs are connected respectively to the (2… m +1)-th bits of the second information inputs of the ( m +1)-bit adder 10, the first bit of which is connected to the carry input of the three-input adder 3. A logical zero signal is fed to the ( m +1)-th bit of the first information inputs of the ( m +1)-bit adder 10.

Осуществление изобретения. Implementation of the invention .

Умножитель по модулю работает следующим образом (см. Фиг. 1).The modulo multiplier operates as follows (see Fig. 1).

На вход 7 устройства подается n-разрядный двоичный код множимого A. На вход 6 устройства подается m-разрядный код множителя B. На третьи информационные входы первых и вторых трехвходовых сумматоров 3 первой ступени преобразования подается инверсный код модуля и соответственно инверсный код удвоенного модуля. На входы переноса первых и вторых трехвходовых сумматоров 3 всех узлов первой ступени преобразования подается логическая единица. На третьи информационные входы первых, вторых, третьих и четвертых трехвходовых сумматоров 3 второй и последующих ступеней преобразования подается соответственно инверсный код модуля, инверсный код удвоенного модуля, инверсный код утроенного модуля и инверсный код учетверенного модуля. Input 7 of the device is fedn-digit binary code of the multiplicandA. Input 6 of the device is fedm-digit code of the multiplierB. The inverse code of the module is fed to the third information inputs of the first and second three-input adders 3 of the first stage of conversion and, accordingly, inverse code of the doubled module. A logical one is fed to the carry inputs of the first and second three-input adders 3 of all nodes of the first stage of conversion. The inverse code of the module, the inverse code of the doubled module, the inverse code of the tripled module and the inverse code of the quadrupled module are fed to the third information inputs of the first, second, third and fourth three-input adders 3 of the second and subsequent stages of conversion, respectively.

Вначале на первой ступени преобразования одновременно в (n/2) узлах вычисляют величины t 1 i , , где i – номер узла:At the first stage of the transformation, the values t 1 i are calculated simultaneously in ( n /2) nodes, , where i is the node number:

t 11=(a n -1 ·B +a n -2·B) mod P, t 11 =( a n -1 · 2 · B + a n -2 · B ) mod P ,

t 12=(a n -3 ·B +a n -4·B) mod P, t 12 =( a n -3 · 2 · B + a n -4 · B ) mod P ,

… , … ,

t 1( n /2)=(a 1 ·B +a 0·B) mod P. t 1( n /2) =( a 1 ·B + a 0 · B ) mod P .

Умножение разрядов множимого a i на множитель B осуществляется с помощью ключей 1. Умножение множителя B на 2 осуществляется путем сдвига разрядов на один в сторону старших с информационных выходов первых ключей 1 каждого узла при подключении к первым информационным входам сумматоров 2, первым информационным входам первых и вторых трехвходовых сумматоров 3 соответствующего узла. Параллельно сумматор 2, первый и второй трехвходовые сумматоры 3 каждого узла первой ступени преобразования осуществляют суммирование значений a i ·B и a i - 1·B, а первый и второй трехвходовые сумматоры 3 еще приводят получившиеся суммы по модулю путем одновременного вычитания из нее значений P и 2P и трехвходового мультиплексора 4 соответствующего узла, осуществляющего коммутацию на выходы, поступивших на его информационные входы значений сигналов переноса, в соответствии с таблицей 1.Multiplication of the digits of the multiplicanda i by a factorBis carried out using keys 1. Multiplication of the multiplierBby 2 is carried out by shifting the digits by one towards the higher ones from the information outputs of the first keys 1 of each node when connecting to the first information inputs of adders 2, the first information inputs of the first and second three-input adders 3 of the corresponding node. In parallel, adder 2, the first and second three-input adders 3 of each node of the first stage of conversion perform summation of the valuesa i ·B And a i - 1·B, A the first and second three-input adders 3 also reduce the resulting sums to their absolute value by simultaneously subtracting the values from itPand 2Pand a three-input multiplexer 4 of the corresponding node, which switches the values of the transfer signals received at its information inputs to the outputs, in accordance with Table 1.

В результате на выходах всех узлов первой ступени преобразования образуются значения t 1 i , в соответствии с выражением (13).As a result, the values t 1 i are formed at the outputs of all nodes of the first stage of transformation, in accordance with expression (13).

На второй ступени преобразования осуществляется вычисление значения t 2=(22 t 11+t 12) mod P, где t 11 и t 12 значения на выходах первого и второго узла первой ступени преобразования. Умножение значения t 11 на 22 осуществляется сдвигом разрядов кода t 11 на два в сторону старшего. Приведение по модулю P осуществляется аналогичным образом путем одновременного вычитания из суммы значений модуля, удвоенного модуля, утроенного модуля и учетверенного модуля и выбором окончательного значения с помощью пятивходового мультиплексора 4 в зависимости от управляющих сигналов, подаваемых на его вход в соответствии с таблицей 2. Операция вычитания осуществляется с помощью соответствующих трехвходовых сумматоров 3 на третьи информационные входы которых подается в инверсном виде код соответствующих значений модуля, а на вход переноса подается сигнал логической единицы, преобразуя инверсный код в дополнительный.At the second stage of the conversion, the value t 2 = (2 2 t 11 + t 12 ) mod P is calculated, where t 11 and t 12 are the values at the outputs of the first and second nodes of the first stage of the conversion. The value t 11 is multiplied by 2 2 by shifting the digits of the code t 11 by two towards the higher digit. Modulo reduction P is performed in a similar manner by simultaneously subtracting the values of the modulus, doubled modulus, tripled modulus and quadrupled modulus from the sum and selecting the final value using a five-input multiplexer 4 depending on the control signals fed to its input in accordance with Table 2. The subtraction operation is performed using the corresponding three-input adders 3, to the third information inputs of which the code of the corresponding modulus values is fed in inverse form, and a logical one signal is fed to the carry input, converting the inverse code into an additional one.

Трехвходовый мультиплексор 4 в зависимости от комбинаций сигналов на его управляющих входах, коммутирует на свой выход сигнал с одного из своих трех информационных входов. Пятивходовый мультиплексор 5 в зависимости от комбинаций сигналов на его управляющих входах, коммутирует на свой выход один из своих пяти информационных входов в соответствии с таблицей 2. Three-input multiplexer 4, depending on the combination of signals at its control inputs, switches the signal from one of its three information inputs to its output. Five-input multiplexer 5, depending on the combination of signals at its control inputs, switches one of its five information inputs to its output in accordance with Table 2.

Трехвходовые сумматоры 3 (см. Фиг. 2) суммируют коды чисел, поступающие на их первые и вторые информационные входы и одновременно вычитают из этой суммы коды чисел, поступающие на их третьи информационные входы. Так как на входы переноса этих сумматоров подается сигнал логической единицы, а на третьи информационные входы поступают инверсные коды значений модуля (удвоенного модуля, утроенного модуля или учетверенного модуля), то в результате образуются соответствующие дополнительные коды, которые и приводят к реализации операции вычитания. На выходах каждого из m полных одноразрядных сумматоров 9.1÷9.m трехвходовых сумматоров 3 формируется сигнал частичной суммы и сигналы сквозного переноса трех чисел, поступающих на их входы. В результате на информационных выходах полных одноразрядных сумматоров 9.1÷9.m образуются поразрядные сигналы частичной суммы, а на выходах переноса образуются поразрядные сигналы сквозного переноса. Сигналы частичной суммы с информационных выходов полных одноразрядных сумматоров 9.1÷9.m поступают на (1, …, m)-й разряды первых информационных входов (m+1)-разрядного сумматора 10, на (m+1)-й разряд которого подается сигнал логического нуля. Сигналы с выходов переноса полных одноразрядных сумматоров 9.1÷9.m поступают на (2, …, (m+1))-й разряды вторых информационных входов (m+1)-разрядного сумматора 10, на первый разряд которого поступает сигнал логической единицы, преобразуя инверсный код модуля в дополнительный. В результате на (1, …, m)-ом разрядах информационных выходов (m+1)-разрядного сумматора 10 образуется значение суммы в соответствии с (13), (14) или (15), причем значение формируемое на (m+1)-м разряде информационных выходов (m+1)-разрядного сумматора 10 является сигналом переноса.Three-input adders 3 (see Fig. 2) sum the codes of numbers arriving at their first and second information inputs and simultaneously subtract from this sum the codes of numbers arriving at their third information inputs. Since a logical one signal is fed to the carry inputs of these adders, and inverse codes of the modulus values (doubled modulus, tripled modulus or quadrupled modulus) are fed to the third information inputs, the corresponding additional codes are formed as a result, which lead to the implementation of the subtraction operation. At the outputs of each of the m full single-bit adders 9.1÷9. m three-input adders 3, a partial sum signal and end-to-end carry signals of three numbers arriving at their inputs are formed. As a result, bit-by-bit partial sum signals are formed at the information outputs of the full single-bit adders 9.1÷9. m , and bit-by-bit end-to-end carry signals are formed at the carry outputs. The partial sum signals from the information outputs of the full single-bit adders 9.1÷9. m are fed to the (1, …, m )-th bits of the first information inputs of the ( m + 1)-bit adder 10, to the ( m +1)-th bit of which the logical zero signal is fed. The signals from the carry outputs of the full single-bit adders 9.1÷9. m are fed to the (2, …, ( m +1))-th bits of the second information inputs of the ( m +1)-bit adder 10, to the first bit of which the logical one signal is fed, converting the inverse code of the module into an additional one. As a result, at the (1, …, m )-th bits of the information outputs of the ( m +1)-bit adder 10, the sum value is formed in accordance with (13), (14) or (15), and the value formed at the ( m +1)-th bit of the information outputs of the ( m +1)-bit adder 10 is the carry signal.

Аналогичные вычисления производятся и на последующих ступенях преобразования. В результате этих вычислений на выходе последней (n/2)-й ступени преобразования образуется значение произведения чисел A и B по модулю P.Similar calculations are performed at subsequent stages of the transformation. As a result of these calculations, the output of the last ( n /2)-th stage of the transformation yields the value of the product of the numbers A and B modulo P .

Так как на каждой ступени преобразования осуществляется обработка одновременно двух разрядов множимого, то через (n/2) шагов преобразований на выходе кода произведения 8 устройства сформируется двоичный код произведения чисел A и B по модулю P. При этом приведение результатов вычисления по произвольному модулю на каждой ступени преобразования выполняется за один шаг, одновременно с операцией суммирования промежуточных вычислений, что повышает быстродействие устройства.Since at each stage of the conversion two digits of the multiplicand are processed simultaneously, then after ( n /2) steps of conversion at the output of the product code 8 of the device a binary code of the product of numbers A and B modulo P will be formed. In this case, the reduction of the calculation results to an arbitrary modulus at each stage of the conversion is performed in one step, simultaneously with the operation of summing the intermediate calculations, which increases the speed of the device.

Источники информацииSources of information

1. Умножитель на два по модулю. Патент РФ №2015537, МПК G06F 7/49 (1990.01), опубл. 30.06.1994.1. Multiplier by two modulo. Russian Federation Patent No. 2015537, IPC G06F 7/49 (1990.01), published 30.06.1994.

2. Устройство для умножения чисел по произвольному модулю. Патент РФ №2316042, МПК G06F 7/523 (2006.01), G06F 7/72 (2006.01), опубл. 27.01.2008. Бюл. № 3.2. Device for multiplying numbers by an arbitrary modulus. Russian Federation Patent No. 2316042, IPC G06F 7/523 (2006.01), G06F 7/72 (2006.01), published 27.01.2008. Bulletin No. 3.

3. Умножитель по модулю. Патент РФ №2751802, МПК G06F 7/72 (2006.01), G06F 7/523 (2006.01), опубл. 19.07.2021. Бюл. № 20.3. Modulo multiplier. Russian Federation Patent No. 2751802, IPC G06F 7/72 (2006.01), G06F 7/523 (2006.01), published 19.07.2021. Bulletin No. 20.

Claims (1)

Умножитель по модулю, содержащий входы кодов множимого, входы кодов множителя, выходы кодов произведения, n/2 ступеней преобразования, где n - разрядность устройства, причем первая ступень преобразования содержит n/2 узлов, а (2…n/2)-е ступени преобразования содержат по одному узлу, каждый узел преобразования первой ступени преобразования содержит первый и второй ключи, двухвходовый сумматор и трехвходовый мультиплексор, а узлы преобразования (2…n/2)-й ступеней преобразования содержат двухвходовые сумматоры и пятивходовые мультиплексоры, информационные входы всех ключей первой ступени преобразования соединены со входами кода множителя, управляющие входы соединены с соответствующими разрядами кода множимого, информационные выходы первых ключей каждого узла первой ступени преобразования соединены с первыми информационными входами соответствующих двухвходовых сумматоров со сдвигом на один разряд в сторону старших, информационные выходы вторых ключей каждого узла первой ступени преобразования соединены со вторыми информационными входами соответствующих двухвходовых сумматоров, информационные выходы двухвходовых сумматоров соединены с первыми информационными входами соответствующих трехвходовых мультиплексоров, информационные выходы трехвходового мультиплексора первого узла первой ступени преобразования соединены со сдвигом на два разряда в сторону старших с первыми информационными входами двухвходового сумматора второй ступени преобразования, информационные выходы трехвходовых мультиплексоров j-го узла первой ступени преобразования, где j=2…n/2, соединены со вторыми информационными входами двухвходовых сумматоров j-й ступени преобразования, информационные выходы двухвходовых сумматоров j-й ступени преобразования соединены с первыми информационными входами соответствующих пятивходовых мультиплексоров, информационные выходы пятивходовых мультиплексоров j-й ступени преобразования, где j=2,…, n/2−1, соединены со сдвигом на два разряда в сторону старших с первыми информационными входами двухвходовых сумматоров (j+1)-й ступени преобразования, а n/2-й ступени преобразования являются выходами кодов произведения, отличающийся тем, что в него введены на первой ступени преобразования в каждый узел первый и второй трехвходовые сумматоры, а на (2…n/2)-й ступени преобразования введены первый, второй, третий и четвертый трехвходовые сумматоры, причем первые информационные входы первых и вторых трехвходовых сумматоров первой ступени преобразования соединены с информационными выходами первых ключей соответствующего узла со сдвигом на один разряд в сторону старших, вторые информационные входы соединены с информационными выходами вторых ключей соответствующего узла, на третьи информационные входы первых трехвходовых сумматоров подается инверсный код модуля, а на третьи информационные входы вторых трехвходовых сумматоров подается инверсный код удвоенного модуля, информационные выходы первых трехвходовых сумматоров соединены со вторыми информационными входами соответствующих трехвходовых мультиплексоров, информационные выходы вторых трехвходовых сумматоров соединены с третьими информационными входами соответствующих трехвходовых мультиплексоров, выходы переноса первых трехвходовых сумматоров соединены с первыми управляющими входами соответствующих трехвходовых мультиплексоров, выходы переноса вторых трехвходовых сумматоров соединены со вторыми управляющими входами соответствующих трехвходовых мультиплексоров, первые информационные входы первых, вторых, третьих и четвертых трехвходовых сумматоров второй ступени преобразования соединены со сдвигом на два разряда в сторону старших с информационными выходами трехвходового мультиплексора первого узла первой ступени преобразования, вторые информационные входы первого, второго, третьего и четвертого трехвходовых сумматоров j-й ступени преобразования, где j=2…n/2, соединены с информационными выходами трехвходового мультиплексора j-го узла первой ступени преобразования, на третьи информационные входы первых, вторых, третьих и четвертых трехвходовых сумматоров j-й ступени преобразования подаются соответственно инверсные коды модуля, инверсные коды удвоенного модуля, инверсные коды утроенного модуля и инверсные коды учетверенного модуля, на входы переноса всех трехвходовых сумматоров подается сигнал логической единицы, причем каждый трехвходовый сумматор содержит m полных одноразрядных сумматоров и (m+1)-разрядный сумматор, (1…m)-й разряды информационных выходов которого являются информационными выходами трехвходового сумматора, а (m+1)-й разряд является выходом переноса трехвходового сумматора, первые информационные входы полных одноразрядных сумматоров соединены с соответствующими разрядами первых информационных входов трехвходового сумматора, вторые информационные входы соединены с соответствующими разрядами вторых информационных входов трехвходового сумматора, третьи информационные входы соединены с соответствующими разрядами третьих информационных входов трехвходового сумматора, информационные выходы (1…m)-го полных одноразрядных сумматоров соединены с (1…m)-м разрядами первых информационных входов (m+1)-разрядного сумматора, а выходы переноса соединены с (2…m+1)-м разрядами вторых информационных входов (m+1)-разрядного сумматора, первый разряд которых соединен со входом переноса трехвходового сумматора, на (m+1)-й разряд первых информационных входов (m+1)-разрядного сумматора подается сигнал логического нуля.A modulo multiplier containing multiplicand code inputs, multiplier code inputs, product code outputs, n /2 conversion stages, where n is the device capacity, the first conversion stage containing n /2 nodes, and the (2… n /2)th conversion stages containing one node each, each conversion node of the first conversion stage containing the first and second switches, a two-input adder and a three-input multiplexer, and the conversion nodes of the (2… n /2)th conversion stages containing two-input adders and five-input multiplexers, the information inputs of all switches of the first conversion stage are connected to the multiplier code inputs, the control inputs are connected to the corresponding bits of the multiplicand code, the information outputs of the first switches of each first conversion stage node are connected to the first information inputs of the corresponding two-input adders with a shift of one bit toward the higher ones, the information outputs of the second switches of each first conversion stage node are connected to the second information inputs of the corresponding two-input adders, the information outputs of the two-input adders are connected to the first information inputs of the corresponding three-input multiplexers, the information outputs of the three-input multiplexer of the first node of the first conversion stage are connected with a shift of two bits toward higher digits to the first information inputs of the two-input adder of the second conversion stage, the information outputs of the three-input multiplexers of the j -th node of the first conversion stage, where j = 2… n /2, are connected to the second information inputs of the two-input adders of the j -th conversion stage, the information outputs of the two-input adders of the j -th conversion stage are connected to the first information inputs of the corresponding five-input multiplexers, the information outputs of the five-input multiplexers of the j -th conversion stage, where j = 2,…, n /2−1, are connected with a shift of two bits toward higher digits to the first information inputs of the two-input adders of the ( j +1)-th conversion stage, and n /2-th stage of the transformation are outputs of the product codes, characterized in that the first and second three-input adders are introduced into it at the first stage of the transformation in each node, and the first, second, third and fourth three-input adders are introduced at the (2… n /2)-th stage of the transformation, wherein the first information inputs of the first and second three-input adders of the first stage of the transformation are connected to the information outputs of the first keys of the corresponding node with a shift of one bit towards the most significant ones, the second information inputs are connected to the information outputs of the second keys of the corresponding node, the inverse code of the modulus is fed to the third information inputs of the first three-input adders, and the inverse code of the doubled modulus is fed to the third information inputs of the second three-input adders, the information outputs of the first three-input adders are connected to the second information inputs of the corresponding three-input multiplexers, the information outputs of the second three-input adders are connected to the third information inputs of the corresponding three-input multiplexers, the outputs the carry outputs of the first three-input adders are connected to the first control inputs of the corresponding three-input multiplexers, the carry outputs of the second three-input adders are connected to the second control inputs of the corresponding three-input multiplexers, the first information inputs of the first, second, third and fourth three-input adders of the second conversion stage are connected with a shift of two bits toward the higher digits to the information outputs of the three-input multiplexer of the first node of the first conversion stage, the second information inputs of the first, second, third and fourth three-input adders of the j -th conversion stage, where j = 2… n /2, are connected to the information outputs of the three-input multiplexer of the j -th node of the first conversion stage, the inverse codes of the modulus, inverse codes of the doubled modulus, inverse codes of the tripled modulus and inverse codes of the quadrupled modulus are fed to the third information inputs of the first, second, third and fourth three-input adders of the j -th conversion stage, respectively. module, a logical one signal is applied to the carry inputs of all three-input adders, wherein each three-input adder contains m full single-bit adders and an ( m +1)-bit adder, the (1… m )-th bits of the information outputs of which are the information outputs of the three-input adder, and the ( m +1)-th bit is the carry output of the three-input adder, the first information inputs of the full single-bit adders are connected to the corresponding bits of the first information inputs of the three-input adder, the second information inputs are connected to the corresponding bits of the second information inputs of the three-input adder, the third information inputs are connected to the corresponding bits of the third information inputs of the three-input adder, the information outputs of the (1… m )-th full single-bit adders are connected to the (1… m )-th bits of the first information inputs of the ( m +1)-bit adder, and the carry outputs are connected to the (2… m +1)-th the bits of the second information inputs of the ( m +1)-bit adder, the first bit of which is connected to the carry input of the three-input adder, a logical zero signal is fed to the ( m +1)-bit of the first information inputs of the ( m +1)-bit adder.
RU2024115290A 2024-06-04 Modulus multiplier RU2829089C1 (en)

Publications (1)

Publication Number Publication Date
RU2829089C1 true RU2829089C1 (en) 2024-10-23

Family

ID=

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050033790A1 (en) * 2001-12-14 2005-02-10 Hubert Gerardus Tarcisius Maria Pipeline core in montgomery multiplier
RU2589361C1 (en) * 2015-03-10 2016-07-10 Федеральное государственное автономное образовательное учреждение высшего профессионального образования "Северо-Кавказский федеральный университет" Modulo multiplier
RU2652450C1 (en) * 2017-08-18 2018-04-26 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Device for calculation montgomery modular product
RU2653310C1 (en) * 2017-05-24 2018-05-07 федеральное государственное бюджетное образовательное учреждение высшего образования "Воронежский государственный университет" (ФГБОУ ВО "ВГУ") Device for multiplication of number by modulus on constant
RU2797164C1 (en) * 2023-03-22 2023-05-31 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Pipeline module multiplier

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050033790A1 (en) * 2001-12-14 2005-02-10 Hubert Gerardus Tarcisius Maria Pipeline core in montgomery multiplier
RU2589361C1 (en) * 2015-03-10 2016-07-10 Федеральное государственное автономное образовательное учреждение высшего профессионального образования "Северо-Кавказский федеральный университет" Modulo multiplier
RU2653310C1 (en) * 2017-05-24 2018-05-07 федеральное государственное бюджетное образовательное учреждение высшего образования "Воронежский государственный университет" (ФГБОУ ВО "ВГУ") Device for multiplication of number by modulus on constant
RU2652450C1 (en) * 2017-08-18 2018-04-26 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Device for calculation montgomery modular product
RU2797164C1 (en) * 2023-03-22 2023-05-31 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Pipeline module multiplier

Similar Documents

Publication Publication Date Title
Gokhale et al. Design of area and delay efficient Vedic multiplier using Carry Select Adder
Kalaiyarasi et al. Design of an efficient high speed radix-4 booth multiplier for both signed and unsigned numbers
CN111630509B (en) Arithmetic circuit for performing product-sum operation
Molahosseini et al. New arithmetic residue to binary converters
RU2717915C1 (en) Computing device
RU2829089C1 (en) Modulus multiplier
Patel et al. Efficient Tree Multiplier Design by using Modulo 2 n+ 1 Adder
Rouhifar et al. Fast overflow detection in moduli set {2n–1, 2n, 2n+ 1}
US11829731B2 (en) Modular multiplication circuit and corresponding modular multiplication method
Hiasat A Suggestion for a Fast Residue Multiplier for a Family of Moduli of the Form (2 n−(2 p±1))
US7461107B2 (en) Converter circuit for converting 1-redundant representation of an integer
RU2751802C1 (en) Modulo multiplier
RU2739338C1 (en) Computing device
RU2839987C1 (en) Numbers multiplier by arbitrary modulus
RU2756408C1 (en) Computing apparatus
RU2256226C2 (en) Neuron network for broadening tuple of numeric subtractions system
RU2626654C1 (en) Multiplier by module
RU2838847C1 (en) Conveyor multiplier by modules
RU2797164C1 (en) Pipeline module multiplier
Zhabin et al. Methods of on-line computation acceleration in systems with direct connection between units
RU2823911C1 (en) Pipeline adder-accumulator by arbitrary modules
Petryshyn et al. Foundations of the Fast Galois Field Arithmetic
Hemanandh et al. Design and Performance Investigation of Binary Signed Digit Adder
Zhang et al. Efficient and Flexible Differet-Radix Montgomery Modular Multiplication for Hardware Implementation
Kang et al. A novel systolic VLSI architecture for fast RSA modular multiplication