SU1571609A1 - Device for computing number factorial - Google Patents

Device for computing number factorial Download PDF

Info

Publication number
SU1571609A1
SU1571609A1 SU884478541A SU4478541A SU1571609A1 SU 1571609 A1 SU1571609 A1 SU 1571609A1 SU 884478541 A SU884478541 A SU 884478541A SU 4478541 A SU4478541 A SU 4478541A SU 1571609 A1 SU1571609 A1 SU 1571609A1
Authority
SU
USSR - Soviet Union
Prior art keywords
input
output
register
subtractive
counter
Prior art date
Application number
SU884478541A
Other languages
Russian (ru)
Inventor
Мирослав Николаевич Кузьо
Анатолий Анатольевич Самчинский
Елена Леонидовна Помыткина
Original Assignee
Предприятие П/Я В-8751
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 Предприятие П/Я В-8751 filed Critical Предприятие П/Я В-8751
Priority to SU884478541A priority Critical patent/SU1571609A1/en
Application granted granted Critical
Publication of SU1571609A1 publication Critical patent/SU1571609A1/en

Links

Landscapes

  • Complex Calculations (AREA)

Abstract

Изобретение относитс  к вычислительной технике и может быть использовано дл  вычислени  функций в специализированных вычислительных системах. Цель изобретени  - повышение быстродействи  устройства. Устройство содержит генератор импульсов, накапливающий сумматор, первый регистр, первый и второй вычитающие счетчики, элементы И, элементы ИЛИ, элементы НЕ, второй регистр, первый и второй дешифраторы нул , суммирующий счетчик, триггер. Предлагаемое устройство - более быстродействующее, так как циклы вычислени  промежуточных значений факториала числа дл  четных множителей реализуютс  путем выделени  двоичного числа, которое кратно четному множителю. 1 ил.The invention relates to computing and can be used to calculate functions in specialized computing systems. The purpose of the invention is to increase the speed of the device. The device contains a pulse generator, accumulating adder, first register, first and second subtractive counters, elements AND, elements OR, elements NOT, second register, first and second decoders zero, summing counter, trigger. The proposed device is faster, since the cycles of calculating intermediate factorial numbers for even factors are implemented by extracting a binary number that is a multiple of the even factor. 1 il.

Description

(L

сwith

Изобретение относитс  к вычислительной технике и может быть использовано дл  вычислени  функций в специализированных вычислительных системах .The invention relates to computing and can be used to calculate functions in specialized computing systems.

Цель изобретени  - повышение быстродействи  устройства.The purpose of the invention is to increase the speed of the device.

На чертеже представлена структурна  схема устройства.The drawing shows a block diagram of the device.

Устройство содержит генератор 1 импульсов , накапливающий сумматор 2, первый регистр 3, вычитающие счетчики 4 и 5, элементы И 6 - 11, элементы ИЛИ 12 - 15, элементы НЕ 16 -19, второй регистр 20, первый 21 и второй 22 дешифраторы нул , суммирующий счетчик 23, триггер 24.The device contains a pulse generator 1, accumulating adder 2, first register 3, subtractive counters 4 and 5, elements AND 6-11, elements OR 12-15, elements NOT 16-19, second register 20, first 21 and second 22 decoders zero, summing counter 23, trigger 24.

Устройство работает следующим образом .The device works as follows.

Перед началом работы отрицательным импульсом по входу начальной установки устройства осуществитс  сброс первого 3 и второго 20 регистров, первого 4 и второго 5 вычитающих счетчиков, суммирующего счетчика 23. После сн ти  сигнала начальной установки в накапливающем сумматоре 2 и в первом регистре 3 должна быть записана единица . При этом О с выхода второго регистра 20 осуществитс  включение генератора 1 импульсов, разрешение подачи импульсов с выхода последнего на вход синхронизации, второго регистра 20, триггера 24. О на выходе первого дешифратора 21 нул  удерживает в нулевом состо нии выход триггера 24, тем самым блокирует счетный .вход счетчика 23 и задает второму регистру 20 режим параллельной записи.Before starting operation, a negative pulse at the input of the initial installation of the device will reset the first 3 and second 20 registers, the first 4 and second 5 subtractive counters, summing counter 23. After the initial installation signal is removed, accumulator 2 must be written in the first register 3 . In this case, O from the output of the second register 20 will turn on the pulse generator 1, enabling the pulses from the last output to the synchronization input, the second register 20, the trigger 24. On the output of the first decoder 21, the zero keeps the output of the trigger 24 in the zero state, thereby blocking counting the input of the counter 23 and sets the second register 20 parallel recording mode.

В исходном состо нии после сн ти  начальной установки элементы И 7, 8,In the initial state, after removing the initial installation, elements And 7, 8,

сп vicn vi

оэoh

оabout

СОWITH

10 будут заблокированы нулевым состо нием информации на выходах первого вычитающего счетчика 4. С каждым импульсом на входе второго регистра 20 осуществитс  запись нулевой информации с выхода второго вычитающего счетчика 5, котора  не изменит состо ни  работы устройства.10 will be blocked by the zero state of the information at the outputs of the first subtractive counter 4. With each pulse at the input of the second register 20, zero information is output from the output of the second subtractive counter 5, which does not change the operating state of the device.

Вычисление факториала заданного J числа осуществл етс  циклами. Каждый цикл вычислени  характеризуетс  наличием исходного промежуточного значени ,  вл ющегос  результатом выполнени  вычислени  предыдущего цикла. Дл  ) первого цикла вычислени  исходным значением  вл етс  предварительно записанна  единица в накапливающем сумматоре 2 и в первом регистре 3. Количество циклов вычислени  определ етс  j количеством множителей факториала заданного , числа. Последний цикл вычислени  заканчиваетс  нулевым состо нием выходов второго вычитающего счетчика 5 и отрицательным сигналом на его 2 выходе.The factorial calculation of a given J number is performed in cycles. Each calculation cycle is characterized by the presence of an initial intermediate value, which is the result of the calculation of the previous cycle. For the first calculation cycle, the initial value is the pre-recorded unit in accumulation adder 2 and in the first register 3. The number of calculation cycles is determined by j, the number of factorial factors of a given number. The last calculation cycle ends with the zero state of the outputs of the second subtractive counter 5 and a negative signal at its 2 output.

