Chapter 6
LRC / CRC Generation
V
LRC Generation
V
CRC Generation
6.1 LRC Generation
The Longitudinal Redundancy Check (LRC) field is one byte, containing an eight-bit binary value. The LRC value is
calculated
by the transmitting device, which appends the LRC to the message. The receiving device recalculates an LRC
during receipt of the message, and compares the calculated value to the actual value it received in the LRC field. If the two
values
are not equal, an error results.
The LRC is calculated by adding together successive eight-bit bytes in the message, discarding any carries, then two's
complementing the result.
The LRC is an eight-bit field, therefore each new addition of a character that would result in a value
higher than 255 decimal simply rolls over the field's value through zero. Because there is no ninth bit,
the carry is discarded
automatically.
Generating an LRC
Chia sẻ với bạn bè của bạn: