пы, вторые входы которых соединены с выходами двоично-дес тичного сумматора , выходы элементов И п той и шестой групп соединены соответственно с первыми и вторыми входами элементов ИЛИ группы, выходы которых соединены с входами буферного регистра , выходы которого соединены с второй группой входов схемы сравнени .The second inputs of which are connected to the outputs of the binary-decimal adder, the outputs of the elements of the fifth and sixth groups are connected respectively to the first and second inputs of the elements OR groups, the outputs of which are connected to the inputs of the buffer register, the outputs of which are connected to the second group of inputs of the comparison circuit .
Изобретение относитс к автоматике и цифровой вычислительной технике и может быть использовано при постро ении преобразователей кодов чисел, а также в аппаратуре.допускового контрол и автоматического слежени за двоично-кодированными параметрами сигналов. Целью изобретени вл етс расширение функциональных возможностей устройства путем обеспечени вычислени процентного отношени двоичных чис ел. Сущность изобретени заключаетс в том, что помимо преобразований двоичного кода в двоично-дес тичный и обратно, которые состо т в том, что последовательно суммируютс дво ично-дес тичные эквиваленты тек разр дов двоичного кода, гДе имеет место код единица, обеспечиваетс ещ и вычисление процентного отношени кодов двоичных чисел согласно равен ству A-IOO Л--(00 На чертеже представлена функциональна схема предлагаемого реверсивного преобразовател двоичного кода в двоично-дес тичный. Преобразователь содержит двоичный регистр 1, шифратор 2 дес тичных эквивалентов, двоично-дес тичный сумматор 3, двоично-дес тичный регистр 4, распределитель 5 импульсов схему 6 сравнени , входы 7 двоичнодес тичного числа, первый вход 8 задани режима, генератор 9 импульсов , первый элемент И 10, второй эле мент И 11, элемент ИЛИ 12, элемент НЕ 13, входы 14 двоичного числа, пер вую, вторую, третью и четвертую груп пы элементов И 15-18, буферный регистр 19, п тую группу элементов И 20, третий элемент И 21 и второй вход 22 задани режима, шестую группу элементов И 23, группу элементов ИЛИ 24. Преобразователь работает в трех режимах. В режиме 1 обеспечиваетс преобразование двоичного кода в двоично-дес тичный , в режиме 2 - преобразование двоично-дес тичного кода в двоичный и в режиме 3 - вычисление процентного отношени двоичных чисел. В )ежиме 1 на первьй и второй входы 8 и 22 подаетс нулевой потенциал. Через входы 14 в двоичный регистр 1 записываетс код преобразуемого двоичного числа. Затем включаетс генератор 9 импульсов. Первый импульс с первого выхода распределител 5 импульсов опрашивает старший разр д двоичного регистра 1. При единичном значении разр да сигнал поступает на вход шифратора 2 дес тичных эквивалентов , с выходов которого дес тичный эквивалент старшего разр да заноситс в двоично-дес тичный сумматор 3. Следующий импульс с второго выхода распределител 5 импульсов опрашивает следующий разр д регистра 1 и при наличии в нем единицы сигнал с выхода элемента И из группы 15 поступает на вход шифратора 2 дес тичных эквивалентов, С выходов последнего дес тичный эквивалент второго разр да поступает в сумматор 3, где суммируетс с предыдущим значением и т.д. После опроса всех разр дов импульс с выхода распределител 5 выключает генератор импульсов. Результат преобразовани двоичного кода в двоично-дес тичный хранитс в сумматоре 3. В режиме 2 на вход 8 подаетс единичный потенциал, а на вход 22 - нулевой потенциал. На входы 7 подаетс 311 потенциальный двоично-дес тичный код преобразуемого числа, триггеры регистра 1 устанавливают в нуль. Затем включаетс генератор 9 импульсов и импульс с первого выхода распределител 5 импульсов через открытый элемент И из группы 17 поступает на шифратор 2 эквивалентов, с выхода которого на сумматор 3 поступает двоично-дес тичный эквивалент старшего двоичного разр да. Если код на входах 7. равен коду, поступающему с сумматора 3, сигнал с выхода равенства схемы 6 сравнени выключает генератор 9 импульсов. Если код на входах 7 больше кода, поступающего с сумматора 3, то открыты элементы И 18 четвертой группы, элемент И старшего разр да в группе 16. По окончании первого тактового импульса в двоично-дес тичный регистр 4 записываетс дес тичный эквивалент старшего двоичного разр да и единица в старший разр д двоичного регистра 1. Если код на входах 7 меньше кода, поступающего с выходов сумматора 3, то регистр 4 и регистр 1 после первого такта не измен ют своих значений.Второй тактовый импульс через открытый элемент И из группы 17 поступает на следующий вход шифратора 2 эквивалентов, с выходом которого на сумматор 3 поступает дес тичный эквивалент следующего двоичного разр да. С выходов сумматора 3 на схему 6 сравнени поступает сумма эквивалента второго разр да и содержимого регистра 4. Если код суммы равен коду на шинах 7 то сигнал со схемы 6 сравнени выклю чает генератор 9 импульсов. Если код на входах 7 больше кода, поступающего с выходов сумматора 3, то открыты элементы И из группы 18 и элементы И из группы 16. По окончании второго тактового импульса в двоично-дес тичный регистр 4 записываетс упом нута сумма и единица во второй разр д регистра 1. В противном случае содержимое регистра 4, сумматора 3 и регистра 1 не изменитс и т.д. Таким образом , после выключени генератора 9 выходным сигналом распределител 5 импульсов (или ренее) в регистре 1 будет содержатьс двоичный эквивалент преобразуемого двоично-дес тичного числа. Результат преобразовани двоично-дес тичного кода в двоичный хранитс в регистреLlj. 3 Быстродействие устройства при пр мом и обратном преобразовании остаетс одинаковым, поскольку число тактов работы устройства в обоих режимах равно числу разр дов преобразуемых чисел. В режиме 3 на входы 8 и 22 подаетс нулевой потенциал. Через входы 14 в двоичный регистр 1 записываетс двоичный код числа А, преобразуемого в процентное отношение. Затем включаетс генератор 9 импульсов. Первый импульс с первого выхода распределител импульсов опрашивает стар1Ш1й разр д преобразуемого кода двоичного регистра 1. При единичном значении разр да сигнал поступает на вход шифратора 2 дес тичных эквивалентов, с выходов которого дес тичный эквивалент старшего разр да заноситс в двоично-дес тичный сумматор 3. Следующий импульс с второго вьсхода распределител 5 импульсов опрашивает следующий разр д регистра 1 и при наличии в нем единицы сигнал с выхода элемента И группы 15 поступает на вход шифратора 2 дес тичных эквивалентов . С выхода последнего дес тичный эквивалент второго разр да поступает в сумматор 3, где суммируетс с предьщущим значением и выключает генератор импульсов. На этом заканчиваетс преобразование двоичного кода числа А в двоично-дес тичный код. Результат преобразовани хранитс в сумматоре 3. Затем на вход 8 подаетс единичный потенциал, а на вход 22 - положительный импульс, и двоично-дес тичный код числа А из сумматора 3 через открытые элементы группы 23 записываетс буферный регистр 19 со сдвигом на восемь разр дов в сторону старших, обеспечива таким образом операцию умножени числа А на 100. Операци записи содержимого сумматора 3 в буферный регистр 19 со сдвигом обеспечиваетс тем, что вькод первого разр да сумматора 3 соединен с тем же элементом И группы 23, к второму входу которого подключен вход дев того разр да, аналогично выход второго разр да сумматора 3 соединен с тем же элементом И из группы 23, к второму входу которого подключен вход дес тичного разр да и т.д. Таким образом, на входе схемы 6 сравнени устанавливаетс потенциальный двоично-дес тичный код величины А100. После чего триггеры регистра устанавливаютс в нуль и включаетс генератор 9 импульсов. Начина с этого момента, устройство работает так, как это было описано в режиме 2. Результат Впреобразовани двоичного кода числа А согласно равенству (1) хранитс в регистре 1. Операци делени на число 2 согласно (1) обеспечиваетс тем, что при считьшании результата 6 из регистра 1 114 1 3 выход 1 -го разр да регистра 1 соответствует первому разр ду . выходного кода процентного отношени , выход (k+D-ro разр да регистра 1 второму разр ду и т.д. Таким образом, дл вычислени процентного отношени двоичных чисел достаточно выполнить пр мое и обратное преобразовани без дополнительных затрат времени на выполнение согласно (1) операций умножени и делени .The invention relates to automation and digital computer technology and can be used in the construction of number code converters, as well as in equipment for starting control and for automatic tracking of binary-coded signal parameters. The aim of the invention is to enhance the functionality of the device by providing a calculation of the percentage of binary numbers. The essence of the invention is that in addition to converting the binary code to binary-decimal and vice versa, which consist in sequentially summing up the binary-decimal equivalents of the binary code bits, where the code is one, there is also a calculation the percentage of codes of binary numbers according to the equality A-IOO L - (00 The drawing shows the functional diagram of the proposed reverse binary-to-decimal converter. The converter contains the binary register 1, the ciphertext op 2 decimal equivalents, binary decimal adder 3, binary decimal register 4, distributor 5 pulses comparison circuit 6, inputs 7 of binary number, first mode setting input 8, pulse generator 9, first element 10, second ele ment 11, element OR 12, element NOT 13, inputs 14 binary numbers, the first, second, third and fourth groups of elements 15-18, the buffer register 19, the fifth group of elements 20, the third element 21 and the second input 22 set mode, the sixth group of elements And 23, a group of elements OR 24. The converter is running in three modes. In mode 1, the binary code is converted to binary-decimal, in mode 2, the binary-decimal code is converted to binary, and in mode 3, the percentage of binary numbers is calculated. B) In mode 1, zero potential is applied to the first and second inputs 8 and 22. Through inputs 14 to binary register 1, the code of the binary number to be converted is written. Then, the pulse generator 9 is turned on. The first pulse from the first output of the distributor 5 pulses polls the high bit of the binary register 1. With a single bit value, the signal enters the encoder 2 decimal equivalents, from whose outputs the decimal equivalent of the high bit is entered into the binary-decimal adder 3. Next the pulse from the second output of the distributor 5 pulses polls the next register bit 1 and if there is a unit in it, the signal from the output of the element And from group 15 is fed to the input of the encoder 2 decimal equivalents, From the outputs after has a decimal equivalent of the second discharge is supplied to the adder 3 where summed with the previous value, etc. After interrogating all the bits, the pulse from the output of the distributor 5 turns off the pulse generator. The result of converting a binary code to a binary decimal is stored in adder 3. In mode 2, a single potential is supplied to input 8 and a zero potential to input 22. The inputs 7 are supplied with the 311 potential binary-decimal code of the number being converted, the triggers of register 1 are set to zero. Then, the pulse generator 9 is turned on and the pulse from the first output of the distributor 5 pulses through the open element And from group 17 goes to the encoder 2 equivalents, from the output of which to the adder 3 the binary-decimal equivalent of the highest binary digit comes. If the code at the inputs 7. is equal to the code from the adder 3, the signal from the equality output of the comparison circuit 6 switches off the generator 9 pulses. If the code at inputs 7 is greater than the code coming from adder 3, elements AND 18 of the fourth group are opened, the element AND of the most significant bit in group 16. At the end of the first clock pulse, the decimal equivalent of the most significant binary digit is written to the binary-decimal register 4 and one in the high bit of the binary register 1. If the code at inputs 7 is less than the code from the outputs of adder 3, then register 4 and register 1 after the first clock cycle do not change their values. The second clock pulse through the open element And from group 17 enters on following encoder input 2 equivalents, the output of which is supplied to the adder 3, a decimal equivalent of the next binary digit. From the outputs of the adder 3, the sum of the equivalent of the second bit and the contents of the register 4 goes to the comparison circuit 6. If the sum code is equal to the code on the tires 7, the signal from the comparison circuit 6 turns off the generator 9 pulses. If the code at inputs 7 is greater than the code from the outputs of adder 3, the AND elements from group 18 and the AND elements from group 16 are open. At the end of the second clock pulse, the sum and one in the second digit are written to the binary-decimal register 4 register 1. Otherwise, the contents of register 4, adder 3 and register 1 remain unchanged, etc. Thus, after turning off the generator 9, the output signal of the distributor 5 pulses (or more) in register 1 will contain the binary equivalent of the binary-decimal number being converted. The result of converting the binary-decimal code to binary is stored in the register Llj. 3 The speed of the device during the forward and reverse transformations remains the same, since the number of cycles of operation of the device in both modes is equal to the number of bits of the numbers being converted. In mode 3, zero potential is applied to inputs 8 and 22. Through the inputs 14 to the binary register 1, the binary code of the number A is converted into a percentage. Then, the pulse generator 9 is turned on. The first pulse from the first output of the pulse distributor polls the old bit of the binary register 1 code being converted. With a single bit value, the signal is fed to the input of the encoder 2 decimal equivalents, from the outputs of which the highest bit equivalent is entered into the binary-ten adder 3. The next pulse from the second output of the distributor 5 pulses polls the next register bit 1, and if there is a unit in it, the signal from the output of the AND element of group 15 is fed to the input of the encoder 2 decimal equivalents . From the output of the latter, the decimal equivalent of the second bit enters the adder 3, where it is summed with the previous value and turns off the pulse generator. This completes the conversion of the binary code of the number A to the binary-decimal code. The result of the conversion is stored in adder 3. Then a single potential is fed to input 8, and a positive impulse is fed to input 22, and the binary-decimal code of number A from adder 3 through the open elements of group 23 is recorded the buffer register 19 with a shift of eight bits to the senior side, thus providing the operation of multiplying the number A by 100. The operation of writing the contents of adder 3 to the buffer register 19 with a shift is ensured by the fact that the first digit of the adder 3 is connected to the same AND element of group 23, to the second input of which entrance connected ninth discharge, similarly to the second discharge outlet of the adder 3 is connected to the same AND element from group 23, to the second input of which is connected input a decimal discharge etc. Thus, at the input of the comparison circuit 6, a potential binary-decimal value code A100 is established. After that, the register triggers are set to zero and the pulse generator 9 is turned on. Starting from this moment, the device works as it was described in mode 2. The result of converting the binary code of the number A according to equality (1) is stored in register 1. The operation of dividing by 2 according to (1) is ensured by the fact that when reading the result 6 from register 1 114 1 3 output of the 1st bit of register 1 corresponds to the first bit. output code, percentage, output (k + D-ro register bit 1 to the second bit, etc. Thus, to calculate the percentage of binary numbers, it is sufficient to perform forward and inverse transformations without additional execution time according to (1) multiply and divide operations.