Множители факториала заданного числа задаютс  поочередно, начина  с большего ег о значени , во втором вычитающем счетчике 5-при вычитании в з каждом цикле вычислени  единицы из его содержимого. Циклы вычислений дл  нечетных множителей факториала заданного числа реализуютс  путем накоплений , а четных - путем выделени  п-разр дного двоичного числа, кратного четному множителю, его хранением с последующим количеством накоплений, равным остатку при делении четного множител  на n-разр дное двоичное 4 число. Вместе с тем содержимое второго вычитающего счечтика 5, т.е. значение очередного множител , определ ет количество .накоплений в накапливающем сумматоре 2, в последующем 4 цикле вычислени .The factorial multipliers of a given number are set in turn, starting with a higher value, in the second subtractive counter, 5 — when the unit is deducted from its contents in each cycle of calculating a unit. Computation cycles for odd factors of a factorial of a given number are implemented by accumulations, and even ones by allocating an n-bit binary number that is a multiple of an even factor, storing it, followed by the number of accumulations equal to the remainder of dividing the even factor by an n-bit binary 4 number. However, the contents of the second subtractive count 5, i.e. the value of the next multiplier determines the number of accumulations in accumulative adder 2, in the next 4 calculation cycle.

Отрицательным импульсом на входе синхронизации устройства осуществитс  запись во второй вычитающий счетчик 5 информации с его группы входов,J т.е. осуществитс  запись двоичного значени  числа, факториал которого необходимо вычислить. Во врем  записи выход элемента И 6 будет заблокирован , т.е. исключитс  работа второгорегистра 20 на запись. После сн ти  отрицательного импульса записи с входа синхронизации выход элемента И 6 будет разблокирован и после поступлени  первого импульса на вход второго регистра 20 осуществитс  запись содержимого второго вычитающего сч етчика 5 Ненулевое значение информации на выходах регистра 20 задает ему через первый дешифратор 21 нул  режим сдвига информации влево (в сторону младших разр дов). При этом сигнал сброса триггера 24 отсутствует.A negative pulse at the synchronization input of the device records information from its input group, i.e. the binary value of the number whose factorial is to be calculated is written. During recording, the output of the element And 6 will be blocked, i.e. the operation of the second register 20 is excluded from the recording. After removing the negative write pulse from the synchronization input, the output of the And 6 element will be unblocked and after the first pulse arrives at the input of the second register 20, the contents of the second subtractive counter 5 will be recorded. The non-zero information at the outputs of the register 20 sets it through the first decoder 21 zero to shift the information left (in the direction of the younger bits). In this case, the reset signal of the trigger 24 is absent.

