CRC algorithm

Discussion to talk about software related topics only.
Post Reply
roland.ames

CRC algorithm

Post by roland.ames »

I need to speed up my CRC calculation.

The CRC I am using is described as:
CRC-4/ITU

width=4 poly=0x3 init=0x0 refin=true refout=true xorout=0x0 check=0x7 name="CRC-4/ITU"

Class: academic
ITU-T Recommendation G.704 (October 1998)
I Full mathematical description (Section 2.3.3.5, p.12)
I Shift register diagram (Annex A.3, p.36)
Created: 7 October 2008

I can currently generate the CRC by processing 1 bit at a time, but I need to be able to do it faster.

I have previously used look up tables to do fast CRC-16 calculations, but I do not have access to the tables for this CRC.

Does anyone know where I could find the tables or a reliable method for generating them, or any way of speeding up the calculation.

thanks,
Roland
dpursell
Posts: 20
Joined: Thu Aug 05, 2010 3:15 pm

Re: CRC algorithm

Post by dpursell »

I used the source code provided at http://www.lammertbies.nl/comm/software/index.html for help generating my own tables. It only gives routines for certain predetermined CRC polynomials, but the tables are generated at run-time so if you spend some time examining the files you should be able to develop a table generation function for your polynomial.

Sorry I can't be more specific, it's been a few years and I don't actually remember how to do it either, but I'm pretty sure that source has everything you need to get going.
Post Reply