RU2797164C1 - Pipeline module multiplier - Google Patents

Pipeline module multiplier Download PDF

Info

Publication number
RU2797164C1
RU2797164C1 RU2023106826A RU2023106826A RU2797164C1 RU 2797164 C1 RU2797164 C1 RU 2797164C1 RU 2023106826 A RU2023106826 A RU 2023106826A RU 2023106826 A RU2023106826 A RU 2023106826A RU 2797164 C1 RU2797164 C1 RU 2797164C1
Authority
RU
Russia
Prior art keywords
information
modulo
information inputs
inputs
numbers
Prior art date
Application number
RU2023106826A
Other languages
Russian (ru)
Inventor
Вячеслав Иванович Петренко
Original Assignee
федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Filing date
Publication date
Application filed by федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" filed Critical федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Application granted granted Critical
Publication of RU2797164C1 publication Critical patent/RU2797164C1/en

Links

Images

Abstract

FIELD: computing technology.
SUBSTANCE: conveyor multiplier contains n parallel registers, n keys, (n−1) module multipliers by two, (n−1) module adders, where n is the capacity of the numbers being processed, with the corresponding links.
EFFECT: increasing speed of operations of multiplying numbers by an arbitrary module during conveyor processing of information.
1 cl, 2 dwg

Description

Область техники, к которой относится изобретениеThe field of technology to which the invention belongs

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

Уровень техникиState of the art

Из существующего уровня техники известен умножитель по модулю два, содержащий сумматор и мультиплексор, позволяющий выполнять умножение чисел на два по произвольным модулям [1]. Технической проблемой, которая не может быть решена при использовании данного технического решения, является невозможность умножения чисел по произвольным модулям на другие числа, не равные двум, так как для выполнения такой операции потребуются дополнительные технические средства. From the existing prior art known multiplier modulo two, containing an adder and a multiplexer that allows you to multiply numbers by two by arbitrary modules [1]. A technical problem that cannot be solved using this technical solution is the impossibility of multiplying numbers in arbitrary modules by other numbers that are not equal to two, since additional technical means will be required to perform such an operation.

Из существующего уровня техники известно устройство для умножения чисел по произвольному модулю, содержащее (m-1) сумматоров, (m-1) мультиплексоров, m ключей, (m-2) блоков сдвига, инвертор и сумматор по модулю, позволяющее выполнять умножение двух чисел по произвольному модулю [2]. Технической проблемой, которая не может быть решена при использовании данного технического решения, является низкое быстродействие при умножении чисел по произвольному модулю при конвейерной обработке информации, так как умножение очередных чисел по модулю в потоке не может быть начато до тех пор, пока не завершено умножение предыдущих чисел по модулю.From the existing prior art, a device is known for multiplying numbers modulo an arbitrary, containing ( m -1) adders, ( m -1) multiplexers, m keys, ( m -2) shift blocks, an inverter and a modulo adder, which allows multiplication of two numbers modulo [2]. A technical problem that cannot be solved using this technical solution is the low speed when multiplying numbers modulo an arbitrary number during pipeline processing of information, since the multiplication of successive numbers modulo in a stream cannot be started until the multiplication of the previous ones is completed. modulo numbers.

Наиболее близким к заявленному техническому решению по технической сущности и достигаемому техническому результату, выбранному в качестве прототипа, является умножитель по модулю, содержащий ключи, сумматоры, мультиплексоры, позволяющий выполнять приведение чисел по произвольным модулям [3]. Технической проблемой, которая не может быть решена при использовании данного технического решения при конвейерной обработке информации, является низкое быстродействие при умножении чисел по произвольному модулю, так как умножение очередных чисел по модулю в потоке не может быть начато до тех пор, пока не завершено умножение по модулю предыдущих чисел.The closest to the claimed technical solution in terms of technical essence and the achieved technical result, selected as a prototype, is a modulo multiplier containing keys, adders, multiplexers, which allows to perform reduction of numbers by arbitrary modules [3]. A technical problem that cannot be solved when using this technical solution for pipelined processing of information is the low speed when multiplying numbers modulo an arbitrary, since the multiplication of successive numbers modulo in the stream cannot be started until the multiplication modulo is completed. modulus of previous numbers.

Техническим результатом, обеспечиваемым приведенной совокупностью признаков, является повышение быстродействия операций умножения чисел по произвольному модулю при конвейерной обработке информации.The technical result provided by the above set of features is to increase the speed of operations of multiplying numbers by an arbitrary modulus during pipeline processing of information.

Раскрытие сущности изобретенияDisclosure of the essence of the invention

Указанный технический результат при осуществлении изобретения достигается тем, что в конвейерный вычислитель содержащий n ключей, где n разрядность обрабатываемых чисел, первые информационные входы устройства, вторые информационные входы устройства, третьи информационные входы устройства, информационные выходы устройства, на первые информационные входы устройства подаётся код множимого, на вторые информационные входы устройства подаётся код множителя, на третьи информационные входы устройства подаётся инверсный код модуля, с информационных выходов устройства снимается код произведения чисел по модулю, введены n параллельных регистров, (n−1) умножителей на два по модулю, (n−1) сумматоров по модулю, тактовый вход устройства, который соединен со входами подачи тактовых импульсов n параллельных регистров, первые информационные входы устройства соединены с (1, …, n)-ми разрядами информационных входов первого параллельного регистра, вторые информационные входы устройства соединены с (n+1, …, 2n)-ми разрядами информационных входов первого параллельного регистра, третьи информационные входы устройства соединены со вторыми входами умножителей на два по модулю и с третьими входами сумматоров по модулю, выход (n−1)-го сумматора по модулю соединён с информационными выходами устройства, первый разряд информационных выходов (1, …, n)-го параллельных регистров соединен соответственно с управляющим входом (1, …, n)-го ключей, (1, …, ni+1)-е разряды информационных входов i-х параллельных регистров, i=(2, …, n), соединены со (2, …, ni+2)-ми разрядами информационных выходов (i−1)-х параллельных регистров, (ni+2, …, 2ni+1)-е разряды соединены с информационными выходами (i-1)-х умножителей на два по модулю, (2n, …, 3n−1)-е разряды информационных входов второго параллельного регистра соединены с выходами первого ключа, а (2ni+2, …, 3ni+1)-е разряды информационных входов (3, …, n)-го параллельных регистров с выходами (1, …, n−2)-го сумматоров по модулю, (2, …, n+1)-й разряд информационных выходов n-го параллельного регистра соединен с информационными входами n-го ключа, (2n−i+2, …, 3n-i+1)-е разряды информационных выходов i-х параллельных регистров соединены с первыми информационными входами (i−1)-х сумматоров по модулю, вторые информационные входы которых соединены с информационными выходами i-х ключей, (n−i+2, …, 2n−i+1)-е разряды, i=(1, …, n), информационных выходов (1, …, n−1)-го параллельных регистров соединены соответственно с информационными входами (1, …, n−1)-го ключей и с первыми входами (1, …, n−1)-го умножителей на два по модулю.The specified technical result in the implementation of the invention is achieved by the fact that the pipeline calculator containing n keys, where n is the capacity of the processed numbers, the first information inputs of the device, the second information inputs of the device, the third information inputs of the device, the information outputs of the device, the code is fed to the first information inputs of the device multiplier, the second information inputs of the device are supplied with the multiplier code, the third information inputs of the device are supplied with the inverse code of the module, the code for the product of numbers modulo is removed from the information outputs of the device, n parallel registers are introduced, ( n − 1) multipliers by two modulo, ( n −1) modulo adders, the clock input of the device, which is connected to the clock inputs of n parallel registers, the first information inputs of the device are connected to (1, ..., n )-bits of the information inputs of the first parallel register, the second information inputs of the device are connected to ( n +1, …, 2 n )-bits of the information inputs of the first parallel register, the third information inputs of the device are connected to the second inputs of multipliers by two modulo and to the third inputs of modulo adders, the output of the ( n −1)-th adder modulo the module is connected to the information outputs of the device, the first bit of the information outputs of the (1, ..., n )-th parallel registers is connected respectively to the control input of the (1, ..., n )-th keys, (1, ..., ni +1) - e bits of information inputs of i -th parallel registers, i =(2, …, n ), are connected to (2, …, ni +2)-th bits of information outputs of ( i −1) -th parallel registers, ( ni +2, …, 2 ni +1)-th bits are connected to information outputs of ( i -1)-th multipliers by two modulo, (2 n , …, 3 n −1)-th bits of information inputs of the second parallel register are connected to the outputs of the first key, and (2 n - i +2, ..., 3 n - i + 1)-th bits of information inputs of the (3, ..., n )-th parallel registers with outputs (1, ..., n − 2)-th modulo adders, (2, …, n+ 1)-th bit of information outputs of the n -th parallel register is connected to information inputs of the n -th key, (2 n − i +2, …, 3 n-i + 1)th bits of the information outputs of the i -th parallel registers are connected to the first information inputs of the ( i −1)th modulo adders, the second information inputs of which are connected to the information outputs of the i -th keys, ( n−i +2, ..., 2 n−i +1)-th bits, i =(1, …, n ), information outputs of the (1, …, n − 1)th parallel registers are connected respectively to information inputs (1, …, n − 1) -th keys and with the first inputs of (1, …, n − 1)-th multipliers by two modulo.

Сущность изобретения заключается в реализации следующего способа умножения двух чисел по модулю. ПустьThe essence of the invention lies in the implementation of the following method of multiplying two numbers modulo. Let

Figure 00000001
Figure 00000001

где A и B – целые положительные числа, 0≤A, B<P, называемые соответственно множимым и множителем; where A and B are positive integers, 0≤ A , B < P , called the multiplier and multiplier respectively;

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

C – целое положительное число, являющееся произведением чисел A и B, приведенным по модулю P. C is a positive integer that is the product of A and B modulo 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 ;

b i ,

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

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 ;

c i ,

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

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

Задача состоит в том, чтобы по известным A и B отыскать произведение C по модулю P. Произведение чисел A и B по модулю P может быть представлено в следующем виде:The problem is to find the product of C modulo P given the known A and B. The product of numbers A and B modulo P can be represented as follows:

Figure 00000005
Figure 00000005

Учитывая, что операция приведения по модулю инвариантна к сложению и умножению, выражение (6) можно записать в виде:Given that the modulo reduction operation is invariant to addition and multiplication, expression (6) can be written as:

Figure 00000006
Figure 00000006

Выражение (7) может быть представлено как:Expression (7) can be represented as:

Figure 00000007
Figure 00000007

Введем следующее обозначение:Let us introduce the following notation:

Figure 00000008
Figure 00000008

Очевидно, чтоIt's obvious that

Figure 00000009
Figure 00000009

Тогда выражение (8) может быть записано в следующем виде:Then expression (8) can be written in the following form:

Figure 00000010
Figure 00000010

В результате вычисление выражения (11) в конвейерном режиме может быть сведено к следующим вычислительным действиям. As a result, the calculation of expression (11) in the pipeline mode can be reduced to the following computational steps.

На 1-й ступени конвейера вычисляют

Figure 00000011
и t 0:At the 1st stage of the pipeline, calculate
Figure 00000011
and t0 :

Figure 00000012
Figure 00000012

На 2-й ступени конвейера вычисляют

Figure 00000013
a 1
Figure 00000014
и t 1:At the 2nd stage of the pipeline, they calculate
Figure 00000013
a 1
Figure 00000014
and t1 :

Figure 00000015
Figure 00000015

На n-й ступени конвейера вычисляют значение

Figure 00000016
а также t n −1:At the nth stage of the pipeline, the value is calculated
Figure 00000016
and also t n −1 :

Figure 00000017
Figure 00000017

Значение t n -1 и будет являться искомым произведением (6).The value of t n -1 will be the desired product (6).

