RU2696223C1 - Arithmetic logic unit for generating residual by arbitrary module from number - Google Patents

Arithmetic logic unit for generating residual by arbitrary module from number Download PDF

Info

Publication number
RU2696223C1
RU2696223C1 RU2018142842A RU2018142842A RU2696223C1 RU 2696223 C1 RU2696223 C1 RU 2696223C1 RU 2018142842 A RU2018142842 A RU 2018142842A RU 2018142842 A RU2018142842 A RU 2018142842A RU 2696223 C1 RU2696223 C1 RU 2696223C1
Authority
RU
Russia
Prior art keywords
input
output
bit
control unit
unit module
Prior art date
Application number
RU2018142842A
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 RU2018142842A priority Critical patent/RU2696223C1/en
Application granted granted Critical
Publication of RU2696223C1 publication Critical patent/RU2696223C1/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: computer equipment.SUBSTANCE: invention relates to computer engineering. Apparatus has three n-bit registers, where n is the number of input numbers, an inverter, (n + 1)-bit adder, a multiplexer, an electronic switch, input and output n-bit buses, and a control unit module.EFFECT: technical result consists in reduction of power consumption.1 cl, 2 dwg

Description

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

Известно устройство для формирования остатка по произвольному модулю от числа, содержащее первый и второй регистр, первый и второй элементы ИЛИ, вычислитель, первую схему сравнения и мультиплексор (Авторское свидетельство СССР N 1633495, кл. H03M 7/18, 1989).A device is known for generating a remainder modulo an arbitrary number, containing the first and second register, the first and second OR elements, a calculator, a first comparison circuit and a multiplexer (USSR Author's Certificate N 1633495, class H03M 7/18, 1989).

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

Известно устройство для формирования остатка по произвольному модулю от числа, содержащее l блоков формирования частичных остатков, (l+1) умножителей по модулю, сумматор по модулю и блок распределения коэффициентов (Патент РФ N 2324972, кл. G06F 7/72, H03M 7/18, 2008).A device is known for generating a remainder modulo an arbitrary number, containing l blocks for the formation of partial residues, (l + 1) modulators, an adder modulo and a coefficient distribution block (RF Patent N 2324972, class G06F 7/72, H03M 7 / 18, 2008).

Недостатком данного устройства является большой объем оборудования.The disadvantage of this device is the large amount of equipment.

Наиболее близким по технической сущности к заявляемому изобретению является арифметико-логическое устройство для выполнения операции деления, содержащее три 8-разрядных регистра, 8-разрядный сумматор, мультиплексор, инвертор, счетчик количества циклов, схему выработки признаков результата, четыре триггера, входную и выходную шины, модуль управляющего блока, содержащий 8-разрядные регистры делителя и делимого, двухканальный 8-разрядный мультиплексор, логические элементы «Исключающее ИЛИ», 8-разрядный сумматор, восемь JK-триггеров, логические элементы «НЕ И», дешифратор, инверторы, логические элементы «И», двоичный 4-разрядный счетчик циклов и логические элементы «ИЛИ» (Бабич Н.П., Жуков И.А. Компьютерная схемотехника. Методы построения и проектирования: Учебное пособие. – К.: «МК-Пресс», 2004. – 576 с. рис. 9.22, стр. 308-322).The closest in technical essence to the claimed invention is an arithmetic logic device for performing the division operation, containing three 8-bit registers, an 8-bit adder, a multiplexer, an inverter, a counter of the number of cycles, a circuit for generating the signs of the result, four triggers, input and output buses , a control unit module containing 8-bit divider and dividend registers, a two-channel 8-bit multiplexer, exclusive OR logic elements, an 8-bit adder, eight JK triggers, logic “NOT AND” elements, decoder, inverters, “AND” logic elements, binary 4-bit cycle counter and “OR” logic elements (Babich NP, Zhukov IA Computer circuitry. Construction and design methods: Educational allowance .-- K .: MK-Press, 2004. - 576 p. Fig. 9.22, p. 308-322).

Недостатком данного арифметико-логического устройства является большой объем оборудования.The disadvantage of this arithmetic-logical device is the large amount of equipment.

Техническим результатом данного изобретения является сокращение объема оборудования и, как следствие, уменьшение энергопотребления за счет исключения трех элементов «Исключающее ИЛИ», восьми JK-триггеров, двух инверторов, логического элемента «И», десяти логических элементов «НЕ И» и логического элемента «ИЛИ».The technical result of this invention is to reduce the amount of equipment and, as a result, reduce energy consumption by eliminating three exclusive OR elements, eight JK triggers, two inverters, an AND logic element, ten NOT AND logic elements and a logical element OR".

Для достижения технического результата в арифметико-логическое устройство для выполнения операции деления, содержащее три n-разрядных регистра, где n – разрядность входных чисел, инвертор, мультиплексор, модуль управляющего блока, входную и выходную n-разрядные шины, (n+1)-разрядный сумматор, причём первый управляющий вход первого n-разрядного регистра соединен с первым выходом модуля управляющего блока, а выход старшего разряда соединен с младшим разрядом первого информационного входа (n+1)-разрядного сумматора, информационный вход второго n-разрядного регистра соединен с входной n-разрядной шиной, управляющий вход соединен со вторым выходом модуля управляющего блока, а выход соединен с входом инвертора, выход которого соединен с младшими n разрядами второго информационного входа (n+1)-разрядного сумматора, младшие n разрядов информационного выхода которого соединены со вторым информационным входом мультиплексора, на первый вход модуля управляющего блока подается одноразрядный код команды формирования остатка по модулю, введен электронный ключ, причём информационный вход первого n-разрядного регистра соединен с входной n-разрядной шиной, второй управляющий вход с четвертым выходом модуля управляющего блока, а старший разряд выхода соединен с младшим разрядом первого информационного входа мультиплексора, на старший разряд второго информационного входа (n+1)-разрядного сумматора, а также на его вход переноса подается сигнал логической «1», а его выход переноса соединен с управляющим входом мультиплексора, выход которого соединен с информационным входом третьего n-разрядного регистра, управляющий вход которого соединен с третьим выходом модуля управляющего блока, выход соединен с информационным входом электронного ключа, а также со старшими n разрядами первого информационного входа (n+1)-разрядного сумматора, выходы младших (n-1) разрядов соединены со старшими (n-1) разрядами первого информационного входа мультиплексора, управляющий вход электронного ключа соединен с пятым выходом модуля управляющего блока, а выход соединен с выходной n-разрядной шиной, на второй вход модуля управляющего блока подаются тактовые импульсы.To achieve a technical result, an arithmetic logic device for performing a division operation containing three n-bit registers, where n is the bit depth of the input numbers, an inverter, a multiplexer, a control unit module, input and output n-bit buses, (n + 1) - a bit adder, the first control input of the first n-bit register connected to the first output of the control unit module, and the high-order output connected to the least significant bit of the first information input of the (n + 1) -digit adder, the information input is second the n-bit register is connected to the input n-bit bus, the control input is connected to the second output of the control unit module, and the output is connected to the inverter input, the output of which is connected to the lower n bits of the second information input of the (n + 1) -bit adder, the lower n the bits of the information output of which are connected to the second information input of the multiplexer, a one-bit code of the command for forming the remainder modulo is fed to the first input of the control unit module, an electronic key is entered, and the information input the first n-bit register is connected to the input n-bit bus, the second control input with the fourth output of the control unit module, and the highest bit of the output is connected to the low-order bit of the first information input of the multiplexer, to the highest bit of the second information input of the (n + 1) -digit adder , as well as a logical “1” signal is supplied to its transfer input, and its transfer output is connected to the control input of the multiplexer, the output of which is connected to the information input of the third n-bit register, the control input of which ohm is connected to the third output of the control unit module, the output is connected to the information input of the electronic key, as well as to the senior n bits of the first information input of the (n + 1) -bit adder, the outputs of the least (n-1) bits are connected to the senior (n-1 ) by the bits of the first information input of the multiplexer, the control input of the electronic key is connected to the fifth output of the control unit module, and the output is connected to the output n-bit bus, clock pulses are sent to the second input of the control unit module.

Сущность изобретения заключается в реализации следующего способа вычисления остатка 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

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

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

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

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 = an-1·2n-1+an-2·2n-2+ . . . +a1·21+a0, (2) A = a n-1 · 2 n-1 + a n-2 · 2 n-2 +. . . + a 1 2 1 + a 0 , (2)

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

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

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

где ai,

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

pi,

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

qi,

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

ri,

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

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

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

A

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

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

R = A (mod P)= (an-1·2n-1+an-2·2n-2+ . . . +a1·21+a0)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) может быть представлено в следующем виде:Expression (7) can be represented as follows:

