Implementation of a Flexible LDPC Decoder