A cyclic redundancy check method and chip

By employing newly defined verification instructions and control units in the chip to perform cyclic redundancy check, the problem of increased area and cost from integrating the CRC module was solved, thus improving computing performance.

CN117993355BActive Publication Date: 2024-11-15北京中科昊芯科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410138252.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-31
Publication Date
2024-11-15
Estimated Expiration
2044-01-31

AI Technical Summary

Technical Problem

Integrating a CRC module increases the chip's physical area and manufacturing cost.

Method used

Cyclic redundancy check is implemented using a newly defined verification instruction. The instruction is executed by the control unit and the arithmetic unit instead of occupying physical space, reducing chip area and keeping the cost unchanged.

Benefits of technology

It enables effective cyclic redundancy check without increasing chip area and cost, thereby improving computing performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117993355B_ABST
    Figure CN117993355B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a method and chip for cyclic redundancy check, the method comprising: setting the value of a status control register, wherein the value of the status control register is used to indicate whether the current check needs to reverse the order of the checked bytes included in the input data; performing the following operations on the i-th checked byte of the input data to obtain a check result: loading the multi-bit input data corresponding to the i-th checked byte; performing a check operation on the i-th checked byte according to a check instruction to obtain an i-th check result, wherein the checked byte is stored in a second operand register corresponding to the check instruction, and the check instruction performs a bit logic operation on the number stored in the second operand register and the number in the first operand register in a cyclic manner, and the first operand register is used to store an initial value and a check process value. The embodiment of the present application is used to reduce chip manufacturing costs and reduce chip area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chips, and specifically, embodiments of the present application relate to a cyclic redundancy check method and chip. Background Art

[0002] In hardware implementation, the CRC circuit can be designed as a module in an integrated circuit (chip). The CRC module usually contains hardware circuits specifically used to perform the CRC algorithm. However, the modules integrated into the chip usually increase the physical area of ​​the chip. Because each module requires a certain number of transistors and other electronic components to implement its functions, these components occupy the area of ​​the chip. Therefore, integrating the CRC module or other functional modules into the chip will increase the total area of ​​the chip.

[0003] The manufacturing cost of a chip depends mainly on the size of the chip and the area of ​​the silicon wafer used in the manufacturing process. Therefore, increasing the physical area of ​​the chip usually leads to increased manufacturing costs. Therefore, adding a CRC module to the chip will lead to an increase in manufacturing costs. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method and chip for cyclic redundancy check. The embodiments of the present application are used to implement cyclic redundancy check through newly defined check instructions. Since the instructions themselves do not directly occupy the physical area of ​​the chip (this is because instructions are the basic operation units of computer programs and are usually stored in the memory rather than directly occupying space on the chip), the execution of the instructions is completed by hardware components such as the control unit and the operation unit on the chip. Therefore, when the embodiments of the present application are used to implement cyclic redundancy check, the chip manufacturing cost will not be increased and the chip area will be reduced.

[0005] In a first aspect, an embodiment of the present application provides a method for cyclic redundancy check, the method comprising: setting the value of a status control register, wherein the value of the status control register is used to indicate whether the current check requires the reverse order of the checked bytes included in the input data; performing the following operations on the i-th checked byte of the input data to obtain a check result: loading multi-bit input data corresponding to the i-th checked byte; performing a check operation on the i-th checked byte according to a check instruction to obtain an i-th check result, wherein the checked byte is stored in a second operand register corresponding to the check instruction, the check instruction performs a bit logic operation on the number stored in the second operand register and the number in the first operand register in a cyclic manner, and the first operand register is used to store an initial value and a check process value; wherein i is an integer greater than or equal to 1.

[0006] In some embodiments, setting the value of the status control register includes: setting the value of the status control register to a first value, wherein the first value is used to represent that this check is a CRC check from the highest bit to the lowest bit of the corresponding checked byte; or setting the value of the status control register to a second value, wherein the second value is used to represent that this check is a CRC check from reversing the corresponding checked bytes and performing a CRC check from the highest bit to the lowest bit of the checked bytes obtained from the reversed order.