R = ((. . . (an-1·2+an-2)·2+. . . +a1)·2+a0) mod P . (8)R = ((... (A n-1 · 2 + a n-2 ) · 2 +.. + A 1 ) · 2 + a 0 ) mod P. (eight)

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

Исходя из вышесказанного, выражение (8) может быть представлено в видеBased on the foregoing, expression (8) can be represented as

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

В таком виде значительно облегчается задача нахождения остатка R от числа А.In this form, the task of finding the remainder R of the number A. is greatly facilitated.

При проведении вычислений по модулю P значение выражения
(an-1·2+an-2) сравнивается с модулем P. Если значение (an-1·2+an-2) ≥ P, то из числа (an-1·2+an-2) вычитается значение модуля P, то есть
t1=(an-1·2+an-2)-P. Если (an-1·2+an-2)< P, то число (an-1·2+an-2) остается без изменений t1=(an-1·2+an-2). Полученное в результате значение t1 умножается на 2, складывается с

Figure 00000004
и сравнивается со значением P. Если значение (t1·2+an-3) ≥ P, то из (t1·2+an-3) вычитается значение модуля P, то есть t2=(t1·2+an-3) - P. Если (t1·2+an-3) < P, то число (t1·2+an-3) остается без изменений, t2=(t1·2+an-3). Полученное в результате значение t2 умножается на 2, складывается с
Figure 00000005
и сравнивается со значением P и т.д. На последнем (n-1)-м шаге число
(tn-2·2+a0) сравнивается с модулем P. Если значение (tn-2·2+a0) ≥ P, то из (tn-2·2+a0) вычитается значение числа P, то есть tn-1=(tn-2·2+a0) - P. Если (tn-2·2+a0) < P, то число (tn-2·2+a0) остается без изменений
tn-1=(tn-2·2+a0). Полученное в результате значение R=tn-1 является остатком от деления числа A на число P. When calculating modulo P, the value of the expression
(a n-1 · 2 + a n-2 ) is compared with the module P. If the value of (a n-1 · 2 + a n-2 ) ≥ P, then from the number (a n-1 · 2 + a n- 2 ) the value of the module P is subtracted, i.e.
t 1 = (a n-1 · 2 + a n-2 ) -P. If (a n-1 · 2 + a n-2 ) <P, then the number (a n-1 · 2 + a n-2 ) remains unchanged t 1 = (a n-1 · 2 + a n-2 ) The resulting t 1 value is multiplied by 2, added to
Figure 00000004
and compared with the value P. If the value (t 1 · 2 + a n-3 ) ≥ P, then the value of the module P is subtracted from (t 1 · 2 + a n-3 ), that is, t 2 = (t 1 · 2 + a n-3 ) - P. If (t 1 · 2 + a n-3 ) <P, then the number (t 1 · 2 + a n-3 ) remains unchanged, t 2 = (t 1 · 2 + a n-3 ). The resulting t 2 value is multiplied by 2, added to
Figure 00000005
and compares with the value of P, etc. At the last (n-1) -th step, the number
(t n-2 · 2 + a 0 ) is compared with the module P. If the value of (t n-2 · 2 + a 0 ) ≥ P, then the value of the number P is subtracted from (t n-2 · 2 + a 0 ) that is, t n-1 = (t n-2 · 2 + a 0 ) - P. If (t n-2 · 2 + a 0 ) <P, then the number (t n-2 · 2 + a 0 ) remains without changes
t n-1 = (t n-2 · 2 + a 0 ). The resulting value R = t n-1 is the remainder of dividing the number A by the number P.

