A computer-readable medium having stored thereon a plurality of instructions which, when executed by a processor of a computer system, cause the processor to perform a method for generating a block-based low density parity check (LDPC) matrix for use in data encoding and data decoding, the method comprising:
- vertically dividing an area of the LDPC matrix based on a length of a first parity bit vector and a length of a second parity bit vector;
- generating a block-based matrix such that a double diagonal matrix is arranged in an upper portion of an area corresponding to the second parity bit vector among areas into which the LDPC matrix is vertically divided;
- horizontally dividing the area for the LDPC matrix based on the position of the double diagonal matrix;
- and
- generating block-based matrices in areas into which the LDPC matrix is horizontally and vertically divided, to satisfy a condition that column weights (Wc) are uniform, such that data is encoded or decoded using the LDPC matrix with the block-based matrices.