Patent ID: 8589619

Claim:
A data writing method for a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical blocks, each of the physical blocks has a plurality of physical pages, a portion of the physical blocks are mapped to a plurality of logical blocks, and each of the logical blocks has a plurality of logical pages, the data writing method comprising: configuring a trim table, wherein the trim table has a plurality of bits, and the bits are respectively corresponding to the logical pages; receiving data, wherein the data has a plurality of data bits and belongs to one of the logical pages; determining whether each of the data bits is a specific value; not writing the data into the physical pages and setting one of the bits corresponding to the logical page that the data belongs to as a tag value in the trim table if each of the data bits is the specific value; writing the data into one of the physical pages if any one of the data bits is not the specific value; and when a trim command is received, setting at least one of the bits corresponding to at least one of the logical pages that is corresponding to the trim command as the tag value in the trim table.