RU2756408C1 - Computing apparatus - Google Patents

Computing apparatus Download PDF

Info

Publication number
RU2756408C1
RU2756408C1 RU2020125188A RU2020125188A RU2756408C1 RU 2756408 C1 RU2756408 C1 RU 2756408C1 RU 2020125188 A RU2020125188 A RU 2020125188A RU 2020125188 A RU2020125188 A RU 2020125188A RU 2756408 C1 RU2756408 C1 RU 2756408C1
Authority
RU
Russia
Prior art keywords
input
output
information
information inputs
conversion
Prior art date
Application number
RU2020125188A
Other languages
Russian (ru)
Inventor
Вячеслав Иванович Петренко
Original Assignee
федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" filed Critical федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет"
Priority to RU2020125188A priority Critical patent/RU2756408C1/en
Application granted granted Critical
Publication of RU2756408C1 publication Critical patent/RU2756408C1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/14Conversion to or from non-weighted codes
    • H03M7/18Conversion to or from residue codes

Abstract

FIELD: computing technology.
SUBSTANCE: disclosed is a computing apparatus for finding the remainder modulo and the partial quotient, ensuring computation of the remainder R of the number A modulo P by means of sequential execution of (n/2-1) operations, wherein n is the amount of bits of the input number A in accordance with the expression: R=(22(22...(22(an-1·2+an-2)+(an-3·2+an-4))+…+(a3·2+a2))+(a 1·2+a 0)) mod P, wherein a i,
Figure 00000008
are the coefficients in the binary representation of the number A.
EFFECT: increase in the operation speed of the apparatus for computing the remainder modulo and the partial quotient.
1 cl, 2 dwg, 4 tbl

Description

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

Известно устройство для формирования остатка по произвольному модулю от числа, содержащее регистры, элементы ИЛИ, вычислитель, схемы сравнения, мультиплексор, элемент задержки, сумматор, группу блоков элементов «И» и блок постоянной памяти со связями (см. АС СССР №1633495, кл. H 03 M 7/18, 1991). Недостатком известного устройства является низкая надежность, так как для его реализации требуется большой объем оборудования.There is a known device for forming the remainder of an arbitrary modulus of a number, containing registers, OR elements, a calculator, comparison circuits, a multiplexer, a delay element, an adder, a group of blocks of elements "I" and a block of permanent memory with connections (see AS USSR No. 1633495, cl . H 03 M 7/18, 1991). The disadvantage of the known device is low reliability, since its implementation requires a large amount of equipment.

Известен комбинационный рекуррентный формирователь остатков, содержащий комбинационный формирователь частичных остатков, блок ключей и блок сумматоров по модулю (см. патент РФ №2029435, кл. 6 H 03 M 7/18, 20.02.1995, бюл. №5). Недостатком данного устройства являются его ограниченные функциональные возможности, а именно отсутствие возможности формирования неполного частного.Known is a combinational recurrent generator of residuals containing a combinational former of partial residuals, a block of keys and a block of modular adders (see RF patent No. 2029435, cl. 6 H 03 M 7/18, 20.02.1995, bull. No. 5). The disadvantage of this device is its limited functionality, namely the lack of the possibility of forming an incomplete private.

Известно вычислительное устройство, содержащее сумматоры и мультиплексоры (см. патент РФ № 2348965, МПК G06F 7/72 (2006.01), H03M 7/18 (2006.01), 10.03.2009. Бюл. № 7). Недостатком данного вычислительного устройства является большой объем оборудования.Known computing device containing adders and multiplexers (see RF patent No. 2348965, IPC G06F 7/72 (2006.01), H03M 7/18 (2006.01), 03/10/2009. Bull. No. 7). The disadvantage of this computing device is the large amount of equipment.

Наиболее близким по технической сущности к заявляемому изобретению является вычислительное устройство, содержащее сумматоры и мультиплексоры (см. патент РФ № 2717915, МПК G06F 7/72 (2006.01), H03M 7/18 (2006.01), 26.03.2020. Бюл. № 9). Недостатком данного вычислительного устройства является низкое быстродействие.The closest in technical essence to the claimed invention is a computing device containing adders and multiplexers (see RF patent No. 2717915, IPC G06F 7/72 (2006.01), H03M 7/18 (2006.01), 03/26/2020. Bull. No. 9) ... The disadvantage of this computing device is its low performance.

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

Для достижения технического результата в вычислительное устройство, содержащее (n/2-1) сумматоров, (n/2-1) мультиплексоров, где n-разрядность входного числа,

Figure 00000001
– четное и больше 2, образующих (n/2-1) ступеней преобразования, вход подачи двоичного кода числа, выход двоичного кода неполного частного, выход двоичного кода остатка от числа дополнительно введены на каждой ступени преобразования три схемы сравнения, трехвходовый элемент ИЛИ и двухвходовый элемент И, на первые информационные входы первых схем сравнения всех ступеней преобразования подается двоичный код модуля, на первые информационные входы вторых схем сравнения всех ступеней преобразования подается двоичный код удвоенного модуля, на первые информационные входы третьих схем сравнения всех ступеней преобразования подается двоичный код утроенного модуля, выходы первой, второй и третьей схем сравнения соединены соответственно с первым, вторым и третьим управляющими входами мультиплексора и с первым, вторым и третьим входами трехвходового элемента ИЛИ соответствующих ступеней преобразования, выход трехвходового элемента ИЛИ каждой ступени преобразования соединен с первым входом двухвходового элемента И соответствующей ступени преобразования, на второй вход двухвходового элемента И всех ступеней преобразования подается логическая единица, выход двухвходовых элементов И всех ступеней преобразования соединен со входом переноса сумматоров соответствующей ступени преобразования, на первый, второй и третий информационные входы мультиплексоров всех ступеней преобразования подаются соответственно инверсные двоичные коды модуля, удвоенного модуля и утроенного модуля, первые информационные выходы мультиплексоров всех ступеней преобразования соединены с первыми информационными входами сумматоров соответствующих ступеней преобразования, j-е разряды вторых информационных входов сумматоров и вторых информационных входов схем сравнения i-й ступени преобразования, где j=(0;1), соединены с (n-2i-j-1)-ми разрядами двоичного кода входного числа соответственно, второй и третий разряды вторых информационных входов сумматора и вторых информационных входов схем сравнения первой ступени преобразования соединены с (n-2)-м и (n-1)-м разрядами двоичного кода входного числа соответственно, информационные выходы сумматоров i-й ступени преобразования, где i=1,.., n/2-2, соединены со сдвигом на два разряда в сторону старших со вторыми информационными входами сумматоров и вторыми информационными входами схем сравнения (i+1)-й ступени преобразования, информационный выход сумматора (n/2-1)-й ступени преобразования является выходом двоичного кода остатка, вторые информационные выходы мультиплексоров являются выходом двоичного кода неполного частного, причем мультиплексор каждой ступени преобразования содержит два инвертора, трехвходовый элемент И, двухвходовый элемент И, три ключа, блок элементов ИЛИ и два элемента ИЛИ, причем первый вход трехвходового элемента И является первым управляющим входом мультиплексора, первый вход двухвходового элемента И является вторым управляющим входом мультиплексора и соединен со входом первого инвертора, выход которого соединен со вторым входом трехвходового элемента И, управляющий вход третьего ключа является третьим управляющим входом мультиплексора и соединен со входом второго инвертора и со вторыми входами первого и второго элементов ИЛИ, выходы которых являются вторым информационным выходом мультиплексора, выход второго инвертора соединен с третьим входом трехвходового элемента И и со вторым входом двухвходового элемента И, выход которого соединен с управляющим входом второго ключа и с первым входом второго элемента ИЛИ, выход трехвходового элемента И соединен с первым входом первого элемента ИЛИ и с управляющим входом первого ключа, информационные входы первого, второго и третьего ключей являются соответствующими информационными входами мультиплексора, а выходы соединены с соответствующими информационными входами блока элементов ИЛИ, выход которого является первым информационным выходом мультиплексора.To achieve a technical result in a computing device containing ( n / 2-1) adders, ( n / 2-1) multiplexers, where n is the input number,
Figure 00000001
- even and more than 2 forming ( n / 2-1) conversion steps, input for feeding the binary code of a number, output of the binary code of an incomplete quotient, output of the binary code of the remainder of the number, three comparison circuits, a three-input OR element and a two-input element And, the binary code of the module is fed to the first information inputs of the first comparison circuits of all conversion stages, the binary code of the doubled modulus is fed to the first information inputs of the second comparison circuits of all conversion stages, the binary code of the triple modulus is fed to the first information inputs of the third comparison circuits of all conversion stages, the outputs of the first, second and third comparison circuits are connected respectively to the first, second and third control inputs of the multiplexer and to the first, second and third inputs of the three-input OR element of the corresponding conversion stages, the output of the three-input OR element of each conversion stage is connected to the first input of the two-in of one AND element of the corresponding conversion stage, a logical unit is supplied to the second input of the two-input AND element of all conversion stages, the output of the two-input AND elements of all conversion stages is connected to the transfer input of the adders of the corresponding conversion stage, to the first, second and third information inputs of the multiplexers of all conversion stages, respectively inverse binary codes of the module, doubled module and triple module, the first information outputs of the multiplexers of all conversion stages are connected to the first information inputs of the adders of the corresponding conversion stages, the j -th bits of the second information inputs of the adders and the second information inputs of the comparison circuits of the i- th conversion stage, where j = (0; 1), connected to the ( n -2 i - j -1) th bits of the binary code of the input number, respectively, the second and third bits of the second information inputs of the adder and the second information inputs of the comparison circuits of the first conversion stages are connected to the ( n -2) -th and ( n -1) -th bits of the binary code of the input number, respectively, the information outputs of the adders of the i -th conversion stage, where i = 1, .., n / 2-2, are connected with a shift by two digits towards the higher ones with the second information inputs of the adders and the second information inputs of the comparison circuits of the ( i + 1) -th conversion stage, the information output of the adder of the ( n / 2-1) -th conversion stage is the output of the binary code of the remainder, the second the information outputs of the multiplexers are the output of the binary code of an incomplete quotient, and the multiplexer of each conversion stage contains two inverters, a three-input AND gate, a two-input AND gate, three keys, an OR gate and two OR gates, and the first input of the three-input AND gate is the first control input of the multiplexer, the first input of the two-input AND element is the second control input of the multiplexer and is connected to the input of the first inverter, the output of which is connected n with the second input of the three-input element AND, the control input of the third key is the third control input of the multiplexer and is connected to the input of the second inverter and to the second inputs of the first and second OR elements, the outputs of which are the second information output of the multiplexer, the output of the second inverter is connected to the third input of the three-input element And and with the second input of the two-input AND element, the output of which is connected to the control input of the second key and to the first input of the second OR element, the output of the three-input AND element is connected to the first input of the first OR element and to the control input of the first key, information inputs of the first, second and third keys are the corresponding information inputs of the multiplexer, and the outputs are connected to the corresponding information inputs of the OR element block, the output of which is the first information output of the multiplexer.

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

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

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

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

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

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

ПричемMoreover

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

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

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

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

где a i ,

Figure 00000002
– коэффициенты, принимающие значение 0 или 1 в зависимости от значения числа A; where a i ,
Figure 00000002
- coefficients taking 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 taking 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 incomplete quotient Q ;

r i ,

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

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

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

