A method for determining errors in a memory, in which useful data bits u=u1, . . . , uk are stored as a code word v=v1, . . . , vn of a code having the length n with k information bits and with the code distance d≧2, wherein there are q subsets useful data bits u=u1, . . . , uk are stored as a code word v=v1, . . . , vn of a code having the length n with k information bits with the code distance d≧2, wherein there are q subsets M1={v1,1, . . . , v1,n1}, . . . , Mq={vq,1, . . . , vq,nq} where q≧1 and ni≦n for i=1, . . . , q of the set M={v1, . . . , vn} of the n components of the code word v=v1, . . . , vn, wherein M1∪M2∪ . . . , ∪Mk=M holds true and such that if v=v1, . . . , vn is a code word of the code, for i=1, . . . , q it is also the case that vMi=v1i, . . . , vni is a code word of the code and at least one of the values n1, . . . , nq is less than n, wherein vMi is formed from v such that the components of v which are an element of Mi are inverted and the components of v which are not an element of Mi are not inverted, wherein the method comprises:
- in a first step, storing a code word v1=v11, . . . , vn1 of the code at an address a in the memory,
- in a second step, reading out a word v2=v12, . . . , vn2 stored at the address a in the memory, wherein this second step is carried out after the first step, and wherein, between the first step and the second step, no further word was written to the memory at the address a,
- in a third step, checking whether v2 is a code word of the code, wherein, if v2 is not a code word of the code, an error is indicated, and wherein, if v2 is a code word of the code, no error is indicated,
- in a fourth step, storing a code word v3=(v2)M1 at the address a in the memory, wherein v3=(v2)M1 is determined from v2 such that the components vi2 where i∈{1, . . . , n} of v2 which belong to M1 are inverted and all the components which do not belong to M1 are not inverted,
- in a fifth step, reading out a word v4 stored at the address a, wherein the fifth step is carried out after the fourth step and, between the fourth step and the fifth step, no further word is written to the memory at the address a, and
- in a sixth step, checking whether v4 is a code word of the code, wherein, if v4 is not a code word of the code, an error is indicated, and wherein, if v4 is a code word of the code, no error is indicated.