Изобретение относитс к автоматике и цифровой вычислительной технике, может быть использовано в измерительных и управл ющих системах и предназначено дл согласовани системы программного управлени с внешними устройствами , например с датчиками обратной св зи, с шаговым приводом с устройствами индикациии т.д., работающими в различных системах представлени информации. Известен преобразователь двоично го кода в двоично-дес тичньй код градусов и минут, содержащий двоичный и двоично-дес тичный счетчики, дешифратор , генератор импульсов, элементы И и делители частоты. Работа зтого преобразоватед осн вана на пересчете импульсов с подбо ром коэффициентов пересчета Недостатками известного преобразовател вл ютс низкое быстродейс вие, сложность, невозможность преоб разовани в двоично-дес тичный код градусов, долей градусов, тыс чных делений угломера и т.д. Кроме того, ограничены их функциональные возмож ности, так как отсутствует возможность формировани унитарного кода с ценой делени , выраженной в угловых единицах. Наиболее близким по технической сущности к предлагаемому вл етс преобразователь двоичного кода в двоично-дес тичный код угловых единиц , содержащий двоичный счетчик, двоично-дес тичный счетчик, дешифратор , два элемента И, сумматор, ре гистр, генератор импзшьсов, выход которого через первый элемент И сое динен со стробирующим входом регист ра, первым входом второго элемента И и с входом двоичного счетчика, вы ход которого через дешифратор подключен к второму входу первого элемента И, вход задани константы сое динен .с аервой группой входом сумматора , втора группа входом которо го подключена к выходу регистра, а выходы сумматора соединены с информационньши входами регистра Недостаток известного преобразовател состоит в малом быстродействии при преобразовании измен шцетос входного двоичного кода. При измене нии входного кода ддже на одну диск ретную единицу требуетс сброс прео разовател в исходное состо ние и повторное преобразование числа, что требует значительного времени. Кроме того, в известном устройстве отсутствуют возможность преобра зовани двоичного кода в унитарный с ценой импульса, выраженной в угловых единицах, и формировани импульсного кода приращени входного кода, также,выраженного в угловых единицах . В известном устройстве отсутствует возможность преобразовани отрицательных чисел, представленным, например, в дополнительном коде.Все это приводит к ограниченным функциональным возможност м преобразоваЦель изобретени - повышение быстродействи и расширение функциональных возможностей за счет обеспечени преобразовани как положительных , так и отрицательных чисел, а также возможности вьщачи результата унитарным кодом. , I Поставленна цель достигаетс тем, что в преобразователь двоичного кода в двоично-дес тичный код угловых единиц, содержащий регистр, двоично-дес тичньй счетчик, первый и второй элементы И, сумматор, выходы которого соединены с информационными входами регистра, выходы которого соединены с первой группой входов сумматора, выход первого элемента И соединен со входом сложени двоичнодес тичного счетчика, вход сброса которого соединен со входом сброса регистра и со входом сброса преобразовател , выходы которого вл ютс выходами двоично-дес тичного счетчика , дополнительно введены группа элементов ИСКЛЮЧАЮЩЕЕ ИЛИ, элемент НЕ, элементИЛИ, схема сравнени , а двоично-дес тичный счетчик выполнен реверсивным, вход вычитани которого соединен с выходом второго элемента И, первым входом элемента ИЛИ и вл етс выходом отрицательных чисел унитарного кода преобразовател , выход положительных чисел унитарного кода которого соединен с выходом первого элемента И и вторым входом элемента ИЛИ, выход которого соединен с синхровходом регистра, выходы которого соединены с первой группой входов схемы сравнени , втора группа входов которой вл ютс информационными входами преобразовател , вход сброса которого через элемент 31 НЕ соединен с первыми входами перво го и второго элементов И, вторые входы которых соединены с выходами Меньше и Больше схемы сравнени соответственно, а третьи входы первого и второго элементов И соединены с тактовым входом преобра зовател , входы константы которого соединены с первыми входами элементов ИСКЛЮЧАЩЕЕ ИЛИ группы, выходы которых соединены со второй группой входов сумматора, вход переноса кот рого соединен с выходом Больше схемы сравнени и со вторыми входами элементов- ИСКЛЮЧАЮЩЕЕ ИЛИ группы На фиг. 1 приведена функциональна схема преобразовател ; на фиг.2 блок-схема схемы сравнени ; на фиг. 3 - временные диаграммы, по сн ющие принцип работы-преобраэовате л . Преобразователь содержит сумматор 1, регистр 2, схему сравнени 3 реверсивный двоично-дес гичный счетчик4, элементы И 5,6,элемент ИЛИ 7, элемент НЕ 8, вход константы 9, вход Сброс 10, информацион ные входы двоичного кода I1, тактовый вход 12, выходы двоично-дес тич ного кода 13 и выходы унитарного ко да 14,15 отрицательных и положитель ных чисел, сумматор 16, группу элементов ИСКЛЮЧАЮЩЕЕ ИЛИ 17. На входе 9 присутствует двоичньй N-разр дный код константы, кото рьй формируетс подачей высокого по тенциала на контакты, соответствующие единичным разр дам константы, а остальные контакты шины заземл ю с . На вход 1I подаетс двоичный п-разр дный код преобразуемого числа . Изменение входного двоичного ко да должно происходить синхронно со срезом либо при паузе тактового сиг нала, присутствующего на входе 12, При подаче на вход 18 логического нул сумматор производит операцию А С в дополнительных кодах. При подаче на вход логической единицы производитс операци А-С в дополнительных кодах. Преобразование кода константы С в отрицательный дополнительный код осуществл етс инвертированием кода элементами 17 при подаче на их второй вход логической единыцы и подачей логической единицы на вход пере носа сумматора. Сумматор 1 и регистр 2, замкнуТы кольцо, представл ют собой накапивающий сумматор, который на кажый стробирующий импульс на входе регистра прибавл ет или отнимает от записанного в регистр 2 двоичного кода А код константы С. Схема сравнени 3 имеет два выхода , при этом высокий потенциал по р л етс на первом выходе при , а на втором - при А В, где А и В двоичные п - разр дные коды, поступающие на ее входы. Схема сравнени может быть выполиена с пороговой зоной и., тогда высокий потенциал по вл етс на первом выходе при -& , а на втором - при . . На фиг. 2 представлена схема элемента сравнени , выполненна на комбинационном сумматоре 19 элементах НЕ 20,21 элементах ИЛИ 22 и 23. Сумматор формирует разность кодор А - В, а по переносу в (п + I) разр д на выходе сумматора определ ет знак неравенст.ва. При переносе равном единице и при условии, что разность не равна нулю, выдаетс сигнал А В, при переносе равном нулю выдаетс сигнал А В. Устройство имеет пороговую зону равную цене младшего разр да поступакнцих кодов и обеспечивает функцию сравнени как дл положительных, так и дл отрица-j тельных чисел, представленных дополнительным кодом. Преобразователь работает следующим образом. В начале преобразовани на вход 10 подаетс сигнал Сброс,который устанавливает в нулевое состо ние регистр 2 и счетчик 4. При наличии на входе 11 положительного входного,двоичного кода В схема сравнени 3 выдает высокий потенциал на первом выходе А В, который разрешает прохождение тактовых импульсов с входа 12 через элемент И 5, а импульсы с выхода элемента И 5 поступают на выход 15, на вход Т. + счетчика 4 и через элемент ИЛИ 7 на вход стробировани записи результата с сумматора 1 в регистр 2, Так как на втором выходе схемы сравнени А В присутствует нулевой сигнал, то к содержимому регистра 2 при поступлении каждого 511 стробирующеГо сигнала будет прибаврт тьс константа С. Процесс преобразовани происходит до тех пор, пока на выходе схемы сравнени не исчезнет сигнал А X В. При этом на выход 15 постуЙ- . пит число импульсов П а в счетчике 4 сформируетс двоичнодес тичный код в угловых единицах, соответствукщйй входному двоичному коду. В регистре 2 при этом будет находитьс двоичный код, равный С. Диаграмма фиг.З по сн ет процесс преобразовани кода. После подачи сигнала Сброс на вход 10 код А в регистре 2 начинает ступенчато возрастать , пока не достигнет величины входного двоичного кода В. При этом на выходе преобразовател (выход 15 по вл ютс импульсы унитарного кода После преобразовани кода преобразователь переходит в следующий режим работы. Если схема сравнени не имеет пороговой зоны, либо порогова зона 4 С- (временные диаграммы фиг.З даны дл преобразовател с использованием схемы сравнени с пороговой зоной Л С), то единичный сигнал будет по вл тьс то на одном, то на другом выходах схем сравнени 3,, разреша поочередное прохождение импульсов в каналы + выход 15 - (выход 14). Если схема сравнени 3 имеет пороговую зону Л С, то посто нстве входного Кода на выходах схемы сравнени будет нулевые сигналы, запрещающие формирование импульсов на выходы. В тех случа х,когда колебани выходного двоично-дес тичного кода в пределах + -1 единица младшего разр да не желательны, следует использовать схему сравнени с пороговой зоной Л 7/С, При изменении входного кода код в счетчике 4 будет отслеживать входной код, преобразованный в заданную систему счислени , а количество импульсов в каналах + и - выходы 14,(1 будет указывать на направление изменени кода и величину изменени , выраженную в угловых единицах. Преобразование отрицательных чисел ,, представленных дополнительным кодом, осуществл етс аналогично лишь с тем отличием, что схема сравнени формирует единичный сигнал на выходе А В и к содержимому регистра 2 прибавл етс константа С со знаком минус. Во врем преобразовани импульсы унитарного кода будут при- сутствовать в канале - выходы 13, а в счетчике 4 будет формироватьс отрицательный код числа В в заданной системе счислени . Например, при преобразовании двоичного кода В, соответствующе го , по каналу - в счетчик 4 поступит 95 импульсов, при этом, если учесть, что начальное положение счетчикабьшо нулевым, а на нем сформируетс код, соответствующий углу 358 25, который вл етс дополнением угла до ЗбО. Преобразователь обеспечивает след щий режим работы при непрерывном переходе входного кода из области положительных чисел в отрицательные и наоборот. Константа С определ етс с , где - максимальное двоичное преобразуемое число; С fTjox число угловых единиц в максимальном преобразуемом числе. Точность задани константы определ етс из услови где ЛС погрещность задани константы . . . . При выполнении услови (1) погрешность преобразовани дл любьгх чисел не будет превьшать дискретности, представлени числа В в требуемой системе счислени . Пример.. Преобразователь 1 -разр дного кода в код градусов, минут. 2 65536 Dmax 360-60 -|f|2 .3,034074 . о.ошш Так как допустимое значение С , то значение константы в двоичном коде может быть выражено двоичным кодом с двенадцатью дробными разр дами, при этом исключаетс набегающа ошибка при преобразо- f вании любых чисел в пределах 711 от +360 а погрешность преобразовани не будет превьппать цены делени в весовых единицах,т.е. 1 угл.мин. Таким образом, точность преобразовани в предлагаемом преобразователе определ етс точностью задани константы С, так же как в известном устройстве может быть достаточно высокой. В предлагаемом преобразователе .достигаетс высокое быстродействие при преобразовании измен ющегос входного двоичного кода. Если скорость изменени входного кода не пр вьшает величины С ---, где Т-перио следовани тактовых импульсов на входе 12, то частота отсчетов выход ного кода может достигать частоты следовани тактового сигнала, т.е. величины -Г-, в то врем как часто та отсчетов кодов на выходе известного преобразовател при изменении .входного кода составит1 Например, дл приведенного выше преобразовател двоичного 16-разр дного кода в код градусов в минуту при тактовом сигнале с периодом Т 10 МКС частота отсчетов по предлагаемой схеме составит 100 кГц, а по известной - 1,525 Гц. Использование известного преобразовател в системе программного управлени резко уменьшает быстродействие. Высокое быстродействие при преобразовании непрерывно мен ющегос двоичного кода вызвано введением элемента сравнени и обратных св зей, управл ющих режимом р1аботы сумматора и регистра и обеспечивающих след щий режим. В устройстве расширено также функциональные возможности за счет формировани импульсов унитарного кода в каналах + и -, что обеспечивает возможность преобразовани двоичного кода в унитарный код с ценой импульса в угловых единицах. Кроме того, предлагаемый преобразователь обеспечивает преобразование как положительных, так и отрицательных чисел представленных двоичным дополнительным кодом.The invention relates to automation and digital computing, can be used in measuring and control systems and is intended to coordinate the program control system with external devices, such as feedback sensors, with stepper drive, display devices, etc., operating in various information representation systems. A known converter of a binary code into a binary-decimal code of degrees and minutes, containing binary and binary-decimal counters, a decoder, a pulse generator, And elements and frequency dividers. This operation is based on pulse recalculation with selection of conversion factors. The disadvantages of the known converter are low speed, complexity, impossibility of converting degrees, fractions, thousand divisions of the goniometer, etc. into a binary-decimal code. In addition, their functional capabilities are limited, since there is no possibility of forming a unitary code with a division price, expressed in angular units. The closest in technical essence to the present invention is a binary code converter into a binary-decimal code of angular units containing a binary counter, a binary-decimal counter, a decoder, two AND elements, an adder, a register, a generator of impulses, the output of which is through the first element And it is connected with the gate input of the register, the first input of the second element I and the input of the binary counter, the output of which through the decoder is connected to the second input of the first element I, the input of the constant setting is connected with the first group in Odom adder, a second group of inputs of which is connected to the output of the register and the adder outputs are connected to inputs of register informatsionnshi drawback of the known transducer is small speed when converting the input variable shtsetos binary code. When the input DJ code is changed by one disk unit, it is necessary to reset the device to its original state and re-convert the number, which takes considerable time. In addition, in the known device there is no possibility of converting a binary code into a unitary one with the impulse price expressed in angular units and forming the impulse code of the input code increment, also expressed in angular units. In the known device, there is no possibility of converting negative numbers presented, for example, in an additional code. All this leads to limited functionality of the invention — an increase in speed and expansion of functionality by providing conversion of both positive and negative numbers, as well as the result of the unitary code. The goal is achieved by converting a binary code to a binary-decimal code of angular units containing a register, a binary-decimal counter, first and second elements AND, an adder, whose outputs are connected to the information inputs of the register, the outputs of which are connected to the first group of inputs of the adder, the output of the first element I is connected to the addition input of a binary unit counter whose reset input is connected to the register reset input and to the reset input of the converter whose outputs are double outputs a decimal counter, the group of elements EXCLUSIVE OR is added, the element is NOT, the elements are OR, the comparison circuit, and the binary-decimal counter is reversible, the input of which is subtracted to the output of the second element AND, the first input of the element OR and is the output of negative numbers unitary code of the converter, the output of the positive numbers of the unitary code of which is connected to the output of the first element AND and the second input of the element OR, the output of which is connected to the synchronous input of the register, the outputs of which are connected to the first The second group of inputs of the comparison circuit, the second group of inputs of which are informational inputs of the converter, the reset input of which is NOT connected to the first inputs of the first and second And elements through the element 31, the second inputs of which are connected to the Less and More outputs of the comparison circuit, respectively, and the third inputs the first and second elements And are connected to the clock input of the converter, the inputs of a constant which are connected to the first inputs of the elements EXCLUSIVE OR groups, the outputs of which are connected to the second group of inputs summation pa, the transfer input of which is connected to the output of the More comparison circuit and with the second inputs of the elements — EXCLUSIVE OR groups. In FIG. 1 shows a functional diagram of the converter; 2 is a block diagram of a comparison circuit; in fig. 3 - timing diagrams, according to the principle of work-conversion l. The converter contains adder 1, register 2, comparison circuit 3 reversible binary-decimal counter 4, elements AND 5.6, element OR 7, element 8, input constant 9, Reset input 10, information inputs of binary code I1, clock input 12 , the outputs of the binary-decimal code 13 and the outputs of the unitary code 14,15 negative and positive numbers, the adder 16, a group of elements EXCLUSIVE OR 17. At the input 9 there is a binary N-bit code of the constant, which is formed by supplying high contact potential corresponding to a single digit nanty, and the remaining contacts of the tire ground e. Input 1I is supplied with a binary n-bit code of the number to be converted. The input binary code change must occur synchronously with the slice or when the clock signal paused at input 12 is paused. When the logic zero is fed to input 18, the adder performs operation A С in additional codes. When a logical unit is fed to the input, A-C operations are performed in additional codes. The conversion of the code of the constant C into a negative additional code is carried out by inverting the code by the elements 17 when the logical unity is fed to their second input and the logical unit is fed to the adder's transfer input. The adder 1 and the register 2, closed the ring, are a accumulating adder, which for each gate pulse at the input of the register adds or subtracts from the binary code A recorded in register 2 of the constant code C. The comparison circuit 3 has two outputs, while the high potential is located on the first output at, and on the second - at AB, where A and B are binary n - bit codes that enter its inputs. A comparison circuit can be polypropylene with a threshold zone and., Then a high potential appears at the first exit at - & , and on the second - with. . FIG. Figure 2 shows the comparison element circuit, performed on the combinational adder 19, the NOT elements 20,21, the elements OR 22 and 23. The adder forms the difference between the coder A - B, and by transferring to (n + I) the bit at the output of the adder determines the inequality sign . When the transfer is equal to one and under the condition that the difference is not equal to zero, the signal A B is output, with the transfer equal to zero, the signal A B is output. The device has a threshold zone equal to the price of the lower order of the entered codes and provides a comparison function for both positive and Denied j-junction numbers represented by an additional code. The Converter operates as follows. At the beginning of the conversion, an Reset signal is applied to input 10, which sets register 2 and counter 4 to zero. If positive input binary code B is present at input 11, comparison circuit 3 generates a high potential at the first output AB, which allows the passage of clock pulses from the input 12 through the element And 5, and the pulses from the output of the element And 5 are fed to the output 15, to the input T. + counter 4 and through the element OR 7 to the input of the gating of the result record from the adder 1 to the register 2, Since the second output of the circuit Compare A In present There is a zero signal, then a constant C will be added to the contents of register 2 as each 511 strobe signal arrives. The conversion process occurs until the signal A X B disappears at the output of the comparison circuit. At the same time, output 15 is steady-state. The num- ber of pulses Pa in counter 4 generates a binary code in angular units, corresponding to the input binary code. In register 2, the binary code will be equal to C. The diagram of FIG. 3 illustrates the code conversion process. After signaling Reset to input 10, code A in register 2 begins to increase stepwise until it reaches the value of input binary code B. At the same time, the output of the converter (output 15 shows pulses of the unitary code. After the code has been converted, the converter enters the next operation mode. If the comparison circuit does not have a threshold zone, or a threshold zone 4 C- (timing diagrams of FIG. 3 are given for the converter using the comparison circuit with a threshold zone L C), then a single signal will appear on one or the other The outputs of the comparison circuits 3, permitting alternate passage of pulses to the channels + output 15 - (output 14). If the comparison circuit 3 has a threshold zone L C, then the input code at the outputs of the comparison circuit will have zero signals that prohibit the formation of pulses at the outputs. In cases where fluctuations of the output binary-decimal code within + -1 units of the least significant bit are not desirable, a comparison circuit with a threshold zone of L 7 / C should be used. When the input code changes, the code in counter 4 will track the input code transformed the number of pulses in channels + and - outputs 14, (1 will indicate the direction of change of the code and the amount of change expressed in angular units. The conversion of negative numbers, represented by an additional code, is carried out in a similar way only with the difference that the comparison circuit forms a single signal at output AB and the constant C with a minus sign is added to the contents of register 2. During the conversion, unitary code pulses will be present in the channel — outputs 13, and counter 4 will generate a negative code for the number B in the specified number system. For example, when converting a binary code B, correspondingly, through a channel, 95 pulses go to counter 4, while taking into account that the initial position of the counter is zero, and a code corresponding to angle 358 25 is formed on it, which is the complement of the angle to ZbO. The converter provides the following mode of operation with a continuous transition of the input code from the region of positive numbers to negative and vice versa. The constant C is defined with, where is the maximum binary convertible number; With fTjox, the number of angular units in the maximum convertible number. The accuracy of the specification of the constant is determined from the condition where the drug is the error of the specification of the constant. . . . When condition (1) is fulfilled, the conversion error for any numbers will not exceed the discreteness representing the number B in the required number system. Example .. Converter 1-bit code to code degrees, minutes. 2 65536 Dmax 360-60 - | f | 2 .3.034074. OK Since the admissible value is C, the value of a constant in binary code can be expressed in binary code with twelve fractional bits, thus excluding the incident error when converting f any numbers within 711 from +360 and the conversion error will not exceed division prices in weight units, i.e. 1 coal min Thus, the accuracy of the conversion in the proposed converter is determined by the accuracy of setting the constant C, as well as in the known device can be quite high. In the proposed converter, a high speed is achieved when converting a variable input binary code. If the rate of change of the input code does not exceed the value of C ---, where T is the period of the clock pulses at input 12, then the sampling frequency of the output code can reach the clock frequency of the clock signal, i.e. -G- values, while the frequency of code samples at the output of a known converter when the input code changes will be 1 For example, for the 16-bit binary code converter above, the code per degrees per minute with a clock signal with a period T of 10 ISS sample frequency under the proposed scheme will be 100 kHz, and the known - 1.525 Hz. The use of a known converter in a software control system drastically reduces speed. The high performance in converting a continuously varying binary code is caused by the introduction of a reference element and feedbacks that control the operation of the adder and register and ensure the tracking mode. The device also extends the functionality by generating pulses of a unitary code in channels + and -, which makes it possible to convert a binary code into a unitary code with the price of a pulse in angular units. In addition, the proposed converter provides conversion of both positive and negative numbers represented by binary additional code.
Фиг. 2FIG. 2