Вычисление

Figure 00000018
в соответствии с (9) осуществляется последовательным удвоением числа B с одновременным приведением результата по модулю P.calculation
Figure 00000018
in accordance with (9) is carried out by successive doubling of the number B with simultaneous reduction of the result modulo P .

Описанная выше процедура определяет вычисление произведения от одной пары чисел A и B.The procedure described above defines the calculation of the product of one pair of numbers A and B .

Рассмотрим реализацию вычисления произведений для потока чисел A j и B j , поступающего потактово на вход конвейерного умножителя, j=1, 2, 3, …, .Consider the implementation of the calculation of products for the stream of numbers A j and B j , coming cycle by cycle to the input of the conveyor multiplier, j =1, 2, 3, …, .

Выражение (1) при этом примет следующий видExpression (1) will then take the following form

Figure 00000019
Figure 00000019

Обозначим через t i , j значение i-го частичного произведения j-й пары чисел A j и B j по модулю P на i-й ступени конвейера, где i =1, 2, … , n – номер ступени конвейера, j=1, 2, 3, …,  – номер такта работы устройства. ТогдаDenote by t i , j the value of the i -th partial product of the j -th pair of numbers A j and B j modulo P on the i -th stage of the pipeline, where i =1, 2, … , n is the number of the pipeline stage, j =1 , 2, 3, …, is the number of the device operation cycle. Then

Figure 00000020
Figure 00000020

где a i -1, j – коэффициенты в выражении (2) для A j числа,where a i -1, j are coefficients in expression (2) for A j numbers,

Figure 00000021
Figure 00000021

Очевидно, чтоIt's obvious that

Figure 00000022
Figure 00000022

В результате вычисление выражения (11) в конвейерном режиме для пар чисел A j и B j по модулю P может быть сведено к следующим вычислительным действиям. As a result, the calculation of expression (11) in the pipeline mode for pairs of numbers A j and B j modulo P can be reduced to the following computational steps.

На первом такте работы устройства на 1-й ступени конвейера в соответствии с (19), (20) и (21) для пар чисел A 1 и B 1 вычисляют

Figure 00000023
и t 0,1:On the first stroke of the device at the 1st stage of the conveyor in accordance with (19), (20) and (21) for pairs of numbers A 1 and B 1 calculate
Figure 00000023
and t0.1 :

Figure 00000024
Figure 00000024

На втором такте работы устройства на 1-й ступени конвейера в соответствии с (19), (20) и (21) для пар чисел A 2 и B 2 вычисляют

Figure 00000025
и t 0,2:On the second cycle of operation of the device at the 1st stage of the conveyor in accordance with (19), (20) and (21) for pairs of numbers A 2 and B 2 calculate
Figure 00000025
and t0.2 :

Figure 00000026
Figure 00000026

На j-м такте работы устройства на 1-й ступени конвейера в соответствии с (19), (20) и (21) для пар чисел A j и B j вычисляют

Figure 00000027
и t 0, j :On the j -th cycle of the device at the 1st stage of the conveyor in accordance with (19), (20) and (21) for pairs of numbers A j and B j calculate
Figure 00000027
and t 0, j :

Figure 00000028
Figure 00000028

На втором такте работы устройства на 2-й ступени конвейера в соответствии с (18) и (19) для пар чисел A 1 и B 1 вычисляют

Figure 00000029
и t 1,1:On the second stroke of the device at the 2nd stage of the conveyor in accordance with (18) and (19) for pairs of numbers A 1 and B 1 calculate
Figure 00000029
and t 1,1 :

Figure 00000030
Figure 00000030

На третьем такте работы устройства на 2-й ступени конвейера в соответствии с (18) и (19) для пар чисел A 2 и B 2 вычисляют

Figure 00000031
и t 1,2:On the third stroke of the device at the 2nd stage of the conveyor in accordance with (18) and (19) for pairs of numbers A 2 and B 2 calculate
Figure 00000031
and t 1,2 :

Figure 00000032
Figure 00000032

На j-м такте работы устройства на 2-й ступени конвейера в соответствии с (18) и (19) для пар чисел A j и B j вычисляют

Figure 00000033
и t 1, j :On the j -th cycle of the device at the 2nd stage of the conveyor in accordance with (18) and (19) for pairs of numbers A j and B j calculate
Figure 00000033
and t 1, j :

Figure 00000034
Figure 00000034

На n-ом такте работы устройства на n-й ступени конвейера в соответствии с (18) для пар чисел A 1 и B 1 вычисляют

Figure 00000035
и t 1,1:Onnth cycle of the device onn-th stage of the pipeline in accordance with (18) for pairs of numbersA 1 AndB 1 calculate
Figure 00000035
Andt 1.1:

Figure 00000036
Figure 00000036

Значение t n 1,1 и будет являться искомым произведением C 1≡(A 1·B 1) mod P.The value t n 1,1 will be the desired product C 1 ≡( A 1 · B 1 ) mod P .

На (n+1)-ом такте работы устройства на n-й ступени конвейера в соответствии с (18) для пар чисел A 2 и B 2 вычисляют

Figure 00000037
и t 1,2:On (n+1)-th cycle of the device onn-th stage of the pipeline in accordance with (18) for pairs of numbersA 2 AndB 2 calculate
Figure 00000037
Andt 1.2:

Figure 00000038
Figure 00000038

Значение t   n 1,2 и будет являться искомым произведением C 2≡(A 2·B 2) mod P. t value   n 1,2 and will be the desired product C 2 ≡( A 2 · B 2 ) mod P .

На (n+j)-ом такте работы устройства на n-й ступени конвейера в соответствии с (18) для пар чисел A j и B j вычисляют

Figure 00000039
и t 1, j :On the ( n + j )-th cycle of the device at the n -th stage of the conveyor, in accordance with (18) for pairs of numbers A j and B j calculate
Figure 00000039
and t 1, j :

Figure 00000040
Figure 00000040