Если во второй регистр 20 записано двоичное значение четного числа, признаком четности которого  вл етс  О на его выходе, осуществитс  выделение n-разр дного двоичного числа путем сдвига информации влево на один разр д во втором регистре 20 до по влени  на его выходе 1. При этом каждый такт сдвига сопровождаетс  работой счетчика 23 по его счетному входу. При по влении 1 на выходе второго регистра 20 осуществитс  блокировка элемента И 6, включение генератора импульсов и запись информации с выходов второго регистра 20 в первый вычитающий счетчик 4. После чего в дальнейшем будет организован процесс накоплени .If the second register 20 contains the binary value of an even number whose parity is O at its output, the n-bit binary number is extracted by shifting the information to the left by one bit in the second register 20 until it appears at its output 1. When In this case, each shift cycle is accompanied by the operation of the counter 23 at its counting input. In case of occurrence of 1, the output of the second register 20 will block the element 6, turn on the pulse generator and record information from the outputs of the second register 20 into the first subtractive counter 4. Then the accumulation process will be organized later.

Если во второй регистр 20 записано двоичное значение нечетного числа, то 1 на его выходе вызовет запись значени  этого числа в первый вычитающий счетчик 4. iIf a binary value of an odd number is written in the second register 20, then 1 at its output will cause the value of this number to be written to the first subtractive counter 4. i

После записи в первый вычитающий счетчик 4 двоичного значени  любого числа, а оно всегда будет нечетное, устройство непосредственно реализует процесс накоплени  в накапливающем сумматоре 2. Количество накоплений будет на единицу меньше значени  нечетного числа. 1 с выхода элемента ИЛИ 13 осуществитс  выключение режима записи дл  первого вычитающего счетчика 4, включение генератора 1 импульсов, разрешение подачи импульсов с генератора 1 импульсов на вход вычитани  первого вычитающего счетчика 4 и на вход накапливающего сумматора 2 . А по переднему фронту сигнала на выходе элемента НЕ 17 осуществл етс  вычитание единицы из содержимого второго вычитающего счетчика 5. Накопление в накапливающем сумматоре 2 произойдет до тех пор пока содержимое первого вычитающего счетчика 4 станет равным двоичному значению единицы, О с выхода второго дешифратора 22 нул  заблокируетс  работа элементаAfter the binary value of any number is written to the first subtractive counter 4, and it will always be odd, the device directly implements the accumulation process in accumulative adder 2. The number of accumulations will be one less than the value of the odd number. 1 from the output of the element OR 13, the recording mode for the first subtractive counter 4 is turned off, the pulse generator 1 is turned on, the pulses from the pulse generator 1 are enabled to input the subtraction of the first subtractive counter 4 and to the input of accumulator 2. And on the leading edge of the signal at the output of the NOT element 17, the unit is subtracted from the contents of the second subtractive counter 5. The accumulation in accumulating adder 2 will occur until the contents of the first subtractive counter 4 become equal to the binary value of the unit, 0 from the output of the second decoder 22 zero is blocked work item

51575157

И 10, с выхода элемента И 9 осуществитс  сброс второго регистра 20. А по заднему фронту сигнала с выхода второго дешифратора 22 нул  осуществитс  запись результата накоплени  в первый регистр 3. Второй регистр 20 удерживаетс  в нулевом состо нии сигналом сброса до тех пор, пока не осуществитс  вычитание последней единицы из содержимого первого вычитающего счетчика 4. После сн ти  сброса с второго регистра 20 начинаетс  новый цикл промежуточного результата вычислени . После завершени  всех циклов вычислений результат вычислени  факториала заданного числа будет сочетать в себе результат накоплени , наход щегос  на первом информационном выходе устройства, со значением n-разр дного двоичного числа, наход щегос  на втором информационном выходе устройства.And 10, from the output of the element And 9, the second register 20 is reset. And on the falling edge of the signal from the output of the second decoder 22 zero, the accumulation result is recorded in the first register 3. The second register 20 is held in the zero state by a reset signal until the last unit is subtracted from the contents of the first subtractive counter 4. After the reset is removed, a new cycle of the intermediate result of the calculation begins in the second register 20. After completion of all calculation cycles, the result of calculating the factorial of a given number will combine the result of the accumulation located at the first information output of the device with the value of the n-bit binary number located at the second information output of the device.

