FPGA-based investigation of coding and detection for non-volatile memories