Reed-Solomon II IP Core User Guide

ID 683144
Date 11/17/2015
Public

3.1.2. Reed-Solomon II Decoder

When the decoder receives the encoded codeword, it uses the check symbols to detect errors and correct them.
Figure 7. Codeword Decoding

The received encoded codeword may differ from the original codeword due to the noise in the channel. The decoder detects errors using several polynomials to locate the error location and the error value. When the decoder obtains the error location and value, the decoder corrects the errors in a codeword, and sends the codeword to the output. As the number of errors increases, the decoder gets to a stage where it can no longer correct but only detect errors, at which point the decoder asserts the out_error signal.

Table 5.  Decoder Detection and Correction Lists how the decoder corrects and detects errors (e) depending on the number of check symbols (R).
Number of Errors Description
e R /2 Decoder detects and corrects errors.
R /2 < e Decoder asserts error signal and decoding fails. The probability that the decoder might not assert the error signal is less than 1/t.
For small numbers of check symbols, out_error is not always reliable. RS codewords have at least d different symbols: d = R + 1. A received packet containing e errors can be either the transmitted codeword t1 with e errors, or another valid codeword t2 with de errors (if t2 exists). When e> R/2, the received packet looks more like t2 than t1 (because de < e) so, the decoder outputs t2 and does not assert out_error. The probability that t2 exists is inferior or equal to the inverse of factorial of R/2. It decreases exponentially as R increases, but is nonetheless significant for small numbers of check symbols.
Figure 8. Decoder Timing—One Channelshows the timing diagram of the RS II decoder with one channel.

The codeword starts when you assert the in_valid signal and the in_startofpacket signal.The decoder accepts the data at in_data as valid data. The codeword ends when you assert the in_endofpacket signal. For a 1-channel codeword, assert the in_startofpacket and in_endofpacket signals for one clock cycle. When the decoder deasserts the in_ready signal, the decoder cannot process any more data until it asserts the in_ready signal again.

At the output, the operation is identical. When the decoder asserts the out_valid signal and the out_startofpacket signal, the decoder provides valid data on out_data. The decoder asserts the out_startofpacket signal and the out_endofpacket signal to indicate the start and end of a codeword. The decoder automatically detects and corrects errors in a codeword and asserts the out_error signal when it encounters a non-correctable codeword. The decoder outputs the full codeword including the check symbols, which you should remove.

Variable Decoding

Under normal circumstances, the decoder allows variable decoding, so you can change the number of symbols per codeword (N) using sink_eop, but not the number of check symbols while decoding. However, you cannot change the length of the codeword, if you turn on the erasure-supporting option. If you turn on the variable option, you can vary:
  • The number of symbols per codeword (using the numn signal) and the number of check symbols (using the numcheck signal), in real time.
  • Both from their minimum allowable values up to their selected values, even with the erasures-supporting option turned on.