A method of encoding an input data into a codeword that satisfy a k constraint includes partitioning the input data into a plurality of data blocks comprising a first data block and a plurality of remaining data blocks; performing a first analysis of the plurality of data blocks for modifying each of the plurality of remaining data blocks that satisfy a first predetermined criterion; performing a second analysis of the plurality of data blocks after the first analysis for modifying each of the plurality of data blocks that satisfy a second predetermined criterion; and converting each bit of the plurality of data blocks after the second analysis to produce the codeword in Non-Return-to-Zero (NRZ) format with the k constraint. There is also provided a method of decoding the codeword with satisfies the k constraint into an output data, and the corresponding encoder and decoder.
展开▼