Операция умножения на два при вычислении выражения (ti·2+an-2-i) во всех случаях осуществляется сдвигом всех разрядов множимого на один в сторону старших. Суммирование осуществляется путем подачи коэффициента ai на самый младший разряд множимого. Ввиду того, что коэффициенты ai могут принимать значение «0» или «1», а самый младший разряд множимого после сдвига всегда будет равен «0», то переноса в следующий разряд при таком решении возникать не будет. The operation of multiplying by two in calculating the expression (t i · 2 + a n-2-i ) in all cases is carried out by shifting all the digits of the multiplicable by one in the direction of the senior. Summation is carried out by applying the coefficient a i to the least significant bit of the multiplicand. Due to the fact that the coefficients a i can take the value “0” or “1”, and the least significant bit of the multiplicand after the shift will always be “0”, there will be no transfer to the next bit with this solution.

На фиг. 1 представлена схема арифметико-логического устройства для формирования остатка по произвольному модулю от числа.In FIG. 1 is a diagram of an arithmetic logic device for generating a remainder modulo an arbitrary number.

Арифметико-логическое устройство для формирования остатка по произвольному модулю от числа, содержит три n-разрядных регистра 2, 3, 7, где n – разрядность входных чисел, инвертор 4, (n+1)-разрядный сумматор 5, мультиплексор 6, электронный ключ 8, входную 1 и выходную 9 n-разрядные шины, модуль управляющего блока 10, вход команды формирования остатка 11, вход тактовых импульсов 12.The arithmetic-logic device for generating a remainder modulo an arbitrary number, contains three n-bit registers 2, 3, 7, where n is the width of the input numbers, inverter 4, (n + 1) -bit adder 5, multiplexer 6, electronic key 8, input 1 and output 9 n-bit buses, the control unit module 10, the input of the remainder 11 formation command, the input of clock pulses 12.

Информационные входы первого и второго n-разрядных регистров 2, 3 соединены с входной n-разрядной шиной 1. Первый управляющий вход первого n-разрядного регистра 2 соединен с первым выходом модуля управляющего блока 10, второй управляющий вход с четвертым выходом модуля управляющего блока 10, а выход старшего разряда соединен с младшим разрядом первого информационного входа (n+1)-разрядного сумматора 5, а также с младшим разрядом первого информационного входа мультиплексора 6.The information inputs of the first and second n-bit registers 2, 3 are connected to the input n-bit bus 1. The first control input of the first n-bit register 2 is connected to the first output of the control unit 10 module, the second control input with the fourth output of the control unit 10 module, and the high-order output is connected to the low-order bit of the first information input of the (n + 1) -bit adder 5, as well as to the low-order bit of the first information input of multiplexer 6.

Управляющий вход второй n-разрядного регистра 3 соединен со вторым выходом модуля управляющего блока 10, а выход соединен со входом инвертора 4, выход которого соединен с младшими n разрядами второго информационного входа (n+1)-разрядного сумматора 5.The control input of the second n-bit register 3 is connected to the second output of the module of the control unit 10, and the output is connected to the input of the inverter 4, the output of which is connected to the lower n bits of the second information input of the (n + 1) -bit adder 5.

На старший разряд второго информационного входа (n+1)-разрядного сумматора 5, а также на его вход переноса подается сигнал логической «1», младшие n разрядов его информационного выхода соединены со вторым информационным входом мультиплексора 6, а его выход переноса соединен с управляющим входом мультиплексора 6.To the senior bit of the second information input of the (n + 1) -bit adder 5, as well as to its transfer input, a logical “1” signal is supplied, the lower n bits of its information output are connected to the second information input of the multiplexer 6, and its transfer output is connected to the control multiplexer input 6.