AR (mod P). (6) AR (mod P ). (6)

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

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

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

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

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

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

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

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

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

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

A = 22(2 n -4(a n -1 ·2+a n -2)+ 2 n -6 (a n -3 ·2+a n -4)+ . . . + (a 3 ·2+a 2))+(a 1 ·2+a 0), (10) A = 22(2 n -4(a n -1 ·2+a n -2) + 2 n -6 (a n -3 ·2+a n -4) +. ... ... + (a 3 ·2+a 2)) + (a 1 ·2+a 0), (ten)

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

A = 22(22…(22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4))+ . . . + (a 3 ·2+a 2))+(a 1 ·2+a 0), (11) A = February 2 (Feb. 2 ... (Feb. 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4)) +... + (A 3 · 2+ a 2)) + (a 1 a 0 · 2+), (11)

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

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

R = (22(22…(22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4))+ . . . + (a 3 ·2+a 2))+(a 1 ·2+a 0)) mod P. (12) R = (2 2 (2 ... 2 (2 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4)) +... + (A 3 2 · + a 2)) + (a 1 · 2+ a 0)) mod P. (12)

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

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

Вначале на первой ступени преобразования вычисляют величину First, at the first stage of conversion, the value is calculated

t 1=(22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4)) mod P. (13) t = 1 (February 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4)) mod P. (13)

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

t 2=(22 ·t 1+(a n -5 ·2+a n -6)) mod P. (14) t 2 = (2 · t 2 1 + (a n -5 · 2+ a n -6)) mod P. (fourteen)

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

t n /2-1=(22 ·t n /2-2+(a 1 ·2+a 0)) mod P, (15)mod P, (15) t n / 2-1 = (( a 1 · 2+ a 0) 2 February · t n / 2-2 +)

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

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

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

t i =22 t i -1 +(a n -2 i -1 ·2+a n -2 i -2), (16) t i = t i February 2 -1 + (-2 a n i -1 · 2+ a -2 i n -2), (16)

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

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

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

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

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

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

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

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

Условия попадания значения t i в один из указанных в таблице 1 интервалов определяются значениями сигналов сравнения «больше или равно» на выходах сравнения схем сравнения в соответствии с таблицей 2.The conditions for hitting the value of t i in one of the intervals indicated in Table 1 are determined by the values of the comparison signals “greater than or equal to” at the outputs of the comparison of the comparison circuits in accordance with Table 2.

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

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

Таким образом, если значение сигналов сравнения равно «1» на выходах сравнения всех трех схем сравнения, то t i (mod P)=t i - 3P, если значение сигналов сравнения равно «1» на выходах сравнения двух схем сравнения, то t i (mod P)=t i - 2P, если значение сигнала сравнения равно «1» на выходах сравнения одной схемы сравнения, то t i (mod P)=t i P. Если значение сигналов сравнения равно «0» на выходах сравнения всех трех схем сравнения, то тогда t i (mod P)=t i , т.е. операция вычитания модуля P из величины t i не выполняется.Thus, if the value of the comparison signals is equal to "1" at the comparison outputs of all three comparison circuits, thent i (modP) =t i - 3P, if the value of the comparison signals is equal to "1" at the comparison outputs of the two comparison circuits, thent i (modP) =t i - 2P, if the value of the comparison signal is equal to "1" at the comparison outputs of one comparison circuit, thent i (modP) =t i -P... If the value of the comparison signals is "0" at the comparison outputs of all three comparison circuits, thent i (modP) =t i , i.e. modulus subtraction operationP from the magnitudet i not executed.

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

