in the description of Reed-Solomon Decoder v9.0 p 20

ERR_CNT Element

The ERR_CNT element gives the number of errors, erasures, and punctures that were corrected. The width of the element depends on the input parameters n and k. The width is equal to the number of binary bits required to represent (n-k). If n-k = 16, for example, the ERR_CNT element is five bits wide

Could someone explain me the example. 'If n-k = 16, for example, the ERR_CNT element is five bits wide'.

I thought it will be 8=(n-k)/2

EDIT 1: In the example n-k =16, then the number of errors ( error correction capability) is (n-k)/2 or I can compute it as 2*e+E<=(n-k), where e - errors, E- erasures

  • 1
    $\begingroup$ I don't understand where your 8(n-k)/2 comes from? Could you explain why you think that would be the case? $\endgroup$ Nov 27, 2020 at 9:11
  • $\begingroup$ @MarcusMüller i have edited and added some information $\endgroup$ Nov 27, 2020 at 10:00
  • $\begingroup$ By the way, you linked to the encoder, not the decoder documentation. $\endgroup$ Nov 27, 2020 at 11:08
  • $\begingroup$ @MarcusMüller fixed $\endgroup$ Nov 27, 2020 at 13:11
  • $\begingroup$ I doubt very much that the Reed-Solomon decoder can fix punctures (which are generally defined as non-transmission of selected parity check symbols resulting in a received codeword of length $<n$), and it is worth noting that there is no rule that requires the number of erasures to be no more than $n-k$; the demodulator may well decide that more symbols than $n-k$ symbols are best sent to the decoder as erasures. So, ERR_CNT most likely contains the sum of the number of errors and number of erasures after a successful decoding (which, with high probability, is a correct decoding). $\endgroup$ Nov 28, 2020 at 16:04

1 Answer 1


$\left\lfloor\frac{n-k}2\right\rfloor$ is the maximum number of bit errors that we can guarantee a code can correct for a binary channel.

But that doesn't mean a code can't sometimes correct more! (In general: not all code words have a distance that's equal to the code's minimum distance. It is the case for minimum distance separable codes, like RS codes are, though.)


RS codes are also used in applications where erasures, not bit flips, happen. You'll find the decoder documentation contains a section on erasure decoding.

You'll also find that a RS code can correct up to $n-k$ erasures – and my guess is that they made the count of that and the count of corrected errors the same width for design consistency reasons, and maybe to make different decoder IP interchangeable.

Note that giving a unsigned number more bits than it needs has no functional or FPGA utilization downside in IP cores: if whatever takes the output uses less bits than it has, the synthesizer will optimize away all calculations resulting in the bits that weren't used.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.