Patent ID: 7653777

Claim:
A portable data storage device operable to write data with reference to a memory address mapping table configured to associate logical address regions with physical address regions, the portable data storage device including: (i) a data interface for transferring data packets into and out of the portable data storage device; (ii) an interface controller; (iii) a master control unit; and (iv) a NAND flash memory unit configured to incorporate the physical address regions; the interface controller being operable to send data received through the data interface to the master control unit; and the master control unit being operable: to recognize a data packet received by the data interface as encoding one of a READ instruction indicating a logical address and a WRITE instruction indicating the logical address and data to be written; upon receiving the READ instruction, to access the memory address mapping table, to read data from a first physical address of a first physical address region in the NAND flash memory unit, the first physical address corresponding, according to the memory address mapping table, to the logical address, and to transmit to the data interface one or more data packets including the data read; and upon receiving the WRITE instruction, to determine, as a first determination, whether the first physical address is in an erased state, and when a result of the first determination is affirmative, to write the data to be written to the first physical address, and when the result of the first determination is negative: (a) to modify the memory address mapping table in accordance with a block queue listing a plurality of queuing physical address regions, the block queue comprising a pointer to indicate a location of a second physical address region at a head of the block queue, (b) to locate the second physical address region in accordance with the pointer to thereby associate the second physical address region with the logical address region containing the logical address, (c) to write the data to be written to a physical address in the second physical address region, and (d) to copy any data stored in other portions of the first physical address region, originally associated with the logical address region containing the logical address, to corresponding locations of the second physical address region, (e) to write the location of that first physical address region into the location to which the pointer points, and (f) to move the pointer in a round-robin manner to indicate a location of a next one of the plurality of queuing physical address regions in the block queue so that the location of the first physical address is places, following said modification of the memory address mapping table, at a rear of the block queue.