RU2791440C1 - Pipeline generator of remainders by an arbitrary modulus - Google Patents

Pipeline generator of remainders by an arbitrary modulus Download PDF

Info

Publication number
RU2791440C1
RU2791440C1 RU2022134138A RU2022134138A RU2791440C1 RU 2791440 C1 RU2791440 C1 RU 2791440C1 RU 2022134138 A RU2022134138 A RU 2022134138A RU 2022134138 A RU2022134138 A RU 2022134138A RU 2791440 C1 RU2791440 C1 RU 2791440C1
Authority
RU
Russia
Prior art keywords
information
partial
information inputs
residues
outputs
Prior art date
Application number
RU2022134138A
Other languages
Russian (ru)
Inventor
Вячеслав Иванович Петренко
Original Assignee
федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Filing date
Publication date
Application filed by федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" filed Critical федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Application granted granted Critical
Publication of RU2791440C1 publication Critical patent/RU2791440C1/en

Links

Images

Abstract

FIELD: computing technology.
SUBSTANCE: pipeline generator of remainders by an arbitrary modulus comprises (n-1) blocks for the formation of partial remainders and (n-1) parallel registers, wherein n is the capacity of the input numbers, and wherein the block for the formation of partial remainders contains an adder and a multiplexer with appropriate links.
EFFECT: reduced energy consumption.
1 cl, 3 dwg

Description

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

Из существующего уровня техники известно устройство для формирования остатка по произвольному модулю от числа, содержащее регистр и блок формирования частного и остатка, позволяющее выполнять вычисление остатка и неполного частного от чисел по произвольным модулям [1]. Недостатком данного технического решения является низкое быстродействие при вычислении остатков по модулю для потока чисел, так как вычисление остатка по модулю для очередного числа в потоке не может быть начато до тех пор, пока не завершено вычисление остатка по модулю для предыдущего числа.From the existing prior art, a device is known for forming a remainder modulo an arbitrary number, containing a register and a unit for generating a quotient and a remainder, which allows the calculation of the remainder and an incomplete quotient of numbers by arbitrary modules [1]. The disadvantage of this technical solution is the low speed when calculating modulo residues for a stream of numbers, since the calculation of the modulo residue for the next number in the stream cannot be started until the calculation of the modulo residue for the previous number is completed.

Из существующего уровня техники известно вычислительное устройство, содержащее 2n-2 сумматоров и n-1 мультиплексоров, где n - разрядность входного числа, позволяющее выполнять вычисление остатка и неполного частного от чисел по произвольным модулям [2]. Недостатком данного технического решения является низкое быстродействие при вычислении остатков по модулю для потока чисел, так как вычисление остатка по модулю для очередного числа в потоке не может быть начато до тех пор, пока не завершено вычисление остатка по модулю для предыдущего числа.From the existing prior art known computing device containing 2 n -2 adders and n -1 multiplexers, where n is the capacity of the input number, allowing you to calculate the remainder and partial quotient of numbers in arbitrary modules [2]. The disadvantage of this technical solution is the low speed when calculating modulo residues for a stream of numbers, since the calculation of the modulo residue for the next number in the stream cannot be started until the calculation of the modulo residue for the previous number is completed.

Из существующего уровня техники известен комбинационный рекуррентный формирователь остатков, содержащий последовательно соединенные комбинационный формирователь частичных остатков, блок ключей и блок сумматоров по модулю, позволяющий выполнять приведение чисел по произвольным модулям [3]. Недостатком данного технического решения является низкое быстродействие при вычислении остатков по модулю для потока чисел, так как вычисление остатка по модулю для очередного числа в потоке не может быть начато до тех пор, пока не завершено вычисление остатка по модулю для предыдущего числа.A combinational recurrent generator of residuals is known from the existing level of technology, containing a series-connected combinational generator of partial residues, a block of keys and a block of modulo adders, which allows to perform reduction of numbers by arbitrary modules [3]. The disadvantage of this technical solution is the low speed when calculating modulo residues for a stream of numbers, since the calculation of the modulo residue for the next number in the stream cannot be started until the calculation of the modulo residue for the previous number is completed.

Из существующего уровня техники известно устройство для формирования остатка по произвольному модулю от числа, содержащее l=((k/N)-1) блоков формирования частичных остатков (где k - количество разрядов в двоичном представлении числа, от которого формируется остаток, с учетом добавленных для достижения кратности N разрядов), (l+1) блоков умножения по модулю, блока распределения коэффициентов и сумматора по модулю [4]. Недостатком данного технического решения является низкое быстродействие при вычислении остатков по модулю для потока чисел, так как формирование частичного остатка и выполнение операций умножения и сложения по модулю производится заново для каждого из чисел в потоке, кроме того, вычисление остатка по модулю для очередного числа в потоке не может быть начато до тех пор, пока не завершено вычисление остатка по модулю для предыдущего числа.From the existing prior art, a device is known for forming a remainder modulo an arbitrary number, containing l = (( k / N )-1) blocks for forming partial residues (where k is the number of digits in the binary representation of the number from which the remainder is formed, taking into account the added to achieve the multiplicity of N digits), ( l +1) modulo multiplication blocks, coefficient distribution block and modulo adder [4]. The disadvantage of this technical solution is the low speed when calculating modulo residues for a stream of numbers, since the formation of a partial residue and the execution of multiplication and addition modulo operations are performed again for each of the numbers in the stream, in addition, the calculation of the modulo residue for the next number in the stream cannot be started until the modulo remainder calculation for the previous number has been completed.

