CRC校验码生成和检查
ThisapplicationnotedescribestheCyclicRedundancy
Check(CRC)theoryandimplementation.TheCRC
checkisusedtodetecterrorsinamessage.Twoimple-mentationsareshown:
•TabledrivenCRCcalculation
•LoopdrivenCRCcalculation
Thisapplicationdescribestheimplementationofthe
CRC-16polynomial.However,thereareseveralfor-matsfortheimplementationofCRCsuchas
CRC-CCITT,CRC-32orotherpolynomials.
CRCisacommonmethodfordetectingerrorsintrans-mittedmessagesorstoreddata.TheCRCisavery
powerful,buteasilyimplementedtechniquetoobtain
datareliability.AN730CRCGeneratingandCheckingEXAMPLE1:MODULO-2CALCULATIONAuthors:ThomasSchmidtMicrochipTechnologyInc.1001100101XOR0100110111INTRODUCTION=1101010010ThisapplicationnotedescribestheCyclicRedundancyCheck(CRC)theoryandimplementation.TheCRCcheckisusedtodetecterrorsinamessage.Twoimple-