Значение t n 1,  j и будет являться искомым произведением C j ≡(A j ·B j ) mod P.The value t n 1, j will be the desired product C j ≡( A j B j ) mod P .

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

Сущность изобретения поясняется чертежами.The essence of the invention is illustrated by drawings.

На фиг. 1 представлена схема конвейерного умножителя по модулю. Конвейерный умножитель по модулю содержит n параллельных регистров 1.1 ÷ 1.n, n ключей 2.1 ÷ 2.n, (n−1) умножителей на два по модулю 3.1 ÷ 3.n–1, (n−1) сумматоров по модулю 4.1 ÷ 4.n–1, где n разрядность обрабатываемых чисел, первые информационные входы устройства 5, вторые информационные входы устройства 6, третьи информационные входы устройства 7, информационные выходы устройства 8, тактовый вход устройства 9. На первые информационные входы устройства 5 подаётся код множимого, на вторые информационные входы устройства 6 подаётся код множителя, на третьи информационные входы устройства 7 подаётся инверсный код модуля, с информационных выходов устройства 8 снимается код произведения чисел по модулю. Тактовый вход устройства 9 соединен со входами подачи тактовых импульсов n параллельных регистров 1.1 ÷ 1.n. Первые информационные входы устройства 5 соединены с (1, …, n)-ми разрядами информационных входов первого параллельного регистра 1.1, вторые информационные входы устройства 6 соединены с (n+1, …, 2n)-ми разрядами информационных входов первого параллельного регистра 1.1, третьи информационные входы устройства 7 соединены со вторыми входами умножителей на два по модулю и с третьими входами сумматоров по модулю 4.1 ÷ 4.n–1. Выход (n−1)-го сумматора по модулю 4.n–1 соединён с информационными выходами устройства 8. Первый разряд информационных выходов (1, …, n)-го параллельных регистров 1.1 ÷ 1.n соединен соответственно с управляющим входом (1, …, n)-го ключей 2.1 ÷ 2.n, (1, …, ni+1)-е разряды информационных входов i-го параллельного регистра 1.i, i=(2, …, n), соединены со (2, …, ni+2)-ми разрядами информационных выходов (i−1)-х параллельных регистров 1.i−1, (ni+2, …, 2ni+1)-е разряды соединены с информационными выходами (i−1)-х умножителей на два по модулю 3.i−1, (2n, …, 3n−1)-е разряды информационных входов второго параллельного регистра 1.2 соединены с выходами первого ключа 2.1, а (2ni+2, …, 3ni+1)-е разряды (3, …, n)-го параллельных регистров 1.3 ÷ 1.n с выходами (1, …, n−2)-го сумматоров по модулю 4.1 ÷ 4.n–2. (2, …, n+1)-й разряд информационных выходов n-го параллельного регистра 1.n соединен с информационными входами 2.n-го ключа, (2n−i+2, …, 3n-i+1)-е разряды информационных выходов i-х параллельных регистров 1.i соединены с первыми информационными входами (i−1)-х сумматоров по модулю 4.i−1, вторые информационные входы которых соединены с информационными выходами i-х ключей 2.i, (n−i+2, …, 2n−i+1)-е разряды, i=(1, …, n), информационных выходов (1.1, …, 1.n−1)-х параллельных регистров соединены соответственно с информационными входами (2.1, …, 2.n−1)-х ключей и с первыми входами (3.1, …, 3.n−1)-х умножителей на два по модулю.In FIG. 1 shows the scheme of the conveyor multiplier modulo. The pipeline multiplier modulo containsn parallel registers 1.1 ÷ 1.n,n keys 2.1 ÷ 2.n, (n−1) multipliers by two modulo 3.1 ÷ 3.n-1, (n−1) adders modulo 4.1 ÷ 4.n–1, wheren - word length of the processed numbers, the first information inputs of the device 5, the second information inputs of the device 6, the third information inputs of the device 7, the information outputs of the device 8, the clock input of the device 9. The multiplier code is fed to the first information inputs of the device 5, the multiplier code is fed to the second information inputs of the device 6, the inverse code of the module is fed to the third information inputs of the device 7, the modulo product code is removed from the information outputs of the device 8. The clock input of the device 9 is connected to the clock inputsn parallel registers 1.1 ÷ 1.n. The first information inputs of device 5 are connected to (1, ...,n)-bits of the information inputs of the first parallel register 1.1, the second information inputs of the device 6 are connected to (n+1, ..., 2n)-bits of the information inputs of the first parallel register 1.1, the third information inputs of the device 7 are connected to the second inputs of multipliers by two modulo and to the third inputs of adders modulo 4.1 ÷ 4.n-1. Exit (n−1)th adder modulo 4.n-1 is connected to the information outputs of the device 8. The first bit of the information outputs (1, ...,n)th parallel registers 1.1 ÷ 1.n connected respectively to the control input (1, ...,n)th keys 2.1 ÷ 2.n, (1, …,ni+1)th digits of information inputsith parallel register 1.i,i=(2, …,n), connected to (2, ...,ni+2) digits of information outputs (i−1)th parallel registers 1.i−1, (ni+2, ..., 2ni+1)th digits are connected to information outputs (i−1)-x multipliers by two modulo 3.i−1, (2n, …, 3n−1)-th digits of the information inputs of the second parallel register 1.2 are connected to the outputs of the first key 2.1, and (2ni+2, ..., 3ni+1)-th digits (3, ...,n)th parallel registers 1.3 ÷ 1.n with outputs (1, ...,n−2)th adders modulo 4.1 ÷ 4.n-2. (2, …,n+1)-th category of information outputsnth parallel register 1.n connected to information inputs 2.n-th key, (2n−i+2, ..., 3ni+1)th digits of information outputsi-x parallel registers 1.i connected to the first information inputs (i−1)-th adders modulo 4.i−1, the second information inputs of which are connected to the information outputsi-x keys 2.i, (n−i+2, ..., 2n−i+1)-th digits,i=(1, …,n), information outputs (1.1, ..., 1.n−1)th parallel registers are connected respectively to the information inputs (2.1, ..., 2.n−1)-th keys and with the first inputs (3.1, ..., 3.n−1)-th multipliers by two modulo.

