111871 Изобретение относитс к- вычислительной технике и может быть использовано в системах и устройствах, функционирующих в системе остаточных классов.5 Цель изобретени - упрощение устройства. На чертеже представлена структурна схема устройства дл умножени чисел по модулю. 10 Устройство содержит первый 1 и второй 2 входы устройства, первый 3 и второй 4 входные регистры, первый 5 и второй 6 дешифраторы, три группы элементов ИЛИ 7-9. четьфе 15 группы элементов И 10-13, вход 14 управлени устройства, п ть элементов ИЛИ 15-19, два элемента И 20 и 21, табличный вычислитель 22 значений вида & (mod Р/2)+Р/2, вькод- 20 ной регистр 23, шифратор 24, выход 25 устройства. Шифратор 24 служит дл преобразовани операндов унитарного кода 25 в двоичный. I Табличный вычислитель 22 представл ет собой двухвходовое ПЗУ. Количество элементов И в узлах табличного вычислител 22 равно Р-2 (-) , где Р - модуль умножени . Входные операнды устройства лежат в интервале 1. 6 А , вб Р-1 табличного вычислител , а входные операн- 35 ды табличного вычислител 22 l.a.X.ti. Известно, что дл операндов„представленных в искусственной форме А А + Р/2, в В + Р/2, результат операции модульного умножени представл етс в виде (АВ) А В или (АВ) А В +Р/2. В предлагаемом устройстве табличному вычислителю 22 присваиваютс значени (mod Р/2)+Р/2, представленные в табл.1. Такое кодирование позвол ет не- 50 посредственно установить взаимно однозначное соответствие между кодами чисел в искусственной форме и кодами чисел в обычном представлении. В табл.1 знаком (+) отмечены случаи, 55 когда (а/ЗУ а/з(mod Р) . В табл.2 представлены операнды в искусственной форме дл Р 14. 7 опе пре сам за цы чес вхо вых гру вкл О дул ды паю гис пос рат ров Таблица 2 () Таким образом, при реализации рации модульного умножени в длагаемом изобретени$1 происходит окоррекци результата операции счет внутренней структуры табливычислител 22 (таблица 1). Колитво входных шин в каждой группе дов вычислител 22 равно одных шин (Р-1). Дешифраторы 5 и 6 имеют две ппы выходов, кажда из которых ючает в себ соответственно Р- .Р+2 тъ л ч --2 т выходов. Устройство дл умножени по мою работает следующим образом. По входам 1 и 2 входные операнА и в в двоичном коде постут на соответствующие входные ретры 3 и 4, с выходов которых тупают на соответствующие дешифоры 5 и 6. С выходов дешифрато5 и 6 операнды А и в в дес 3111871 The invention relates to computer technology and can be used in systems and devices operating in the system of residual classes.5. The purpose of the invention is to simplify the device. The drawing shows a block diagram of a device for multiplying modulo numbers. 10 The device contains the first 1 and second 2 inputs of the device, the first 3 and second 4 input registers, the first 5 and second 6 decoders, three groups of elements OR 7-9. In the group of elements 15, AND 10-13, the device control input 14, five elements OR 15-19, two elements AND 20 and 21, a table calculator 22 values of the form & (mod P / 2) + P / 2, V-code 20 register 23, encoder 24, device output 25. The encoder 24 serves to convert the operands of the unitary code 25 to binary. Table Spreadsheet 22 is a two-input ROM. The number of elements And in the nodes of the table calculator 22 is equal to P-2 (-), where P is the multiplication module. The input operands of the device lie in the interval 1. 6 A, the P-1 of the tabular calculator, and the input operands of the tabular calculator 22 l.a.X.ti. It is known that for the operands presented in the artificial form А А + Р / 2, in В + Р / 2, the result of the modular multiplication operation is represented as (АВ) А В or (АВ) А В + Р / 2. In the proposed device, the table calculator 22 is assigned the values (mod P / 2) + P / 2, presented in Table 1. Such coding allows one to directly establish a one-to-one correspondence between the codes of numbers in the artificial form and the codes of numbers in the usual representation. In Table 1, a sign (+) indicates cases 55 when (a / char is a / c (mod R.). Table 2 presents operands in an artificial form for P. 14. 7 operatives for input samples are included). table 2 () Thus, when implementing modular multiplication in the proposed invention $ 1, the result of the operation is corrected by the internal structure of the calculator 22 (table 1). The number of input buses in each group of computer 22 is equal to one ( P-1). Decoders 5 and 6 have two outputs, each of which yields, respectively, Р- .Р + 2 тъ л h - 2 tons of outputs. The device for multiplying by mine works as follows: On inputs 1 and 2, input operands and in binary code will be sent to the corresponding input retry 3 and 4, from whose outputs they blunt to the corresponding decipher 5 and 6. Deshifrato5 and 6 operands A and in dec 3
тичном коде поступают на соответстствующие элементы ИЛИ 7 и 8, с выходов которых операнды а и и (А (у;, а ), В (у;,)) через элементы И 10 и 11 групп, которые одновременно открываютс сигналом 14, поступают на входы табличного вычислител 22. Выходной сигнал табличного вычислител 22, соответствующий значению а/5 (mod Р/2)+Р/2 поступает на первые входы К-го элемента И 12 группы и К-го элемента И 13 группь (К 1,2, ...,Р-1). Если Уд У о , то элементы И 20 и 21 закрыты и выходной сигнал элемента ИЛИ 19 отсутствует. Элементы И 12 группы открыты, а элементы И 13 группы закрыты (на первый запрещающий вход элемента И 12 группы сигнал с выхода элем.ента ИЛИ 19In the actual code, the corresponding elements OR 7 and 8 are received, from whose outputs the operands a and (A (y ;, a), B (y ;,)) through elements 10 and 11 of the groups that are simultaneously opened by signal 14, go to inputs of the table calculator 22. The output signal of the table calculator 22, corresponding to the value a / 5 (mod P / 2) + P / 2 goes to the first inputs of the K-th element of the 12th group and the K-th element of the 13th group (K 1,2 , ..., P-1). If Od Y oo, the elements And 20 and 21 are closed and the output signal of the element OR 19 is missing. Elements And 12 groups are open, and elements And 13 groups are closed (at the first entry-prohibiting element AND 12 group signal from the output of the element OR 19
18716141871614
не поступает). В этом случае сигнал с выхода К-го элемента И 12 группы поступает на вход К-го элемента ИЛИ 9 группы, с выхода которого сигнал 5 поступает на вход регистра 23 и далее поступает на шифратор 24, с выхода которого результат операции модульного умножени в двоичном коде поступает на выход 25 устрой10 ства.does not arrive). In this case, the signal from the output of the K-th element And the 12 group enters the input of the K-th element OR 9 of the group, from the output of which the signal 5 enters the input of the register 23 and then goes to the encoder 24, from the output of which the result of the modular multiplication operation in binary The code enters output 25 of the device.
Если УА У У в,то сигнал с выхода элемента ИЛИ 19 присутствует. Этот сигнал закрывает элементы И 12 группы и разрешает прохождению сигнала с выхода табличного вычислител 22 через элементы И 13 группы. В этбм случае сигнал с выхода К-го элемента И 14 поступает на вход (Р-К)-го элемента ИЛИ 9 группы.If UA U U U in, then the signal from the output of the element OR 19 is present. This signal closes the elements And 12 groups and allows the passage of the signal from the output of the table calculator 22 through the elements And 13 groups. In this case, the signal from the output of the K-th element And 14 is fed to the input of the (PK) -th element of OR 9 group.