Claims (2)
15 триггера каждого разр да соединен с первыми входами соответствующего, первого дополнительного элемента И и элемента ИЛИ, выход которого сое„ динен с информационным входом триггера последующего разр да, информационный вход триггера старшего разр да соединен с вторым входом элемента ИЛИ данного разр да и с входом сигнала логического нул устройства, выход элемента ИЛИ младшего разр да вл етс выходом регистра и соединен с первым входом элемента И, второй вход которого соединен с вторыми входами дополнительных элементов И и с синхронизирующим входом устройст ва, выход элемента И соединен со счетным входом триггера, выход которого вл етс выходом устройства, а выходы дополнительных элементов И соединены с синхронизирующими входами триггеров соответствующих разр дов 33Недостатком известного устройства вл етс его низкое быстродействие. Хот количество сдвигающих импульсов равно количеству логических единиц провер емого кода, при большом числе этих единиц дл проверки кода на четность требуетс значительное врем . Цель изобретени - повышение быст родействи устройства Поставленна цель достигаетс тем что в устройство дл формировани контрольного кода по четности, содер жащее элемент И, триггер четности, регистр сдвига, каждый разр д которо го содержит триггер, первый элемент ,.п1. элемент ИЛИ, причем синхронизирующий вход устройства соединен с первыми входами первых элементов И всех разр дов и с первым входом элемента И, выход которого соединен со счетным входом триггера четности, выход триг гера четности вл етс выходом устройства , выход первого элемента И каждого разр да соединен с синхронизирующим входом триггера соответствующего разр да, информационные входы регистра сдвига образуют группу входов устройства и соединены с единичными входами триггеров соответствующих разр дов, установочный вход регистра соединен с установочным вхо дом триггера старшего разр да регист ра и с первым входом элемента ИЛИ этого же разр да, выход элемента ИЛИ каждого разр да соединен с установоч ным входом триггера последующего раз р да регистра и с первым входом соответствующего элемента ИЛИ, выход элемента ИЛИ младшего разр да соединен с вторым входом элемента И, в каждый разр д регистра введен второй элемент И, а в каждый ()-ый разр д (где ,l,2...) введены дополни тельный элемент И и дополнительный элемент ИЛИ, причем единичный выход триггера каждого разр да соединен с первым входом второго элемента И, соответствующего разр да, первый вход второго элемента И каждого из ( 1+Зk)-ыx разр дов регистра соединен с первым входом дополнительного элемента И, выход которого соединен с первым входом дополнительного элемента ИЛИ, выход второго элемента И каждого из (l+3k)-bix разр дов регистра соединен с вторым входом дополнительного элемента ИЛИ, выход которого соединен с вторыми входами элемента ИЛИ и первого элемента И (l+3k) разр дов, единичные выходы триггеров разр дов (2+3k) и (3+3k) соединены соответственно с вторым и третьим входами дополнительного элемента И ( l+3k)-ro разр да, нулевые выходы триггеров (2+3k)-ro и 3+3k)-ro разр дов соединены соответственно со вторым и третьим входами второго элемента И (1+3k)-ro разр да, нуле выходы триггеров (1+3k)-ro ( 3+3) -го разр дов соединены соответственно с вторым и третьим входами второго элемента И (2+3k)-ro разр да, выход которого соединен со вторыми входами первого элемента И и элемен д соответствующего разр да. левые выходы триггеров (l+3k)-ro и {2+3k)-ro разр дов соединены соответственно с вторым и третьим входами второго элемента И (3+3k)-ro разр да , выход которого соединен с вторыми входами первого элемента И и элемента ИЛИ. На чертеже представлена схема устройства дл проверки трехразр дного параллельного двоичного кода на четность . Устройство содержит регистр 1 сдвига , состо щий из триггеров 2-k, элементов ИЛИ 5-7, первых элементов И 8-10, вторых элементов И 11-13, дополнительного элемента И 1 i и дополнительного элемента ИЛИ 15, элемент И 16, триггер 17 четности со счетным входом, установочный вход 18 регистра 1 и синхронизирующий вход 19 устройства. Разр д l4-3k регистра (при k О равный t) содержит триггер 2, элемент ИЛИ 5 первый элемент И 8, второй элемент И 11, дополнительный элемент И 14, дополнительный элемент ИЛИ 15, причем единичный выход триггера 2 соединен с первым входом второго элемента И 11, выход которого соединен с вторым входом дополнитель ного элемента ИЛИ 15, выход которого соединен с вторым входом элемента ИЛИ 5. Установочный вход триггера 2 соединен с первым входом элемента ИЛИ 5 и с установочным входом 18 регистра 1. Выход первого элемента И 8 соединен с синхронизирующим входом тригге ра 2 , а первый и второй входы - соответственно с синхронизирующим входом 19 устройства и с выходом дополнительного элемента ИЛИ 15 и вторым входом элемента ИЛИ 5. Первый вход дополнительного элемента ИЛИ 15 соединен с выходом дополнительного элемента И I. Разр д 2+3k регистра (при k О второй разр д) содержит триггер 3, элемент ИЛИ 6, первый 9 и второй 12 элементы И. Разр д 3+3k регистра (при k О третий разр д) содержит триггер , элемент ИЛИ 7, первый 10 и второй 13 элементы И. Одноименные элементы разр дов 2+3k и 3+3k соединены аналогично раз р ду 1+3k за исключением того, что первые входы первых элементов И 9 и 10 соединены с выходами соответственно вторых элементов И 12 и 13 и с первыми входами соответственно элементов ИЛИ 6 и 7. Нулевой выход триггера 2 соединен с вторыми входами вторых элементов И 12 и 13, нулевой выход триггера 3 с вторым входом второго элемента И 13, а нулевой выход триггера с третьими входами вторых элементов И 11 и 12. Первый, второй и третий входы дополнительного элемента И соединены соответственно с единичными выходами триггеров 2-А. Выход элемента ИЛИ 5 соединен с информационным входом триггера 3, выход элемента ИЛИ 6 - с информационным входом триггера , а выход элемента ИЛИ 7 - с вторым входом элемента И 16 первыйовход и выход которого соединены соответственно с синхронизирующим входом 19 устройства и со счетным входом триггера 17 четности. Вход установки всех триггеров в нулевое состо ние на чертеже не показан . Устройство работает следующим образом . б ИСХОДНОМ состо нии все триггеры установлены в нулевое состо ние их единичных выходов. На выходах вторых элементов И 11-13 также устанавливаютс потенциалы нул ,-и синхроимпульсы от входа 19 не проход т через первые элементы И 8-10 на синхронизирующие входы триггеров 2-. Рассмотрим проверку на четность трехразр дного кода с одной логической 1 и двум логическими О, например 100. Поступа на единичные входы триггеров , которые вл ютт с информационными входами устройства , провер емый код устанавливает триггер 2 в положение логической 1, а триггеры 3 и в положение логического О. На входы элемента И 11 поступают три логические 1 (от единичного выхода триггера 2 и нулевых выходов триггеров 3 и ). С выхода элемента И 11 логическа 1 через дополнительный элемент ИЛИ 15 поступает на входы элемента ИЛИ 5 и элемента И 8, подготавлива последний дл прохождени через него синхронизирующих импульсов от входа 19 на синхронизирующий вход триггера 2. На входы элемента И 12 поступают логические О от единичного выхода триггера 3 и нулевого выхода триггера 2 и логическа 1 от нулевого выхода триггера k. Логический О с выхода элемента И 12 поступает на вход элемента И 9 и запрещает прохождение через него синхронизирующих импульсов. Состо ние элемента И 13 аналогично состо нию элемента И Т2, и элемент И 10 блокирован дл прохождени через него синхронизирующих импульсов . Логическа 1 с выхода элемента ИЛИ 5 через элементы ИЛИ 6 и 7 поступает на вход элемента И 16 и подготавливает его дл прохождени через него синхронизирующих импульсов. С приходом первого синхроимпульса происходит запись логического О в триггер 2 и запись логической 1 в триггер 17 четности. Логический О с единичного выхода триггера 2 поступает на вход элемента И 11 и с его выхода через элемент ИЛИ 15 блокирует элемент И 8 дл прохождени синхроимпульсов. Триггер 17 четности находитс в осто нии нечетности провер емого кода. Рассмотрим проверку на четность трехразр дного кода с двум логическими 1 и одним логическим О, например 011. Поступа на единичные входы триггеров 2-4, провер емый код устанавливает триггер 2 в положение логического О а триггеры 3 и в положение логической 1. Логический О с единичного выхода триггера 2 через элементы И 11 и ИЛИ 15 поступает на входы элемент ИЛИ 5 и элемента И 8 и блокирует последний дл прохождени через него синхроимпульсов на вход триггера 2. На вход элемента И 12 поступают логические 1 от единичного выхода триггера 3 и нулевого выхода триггера 2 и логический О отнулевого выхода триггера k. Логический О с выхода элемента И 12 блокирует эле мент И 9 дл прохождени через него синхроимпульсов на вход триггера 3. Состо ние элемента И 13 аналогично состо нию элемента И-12, и элемент И 10 блокирован дл прохождени через него синхроимпульсов. Таким образом, на выходах всех элементов ИЛИ установлены логические О и вход элемента И 16 блокирован дл прохождени синхроимпуль сов через него на счетный вход триггера 17 четности. Триггер 17 четности находитс в состо нии четности провер емого кода Рассмотрим проверку на четность трехразр дного кода с трем логическими 1 (111). Поступа на единичны входы триггеров 2-4, провер емый код устанавливает их в положение логичес кой 1. На каждый из элементов И 11-13 приходит логическа 1 от единичног выхода триггера своего разр да и логические О от триггеров двух других разр дов. Логические О с выходов элементов И 12 и 13 поступают на входы элементов И 9 и 10 и блокируют их дл прохождени через них синхроимпульсов на входы триггеров 3 и 4. Логические 1 с единичных выходов триггеров 2-4 поступают на входы элемента И 14 и через элемент ИЛИ 15 на вход элемента И 8, подготавлива его дл прохождени через него синхроимпульсов на вход триггера 2, и на вход элемента ИЛИ 5, с выхода которого поступают через элементы ИЛИ 6 и 7 на вход элемента И 16, под 8 готавлива его дли прохождени через него синхроимпульсов на счетный ВХОДтриггера 17 четности. С приходом первого синхроимпульса происходит запись логического О в триггер 2 и логической 1 в триггер 17 четности. При этом логический О с единичного выхода триггера 2 блокирует элемент И 14 и, проход через элемент ИЛИ 15, блокирует элемент И 8 дл прохождени через него синхроимпульсов на вход триггера 15 flip-flops of each bit are connected to the first inputs of the corresponding, first additional AND element and the OR element, whose output is connected to the information input of the subsequent bit trigger, the information input of the high-level trigger is connected to the second input of the OR element of this bit and to the input the signal of the logical zero of the device, the output of the element OR the lower bit is the output of the register and is connected to the first input of the element AND The clock input of the device, the output of the AND element is connected to the counting input of the trigger, the output of which is the output of the device, and the outputs of the additional elements AND are connected to the synchronization inputs of the trigger elements of the corresponding bits 33. The disadvantage of the known device is its low speed. Although the number of shifting pulses is equal to the number of logical units of the code being tested, with a large number of these units a considerable time is required for checking the parity code. The purpose of the invention is to increase the speed of the device. The goal is achieved by the fact that the device for generating a parity check code containing AND, parity trigger, shift register, each bit of which contains a trigger, the first element, .1. the OR element, the synchronization input of the device is connected to the first inputs of the first AND elements of all bits and to the first input of the AND element whose output is connected to the counting input of the parity trigger, the output of the parity trigger is the device output, the output of the first AND element of each bit is connected with the synchronization input of the trigger of the corresponding bit, the information inputs of the shift register form a group of device inputs and are connected to the single inputs of the triggers of the corresponding bits, the setup input regis It is connected to the setup input of the trigger of the highest bit of the register and with the first input of the OR element of the same bit, the output of the OR element of each bit is connected to the installation input of the trigger of the subsequent bit of the register and with the first input of the corresponding element OR, the output of the element OR the least significant bit is connected to the second input of the AND element, the second AND element is entered into each register bit, and the additional AND element and the additional OR element are entered into each () th digit (where, l, 2 ...) moreover, a single trigger output of each bit connected to the first input of the second element AND corresponding to the bit; the first input of the second element AND of each of the (1 + 3k) -x register bits is connected to the first input of the additional element AND whose output is connected to the first input of the additional element OR, the output of the second element And each of the (l + 3k) -bix register bits is connected to the second input of an additional OR element, the output of which is connected to the second inputs of the OR element and the first element AND (l + 3k) bits, the single outputs of the trigger bits (2 + 3k ) and (3 + 3k) are connected respectively. with the second and third inputs of the additional element And (l + 3k) -ro bit, zero outputs of the trigger (2 + 3k) -ro and 3 + 3k) -ro bits are connected respectively with the second and third inputs of the second element And (1+ 3k) -ro bit, zero triggers (1 + 3k) -ro (3 + 3) th bits are connected respectively to the second and third inputs of the second element And (2 + 3k) -ro bit, the output of which is connected to the second inputs of the first element AND and the element of the corresponding bit. the left outputs of the flip-flops (l + 3k) -ro and {2 + 3k) -ro bits are connected respectively to the second and third inputs of the second element And (3 + 3k) -ro discharge, the output of which is connected to the second inputs of the first element And And element OR. The drawing shows a diagram of a device for checking a three-bit parallel binary parity code. The device contains a shift register 1 consisting of triggers 2-k, elements OR 5-7, first elements AND 8-10, second elements AND 11-13, additional element AND 1 i and additional element OR 15, element AND 16, trigger 17 parity with the counting input, the setup input 18 of the register 1 and the clock input 19 of the device. Bit l4-3k register (when k O is equal to t) contains a trigger 2, the element OR 5 the first element And 8, the second element And 11, an additional element And 14, an additional element OR 15, and the single output of the trigger 2 is connected to the first input of the second element 11, the output of which is connected to the second input of the additional element OR 15, the output of which is connected to the second input of the element OR 5. The installation input of the trigger 2 is connected to the first input of the element OR 5 and to the installation input 18 of the register 1. The output of the first element AND 8 connected to the sync input tr 2, and the first and second inputs, respectively, with the synchronization input 19 of the device and with the output of the additional element OR 15 and the second input of the element OR 5. The first input of the additional element OR 15 is connected to the output of the additional element AND I. Discharge 2 + 3k register (for k o the second bit) contains trigger 3, the element OR 6, the first 9 and the second 12 elements I. bit 3 3k of the register (for k o the third bit) contains a trigger, the element OR 7, the first 10 and the second 13 elements I. Like elements of bits 2 + 3k and 3 + 3k are connected in a similar way as p 1 + 3k for the claim The fact that the first inputs of the first elements AND 9 and 10 are connected to the outputs of the second elements 12 and 13, respectively, and the first inputs of the elements OR 6 and 7, respectively. The zero output of the trigger 2 is connected to the second inputs of the second elements 12 and 13, zero output trigger 3 with the second input of the second element And 13, and zero output of the trigger with the third inputs of the second elements And 11 and 12. The first, second and third inputs of the additional element And are connected respectively to the single outputs of the flip-flops 2-A. The output of the element OR 5 is connected to the information input of the trigger 3, the output of the element OR 6 is connected to the information input of the trigger, and the output of the element OR 7 is connected to the second input of the element AND 16, the first input and output of which are connected respectively to the synchronizing input 19 of the device and the counting input of the trigger 17 parity. The installation input of all triggers in the zero state is not shown in the drawing. The device works as follows. In the INITIAL state, all the triggers are set to the zero state of their single outputs. The outputs of the second elements And 11-13 also set the potentials to zero, and the clock pulses from the input 19 do not pass through the first elements And 8-10 to the clock inputs of the flip-flops 2-. Consider the parity check of a three-bit code with one logical 1 and two logical O, for example 100. The inputs to the single inputs of the triggers that are with the information inputs of the device, the checked code sets trigger 2 to the position logical 1, and triggers 3 to logical O. At the inputs of the element 11, there are three logical 1 (from the single output of trigger 2 and zero outputs of the trigger 3 and). From the output of the element 11 and logical 1 through an additional element OR 15 enters the inputs of the element OR 5 and element AND 8, preparing the latter for passing synchronizing pulses from it from input 19 to the synchronizing input of trigger 2. At the inputs of the element 12, logical O comes from trigger output 3 and zero output of trigger 2 and logical 1 from zero output of trigger k. Logical O from the output of the element And 12 enters the input of the element And 9 and prohibits the passage of synchronizing pulses through it. The state of the element And 13 is similar to the state of the element And T2, and the element And 10 is blocked for the passage of synchronizing pulses through it. Logical 1 from the output of the element OR 5 through the elements OR 6 and 7 enters the input of the element AND 16 and prepares it for the passage of synchronizing pulses through it. With the arrival of the first clock pulse, the logical O is written to trigger 2 and the logical 1 is written to parity trigger 17. Logic O from the unit output of the trigger 2 enters the input of the AND 11 element and from its output through the OR 15 element blocks the AND 8 element for passing the clock pulses. The parity trigger 17 is located in the odd parity of the code being checked. Consider a parity check of a three-bit code with two logical 1 and one logical O, for example, 011. The inputs to the single inputs of the flip-flops 2-4, the checked code sets the flip-flop 2 to the logical O position and triggers 3 and to the logical 1 position. a single output of trigger 2 through the elements AND 11 and OR 15 enters the inputs of the element OR 5 and the element AND 8 and blocks the latter to pass through the clock pulses to the input of the trigger 2. The input of the element 12 receives logical 1 from the single output of trigger 3 and zero you the trigger 2 and the logical O of the yellow output of the trigger k. Logical O from the output of the element And 12 blocks the element And 9 to pass through it the clock pulses to the input of the trigger 3. The state of the element And 13 is similar to the state of the element I-12, and the element And 10 is blocked to pass through it the clock. Thus, at the outputs of all the OR elements, logical O is set and the input of the AND 16 element is blocked for passing sync pulses through it to the counting input of the parity trigger 17. The parity trigger 17 is in the parity state of the code being checked. Consider the parity check of a three-bit code with three logical 1 (111). The inputs to the single inputs of the flip-flops 2-4, the code being checked sets them to the logical 1 position. Each of the elements I 11-13 receives a logical 1 from the single output of the trigger of its own discharge and the logical O from the triggers of the other two bits. Logic O from the outputs of the elements And 12 and 13 arrive at the inputs of the elements And 9 and 10 and block them for passing the clock pulses through them to the inputs of the flip-flops 3 and 4. Logical 1 from the single outputs of the flip-flops 2-4 arrive at the inputs of the And 14 element and through the element OR 15 to the input element AND 8, preparing it to pass through it the clock pulses to the input of the trigger 2, and to the input of the element OR 5, from the output of which goes through the elements OR 6 and 7 to the input of the element AND 16, under 8 preparing it for passing through it sync pulses on the counting INKTtrigger 1 7 parity. With the arrival of the first clock pulse, the logical O is written into trigger 2 and the logical 1 into parity trigger 17. In this case, a logical O from a single output of trigger 2 blocks the element AND 14 and, passing through the element OR 15, blocks the element AND 8 to pass through it the clock pulses to the input of the trigger
2. Триггер 17 четности находитс в состо нии нечетности провер емого кода. Таким образом, максимальное количество тактов синхроимпульсов, необходимое дл проверки трехразр дно параллельного кода на четность. равно 1. В прототипе дл этого требуетс три такта. Дл проверки п-разр дных кодов на четность необходимо последовательно соединить п/3 (с округлением до целого числа в большую сторону) трехразр дных регистров, приведенных на чертеже . Максимальное количество тактов дл проверки п-разр дного кода на четность при этом составит п/3, в отличие от прототипа, который потребл ет п тактов. Формула изобретени Устройство дл формировани контрольного кода по четности, содержащее элемент И, триггер четности, регистр сдвига, каждый разр д которого содержит триггер, первый элемент И, элемент ИЛИ, г1ричем синхронизирующий вход устройства соединен с первыми входами первых элементов И всех Зазр дов и С первым входом элемента И, выход которого соединен со счетным входом триггера четности, выход триггера четности вл етс выходом устройства , выход первого элемента И каждого разр да соединен с синхронизирующим входом триггера соответствующего разр да, информационные входы регистра сдвига образуют группу входов устройства и соединены с единичными входами триггеров соответствующих разр дов, установочный вход регистра соединен с установочным входом триггера старшего разр да регистра и с первым входом элемента ИЛИ2. The parity trigger 17 is in the odd state of the code being checked. Thus, the maximum number of clock pulses needed to check a three-bit parallel parity code. equal to 1. In the prototype, this requires three clocks. To check the n-bit parity codes, it is necessary to sequentially connect n / 3 (rounded up to a whole number in a larger direction) of the three-bit registers shown in the drawing. The maximum number of clocks to check the n-bit parity code will be n / 3, in contrast to the prototype, which consumes p clocks. Claims An apparatus for generating a parity check code containing an AND element, a parity trigger, a shift register, each bit of which contains a trigger, the first AND element, an OR element, synchronously connecting the device to the first inputs of the first AND elements of all And the first input of the element AND whose output is connected to the counting input of the parity trigger, the output of the parity trigger is the output of the device, the output of the first element AND of each bit is connected to the clock input of the trigger the corresponding bits, the information inputs of the shift register form a group of device inputs and are connected to the single inputs of flip-flops of the corresponding bits, the installation input of the register is connected to the installation input of the high-order trigger and OR