Longitudinal Redundancy Check Data Link Error Detection / Correction Method

A simple parity value calculated on columns of data rather than rows, were each successive set of data bit is XOR'd with the prior set to form a new set of parity values.

LRC = LRC ^ dataByte;

or

movf    dataByte,w
xorwf   LRC

LRC's by themselves, can only detect errors, but have a slight advantage over standard parity bits in that they are less sensitive to burst errors in serially transmitted data. For example with a drop-out burst error of 3 bits starting after the first bit of the first byte:

10110001  even parity = 0	10000001  even parity = 0 (still)
11011011  even parity = 1	11011011  even parity = 1
--------			--------
01101010 = LRC			01011010 = LRC

Note that if the data were being transmitted in parallel, the advantage reverts to simple parity, as the LRC becomes sensitive to burst errors.

An 8-bit LRC such as this is equivalent to a CRC using the polynomial x8+1