We extend the coding technique for the 1-D channel, due to Wolf and Ungerboeck, to the case of the (1-D)(1+D)/sup n/ channel. The technique employs a convolutional encoder, a precoder, and the channel in cascade. A computer-aided search for channel codes with large minimum free squared Euclidean distance, d/sub free//sup 2/, is introduced. The search is limited to a class of convolutional encoders for which an encoder with constraint length /spl nu/ generates a decoder trellis with 2/sup /spl nu// states only, as opposed to 2/sup /spl nu/+n+1/ states obtained when a general convolutional encoder is used. These channel codes are said to be totally trellis-matched (TTM) to the (1-D)(1+D)/sup n/ channel. A limitation on the maximum zero-run length, L/sub MAX/ is attained by choosing a nontrivial coset of the convolutional code. A class of coset representatives from which the resulting run-length-limited channel codes are TTM is determined. While minimal encoders generate channel codes containing no flawed codewords, it is shown that some nonminimal encoders do the same while achieving larger dg/sub free//sup 2/. Both types of encoders are considered in the search. Many new channel codes for the (1-D)(1+D)/sup 2/ and the (1-D)(1+D)/sup 3/ channels, with diverse rates and decoding complexities, are tabulated. The codes have relatively low decoding complexity for rates up to 0.8. Two of the new channel codes are compared to a matched spectral null (MSN) code. With the same decoding complexity and code rate, one of these two new channel codes has a smaller d/sub free//sup 2/ and larger L/sub MAX/ than the MSN code. However, with slightly higher decoding complexity, the second new channel code outperforms the MSN code.