March 3, 2013

Error detection checksums (bookmark)

This post will be describing checksums only.
How to find out the message you received is same as the one which was sent? Checksums or CRC? there are at least dozen approaches (let's name few : additive, XOR, one's complement, two's complement, fletcher's  and many more).

One library I have been using implemented additive checksum. Is this the right one to implement in embedded world? The answer is provided in the next link:

The Effectiveness of Checksums for Embedded Networks []
One to start with, thesis dedicated to the checksums.

Which Error Detection Code Should You Use? []
This one sums it all briefly.

Additive checksums []
I usually find an article on barrgroup which forces me to look for more than just that topic.

I am going to rewrite that additive checksum to the one's complement solution. Few more instructions executed once in a while are worth it. The implementation is in the barrgroup's article down the page. There's mistake though, sum should be 32bits in order to get properly carry bits.