Patent ID: 8539310

Claim:
A memory device comprising: an external interface unit which interfaces with a higher-level device; a memory which stores data; a memory controlling unit which controls write and read of data with respect to the memory; an ECC circuit which generates an error detecting and correcting code and adds the code to data when the data is to be written to the memory and, when the data is read from the memory, corrects the data based on the error detecting and correcting code if an error is detected; a refresh request generating unit which issues a refresh request at every refresh cycle and refreshes the memory; a patrol controlling unit which periodically reads the data of the memory, checks and counts normality occurrences of the data by the ECC circuit, and, if any error is detected, writes back corrected data to the memory; a cycle adjusting unit which, shortens the refresh cycle of the refresh request generating unit and causes the patrol controlling unit to patrol an error-occurred address in addition to a periodic patrol operation which is normally carried out, when the error of the data is detected by the ECC circuit; a refresh cycle shortening unit which, instructs the refresh request generating unit to shorten the refresh cycle when an error detection notification from the ECC circuit is received; an error patrol request issuing unit which retains the error-occurred address received from the ECC circuit and issues an error patrol request for patrolling the error-occurred address at a cycle slightly longer than the changed refresh cycle to the patrol controlling unit; an error patrol requesting unit which stops issuing of the error patrol request when an error detection notification of the error-occurred address is not received from the ECC circuit for more than a predetermined period of time after the error patrol request is issued and when a normality count reaches a threshold; and a refresh cycle shortening canceling unit which cancels the shortening of the refresh cycle and returns the cycle to the original cycle when an error detection notification is not received from the ECC circuit for more than a predetermined period of time after issuing of the error patrol request is stopped and when a normality count reaches a threshold, when the patrol controlling unit receives the error patrol request from the cycle adjusting unit, the patrol controlling unit carries out a patrol of the error-occurred address in addition to the periodical patrol operation which is normally carried out.