Наиболее близким к заявленному техническому решению по технической сущности и достигаемому техническому результату, выбранному в качестве прототипа, является устройство для формирования остатка по заданному модулю [5], содержащее блоки формирования частичных остатков, параллельные многоразрядные регистры, мультиплексор, компаратор, блок вычитания, в котором организована конвейеризация процесса вычисления остатков по заданному модулю для потока чисел на базе последовательного выполнения операций сложения (не по модулю) первичных остатков. Недостатками данного технического решения являются большой объем оборудования, обусловленный тем, что в каждом блоке формирования частичных остатков кроме основных параллельных регистров используются дополнительные (по количеству разрядов модуля) параллельные регистры для хранения частичных остатков, а также многовходовый комбинационный сумматор, который при разрядности более 32 фактически окажется сложно реализуемым, а также будет обладать большим временем суммирования. Кроме того, предложенная структура устройства может быть реализована для конкретных разрядностей модуля и при необходимости работы с модулями иной разрядности потребуется изменение структуры устройства.The closest to the claimed technical solution in terms of technical essence and the achieved technical result, selected as a prototype, is a device for forming a remainder according to a given modulo [5], containing blocks for forming partial residues, parallel multi-bit registers, a multiplexer, a comparator, a subtraction unit, in which pipelining of the process of calculating residuals according to a given modulo for a stream of numbers is organized based on the sequential execution of addition operations (not modulo) of primary residuals. The disadvantages of this technical solution are a large amount of equipment, due to the fact that in each block for the formation of partial residues, in addition to the main parallel registers, additional (according to the number of bits of the module) parallel registers are used to store partial residues, as well as a multi-input combinational adder, which, with a capacity of more than 32, actually will be difficult to implement, and will also have a large summation time. In addition, the proposed device structure can be implemented for specific module bit depths, and if it is necessary to work with modules of a different bit depth, the device structure will need to be changed.

Техническим результатом, обеспечиваемым приведенной совокупностью признаков, является сокращение объема используемого оборудования за счет исключения дополнительных параллельных регистров и замены многовходовых комбинационных сумматоров на стандартный двухвходовый сумматор и как следствие уменьшение потребления энергии. The technical result provided by the above set of features is to reduce the amount of equipment used by eliminating additional parallel registers and replacing multi-input combination adders with a standard two-input adder and, as a result, reducing energy consumption.

