Neil Gandler wrote: > Correct me if I wrong but, this is how I view this error scheme. If > I send a 32 bit word, and then an identical 32 bit word. The odds > of those words being corrupted in the EXACT same pattern are > extroadinarily low. Neil: I believe that I already corrected your assumption in my previous message. Here's the math so you can follow along: If there's an error rate (call it "p") for each bit, the odds of transmitting 64 bits with zero errors is (1-p)**64. For a hypothetical (high) error rate of 1%, this works out to only 52%, which means that NEARLY HALF OF ALL MESSAGES WILL BE RECEIVED WITH ERRORS. Now... To find the number of errors that your scheme will detect, you need (as you know) to find the probability of two errors occurring with a separation of exactly 32 bits. To make this easy, you can treat your transmission as a series of 32 2-bit packets, each of which contains either "00" or "11". This is exactly equivalent to your scheme, and it reduces the problem to discovering the odds of transmitting 32 two-bit packets with fewer than two errors in each packet. Ok... The odds of transmitting a two-bit message and making at most one error in transmission is: (1-p)**2 + 2p(1-p) = 0.99**2 + 2*0.01*0.99 = 0.9999 Since you're transmitting 32 of these packets, the odds of receiving the entire message with no undetectable errors is: 0.9999**32 = 0.9968 This means, as I said in my previous message, that a little more than 3 messages in every 1000 will slip through with undetectable errors. If this sort of error rate is ok in your application, more power to you. > If the two words do not match, then the packet is discarded and > the PIC simply waits for the next one. There is no reason to > request a resend. While this substantially increases the amount of > packets that may be discarded .... Assuming that your error rate is as high as 1% per bit, you'll be discarding nearly half of all received messages. > .... it almost perfectly assures that the data is not corrupt, > which is very important in my application. If correct transmission is very important, take my advice and use a Hamming code. > I don't have any numerical data to substantiate this, but I am > basically approximating probability. Again, please correct me if I > wrong. Thanks for the advice. The first thing you need to do is quantify your communication channel's ACTUAL error rate... Without that information, none of the math can help you decide whether your solution is adequate. -Andy Andrew Warren - fastfwd@ix.netcom.com Fast Forward Engineering, Vista, California http://www.geocities.com/SiliconValley/2499