Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/31/00 16:12
Read: times


 
#6092 - RE: CHECKSUM
Yehuda,
You must first have a protocol (definition) of your record. This would generally include framing information such as a header to define the beginning of a record and a delimiter or end of record marker.
Several protocols already exist for you to use or you can create your own if the system you design is under your control. (Yours to do with as you like).

A checksum is a simple calculation to determine if an error exists in your data. It is far from a great way to test for errors but is ok to use as a first pass. One way to implement the checksum is to add up (sum) all the bytes in the data portion of your record and make the checksum twos compliment. In other words if you sum all the data bytes includng the checksum the result would be zero. If the result is non-zero then an error occurred.
To determine the length of your record in the c language is fundamental. There are several ways to do it and I will leave you with this:
You know by the protocol what the start and end (framing) of the record is so to count bytes think of using a loop to determine the number of bytes between start and end.
You should have had that in any programming language class you might have had.
Allen

List of 3 messages in thread
TopicAuthorDate
CHECKSUM            01/01/70 00:00      
RE: CHECKSUM            01/01/70 00:00      
RE: CHECKSUM            01/01/70 00:00      

Back to Subject List