A systematic method and apparatus for constructing a run length limited code in which the minimum number of continuous bits of the same binary value is constrained to d and the maximum number thereof is constrained to k.
In converting m-bit data words to n-bit code words (n>m) to construct the run length limited code, selection means for n-bit code words usable to meet the d, k-constraint and a concatenation rule of the code words selected by the selection means are introduced.
The selection means divides each of 2.sup.n n-bit bit sequences into a leading block L having l continuous bits of the same binary value, an end block R having .gamma. continuous bits of the same binary value and an intermediate block B having b(=n-l-.gamma.) bits between the blocks L and R.
Only those n-bit bit sequences in which the blocks B thereof completely meet the d, k-constraint and the blocks L and R thereof meet conditions uniquely defined for given d and k are used as the code words. Consequently, a systematic method for constructing the run length limited code is provided.