Вычислительное устройство содержит (n/2-1) ступеней преобразования, где n-разрядность входного числа, каждая из которых содержит сумматоры 1 и мультиплексоры 2, три схемы сравнения 3, трехвходовый элемент ИЛИ 4, двухвходовый элемент И 5, вход 6 подачи двоичного кода числа A, выход 7 двоичного кода неполного частного Q и выход 8 двоичного кода остатка R от числа A. На первые информационные входы первых схем сравнения 3 всех ступеней преобразования подается двоичный код модуля, на первые информационные входы вторых схем сравнения 3 всех ступеней преобразования подается двоичный код удвоенного модуля, на первые информационные входы третьих схем сравнения 3 всех ступеней преобразования подается двоичный код утроенного модуля. Выходы первой, второй и третьей схем сравнения 3 соединены соответственно с первым, вторым и третьим управляющими входами мультиплексора 2 и с первым, вторым и третьим входами трехвходового элемента ИЛИ 4 соответствующих ступеней преобразования. Выход элемента ИЛИ 4 каждой ступени преобразования соединен с первым входом двухвходового элемента И 5 соответствующей ступени преобразования. На второй вход двухвходового элемента И 5 всех ступеней преобразования подается логическая единица, выход двухвходовых элементов И 5 всех ступеней преобразования соединен со входом переноса сумматоров 1 соответствующей ступени преобразования. На первый, второй и третий информационные входы мультиплексоров 2 всех ступеней преобразования подаются соответственно инверсные двоичные коды модуля, удвоенного модуля и утроенного модуля. Первые информационные выходы мультиплексоров 2 всех ступеней преобразования соединены с первыми информационными входами сумматоров 1 соответствующих ступеней преобразования, j-е разряды вторых информационных входов сумматоров 1 и вторых информационных входов схем сравнения 3 i-й ступени преобразования, где j=(0;1), соединены с (n-2i-j-1)-ми разрядами двоичного кода 6 входного числа соответственно. Второй и третий разряды вторых информационных входов сумматора 1 и вторых информационных входов схем сравнения 3 первой ступени преобразования соединены с (n-2)-м и (n-1)-м разрядами двоичного кода 6 входного числа соответственно. Информационные выходы сумматоров 1 i-й ступени преобразования, где i=1,.., n/2-2, соединены со сдвигом на два разряда в сторону старших со вторыми информационными входами сумматоров 1 и вторыми информационными входами схем сравнения 3 (i+1)-й ступени преобразования. Информационный выход сумматора 1 (n/2-1)-й ступени преобразования является выходом 8 двоичного кода остатка. Вторые информационные выходы мультиплексоров 2 являются выходом 7 двоичного кода неполного частного.The computing device contains ( n / 2-1) conversion stages, where n is the bit width of the input number, each of which contains adders 1 and multiplexers 2, three comparison circuits 3, three-input OR gate 4, two-input AND gate 5, input 6 of the binary code feed number A , output 7 of the binary code of the incomplete quotient Q and output 8 of the binary code of the remainder R of the number A. The binary code of the module is supplied to the first information inputs of the first comparison circuits 3 of all conversion stages, the binary code of the doubled module is supplied to the first information inputs of the second comparison circuits 3 of all conversion stages, the binary code of the triple unit is supplied to the first information inputs of the third comparison circuits 3 of all conversion stages. The outputs of the first, second and third comparison circuits 3 are connected, respectively, to the first, second and third control inputs of the multiplexer 2 and to the first, second and third inputs of the three-input OR element 4 of the corresponding conversion stages. The output of the OR element 4 of each conversion stage is connected to the first input of the two-input AND element 5 of the corresponding conversion stage. A logical unit is fed to the second input of the two-input element AND 5 of all conversion stages, the output of the two-input elements AND 5 of all conversion stages is connected to the transfer input of adders 1 of the corresponding conversion stage. At the first, second and third information inputs of multiplexers 2 of all conversion stages, respectively, inverse binary codes of the module, doubled module and tripled module are supplied. The first information outputs of the multiplexers 2 of all conversion stages are connected to the first information inputs of the adders 1 of the corresponding conversion stages, the j -th bits of the second information inputs of the adders 1 and the second information inputs of the comparison circuits 3 of the i -th conversion stage, where j = (0; 1), connected to the ( n -2 i - j -1) th bits of the binary code 6 of the input number, respectively. The second and third bits of the second information inputs of the adder 1 and the second information inputs of the comparison circuits 3 of the first conversion stage are connected to the ( n -2) th and ( n -1) th bits of the binary code 6 of the input number, respectively. The information outputs of the adders 1 of the i- th conversion stage, where i = 1, .., n / 2-2, are connected with a two-bit shift towards the higher ones with the second information inputs of the adders 1 and the second information inputs of the comparison circuits 3 ( i +1 ) of the th stage of transformation. The information output of the adder 1 ( n / 2-1) -th conversion stage is the output 8 of the binary code of the remainder. The second information outputs of the multiplexers 2 are the output 7 of the binary code of the partial private.

На фиг.2 представлена схема мультиплексоров 2.Figure 2 shows a diagram of multiplexers 2.

Мультиплексоры 2 содержат три инвертора 9, трехвходовый элемент И 10, двухвходовый элемент И 11, три ключа 12, блок элементов ИЛИ 13 и два элемента ИЛИ 14. Первый вход трехвходового элемента И 10 является первым управляющим входом мультиплексора 2. Первый вход двухвходового элемента И 11 является вторым управляющим входом мультиплексора 2 и соединен со входом первого инвертора 9, выход которого соединен со вторым входом трехвходового элемента И 10. Управляющий вход третьего ключа 12 является третьим управляющим входом мультиплексора 2 и соединен со входом второго инвертора 9 и со вторыми входами первого и второго элементов ИЛИ 14, выходы которых являются вторым информационным выходом мультиплексора 2. Выход второго инвертора 9 соединен с третьим входом трехвходового элемента И 10 и со вторым входом двухвходового элемента И 11, выход которого соединен с управляющим входом второго ключа 12 и с первым входом второго элемента ИЛИ 14. Выход трехвходового элемента И 10 соединен с первым входом первого элемента ИЛИ 14 и с управляющим входом первого ключа 12. Информационные входы первого, второго и третьего ключей 12 являются соответствующими информационными входами мультиплексора 2, а выходы соединены с соответствующими информационными входами блока элементов ИЛИ 13, выход которого является первым информационным выходом мультиплексора 2.Multiplexers 2 contain three inverters 9, a three-input AND element 10, a two-input AND element 11, three switches 12, a block of OR elements 13 and two OR elements 14. The first input of a three-input AND element 10 is the first control input of multiplexer 2. The first input of a two-input AND element 11 is the second control input of the multiplexer 2 and is connected to the input of the first inverter 9, the output of which is connected to the second input of the three-input element AND 10. The control input of the third key 12 is the third control input of the multiplexer 2 and is connected to the input of the second inverter 9 and to the second inputs of the first and second OR elements 14, the outputs of which are the second information output of the multiplexer 2. The output of the second inverter 9 is connected to the third input of the three-input AND element 10 and to the second input of the two-input AND element 11, the output of which is connected to the control input of the second key 12 and to the first input of the second OR element 14. The output of the three-input element And 10 is connected to the first input th of the first OR element 14 and with the control input of the first key 12. The information inputs of the first, second and third keys 12 are the corresponding information inputs of the multiplexer 2, and the outputs are connected to the corresponding information inputs of the OR element block 13, the output of which is the first information output of the multiplexer 2.

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

На вход 6 устройства подается двоичный код числа A от которого необходимо сформировать остаток R и неполное частное Q. Старшие разряды числа A подаются на вход первой ступени преобразования, а младшие – на вход последней. The binary code of the number A is fed to the input 6 of the device, from which it is necessary to form the remainder R and the incomplete quotient Q. The high-order bits of the number A are fed to the input of the first conversion stage, and the low-order ones are fed to the input of the last one.

