Analog error correction circuit (100) comprising: one or more non-volatile resistive
analog memory crossbar arrays comprising: a first
crossbar array portion including a circuit (102) programmed with values of a multiplication matrix (A'); a second
crossbar array part for correcting calculation errors, which includes a circuit (104) programmed with values of an
encoder matrix (A''), the values of the
encoder matrix (A'') depending on the values of the multiplication matrix (A'); and a third
crossbar array part for detecting calculation errors, which contains a circuit (114) programmed with values of a decoder matrix, wherein the first crossbar array part and the second crossbar array part are configured to output a first output (c') and a second output (c''), respectively, representing a result (c) of a
matrix multiplication operation with an input vector (u), wherein the first and second outputs (c', c'') are provided as inputs for the third crossbar array part, and wherein a third output of the third crossbar array part indicates whether a
calculation error is present in the first output (c') of the first crossbar array part, wherein the third output of the third crossbar array part represents a measured syndrome vector (212), and wherein the measured syndrome vector (212) comprises two off-threshold values indicating the presence of the
calculation error in the first output (c') of the first crossbar array part, wherein the measured syndrome vector (212) is thresholded to obtain a thresholded syndrome vector (302), and wherein the thresholded syndrome vector (302) is fed back to the third crossbar array part to determine the location of the
calculation error.