Рассмотрим пример работы устройства при вычислении факториала числа три. Факториал числа три содержит в себе множители 1 - 3, из которых два нечетных и один четный. В накапливающем сумматоре 2 в цикле вычитани  дл  нечетного множител  3 осуществл етс  два накоплени . В результате чего в первый регистр 3 будет записан первый промежуточный результат вычислени , равный двоичному значению числа 3. Дл  четного множител  2 цикл вычислени  заключаетс  только в выделении двоичного числа, кратного числу 2, в результате чего содержимое счетчика станет равным 1. Дл  следующего нечетного множител  1 количество накоплений равно нулю. Итак, результат вычислени  факториала заданного числа содержитс  в первом регистре 3 и счетчике 23 и равен соответственно 3 и 2, произведение которых равно 6.Consider an example of the operation of the device when calculating the factorial of the number three. The factorial of the number three contains factors of 1 - 3, of which two are odd and one is even. In accumulative adder 2 in the subtraction cycle for the odd multiplier 3, two accumulations are made. As a result, the first intermediate result of the calculation will be written to the first register 3, equal to the binary value of the number 3. For an even multiplier 2, the calculation cycle consists only of extracting a binary number that is a multiple of 2, resulting in the contents of the counter becoming 1. For the next odd multiplier 1 the amount of savings is zero. Thus, the result of calculating the factorial of a given number is contained in the first register 3 and the counter 23 and is equal to 3 and 2, respectively, whose product is 6.

Claims (1)