Указанный технический результат при осуществлении изобретения достигается тем, что в конвейерном формирователе остатков по произвольному модулю, содержащем (n-1) блоков формирования частичных остатков, (n-1) параллельных регистров, где n - разрядность входных чисел, первые и вторые информационные входы устройства, информационные выходы устройства и тактовый вход устройства, соединенный с тактовыми входами (n-1) параллельных регистров, первые информационные входы устройства соединены с информационными входами первого параллельного регистра, два старших разряда информационных выходов которого соединены с первыми информационными входами первого блока формирования частичных остатков, вторые информационные входы устройства соединены со вторыми информационными входами блоков формирования частичных остатков, информационные выходы (n-1)-го блока формирования частичных остатков соединены с информационными выходами устройства, информационные выходы i-го блока формирования частичных остатков, i=(1, …, (n-2)) соединены с m младшими разрядами информационных входов (i+1)-го параллельного регистра, где m - разрядность модуля, m младших разрядов информационных выходов которого соединены со (2, … , (m+1))-ми разрядами первых информационных входов (i+1)-го блока формирования частичных остатков, с первым разрядом первых информационных входов которого соединён самый старший (n-i+m)-й разряд информационных выходов (i+1)-го параллельного регистра, (n-i-1) старших разрядов информационных входов которого соединены с (n-i-1) старшими разрядами информационных выходов i-го параллельного регистра, разрядность первого параллельного регистра равна n, а i-го параллельного регистра равна (m+n-i), причём блок формирования частичных остатков содержит сумматор и мультиплексор, первые информационные входы сумматора и мультиплексора соединены с первыми информационными входами блока формирования частичных остатков, вторые информационные входы сумматора соединены со вторыми информационными входами блока формирования частичных остатков, информационные выходы сумматора соединены со вторыми информационными входами мультиплексора, а выход переноса соединён с управляющим входом мультиплексора, выходы которого являются информационными выходами блока формирования частичных остатков, а на вход переноса сумматора подаётся сигнал логической единицы. The specified technical result in the implementation of the invention is achieved by the fact that in the conveyor generator of residues by an arbitrary module, containing ( n- 1) blocks for the formation of partial residues, ( n- 1) parallel registers, where n is the capacity of the input numbers, the first and second information inputs of the device , the information outputs of the device and the clock input of the device connected to the clock inputs ( n- 1) of parallel registers, the first information inputs of the device are connected to the information inputs of the first parallel register, the two most significant bits of the information outputs of which are connected to the first information inputs of the first block for the formation of partial residues, the second information inputs of the device are connected to the second information inputs of the partial residue formation blocks, the information outputs of the ( n- 1)-th partial residue formation block are connected to the information outputs of the device, the information outputs of the i -th partial residue formation block tkov, i =(1, ..., ( n- 2)) are connected to the m lower bits of the information inputs of the ( i + 1)th parallel register, where m is the capacity of the module, the m lower bits of the information outputs of which are connected to (2, ... , ( m +1))-th digits of the first information inputs of the ( i +1)-th block for the formation of partial residues, with the first digit of the first information inputs of which the most senior ( ni + m )-th digit of information outputs ( i +1) is connected -th parallel register, ( ni- 1) the most significant bits of the information inputs of which are connected to ( ni- 1) the most significant bits of the information outputs of the i -th parallel register, the capacity of the first parallel register is n , and the i -th parallel register is ( m + n-i ), and the block for forming partial residues contains an adder and a multiplexer, the first information inputs of the adder and multiplexer are connected to the first information inputs of the block for forming partial residues, the second information inputs of the adder are connected to the second and information inputs of the partial residue formation unit, the information outputs of the adder are connected to the second information inputs of the multiplexer, and the transfer output is connected to the control input of the multiplexer, the outputs of which are the information outputs of the partial residue formation unit, and a logical one signal is applied to the transfer input of the adder.

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

A = Q⋅P +R, (1) A = Q⋅P + R , (1)

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

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

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

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

Причем And

A = a n - 1 ·2 n - 1+a n - 2 ·2 n - 2+ . . . +a 1 ·21+a 0, (2) A = a n - 1 2 n - 1 + a n - 2 2 n - 2 + . . . + a 1 2 1 + a 0 , (2)

P = p m - 1 ·2 m - 1+p m - 2 ·2 m - 2+ . . . +p 1 ·21+p 0, (3) P = p m - 1 2 m - 1 + p m - 2 2 m - 2 + . . . + p 1 2 1 + p 0 , (3)

Q = q n - 2 ·2 n - 2+ q n - 3 ·2 n - 3+ . . . +q 1 ·21+q 0, (4) Q = q n - 2 2 n - 2 + q n - 3 2 n - 3 + . . . + q 1 2 1 + q 0 , (4)

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

где a i ,

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

p i ,

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

q i ,

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

r i ,

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

n - количество разрядов в представлении числа A, m - количество разрядов в представлении модуля P,

Figure 00000004
. n is the number of digits in the representation of the number A , m is the number of digits in the representation of the module P ,
Figure 00000004
.

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

A

Figure 00000005
R (mod P). (6) A
Figure 00000005
R (mod P ). (6)

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

R = A (mod P) = (a n - 1 ·2 n - 1+a n - 2 ·2 n - 2+ … +a 1 ·21+a 0)mod P. (7) R = A (mod P ) = ( a n - 1 2 n - 1 + a n - 2 2 n - 2 + … + a 1 2 1 + a 0 )mod P . (7)

Перепишем выражение (7) в следующем виде:Let us rewrite expression (7) in the following form:

R = (2(2(…(2(a n - 1 ·2+a n - 2)+ a n - 3) …) +a 1)+a 0)mod P. (8) R = (2(2(…(2( a n - 1 2+ a n - 2 )+ a n - 3 ) …) + a 1 )+ a 0 )mod P . (8)

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

Поэтому выражение (8) может быть представлено в следующем видеTherefore, expression (8) can be represented in the following form

R = (2(2(…(2(a n - 1 ·2+a n - 2) mod P + a n - 3) mod P+ …)mod P +…+a 1) mod P +a 0)mod P. (9) R = (2(2(…(2( a n - 1 2+ a n - 2 ) mod P + a n - 3 ) mod P + …)mod P +…+ a 1 ) mod P + a 0 ) mod P . (9)

В таком виде значительно облегчается задача нахождения остатка R от числа А по модулю P с использованием конвейерного режима.In this form, the task of finding the remainder R of the number A modulo P using the pipeline mode is greatly facilitated.

