A method for recoding an input sequence of words, including assigning a respective bit-grade such as a reliability valve depending on sampling phases to at least one of the bits in a first word in the input sequence, deriving candidate words (161, W1, W2) from the first word in response to the respective bit-grade, and inserting one of the candidate words into each of a plurality of candidate sequences (T1, T2, T3), so that each of the candidate sequences contains one of the candidate words. The method further includes adding subsequent words (Wx(t), Wx(t−1), . . . ) to the candidate sequences, the subsequent words consisting of a further candidate word derived from a further word in the input sequence, computing respective sequence parameters for the candidate sequences, based on a relation between the candidate words and the subsequent words in the candidate sequences involving the digital sum variation, selecting one of die candidate sequences (T1) in response to the sequence parameters, and outputting one of the candidate words contained in the selected candidate sequence. For gigabit ethernet using a 8b/10b coding scheme.