Electronic circuit for generating error detection codes for digital signals

Abstract: An electronic circuit for generating error detection codes in digital signals organized into serial data blocks, which derives the error code from the coefficients of a remainder polynomial obtained from the division between a dividend polynomial, whose coefficients are the bits of each serial block, and a convenient divisor polynomial. The circuit consists of a shift register wherein at the beginning of each serial data block the reset and the first datum load are performed in a single clock interval.

Description: The present invention refers to the systems for data signal transmission and to the devices for evaluating the good functioning of the apparatus processing said signals and more particularly it concerns an electronic circuit for generating error detection codes for errors in digital signals. When the transmission system quality is to be evaluated, it is usual to associate with a certain block of digital signals to be transmitted a digital code obtained by duly processing the signals themselves, and to check whether this code is equal to the code obtained from the block of the received digital signals, processed in the same way as at the transmission. When, however, the correct functioning of an apparatus or a circuit is to be evaluated, a circuit is added for extracting some digital signals from suitable points of the item to be tested and a digital code is computed which is compared with a known code. The comparison result allows the good functioning or malfunctioning of the item under test to be checked. A particular kind of said codes, referred to as cyclic redundancy codes or CRC, is obtained as follows. Each block of N digital signals, each of them being associated with a code, is considered as a polynomial of degree N, whose coefficients are the bits of the block itself. This polynomial is divided by a divisor polynomial, having a suitable degree and suitable coefficient values, and the coefficients of the division remainder polynomial, of degree lower by a unity than that of the divisor, form the cyclic redundancy code or CRC. The higher the remainder polynomial degree, the more accurate the check performed on the data to be tested. Of course, also the complexity of the circuits which perform the division between the polynomials is higher. The polynomial division, effected by modulus-2 subtractions or additions, i.e. without carry or borrow, generally requires rather complex electronic circuits. However, by exploiting the fact that the data are generally organized into serial blocks and the divisor polynomial is constant and predetermined, the division circuit can be considerably simplified. A few examples of division circuits, used for generating cyclic codes for error detection, are described in the paper entitled "Cyclic Codes for Error Detection", by W.W. Peterson and D.T.Brown, issued on Proceedings of the IRE, January 1961. They basically consist of a shift register, with a number of stages lower by a unity than the degree of the divisor polynomial, and of modulus-2 adders placed in between the register stages, corresponding to the divisor polynomial terms with coefficients different from zero. Each adder adds the bit coming from the preceding stage of the shift register to the bit entering the division circuit at that instant. The adders are implemented by exclusive-OR gates. As it is easy to understand, the division operation is performed by successive shift operations, corresponding to the multiplication of the divisor by the single terms of the quotient, and by modulo-2 additions, corresponding to the successive subtractions of the products obtained from the updated dividend. Another example of division circuit, wherein the divisor polynomial can be chosen time by time, is described in the paper entitled "Self-Testing by polynomial division" by D.K.Bhavsar and R.W. Heckelman, presented at the International Test Conference, Philadelphia, October 1981. In this circuit, used for checking the o functioning of complex circuits, there are adders at each shift register stage and the signal outgoing from the division circuit is brought to each adder only if the relevant coefficient of the divisor polynomial is different from zero. This higher flexibility of course entails higher circuit complexity. Moreover, both the solutions examined require a previous operation of reset of the shift register contents whenever the cyclic redundancy code is calculated for a data block, operating in the time interval comprised between the last datum of a block and the first datum of the subsequent block. This operation, in case it is to be performed on the serial flow of data with the relevant clock signals, requires the generation of a reset signal with active phase placed between two successive edges of the clock signal. It is clear that the generation of such a signal requires rather complex circuits and can cause mulfunctionings, especially if the active phase above is not synchronous with the clock signal. EP-A-0 225 761 discloses presetting of an apparatus calculating cyclical redundancy codes during the first clock cycle of the code calculation. Herein, the presetting to all logic l's is carried out by a logic circuit consisting of OR gates or of multiplexers placed between calculating registers and feedback network. The circuit constitutes an additional component causing extended expenses and a lower speed, as some propagation delay occurs due to these additional logics interposed between the registers. Said disadvantages are overcome by the electronic circuit for generating error detection codes for digital signals, provided by the present invention, which is simply feasible, allows reset operation to be performed at the same time as the load of the first bit of each data block, using a reset signal extracted from the present clock signals, and is easy to integrate. The present invention provides an electronic circuit for generating an error detection code for errors in digital signals, organized in data blocks forming the coefficients of a dividend polynomial, to be divided by a suitable divisor polynomial of (n)th degree to obtain a remainder polynomial of (n-1)th degree, whose coefficients form the error detection code, the circuit consisting of a shift register composed of n flip-flops wherein the signal outgoing from the (i-1)th flip-flop, i being comprised between 0 and n, is sent to a first input of (i)th flip-flop directly or through a modulo-2 adder, according to whether the coefficient of the term of (i)th degree of the divisor polynomial is equal to or different from zero, said adder adding to the signal outgoing from the preceding flip-flop a feedback signal obtained at the output of the (n)th flip-flop which is the MSB flip-flop, either directly, or after adding it to the input data signal in a modulo-2 adder which for providing the feedback signal receives as inputs the MSB of the remainder and said input data signal, the feedback signal being supplied to the (i-1)th flip -flop and to the other modulo-2 adder, and all the flip-flops being clocked by a common clock signal, characterized in that a second input of the (i)th flip-flop accepts the first bit of said data block or a bit at low logic value, according to whether the coefficient of the term of (i)th degree of the divisor polynomial be respectively different from or equal to zero, in correspondence with the clock signal transition relevant to the first bit of the data block, whilst at the subsequent transitions the (i)th flip-flop accepts the signals present at the first input, the first or second inputs being enabled according to the logic level of a signal active in correspondence with the first bit of a data block. The foregoing and other characteristics of the present invention will be made clearer by the following description of a preferred way of embodiment thereof, given by way of a non-limiting exampte, and by the annexed drawing, wherein: Fig.1 is a block diagram of the electronic circuit for generating error detection codes for digital signals; Fig.2 is a representation of a few waveforms present at the main circuit points. The exemple of circuit shown in Fig.1 is apt to generate a cyclic rendundancy code obtained from the division of data blocks, present at the input on wire D, by a convenient divisor polynomial of x 4 +x+1 type. The division remainder, coincident with the wished code, is made available at the output on wires R1,R2, R3 and R4, with the least significant bit on wire R1. The circuit consists of a shift register, implemented with 4 flip-flops FF1, FF2, FF3, FF4, whose number is equal to the degree of wished remainder polynomial, and by two modulus-2 adders EO1 and EO2, implemented by exclusive-OR gates. The adder EO1 is placed between the first and the second stage of the shift register, while adder EO2 is placed at the output, so as to implement respectively the feedback relevant to the term of the first degree x of the divisor polynomial and the feedback relevant to the term of the fourth degree x 4 . More particularly, EO2 adds the signal outgoing from flip-flop FF4 which supplies the most significant bit (MSB) on wire R4, and the data signal present on input wire D, supplying at the output on wire 10 the feedback signal, while EO1 adds the signal outgouing from flip-flop FF1 and the feedback signal supplied by EO2, supplying at the output on wire 11 the signal for a first input of flip-flop FF2. The feedback signal on wire 10 is also brought to a first FF1 input, so as to implement the reaction relevant to the constant term of the divisor polynomial. Finally the signal at FF2 output is directly brought to a first FF3 input connected to wire R2 and the signal at FF3 output is directly brought to a first FF4 input connected to wire R3. The data signal present on wire D is also brought to a second input of FF1 and to a second input of FF2, while a second input of FF3 and a second input of FF4 are set at low logic level, in function of the values of the coefficients of the divisor polynomial. All the clock inputs of the four flip-flops are connected to wire C, on which a clock signal associated with the input data arrives. The leading edge of the clock signal causes the signals at the inputs of flip-flops FF1,..,FF4 to be loaded. More particularly, according to the logic level of the signal present on wire L, connected to all the flip-flops FF1,..,FF4, either the signals present at the first inputs or those present at the second inputs are accepted. The signal present on wire L is generated by a logic circuit, apt to carry out the derivative, which consists of two flip-flopsFF5, FF6 and of two gates NO and AN, starting from a synchronism signal indicating the beginning of each block of data, present on wire S. Gate NO inverts the clock signal present on wire C and sends it to the clock inputs of flip-flops FF5 and FF6. FF5 receives at the data input the synchronism signal present on wire S and supplies FF6 data input with the signal present at its true output. The AND gate AN receives both the signal at the true output of FF5 and the signal at the complementary output of FF6, and supplies at the output on wire L the 5 signal which will be used by the flip-flops FF1, FF2 to load the input datum on wire D and by flip-flops FF3, FF4 to load the low logic level at the beginning of each data block. Let us see now the circuit operation with the help of the time diagram of Fig.2, wherein there are the waveforms of a number of signals present at the main circuit points. They are denoted by the same references as those denoting in the preceding Figure the corresponding wires. As previously stated, flip-flops FF1,..,FF4 are activated by the leading edges of the clock signal C, which arrive in the time slots in which data D are stable, while in correspondence with the trailing edges of clock signal C data D can change. The same trailing edges, thanks to the presence of the inverting gate NO, activate flip-flops FF5, FF6 of the circuit generating signal L. Generally synchronism signal S is at low logic level, that is why the signal at the FF5 true output is at low logic level and the signal at FF6 complementary output is at high level, hence signal L, supplied by gate AN, is at low level. When the synchronism signal S passes to high level, indicating the beginning of a data group, at the first trailing edge of the clock signal C also the signal at the true output of FF5 passes to high level, that is why at the inputs of gate AN there are two high level signals, which raise signal L to high level. At the subsequent trailing edge of clock signal C, the signal at the complementary output of FF6 passes to low level, returning then signal L to low level. This signal will undergo no variation when synchronism signal S returns to low level. As it can be noticed in Fig.2, signal L is at high level in correspondence with the leading edge of clock signal C relevant to the first bit of the data block, starting in correspondence with the vertical line denoted by O. Under these conditions clock signal C causes the datum on wire D to be transferred to the outputs of flip-flops FF1, FF2 and the low logic level to be transferred to the outputs of flip-flops FF3, FF4. In this way the register composed of four flip-flops FF1,..,FF4 remains in the same condition in which it would have been found after a previous operation of reset and a subsequent operation of load of the first datum. According to the present invention said two operations are performed at the same time by exploiting a unique clock period. From the subsequent clock pulse on, to the end of the data block, signal L causes flip-flops FF1,..,FF4 to accept the signals present respectively on wires 10,11,R2,R3, while the subsequent data on wire D, whereupon the division is serially carried out, are introduced through the adder EO2. In this way the circuit behaves as a conventional polynomial divider. The fact of inserting the incoming data at the end of the shift register, through EO2, entails their multiplication by the degree of the divisor polynomial, in this case x 4 . That allows a faster computation, since it is not necessary to wait for four clock intervals to dispose on wires R1,R2,R3,R4 of the polynomial remainder. However, the circuit operation woult not change if adder EO2 supplies only the FF1 input and FF4 supplies the EO1 input.

Claims: An electronic circuit for generating an error detection code for errors in digital signals (D), organized in data blocks forming the coefficients of a dividend polynomial, to be divided by a suitable divisor polynomial of (n)th degree to obtain a remainder polynomial of (n-1)th degree, whose coefficients (R1, R2, R3, R4) form the error detection code, the circuit consisting of a shift register composed of n flip-flops (FF1,..., FF4) wherein the signal outgoing from the (i-1)th flip-flop (FF1), i being comprised between 0 and n, is sent to a first input of (i)th flip-flop (FF2) directly or through a modulo-2 adder (EO1), according to whether the coefficient of the term of (i)th degree of the divisor polynomial is equal to or different from zero, said adder (EO1) adding to the signal outgoing from the preceding flip-flop (FF1) a feedback signal (10) obtained at the output of the (n)th flip-flop (FF4) which is the MSB flip-flop, either directly, or after adding it to the input data signal (D) in a modulo-2 adder (EO2) which for providing the feedback signal (10) receives as inputs the MSB of the remainder (R4) and said input data signal (D), the feedback signal (10) being supplied to the (i-1)th flip -flop (FF1) and to the other modulo-2 adder (EO1), and all the flip-flops being clocked by a common clock signal (C), characterized in that a second input of the (i)th flip-flop (FF2) accepts the first bit of said data block or a bit at low logic value, according to whether the coefficient of the term of (i)th degree of the divisor polynomial be respectively different from or equal to zero, in correspondence with the clock signal (C) transition relevant to the first bit of the data block, whilst at the subsequent transitions the (i)th flip-flop accepts the signals present at the first input, the first or second inputs being enabled according to the logic level of a signal (L) active in correspondence with the first bit of a data block. An electronic circuit as in claim 1, characterized in that said signal (L) active in correspondence with the first bit of a data block is generated by a logic circuit (FF5, FF6, AN) apt to carry out the derivative starting from said clock signal (C), duly inverted (NO), and from a synchronism signal (S) signalling the start of a data block.

Inventors: GANDINI MARCO, GHIGO GIOVANNI, MARCHISIO MAURO, GANDINI, MARCO, GHIGO, GIOVANNI, MARCHISIO, MAURO
Applicants: SIP, SIP SOCIETA ITALIANA PER L'ESERCIZIO DELLE TELECOMUNICAZIONI P.A.
Application year: 1991
Main classification: H03M13
IPC codes: H03M13, G06F11