2. Датчик по П.1, о т л и ч а ю щ и и с тем, что преобразователь код-число импульсов содержит счетчик, элемент ИЛИ, элемент И и генератор импульсой, выход которого соединен с первым входом элемента И, выход которого вл етс информационным выходом преобразовател и соединен с вычитающим входом счетчика, вход2. The sensor according to Claim 1, which means that the code-number of pulses converter contains a counter, an OR element, an AND element and a pulse generator, the output of which is connected to the first input of an AND element whose output is the information output of the converter and is connected to the subtracting input of the counter, the input
Запись которого вл етс управл ющим входом преобразовател , информационным входом которого вл етс установочный вход счетчика, выходы разр дов которого соединены с.входами элемента ИЛИ соответственно, выход которого вл етс выходом преобразовател и соединен с вторым входом элемента И.The recording of which is the control input of the converter, whose information input is the installation input of the counter, the discharge outputs of which are connected to the inputs of the OR element, respectively, whose output is the output of the converter and is connected to the second input of the element I.
Изобретение относитс к вычислительной технике, в частности к цифровым датчикам случайных чисел; и может быть использовано дл испытани аппаратуры в качестве источника входного сигнала. Известен датчикслучайных чисел который вырабатывает многоразр дные случайные числа с равномерным распределением в интервале от О до (п - разр дность датчика) ij Недостаток этого устройства заключаетс в том, что оно принципи ально не позвол ет получать случайные числа, равномерно распределенные в интервале от А до В (А и В любые целые числа). В то же врем при испытани х различной аппаратуры дискретного действи , на ее входы необходимо подавать случайные чихала, лежащие в пределах входного диапазона испытываемой аппаратуры, кот.орый в общем случае расположен между границами А и В. Наиболее близким к изобретению вл етс датчик случайных чисел, равномерно распределенных в интервале от О, до А (А - любое целое чи ло) , содержаи№1й источник случайных чисел, блок-схему запрета, дешифра тор, счетчик, блок логических схем ИЛИ 2 . Однако на выход этого датчика могут поступать числа больше, чем А. Поскольку при открытой схеме запрета (когда R; и А) к блоку схем ИЛ подключены одновременно и выходы счетчика, то на выход поступает не генерируемое число R, а числорезультат логической операции R ИЛИ В (в - содержимое счетчика). В результате получаетс случайное число, которое в отдельных случа х превышает значение А. Наримар, если ,о , ,о , , то R;-) В 1000, 01102 1110, 10,0 . Закон распределени выходных чисел известного датчика не вл етс равномерным . Поскольку со счетчика чис ла поступают в естественном пор дке то при значительной разности (2 -1)-А с большой веро тностью на выходе числа будут иметь естественный пор док (т.е. К, К+1, К+2, ;..). Цель изобретени - расширение функциональных возможностей датчика путем обеспечени возможности изменени диапазона формируемых чисел. Дл достижени поставленной цели в датчик равномерно распределенных случайных чисел, содержащий первичный источник равномерно распределенных случайных чисел, счетчик, первый регистр пам ти, выход которого вл етс выходом датчика, введены два регистра кода, две схемы сравнени , преобразователь код-число импульсов, второй регистр пам ти и генератор импульсов, выход которого соединен с управл ющим входом второго регистра пам ти, выход которого соединен с первым входом первой схемы сравнени , выход -которой соединен с управл ющим входом преобразовател код-число импульсов, информационный выход которого соединен с суммирующим входом счетчика, информационный выход которого соединен с первым входом второй схемы сравнени и с информационным входом первого регистра пам ти, выход первичного источника равномерно распределенных случайных чисел соединен с информационным входом второго регистра пам ти , с вторым входом первой схемы сравнени и с информационным входом преобразовател код-число импульсов, выход. которого соединен с управл ю11№1м входом первого регистра пагл тТ ,вы-ход первого регистра кода соединен с вторым входом второй схемы сравнени , выход которой соединен с входом Запись счетчика, установочный вход которого подключен к выходу второго регистра кода. Преобразователь код-число импульсов содержит счетчик, элемент ИЛИ, элемент И и генератор импульсов, выход ко хорого соединен с первым входом элемента И, выход которого вл етс информационным выходом пре образовател и соединен с вычитающим входом счетчика, вход Запись которого вл етс управл ющим входо преобразовател , информационным входом которого вл етс установочный вход счетчика, выходы разр дов которого соединены с входами элемен тов ИЛИ соответственно, выход которого вл етс выходом преобразовате л и соединен с вторым входом элеме та И. . На чертеже показана блок-схема предлагаемого датчика. Датчик содержит первичный источник 1 равномерно распределенных случайных чисел, преобразователь 2 код-число импульсов, блок 3 определени смены кода, преобразователь 4 числа импульсов в код, регистр 5 па м ти и выход 6. Преобразователь 2 код-число импульсов содержит генера тор 7 импульсов, элемент И 8, счетчик 9, элемент ИЛИ 10. Блок 3 определени смены кода содержит регистр 11 пам ти, схему 12 сравнени и ген ратор 13 импульсов. Преобразователь 4 числа импульсов в код содержит счетчик 14, схему 15 сравнени , регистры 16 и 17 кода. Датчик случайных чисел работает следующим образом. Датчик предназначен дл выработ ки случайных чисел, равномерно распределенных в интервале от А до В. и В - любые целые числа, которые задаютс с наборного пол . Источник 1 генерирует случайное число в интер вале от О до . Блок 3 определ е когда число на выходе источника 1 измен етс . После получени разрешени от блока 3 определени смены к да случайное число преобразуетс преобразователем 2 в соответствующе число импульсов, поступающих на пре образователь 4 числа импульсов в код (Преобразователь 4 преобразует это число в код, лежащий в диапазоне от А до В. По окончании преобразовани полученный код записываетс в регистр 5. Блок 3 определени смены кода работает следующим образом. С генератора 13 импульсы непрерывно поступают на управл ющих вход регистра 11 и записывают в него код с выходов источника 1. Этот же код поступает на первые входы схемы 12 сравнени , на вторые входы которой поступает код с выходов регистра 11 На выходе схемы сравнени при равенстве - кодов ,на входах :имеем нулевой потенциал. Когда на выходе источника 1 по витс код нового числа, то он сразу поступит на первые входы схемы 12 сравнени . На вторые входы этот код поступит с задержкой (после очередного импульса генератора 13). Так как некоторое врем на входах схемы сравнени присутствуют разные коды, то на выходе по витс 1, котора поступает на вход преобразовател 2 кода в число импульсов. Преобразователь 2 работает слеiдующим образом, В исходном состо нии на выходах счетчика 9 имеетс код00 ... О, в результате чего имеетс логический нуль на выходе элемента ИЛИ 10. Эт.от нуль запрещает проходить импульсам с генератора 7 на выход элемента И . Управл ю1ций импульс с блока 3 определени смены кода своим задним фронтом записывает код в счетчик 9. На выходе cxeNH ИЛИ 10 по витс 1, котора откроет элемент И В.- В результате на выход преобразовател и на вычитаюо1Ий вход счётчика 9 будут поступать импульсм. Когда содержимое счетчика станет равным нулю (как в исходном состо нии), элемент И 8 будет оп ть закрыт. Таким образом , на выход преобразовател поступ т импульсы, число которых соответствует коду, записанному в счетчик 9. Преобразователь 4 числа импульсов в код работает следующим образом. В исходном состо нии в счетчике Г4 находитс число между А и В. Импульсы с выхода преобразовател 2 увеличивают состо ние счетчика до тех пор, пока в нем не окажетс число В, которое поступает на входы схемы 15 сравнени с выходов регистра 16. При по влении на выходах сЧетчика 14 числа В схема 15 срав 1ени переносит в него число А с выходов регистра 17, в котором оно хранитс . Таким образом , счетчик 14 мен ет свое 5со сто ние от А до В и вновь, возвращаетс в А при каждом срабатывании 15 сравнени . Других состо ний счетчик 14 не может, поэтому его ВЫХОДНОЙ код после подачи любого числа импульсов на его вход лежит в пределах от А до В. Таким образом, предлагаемый датчик, в отличие от известных, позвол ет получить случайные числа, равномерно распределенные в пределах заранее заданного диапазона от А до В (А и В - любые целые числа, меньше п - разр дность источника входного сигнала).. Предлагаемый датчик может быть применен при испытани х аппаратуры, на вход которой поступают числа в диапазоне, на который данна аппаратура расчитана. Отсутствие в вырабатываемых датчиком числах чисел, лежащих за пределами входного диапазона испытуемой аппаратуры, позвол ет сократить врем испытани путем исключени затрат времени на подачу нерабочих воздействий и изучени реакции испытуемой аппаратуры на них. Следовательно, предлаraef«jrt датчик случайных чисел по сравнению с известным позвол ет сокртить врем испытаний различной аппаратуры с цифровым входом, а с использованием на выходе датчика цифроаналогового преобразовател и с аналоговым входом. В качестве базового объекта вз т датчик случайных чисел, распределенных в инт вале от О до , построенный на сдвиговых регистрах. Дл иммитации сигналов датчиков температуры и давлени воды нужет датчик случайных чисел с выходным диапазоном от 300 до 1000. Примен датчик с диапазоном чисел от О до 1023, на испытание аппаратуры затрачено врем Т. За это врем на вход аппаратуры подаютс , кроме рабочих, числа от О до 300 и от 1001 до 1023, па которые испытуема аппаратура не реагирует. Врем на подачу этих нерабочих воздействий затрачено зр и составит величину Т, т.е. предлагаемое устройство позвол ет увеличить производительность труда путем сокращени времени испытаний. л ( 300-0) + (1023-1001) ,304. Следовательно, врем испытаний сокращаетс на 30%. Поскольку стоимость .испытаний аппаратуры составл ет 6 тыс. руб. в мес ц, то ожидаемый экономический эффект от использовани изобретени на единицу продукции составит 1800 руб. в мес ц. Ориентировочна потребность народного хоз йства в изобретении 1000 шт. в год. Годовой экономический эффект от максимального , использовани датчика случайных чисел 21 млн. 600 тыс. руб.The invention relates to computing, in particular to digital random number sensors; and can be used to test hardware as an input source. A random number sensor is known that produces multi-bit random numbers with a uniform distribution in the interval from O to (n is the sensor width) ij The disadvantage of this device is that it basically does not allow for obtaining random numbers evenly distributed in the interval from A to B (A and B are any integers). At the same time, when testing various discrete-action equipment, random sneezes must be supplied to its inputs that lie within the input range of the equipment under test, which is generally located between boundaries A and B. The closest to the invention is a random number sensor. , uniformly distributed in the interval from O to A (A is any integer number), containing the # 1 source of random numbers, a block diagram of the prohibition, a decoder, a counter, a block of logic circuits OR 2. However, the output of this sensor can receive numbers greater than A. Since, with an open inhibit scheme (when R; and A), the counter outputs are simultaneously connected to the block of IL circuits, the output does not generate the generated number R, but the number is the result of the logical operation R OR In (in - the contents of the counter). The result is a random number, which in some cases exceeds A. A. Narimar, if, o, o, o, then R ;-) B 1000, 01102 1110, 10.0. The distribution of the output numbers of a known sensor is not uniform. Since the numbers come from the counter in the natural order, with a significant difference (2 -1) -A, the numbers will most likely have a natural order at the output (i.e., K, K + 1, K + 2,;. .). The purpose of the invention is to enhance the functionality of the sensor by allowing the range of numbers to be changed. To achieve this goal, a uniformly distributed random number sensor containing a primary source of uniformly distributed random numbers, a counter, the first memory register, the output of which is the sensor output, two code registers, two comparison circuits, a code-number converter, and a second register. memory and pulse generator, the output of which is connected to the control input of the second memory register, the output of which is connected to the first input of the first comparison circuit, the output of which is connected to the control input The code-number pulses of the converter, the information output of which is connected to the summing input of the counter, whose information output is connected to the first input of the second comparison circuit and the information input of the first memory register, the output of the primary source of uniformly distributed random numbers , with the second input of the first comparison circuit and with the information input of the converter, the code-number of pulses, the output. which is connected to the control 11n1m input of the first register ptl tT, the output of the first register code is connected to the second input of the second comparison circuit, the output of which is connected to the input Record counter, the setup input of which is connected to the output of the second code register. The converter code-number of pulses contains a counter, an OR element, an AND element and a pulse generator, the output of which is connected to the first input of an AND element, the output of which is the information output of the converter and connected to the subtractive input of the counter whose input is a control input the converter, whose information input is the installation input of the counter, the bit outputs of which are connected to the inputs of the OR elements, respectively, the output of which is the output of the converter and connected to the second course element a GI. The drawing shows a block diagram of the proposed sensor. The sensor contains the primary source 1 of uniformly distributed random numbers, the converter 2 is the code-number of pulses, the code change determination unit 3, the converter 4 is the number of pulses into a code, the register is 5 bits and the output 6. The converter 2 is the code-number of pulses contains a generator of 7 pulses , element AND 8, counter 9, element OR 10. The code change determination unit 3 contains a register 11 of memory, a comparison circuit 12 and a generator of 13 pulses. Converter 4 of the number of pulses into a code contains a counter 14, a comparison circuit 15, registers 16 and 17 of the code. The random number sensor works as follows. The sensor is designed to generate random numbers that are evenly distributed in the interval from A to B. And B is any integer numbers that are specified from the keypad. Source 1 generates a random number in the interval from O to. Block 3 is determined when the number at the output of source 1 changes. After obtaining the resolution from the shift definition block 3 to yes, the random number is converted by the converter 2 into the corresponding number of pulses fed to the converter 4 of the number of pulses into a code (Converter 4 converts this number into a code ranging from A to B. At the end of the conversion, the resulting The code is written to register 5. The code change determining unit 3 works as follows: From the generator 13, the pulses are continuously fed to the control inputs of register 11 and the code from the source 1 outputs is written to it. It comes to the first inputs of the comparison circuit 12, the second inputs of which receive the code from the outputs of register 11 At the output of the comparison circuit with equality - codes, at the inputs: we have zero potential. When the output of source 1 has the code of a new number, it will immediately go to the first inputs of the comparison circuit 12. The second inputs receive this code with a delay (after the next pulse of the generator 13.) Since some time there are different codes at the inputs of the comparison circuit, the output is 1, which goes to the input of the code 2 converter into pulse in. Converter 2 operates as follows. In the initial state, the outputs of the counter 9 have code00 ... O, as a result of which there is a logical zero at the output of the OR 10 element. This zero prevents the pulses from passing through the generator 7 to the output of the And element. The impulse control from the code change determination unit 3, with its falling edge, writes the code to counter 9. At the output cxeNH OR 10, it turns on 1, which will open the element AND B. - As a result, impulses will arrive at the output of the converter and at the subtracting input of counter 9. When the contents of the counter become zero (as in the initial state), the AND element 8 will again be closed. Thus, at the output of the converter, there are pulses, the number of which corresponds to the code recorded in counter 9. The converter 4 of the number of pulses into a code works as follows. In the initial state in the counter G4 there is a number between A and B. The pulses from the output of converter 2 increase the state of the counter until it contains the number B, which is fed to the inputs of the comparison circuit 15 from the outputs of the register 16. When at the outputs of the counter 14 of the number B, the circuit 15 compares it with the number A from the outputs of the register 17 in which it is stored. Thus, the counter 14 changes its position from A to B, and again, returns to A with each triggering of 15 comparisons. Other states, the counter 14 cannot, therefore its OUTPUT code after applying any number of pulses to its input lies in the range from A to B. Thus, the proposed sensor, unlike the known ones, allows to obtain random numbers evenly distributed within the limits of specified range from A to B (A and B are any integers, less than n is the width of the input source). The proposed sensor can be used for testing equipment, the input of which receives numbers in the range for which this equipment is designed. The absence in the numbers produced by the sensor that lie outside the input range of the equipment under test can shorten the test time by eliminating the time spent on the delivery of non-working effects and studying the response of the equipment under test to them. Consequently, the pred raef jrt random number sensor as compared to the known one allows you to shorten the test time of various equipment with a digital input, and using an analog-to-digital converter at the output of the sensor with an analog input. A random number sensor distributed in the interval from O to, built on shift registers is taken as the base object. To simulate the signals of the temperature and pressure water sensors, a random number sensor with an output range from 300 to 1000 is needed. Applying a sensor with a range of numbers from 0 to 1023, time T was consumed to test the equipment. During this time, About up to 300 and from 1001 to 1023, pas which the equipment under test does not react. The time for the filing of these non-working effects spent sp and amount to T, i.e. The proposed device allows increasing labor productivity by reducing test time. l (300-0) + (1023-1001), 304. Therefore, the test time is reduced by 30%. Since the cost of testing equipment is 6 thousand rubles. per month, the expected economic effect from the use of the invention per unit of production will be 1,800 rubles. in months c. Approximate need of a national household in the invention of 1000 pieces. in year. The annual economic effect from the maximum using a random number generator is 21 million 600 thousand rubles.