Вначале на первом такте в первом слое конвейера от первого числа вычисляют первый частичный остаток t 1:First, on the first cycle in the first layer of the pipeline, the first partial remainder t 1 is calculated from the first number:

t 1 = (2·t 0+a n - 2) mod P, где t 0=a n -1. (10) t 1 = (2 t 0 + a n - 2 ) mod P , where t 0 = a n -1 . (10)

На втором такте во втором слое конвейера от первого числа вычисляют второй частичный остаток t 2:On the second cycle in the second layer of the pipeline, the second partial remainder t 2 is calculated from the first number:

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

а от второго числа в первом слое конвейера вычисляют первый частичный остаток t 1 в соответствии с (10).and from the second number in the first layer of the conveyor, the first partial remainder t 1 is calculated in accordance with (10).

На третьем такте в третьем слое конвейера от первого числа вычисляют третий частичный остаток t 3:On the third cycle in the third layer of the pipeline, the third partial remainder t 3 is calculated from the first number:

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

от второго числа во втором слое конвейера вычисляют второй частичный остаток t 2 в соответствии с (11), а от третьего числа в первом слое конвейера вычисляют первый частичный остаток t 1 в соответствии с (10).from the second number in the second layer of the conveyor, the second partial remainder t 2 is calculated in accordance with (11), and from the third number in the first layer of the conveyor, the first partial remainder t 1 is calculated in accordance with (10).

На (n-1)-м такте в (n-1)-м слое конвейера от первого числа вычисляют (n-1)-й частичный остаток t n-1:On the ( n- 1)-th cycle in the ( n- 1)-th layer of the pipeline, the ( n- 1)-th partial remainder t n-1 is calculated from the first number:

t n = 1 (2·t n - 2+a 0) mod P, (13) t n = 1 (2 t n - 2 + a 0 ) mod P , (13)

который и является искомым остатком R от первого числа A по модулю P, поступившего на вход конвейера на первом такте. При этом в (1…(n-2))-м слоях конвейера будут находиться соответствующие частичные остатки, согласно вышеприведенным выражениям, от поступивших на его вход чисел. Соответственно на каждом следующем такте будем в (n-1)-м слое конвейера получать остатки от чисел, поступающих на вход по модулю P.which is the required remainder R of the first number A modulo P , received at the input of the pipeline on the first cycle. In this case, the (1…( n- 2))-th layers of the conveyor will contain the corresponding partial residues, according to the above expressions, from the numbers received at its input. Accordingly, at each next cycle, in the ( n- 1)-th layer of the pipeline, we will receive the remainders from the numbers entering the input modulo P .

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

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

t i = 2 t i - 1 +a n - i - 1,

Figure 00000006
(14) t i = 2 t i - 1 + a n - i - 1 ,
Figure 00000006
(14)

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

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

t i (mod P)=t i - P, если P ≤ t i < 2P. t i (modP)=t i -P, IfP≤ t i < 2P.

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

На фиг. 1 представлена схема конвейерного формирователя остатков по произвольному модулю. Конвейерный формирователь остатков по произвольному модулю содержит (n-1) параллельных регистров 1.1÷1.n-1, (n-1) блоков формирования частичных остатков 2.1÷2.n-1, первые информационные входы 3 устройства, вторые информационные входы 4 устройства, информационные выходы 5 устройства, тактовый вход 6 устройства. Тактовый вход 6 устройства соединен с тактовыми входами (n-1) параллельных регистров 1.1÷1.n-1. Первые информационные входы 3 устройства соединены с информационными входами первого параллельного регистра 1.1, два старших разряда информационных выходов которого соединены с первыми информационными входами первого блока формирования частичных остатков 2.1, вторые информационные входы устройства соединены со вторыми информационными входами блоков формирования частичных остатков 2.1÷2.n-1, информационные выходы (n-1)-го блока формирования частичных остатков 2.n-1 соединены с информационными выходами 5 устройства, информационные выходы i-го блока формирования частичных остатков 2.i, i=(1, …, (n-2)) соединены с m младшими разрядами информационных входов (i+1)-го параллельного регистра 1.i+1, где m - разрядность модуля, m младших разрядов информационных выходов которого соединены со (2, … , (m+1))-ми разрядами первых информационных входов (i+1)-го блока формирования частичных остатков 2.i+1, с первым разрядом первых информационных входов которого соединён самый старший (n-i+m)-й разряд информационных выходов (i+1)-го параллельного регистра 1.i+1, (n-i-1) старших разрядов информационных входов которого соединены с (n-i-1) старшими разрядами информационных выходов i-го параллельного регистра 1.i, разрядность первого параллельного регистра 1.1 равна n, а i-го параллельного регистра 1.i равна (m+n-i).In FIG. 1 shows a diagram of a conveyor generator of residues by an arbitrary modulus. The pipeline generator of residuals modulo contains ( n- 1) parallel registers 1.1÷1. n- 1, ( n- 1) blocks of formation of partial residues 2.1÷2. n- 1, the first information inputs 3 of the device, the second information inputs 4 of the device, the information outputs of the device 5, clock input 6 of the device. The clock input 6 of the device is connected to clock inputs ( n- 1) of parallel registers 1.1÷1. n- 1. The first information inputs 3 of the device are connected to the information inputs of the first parallel register 1.1, the two most significant bits of the information outputs of which are connected to the first information inputs of the first block for the formation of partial residues 2.1, the second information inputs of the device are connected to the second information inputs of the blocks for the formation of partial residues 2.1 ÷2. n- 1, information outputs of the ( n- 1)-th block of formation of partial residues 2. n- 1 are connected to information outputs 5 of the device, information outputs of the i -th block of formation of partial residues 2. i , i =(1, …, ( n- 2)) are connected to the m least significant digits of the information inputs ( i +1) of the parallel register 1. i +1, where m is the capacity of the module, the m least significant digits of the information outputs of which are connected to (2, … , ( m +1 ))-th bits of the first information inputs ( i +1) of the block of formation of partial residues 2. i +1, with the first bit of the first information inputs of which the most senior ( ni + m )-th bit of information outputs ( i +1) is connected -th parallel register 1. i +1, ( ni- 1) the most significant bits of the information inputs of which are connected to ( ni- 1) the most significant bits of the information outputs of the i -th parallel register 1. i , the capacity of the first parallel register 1.1 is n , and i th parallel register 1. i is equal to ( m + n-i ).

