It is shown that soft decision maximum likelihood decoding of any

linear block code over

can be accomplished using the Viterbi algorithm applied to a trellis with no more than

states. For cyclic codes, the trellis is periodic. When this technique is applied to the decoding of product codes, the number of states in the trellis can be much fewer than

. For a binary

single parity check code, the Viterbi algorithm is equivalent to the Wagner decoding algorithm.