Characterization and optimization of charge-trap based nand flash memories by