Формула изобретени Invention Formula Устройство дл  вычислени  факториала числа, содержащее генератор импульсов , накапливающий сумматор, первый регистр, первый и второй вычитающие счетчики, первый элемент И, первый дешифратор нул , первый элемент НЕ, причем вход начальной установки устройства соединен с входом сброса первого и второго вычитающих счетчиков и первого регистра, вход синхронизации устройства соединен с входомA device for calculating a factorial of a number, containing a pulse generator, accumulating adder, first register, first and second subtractive counters, first AND element, first decoder zero, first NOT element, the input of the initial installation of the device connected to the reset input of the first and second subtractive counters and the first register, the device sync input is connected to the input 09(,09 (, разрешени  записи второго вычитающего счетчика, выход переполнени  которого соединен с выходом готовности устройства , информационный вход накапливающего сумматора соединен с первым информационным выходом устройства и выходом первого регистра, отличающеес  тем, что, с целью повышени  быстродействи , в него введены с второго по шестой элементы И, с второго по четвертый элементы НЕ, с первого по четвертый элементы ИЛИ, суммирующий счетчик, второй регистр,enable the recording of the second subtractive counter, the overflow output of which is connected to the device readiness output, the information input of the accumulating adder is connected to the first information output of the device and the output of the first register, characterized in that, in order to improve speed, the second to sixth elements are entered into it, items two through four are NOT, items one through four, or, summing counter, second register, 5 второй дешифратор нул  и триггер, причем вход синхронизации устройства соединен с первым входом первого элемента И, второй вход которого соединен с выходом генератора импульсов5 is a second zero decoder and a trigger, with the device synchronization input connected to the first input of the first element I, the second input of which is connected to the output of the pulse generator 0 и первым входом второго элемента И, второй вход которого соединен с выходом третьего элемента И и первым входом первого элемента ИЛИ, выход и . второй вход которого соединены соот5 ветственно с входом запуска генератора импульсов и третьим входом первого элемента И, выход переполнени  первого вычитающего счетчика соединен с первым входом второго элемента ИЛИ и0 and the first input of the second element AND, the second input of which is connected to the output of the third element AND and the first input of the first element OR, the output and. the second input of which is connected respectively to the trigger input of the pulse generator and the third input of the first element AND, the overflow output of the first subtractive counter is connected to the first input of the second element OR and 0 через первый элемент НЕ с первым входом третьего элемента ИЛИ, выход которого соединен с первым входом четвертого элемента И, второй вход которого соединен с входом начальной ус , тановки устройства и входом сброса суммирующего счетчика, вход синхронизации которого соединен с выходом п того элемента И, первый вход которого соединен с выходом первого элемента0 through the first element NOT to the first input of the third element OR, the output of which is connected to the first input of the fourth element AND, the second input of which is connected to the input of the initial device, device installation and the reset input of the summing counter, the synchronization input of which is connected to the output of the fifth element AND, the first input of which is connected to the output of the first element Q И, входом синхронизации второго регистра и входом синхронизации триггера, пр мой выход которого соединен с вторым входом п того элемента И, выход второго элемента ИЛИ соединен с пер5 вым входом четвертого элемента ИЛИ и первым входом третьего элемента И, второй вход которого соединен с входом второго элемента НЕ и выходом четвертого элемента ИЛИ, второй входQ AND, the synchronization input of the second register and the trigger synchronization input, the direct output of which is connected to the second input of the fifth AND element, the output of the second OR element, is connected to the first input of the fourth OR element and the first input of the third AND element, the second input of which is connected to the input the second element is NOT and the output of the fourth element OR, the second input 0 которого соединен с выходом третьего элемента НЕ и третьим входом первого элемента И, выход генератора импульсов соединен с первым входом шестого элемента И, второй вход которого соединен с выходом второго дешифратора0 which is connected to the output of the third element NOT and the third input of the first element I, the output of the pulse generator is connected to the first input of the sixth element I, the second input of which is connected to the output of the second decoder 5five нул , вторыми входами второго и третьего элементов ИЛИ и через четвертый элемент НЕ с входом синхронизации первого регистра, выход шестого элемента И соединен, с входом синхронизации накапливающего сумматора, выход четвертого элемента И соединен с входом сброса второго регистра, вход выбора режима которого соединен с выходом первого дешифратора нул  и входом сброса и информационным входом триггера, выход второго элемента НЕ соединен с вычитающим входом второго вычитающего счетчика, параллельный выход которого соединен с информационным входом второго регистра, последовательный выход которого соединен с входом третьего элемента НЕ, парал- лельный выход -второго регистра соединен с входом первого дешифратора нул zero, the second inputs of the second and third elements OR, and through the fourth element is NOT with the synchronization input of the first register, the output of the sixth element AND is connected to the synchronization input of the accumulating adder, the output of the fourth element And is connected to the reset input of the second register, the mode selection input of which is connected to the output the first decoder zero and the reset input and information input of the trigger, the output of the second element is NOT connected to the subtractive input of the second subtractive counter, the parallel output of which is connected to the information the input of the second register, the serial output of which is connected to the input of the third element NOT, the parallel output of the second register is connected to the input of the first decoder zero и информационным входом первого вычитающего счетчика, входы разрешени  записи и вычитани  которого соединены соответственно с выходом четвертого элемента ИЛИ и выходом второго элемента И, выход четвертого элемента И соединен с входом сброса второго регистра , параллельный выход первого вычитающего счетчика соединен с входом второго дешифратора нул , информационный вход устройства соединен с информационным входом второго вычитающего счетчика, выход суммирующего счетчика соединен с вторым информационным выходом устройства.and information input of the first subtractive counter, recording and subtraction resolution inputs of which are connected respectively to the output of the fourth element OR and the output of the second element AND, the output of the fourth element I is connected to the reset input of the second register, the parallel output of the first subtractive counter is connected to the input of the second decoder zero, information the device input is connected to the information input of the second subtractive counter, the output of the summing counter is connected to the second information output of the device.
SU884478541A 1988-08-29 1988-08-29 Device for computing number factorial SU1571609A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
SU884478541A SU1571609A1 (en) 1988-08-29 1988-08-29 Device for computing number factorial

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
SU884478541A SU1571609A1 (en) 1988-08-29 1988-08-29 Device for computing number factorial

Publications (1)

Publication Number Publication Date
SU1571609A1 true SU1571609A1 (en) 1990-06-15

Family

ID=21397493

Family Applications (1)

Application Number Title Priority Date Filing Date
SU884478541A SU1571609A1 (en) 1988-08-29 1988-08-29 Device for computing number factorial

Country Status (1)

Country Link
SU (1) SU1571609A1 (en)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Авторское свидетельство СССР № 1120345, кл. G 06 F 15/31, 1984. Авторское свидетельство СССР № 1297071, кл. G 06 F 15/31, 1986. *

Similar Documents

Publication Publication Date Title
SU1571609A1 (en) Device for computing number factorial
SU1141407A1 (en) Device for calculating value of square root
SU1456950A1 (en) Device for computing arcsine function
SU1007101A1 (en) Multiplying device
SU1642478A1 (en) Moving average calculator
SU1472901A1 (en) Function generator
SU1325467A1 (en) Dividing device
SU1363203A1 (en) Division device
SU1051730A1 (en) Pulse train divider (versions)
SU1157541A1 (en) Sequential multiplying device
SU809199A1 (en) Multi-channel multi-measure digital correlator
SU1552210A1 (en) Dividing device
SU1640709A1 (en) Device for fast fourier transforms
SU922765A1 (en) Device for determining probability distribution laws
SU1282156A1 (en) Device for calculating fourier coefficient
SU1647591A1 (en) Matrix inversion device
SU1167608A1 (en) Device for multiplying frequency by code
SU1631558A1 (en) Special processor for digital filtration
SU1206806A1 (en) Device for editing list
RU1837401C (en) Device for forming arbitrary modulo residue
RU1783618C (en) Converter of binary k-digit code to binary code
RU2011215C1 (en) Modulo 3 convoluting device
SU326576A1 (en) MULTIPLICATION DEVICE
SU1075260A1 (en) Device for making summation of m n-bit numbers arriving in sequential order
SU1587491A1 (en) Device for extremal filtration