На фиг. 2 представлено распределение разрядности параллельных регистров 1.1 ÷ 1.n устройства. Первый параллельный регистр 1.1 имеет разрядность 2n, равную сумме разрядности входных чисел A и B. В разряды с 1-го по n-й первого параллельного регистра 1.1 записываются числа A j , а в разряды с (n+1)-го по 2n-й записываются числа B j . Параллельные регистры 1.i, где i = (2, …, n) – номер ступени конвейера, имеют разрядность равную (3ni+1). В разряды с 1-го по (ni+1)-й i-го параллельного регистра 1.i записываются значения разрядов числа A, причем количество этих разрядов уменьшается на каждой последующей ступени конвейера на один со стороны младших, в разряды с (ni+2)-го по (2ni+1)-й записываются соответствующие значения разрядов чисел

Figure 00000041
а в разряды с (2ni+2)-го по (3ni+1)-й записываются значения разрядов чисел t i -2. In FIG. 2 shows the distribution of the capacity of parallel registers 1.1 ÷ 1. n devices. The first parallel register 1.1 has a capacity 2 n equal to the sum of the capacity of the input numbers A and B . Numbers A j are written into bits from 1st to nth of the first parallel register 1.1, and numbers Bj are written into bits from ( n +1)th to 2nth . Parallel registers 1. i , where i = (2, …, n ) is the number of the pipeline stage, have a capacity equal to (3 ni +1). The digits from the 1st to ( ni +1)-th i -th parallel register 1. i are filled with the values of the digits of the number A , and the number of these digits decreases at each subsequent stage of the pipeline by one from the lower ones, into digits with ( ni +2)-th to (2 ni +1)-th the corresponding values of the digits of numbers are written
Figure 00000041
and in the digits from (2 ni +2)-th to (3 ni +1)-th the values of the digits of numbers t i -2 are written.

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

Конвейерный вычислитель работает следующим образом (см. Фиг. 1).Pipeline calculator works as follows (see Fig. 1).

В исходном состоянии параллельные регистры 1.1 ÷ 1.n−1 обнулены. На тактовый вход 9 устройства поступают тактовые импульсы. На первые информационные входы 5 устройства и вторые информационные входы 6 устройства с каждым тактовым импульсом подаются числа A j и B j , для которых необходимо вычислить произведение C j по модулю P. На третьи информационные входы 7 устройства, в течение всего цикла формирования произведений, подаётся инверсный код модуля P. Произведение C j по модулю P чисел A j и B j снимается с информационных выходов 8 устройства.In the initial state, the parallel registers 1.1 ÷ 1. n −1 are set to zero. The clock input 9 of the device receives clock pulses. The first information inputs 5 of the device and the second information inputs 6 of the device with each clock pulse are supplied with the numbers A j and B j for which it is necessary to calculate the product C j modulo P . The inverse code of the module P is fed to the third information inputs 7 of the device during the entire cycle of creating works. The product C j modulo P numbers A j and B j is removed from the information outputs 8 of the device.

На первом такте работы устройства первые два числа A 1 и B 1 записываются в параллельный регистр 1.1. При этом значение младшего разряда a 0,1 первого числа A 1 с выходов параллельного регистра 1.1 поступает на управляющий вход первого ключа 2.1, а оставшиеся значения (a 1,1, …, a n −1,1) разрядов первого числа A 1 поступают на (1, …, n−1)-е разряды информационных входов второго параллельного регистра 1.2. На информационные входы первого ключа 2.1 и на первые информационные входы первого умножителя на два по модулю 3.1 с (n+1, …, 2n)-го разрядов информационных выходов первого параллельного регистра 1.1 поступает код первого числа B 1. В соответствии с (23) на выходе первого ключа 2.1 образуется произведение t 0,1 = a 0,1·B 1, а в соответствии с (22) на выходе первого умножителя на два по модулю 3.1 образуется число

Figure 00000042
mod P. Умножители на два по модулю 3.1 ÷ 3.n–1 могут быть реализованы в соответствии с [1].On the first cycle of the device, the first two numbers A 1 and B 1 are written to the parallel register 1.1. In this case, the value of the least significant digit a 0.1 of the first number A 1 from the outputs of the parallel register 1.1 is fed to the control input of the first key 2.1, and the remaining values ( a 1,1 , …, a n −1,1 ) of the digits of the first number A 1 are received to (1, …, n − 1)-th bits of the information inputs of the second parallel register 1.2. The information inputs of the first key 2.1 and the first information inputs of the first multiplier by two modulo 3.1 with ( n +1, ..., 2 n )-bits of the information outputs of the first parallel register 1.1 receives the code of the first number B 1 . In accordance with (23), at the output of the first key 2.1, the product t 0.1 = a 0.1 B 1 is formed, and in accordance with (22), at the output of the first multiplier by two modulo 3.1, the number
Figure 00000042
mod P . Multipliers by two modulo 3.1 ÷ 3. n –1 can be implemented in accordance with [1].

На втором такте работы устройства в (1, …, n−1)-е разряды информационных входов второго параллельного регистра 1.2 записываются значения (a 1,1, …, a n −1,1) разрядов первого числа A 1, в (n, …, 2n−1)-е разряды записывается значение числа