Выход мультиплексора 6 соединен с информационным входом третьего n-разрядного регистра 7, управляющий вход которого соединен с третьим выходом модуля управляющего блока 10, выход соединен с информационным входом электронного ключа 8, а также со старшими n разрядами первого информационного входа (n+1)-разрядного сумматора 5, а выходы младших (n-1) разрядов соединены со старшими (n-1) разрядами первого информационного входа мультиплексора 6.The output of the multiplexer 6 is connected to the information input of the third n-bit register 7, the control input of which is connected to the third output of the module of the control unit 10, the output is connected to the information input of the electronic key 8, as well as to the senior n bits of the first information input (n + 1) - bit adder 5, and the outputs of the lower (n-1) bits are connected to the senior (n-1) bits of the first information input of the multiplexer 6.

Управляющий вход электронного ключа 8 соединен с пятым выходом модуля управляющего блока 10, а выход соединен с выходной n-разрядной шиной 9. На первый вход 11 модуля управляющего блока 10 подается одноразрядный код команды формирования остатка по модулю, а на второй вход 12 подаются тактовые импульсы.The control input of the electronic key 8 is connected to the fifth output of the module of the control unit 10, and the output is connected to the output n-bit bus 9. At the first input 11 of the module of the control unit 10, a one-bit code of the remainder modulo command is supplied, and clock pulses are fed to the second input 12 .

На фиг. 2 представлена схема модуля управляющего блока 10 арифметико-логического устройства для формирования остатка по произвольному модулю от числа.In FIG. 2 is a diagram of a module of a control unit 10 of an arithmetic logic device for generating a remainder modulo an arbitrary modulus of a number.

Модуль управляющего блока 10 содержит двухвходовый элемент И 10.1, двухвходовый элемент ЗАПРЕТ 10.2, r-разрядный счётчик 10.3, где

Figure 00000006
, r-входовый дешифратор 10.4, n-входовый элемент ИЛИ 10.5, (n-1)-входовый элемент ИЛИ 10.6.The control unit module 10 contains a two-input element AND 10.1, a two-input element is PROHIBITED 10.2, r-bit counter 10.3, where
Figure 00000006
, r-input decoder 10.4, n-input OR element 10.5, (n-1) -input OR element 10.6.

Первый вход двухвходового элемента И 10.1 является первым входом 11 модуля управляющего блока 10, второй вход является вторым входом 12 модуля управляющего блока 10, а выход соединен со счётным входом r-разрядного счётчика 10.3 и с запрещающим входом двухвходового элемента ЗАПРЕТ 10.2, выход которого соединён с управляющим входом r-разрядного счётчика 10.3, выходы которого соединены с соответствующими информационными входами r-входового дешифратора 10.4.The first input of the two-input element And 10.1 is the first input 11 of the module of the control unit 10, the second input is the second input 12 of the module of the control unit 10, and the output is connected to the counting input of the r-bit counter 10.3 and to the inhibit input of the two-input element PROHIBIT 10.2, the output of which is connected to the control input of the r-bit counter 10.3, the outputs of which are connected to the corresponding information inputs of the r-input decoder 10.4.

Первый выход r-входового дешифратора 10.4 соединен с первым выходом модуля управляющего блока 10, второй выход соединен со вторым выходом модуля управляющего блока 10. Каждый (2k+1)-й выход r-входового дешифратора 10.4, где k = 1, 2, …, n, соединен с k-м входом n-входового элемента ИЛИ 10.5, выход которого соединен с третьим выходом модуля управляющего блока 10. Каждый (2k+2)-й выход r-входового дешифратора 10.4, где k = 1, 2, …, n-1, соединён с k-м входом (n-1)-входового элемента ИЛИ 10.6, выход которого соединен с четвертым выходом модуля управляющего блока 10. (2n+2)-й выход r-входового дешифратора 10.4 соединен с пятым выходом модуля управляющего блока 10, а также с разрешающим входом двухвходового элемента ЗАПРЕТ 10.2.The first output of the r-input decoder 10.4 is connected to the first output of the module of the control unit 10, the second output is connected to the second output of the module of the control unit 10. Each (2k + 1) -th output of the r-input decoder 10.4, where k = 1, 2, ... , n, is connected to the kth input of the n-input OR element 10.5, the output of which is connected to the third output of the control unit 10 module. Each (2k + 2) th output of the r-input decoder 10.4, where k = 1, 2, ... , n-1, is connected to the k-th input of the (n-1) -input element OR 10.6, the output of which is connected to the fourth output of the module of the control unit 10. (2n + 2) -th output r-input A new decoder 10.4 is connected to the fifth output of the control unit 10 module, as well as to the enabling input of the two-input element BAN 10.2.

Формирование остатка от n-разрядного числа A по модулю P осуществляется за (2n+2) тактов, где n – разрядность входных чисел.The remainder of an n-bit number A modulo P is generated in (2n + 2) clock cycles, where n is the bit depth of the input numbers.

В исходном состоянии r-разрядный счётчик 10.3 обнулён, на вход 11 команды формирования остатка подаётся логический «0». Для начала работы устройства и на протяжении всего цикла формирования остатка на вход 11 команды формирования остатка устройства подаётся сигнал логической «1». При этом тактовые импульсы, поступающие на вход тактовых импульсов 12, начинают подсчитываться r-разрядным счётчиком 10.3. Результат подсчёта подаётся на вход r-входового дешифратора 10.4, и на его выходах с номерами 1,…, (2n+2) последовательно появляются импульсы.In the initial state, the r-bit counter 10.3 is reset to zero, a logical “0” is sent to input 11 of the remainder formation command. To start the operation of the device and throughout the entire cycle of forming the remainder, a logical “1” signal is sent to input 11 of the remainder formation command of the device. In this case, the clock pulses arriving at the input of the clock pulses 12 begin to be counted by the r-bit counter 10.3. The calculation result is fed to the input of the r-input decoder 10.4, and pulses appear sequentially at its outputs with numbers 1, ..., (2n + 2).