На первые информационные входы первых схем сравнения 3 всех ступеней преобразования подается двоичный код модуля P, вторых схем сравнения 3 – удвоенный двоичный код модуля P, третьих схем сравнения 3 – утроенный двоичный код модуля P. The binary code of the P module is fed to the first information inputs of the first comparison circuits 3 of all conversion stages, the second comparison circuits 3 - the doubled binary code of the P module, the third comparison circuits 3 - the triple binary code of the P module.

На первые информационные входы мультиплексоров 2 всех ступеней преобразования подается инверсный двоичный код модуля P, на вторые информационные входы – удвоенный инверсный двоичный код модуля P, а на третьи информационные входы – утроенный инверсный код модуля P. The inverse binary code of the P module is fed to the first information inputs of the multiplexers 2 of all conversion stages, the double inverse binary code of the P module is fed to the second information inputs, and the triple inverse code of the P module is fed to the third information inputs.

На первой ступени преобразования осуществляется вычисление значения t 1=(22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4)) mod P. Причем вычисление значения 22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4) осуществляется путем подачи соответствующих разрядов a n -1 …a n -4 на соответствующие входы первой ступени преобразования. Для приведения этого значения по модулю P с помощью схем сравнения 3 осуществляют одновременное сравнение значений P, 2P и 3P с входным значением и в зависимости от того, в каком диапазоне находится входное значение, в соответствии с табл. 2 появляются сигналы на соответствующих выходах «больше или равно» схем сравнения 3, которые далее поступают на соответствующие управляющие входы мультиплексора 2. The first stage computes the conversion value t = 1 (February 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4)) mod P. Wherein calculating values February 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4) is carried out by supplying respective bits of a n -1 ... a n -4 to respective inputs of the first transformation stages. To bring this value modulo P using the comparison circuits 3, the values of P , 2 P and 3 P are simultaneously compared with the input value and, depending on the range of the input value, in accordance with table. 2, signals appear at the corresponding outputs "greater than or equal" of the comparison circuits 3, which are then fed to the corresponding control inputs of the multiplexer 2.

Управляющие сигналы мультиплексора 2 (см. Фиг. 2) открывают один из ключей 12. The control signals of the multiplexer 2 (see Fig. 2) open one of the keys 12.

Если управляющий сигнал появляется на всех трех управляющих входах, то окажется открытым третий ключ 12. Управляющий сигнал с третьего управляющего входа откроет третий ключ 12 и через второй инвертор 9 в виде логического нуля поступит на третий вход трехвходового элемента И 10 и на второй вход двухвходового элемента И 11, запрещая прохождение управляющих сигналов с их первых входов на их выходы. В результате первый и второй ключи 12 окажутся закрытыми и на выход мультиплексора 2 поступит значение инверсного двоичного кода утроенного модуля P с его третьего информационного входа. В результаты на выходе сумматора 1 окажется величина 22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4) - 3P.If the control signal appears at all three control inputs, then the third key 12 will be open. The control signal from the third control input will open the third key 12 and, through the second inverter 9, it will be fed as a logical zero to the third input of the three-input element AND 10 and to the second input of the two-input element And 11, prohibiting the passage of control signals from their first inputs to their outputs. As a result, the first and second keys 12 will be closed and the output of the multiplexer 2 will receive the value of the inverse binary code of the triple module P from its third information input. The results at the output of the adder would be the value of 1 February 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4) - 3 P.

Если управляющий сигнал появляется на первом и втором управляющих входах мультиплексора 2, то аналогичным образом окажется открытым только второй ключ 12, а первый и третий ключи 12 окажутся закрытыми. В результате на выход мультиплексора 2 поступит значение инверсного двоичного кода удвоенного модуля P с его второго информационного входа. На выходе сумматора 1 окажется величина 22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4) - 2P. If the control signal appears at the first and second control inputs of the multiplexer 2, then in the same way only the second key 12 will be open, and the first and third keys 12 will be closed. As a result, the output of the multiplexer 2 will receive the value of the inverse binary code of the doubled module P from its second information input. At the output of the adder would be the value of 1 2 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4) - 2 P.

Если управляющий сигнал появляется только на первом управляющем входе мультиплексора 2, то аналогичным образом окажется открытым только первый ключ 12, а второй и третий ключи 12 окажутся закрытыми. В результате на выход мультиплексора 2 поступит значение инверсного двоичного кода модуля P с его первого информационного входа. На выходе сумматора 1 окажется величина 22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4) - P.If the control signal appears only at the first control input of the multiplexer 2, then in the same way only the first key 12 will be open, and the second and third keys 12 will be closed. As a result, the output of the multiplexer 2 will receive the value of the inverse binary code of the module P from its first information input. At the output of the adder would be the value of 1 February 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4) - P.

Если же на управляющих входах мультиплексора 2 будут только нулевые сигналы, то все ключи 12 окажутся закрытыми и на выходе мультиплексора 2 образуется нулевое значение. В результате на выходе сумматора 1 окажется величина 22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4).If there are only zero signals at the control inputs of the multiplexer 2, then all keys 12 will be closed and a zero value is formed at the output of the multiplexer 2. As a result, the output of the adder 1 will be the value 2 2 ( a n -1 · 2+ a n -2 ) + ( a n -3 · 2+ a n -4 ).

Сформированное на первой ступени преобразования значение t 1=(22(a n -1 ·2+a n -2)+(a n -3 ·2+a n -4)) mod P поступает со сдвигом на два разряда в сторону старших (т.е. фактически осуществляя умножение на 22) на вход следующей ступени преобразования. На младшие два разряда подаются сигналы a n -5, a n -6 разрядов входного числа A.Formed in the first stage conversion value t = 1 (February 2 (a n -1 · 2+ a n -2) + (a n -3 · 2+ a n -4)) mod P arrives shifted by two bits in the direction senior (ie actually carrying out multiplication by 2 2 ) at the input of the next transformation stage. Signals a n -5 , a n -6 bits of the input number A are applied to the least significant two bits.

На второй ступени преобразования осуществляются аналогичные вычисления. Аналогично происходит работа устройства и на остальных ступенях преобразования.In the second stage of the transformation, similar calculations are carried out. The device operates in a similar way at the rest of the conversion stages.

Так как на каждой ступени преобразования осуществляется обработка одновременно двух разрядов входного числа, то через (n/2-1) преобразований на выходе 8 устройства сформируется двоичный код остатка R от числа A по модулю P, а на выходе 7 устройства сформируется двоичный код неполного частного Q. Since at each conversion stage, two bits of the input number are processed simultaneously, then through ( n / 2-1) transformations at the output 8 of the device, a binary code of the remainder R of the number A modulo P is formed , and at the output 7 of the device, a binary code of an incomplete quotient Q.

Рассмотрим работу вычислительного устройства на примере.Let's consider the operation of a computing device using an example.

Пусть входное число A=21510=110101112, модуль P=610=000001102, разрядность n=8. Двоичные прямые и инверсные коды значений модуля P, 2P, 3P представлены в табл. 3.Let the input number A = 215 10 = 11010111 2 , module P = 6 10 = 00000110 2 , bit width n = 8. Binary direct and inverse codes of values of the modulus P , 2 P , 3 P are presented in table. 3.

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

Двоичный прямой кодBinary straight code Двоичный инверсный кодBinary inverse code Модуль P =6Module P = 6 0000011000000110 1111100111111001 Значение 2P = 122 P value = 12 0000110000001100 1111001111110011 Значение 3P = 183 P value = 18 0001001000010010 1110110111101101

Значения сигналов при работе устройства на входах и выходах сумматоров 1, мультиплексоров 2 и схем сравнения 3 представлены в табл. 4. Номер ступени преобразования приведен в первом столбце таблицы 4. «Схема сравнения 1», «Схема сравнения 2» и «Схема сравнения 3», соответственно обозначение первой, второй и третьей схем сравнения 3. «Мультиплексор инф» - обозначения информационных входов и выходов мультиплексоров 2, «Мультиплексор упр» - обозначения управляющих входов мультиплексоров 2. «Вход 1» и «Вход 2», соответственно первый и второй информационные входы сумматоров 1, мультиплексоров 2 и схем сравнения 3, а также первый и второй управляющий входы мультиплексоров 2. «Вход 3» - вход переноса сумматоров 1, а также третий информационный и третий управляющий вход мультиплексоров 2. «Выход 1» - информационные выходы сумматоров 1, мультиплексоров 2 и схем сравнения 3. «Выход 2» - второй информационный выход мультиплексоров 2.The values of the signals during the operation of the device at the inputs and outputs of adders 1, multiplexers 2 and comparison circuits 3 are presented in table. 4. The number of the conversion stage is given in the first column of Table 4. "Comparison circuit 1", "Comparison circuit 2" and "Comparison circuit 3", respectively designation of the first, second and third comparison circuits 3. "Multiplexer inf" - designations of information inputs and outputs of multiplexers 2, "Multiplexer control" - designations of the control inputs of multiplexers 2. "Input 1" and "Input 2", respectively, the first and second information inputs of adders 1, multiplexers 2 and comparison circuits 3, as well as the first and second control inputs of multiplexers 2 "Input 3" - the transfer input of adders 1, as well as the third information and third control inputs of multiplexers 2. "Output 1" - information outputs of adders 1, multiplexers 2 and comparison circuits 3. "Output 2" - the second information output of multiplexers 2.

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

№ стArt No. Вход/ВыходEnter exit Схема сравненияComparison circuit МультиплексорMultiplexer СумматорAdder 11 22 33 инфinf упрcontrol 11 Вход 1Entrance 1 0000011000000110 0000110000001100 0001001000010010 1111100111111001 11 1111001111110011 Вход 2Entrance 2 0000110100001101 0000110100001101 0000110100001101 1111001111110011 11 0000110100001101 Вход 3Entrance 3 -- -- -- 1110110111101101 00 11 Выход 1Exit 1 11 11 00 1111001111110011 -- 0000000100000001 Выход 2Exit 2 -- -- -- 10ten -- -- 22 Вход 1Entrance 1 0000011000000110 0000110000001100 0001001000010010 1111100111111001 00 0000000000000000 Вход 2Entrance 2 0000010100000101 0000010100000101 0000010100000101 1111001111110011 00 0000010100000101 Вход 3Entrance 3 -- -- -- 1110110111101101 00 00 Выход 1Exit 1 00 00 00 0000000000000000 -- 0000010100000101 Выход 2Exit 2 -- -- -- 0000 -- -- 33 Вход 1Entrance 1 0000011000000110 0000110000001100 0001001000010010 1111100111111001 11 1110110111101101 Вход 2Entrance 2 0001011100010111 0001011100010111 0001011100010111 1111001111110011 11 0001011100010111 Вход 3Entrance 3 -- -- -- 1110110111101101 11 11 Выход 1Exit 1 11 11 11 1110110111101101 -- 0000010100000101 Выход 2Exit 2 -- -- -- 11eleven -- --

В результате на информационных выходах сумматора 1 третьей ступени преобразования, являющихся выходом 8 двоичного кода остатка R от числа A устройства, образуется код числа 000001012=510, который и является вычисленным остатком R числа A=215 по модулю P=6, а на выходах 7 устройства образуется двоичный код 1000112=3510, который и является неполным частным Q. Непосредственной проверкой устанавливаем, что 215=35·6 + 5, что доказывает правильность функционирования устройства.As a result, at the information outputs of the adder 1 of the third transformation stage, which are the output 8 of the binary code of the remainder R of the number A of the device, the code of the number 00000101 2 = 5 10 is formed , which is the calculated remainder R of the number A = 215 modulo P = 6, and on the outputs 7 of the device generate a binary code 100011 2 = 35 10 , which is an incomplete partial Q. By direct verification, we establish that 215 = 35 · 6 + 5, which proves the correct functioning of the device.

