(5) ПРЕОБРАЗОВАТЕЛЬ ДВОИЧНО-ДЕСЯТИЧНОГО Изобретение относитс к автоматике и вычислительной технике и може:т. быть использовано при построении преобразователей кодов в арифметических устройствах. Известно устройство преобразовани дес тичного кода в двоичный, содержащее входной регистр с дешифратором дес тичного кода, элементы И, элементы ИЛИ, запоминающее устройство, сумматор и генератор импульсов 12. Недостаток известного устройства состоит в низком быстродействии при получении дополнительного кода, что св зано с использованием дополнительных блоков преобразовани . Наиболее близким решением к изобретению по технической сущности и достигаемому результату вл етс преобразователь кодов, содержащий входной регистр, группу элементов И, сумматор , сдвиговый регистр, триггер и элемент И, выполн ющий преобразование КОДА- В ДВОИЧНЫЙ путем последовательного суммировани весов групп разр дов входного кода Г2. Недостатком данного преобразовател вл етс ограниченность функциональных возможностей, что св зано с отсутствием возможности получени дополнительного кода. Цель изобретени - расширение функциональных возможностей, заключающихс в обеспечении преобразовани как пр мых так и дополнительного кодов . Поставленна цель достигаетс тем, что в преобразователь двоично-дес тичного кода в двоичный, содержащий входной регистр, группу элементов И, сумматор, сдвиговый регистр, триггер и элемент И, первый вход которого вл етс тактовым.входом преобразовател , второй вход соединен с выходам три.ггера, а выход элемента И соединен с входой сдвигового регистра, выходы которого соединены с первыми входами элементов И группы, вторые входы которых соединены с выходами входного регистра, вход сброса которого соединен с входом сброса преобразовател .и входом сброса сумматора , входом начальной установки сдвигового регистра и нулевым входом триггера, единичный вход которого вл етс входом пуска преобразовател , тактовый вхрд сумматора соединен с выходом элемента И, введены триггер знака, дешифраторы пр мого и дополнительного кодов и группа элементов ИЛИ, первые и вторые входы ко торых соединены с сответствующими вы ходами дешифраторов пр мого и дополнительного кодов, информаци-онные вхо ды которых соединены с выходами элементов И группы, а первый и второй управл ющие входы соединены соответс венно с единичным и нулевым выходами триггера знака, выходы элементов ИЛИ группы соединены с входами сумматора На чертеже приведена блок-схема предлагаемого преобразовател . Преобразователь состоит из входного регистра 1, выходы которого соединены с первыми входами группы элементов И 2, блока 3 управлени , дешифраторов k пр мого и дополнитель ного кодов, группы элементов ИЛИ 5, сумматора 6, триггера 7 знака. . Один из возможных вариантов блока 3 управлени содержит элемент И 8, первый вход которого соединен с тактовым входом 9 преобразовател , а второй - с выходом триггера 10, сдви говый регистр 11. Входы триггера 10 соединены: единичный - с входом 12 пуска преобразовател , а нулевой с входом 13 сброса преобразовател . Выход элемента И 8 соединен с входами синхронизации сдвигового регистра 11 и сумматора 6, Дешифраторы пр мого и дополнительного кодов построены из элементо И, ИЛИ и НЕ и включают в себ деши(|)раторы , преобразующие дес тичный код в пр мой двоичный код дл положительных чисел, или иначе называемые дешифраторами пр мого кода, и дешифраторы , преобразующие дес тичный код в дополнительный, или иначе называемые дешифраторами квазиобратного кода, дл .отрицательных чисел. Преобразователь работает следую-. щим образом. Квазиобратным кодом вл етс синтезированный код отдельных разр дов двоичногдес тичного числа, дающий 9 при суммировании обратный или дополнительный двоичный код. Если используют в преобразователе п двоичных разр дов, то максимально записываемое число Н 2°+2+.. .2. Обозначим: Р - пр мой двоичный код; К - обратный двоичный код; тогда , , где Д - дополнительный двоичный код. пр мой, двоичный L разр дов дес тичнокод каждого из ,К.Н-Р-нЛх,, (Н-Хц) - обратный код каждого из L разр дов дес тичного числа. Если суммируют обратные коды дво- ично-дес тичных разр дов, тО получают следующий результат i, (H-X,)+{H-Xj+... + (H-Xi)LH-5: Х, . LH-P, что превышает значение обратного двоичного кода дес тичного числа на (L-1 )Н, т.е. дл Получени квазиобратного кода уменьшают обратный код каждого из разр дов двоично-дес тичного числа в общейсумме на (L-1 );Н. Причем дл упрощени преобразоват .ел квазиобратный код единиц (X/,) берут равным обратному четырехразр дному коду единиц, что позвол ет получить его простым инвертированием пр мого кода единиц; квазиобратный код разр дов Х(-Хц стро т из тех же кодовых комбинаций, что и пр мой код соответствующих разр дов, вследствие чего Дешифраторы квазиобратного кода по сложности и числу элементов эквивалентны дешифраторам пр мого кода; квазиобратный код разр да Xj, равен Ккьи ,K(j-S, где К - обратный код разр да Хц, .H).H-ri|u, де йК-К- -КквЙ -Ки . ; 4i азница между обратным и квазиобратТо есть Ккй, K,-(L-1 )-Н+ ым кодами рдК;, И-15 как исользуютс всего Ц разр да К,2. Аес. 90) 90 - мах.записыаемое число ё дес тках; Кз дКерт(н-900)н-9-10 ; К- Н-9--10 KL,.,H-9-10--i; . е. лК Т5+9-10%,,..,+910-Ч эта ормула справедлива дл , дл Ки 15+910 дл .(5) BINARY DECIMAL CONVERTER The invention relates to automation and computing technology and can: t. be used in the construction of code converters in arithmetic devices. A device for converting a decimal code to a binary one, containing an input register with a decrypter of a decimal code, AND elements, OR elements, a memory device, an adder and a pulse generator 12, is known. A disadvantage of the known device is the low speed in obtaining an additional code, which is associated with additional conversion blocks. The closest solution to the invention in terms of technical essence and the achieved result is a code converter containing an input register, a group of elements AND, an adder, a shift register, a trigger and an element AND performing the conversion of a CODE-TO BINARY by successively summing the weights of groups of bits of the input code R2. The disadvantage of this converter is limited functionality, which is due to the inability to obtain additional code. The purpose of the invention is to enhance the functionality involved in providing conversion of both direct and additional codes. The goal is achieved by converting a binary-decimal code into a binary one, containing an input register, a group of elements And, an adder, a shift register, a trigger and an element And, whose first input is a clock. The input of the converter, the second input is connected to the outputs three .ggera, and the output of the element And is connected to the input of the shift register, the outputs of which are connected to the first inputs of elements And groups, the second inputs of which are connected to the outputs of the input register, the reset input of which is connected to the reset input of the converter and the reset input of the adder, the input of the initial setup of the shift register and the zero input of the trigger, the single input of which is the input of the converter start, the clock input of the adder is connected to the output of the AND element, the trigger of the sign, the decoders of the direct and additional codes, and the group of OR elements are entered and the second inputs of which are connected to the corresponding outputs of the decoder direct and additional codes, informational inputs of which are connected to the outputs of the elements of the AND group, and the first and second control inputs are ineny sootvets venno with unit and zero outputs sign latch, the outputs of elements or groups are connected to adder inputs of the drawing is a block diagram of the transducer. The converter consists of an input register 1, the outputs of which are connected to the first inputs of the group of elements AND 2, the control unit 3, the decoder k direct and additional codes, the group of elements OR 5, the adder 6, the trigger 7 characters. . One of the possible variants of the control unit 3 contains an element 8, the first input of which is connected to the clock input 9 of the converter, and the second - to the output of the trigger 10, shift register 11. The inputs of the trigger 10 are connected: single - to the 12 start of the converter, and zero with input 13 reset the converter. The output of the AND 8 element is connected to the synchronization inputs of the shift register 11 and the adder 6, the direct and additional code decoders are built from AND, OR, and NOT elements and include deshi (|) ratios that convert the decimal code into a direct binary code for positive numbers, or otherwise called direct code decoders, and decoders that convert a decimal code into additional code, or otherwise called quasi-inverse code decoders, for negative numbers. The converter works as follows. shimm way. The quasi-inverse code is a synthesized code of individual bits of a binary number, giving 9 when summing the reverse or additional binary code. If n binary bits are used in the converter, then the maximum recorded number is H 2 ° + 2 + .. .2. Denote: P - direct my binary code; K - reverse binary code; then, where D is an additional binary code. right, binary L bits of the decimal code of each of, K.N-R-nLh ,, (Н-Хц) is the reverse code of each of the L bits of the decimal number. If the return codes of binary-decimal digits are summed up, then the following result is obtained: i, (H-X,) + {H-Xj + ... + (H-Xi) LH-5: X,. LH-P, which exceeds the value of the inverse binary code of a decimal number by (L-1) H, i.e. to obtain a quasi-inverse code, reduce the inverse code of each of the bits of the binary-decimal number in total (L-1); H. Moreover, to simplify the conversion, the quasi-inverse code of the units (X /,) is taken to be equal to the inverse four-digit code of the units, which makes it possible to obtain it by simply inverting the forward code of the units; the quasi-inverse code of bits X (-Hz is constructed from the same code combinations as the direct code of the corresponding bits, as a result of which the decoders of the quasi-inverse code are equivalent in complexity and number of elements to the decoders of the direct code; the quasi-inverse code of discharge Xj is equal to Kc, K (jS, where K is the inverse code of the Hz bit, .H) .H-ri | u, de yK-K-KQY-Ky.; 4i difference between the inverse and quasi-turnTo is Kc, K, - (L-1 ) -N + rdK codes ;, I-15 as the whole C of the digit K is used, 2. Aes 90) 90 is a max. Record number of e decade; Кз дКерт (n-900) н-9-10; K-H-9--10 KL,., H-9-10 - i; . e. lK T5 + 9-10% ,, .., + 910-H this formula is valid for, for Ci 15 + 910 for.
5.925.92
В данном случае S определено дл получени обратного двоичного кода дес тичного числа.In this case, S is defined to obtain the inverse binary code of a decimal number.