С приходом первого тактового импульса на вход тактовых импульсов 12 на первом выходе r-входового дешифратора 10.4 появляется сигнал логической единицы, который поступает на выход y1 модуля управляющего блока 10. Сигнал с выхода y1 модуля управляющего блока 10 поступает на управляющий вход первого n-разрядного регистра 2, в результате чего происходит считывание кода числа A с входной n-разрядной шины 1 в первый n-разрядный регистр 2.With the arrival of the first clock pulse at the input of clock pulses 12, the logical unit signal appears on the first output of the r-input decoder 10.4, which is fed to the output y 1 of the control unit 10 module. The signal from the output y 1 of the control unit 10 module is fed to the control input of the first n- bit register 2, resulting in the reading of the code of the number A from the input n-bit bus 1 in the first n-bit register 2.

С приходом второго тактового импульса на вход тактовых импульсов 12 сигнал логической «1» появляется на втором выходе r-входового дешифратора 10.4 и передаётся на выход y2 модуля управляющего блока 10. Этот сигнал поступает на управляющий вход второго n-разрядного регистра 3, в результате чего происходит считывание в данный регистр кода модуля P.With the arrival of the second clock pulse at the input of clock pulses 12, the logical 1 signal appears at the second output of the r-input decoder 10.4 and is transmitted to the output y 2 of the module of the control unit 10. This signal is fed to the control input of the second n-bit register 3, as a result what is the reading into the given register of the module code P.

С приходом (2k+1)-го тактового импульса, где k = 1, 2, …, n, сигнал логической «1» появляется на (2k+1)-м выходе r-входового дешифратора 10.4, откуда передаётся через n-входовый элемент ИЛИ 10.5 на третий выход модуля управляющего блока 10. Далее он поступает на управляющий вход третьего n-разрядного регистра 7 в результате чего происходит считывание в третий n-разрядный регистр 7 очередного частичного остатка.With the arrival of the (2k + 1) th clock pulse, where k = 1, 2, ..., n, the logical “1” signal appears on the (2k + 1) th output of the r-input decoder 10.4, from where it is transmitted via the n-input OR element 10.5 to the third output of the module of the control unit 10. Then it enters the control input of the third n-bit register 7, as a result of which the next partial remainder is read into the third n-bit register 7.

С приходом (2k+2)-го тактового импульса, где k = 1,2,…,n-1, сигнал логической «1» появляется на (2k+2)-м выходе r-входового дешифратора 10.4, откуда передаётся через (n-1)-входовый элемент ИЛИ 10.6 на выход y4 модуля управляющего блока 10. Сигнал с выхода y4 модуля управляющего блока 10 поступает на управляющий вход первого n-разрядного регистра 2, что приводит к сдвигу находящегося в нем значения на один разряд в сторону старшего.With the arrival of the (2k + 2) th clock pulse, where k = 1,2, ..., n-1, the logical “1” signal appears on the (2k + 2) th output of the r-input decoder 10.4, from where it is transmitted via ( n-1) -input element OR 10.6 to output y 4 of the control unit 10 module. The signal from output y 4 of the control unit 10 module is supplied to the control input of the first n-bit register 2, which leads to a shift of the value in it by one bit in side of the elder.

С приходом (2n+2)-го тактового импульса сигнал логической «1» появляется на (2n+2)-м выходе r-входового дешифратора 10.4, откуда поступает на выход y5 модуля управляющего блока 10 и на разрешающий вход двухвходового элемента ЗАПРЕТ 10.2. С выхода y5 модуля управляющего блока 10 сигнал поступает на управляющий вход электронного ключа 8, и результат формирования остатка от n-разрядного числа A по модулю P подаётся с выхода третьего n-разрядного регистра 7 на выходную n-разрядную шину 9. После спада (2n+2)-го тактового импульса на запрещающий вход двухвходового элемента ЗАПРЕТ 10.2 поступает логический «0» и на его выходе устанавливается сигнал логической «1», который подаётся на вход сброса r-разрядного счётчика 10.3 и, таким образом, обнуляет счётчик. Цикл формирования остатка завершён.With the arrival of the (2n + 2) -th clock pulse, the logical 1 signal appears at the (2n + 2) -th output of the r-input decoder 10.4, from where it goes to output y 5 of the control unit 10 module and to the enable input of the two-input element BAN 10.2 . From the output y 5 of the module of the control unit 10, the signal is fed to the control input of the electronic key 8, and the result of generating the remainder of the n-bit number A modulo P is fed from the output of the third n-bit register 7 to the output n-bit bus 9. After the decline ( 2n + 2) -th clock pulse to the inhibitory input of the two-input element FORBID 10.2 receives a logical “0” and a logical “1” signal is set at its output, which is fed to the reset input of the r-bit counter 10.3 and, thus, the counter is reset. The remainder formation cycle is completed.

Рассмотрим работу арифметико-логического устройства для формирования остатка по произвольному модулю от числа на примере.Consider the work of an arithmetic-logic device for generating a remainder modulo an arbitrary number from a number using an example.

