On Sat, Jun 26, 2004 at 11:33:05PM +0100, Howard Winter wrote: > Kyrre, > > On Sat, 26 Jun 2004 17:50:44 +0200, Kyrre Aalerud wrote: > > > Is this better or wose than the sum method ? > > If I remember rightly (it's late so I can't think > clearly enough to check!) if the last byte transmitted > is the checksum, the result of a rolling XOR of > everything before, when you XOR it you will end up with > zero if all was sent correctly. So the receiver just > XORs everything it receives and the result should be > zero - easy! Right. The question is how effective? Just conceptually XOR has a major problem: 1) paired bit errors in the same column can result in an erroneous packet with a valued checksum. Consider the three byte stream ....1 ....1 ....1 When the LSB's are XORed the resumt is a 1. But when added the result is three. Adding affects other columns in the checksum whereas XOR can only impact the column it's in. Consider if there were two bit errors: ....0 ....1 ....0 The XORed result is still 1. Whereas the summed result is also 1, and would indicate an error. > > > Maby I can do both ? > > No need - it doesn't improve anything. Agreed. However it's best to pick the added result. Since adding and XORing cost exactly the same, why not use the sum? BAJ -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics