Cyclic coding and cyclic redundancy code check processor

Abstract: A cyclic coding and cyclic redundancy check processor for a generator polynomial G(X) with a degree of m (m is an integer satisfying m ≦ n/2) by units of n bits comprising a residue table storage section (200) to store a residue table containing 2 n pieces of residue data each having n/2 bits obtained by divisions of 2 n pieces of data having n bits by the generator polynomial, a data read section (101) to read out the data having predetermined number of bits for cyclic coding by units of n bits, an address generation section (102) to generate addresses of the residue data to be read out from the residue table storage section, a residue data read section (103) to read the residue data out of the residue table storage section according to the generated address, a processing section (104, 105) for shifting and saving of the data subjected to cyclic coding and a data synthesis section (106) for synthesis of the data shifted or saved and the read out residue data.

Description: BACKGROUNDS OF THE INVENTION FIELD OF THE INVENTION The present invention relates to a processor for cyclic coding and cyclic redundancy code check (hereinafter referred to as "CRC"), and particularly relates to a cyclic coding and CRC processor for error detection and correction of the data received in digital communications. DESCRIPTION OF THE RELATED ART Error detection and error correction are techniques at the receiver to accurately receive the data from the transmitter in digital signal communications. Cyclic coding is a process to generate check bits at the transmitter to facilitate such error detection or error correction at the receiver. It may be used for both error detection and error correction corresponding to the type of generator polynomial and available devices at the receiver. On the other hand, CRC is a process at the receiver to detect errors in the cyclic coded data as described above. Conventionally, there have been two types of cyclic coding and CRC processor for computerized cyclic coding and CRC corresponding to the degree of the generator polynomial and the number of data bits subjected to cyclic coding. Since the cyclic coding and CRC basically have the same procedure, the following description mainly addresses the cyclic coding. First of all, the type of the computer, the degree of the generator polynomial and the number of data subjected to be cyclic coding are defined. Suppose that the computer is an 8 bit microcomputer, the generator polynomial is G(X) = X 3 + X + 1, and the number of data subjected to cyclic coding is 50 bits. The 50 bit data for cyclic coding are a 49 , a 48 , .... a 1 and a 0 from the most significant bit (MSB). A cyclic coding and CRC processor in a first conventional Example is effective only when the generator polynomial has a low degree and a small number of data are processed. As shown in Fig. 6, it comprises a central processing unit (CPU) 600 for operation, data processing and control with a unit of 8 bits, a data memory 620 which stores 50 bits of the data for cyclic coding in order and a table ROM 610 which stores a syndrome table, all of which are connected with a bus 630. The table ROM 610 stores a syndrome table prepared in advance. For the syndrome table, data polynomials Ai(X) = ai · X i for the data which have 50 bits {a 49 , .... a 0 } and whose all bits are "0" except for bit i having "1" (i is an integer satisfying 0 ≦ i ≦ 49) (there exists 50 pieces of such data) are multiplied by X 3 and the products are divided by G(X) with modulo 2. The remainders (=3 bits) of such divisions are stored in the table. The syndrome table substantially has a size of 3 bits × 50 (50 bytes for a memory of 8 bit units). Next, refer to the flowchart of Fig. 7 illustrating the processing procedure and Table 1 showing an example of coding with Z80 assembler. Firstly, the CPU 600 sets the number of loops C to be 6 (Step 701). Next, it clears the parity register (one of the general purpose registers) inside (Step 702). Then, in Steps 703 to 706, the CPU 600 reads out 8 bit data (a n to a n-7 with a n being the MSB; first n = 49) from the data memory 620 (input data), shifts the data by one bit and then transmits the MSB to the CY (carry register). In Step 707, it is judged whether CY = 1 or not. If CY is 1, the syndrome value for the hit data a n (First n = 49) from the table ROM 610 (the lower 3 bits are valid in the 8 bit data (Step 708). Then, the syndrome value and the value at the above parity register are XORed and the result is stored to the above parity register (Step 709). If CY = 0 in Step 707, nothing is performed for it. The CPU 600 performs such bit judgment processing for the remaining bits (a n-1 to a n-7 ; n = 49) (Steps 710 to 711). When the processing is completed for all of 8 bits (Step 712), the CPU reads out the next 8 bit data (a n to a n-7 , n = 41) out of the data memory 620 and follows Steps 706 to 712. Then, the CPU 600 performs Steps 704 to 714 for the number of loops (for 48 bits). Then, in Steps 715 to 721, the remaining two bits are also subjected to the same bit judgment. The lower 3 bits finally remained in the above parity register in Steps 722 to 724 are used as the parity bits. From the coding example of Table 1, the number of execution states for the first conventional example is calculated to be a value from 1855 states at least to 2851 states at most, depending on whether the data is 1 or 0. Next, according to a second conventional example, cyclic coding can be made substantially for any number of data, provided that the degree of the generator polynomial is not more than twice the number of bits in the applicable general-purpose register. As shown in Fig. 8, a processor according to the present invention comprises a CPU 800 and a data memory 820, which are connected with a bus 830 each other, similarly to the first example. Referring now to the flowchart of Fig. 9 and a coding example using Z80 assembler in Table 2, the CPU 800 sets the number of loops E to be 5 first (Step 901). Next, it sets the generator polynomial registers (two of the general-purpose registers) in the CPU 800 to have 60H (Step 902). Then, in Step 903, the CPU 800 reads out 8 bit data (a 49 to a 42, with a 49 being the MSB) from the data memory 820 and stores the data to register A (one of the general-purpose registers) inside. In Step 904, the CPU 800 reads out the next 8 bit data (a n to a n-7 , with a n being the MSB; n = 41) from the data memory 820 and stores the data to register B (one of the general-purpose registers) inside. The above procedure is performed for 8 bits (Step 905). Then, in Step 906, the values of registers A and B are shifted by one bit and the MSB of register B is transmitted to the least significant bit (LSB) of register A and the MSB of register A to the carry register (CY). In Step 907, it is judged whether CY = 1 or not. If CY is 1, the values of register A and generator polynomial register are XORed and the result is stored to register A (Step 908). If CY is 0 in Step 907, then the CPU 800 just proceeds to Step 909. Then, the CPU 800 performs such bit judgment processing for the remaining 7 bits (a 48 to a 42 ) firstly stored to register A (Steps 906 to 910). At this time, the data of register B (a n to a n-7 ; n = 41) are entirely shifted to register A, and the CPU 800 reads out the following 8 bit data (a n to a n-7 ; n = 33) from the data memory 820, stores the data to register B and follows Steps 806 to 810. The CPU 800 performs the procedure of Steps 904 to 910 for the number of loops (for 48 bits). Then, in Steps 913 to 919, it performs similar bit judgment for the remaining 2 bits. The higher 3 bits of the value at register A upon completion of processing are the parity bits (Step 920). From the coding example of Table 2, the number of execution states for the second conventional example is calculated to be a value from 1727 at least to 2095 at most, depending on whether the data is 1 or 0. The conventional cyclic coding and CRC processor as described above involves complicated and lengthy processing including judgment process and XOR operation for each bit of data. This limits the time available for other processing such as communication protocol control, and naturally results in an increased cost when a high speed computer is used to reduce time for such processing. SUMMARY OF THE INVENTION It is an object of the present invention to provide a cyclic coding and cyclic redundancy check processor which reduces the time required for cyclic coding and CRC and thereby enables effective utilization of computer capacity for other processing such as communication protocol control. It is another object of the present invention to provide a cyclic coding and cyclic redundancy check processor which reduces the processing time for cyclic coding and CRC to eliminate the need of high speed computer and to thereby reduce the cost of the entire system. According to the present invention to attain the above objects, a cyclic coding processor for a generator polynomial G(X) with a degree of m (m is an integer satisfying m ≦ n/2) using a computer for data processing by units of n bits comprises residue table storage means which stores a residue table containing 2 n pieces of residue data having n/2 bits obtained by divisions of 2 n pieces of data having n bits by the generator polynomial, data read means which reads out the data having predetermined number of bits for cyclic coding by units of n bits, address generation means which generates addresses of the residue data to be read out from the residue table storage means, residue data read means which reads the residue data out of the residue table storage means according to the generated address, data save means which saves the data subjected to the cyclic coding, data shift means which shifts the data subjected to the cyclic coding and data synthesis means to synthesize the shifted and saved data and the residue data read out. The data save means generates save data by saving the lower n/2 bits of the data subjected to cyclic coding, the data shift means generates the shift data by shifting the higher n/2 bits of the data subjected to the cyclic coding toward the lower n/2 bits, and the data synthesis means generates synthetic data by synthesizing the residue data and the shift data or the residue data and the save data. According to another preferred embodiment of a cyclic coding processor, the address generation means uses, for the first address generation, n bit data subjected to cyclic coding read out by the data read means in order to generate the address for the residue table, and for the following address generations, the data obtained by synthesis of the residue data having n/2 bits previously read out and n/2 bits among the n bits subjected to the cyclic coding in order to generate the address for the residue table. According to a still preferred embodiment of a cyclic coding processor, the address generation means uses, for the first and following address generation processes, the data obtained by synthesis with treating the residue data of n/2 bits previously read out as the higher bits and n/2 bits of the n bits subjected to the cyclic coding as the lower bits in order to generate the address for the residue table. According to a further preferred embodiment of a cyclic coding processor, the residue table has 2 n pieces of residue data each having a length of n/2 bits obtained by modulo 2 divisions with the generator polynomial G (X) of the data polynomials for 2 n pieces of data with groups of n bits {Dk} (Dk = (d 0 , ...., d i , ...., d n-1 ) where di is 0 or 1, i is an integer satisfying 0 ≦ i ≦ n-1 and k is an integer satisfying 0 ≦ k ≦ 2 n . According to still another preferred embodiment of a cyclic coding processor, the residue table has, if n/2 - m = 0, 2 n pieces of residue data {r 0 , ...., r m-1 }, each having a length of n/2 bits, obtained by modulo 2 divisions with the generator polynomial G(X) of the data polynomials for the data {Dk} and, if n/2 - m > 0, n/2 bit data comprising 2 n pieces of m bit residue data {r 0 , ...., r m-1 } obtained by modulo 2 divisions with the generator polynomial G(X) of the data polynomials and the remaining n/2 - m bit data of the data {Dk}, which are {d 0 , ..., d n/2-m+1 }. According to attain the above objects, a cyclic redundancy check processor for a generator polynomial G(X) with a degree of m (m is an integer satisfying m ≦ n/2) using a computer for data processing by units of n bits comprises residue table storage means which stores a residue table containing 2 n pieces of residue data having n/2 bits obtained by division of 2 n pieces of data having n bits by the generator polynomial, data read means which reads out the data having predetermined number of bits for cyclic redundancy check by units of n bits, address generation means which generates addresses of the residue data to be read out from the residue table storage means, residue data read means which reads the residue data out of the residue table storage means according to the generated address, data save means which saves the data subjected to the cyclic redundancy check, data shift means which shifts the data subjected to the cyclic redundancy check, data synthesis means to synthesize the shifted and saved data and the residue data read out and check means for parity check of the data subjected to the cyclic redundancy checking using the residue data finally read out. The data save means generates save data by saving the lower n/2 bits of the data subjected to cyclic redundancy check, the data shift means generates the shift data by shifting the higher n/2 bits of the data subjected to the cyclic redundancy check toward the lower n/2 bits, and the data synthesis means generates synthetic data by synthesizing the residue data and the shift data or the residue data and the save data. According to another preferred embodiment of a cyclic redundancy check processor, the address generation means uses, for the first address generation, n bit data subjected to cyclic redundancy check read out by the data read means in order to generate the address for the residue table, and for the following address generations, the data obtained by synthesis of the residue data having n/2 bits previously read out and n/2 bits among the n bits subjected to the cyclic redundancy check in order to generate the address for the residue table. According to still another preferred embodiment of a cyclic redundancy check processor, the address generation means uses, for the first and following address generation processes, the data obtained by synthesis with treating the residue data of n/2 bits previously read out as the higher bits and n/2 bits of the n bits subjected to the cyclic redundancy check as the lower bits in order to generate the address for the residue table. According to a further preferred embodiment of a cyclic redundancy check processor, the residue table has 2 n pieces of residue data each having a length of n/2 bits obtained by modulo 2 divisions with the generator polynomial G (X) of the data polynomials for 2 n pieces of data with groups of n bits {Dk} (Dk = (d 0 , .... ,d i , ...., d n-1 ) where di is 0 or 1, i is an integer satisfying 0 ≦ i ≦ n-1 and k is an integer satisfying 0 ≦ k ≦ 2 n . According to still another preferred embodiment of a cyclic redundancy check processor, the residue table has, if n/2 - m = 0, 2 n pieces of residue data {r 0 , ...., r m-1 }, each having a length of n/2 bits, obtained by modulo 2 divisions with the generator polynomial G(X) of the data polynomials for the data {Dk} and, if n/2 - m > 0, n/2 bit data comprising 2 n pieces of m bit residue data {r 0 , ...., r m-1 } obtained by modulo 2 divisions with the generator polynomial G(X) of the data polynomials and the remaining n/2 - m bit data of the data {Dk}, which are {d 0 , ..., d n/2-m+1 }. Other objects, features and advantages of the present invention will become clear from the detailed description given herebelow. BRIEF DESCRIPTION OF THE DRAWINGS The present invention will be understood more fully from the detailed description given herebelow and from the accompanying drawings of the preferred embodiment of the invention, which, however, should not be taken to be limitative to the invention, but are for explanation and understanding only. In the drawings: Fig. 1 is a block diagram to illustrate the configuration of a cyclic coding processor according to a first embodiment of the present invention; Fig. 2 is a flowchart to illustrate the flow of cyclic coding procedure according to the first embodiment; Fig. 3 is a block diagram to show the entire configuration of a cyclic coding and CRC processor according to the present invention; Fig. 4 is a block diagram to illustrate the configuration of a CRC processor according to a second embodiment of the present invention; Fig. 5 is a flowchart to illustrate the flow of CRC processing according to the second embodiment; Fig. 6 is a block diagram to show the entire configuration of a conventional cyclic coding processor according to a first example; Fig. 7 is a flowchart to illustrate the flow of conventional cyclic coding; Fig. 8 is a block diagram to show the entire configuration of another conventional cyclic coding processor according to a second example; and Fig. 9 is a flowchart to illustrate the flow of conventional cyclic coding. DESCRIPTION OF THE PREFERRED EMBODIMENT Referring to the attached figures, preferred embodiments of the present invention will be described in details below. Fig. 3 shows the entire configuration of a cyclic coding and CRC processor according to the present invention. The reference numeral 100 indicates a CPU for operation, data processing and control by a unit of 8 bits. The numeral 200 indicates a table ROM to store a residue table and 300 indicates a data memory to store the data to be changed into cyclic codes. The CPU 100, the table ROM 200 and the data memory 300 are connected by a bus 400. Fig. 1 is a block diagram to illustrate the function of the CPU 100. In the figure, the CPU 100 comprises a data reader 101 to read out the data to be processed from the data memory 300, a reference address generator 102 to generate addresses for the residue data to be read out of the residue table TR in the table ROM 200, a residue table reader 103 to read out the residue data from the residue table TR in the table ROM 200, a save data generator 104 to save the data read out in the cyclic coding and CRC processing, a shift data generator 105 to shift the data read out in the cyclic coding and CRC processing, a synthetic data generator 106 for data synthesis in the cyclic coding and CRC processing, a repetition controller 107 to control repetition of the cyclic coding and CRC processing and registers 110 to be used for data operation in the cyclic coding and CRC processing. Suppose here a generator polynomial G(X) = X 3 + X + 1. The data to be transformed into cyclic codes has 50 bits, which are, from the MSB, {a 49 , a 48 , ..., a 1 and a 0 }. These bits are stored in the data memory 300 in this order. The table ROM 200 has a residue table TR prepared in advance. The residue table TR of the present embodiment to execute cyclic coding for every 8 bits of data has the configuration as described below. Suppose 256 pieces of data with combination of 8 bit groups {Dk}, which are d 0 , d 1 , .. , d i ,.., d 7 (i is an integer satisfying 0 ≦ i ≦ 7 and k is an integer satisfying 0 ≦ k ≦ 255). A data polynomial D(X) is obtained by applying the formula (1) to the above data {Dk} except bit d 0 . This polynomial D(X) is subjected to division with modulo 2 by the generator polynomial G (X). To the 3 bit residue {r 0 , r 1 , r 2 } obtained from such division, bit d 0 of the data {Dk} is added so as to form a 4 bit data {d 0 , r 0 , r 1 , r 2 }. The residue table TR has 256 pieces of data {d 0 , r 0 , r 1 , r 2 } generated for each bit in the data {Dk}. Accordingly, the residue table TR in this case has a size of 4 bits × 256: 256 bytes for an 8 bit unit memory. Specifically, the table ROM 200 of this embodiment, which is an 8 bit unit memory, stores the residue table TR and residues are assigned to the higher 4 bits of the 8 bit data. Though the computer explained above executes operation, data processing and control by units of 8 bits, the description above can be applied to computers for n-bit processing in general. Suppose a generator polynomial G(X) of degree m (m is an integer satisfying m ≦ n/2) is used in cyclic coding and cyclic redundancy code check for predetermined number of data, or in other words, data bits in the data memory 300 are read out by units of n bits for the above processing. In this case, the residue table can be defined as follows. For 2 n pieces of data {Dk} {d 0 , ..., d n-1 } (where i is an integer satisfying 0 ≦ i ≦ n-1 and k is an integer satisfying 0 ≦ k ≦ 2 n ), if n/2 -m = 0, The residue table has 2 n pieces of residue data {r 0 , ...., r m-1 } each having a length of n/2 bits, which are generated by modulo 2 division of the data polynomial Da(X) (2) by the generator polynomial G(X). If n/2-m > 0, the residue table has 2 n pieces of data {d 0 , ..., d n/2-m+1 , r 0 , ..., r m-1 } each having a length of n/2 bits obtained by adding the remaining data {d 0 , ..., d n/2-m+1 } of the data Dk to the m bit residue data {r 0 , ..., r m-1 } as a result of modulo 2 division of the above data polynomial Da(X) by the generator polynomial G (X). In the above description of the present embodiment, the generator polynomial G(X) has a degree of "3" and n is 8, and it corresponds to the case where n/2 -m > 0. Refer now to the flowchart of Fig. 2 to describe cyclic coding procedure and Table 3 to show an example of coding with Z80 assembler. Firstly, the repetition controller 107 of the CPU 100 sets the number of loops C = 5 at the register (Step 201). Then, the data reader 101 reads out 8 bits from the MSB (a 49 to a 42 ) among 50 bits of data from the data memory 300 so that they are used as the input data (Step 202). The reference address generator 102 of the CPU 100 uses the above input data to generate an address for the residue table. The residue table reader 103 reads out the first residue data (assigned to the higher 4 bits of the 8 bit data) corresponding to the reference address from the residue table TR and stores the data to register A (Step 203). The data reader 101 of the CPU 100 reads out the next 8 bits (a n to a n-7 ; n=41) from the data memory 300 and stores them to register E as the input data (Step 204). The save data generator 104 saves the lower 4 bits of the input data to register B as the first save data (Step 205). Further, the shift data generator 105 of the CPU 100 shifts the higher 4 bits in register E to the lower 4 bits so as to form the first shift data (Step 206). The synthetic data generator 106 of the CPU 100 synthesizes the first residue data of register A and the first shift data of register E by OR operation to generate the first synthetic data to be stored in register E (Step 207). Then, the reference address generator 102 uses the first synthetic data as the reference address for the residue table TR. The residue table reader 103 reads out the second residue data from the residue table TR according to the reference address and stores the data to register A (Step 208). Here, the synthetic data generator 106 of the CPU 100 stores the second residue data of register A to register E and stores the first save data to register A. It further ORs the second residue data and the first save data to form the second synthetic data to be stored in register E (Step 209). Then, the reference address generator 102 uses the second synthetic data as the reference address for the residue table TR. The residue table reader 103 reads out the third residue data from the residue table TR according to the reference address and stores the data to register A (Step 210). Focusing on the data read out of the data memory 300 in the above procedure, it is understood that the operation is made by units of 4 bits. After reading of the third residue data in Step 210, the repetition controller 107 decrements the number of loops C (Step 211), and it checks whether the number of loops C is "0" or not in Step 212. If the number of loops C is "0" or more, the CPU 100 returns to Step 204 so that the data reader 101 of the CPU 100 further reads out the following 8 bits (a n to a n-7 ; n = 33) from the data memory 300 and performs the procedure of Steps 205 to 210 for the input data newly read out. The CPU 100 continues the above procedure by units of 4 bits for the number of loops (or until the number of loops C becomes "0"). By repeating the procedure of Steps 204 to 210 until the number of loops C becomes "0", 48 bits among 50 bits are processed. If the number of loops C is found to be "0" in Step 212, then the CPU 100 has its data reader 101 read out the remaining 2 bits of the data among 50 bits from the data memory 300 and store them to register E (Step 213). Among 8 bits stored in register E, the higher two bits are provided with the bits read out of the above data memory 300. In other words, an input data having valid bits at the higher 2 bits among 8 bits is stored. Next, the shift data generator 105 shifts the higher 4 bits of the input data to the lower 4 bits so as to generate the second shift data (Step 214). The lower two bits of the second shift data is provided with "0". In other words, among the lower 4 bits in an 8 bit data, the higher 2 bits are provided with the 2 bit data read out of the above data memory 300 and the lower 2 bits are provided with "O". Then, the synthetic data generator 106 of the CPU 100 synthesizes the third residue data of register A and the second shift data of register E by OR operation to generate the third synthetic data to be stored in register E (Step 215). The reference address generator 102 uses the third synthetic data as a reference address for the residue address TR. According to such reference address, the residue table reader 103 reads out the fourth residue data from the residue table TR to be stored in register A (Step 216). The shift data generator 105 of the CPU 100 shifts the fourth residue data by two bits toward lower bit direction and thereby obtains the third shift data (Step 217). Here, the higher 2 bits and the lower 2 bits of the third shift data have "0". Then, the reference address generator 102 uses the third shift data as the reference address for the residue table TR and the residue table reader 103, according to such reference address, reads out the fifth residue data from the residue table TR (Step 218). The higher 3 bits of the fifth residue data are the desired parity bits (Step 219). The number of execution states determined from the coding example of Table 3 is found to be 651 states. Fig. 4 shows the configuration of a CRC processor according to a second embodiment of the present invention. This processor has a CPU 100a with the same configuration as the CPU 100 of Fig. 1 except addition of a parity checker 120 to check the parity to judge whether the data has any error or not. According to the second embodiment, CRC processing is described below. The cyclic coding and CRC processing basically follow the same procedure. Usually, the data transmitter transmits the data in cyclic codes (information bits + parity bits) and the receiver performs CRC processing (error detection with parity check). In the description below, CRC processing for the data in cyclic codes according to the first embodiment. Referring now to the flowchart of Fig. 5 to illustrate the CRC processing, 53 bits of data to be subjected to the CRC processing are supposed to be stored in the data memory 300 in appropriate order. These 53 bits comprise 50 bits of cyclic coded data and three parity bits. Prior to execution of the processing, a residue table TR similar to the one described for the first embodiment is prepared in advance and stored in the table ROM 200. In Steps 501 to 510, the same procedure as the one in Steps 201 to 210 of Fig. 2 is performed and explanation therefor is omitted. The data of 53 bits has 50 information bits and three parity bits. Therefore, upon completion of processing in Step 512 (upon completion of data processing for 48 bit data), there remains 5 bits of data. Specifically, the remaining two information bits and three parity bits. Referring first to Step 513, is the number of loops C is "0" in Step 512, the data reader 101 of the CPU 100 reads out the remaining five bits in 53 bit data from the data memory 300 and stores them to register E as input data (Step 513). The eight bits are provided with bit numbers from the higher bits in descending order so that the MSB has the bit number 7 and the LSB has the bit number 0 among the eight bits. In other words, among the eight bits of the input data, the higher five bits are provided with the data read out of the data memory 300 (the higher five bits are valid). Then, the save data generator 104 saves the third bit in the input data (Bit 3) and treats it as the second save data (Step 514). In this second save data, the third bit in the eight bits (Bit 3) is valid. Next, the shift data generator 105 of the CPU 100 shifts the higher four bits of the input data to the lower four bits and treats it as the second shift data (Step 515). Then, the synthetic data generator 106 of the CPU 100 synthesizes the third residue data and the second shift data by means of logical OR operation to generate the third synthetic data (Step 516). The reference address generator 102 generates third synthetic data as the reference address of the residue table TR and the residue table reader 103 reads out the fourth residue data from the residue table TR according to the reference address (Step 517). Then, the synthetic data generator 106 of the CPU 100 synthesizes the fourth residue data and the second save data by means of logical OR operation to generate the fourth synthetic data (Step 518). Then, the shift data generator 105 shifts the fourth synthetic data by two bits to the lower bit direction so as to generate the third shift data (Step 519). At this time the higher two bits of the third shift data are set to "0". Then, the reference address generator 102 of the CPU 100 generates the third shift data as the reference address of the residue table TR and the residue table reader 103 reads out the fifth residue data from the residue table TR according to the reference address (Step 520). Then, the parity checker 120 checks the higher three bits of the read out fifth residue data (Step 521). If the higher three bits of the fifth residue data are all "0", the system judges that the 53 bit data has no error, and judges that there is an error when even one of the higher three bits is "0". As described above, the cyclic coding and CRC processing device according to the above embodiments enables shifting and data synthesis for every n/2 bits because it stores a residue table of 2 n pieces in advance. This reduces the time required for cyclic coding and CRC processing, so that the computer can be effectively utilized for other processing including communication protocol control. Reduction of the time required for cyclic coding and CRC processing also eliminates the need of high speed computers, which reduces the cost of the system.

Claims: A cyclic coding processor for a generator polynomial G(X) with a degree of m (m is an integer satisfying m ≦ n/2) using a computer for data processing by units of n bits comprising: residue table storage means (200) for storing a residue table containing 2 n pieces of residue data having n/2 bits obtained by divisions of 2 n pieces of data having n bits by said generator polynomial, data read means (101) for reading out the data having predetermined number of bits for cyclic coding by units of n bits, address generation means (102) for generating addresses of said residue data to be read out from said residue table storage means (200), residue data read means (103) for reading said residue data out of said residue table storage means according to the generated address, data save means (104) for saving the data subjected to said cyclic coding, data shift means (105) for shifting the data subjected to said cyclic coding, and data synthesis means (106) for synthesizing said shifted and saved data and said residue data read out, characterized in that said data save means (104) generates save data by saving the lower n/2 bits of the data subjected to cyclic coding, said data shift means (105) generates the shift data by shifting the higher n/2 bits of the data subjected to said cyclic coding toward the lower n/2 bits, and said data synthesis means (106) generates synthetic data by synthesizing said residue data and said shift data or said residue data and said save data. A cyclic coding processor as set forth in Claim 1 wherein said address generation means (102) uses, for the first address generation, n bit data subjected to cyclic coding read out by said data read means (101) in order to generate the address for said residue table, and for the following address generations, the data obtained by synthesis of the residue data having n/2 bits previously read out and n/2 bits among the n bits subjected to said cyclic coding in order to generate the address for said residue table. A cyclic coding processor as set forth in Claim 2 wherein said address generation means (102) uses, for the first and following address generation processes, the data obtained by synthesis with treating the residue data of n/2 bits previously read out as the higher bits and n/2 bits of the n bits subjected to said cyclic coding as the lower bits in order to generate the address for said residue table. A cyclic coding processor as set forth in Claim 1 wherein said residue table has 2 n pieces of residue data each having a length of n/2 bits obtained by modulo 2 divisions with said generator polynomial G (X) of the data polynomials for 2 n pieces of data with groups of n bits {Dk} (Dk = (d 0 , ...., d i , .... d n-1 ) where di is 0 or 1, i is an integer satisfying 0 ≦ i ≦ n-1 and k is an integer satisfying 0 ≦ k ≦ 2 n . A cyclic coding processor as set forth in Claim 4 wherein said residue table has, if n/2 - m = 0, 2 n pieces of residue data {r 0 , ...., r m-1 }, each having a length of n/2 bits, obtained by modulo 2 divisions with said generator polynomial G(X) of the data polynomials for said data {Dk} and, if n/2 - m > 0, n/2 bit data comprising 2 n pieces of m bit residue data {r 0 , ...., r m-1 } obtained by modulo 2 divisions with said generator polynomial G(X) of said data polynomials and the remaining n/2 - m bit data of said data {Dk}, which are {d 0 , ..., d n/2-m+1 }. A cyclic redundancy check processor for a generator polynomial G(X) with a degree of m (m is an integer satisfying m ≦ n/2) using a computer for data processing by units of n bits comprising: residue table storage means (200) for storing a residue table containing 2 n pieces of residue data having n/2 bits obtained by division of 2 n pieces of data having n bits by said generator polynomial, data read means (101) for reading out the data having predetermined number of bits for cyclic redundancy check by units of n bits, address generation means for generating addresses of said residue data to be read out from said residue table storage means, residue data read means (103) for reading said residue data out of said residue table storage means (200) according to the generated address, data save means (104) for saving the data subjected to said cyclic redundancy check, data shift means (105) which shifts the data subjected to said cyclic redundancy check, data synthesis means (106) for synthesizing said shifted and saved data and said residue data read out, check means (120) for parity check of the data subjected to said cyclic redundancy checking using said residue data finally read out, characterized in that said data save means (104) generates save data by saving the lower n/2 bits of the data subjected to cyclic redundancy check, said data shift means (105) generates the shift data by shifting the higher n/2 bits of the data subjected to said cyclic redundancy check toward the lower n/2 bits, and said data synthesis means (106) generates synthetic data by synthesizing said residue data and said shift data or said residue data and said save data. A cyclic redundancy check processor as set forth in Claim 6 wherein said address generation means (102) uses, for the first address generation, n bit data subjected to cyclic redundancy check read out by said data read means (101) in order to generate the address for said residue table, and for the following address generations, the data obtained by synthesis of the residue data having n/2 bits previously read out and n/2 bits among the n bits subjected to said cyclic redundancy check in order to generate the address for said residue table. A cyclic redundancy check processor as set forth in Claim 7 wherein said address generation means (102) uses, for the first and following address generation processes, the data obtained by synthesis with treating the residue data of n/2 bits previously read out as the higher bits and n/2 bits of the n bits subjected to said cyclic redundancy check as the lower bits in order to generate the address for said residue table. A cyclic redundancy check processor as set forth in Claim 6 wherein said residue table has 2 n pieces of residue data each having a length of n/2 bits obtained by modulo 2 divisions with said generator polynomial G (X) of the data polynomials for 2 n pieces of data with groups of n bits {Dk} (Dk = (d 0 , ...., d i , ...., d n-1 ) where di is 0 or 1, i is an integer satisfying 0 ≦ i ≦ n-1 and k is an integer satisfying 0 ≦ k ≦ 2 n . A cyclic redundancy check processor as set forth in Claim 9 wherein said residue table has, if n/2 - m = 0, 2 n pieces of residue data {r 0 , ..., r m-1 }, each having a length of n/2 bits, obtained by modulo 2 divisions with said generator polynomial G(X) of the data polynomials for said data {Dk} and, if n/2 - m > 0, n/2 bit data comprising 2 n pieces of m bit residue data {r 0 , ..., r m-1 } obtained by modulo 2 divisions with said generator polynomial G(X) of said data polynomials and the remaining n/2 - m bit data of said data {Dk}, which are {d 0 , ..., d n/2-m+1 }.

Inventors: SAEGUSA YASUHIRO, SAEGUSA, YASUHIRO, SAEGUSA, YASUHIRO, C/O NEC CORPORATION
Applicants: NIPPON ELECTRIC CO, NEC CORPORATION
Application year: 1994
Main classification: H03M13
IPC codes: H03M13, H04L1, G06F11