Figure 00000043
а в (2n, …, 3n−1)-е разряды записывается значение числа t 0,1. С выхода первого разряда второго параллельного регистра 1.2 значение (a 1,1)-го разряда первого числа A 1, поступает на управляющий вход второго ключа 2.2. Значения (a 2,1, …, a n −1,1) разрядов первого числа A 1 с (2, …, n−1)-х разрядов информационных выходов второго параллельного регистра 1.2 поступают на (1, …, n−2)-е разряды информационных входов третьего параллельного регистра 1.3. Значение числа
Figure 00000044
с (n, …, 2n−1)-х разрядов информационных выходов второго параллельного регистра 1.2 поступает на информационные входы второго ключа 2.2 и на первые информационные входы второго умножителя на два по модулю 3.2. Значение числа t 0,1 с (2n, …, 3n−1)-х разрядов информационных выходов второго параллельного регистра 1.2 поступает на первые информационные входы первого сумматора по модулю 4.1, на вторые информационные входы которого поступает значение
Figure 00000045
а на информационных выходах образуется значение числа t 1,1 в соответствии с (29), которое поступает на (2n−1, …, 3n)-е разряды информационных входов третьего параллельного регистра 1.3, на (n−1, …, 2n−2)-е разряды которых поступает значение числа
Figure 00000046
в соответствии с (28). Сумматоры по модулю 4.1 ÷ 4.n–1 могут быть реализованы согласно [4].On the second cycle of device operation, the (1, …, n −1)-th bits of the information inputs of the second parallel register 1.2 are filled with the values ( a 1,1 , …, a n −1,1 ) of the bits of the first number A 1 , in ( n , …, 2 n −1)-th digits the value of the number is written
Figure 00000043
and in (2 n , …, 3 n −1)-th digits the value of the number t 0.1 is written. From the output of the first digit of the second parallel register 1.2 value ( a 1,1 )-th digit of the first number A 1 is supplied to the control input of the second key 2.2. Values ( a 2,1 , …, a n −1,1 ) bits of the first number A 1 with (2, …, n −1)-th bits of the information outputs of the second parallel register 1.2 are sent to (1, …, n −2 )-th bits of information inputs of the third parallel register 1.3. Number value
Figure 00000044
with ( n , ..., 2 n −1)-th bits of the information outputs of the second parallel register 1.2 is supplied to the information inputs of the second key 2.2 and to the first information inputs of the second multiplier by two modulo 3.2. The value of the number t 0.1 s (2 n , ..., 3 n −1)-th bits of the information outputs of the second parallel register 1.2 is supplied to the first information inputs of the first adder modulo 4.1, the second information inputs of which receive the value
Figure 00000045
and the value of the number t 1.1 is formed at the information outputs in accordance with (29), which goes to (2 n −1, …, 3 n )-th bits of the information inputs of the third parallel register 1.3, to ( n −1, …, 2 n − 2)-th bits of which the value of the number comes
Figure 00000046
according to (28). Adders modulo 4.1 ÷ 4. n –1 can be implemented according to [4].

Также на втором такте устройства вторые два числа A 2 и B 2 записываются в параллельный регистр 1.1. При этом значение младшего разряда a 0,2 второго числа A 2 с выходов параллельного регистра 1.1 поступает на управляющий вход первого ключа 2.1, а оставшиеся значения (a 1,2, …, a n −1,2) разрядов второго числа A 2 поступают на (1, …, n−1)-е разряды информационных входов второго параллельного регистра 1.2. На информационные входы первого ключа 2.1 и на первые информационные входы первого умножителя на два по модулю 3.1 с (n+1, …, 2n)-го разрядов информационных выходов первого параллельного регистра 1.1 поступает код второго числа B 2. В соответствии с (25) на выходе первого ключа 2.1 образуется произведение t 0,2 = a 0,2·B 2, а в соответствии с (24) на выходе первого умножителя на два по модулю 3.1 образуется число

Figure 00000047
Also on the second cycle of the device, the second two numbers A 2 and B 2 are written to the parallel register 1.1. In this case, the value of the least significant bit a 0.2 of the second number A 2 from the outputs of the parallel register 1.1 is fed to the control input of the first key 2.1, and the remaining values ( a 1.2 , ..., a n −1.2 ) of the digits of the second number A 2 are received to (1, …, n − 1)-th bits of the information inputs of the second parallel register 1.2. The information inputs of the first key 2.1 and the first information inputs of the first multiplier by two modulo 3.1 with ( n +1, ..., 2 n )-bits of the information outputs of the first parallel register 1.1 receives the code of the second number B 2 . In accordance with (25), at the output of the first key 2.1, the product t 0.2 = a 0.2 B 2 is formed, and in accordance with (24), at the output of the first multiplier by two modulo 3.1, the number
Figure 00000047

На следующих тактах работа устройства осуществляется аналогичным образом.On the following cycles, the operation of the device is carried out in a similar way.

На n-ом такте работы устройства на информационных выходах 8 устройства в соответствии с (34) для пар чисел A 1 и B 1 будет получено значение t n 1,1, которое и будет являться искомым произведением

Figure 00000048
On the nth cycle of the device operation, at the information outputs 8 of the device, in accordance with (34), for pairs of numbers A 1 and B 1 , the value t n 1.1 will be obtained, which will be the desired product
Figure 00000048

На (n+1)-ом такте работы устройства на информационных выходах 8 устройства для пар чисел A 2 и B 2 в соответствии с (36) будет получено значение t n 1,2, которое будет являться искомым произведением

Figure 00000049
On the ( n +1)-th cycle of the device operation, at the information outputs 8 of the device for pairs of numbers A 2 and B 2 , in accordance with (36), the value t n 1.2 will be obtained, which will be the desired product
Figure 00000049

На (n+j)-м такте работы устройства на информационных выходах 8 устройства для пар чисел A j и B j в соответствии с (36) будет получено значение t n 1, j которое будет являться искомым произведением

Figure 00000050
On the ( n + j )th cycle of the device operation, at the information outputs 8 of the device for pairs of numbers A j and B j in accordance with (36) the value t n 1 will be obtained, j which will be the desired product
Figure 00000050

Изобретение позволяет в конвейерном режим осуществлять умножение по модулю чисел, поступающих на его вход.The invention allows in the pipeline mode to carry out modulo multiplication of the numbers coming to its input.