[0007] In some embodiments, performing a verification operation on the i-th verified byte according to the verification instruction to obtain the i-th verification result includes: storing an initial value or a result value of the verification process in the first operand register; storing the i-th verified byte in the second operand register according to the value in the status control register; performing a bit-by-bit logical operation on the value in the first operand register and the value in the second operand register to obtain a calculation result and assigning the calculation result to an intermediate variable n, until the loop ends and the value of the intermediate variable is stored in the first operand register.

[0008] In some embodiments, the logical operation is a bitwise exclusive-OR operation.

[0009] In some embodiments, the i-th verified byte includes n binary bits, and the bitwise logical operation of the value in the first operand register and the value in the second operand register to obtain a calculation result and assigning the calculation result to the intermediate variable n until the loop ends and the value of the intermediate variable is stored in the first operand register, includes: bitwise looping calculation for n or less times: if it is confirmed that the result of the bitwise AND operation of the value of the intermediate variable n and the first set value in the k-th loop is equal to 1, then the value of the intermediate variable n in the k+1-th loop is equal to the value of the intermediate variable n in the k-th loop shifted left by one bit and then bitwise XORed with the second set value; if it is confirmed that the result of the bitwise AND operation of the value of the intermediate variable n in the k-th loop and the first set value is not equal to 1, then the value of the intermediate variable n in the k+1-th loop is equal to the value of the intermediate variable n in the k-th loop shifted left by 1 bit; wherein k is an integer greater than 1 and less than or equal to n-1.

[0010] In some embodiments, if the value of n is 8, the first setting value is 0x80, and the second setting value is 0x07.

[0011] In some embodiments, storing the i-th checked byte into the second operand register according to the value in the status control register includes: reading the value in the status control register to obtain a reverse attribute value; if it is confirmed that the reverse attribute value is the first numerical value, inputting the i-th checked byte into the second operand register in positive order.

[0012] In some embodiments, storing the i-th checked byte into the second operand register according to the value in the status control register includes: reading the value in the status control register to obtain a reverse attribute value; if it is confirmed that the reverse attribute value is the second numerical value, reversing the i-th checked byte and inputting it into the second operand register.

[0013] In some embodiments, the first value is the number 0 and the second value is the number 1.

[0014] In a second aspect, some embodiments of the present application provide a chip comprising a processor and a memory, wherein the processor reads data or instructions from the memory and executes them to implement the method as described in any one of the embodiments in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0016] Figure 1 One of the flow charts of the cyclic redundancy check method provided in the embodiment of the present application;

[0017] Figure 2 A second flowchart of the cyclic redundancy check method provided in an embodiment of the present application;