В устройстве прототипе вычисление остатка осуществляется за (n-1) последовательных шагов преобразования, а в предлагаемом устройстве за (n/2-1) шагов. В результате быстродействие предлагаемого технического решения по сравнению с устройством прототипом будет выше не менее чем в два раза.In the prototype device, the remainder is calculated in ( n -1) sequential transformation steps, and in the proposed device, in ( n / 2-1) steps. As a result, the speed of the proposed technical solution in comparison with the prototype device will be at least twice as high.

Claims (1)

Вычислительное устройство для нахождения остатка по модулю и неполного частного, содержащее (n/2-1) сумматоров, (n/2-1) мультиплексоров, где n - разрядность входного числа, n – четное и больше 2, образующих (n/2-1) ступеней преобразования, вход подачи двоичного кода числа, выход двоичного кода неполного частного, выход двоичного кода остатка от числа, отличающееся тем, что в него дополнительно введены на каждой ступени преобразования три схемы сравнения, трехвходовый элемент ИЛИ и двухвходовый элемент И, на первые информационные входы первых схем сравнения всех ступеней преобразования подается двоичный код модуля, на первые информационные входы вторых схем сравнения всех ступеней преобразования подается двоичный код удвоенного модуля, на первые информационные входы третьих схем сравнения всех ступеней преобразования подается двоичный код утроенного модуля, выходы первой, второй и третьей схем сравнения соединены соответственно с первым, вторым и третьим управляющими входами мультиплексора и с первым, вторым и третьим входами трехвходового элемента ИЛИ соответствующих ступеней преобразования, выход трехвходового элемента ИЛИ каждой ступени преобразования соединен с первым входом двухвходового элемента И соответствующей ступени преобразования, на второй вход двухвходового элемента И всех ступеней преобразования подается логическая единица, выход двухвходовых элементов И всех ступеней преобразования соединен со входом переноса сумматоров соответствующей ступени преобразования, на первый, второй и третий информационные входы мультиплексоров всех ступеней преобразования подаются соответственно инверсные двоичные коды модуля, удвоенного модуля и утроенного модуля, первые информационные выходы мультиплексоров всех ступеней преобразования соединены с первыми информационными входами сумматоров соответствующих ступеней преобразования, j-е разряды вторых информационных входов сумматоров и вторых информационных входов схем сравнения i-й ступени преобразования, где j=(0; 1), соединены с (n-2i-j-1)-ми разрядами двоичного кода входного числа соответственно, второй и третий разряды вторых информационных входов сумматора и вторых информационных входов схем сравнения первой ступени преобразования соединены с (n-2)-м и (n-1)-м разрядами двоичного кода входного числа соответственно, информационные выходы сумматоров i-й ступени преобразования, где i=1, …, n/2-2, соединены со сдвигом на два разряда в сторону старших со вторыми информационными входами сумматоров и вторыми информационными входами схем сравнения (i+1)-й ступени преобразования, информационный выход сумматора (n/2-1)-й ступени преобразования является выходом двоичного кода остатка, вторые информационные выходы мультиплексоров являются выходом двоичного кода неполного частного, причем мультиплексор каждой ступени преобразования содержит два инвертора, трехвходовый элемент И, двухвходовый элемент И, три ключа, блок элементов ИЛИ и два элемента ИЛИ, причем первый вход трехвходового элемента И является первым управляющим входом мультиплексора, первый вход двухвходового элемента И является вторым управляющим входом мультиплексора и соединен со входом первого инвертора, выход которого соединен со вторым входом трехвходового элемента И, управляющий вход третьего ключа является третьим управляющим входом мультиплексора и соединен со входом второго инвертора и со вторыми входами первого и второго элементов ИЛИ, выходы которых являются вторым информационным выходом мультиплексора, выход второго инвертора соединен с третьим входом трехвходового элемента И и со вторым входом двухвходового элемента И, выход которого соединен с управляющим входом второго ключа и с первым входом второго элемента ИЛИ, выход трехвходового элемента И соединен с первым входом первого элемента ИЛИ и с управляющим входом первого ключа, информационные входы первого, второго и третьего ключей являются соответствующими информационными входами мультиплексора, а выходы соединены с соответствующими информационными входами блока элементов ИЛИ, выход которого является первым информационным выходом мультиплексора.A computing device for finding the remainder modulo and incomplete quotient, containing (n / 2-1) adders, (n / 2-1) multiplexers, where n is the bit width of the input number, n is even and more than 2, forming (n / 2- 1) conversion steps, input for feeding the binary code of a number, output of a binary code of an incomplete quotient, output of a binary code of the remainder of a number, characterized in that three comparison circuits, a three-input OR element and a two-input AND element, are additionally introduced into it at each conversion stage. the information inputs of the first comparison circuits of all conversion stages are fed the binary code of the module, the binary code of the doubled module is fed to the first information inputs of the second comparison circuits of all conversion stages, the binary code of the triple module is fed to the first information inputs of the third comparison circuits of all conversion stages, the outputs of the first, second and the third comparison circuits are connected respectively to the first, second and third control inputs of the multiplex ora and with the first, second and third inputs of the three-input element OR of the corresponding conversion stages, the output of the three-input element OR of each conversion stage is connected to the first input of the two-input element AND of the corresponding conversion stage, a logical unit is supplied to the second input of the two-input element AND of all conversion stages, the output of the two-input elements And all conversion stages are connected to the transfer input of the adders of the corresponding conversion stage, to the first, second and third information inputs of the multiplexers of all conversion stages, respectively, inverse binary codes of the module, doubled module and triple module are fed, the first information outputs of the multiplexers of all conversion stages are connected to the first information inputs adders of the corresponding conversion stages, the j-th bits of the second information inputs of the adders and the second information inputs of the comparison circuits of the i-th conversion stage, where j = (0; 1), are connected to the (n-2i-j-1) -th bits of the binary code of the input number, respectively, the second and third bits of the second information inputs of the adder and the second information inputs of the comparison circuits of the first conversion stage are connected to the (n-2) -th and (n-1) -th bits of the binary code of the input number, respectively, the information outputs of the adders of the i-th conversion stage, where i = 1, ..., n / 2-2, are connected with a two-bit shift towards the higher ones with the second information inputs of the adders and the second information inputs of the comparison circuits of the (i + 1) th conversion stage, the information output of the adder of the (n / 2-1) th conversion stage is the output of the binary code of the remainder, the second information outputs of the multiplexers are the output of the binary partial private code, and the multiplexer of each the conversion stage contains two inverters, a three-input AND element, a two-input AND element, three keys, a block of OR elements and two OR elements, and the first input of the three-input AND element is the first control input of the multiplexer, the first input of the two-input element And is the second control input of the multiplexer and is connected to the input of the first inverter, the output of which is connected to the second input of the three-input element AND, the control input of the third key is the third control input of the multiplexer and is connected to the input of the second inverter and to the second the inputs of the first and second OR elements, the outputs of which are the second information output of the multiplexer, the output of the second inverter is connected to the third input of the three-input AND element and to the second input of the two-input AND element, the output of which is connected to the control input of the second key and to the first input of the second OR element, the output of the three-input AND element is connected to the first input of the first OR element and to the control input of the first key, the information inputs of the first, second and third keys are the corresponding information inputs of the multiplexer, and the outputs are connected to the corresponding information inputs a block of OR elements, the output of which is the first information output of the multiplexer.
RU2020125188A 2020-07-29 2020-07-29 Computing apparatus RU2756408C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2020125188A RU2756408C1 (en) 2020-07-29 2020-07-29 Computing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2020125188A RU2756408C1 (en) 2020-07-29 2020-07-29 Computing apparatus

