Patent ID: 8214579

Claim:
A memory controller for controlling access to flash memories, in which data writing and data reading are performed in physical pages and data erasing is performed in physical blocks, comprising: a virtual block forming unit which forms virtual blocks each composed of a plurality of physical blocks each included in each of the flash memories; a first virtual block management unit which maintains identification information to identify physical blocks composing each of the virtual blocks formed by the virtual block forming unit; a relationship management unit which manages a relationship between logical blocks each composed of a plurality of logical sectors each assigned a logical address and the virtual blocks; a second virtual block management unit which forbids use of a virtual block to which at least one defective physical block newly generated belongs; a defective virtual block management unit which manages a virtual block of which use is forbidden by the second virtual block management unit as a defective virtual block; and a third virtual block management unit which generates a virtual block to which no defective physical block belongs by replacing a defective physical block belonging to one defective virtual block with a normal physical block belonging to another defective virtual block among defective virtual blocks and allows use of the virtual block generated, wherein the virtual block forming unit preferentially forms the virtual blocks each comprised of only physical blocks of which physical block addresses are the same, wherein the first virtual block management unit holds only information for specifying physical blocks that configure a virtual block other than the virtual blocks each comprised of only physical blocks of which physical block addresses are the same, wherein the defective virtual block management unit holds information for specifying the defective virtual blocks and normal blocks which each belong to any of the defective virtual blocks, and holds sums each of which is the number of normal physical blocks belonging to the defective virtual blocks for each flash memory, wherein the third virtual block management unit generates the virtual block when all the sums for each flash memory equal or exceed a predetermined threshold based on the information for specifying the normal block that the defective virtual block management unit holds, and wherein the defective virtual block management unit discards information as to the virtual block generated by the third virtual block management unit.