Hi, Scott Dattalo wrote: > I don't know why, but I've been thinking about the CRC-32 too :). I was > surprised to discover that the 8-bit CRC in Dallas' 1-wire products is > more difficult to implement than the 16-bit CRCs. It lacks the symmetry of > say a CRC-16 computation. This made me curious about the 32-bit CRC's. Do > they have the simple symmetry that allows them to be efficiently computed? > Incidently, the technique used to implement the 8-bit CRC (see > http://www.dattalo.com/technical/software/pic/crc_8.asm for an > implementation, but no description) is completely generic. It takes 19 > cycles. In general, for an N-byte crc, this technique will take about 9*N > cycles to implement. I'd expect 36 to 40 cycles for a 32-bit CRC. I'd > expect less if symmetry can be exploited. :) my initial estimates were a few cycles over that, something around 50 cycles, an initial glance the crc32 leans towards more brute force than elegant symetry, however there are a few 'shortcuts' that can be made but if these will save cycles in the end I'm still not sure. The polynom for crc32 affect many more bits than the crc16, that is in relative number of bits affected, crc16 affects 3 bits/16 bits ~19%, crc32 affects 14/32 ~45%. I belive that the low percentage of affected bits in the crc16 polynom 'helped' finding the symetry. Affecting more number of bits will make symetry harder (and more inefficent) to calculate.=20 Anyway the thread is alive now, /Tony -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads