Coding and Algorithms for Memories Lecture 8 1
Flash Memory Cell Can only add water (charge) 2
The Leakage Problem Error! 3
The Overshooting Problem Need to erase the whole block 4
Possible Solution – Iterative Programming Slow…
Relative Vs. Absolute Values 01 Less errors More retention Jiang, Mateescu, Schwartz, Bruck, “Rank modulation for Flash Memories”,
The New Paradigm Rank Modulation Absolute values Relative values Single cell Multiple cells Physical cell Logical cell 7
Rank Modulation Ordered set of n cells Assume discrete levels Relative levels define a permutation Basic operation: push-to-the-top Overshoot is not a concern Writing is much faster Increased reliability (data retention) 8
New Number Representation System permutation in lexicographical order [Lehmer 1906, Laisant 1888] FACTORADIC decimal a n-1 …a 3 a 2 a 1 = a n-1 ·(n-1)! + … + a 3 ·3! + a 2 ·2! + a 1 ·1! 0 ≤ a i ≤ i
Gray Codes for Rank Modulation Find cycle through n! states by push-to-the-top transitions Transition graph, n=3 n=3 3 cycles The problem: Is it possible to transition between all permutations? 10
Gray Codes for Arbitrary n Recursive construction: – Keep bottom cell fixed – (n-1)! transitions with others ~ (n-1)!
Gray Codes for Arbitrary n
2134 2143 Kendall’s Tau Distance For a permutation an adjacent transposition is the local exchange of two adjacent elements For ,π ∊ S m, d τ ( ,π) is the Kendall’s tau distance between and π = Number of adjacent transpositions to change to be π =2413 and π= d τ ( ,π) = 3 It is called also the bubble-sort distance Lemma: Kendall’s tau distance induces a metric on S n The Kendall’s tau distance is the number of pairs that do not agree in their order 2143 2134
Kendall’s Tau Distance Lemma: Kendall’s tau distance induces a metric on S n The Kendall’s tau distance is the number of pairs that do not agree in their order For a permutation , W τ ( ) = {(i,j) | i -1 (i) } Lemma: d τ ( ,π)= |W τ ( ) W τ (π)| = |W τ ( )\W τ (π)| + |W τ (π)\W τ ( )| d τ ( ,id) = |W τ ( )| The maximum Kendall’s tau distance is n(n-1)/2 The inversion vector of is x =(x (2),…,x (n)) x (i) = # of elements to the right of i and are less then i d τ ( ,id) = |W τ ( )| = Σ 2≤i≤n x (i) 15
Kendall’s Tau Distance The Kendall’s tau ball: B r ( ) = {π|d τ ( ,π) ≤ r} The Kendall’s tau sphere: S r ( ) = {π|d τ ( ,π) = r} They do not depend on the center |B 1 ( )| = n, |S 1 ( )| = n-1 16
How to Construct ECCs for the Kendall’s Tau Distance? Goal: Construct codes with some prescribed min Kendall’s tau dist d 17
ECCs for Kendall’s Tau Distance Goal: Construct codes correcting a single error Assume k or k+1 is prime Encode a permutation in S k to a permutation in S k+2 A code over S k+2 with k! codewords – s=(s 1,…s k ) S k is the information permutation – set the locations of k+1 Z k+1 and k+2 Z k+2 to be loc(k+1) = Σ 1 k (2i-1)s i (mod m) loc(k+2) = Σ 1 k (2i-1) 2 s i (mod m) m=k if k is prime and m=k+1 is k+1 is prime Ex: k=7, s=( ) loc(8) = 1 7+3 6+5 1+7 3+9 2+11 4+13 5 = 3 (mod 7) loc(9) = 1 2 5 = 2 (mod 7) E(s) = ( ) 18
ECCs for Kendall’s Tau Distance A code over S k+2 with k! codewords – s=(s 1,…s k ) S k is the information permutation – set the locations of k+1 Z k+1 and k+2 Z k+2 to be loc(k+1) = Σ 1 k (2i-1)s i (mod m) loc(k+2) = Σ 1 k (2i-1) 2 s i (mod m) m=k if k is prime and m=k+1 is k+1 is prime Ex: k=3, m=3 123 => ; loc(4)=1 1+3 2+5 3=1(mod3), loc(5)=1 1+9 2+25 3=1(mod3) 132 => ; loc(4)=1 1+3 3+5 2=2(mod3), loc(5)=1 1+9 3+25 2=2(mod3) 213 => ; loc(4)=1 2+3 1+5 3=2(mod3), loc(5)=1 2+9 1+25 3=2(mod3) 231 => ; loc(4)=1 2+3 3+5 1=1(mod3), loc(5)=1 2+9 3+25 1=0(mod3) 312 => ; loc(4)=1 3+3 1+5 2=1(mod3), loc(5)=1 3+9 1+25 2=2(mod3) 321 => ; loc(4)=1 3+3 2+5 1=2(mod3), loc(5)=1 3+9 2+25 1=1(mod3) 19
ECCs for Kendall’s Tau Distance A code over S k+2 with k! codewords – s=(s 1,…s k ) S k is the information permutation – set the locations of k+1 Z k+1 and k+2 Z k+2 to be loc(k+1) = Σ 1 k (2i-1)s i (mod m); loc(k+2) = Σ 1 k (2i-1) 2 s i (mod m) Theorem: This code can correct a single Kendall’s tau error. Proof: Enough to show that the Kendall’s tau distance between every two codewords is at least 3 – s=(s 1,…s k ) S k, u=E(s); t=(t 1,…t k ) S k, v=E(t) – If d τ (s,t)≥3 then d τ (u,v)≥3 ✔ – If d τ (s,t)=1, write t=(s 1,…s i+1,s i …s k ), let δ = s i+1 -s i loc s (k+1)-loc t (k+1)=(2i-1)s i +(2i+1)s i+1 –(2i-1)s i+1 -(2i+1)s i =2s i+1 -2s i =2δ(mod k) thus, they are not positioned in the same location. ✔ loc s (k+2)-loc t (k+2)=(2i-1) 2 s i +(2i+1) 2 s i+1 –(2i-1) 2 s i+1 -(2i+1) 2 s i =8is i+1 -8is i =8iδ(mod k) thus, they are not positioned in the same location either ✔. 20
ECCs for Kendall’s Tau Distance Proof (cont): – s=(s 1,…s k ) S k, u=E(s); t=(t 1,…t k ) S k, v=E(t) – If d τ (s,t)=1, write t=(s 1,…s i+1,s i …s k ), let δ = s i+1 -s i loc s (k+1)-loc t (k+1)=(2i-1)s i +(2i+1)s i+1 –(2i-1)s i+1 -(2i+1)s i =2s i+1 -2s i =2δ(mod k) thus, they are not positioned in the same location. ✔ loc s (k+2)-loc t (k+2)=(2i-1) 2 s i +(2i+1) 2 s i+1 –(2i-1) 2 s i+1 -(2i+1) 2 s i =8is i+1 -8is i =8iδ(mod k) thus, they are not positioned in the same location either ✔. – If d τ (s,t)=2, write t=(s 1,…,s i+1,s i,…,s i+1,s i,…,s k ), δ 1 =s i+1 -s i, δ 2 =s j+1 -s j loc s (k+1)-loc t (k+1)=2(δ 1 +δ 2 )(mod k) loc s (k+2)-loc t (k+2)=8iδ 1 +8jδ 2 (mod k) If δ 1 +δ 2 is NOT a multiple of k then k+1 appears in different locations ✔ Otherwise, δ 2 =-δ 1 (mod k) and loc s (k+2)-loc t (k+2)=8(i–j)δ 1 (mod k), so k+2 appears in different locations ✔ – If d τ (s,t)=2, write t=(s 1,…,s i+2,s i,s i+1,…,s k ) loc s (k+1)-loc t (k+1)=(2i-1)s i +(2i+1)s i+1 +(2i+3)s i+2 -(2i-1)s i+2 -(2i+1)s i -(2i+3)s i+1 ) =4s i+2 -2s i+1 -2s i (mod k) loc s (k+2)-loc t (k+2)=8((2i+1)s i+2 -(i+1)s i+1 -is i )(mod k) 21