На фиг. 2 представлена схема блока формирования частичных остатков 2.i, i=(1, …, (n-1)). Блок формирования частичных остатков 2.i содержит сумматор 7 и мультиплексор 8. Первые информационные входы сумматора 7 и мультиплексора 8 соединены и являются первыми информационными входами блока формирования частичных остатков 2.i, вторые информационные входы сумматора 7 соединены со вторыми информационными входами блока формирования частичных остатков 2.i, информационные выходы сумматора 7 соединены со вторыми информационными входами мультиплексора 8, а выход переноса соединён с управляющим входом мультиплексора 8, выходы которого являются информационными выходами блока формирования частичных остатков 2.i, а на вход переноса сумматора 7 подаётся сигнал логической единицы.In FIG. Figure 2 shows a block diagram of the formation of partial residues 2. i , i =(1, ..., ( n- 1)). Block forming partial residues 2. i contains an adder 7 and a multiplexer 8. The first information inputs of the adder 7 and multiplexer 8 are connected and are the first information inputs of the block forming partial residues 2. i , the second information inputs of the adder 7 is connected to the second information inputs of the block forming partial residues 2. i , the information outputs of the adder 7 are connected to the second information inputs of the multiplexer 8, and the transfer output is connected to the control input of the multiplexer 8, the outputs of which are the information outputs of the block for the formation of partial residues 2. i , and a logical unit signal is applied to the transfer input of the adder 7.

На фиг. 3 представлено распределение разрядности параллельных регистров 1.1÷1.n-1. Первый параллельный регистр 1.1 имеет разрядность n, равную разрядности входных чисел, а i-й (i=2, …, (n-1)) параллельный регистр 1.i имеет разрядность (m+n-i), где n - разрядность входных чисел, а m - разрядность модуля.In FIG. 3 shows the distribution of the width of the parallel registers 1.1÷1. n- 1. The first parallel register 1.1 has a capacity n equal to the capacity of the input numbers, and the i -th ( i =2, …, ( n- 1)) parallel register 1. i has a capacity ( m + n-i ), where n - the capacity of the input numbers, and m is the capacity of the module.

Конвейерный формирователь остатков по произвольному модулю работает следующим образом (см. Фиг. 1).The conveyor generator of residuals according to an arbitrary modulus works as follows (see Fig. 1).

В исходном состоянии параллельные регистры 1.1÷1. n-1 обнулены. На тактовый вход 6 устройства поступают тактовые импульсы. На первые информационные входы 3 устройства с каждым тактовым импульсом подаются числа A i , от которых необходимо вычислить остаток по модулю P. На вторые информационные входы 4 устройства, в течение всего цикла формирования остатков, подаётся инверсный код модуля P.In the initial state, parallel registers 1.1÷1. n- 1 set to zero. The clock input 6 of the device receives clock pulses. On the first information inputs 3 of the device with each clock pulse served number A i from which you want to calculate the remainder modulo P . The inverse code of the module P is fed to the second information inputs 4 of the device during the entire cycle of formation of residues.

