A volatile memory stores data related to application program. Data that is
the same as the data in the volatile memory is also stored in a
nonvolatile memory. When writing the data from the volatile memory to the
nonvolatile memory, it is confirmed that the data has no error. A parity
bit for each data block in the volatile memory is stored in the volatile
memory. It is then decided whether or not there is an error in the data
stored in the volatile memory based on the parity bits. If an error is
detected in the data stored in the volatile memory then the data is
recovered or corrected by using the data in the nonvolatile memory. Data
can be thus recovered speedily and reliably.