3. Error Checking
3a. All messages sent over the network will be error checked initally so as to help isolate software and hardware bugs.
3b. A checksum will be associated with each message, which is order dependent.
3b1. The following algorithm is one which might be used:
3b1a. A checksum of length 1 may be formed by adding successive fields in the string to be checked serially, and adding the carry bit into the lowest bit position of the sum.
+--------------+
| |
+---FIELD 1----+
ADD +--------------+
| |
+----FIELD 2---+
+-+--------------+
| | |
+-+--------------+
\
\ +--+
ADD CARRY---> | |
+--+
+--------------+
| |
+----RESULT----+
3b1a1. This process is known as folding.
3b1a2. Several fields may be added and folded in parallel, if they are folded appropiately after the addition.
+---------+---------+---------+---------+
| FIELD 4 | FIELD 3 | FIELD 2 | FIELD 1 |
+---------+---------+---------+---------+
+---------+---------+---------+---------+
| FIELD 8 | FIELD 7 | FIELD 6 | FIELD 5 |
+---------+---------+---------+---------+
ADD
+-+---------+---------+---------+---------+
| | | | | |
+-+---------+---------+---------+---------+
| | | | |
| | | | v
| | | | +---------+
| | | | | |
| | | | +---------+
| | | |
| | | \ +---------+
| | | `-> | |
| | | +---------+
| | |
| | \ +---------+
| | `-----------> | |
| | +---------+
| |
| \ +---------+
| `--------------------->| |
| +---------+
|
\ +---+
`-----CARRY------------------------>| |
+---+
ADD
+---------+---------+
| | |
+--CARRY--+---------+
|
\ +-----+
ADD `-----> | |
+-----+
+---------+
| |
+-RESULT--+