Пусть n = 4, A = 14, P = 5. Формирование остатка выполняется за (2n+2) = 10 тактов.Let n = 4, A = 14, P = 5. The remainder is formed in (2n + 2) = 10 clock cycles.

На первом такте производится считывание с входной n-разрядной шины 1 кода модуля A = 14 в первый n-разрядный регистр 2.At the first clock cycle, the module code A = 14 is read from the input n-bit bus 1 into the first n-bit register 2.

На втором такте с входной n-разрядной шины 1 считывается код значения P = 5 во второй n-разрядный регистр 3. At the second clock, the value code P = 5 is read from the input n-bit bus 1 into the second n-bit register 3.

На третьем такте, поскольку значение суммы удвоенного обнуленного содержимого третьего n-разрядного регистра 7 и старшего разряда A = 11102 равное единице, меньше модуля P, в третий n-разрядный регистр 7 записывается новое значение частичного остатка qнов = 00012, представляющего собой значение суммы удвоенного содержимого третьего n-разрядного регистра 7 и старшего разряда A.At the third step, since the value of the sum of the doubled zeroed contents of the third n-bit register 7 and the high order A = 1110 2 is equal to one, less than the module P, a new value of the partial remainder q new = 0001 2 is written in the third n-bit register 7, which is the value of the sum of the doubled contents of the third n-bit register 7 and high order A.

На четвертом такте сдвигается на один разряд влево содержимое первого n-разрядного регистра 2, в котором хранится значение множителя A = 11102, т.е. теперь в первом n-разрядном регистре 2 будет число 11002.At the fourth step, the contents of the first n-bit register 2 are shifted by one bit to the left, in which the value of the factor A = 1110 2 is stored, i.e. now in the first n-bit register 2 will be the number 1100 2 .

На пятом такте, поскольку значение суммы удвоенного предыдущего частичного остатка qпред = 00012 и старшего разряда A = 11002 равное трем, меньше модуля P, в третий n-разрядный регистр 7 записывается новое значение частичного остатка qнов = 00112, представляющего собой значение суммы удвоенного предыдущего частичного остатка qпред = 00012 и старшего разряда A = 11002.At the fifth step, since the value of the sum of the doubled previous partial remainder q pre = 0001 2 and the highest order A = 1100 2 is equal to three, less than the module P, a new value of the partial remainder q new = 0011 2 is written in the third n-bit register 7, which is the value of the sum of the doubled previous partial remainder q pre = 0001 2 and the highest order A = 1100 2 .

На шестом такте сдвигается на один разряд влево содержимое первого n-разрядного регистра 2, в котором хранится значение множителя A = 11002, т.е. теперь в первом n-разрядном регистре 2 будет число 10002.At the sixth step, the contents of the first n-bit register 2 are shifted by one bit to the left, in which the value of the factor A = 1100 2 is stored, i.e. now in the first n-bit register 2 will be the number 1000 2 .

На седьмом такте, поскольку значение суммы удвоенного предыдущего частичного остатка qпред = 00112 и старшего разряда A = 10002 равное семи, больше модуля P, в третий n-разрядный регистр 7 записывается новое значение частичного остатка qнов = 00102, представляющего собой значение разности суммы удвоенного предыдущего частичного остатка qпред = 00112 и старшего разряда A = 10002 со значением модуля P = 01012.At the seventh step, since the value of the sum of the doubled previous partial remainder q pre = 0011 2 and the high order A = 1000 2 is seven, greater than the module P, a new value of the partial remainder q new = 0010 2 is written in the third n-bit register 7, which is the difference value of the sum of the doubled previous partial remainder q pre = 0011 2 and the highest order A = 1000 2 with the module value P = 0101 2 .

На восьмом такте сдвигается на один разряд влево содержимое первого n-разрядного регистра 2, в котором хранится значение множителя A = 10002, т.е. теперь в первом n-разрядном регистре 2 будет число 00002.At the eighth step, the contents of the first n-bit register 2 are shifted by one bit to the left, in which the value of the factor A = 1000 2 is stored, i.e. now in the first n-bit register 2 will be the number 0000 2 .

На девятом такте, поскольку значение суммы удвоенного предыдущего частичного остатка qпред = 00102 и старшего разряда A = 00002 равное четырем, меньше модуля P, в третий n-разрядный регистр 7 записывается новое значение частичного остатка qнов = 01002, представляющего собой значение суммы удвоенного предыдущего частичного остатка qпред = 00102 и старшего разряда A = 00002.At the ninth step, since the value of the sum of the doubled previous partial remainder q pre = 0010 2 and the highest order A = 0000 2 is four, less than the module P, a new value of the partial remainder q new = 0100 2 is written in the third n-bit register 7, which is the value of the sum of the doubled previous partial remainder q pre = 0010 2 and the highest order A = 0000 2 .

На десятом такте содержимое третьего n-разрядного регистра 7 подаётся на выходную n-разрядную шину 9. Таким образом, результат операции формирования остатка по модулю равен 4. Операция выполнена корректно, поскольку 14 (mod 5) = 4.On the tenth step, the contents of the third n-bit register 7 is supplied to the output n-bit bus 9. Thus, the result of the operation of forming the remainder modulo is 4. The operation was performed correctly, since 14 (mod 5) = 4.

Claims (1)