[0018] Figure 3 A schematic diagram of the chip architecture provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0020] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0021] At least in order to overcome the technical defects existing in the background technology part, the embodiments of the present application target the cyclic redundancy check algorithm of common polynomials (for example, crc8 (0x7), crc16 (0x8005 / 0x1021), crc24 (0x5d6dcb), crc32 (0x1edc6f41 / 0x04c11db7), find out the hot spot calculation block and define and design it into a riscv instruction (i.e., the check instruction) to realize its calculation function, thereby achieving the technical purpose of reducing the number of instructions, improving computing performance and reducing chip area.

[0022] The following is an example of CRC application and CRC algorithm.

[0023] Introduction to CRC application:

[0024] CRC algorithm has a wide range of applications in the fields of communication and data storage, mainly used to detect errors in data transmission or storage. The application scenarios of CRC algorithm include: communication protocols, storage systems, file transfer, wireless communication, storage media, serial communication, sensor data transmission, etc.

[0025] The input of CRC (Cyclic Redundancy Check) is usually the data to be checked for errors. This data can come from a variety of application scenarios, including but not limited to:

[0026] Communication protocol data: In network communication, serial communication and other protocols, CRC is usually used to detect whether errors occur during data transmission. Part of the data frame is usually used as input for calculating CRC.

[0027] Storing data: In storage systems such as hard drives, flash memory, etc., CRC can be used to detect whether the data is damaged while in storage. The content of the data block or storage cell is the input to the CRC.

[0028] File transfer: During the file transfer process, CRC can be used to detect whether the transferred file is complete. The content of the entire file or a file block can be used as the input of CRC.

[0029] Data packet: In computer networks, data packets usually contain information about the communication. CRC can be used to detect whether errors occurred in the transmission of data packets.

[0030] Sensor data: In the Internet of Things (IoT) and sensor networks, data obtained from sensors may need to be CRC checked to ensure data integrity.

[0031] Input device data: In some cases, CRC can be used to verify data received from input devices (such as keyboard, mouse).

[0032] Regardless of the source of the data, whether it is communication, storage, file transfer, or other applications, the goal of CRC is to provide an effective way to detect errors in data transmission or storage. The CRC algorithm adds redundant information to the data and uses polynomial division to generate a check value, allowing the receiving end to detect whether an error has occurred.

[0033] Introduction to CRC algorithm:

[0034] There are several important parameters in the CRC (Cyclic Redundancy Check) algorithm, which determine the performance and characteristics of CRC. The following are some common CRC parameters and their meanings:

[0035] Polynomial: The core of the CRC algorithm is a polynomial, usually expressed in binary. This polynomial determines the performance and detection capabilities of the CRC algorithm. For example, the polynomial of CRC-32 is (x^{32}+x^{26}+x^{23}+x^{22}+x^{16}+x^{12}+x^{11}+x^{10}+x^8+x^7+x^5+x^4+x^2+x+1), which is 0x04c11db7.

[0036] Initial Value: The initial value of the CRC register before the calculation begins. Usually, it can be set to all 0s or all 1s, depending on the requirements of the CRC algorithm.

[0037] Final XOR Value: After all data bits have been calculated, the CRC value may need to be XORed with a predefined value for a final time. This value is sometimes called the "XOR mask" or "final XOR value".

[0038] Reflect Input: Indicates whether the order of the input data bits needs to be reversed when processing them. Sometimes also called bit order reversal.

[0039] Reflect Output CRC: Indicates whether the bits in the CRC register need to be reversed before the final CRC value is output. It is also a type of bit order reversal.

[0040] The selection of these parameters will affect the performance and applicability of the CRC algorithm. Different application scenarios may require different CRC configurations to meet specific error detection and correction requirements. When selecting CRC parameters, factors such as the communication environment, data transmission rate, and data length need to be carefully considered to ensure the effectiveness of the CRC.

[0041] Please see Figure 1 , Figure 1 A cyclic redundancy check method is provided for an embodiment of the present application, the method comprising:

[0042] S110, setting the value of the status control register, wherein the value of the status control register is used to indicate whether the current check needs to reverse the order of the checked bytes included in the input data.

[0043] Perform the following operations on the i-th checked byte of the input data to obtain a check result:

[0044] S121, load the multi-bit input data corresponding to the i-th checked byte.

[0045] S122, perform a verification operation on the i-th verified byte according to the verification instruction to obtain an i-th verification result, wherein the verified byte is stored in a second operand register corresponding to the verification instruction, and the verification instruction performs a bit logic operation on the number stored in the second operand register and the number in the first operand register in a cyclic manner, and the first operand register is used to store an initial value and a verification process value; wherein i is an integer greater than or equal to 1.

[0046] The following is an example explanation: Figure 1 The implementation process of the relevant steps.

[0047] In some embodiments of the present application, the process of setting the value of the status control register described in S110 exemplarily includes: setting the value of the status control register to a first value, wherein the first value is used to represent that this check is a CRC check from the highest bit to the lowest bit of the corresponding checked byte; or, setting the value of the status control register to a second value, wherein the second value is used to represent that this check is from reversing the corresponding checked bytes and performing a CRC check from the highest bit to the lowest bit of the checked bytes obtained from the reversed order.

[0048] In some embodiments of the present application, S122 exemplarily includes:

[0049] The first step is to store an initial value or a result value in a verification process in the first operand register.

[0050] The second step is to store the i-th checked byte into the second operand register according to the value in the status control register.

[0051] For example, in some embodiments of the present application, the second step exemplarily includes: reading the value in the status control register to obtain a reverse attribute value; if it is confirmed that the reverse attribute value is the first numerical value, inputting the i-th checked byte in positive order into the second operand register.

[0052] For example, in some embodiments of the present application, the second step exemplarily includes: reading the value in the status control register to obtain a reverse attribute value; if it is confirmed that the reverse attribute value is the second numerical value, reversing the i-th checked byte and inputting it into the second operand register.

[0053] For example, in some embodiments of the present application, the first value is the number 0 and the second value is the number 1.

[0054] In the third step, the value in the first operand register and the value in the second operand register are logically operated bit by bit to obtain a calculation result and the calculation result is assigned to the intermediate variable n until the loop ends and the value of the intermediate variable is stored in the first operand register. For example, in some embodiments of the present application, the logical operation is a bitwise XOR operation.

[0055] In some embodiments of the present application, the i-th verified byte includes n binary bits, and the third step exemplarily includes: bitwise looping n times of the following calculations: if it is confirmed that the result of the bitwise AND operation of the value of the intermediate variable n in the k-th loop and the first set value is equal to 1, then the value of the intermediate variable n in the k+1-th loop is equal to the value of the intermediate variable n in the k-th loop shifted left by one bit and then bitwise XORed with the second set value; if it is confirmed that the result of the bitwise AND operation of the value of the intermediate variable n in the k-th loop and the first set value is not equal to 1, then the value of the intermediate variable n in the k+1-th loop is equal to the value of the intermediate variable n in the k-th loop shifted left by 1 bit; wherein k is an integer greater than 1 and less than or equal to n-1. For example, in some embodiments of the present application, if the value of n is 8, the first set value is 0x80 and the second set value is 0x07.

[0056] Combine the following Figure 2 The cyclic redundancy check method provided by some embodiments of the present application is exemplified.

[0057] The first step is to start the CRC calculation.

[0058] The second step is to set the CRC initial value.

[0059] The third step is to set the status control register CRCSTATUS.

[0060] In the “setting status control register CRCSTATUS” link recorded in some embodiments of the present application, the CRCSTATUS mentioned is the CRC instruction set status register, and the register [0] bit CRCSTATUS[0], that is, CRCSTATUS.REVERSE is the reverse CRC check control bit.

[0061] CRCSTATUS.REVERSE=0: CRC check is performed from the highest bit to the lowest bit of the byte being checked;

[0062] CRCSTATUS.REVERSE=1: Reverse the order of the bytes to be checked, and then perform CRC check on the highest bit --> lowest bit.

[0063] The fourth step is to input data in bytes.

[0064] The fifth step is to assign an initial value of 0 to the parameter j, which is used to record the length of the verified data.

[0065] Step 6: Determine whether the value of j is less than the input data length. If so, continue to step 7, otherwise, proceed to step 11.

[0066] Step 7. Input data rd and rs1.

[0067] rd is the first operand register and rs1 is the second operand register.

[0068] The eighth step is to call the corresponding custom instruction calculation. These custom verification instructions include: CRC8, CRC16P1, CRC16P2, CRC24, CRC32P1 or CRC32P2.

[0069] The following is a brief introduction to it.

[0070] CRC8 instruction format crc8 rd,rs1 Input: rs1 is the 8-bit data to be checked, rd is the CRC initial value or the result during the check process. Output: rd is the 8-bit check result. The first setting value of this instruction is 0x80, and the second setting value is 0x07.

[0071] CRC16P1 instruction format crc16p1 rd,rs1 Input: rs1 is the 8-bit data to be checked, rd is the CRC initial value or the result during the check process. Output: rd is the 16-bit check result. The first setting value of this instruction is 0x8000, and the second setting value is 0x8005.

[0072] CRC16P2 instruction format crc16p2 rd,rs1 Input: rs1 is the 8-bit data to be checked, rd is the CRC initial value or the result during the check process. Output: rd is the 16-bit check result. The first setting value of this instruction is 0x8000, and the second setting value is 0x1021.

[0073] CRC24 instruction format crc24 rd,rs1 Input: rs1 is the 8-bit data to be checked, rd is the CRC initial value or the result during the check process. Output: rd is the 24-bit check result. The first setting value of this instruction is 0x800000, and the second setting value is 0x5d6dcb.

[0074] CRC32P1 instruction format crc32p1 rd,rs1 Input: rs1 is the 8-bit data to be checked, rd is the CRC initial value or the result during the check process. Output: rd is the 32-bit check result. The first setting value of this instruction is 0x80000000, and the second setting value is 0x4c11db7.

[0075] CRC32P2 instruction format crc32p2 rd,rs1 Input: rs1 is the 8-bit data to be checked, rd is the CRC initial value or the result during the check process. Output: rd is the 32-bit check result. The first setting value of this instruction is 0x80000000, and the second setting value is 0x1edc6f41.

[0076] The "custom instruction calculation" link of some embodiments of the present application includes custom instructions for CRC calculation of 6 common polynomials, among which the crc8 instruction is introduced as an example. This instruction implements CRC calculation on one byte of input data.

[0077] The instruction format of the 8-bit data check instruction is: crc8 rd,rs1

[0078] The first operand register rd is used to store the crc initial value, the result of the verification process and the result of executing the instruction, and the second operand register rs1 is used to store the verified data.

[0079] Before executing this instruction, the first operand register rd and the second operand register rs1 have been assigned values ​​through the seventh step. rs1: 8-bit (Byte) data to be checked; rd: crc initial value or result of the check process. The result after executing this instruction is stored in the rd register: 8-bit check result.

[0080] In some embodiments of the present application, the instruction functions of the 8-bit data verification instruction are as follows: 1. If CRCSTATUS.REVERSE = 0, that is, the input data is set to be in bit order, then rs1[7:0] = rs1[7:0]; otherwise, the input data is in bit order, so rs1[7:0] = rs1[0:7]; 2. Set the intermediate variable n = (rd^rs1). Loop the following calculations 8 times bit by bit: If (n&0x80) is equal to 1, then n is equal to (n shifted left by 1 bit)^0x07 (the polynomial of crc8), otherwise n is equal to the value of n shifted left by 1 bit. After the above 8 cycles are completed, the result rd is equal to the value of n.

[0081] Step 9. Get the value in rd.

[0082] In the tenth step, the value of parameter j is incremented.

[0083] Step 11: Output the value of rd, which is the result of CRC calculation.

[0084] Step 12. End.

[0085] To sum up, some embodiments of the present application utilize the status control register CRCSTATUS and crc custom instructions to greatly improve the calculation performance of crc. The specific calculation process is: 1. Set the CRCSTATUS register; 2. Load 8-bit input data; 3. crc custom instruction calculation; 4. Loop steps 2 and 3; 5. Output the verification result after the input data is loaded and calculated.

[0086] It is not difficult to understand that some embodiments of the present application effectively reduce the number of algorithm instructions by adding custom extension instructions from the bottom layer of the chip without changing the algorithm logic or using tools, thereby improving the computing performance of the chip by increasing the speed of CRC operations.

[0087] like Figure 3 As shown, some embodiments of the present application provide a chip 300, wherein the chip 300 includes a processor 320 and a memory 310, wherein the processor 320 reads data or instructions from the memory 310 and executes them to implement the method as described in any one of the embodiments of the first aspect.

[0088] For example, in some embodiments of the present application, the memory 310 is at least configured to store verification instructions and data related to executing the verification instructions, and the processor 320 reads instructions from the memory through a bus and reads related operands for calculation to obtain verification results.

[0089] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0090] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0091] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0092] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0093] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0094] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A cyclic redundancy check method, characterized in that: The method comprises: Setting a value of a status control register, wherein the value of the status control register is used to indicate whether the current check needs to reverse the order of the bytes to be checked included in the input data; Perform the following operations on the i-th checked byte of the input data to obtain a check result: Loading the multi-bit input data corresponding to the i-th checked byte; Performing a check operation on the i-th checked byte according to the check instruction to obtain an i-th check result, wherein the checked byte is stored in a second operand register corresponding to the check instruction, and the check instruction performs a bit logic operation on a number stored in the second operand register and a number in a first operand register in a cyclic manner, and the first operand register is used to store an initial value and a check process value; Wherein, i is an integer greater than or equal to 1; in: The step of performing a check operation on the i-th checked byte according to the check instruction to obtain an i-th check result includes: storing an initial value or a result value of a verification process in the first operand register; storing the i-th checked byte into the second operand register according to the value in the status control register; A logical operation is performed bit by bit on the value in the first operand register and the value in the second operand register to obtain a calculation result and the calculation result is assigned to an intermediate variable n until the loop ends and the value of the intermediate variable is stored in the first operand register.

2. The method according to claim 1, characterized in that The setting of the value of the status control register includes: The value of the state control register is set to a first value, wherein the first value is used to indicate that the current check is performed from the highest bit to the lowest bit of the corresponding checked byte. or, The value of the status control register is set to a second value, wherein the second value is used to indicate that this check is to perform a CRC check from the highest bit to the lowest bit of the corresponding checked bytes in reverse order.

3. The method according to claim 2, characterized in that The logical operation is a bitwise exclusive OR operation.

4. The method according to claim 2, characterized in that The i-th verified byte includes n binary bits, then performing a bit-by-bit logical operation on the value in the first operand register and the value in the second operand register to obtain a calculation result and assigning the calculation result to an intermediate variable n until the loop ends and the value of the intermediate variable is stored in the first operand register, comprising: Loop the following bitwise calculations n times: If it is confirmed that the result of the bitwise AND operation of the value of the intermediate variable n in the kth cycle and the first set value is equal to 1, the value of the intermediate variable n in the k+1th cycle is equal to the value of the intermediate variable n in the kth cycle shifted left by one bit and then bitwise XORed with the second set value; If it is confirmed that the result of the bitwise AND operation between the value of the intermediate variable n in the kth loop and the first set value is not equal to 1, then the value of the intermediate variable n in the k+1th loop is equal to the value of the intermediate variable n in the kth loop shifted left by 1 bit; Here, k is an integer greater than 1 and less than or equal to n-1.

5. The method according to claim 4, characterized in that If the value of n is 8, the first setting value is 0x80, and the second setting value is 0x07.

6. The method according to claim 2, characterized in that The step of storing the i-th checked byte into the second operand register according to the value in the status control register comprises: Read the value in the state control register to obtain a reverse attribute value; If it is confirmed that the reverse attribute value is the first value, the i-th checked byte is input into the second operand register in positive order.

7. The method according to claim 2, characterized in that The step of storing the i-th checked byte into the second operand register according to the value in the status control register comprises: Read the value in the state control register to obtain a reverse attribute value; If it is confirmed that the reverse attribute value is the second value, the i-th checked byte is reversed and input into the second operand register.

8. The method according to claim 6 or 7, characterized in that The first value is the number 0 and the second value is the number 1.

9. A chip, characterized in that: The chip includes a processor and a memory, wherein the processor reads data or instructions from the memory and executes them to implement the method as described in any one of claims 1-8.