To provide a memory device with a function to perform an operation and a method
of performing an operation and storage which can save space and cost and which
can start, immediately after the power source is recovered, the processing which
was being performed at the time of power failure. A memory cell MC can store two
independent data sets; DRAM data (volatile data) and FeRAM data (non-volatile data).
Thus, the number of memory cells can be reduced to a half. Also, the DRAM data
to be used in the next operation of the two data sets which have been read out
for the previous operation are temporarily held in a hold circuit 21 of
an operation unit OU and then written back into the memory cell MC in a non-volatile
manner as new FeRAM data for preparation of the next operation. Thus, even when
the power source is shut down by an unexpected trouble, the data necessary for
the next operation are not lost.