Арифметико-логическое устройство для формирования остатка по произвольному модулю от числа, содержащее три n-разрядных регистра, где n – разрядность входных чисел, инвертор, мультиплексор, модуль управляющего блока, входную и выходную n-разрядные шины, (n+1)-разрядный сумматор, причём первый управляющий вход первого n-разрядного регистра соединен с первым выходом модуля управляющего блока, а выход старшего разряда соединен с младшим разрядом первого информационного входа (n+1)-разрядного сумматора, информационный вход второго n-разрядного регистра соединен с входной n-разрядной шиной, управляющий вход соединен со вторым выходом модуля управляющего блока, а выход соединен с входом инвертора, выход которого соединен с младшими n разрядами второго информационного входа (n+1)-разрядного сумматора, младшие n разрядов информационного выхода которого соединены со вторым информационным входом мультиплексора, на первый вход модуля управляющего блока подается одноразрядный код команды формирования остатка по модулю, отличающееся тем, что в него введены, электронный ключ, причём информационный вход первого n-разрядного регистра соединен с входной n-разрядной шиной, второй управляющий вход - с четвертым выходом модуля управляющего блока, а старший разряд выхода соединен с младшим разрядом первого информационного входа мультиплексора, на старший разряд второго информационного входа (n+1)-разрядного сумматора, а также на его вход переноса подается сигнал логической «1», а его выход переноса соединен с управляющим входом мультиплексора, выход которого соединен с информационным входом третьего n-разрядного регистра, управляющий вход которого соединен с третьим выходом модуля управляющего блока, выход соединен с информационным входом электронного ключа, а также со старшими n разрядами первого информационного входа (n+1)-разрядного сумматора, выходы младших (n-1) разрядов соединены со старшими (n-1) разрядами первого информационного входа мультиплексора, управляющий вход электронного ключа соединен с пятым выходом модуля управляющего блока, а выход соединен с выходной n-разрядной шиной, на второй вход модуля управляющего блока подаются тактовые импульсы, причём модуль управляющего блока содержит двухвходовый элемент И, двухвходовый элемент ЗАПРЕТ, n-входовый элемент ИЛИ, (n-1)-входовый элемент ИЛИ, r-разрядный счётчик, где
Figure 00000007
, r-входовый дешифратор, причём первый вход двухвходового элемента И является первым входом модуля управляющего блока, второй вход является вторым входом модуля управляющего блока, а выход соединен со счётным входом r-разрядного счётчика и с запрещающим входом двухвходового элемента ЗАПРЕТ, выход которого соединён с управляющим входом r-разрядного счётчика, выходы которого соединены с соответствующими информационными входами r-входового дешифратора, первый выход которого соединен с первым выходом модуля управляющего блока, второй выход соединен со вторым выходом модуля управляющего блока, каждый (2k+1)-й выход, где k = 1, 2, …, n, соединен с k-м входом n-входового элемента ИЛИ, выход которого соединен с третьим выходом модуля управляющего блока, каждый (2k+2)-й выход r-входового дешифратора, где k = 1, 2, …, n-1, соединён с k-м входом (n-1)-входового элемента ИЛИ, выход которого соединен с четвертым выходом модуля управляющего блока, (2n+2) выход r-входового дешифратора соединен с пятым выходом модуля управляющего блока, а также с разрешающим входом двухвходового элемента ЗАПРЕТ.
An arithmetic-logic device for generating a remainder modulo an arbitrary number, containing three n-bit registers, where n is the width of the input numbers, an inverter, a multiplexer, a control unit module, input and output n-bit buses, (n + 1) -bit an adder, wherein the first control input of the first n-bit register is connected to the first output of the control unit module, and the high-order output is connected to the least significant bit of the first information input of the (n + 1) -bit adder, the information input of the second n-bit the histra is connected to the input n-bit bus, the control input is connected to the second output of the control unit module, and the output is connected to the inverter input, the output of which is connected to the lower n bits of the second information input of the (n + 1) -bit adder, the lower n bits of the information output which are connected to the second information input of the multiplexer, a one-bit code of the remainder modulo formation command is fed to the first input of the control unit module, characterized in that an electronic key is entered into it, moreover The input of the first n-bit register is connected to the input n-bit bus, the second control input is connected to the fourth output of the control unit module, and the highest bit of the output is connected to the least significant bit of the first information input of the multiplexer, to the highest bit of the second information input (n + 1) -digit adder, as well as its transfer input, a logical “1” signal is supplied, and its transfer output is connected to the control input of the multiplexer, the output of which is connected to the information input of the third n-bit register the input input of which is connected to the third output of the control unit module, the output is connected to the information input of the electronic key, as well as to the highest n bits of the first information input of the (n + 1) -bit adder, the outputs of the lower (n-1) bits are connected to the highest (n -1) by the bits of the first information input of the multiplexer, the control input of the electronic key is connected to the fifth output of the control unit module, and the output is connected to the output n-bit bus, clock pulses are fed to the second input of the control unit module, and The module control unit comprises a two-input AND gate, two-input inverted element, n-OR input elements, (n-1) -vhodovy OR element, r-bit counter, wherein
Figure 00000007
, the r-input decoder, and the first input of the two-input element And is the first input of the control unit module, the second input is the second input of the control unit module, and the output is connected to the counting input of the r-bit counter and to the inhibit input of the two-input element BAN, the output of which is connected to the control input of the r-bit counter, the outputs of which are connected to the corresponding information inputs of the r-input decoder, the first output of which is connected to the first output of the control unit module, the second output connected to the second output of the control unit module, each (2k + 1) -th output, where k = 1, 2, ..., n, is connected to the k-th input of the n-input element OR, the output of which is connected to the third output of the control unit module , each (2k + 2) th output of the r-input decoder, where k = 1, 2, ..., n-1, is connected to the k-th input of the (n-1) -input element OR, the output of which is connected to the fourth output control unit module, (2n + 2) the output of the r-input decoder is connected to the fifth output of the control unit module, as well as with the enable input of the two-input element BAN.
RU2018142842A 2018-12-04 2018-12-04 Arithmetic logic unit for generating residual by arbitrary module from number RU2696223C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2018142842A RU2696223C1 (en) 2018-12-04 2018-12-04 Arithmetic logic unit for generating residual by arbitrary module from number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2018142842A RU2696223C1 (en) 2018-12-04 2018-12-04 Arithmetic logic unit for generating residual by arbitrary module from number