Сравним быстродействие вычисления произведений чисел устройства прототипа [3] и предлагаемого устройства при реализации операции вычисления произведений для 100 пар 16-разрядных чисел. Устройство прототип при его реализации для работы с 16-разрядными числами будет содержать 8 последовательных ступеней преобразования. Обозначим через Tпр – время вычисления на одной ступени преобразования. При условии, что вычисление следующего произведения чисел не может быть начато до тех пор, пока не будет выполнено текущее вычисление, время, затрачиваемое устройством прототипом на вычисления произведения 100 пар 16-разрядных чисел, составит 800 Tпр. Предлагаемое устройство для выполнения аналогичной задачи будет содержать 16 последовательных ступеней конвейера. Обозначим через Tиз – время обработки информации одной ступенью конвейера. Тогда общее время вычисления произведения 100 пар 16-разрядных чисел составит 132 Tиз. Полагая

Figure 00000051
(хотя фактически Tпр>Tиз), получим выигрыш B в быстродействии для указанных условий вычислений Let's compare the speed of calculating the products of numbers of the prototype device [3] and the proposed device when implementing the operation of calculating products for 100 pairs of 16-bit numbers. The prototype device, when implemented to work with 16-bit numbers, will contain 8 consecutive conversion steps. Denote by T pr - the time of calculation at one stage of the transformation. Provided that the calculation of the next product of numbers cannot be started until the current calculation is completed, the time taken by the prototype device to calculate the product of 100 pairs of 16-bit numbers will be 800 T pr . The proposed device for performing a similar task will contain 16 successive stages of the conveyor. Let us denote by T out the time of information processing by one stage of the conveyor. Then the total time for calculating the product of 100 pairs of 16-bit numbers will be 132 T of . Assuming
Figure 00000051
(although in fact T pr >T from ), we get a gain B in speed for the specified calculation conditions

Figure 00000052
Figure 00000052

Таким образом, при организации последовательных вычислений произведений 100 пар 16-разрядных чисел в конвейерном режиме выигрыш в быстродействии заявленного устройства по сравнению с устройством прототипом составит 6 раз. Очевидно, что при увеличении разрядности и увеличении количества чисел, выигрыш будет только возрастать.Thus, when organizing sequential calculations of the products of 100 pairs of 16-bit numbers in the pipeline mode, the speed gain of the claimed device compared to the prototype device will be 6 times. Obviously, with an increase in the bit depth and an increase in the number of numbers, the gain will only increase.

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

1. Патент на изобретение RU 2015537 C1. МПК G06F 7/49 (1990.01). Умножитель на два по модулю. Опубликован 30.06.1994. 1. Patent for invention RU 2015537 C1. IPC G06F 7/49 (1990.01). Multiplier by two modulo. Published 06/30/1994.

2. Патент на изобретение RU 2316042 C1. МПК G06F 7/523 (2006.01), G06F 7/72 (2006.01). Устройство для умножения чисел по произвольному модулю. Опубликован 27.01.2008. Бюл. № 3.2. Patent for invention RU 2316042 C1. IPC G06F 7/523 (2006.01), G06F 7/72 (2006.01). A device for multiplying numbers modulo arbitrary. Published on 01/27/2008. Bull. No. 3.

3. Патент на изобретение RU 2751802 C1. МПК G06F 7/72 (2006.01), G06F 7/523 (2006.01). Умножитель по модулю. Опубликован 19.07.2021 Бюл. № 20.3. Patent for invention RU 2751802 C1. IPC G06F 7/72 (2006.01), G06F 7/523 (2006.01). Modulo multiplier. Published on 19.07.2021 Bull. No. 20.

4. Патент на изобретение RU 2032934 C1. МПК G06F 7/49 (1995.01). Сумматор по модулю. Опубликован 10.04.1995. 4. Patent for invention RU 2032934 C1. IPC G06F 7/49 (1995.01). Modulo adder. Published 04/10/1995.

Claims (1)

