have a look at this one:
http://www.cuj.com/documents/s=8235/cuj0306mcdaniel/
it is c++ though, but you should get the picture and be able to
transform it to vhdl...
That link contains the text:
"It turns out that you can also use CRCs to correct a single-bit error
in any transmission."
That statement is false in general.
For CRC32, it is theoretically possible to uniquely locate the single
bit error in packets up to 2^32 bits long, which covers any practical
packet length, but not e.g. large files.
(Umm, that might be 2^32-1, rather than 2^32.)
For CRC16, it's a little worse. For starters, it's only 16 bits long,
so only 2^16 bits can be corrected.
Also, CRC16 isn't a primitive polynomial; it has (x+1) as a factor. I
think this means only 2^15 bits can be corrected. (Please, someone
correct me if I'm wrong.)
If all your packets are less than 4k bytes, this might be ok.
Note that in assuming that all possible values of the CRC represent
single bit errors, we have lost the ability to detect multi-bit
errors; they will appear as correctable single bit errors.
I suggest that if the OP is having a problem with single bit errors,
multiple bit errors will also be a problem. Thus some additional form
of error detection is required.
Regards,
Allan.