user5951764
user5951764

Reputation: 43

When should hamming codes be used and when is crc better?

Following are the things that I already know about these:

My main question is what is the advantage of using one code over another?

Upvotes: 3

Views: 4516

Answers (2)

DataMiner
DataMiner

Reputation: 11

It will depend on your application, but as you have pointed out, the two are quite different. The main difference I would consider is the amount of overhead needed for each.

For a simple (7,4) hamming code, you are adding 75% overhead to your data in order to get the ability to correct one error for every 4-bits. So if you were sending or storing a 1000 byte message, you would have to really send/store 1750 bytes. That's a lot of overhead!

For a CRC, you are accumulating a single result over a large amount of data in order to detect if there is an error somewhere in the data. You do not need to tell exactly where it is, just that something is wrong. For that, you could accumulate a 32-bit CRC over your message and do pretty well. So for our 1000 byte message, you would really be sending/storing 1004 bytes. That is very efficient if all you need is detection of a problem.

Upvotes: 1

Chaitanya Gawande
Chaitanya Gawande

Reputation: 26

Hamming is used in case where fixed length of data is to be detected and corrected while CRC works for any length of data.

Upvotes: 1

Related Questions