We present a simple nanodevice that can operate in two modes: i) three-state memory and ii) reading device. The nanodevice is fabricated with an array of ordered triangular-shaped nanomagnets embedded in a superconducting thin film. The input signal is ac current and the output signal is dc voltage. Vortex ratchet effect in combination with out of plane magnetic anisotropy of the nanomagnets is the background physics which governs the nanodevice performance.