HOME

TheInfoList



OR:

In telecommunication, a longitudinal redundancy check (LRC), or horizontal redundancy check, is a form of
redundancy check In information theory and coding theory with applications in computer science and telecommunication, error detection and correction (EDAC) or error control are techniques that enable reliable delivery of digital data over unreliable commu ...
that is applied independently to each of a parallel group of bit streams. The data must be divided into
transmission block In telecommunication, the term transmission block has the following meanings: #A group of characters or bits transmitted as a block, unit, message, or packet. It usually includes additional encoded characters for error detection and correction. #In ...
s, to which the additional check data is added. The term usually applies to a single
parity bit A parity bit, or check bit, is a bit added to a string of binary code. Parity bits are a simple form of error detecting code. Parity bits are generally applied to the smallest units of a communication protocol, typically 8-bit octets (bytes) ...
per bit stream, calculated independently of all the other bit streams ( BIP-8), : "Reliable link layer protocols". although it could also be used to refer to a larger
Hamming code In computer science and telecommunication, Hamming codes are a family of linear error-correcting codes. Hamming codes can detect one-bit and two-bit errors, or correct one-bit errors without detection of uncorrected errors. By contrast, the sim ...
. This "extra" LRC word at the end of a block of data is very similar to
checksum A checksum is a small-sized block of data derived from another block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage. By themselves, checksums are often used to verify data ...
and
cyclic redundancy check A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to digital data. Blocks of data entering these systems get a short ''check value'' attached, based on t ...
(CRC).


Optimal rectangular code

While simple longitudinal parity can only detect errors, it can be combined with additional error-control coding, such as a transverse redundancy check (TRC), to correct errors. The transverse redundancy check is stored on a dedicated "parity track". Whenever any single-bit error occurs in a transmission block of data, such two-dimensional parity checking, or "two-coordinate parity checking", enables the receiver to use the TRC to detect which byte the error occurred in, and the LRC to detect exactly which track the error occurred in, to discover exactly which bit is in error, and then correct that bit by flipping it.


Pseudocode

International standard ISO 1155 states that a longitudinal redundancy check for a sequence of bytes may be computed in
software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consists ...
by the following algorithm: ''lrc'' := 0 for each byte ''b'' in the buffer do ''lrc'' := (''lrc'' + ''b'') and 0xFF ''lrc'' := (((''lrc'' XOR 0xFF) + 1) and 0xFF) which can be expressed as "the 8-bit two's-complement value of the sum of all bytes modulo 28" (x AND 0xFF is equivalent to x MOD 28).


Other Forms

Many protocols use an XOR-based longitudinal redundancy check byte (often called block check character or BCC), including the serial line interface protocol (SLIP, not to be confused with the later and well-known Serial Line Internet Protocol), . "A Thinwire Protocol for connecting personal computers to the INTERNET". Appendix D: "Serial Line Interface Protocol (SLIP)". the
IEC 62056 IEC 62056 is a set of standards for electricity metering data exchange by International Electrotechnical Commission. The IEC 62056 standards are the international standard versions of the DLMS/COSEM specification. DLMS or Device Langu ...
-21 standard for electrical-meter reading, smart cards as defined in
ISO/IEC 7816 ISO/IEC 7816 is an international standard related to electronic identification cards with contacts, especially smart cards, and more recently, contactless mobile devices, managed jointly by the International Organization for Standardization (ISO) ...
, and the
ACCESS.bus ACCESS.bus, or A.b for short, is a peripheral-interconnect computer bus developed by Philips and DEC in the early 1990s, based on Philips' I²C system. It is similar in purpose to USB, in that it allows low-speed devices to be added or removed fro ...
protocol. An 8-bit LRC such as this is equivalent to a
cyclic redundancy check A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to digital data. Blocks of data entering these systems get a short ''check value'' attached, based on t ...
using the polynomial ''x''8 + 1, but the independence of the bit streams is less clear when looked at in that way.


References

* {{ISO standards Error detection and correction Articles with example pseudocode ISO standards