На первом такте первое число A записывается в параллельный регистр 1.1. При этом два старших разряда первого числа A с выходов параллельного регистра 1.1 поступают на первые информационные входы блока формирования частичных остатков 2.1, который вычисляет значение первого частичного остатка в соответствии с выражением (10). С информационных выходов блока формирования частичных остатков 2.1 m - разрядное значение первого частичного остатка первого числа поступает на (1…m)-ые разряды информационных входов второго параллельного регистра 1.2. На ((m+1)…(m+n-2))-ые разряды информационных входов этого же регистра поступают значения (1, …, (n-3))-ых разрядов первого входного числа с информационных выходов первого параллельного регистра 1.1. On the first cycle, the first number A is written to the parallel register 1.1. In this case, the two most significant digits of the first number A from the outputs of the parallel register 1.1 are fed to the first information inputs of the block for the formation of partial residues 2.1, which calculates the value of the first partial residue in accordance with expression (10). From the information outputs of the block for the formation of partial residues 2.1 m - bit value of the first partial residue of the first number is supplied to the (1 ... m )-th digits of the information inputs of the second parallel register 1.2. The (( m +1)…( m + n- 2))-th bits of the information inputs of the same register receive the values of (1, …, ( n- 3))-th bits of the first input number from the information outputs of the first parallel register 1.1 .

На втором такте в первый параллельный регистр 1.1 записывается второе число, а во второй параллельный регистр 1.2 записывается первый частичный остаток первого числа с выхода блока формирования частичных остатков 2.1 и значения (1, …, (n-2))-ых разрядов первого числа с информационных выходов параллельного регистра 1.1. В результате на первый разряд первых информационных входов блока формирования частичных остатков 2.2 с информационного выхода второго параллельного регистра 1.2 поступит значение (n-3) разряда первого числа, а на остальные разряды поступит значение первого частичного остатка от первого числа с информационных выходов первого блока формирования частичных остатков 2.1. В результате на информационном выходе блока формирования частичных остатков 2.1 будет сформирован первый частичный остаток от второго числа, а на информационном выходе блока формирования частичных остатков 2.2 будет сформирован второй частичный остаток от первого числа. On the second cycle, the second number is written to the first parallel register 1.1, and the first partial remainder of the first number is written to the second parallel register 1.2 from the output of the partial remainder formation unit 2.1 and the values of (1, ..., ( n- 2))-th bits of the first number with information outputs of the parallel register 1.1. As a result, the first bit of the first information inputs of the block for forming partial residues 2.2 from the information output of the second parallel register 1.2 will receive the value ( n- 3) of the bit of the first number, and the remaining bits will receive the value of the first partial remainder of the first number from the information outputs of the first block for forming partial residues 2.1. As a result, the first partial remainder of the second number will be generated at the information output of the partial residue formation block 2.1, and the second partial remainder of the first number will be formed at the information output of the partial residue formation unit 2.2.

На (n-1)-ом такте на информационном выходе (n-1)-го блока формирования частичных остатков 2.(n-1) будет сформирован (n-1)-й частичный остаток от первого числа, являющийся остатком от числа, поступившего на первом такте на вход устройства, по модулю P, который и поступит на информационные выходы 5 устройства. На последующих тактах на информационных выходах 5 устройства будут последовательно сформированы остатки от второго, третьего и последующих чисел, поступивших на вход устройства.On the ( n- 1)-th cycle, at the information output of the ( n- 1)-th block for the formation of partial residues 2.( n- 1), the ( n- 1)-th partial residue from the first number will be formed, which is the remainder of the number, received on the first cycle at the input of the device, modulo P , which will go to the information outputs 5 of the device. On subsequent cycles, the information outputs 5 of the device will sequentially form the remainders of the second, third and subsequent numbers received at the input of the device.

Блок формирования частичных остатков 2.i, i=(1, …, (n-1)) реализует выражение (15) следующим образом (см. Фиг. 2). Так как на вторые информационные входы сумматора 7 поступает инверсный код модуля P, а на вход переноса сигнал логической единицы, то сумматор 7 реализует операцию вычитания t i -P. В случае, если t iP на выходе переноса сумматора 7 появляется сигнал логической единицы, который, поступая на управляющий вход мультиплексора 8, скоммутирует с его выходами вторые информационные входы, если же t i <P, то на выходе переноса сумматора 7 будет сигнал логического нуля и на выходы мультиплексора 8 будет скоммутирован его первые информационные входы. В результате на выходах мультиплексора 8 всегда будет значение t i mod P, которое поступает на первые информационные выходы блока формирования частичных остатков 2.i. Block forming partial residues 2. i , i =(1, ..., ( n- 1)) implements the expression (15) as follows (see Fig. 2). Since the second information inputs of the adder 7 receives the inverse code of the module P , and the transfer input is a logical unit signal, the adder 7 implements the subtraction operation t i -P . If t iP at the transfer output of the adder 7, a logical unit signal appears, which, when fed to the control input of the multiplexer 8, switches the second information inputs with its outputs, if t i < P , then the transfer output of the adder 7 will have a signal logic zero and the outputs of the multiplexer 8 will be switched to its first information inputs. As a result, the outputs of the multiplexer 8 will always have the value t i mod P , which is fed to the first information outputs of the block for the formation of partial residues 2. i .

