The device comprises two magnetoresistive elements (10, 20) placed relative to each other in magnetostatic interaction in such a manner that a magnetic flux passing between these elements (10, 20) closes through soft ferromagnetic layers (26, 27) of said elements (10, 20). A write device (15) is associated with the elements (10, 20) to control the magnetization of each soft layer (26, 27). A read conductor line (11, 12, 13, 14) is associated with each magnetoresistive element (10, 20) to detect the magnetic state of the soft layer (26, 27) by measuring the corresponding magnetoresistance. The soft ferromagnetic layers (26, 27) of the elements (10, 20) remain oriented substantially in antiparallel relative to each other, while the hard ferromagnetic layers (24) of said elements (10, 20) are oriented substantially in parallel.