A method for mapping an input vector to an output vector by means of a matrix circuit which has memory cells and first, second and third lines arranged in a matrix in a plurality of rows and a plurality of columns, one of the first lines (22) being assigned to each row and one of the second and one of the third lines (24, 26) being assigned to each column,
- wherein each memory cell has an adjustable memory state,
- wherein each memory cell is connected to the first line (22) assigned to the row in which the memory cell is located and to the second and third lines (24, 26) assigned to the column in which the memory cell is located,
- wherein each memory cell is arranged to conduct an electric current (I1, I2, I3) from the first to the third line (26) as a function of the memory state and of voltages applied to the first, the second and the third line,
- wherein each memory cell comprises a semiconductor switching element (28) having a control terminal connected to the second line (24) assigned to the column in which the semiconductor switching element is located;
- wherein input voltages (U1, U2, U3) corresponding to components of the input vector are applied to the first lines (110);
- the method comprising for each column:
- applying (120) a ramp voltage (V1, V2, V3) to the second line assigned to the column,
- increasing (130) the level of the ramp voltage over time;
- detecting a total current at the third line assigned to the column;
- determining (150) a time period that has elapsed from a start time of the level increase of the corresponding ramp voltage until a certain current magnitude threshold (Ig) is reached (140) by the magnitude of the total current;
- and
- determining (170) a component of the output vector corresponding to the column based on the elapsed time period (t1, t2, t3).