Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What is the best checksum method?

Status
Not open for further replies.

rednewguy

Full Member level 2
Joined
Jun 3, 2005
Messages
123
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,296
Activity points
2,413
what is the best checksum method available now.
what i use is

let me say in C

for (i = 0; i < count; i++)
{
checksum = (checksum + data) % 256; /* say my checksum is 8bits */
}
checksum = -checksum;



but this is doesnt seem to be a good error detection system. is ther any alternative best algos for checksum.

thanks
 

Re: checksum

No matter how you calculate them checksums are weak. They can't detect multiple errors and your checksum won't catch any high order bit errors if checksum type is 16 bits. If checksum type is 8 bits you don't need the modulo operation, just keep adding them and letting them rollover. Make sure you don't have any 'math error exceptions' enabled if you do it this way.

CRC's are better, but mathematically more complicated to generate and check. You can find examples everywhere so it's actually easy to cut and paste one into your code. They're pretty good about detecting a few bit errors.

You can look up the various Error Correction codes that are available, too.

The more robust your Error Correction/Detection is, the more data it takes. So your effective throughput will decrease.
 

    rednewguy

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top