Техническим результатом изобретения является сокращение объема используемого оборудования за счет исключения дополнительных параллельных регистров и заменой многовходовых комбинационных сумматоров на стандартный двухвходовый сумматор и как следствие уменьшение потребления энергии. The technical result of the invention is to reduce the amount of equipment used by eliminating additional parallel registers and replacing multi-input combination adders with a standard two-input adder and, as a result, reducing energy consumption.

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

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

1. Патент на изобретение RU 2012137 C1. Устройство для формирования остатка по произвольному модулю от числа. Опубл. 30.04.1994. 1. Patent for invention RU 2012137 C1. A device for forming the remainder modulo an arbitrary number. Published 04/30/1994.

2. Патент на изобретение RU 2348965 C1. Вычислительное устройство. Опубл. 10.03.2009, Бюл. №7.2. Patent for invention RU 2348965 C1. Computing device. Published 10.03.2009, Bull. No. 7.

3. Патент на изобретение RU 2029435 C1. Комбинационный рекуррентный формирователь остатков. Опубл. 20.02.1995.3. Patent for invention RU 2029435 C1. Combination recurrent generator of residues. Published 02/20/1995.

4. Патент на изобретение RU 2324972 C2. Устройство для формирования остатка по произвольному модулю от числа. Опубл. 20.05.2008. Бюл. №14.4. Patent for invention RU 2324972 C2. A device for forming the remainder modulo an arbitrary number. Published May 20, 2008. Bull. No. 14.

5. Патент на изобретение RU 2421781 C1. Устройство для формирования остатка по заданному модулю. Опубл. 20.06.2011. Бюл. №17.5. Patent for invention RU 2421781 C1. A device for forming the remainder according to a given modulo. Published 06/20/2011. Bull. No. 17.

Claims (1)

Конвейерный формирователь остатков по произвольному модулю, содержащий (n−1) блоков формирования частичных остатков, (n−1) параллельных регистров, где n - разрядность входных чисел, первые и вторые информационные входы устройства, информационные выходы устройства и тактовый вход устройства, соединенный с тактовыми входами (n−1) параллельных регистров, отличающийся тем, что первые информационные входы устройства соединены с информационными входами первого параллельного регистра, два старших разряда информационных выходов которого соединены с первыми информационными входами первого блока формирования частичных остатков, вторые информационные входы устройства соединены со вторыми информационными входами блоков формирования частичных остатков, информационные выходы (n−1)-го блока формирования частичных остатков соединены с информационными выходами устройства, информационные выходы i-го блока формирования частичных остатков, i=(1, …, (n−2)), соединены с m младшими разрядами информационных входов (i+1)-го параллельного регистра, где m – разрядность модуля, m младших разрядов информационных выходов которого соединены со (2, … , (m+1))-ми разрядами первых информационных входов (i+1)-го блока формирования частичных остатков, с первым разрядом первых информационных входов которого соединён самый старший (ni+m)-й разряд информационных выходов (i+1)-го параллельного регистра, (ni−1) старших разрядов информационных входов которого соединены с (ni−1) старшими разрядами информационных выходов i-го параллельного регистра, разрядность первого параллельного регистра равна n, а i-го параллельного регистра равна (m+ni), причём блок формирования частичных остатков содержит сумматор и мультиплексор, первые информационные входы сумматора и мультиплексора соединены с первыми информационными входами блока формирования частичных остатков, вторые информационные входы сумматора соединены со вторыми информационными входами блока формирования частичных остатков, информационные выходы сумматора соединены со вторыми информационными входами мультиплексора, а выход переноса соединён с управляющим входом мультиплексора, выходы которого являются информационными выходами блока формирования частичных остатков, а на вход переноса сумматора подаётся сигнал логической единицы.Conveyor generator of residues by an arbitrary modulus, containing ( n − 1) blocks for forming partial residues, ( n − 1) parallel registers, where n is the width of the input numbers, the first and second information inputs of the device, the information outputs of the device and the clock input of the device connected to clock inputs ( n − 1) of parallel registers, characterized in that the first information inputs of the device are connected to the information inputs of the first parallel register, the two most significant bits of the information outputs of which are connected to the first information inputs of the first block for the formation of partial residues, the second information inputs of the device are connected to the second information inputs of the partial residue formation blocks, the information outputs of the ( n − 1)th partial residue formation unit are connected to the device information outputs, the information outputs of the i -th partial residue formation unit, i =(1, ..., ( n − 2)), connected to m low bits info inputs of the ( i +1)th parallel register, where m is the capacity of the module, the m least significant bits of the information outputs of which are connected to the (2, …, ( m +1))-th bits of the first information inputs of the ( i +1)th of the block for forming partial residues, with the first bit of the first information inputs of which the most senior ( ni + m )-th bit of information outputs of the ( i +1)-th parallel register, ( ni −1) of the most significant bits of the information inputs of which are connected with ( ni − 1) senior digits of the information outputs of the i -th parallel register, the capacity of the first parallel register is n , and the i -th parallel register is ( m + ni ), and the block for forming partial residues contains an adder and a multiplexer, the first information inputs of the adder and the multiplexer are connected to the first information inputs of the block for forming partial residues, the second information inputs of the adder are connected to the second information inputs of the block for forming partial logical residues, the information outputs of the adder are connected to the second information inputs of the multiplexer, and the transfer output is connected to the control input of the multiplexer, the outputs of which are the information outputs of the block for the formation of partial residues, and a logical unit signal is applied to the transfer input of the adder.
RU2022134138A 2022-12-23 Pipeline generator of remainders by an arbitrary modulus RU2791440C1 (en)