Publications (1)

Publication Number Publication Date
RU2756408C1 true RU2756408C1 (en) 2021-09-30

Family

ID=78000117

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2020125188A RU2756408C1 (en) 2020-07-29 2020-07-29 Computing apparatus

Country Status (1)

Country Link
RU (1) RU2756408C1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2796555C1 (en) * 2022-11-30 2023-05-25 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4555769A (en) * 1983-05-25 1985-11-26 International Business Machines Corporation Circuit apparatus for generating modulus-N residues
US4949293A (en) * 1987-09-25 1990-08-14 Kabushiki Kaisha Toshiba Method and apparatus for computing residue with respect to arbitrary modulus
RU2348965C1 (en) * 2007-05-25 2009-03-10 Государственное образовательное учреждение высшего профессионального образования "Ставропольский государственный университет" Computing mechanism
RU2717915C1 (en) * 2019-02-21 2020-03-26 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4555769A (en) * 1983-05-25 1985-11-26 International Business Machines Corporation Circuit apparatus for generating modulus-N residues
US4949293A (en) * 1987-09-25 1990-08-14 Kabushiki Kaisha Toshiba Method and apparatus for computing residue with respect to arbitrary modulus
RU2348965C1 (en) * 2007-05-25 2009-03-10 Государственное образовательное учреждение высшего профессионального образования "Ставропольский государственный университет" Computing mechanism
RU2717915C1 (en) * 2019-02-21 2020-03-26 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2796555C1 (en) * 2022-11-30 2023-05-25 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Computing device
RU2797163C1 (en) * 2023-02-13 2023-05-31 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Pipeline calculator
RU2804380C1 (en) * 2023-05-30 2023-09-28 федеральное государственное автономное образовательное учреждение высшего образования "Северо-Кавказский федеральный университет" Pipeline calculator

Similar Documents

Publication Publication Date Title
KR100267009B1 (en) Method and device for modular multiplication
Gokhale et al. Design of area and delay efficient Vedic multiplier using Carry Select Adder
US3878985A (en) Serial-parallel multiplier using booth{3 s algorithm with combined carry-borrow feature
RU2717915C1 (en) Computing device
RU2756408C1 (en) Computing apparatus
RU2348965C1 (en) Computing mechanism
US3842250A (en) Circuit for implementing rounding in add/subtract logic networks
RU2739338C1 (en) Computing device
RU2751802C1 (en) Modulo multiplier
RU2796555C1 (en) Computing device
US20070180014A1 (en) Sparce-redundant fixed point arithmetic modules
RU2798746C1 (en) Computing device
RU2755734C1 (en) Apparatus for multiplying numbers by an arbitrary modulus
RU2661797C1 (en) Computing device
RU2797164C1 (en) Pipeline module multiplier
Nadjia et al. High throughput parallel montgomery modular exponentiation on FPGA
US11829731B2 (en) Modular multiplication circuit and corresponding modular multiplication method
Awasthi et al. Hybrid signed digit arithmetic in efficient computing: A comparative approach to performance assay
RU2029435C1 (en) Combination recurrent former of remainders
Kukade et al. A Novel Parallel Multiplier for 2's Complement Numbers Using Booth's Recoding Algorithm
Sharma et al. Addition Of redundant binary signed digits using RBSD Adder
RU2804380C1 (en) Pipeline calculator
RU2791440C1 (en) Pipeline generator of remainders by an arbitrary modulus
RU2799035C1 (en) Conveyor totalizer by modulo
Abraham et al. An ASIC design of an optimized multiplication using twin precision