Publications (1)

Publication Number Publication Date
RU2696223C1 true RU2696223C1 (en) 2019-07-31

Family

ID=67586605

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2018142842A RU2696223C1 (en) 2018-12-04 2018-12-04 Arithmetic logic unit for generating residual by arbitrary module from number

Country Status (1)

Country Link
RU (1) RU2696223C1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2760927C1 (en) * 2021-02-19 2021-12-01 Федеральное государственное казенное военное образовательное учреждение высшего образования "Военная академия Ракетных войск стратегического назначения имени Петра Великого" МО РФ Device for forming the remainder of an arbitrary modulus of the number
RU2763988C1 (en) * 2021-04-13 2022-01-12 Акционерное общество "Концерн "Созвездие" Accumulating adder-subtractor by an arbitrary natural number modulo

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0308963A2 (en) * 1987-09-25 1989-03-29 Kabushiki Kaisha Toshiba Remainder computing system and method
RU2020759C1 (en) * 1991-05-12 1994-09-30 Петренко Вячеслав Иванович Device for forming remainder for random module of number
RU2029435C1 (en) * 1992-03-16 1995-02-20 Вячеслав Иванович Петренко Combination recurrent former of remainders
JP3390966B2 (en) * 1998-03-26 2003-03-31 日本電信電話株式会社 Remainder arithmetic device modulo square number and program recording medium therefor
RU2324972C2 (en) * 2006-01-31 2008-05-20 Ставропольский военный институт связи ракетных войск Creator of random module reminder of number

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0308963A2 (en) * 1987-09-25 1989-03-29 Kabushiki Kaisha Toshiba Remainder computing system and method
RU2020759C1 (en) * 1991-05-12 1994-09-30 Петренко Вячеслав Иванович Device for forming remainder for random module of number
RU2029435C1 (en) * 1992-03-16 1995-02-20 Вячеслав Иванович Петренко Combination recurrent former of remainders
JP3390966B2 (en) * 1998-03-26 2003-03-31 日本電信電話株式会社 Remainder arithmetic device modulo square number and program recording medium therefor
RU2324972C2 (en) * 2006-01-31 2008-05-20 Ставропольский военный институт связи ракетных войск Creator of random module reminder of number

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2760927C1 (en) * 2021-02-19 2021-12-01 Федеральное государственное казенное военное образовательное учреждение высшего образования "Военная академия Ракетных войск стратегического назначения имени Петра Великого" МО РФ Device for forming the remainder of an arbitrary modulus of the number
RU2763988C1 (en) * 2021-04-13 2022-01-12 Акционерное общество "Концерн "Созвездие" Accumulating adder-subtractor by an arbitrary natural number modulo

Similar Documents

Publication Publication Date Title
Lu Arithmetic and logic in computer systems
EP0040279A2 (en) Binary divider
US5132925A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
US5023827A (en) Radix-16 divider using overlapped quotient bit selection and concurrent quotient rounding and correction
Chandel et al. Booth multiplier: Ease of multiplication
RU2696223C1 (en) Arithmetic logic unit for generating residual by arbitrary module from number
Lad et al. Design and comparison of multiplier using vedic sutras
US3878985A (en) Serial-parallel multiplier using booth{3 s algorithm with combined carry-borrow feature
RU2639645C1 (en) Arithmetic-logical device for summing numbers by module
Tynymbayev et al. Devices for multiplying modulo numbers with analysis of the lower bits of the multiplier
RU2653263C1 (en) Arithmetic-logic device for number module multiplication
Piestrak Design of multi-residue generators using shared logic
US4866655A (en) Arithmetic processor and divider using redundant signed digit
Ushasree et al. VLSI implementation of a high speed single precision floating point unit using verilog
RU2348965C1 (en) Computing mechanism
RU2711051C1 (en) Arithmetic logic unit for addition, subtraction and multiplication of numbers modulo
RU2661797C1 (en) Computing device
US8417761B2 (en) Direct decimal number tripling in binary coded adders
US3794820A (en) Binary multiplier circuit
RU2628175C1 (en) Arithmetic-logical device for summing numbers to module
RU2804380C1 (en) Pipeline calculator
RU2791440C1 (en) Pipeline generator of remainders by an arbitrary modulus
Abid et al. Modified operand decomposition multiplication for high performance parallel multipliers
Murali et al. An optimized implementation of vedic multiplier using barrel shifter in FPGA technology
RU2595906C1 (en) Device for calculating functions