Publications (1)

Publication Number Publication Date
RU2791440C1 true RU2791440C1 (en) 2023-03-07

Family

ID=

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2324972C2 (en) * 2006-01-31 2008-05-20 Ставропольский военный институт связи ракетных войск Creator of random module reminder of number
RU2348965C1 (en) * 2007-05-25 2009-03-10 Государственное образовательное учреждение высшего профессионального образования "Ставропольский государственный университет" Computing mechanism
RU2421781C1 (en) * 2009-10-19 2011-06-20 Государственное образовательное учреждение высшего профессионального образования Казанский государственный технический университет им. А.Н. Туполева Apparatus for generating remainder for given modulo
US20140129601A1 (en) * 2012-05-19 2014-05-08 Eric B. Olsen Conversion apparatus for a residue number arithmetic logic unit
US20190339944A1 (en) * 2018-05-04 2019-11-07 Eric B. Olsen Reverse conversion apparatus for residue numbers

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2324972C2 (en) * 2006-01-31 2008-05-20 Ставропольский военный институт связи ракетных войск Creator of random module reminder of number
RU2348965C1 (en) * 2007-05-25 2009-03-10 Государственное образовательное учреждение высшего профессионального образования "Ставропольский государственный университет" Computing mechanism
RU2421781C1 (en) * 2009-10-19 2011-06-20 Государственное образовательное учреждение высшего профессионального образования Казанский государственный технический университет им. А.Н. Туполева Apparatus for generating remainder for given modulo
US20140129601A1 (en) * 2012-05-19 2014-05-08 Eric B. Olsen Conversion apparatus for a residue number arithmetic logic unit
US20190339944A1 (en) * 2018-05-04 2019-11-07 Eric B. Olsen Reverse conversion apparatus for residue numbers

Similar Documents

Publication Publication Date Title
Zimmermann Efficient VLSI implementation of modulo (2/sup n//spl plusmn/1) addition and multiplication
US5132925A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
EP0356153B1 (en) Radix-2**n divider method and apparatus using overlapped quotient bit selection and concurrent quotient rounding and correction
Savas et al. Multiplier architectures for GF (p) and GF (2n)
Patronik et al. Design of Reverse Converters for the New RNS Moduli Set $\{2^{n}+ 1, 2^{n}-1, 2^{n}, 2^{n-1}+ 1\} $($ n $ odd)
US5025408A (en) Bit serial multiplier with parallel-in-serial-out carry and partial product shift registers
Tynymbayev et al. Devices for multiplying modulo numbers with analysis of the lower bits of the multiplier
RU2696223C1 (en) Arithmetic logic unit for generating residual by arbitrary module from number
Hong et al. Radix-4 modular multiplication and exponentiation algorithms for the RSA public-key cryptosystem
Asadi et al. CORLD: In-stream correlation manipulation for low-discrepancy stochastic computing
RU2791440C1 (en) Pipeline generator of remainders by an arbitrary modulus
RU2299461C1 (en) Modulus multiplexer
RU2717915C1 (en) Computing device
RU2797163C1 (en) Pipeline calculator
US7607165B2 (en) Method and apparatus for multiplication and/or modular reduction processing
RU2804380C1 (en) Pipeline calculator
Piestrak Design of multi-residue generators using shared logic
RU2661797C1 (en) Computing device
RU2324972C2 (en) Creator of random module reminder of number
RU2796555C1 (en) Computing device
RU2797164C1 (en) Pipeline module multiplier
KR20070062901A (en) Apparatus and method for modular multiplication using chhinese remainder theorem and carry save adder
Tynymbayev et al. Devices for Modular Multiplication of Numbers with Analysis of Two Least Significant Bits of the Multiplier.
RU2798746C1 (en) Computing device
Vergos et al. On the use of diminished-1 adders for weighted modulo 2n+ 1 arithmetic components