Patent ID: 8824199

Claim:
A magnetic random access memory comprising: magnetoresistive elements capable of storing one of a first resistance value and a second resistance value that is different from the first resistance value; a write circuit to write s-bit (s is a natural number equal to 2 or greater) write data to the magnetoresistive elements, the write data supplied from a buffer memory; a read circuit to read s-bit read data from the magnetoresistive elements; and a control circuit that is configured to: select one of first and second modes based on a mode selection signal; control the read circuit so that the read circuit reads the read data and control the write circuit so that the write circuit writes one of the write data and inversion data of the write data to the magnetoresistive elements based on the read data and the write data, if free space of the buffer memory is equal to a fixed value or more when the second mode is selected; and control the write circuit so that the write circuit writes one of the write data and the inversion data of the write data to the magnetoresistive elements, the one of the write data and the inversion data corresponding to a relation that a number of bits setting the magnetoresistive elements to the first resistance value is larger than a number of bits setting the magnetoresistive elements to the second resistance value, if the free space of the buffer memory is less than the fixed value when the second mode is selected.