A Reed-Solomon code is a -ary BCH code of length . The generator polynomial for a -error correcting code is . The decoder uses the Berlkamp-Massey algorithm for decoding as described in: S. B. Wicker, "Error Control Systems for digital communication and storage," Prentice Hall. The following example simulates a binary (i.e. ) Reed-Solomon code with parameters and :