1. Field of the Invention
The present invention relates to a method for managing memory blocks in a flash memory and, more particularly, to a managing method that utilizes the number of the good blocks in the flash memory to adjust the flash memory capacity so that the flash memory can be used with lower capacity.
2. Description of the Related Art
The evolution of non-volatile memory has been very remarkable, from a series of ROM (read only memory), such as Mask-ROM, OTP ROM (one time programmable read only memory), EPROM (erasable and programmable read only memory) and EEPROM (electrically erasable and programmable read only memory), to a powerful information storage device called flash memory. Among them, flash memory has been the focus of spotlight because it has all the credits that a common non-volatile memory has and goes beyond that; that is, flash memory has faster reading speed and lower power consumption for information storage than other non-volatile memories. For this reason, flash memory has been playing a significant role in the semiconductor industry. In recent years, some manufacturers even combine controller chip to flash memory and produce new storage devices such as flash disks and memory cards. Moreover, the good qualities that a flash memory owns, including low power consumption, non-volatility, shock resistance, high storage density, and compact size that can be substantially reduced without any assistance of motor or magnetic head, are very suitable to be employed in the compact electronic products such as digital cameras, MP3 mobile mini disks, and personal digital assistant (PDA).
So far, the flash memory has been very successful in developing its high capacity, and now one single flash memory can be as powerful as having 512 mega bytes, while the number of blocks can reach 4096 blocks. However, because the SRAM (static random access memory) on a controller chip is limited, the memory blocks in a flash memory is managed by block segmentation, while the overall management is achieved by a technique called swapping. On the other hand, selection of segments for use is depending on an even allocation method. For example, if a flash memory contains 4096 blocks, then after all the blocks have been divided into four segments for management, each segment may contain 1024 blocks. Theoretically, this method may sound easy for management, but in case that a few blocks has already gone bad, and that all the bad blocks are all aggregated in one segment, the situation may turn into that no block is available for block replacement in that segment. In such case, when data is to be written into the segment, the flash memory may refuse data accessing because there is no replaceable block available for writing. As a result, the user of the flash memory may need to buy another storage device due to malfunction caused by the flash memory, which in turn may increase the user's cost for consuming another storage device.