Конвейерный умножитель по модулю, содержащий n ключей, где n разрядность обрабатываемых чисел, первые информационные входы устройства, вторые информационные входы устройства, третьи информационные входы устройства, информационные выходы устройства, на первые информационные входы устройства подаётся код множимого, на вторые информационные входы устройства подаётся код множителя, на третьи информационные входы устройства подаётся инверсный код модуля, с информационных выходов устройства снимается код произведения чисел по модулю, отличающийся тем, что в него введены n параллельных регистров, (n−1) умножителей на два по модулю, (n−1) сумматоров по модулю, тактовый вход устройства, который соединен со входами подачи тактовых импульсов n параллельных регистров, первые информационные входы устройства соединены с (1, …, n)-ми разрядами информационных входов первого параллельного регистра, вторые информационные входы устройства соединены с (n+1, …, 2n)-ми разрядами информационных входов первого параллельного регистра, третьи информационные входы устройства соединены со вторыми входами умножителей на два по модулю и с третьими входами сумматоров по модулю, выход (n−1)-го сумматора по модулю соединён с информационными выходами устройства, первый разряд информационных выходов (1, …, n)-го параллельных регистров соединен соответственно с управляющим входом (1, …, n)-го ключей, (1, …, ni+1)-ые разряды информационных входов i-х параллельных регистров, i=(2, …, n), соединены со (2, …, ni+2)-ми разрядами информационных выходов (i−1)-ых параллельных регистров, (ni+2, …, 2ni+1)-е разряды соединены с информационными выходами (i-1)-х умножителей на два по модулю, (2n, …, 3n−1)-е разряды информационных входов второго параллельного регистра соединены с выходами первого ключа, а (2ni+2, …, 3ni+1)-е разряды информационных входов (3, …, n)-го параллельных регистров с выходами (1, …, n−2)-го сумматоров по модулю, (2, …, n+1)-й разряд информационных выходов n-го параллельного регистра соединен с информационными входами n-го ключа, (2n−i+2, …, 3n-i+1)-е разряды информационных выходов i-х параллельных регистров соединены с первыми информационными входами (i−1)-х сумматоров по модулю, вторые информационные входы которых соединены с информационными выходами i-х ключей, (n−i+2, …, 2n−i+1)-е разряды, i=(1, …, n), информационных выходов (1, …, n−1)-го параллельных регистров соединены соответственно с информационными входами (1, …, n−1)-го ключей и с первыми входами (1, …, n−1)-го умножителей на два по модулю.Modulo pipeline multiplier containing n keys, where n is the number of bits being processed, the first information inputs of the device, the second information inputs of the device, the third information inputs of the device, the information outputs of the device, the code of the multiplier is fed to the first information inputs of the device, the code of the multiplier is fed to the second information inputs of the device multiplier code, the inverse code of the module is fed to the third information inputs of the device, the code of the product of numbers modulo is removed from the information outputs of the device, which differs in that it contains n parallel registers, ( n − 1) multipliers by two modulo, ( n − 1 ) modulo adders, the clock input of the device, which is connected to the clock inputs of n parallel registers, the first information inputs of the device are connected to (1, ..., n)-bits of the information inputs of the first parallel register, the second information inputs of the device are connected to ( n +1, ..., 2 n )-bits of the information inputs of the first parallel register, the third information inputs of the device are connected to the second inputs of multipliers by two modulo and to the third inputs of modulo adders, the output of the ( n − 1)-th modulo adder is connected with the information outputs of the device, the first bit of the information outputs of the (1, ..., n )-th parallel registers is connected respectively to the control input of the (1, ..., n )-th keys, (1, ..., ni +1)-th bits information inputs of i -th parallel registers, i =(2, …, n ), are connected to (2, …, ni +2)-th bits of information outputs of ( i −1)-th parallel registers, ( ni +2, …, 2 ni +1)-th bits are connected to information outputs of ( i -1)-th multipliers by two modulo, (2 n , …, 3 n −1)-th bits of information inputs of the second parallel register are connected to the outputs of the first key, and (2 n - i +2, ..., 3 n - i + 1)-th bits of information inputs of the (3, ..., n )-th parallel registers with outputs (1, ..., n - 2)-th adder modulo, (2, ..., n + 1)-th bit of the information outputs of the n -th parallel register is connected to the information inputs of the n -th key, (2 n−i +2, ..., 3 n-i +1) -th bits of the information outputs of the i -th parallel registers are connected to the first information inputs of ( i −1)-th adders modulo, the second information inputs of which are connected to the information outputs of the i -th keys, ( n−i +2, ..., 2 n −i +1)-th bits, i =(1, …, n ), information outputs of the (1, …, n −1)-th parallel registers are connected respectively with information inputs of the (1, …, n −1)-th keys and with the first inputs of the (1, …, n − 1)th multipliers by two modulo.
RU2023106826A 2023-03-22 Pipeline module multiplier RU2797164C1 (en)

Publications (1)

Publication Number Publication Date
RU2797164C1 true RU2797164C1 (en) 2023-05-31

Family

ID=

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3814924A (en) * 1973-03-12 1974-06-04 Control Data Corp Pipeline binary multiplier
US20050033790A1 (en) * 2001-12-14 2005-02-10 Hubert Gerardus Tarcisius Maria Pipeline core in montgomery multiplier
RU2316042C1 (en) * 2006-08-07 2008-01-27 ГОУ ВПО Ставропольский государственный университет Device for multiplying numbers with arbitrary modulus
RU2408057C2 (en) * 2006-01-20 2010-12-27 Квэлкомм Инкорпорейтед Fixed point multiplier with presaturation
RU2546072C1 (en) * 2013-09-24 2015-04-10 Общество с ограниченной ответственностью "ЛЭТИНТЕХ" Conveyor arithmetic multiplier

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3814924A (en) * 1973-03-12 1974-06-04 Control Data Corp Pipeline binary multiplier
US20050033790A1 (en) * 2001-12-14 2005-02-10 Hubert Gerardus Tarcisius Maria Pipeline core in montgomery multiplier
RU2408057C2 (en) * 2006-01-20 2010-12-27 Квэлкомм Инкорпорейтед Fixed point multiplier with presaturation
RU2316042C1 (en) * 2006-08-07 2008-01-27 ГОУ ВПО Ставропольский государственный университет Device for multiplying numbers with arbitrary modulus
RU2546072C1 (en) * 2013-09-24 2015-04-10 Общество с ограниченной ответственностью "ЛЭТИНТЕХ" Conveyor arithmetic multiplier

Similar Documents

Publication Publication Date Title
Yang et al. A new RSA cryptosystem hardware design based on Montgomery's algorithm
EP0381161A2 (en) Modular multipication method and the system
US5751619A (en) Recurrent adrithmetical computation using carry-save arithmetic
EP0356153B1 (en) Radix-2**n divider method and apparatus using overlapped quotient bit selection and concurrent quotient rounding and correction
US5132925A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
US3878985A (en) Serial-parallel multiplier using booth{3 s algorithm with combined carry-borrow feature
RU2299461C1 (en) Modulus multiplexer
RU2717915C1 (en) Computing device
RU2797164C1 (en) Pipeline module multiplier
RU2696223C1 (en) Arithmetic logic unit for generating residual by arbitrary module from number
US7607165B2 (en) Method and apparatus for multiplication and/or modular reduction processing
US7266577B2 (en) Modular multiplication apparatus, modular multiplication method, and modular exponentiation apparatus
JP3660075B2 (en) Dividing device
JPS58129653A (en) Multiplication system
RU2791440C1 (en) Pipeline generator of remainders by an arbitrary modulus
RU2804380C1 (en) Pipeline calculator
RU2814657C9 (en) Modulo conveyor accumulating adder
RU2797163C1 (en) Pipeline calculator
RU2799035C1 (en) Conveyor totalizer by modulo
EP1504338A1 (en) &#34;emod&#34; a fast modulus calculation for computer systems
RU2739338C1 (en) Computing device
RU2755734C1 (en) Apparatus for multiplying numbers by an arbitrary modulus
RU2756408C1 (en) Computing apparatus
RU2796555C1 (en) Computing device
RU2751802C1 (en) Modulo multiplier