Journal Pre-proof Second-order associative memory circuit hardware-implemented by the evolution from battery-like capacitance to resistive switching memory