On The Generalization of Error-Correcting WOM

Similar documents
The Regulated and Riemann Integrals

W. We shall do so one by one, starting with I 1, and we shall do it greedily, trying

p-adic Egyptian Fractions

Math 1B, lecture 4: Error bounds for numerical methods

Review of Calculus, cont d

7.2 The Definite Integral

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.

Generalized Fano and non-fano networks

UniversitaireWiskundeCompetitie. Problem 2005/4-A We have k=1. Show that for every q Q satisfying 0 < q < 1, there exists a finite subset K N so that

A recursive construction of efficiently decodable list-disjunct matrices

MORE FUNCTION GRAPHING; OPTIMIZATION. (Last edited October 28, 2013 at 11:09pm.)

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

Infinite Geometric Series

UNIT 1 FUNCTIONS AND THEIR INVERSES Lesson 1.4: Logarithmic Functions as Inverses Instruction

approaches as n becomes larger and larger. Since e > 1, the graph of the natural exponential function is as below

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Theoretical foundations of Gaussian quadrature

Math 8 Winter 2015 Applications of Integration

We will see what is meant by standard form very shortly

Chapter 5 : Continuous Random Variables

Goals: Determine how to calculate the area described by a function. Define the definite integral. Explore the relationship between the definite

19 Optimal behavior: Game theory

Natural examples of rings are the ring of integers, a ring of polynomials in one variable, the ring

ARITHMETIC OPERATIONS. The real numbers have the following properties: a b c ab ac

How to simulate Turing machines by invertible one-dimensional cellular automata

New Expansion and Infinite Series

Continuous Random Variables

APPROXIMATE INTEGRATION

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

The First Fundamental Theorem of Calculus. If f(x) is continuous on [a, b] and F (x) is any antiderivative. f(x) dx = F (b) F (a).

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

Spanning tree congestion of some product graphs

Recitation 3: More Applications of the Derivative

20 MATHEMATICS POLYNOMIALS

Chapter 3 Polynomials

State space systems analysis (continued) Stability. A. Definitions A system is said to be Asymptotically Stable (AS) when it satisfies

Acceptance Sampling by Attributes

Review of basic calculus

Introduction to Group Theory

4 7x =250; 5 3x =500; Read section 3.3, 3.4 Announcements: Bell Ringer: Use your calculator to solve

Is there an easy way to find examples of such triples? Why yes! Just look at an ordinary multiplication table to find them!

Bases for Vector Spaces

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

Scientific notation is a way of expressing really big numbers or really small numbers.

ODE: Existence and Uniqueness of a Solution

Read section 3.3, 3.4 Announcements:

Frobenius numbers of generalized Fibonacci semigroups

Improper Integrals, and Differential Equations

1 Online Learning and Regret Minimization

221B Lecture Notes WKB Method

Math 360: A primitive integral and elementary functions

Riemann Sums and Riemann Integrals

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

Indefinite Integral. Chapter Integration - reverse of differentiation

4.4 Areas, Integrals and Antiderivatives

Chapter 14. Matrix Representations of Linear Transformations

Student Activity 3: Single Factor ANOVA

Week 10: Line Integrals

Math 61CM - Solutions to homework 9

Convert the NFA into DFA

Lecture 1. Functional series. Pointwise and uniform convergence.

( dg. ) 2 dt. + dt. dt j + dh. + dt. r(t) dt. Comparing this equation with the one listed above for the length of see that

We partition C into n small arcs by forming a partition of [a, b] by picking s i as follows: a = s 0 < s 1 < < s n = b.

N 0 completions on partial matrices

Lecture Note 9: Orthogonal Reduction

5.7 Improper Integrals

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

The steps of the hypothesis test

Riemann is the Mann! (But Lebesgue may besgue to differ.)

1 Probability Density Functions

Integral points on the rational curve

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

Riemann Sums and Riemann Integrals

Definition of Continuity: The function f(x) is continuous at x = a if f(a) exists and lim

Section 14.3 Arc Length and Curvature

and that at t = 0 the object is at position 5. Find the position of the object at t = 2.

1.9 C 2 inner variations

Math 270A: Numerical Linear Algebra

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams

1 Sets Functions and Relations Mathematical Induction Equivalence of Sets and Countability The Real Numbers...

Riemann Integrals and the Fundamental Theorem of Calculus

The Properties of Stars

SOLUTIONS FOR ADMISSIONS TEST IN MATHEMATICS, COMPUTER SCIENCE AND JOINT SCHOOLS WEDNESDAY 5 NOVEMBER 2014

A. Limits - L Hopital s Rule ( ) How to find it: Try and find limits by traditional methods (plugging in). If you get 0 0 or!!, apply C.! 1 6 C.

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Math 426: Probability Final Exam Practice

5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.

Lecture 19: Continuous Least Squares Approximation

Definite integral. Mathematics FRDIS MENDELU

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

Let S be a numerical semigroup generated by a generalized arithmetic sequence,

f(x)dx . Show that there 1, 0 < x 1 does not exist a differentiable function g : [ 1, 1] R such that g (x) = f(x) for all

Bernoulli Numbers Jeff Morton

Vyacheslav Telnin. Search for New Numbers.

Administrivia CSE 190: Reinforcement Learning: An Introduction

Transcription:

On The Generliztion of Error-Correcting WOM Codes Anxio (Andrew) Jing Computer Science Dept., Texs A&M University, College Sttion, TX 77843, USA Emil: jing@cs.tmu.edu Abstrct- WOM (Write Once Memory) codes re codes for efficiently storing nd updting dt in memory whose stte trnsition is irreversible. Storge medi tht cn be clssified s WOM includes flsh memories, opticl disks nd punch crds. Error-correcting WOM codes cn correct errors besides its regulr dt updting cpbility. They re incresingly importnt for electronic memories using MLCs (multi-level cells), where the stored dt re prone to errors. In this pper, we study error-correcting WOM codes tht generlize the clssic models. In prticulr, we study codes for jointly storing nd updting multiple vribles - insted of one vrible - in WOMs with multi-level cells. The error-correcting codes we study here re lso nturl extension of the recently proposedfoting codes [7]. We nlyze the performnce of the generlized errorcorrecting WOM codes nd present severl bounds. The number of vlid sttes for code is n importnt mesure of its complexity. We present three optiml codes for storing two binry vribles in n q-ry cells, where n = 1, 2, 3, respectively. We prove tht mong ll the codes with the minimum number of vlid sttes, the three codes mximize the totl number of times the vribles cn be updted. I. INTRODUCTION The Write Once Memory (WOM) ws first introduced by Rivest nd Shmir [10] to model those memories where ech bsic storge element cn trnsit from 0-stte to 1-stte but not vice vers. Erly exmples of WOM include punch crds nd opticl disks. In recent yers, flsh memories, which use floting gtes s storge cells, hve emerged s n importnt fmily of memories tht cn be modelled s WOMs. In flsh memories, every memory cell hs threshold voltge tht is one of q possible vlues: 0,1,.., q -1. The threshold voltge is the stte of the cell. Moving the cell from lower stte to higher stte cn be relized efficiently using either the hot-electron injection mechnism or the Fowler-Nordheim tunneling mechnism. However, moving the cell from higher stte to lower stte is much more expensive, becuse it requires ersing nd re-writing ll the dt in memory block, which typiclly consists of bout 128 kilobytes. The ersure nd rewriting of block re not only very slow, but lso degrde the cells' qulity nd shorten the memory's lifetime. Currently, flsh memory's lifetime is bounded by round 105 progrm-erse cycles. For this reson, the opertion of lowering cell's stte should be delyed s much s possible. When we consider the time period between two block ersure opertions, cell's stte cn only move upwrd in its q sttes. When q > 2, the cell is clled multi-level cell (MLC). The dt in memories often need to be updted, especilly for pplictions such s file systems, progrms, etc. Since WOM's stte trnsition is irreversible, the number of updtes it llows is limited. Mny reserchers hve studied WOM codes, where single vrible is stored in WOM, nd the WOM code ims t mximizing the number of times the vrible cn be rewritten (i.e., updted) [2], [3], [6], [8], [11]. Multiple fmilies of WOM codes, including liner codes [1], [10], tbulr codes [10], codes bsed on projective geometries [9], etc., hve been invented. WOM codes tht cn correct errors hve lso been explored [4], [12]. The cpbility of error correction is especilly importnt for electronic memories using multi-level cells. Using MLC is fundmentl pproch for incresing the dt density. In flsh memories, q-ry cells where q = 4 up to 256 hve been implemented. It, however, brings relibility issues. Vrious resons cn mke the stte of cell be red incorrectly, especilly for djcent sttes. We model the problem we study s follows. The memory consists of n cells, where ech cell hs q sttes: 0, 1,.., q -1. A cell cn chnge from stte i to stte j if nd only if i <j. (0 < i,j q- 1.) k vribles re stored in the memory, where ech vrible tkes its vlue from n lphbet of size 1: {0, 1,..., I- 1}. By defult, initilly, ll the cells re in stte 0, nd ll the vribles hve the vlue 0. Every write chnges the vlue of exctly one vrible. We use t to denote the mximum number of writes llowed by the memory in the worst cse. Specificlly, for ny sequence of writes, the first t of them re gurnteed to be implementble. We use (cl, c2,..., c) - clled the cell stte vector - to denote the sttes of the n cells, where ci e [0, q -1] is the stte of the i-th cell. The vlue of En 1 Ci is clled the weight of the cell stte vector. For ny two cell stte vectors A = (c,c2,,cn) nd B = (c,c,..,c' ), their L1 distnce is defined to be dl(a,b) En = Ici- c'. We use (vl,v2,....,v) - clled the vrible vector- to denote the vlues of the k vribles, where vi C [0,1-1] is the vlue of the i-th vrible. Our error model hs three prmeters: A+, A-, nd E. Here, A+ (resp., A-) is the mximum mgnitude of singlecell error in the upwrd direction (resp., in the downwrd direction), nd E is the mximum totl mgnitude of the errors. (Nturlly, E > A+ > 0 nd E > A- > 0.) Specificlly, let's use (el, e2,..., en) - clled the error vector - to denote the n dditive errors in the n cells. For i = 1,2,,n, it mkes the stte of the i-th cell, ci, to be mistkenly red s 1-4244-1429-6/07/$25.00 2007 IEEE 1391

ci + ei C [0, q -1]. The errors stisfy the following constrints: -ia- < ei <A+ for ll i, nd, 1 e < E. It is generl error model for memories using MLCs. An error-correcting WOM code mps every cell stte vector (whether it contins errors or not) to vrible vector. Tht is the decoding. We ssume tht errors hppen only in the red phse - which re errors cused by fults or noise in the reding circuit - nd therefore, the rel sttes of the cells re lwys correct. So for the writing circuit, the cells' sttes re lwys error-free. (Correcting errors in the rel sttes of the cells using rewriting is nother fscinting topic, which we will study lter.) Given the current (error-free) cell stte vector nd write request, the code chnges the cell stte vector to new one corresponding to the new vrible vector. Tht is the encoding. The error-correcting WOM code should be ble to correct ny error with prmeters A+, A- nd E. Given these constrints, the error-correcting WOM code tht mximizes t - the totl number of writes - is clled optiml. Our objective is to look for optiml error-correcting WOM codes. The model we study generlizes the trditionl WOM codes, becuse here we consider the joint storge, updte nd error correction of multiple vribles insted of just one vrible. Hving multiple vribles (e.g., words) stored in memory is common in nerly ll prctices. By considering the joint coding of multiple vribles, we cn often chieve substntilly better performnce thn seprte coding for ech individul vrible. This motivtion hs led to the study of floting codes - recently proposed in [7], - which generlize trditionl WOM codes by using joint coding of multiple vribles for dt storge nd updte. The error-correcting codes we study here re nturl extension of the floting codes. An exmple of error-correcting WOM codes is given in Fig. l(). The vector inside ech circle is (vlid) cell stte vector, nd the vector beside the circle, which is in the bold font, is the corresponding vrible vector. The two rrows leving circle indicte the next two cell stte vectors given the 2 = k(l -1) possible write requests. For exmple, if the first write chnges the second vrible v2 to 1, nd the second write chnges the first vrible v, to 1, then the vrible vector chnges s (0, 0) -> (0,1) -> (1, 1), nd the cell stte vector chnges s (0, 0) -> (0, 3) -> (3, 3). The code llows t 2 writes, nd cn correct ny error with prmeters A±+ = = E = 1. For exmple, if the true cell stte vector is (cl = 6, C2 = 0) nd the error vector is (ei =-1, e2 = 0), then the cell stte vector will be incorrectly red s (cl = 5, 0). Since there is only one vlid cell stte vector within L1 distnce 1 from (5, 0), which is (ci = 6, c2 = 0), the cell stte vector nd the vrible vector will be correctly decoded s (6, 0) nd (0, 0), respectively. In this pper, we study both code construction nd the performnce nlysis of generl error-correcting WOM codes. We present severl bounds for performnce nlysis. The number of vlid cell stte vectors in WOM code is n importnt mesure of the code's complexity. We present three codes for storing two binry vribles in n q-ry cells, where n 1, 2, 3, respectively. The three codes hve t = [q-1], 4q7 6j nd q- 2 Lq ], respectively, which re provbly optiml mong ll the codes with the minimum number of vlid cell stte vectors. The detils re s follows. II. BOUNDS AND SIMPLE CODE CONSTRUCTIONS Two exmple codes re shown in Fig. l(), (b). In fct, they show two bsic wys to derive error-correcting WOM codes from ordinry WOM codes. Both exmple codes re derived from the ordinry WOM code in Fig. 1(c). The first code (shown in Fig. 1()) is n exmple of the following pproch: given n ordinry WOM code, mp the cell stte i to the cell stte i. (A+ + Ai- + 1). In this wy, ny two vlid sttes for cell re sufficiently fr wy, thus llowing error correction. The second code (shown in Fig. 1(b)) is n exmple of the following pproch: given n ordinry WOM code, mp every cell to 2E + 1 cells nd use the repetition code, which cn correct ny E errors. Since both pproches chnge either q or n, the pproprite ordinry WOM code need to be selected. We will show lter tht when n nd q re sufficiently lrge, these two pproches - especilly the first one - cn ctully build codes quite close to optiml. 6,0 33 0 3 (0,1) () (2,2,2,0,0,0 (,1,1,1,1,1 0,0,2,2,2 (0,1) (b) 2,0 11 0 (1,O) 1 ) 0 (0,1) Fig. 1. () An error-correcting WOM code with k = 2,1 = 2, n = 2, q = 7, t = 2, A+ = A - = E = 1. (b) An error-correcting WOM code with k = 2,1 = 2,n = 6,q = 3,t = 2,A+ A - = E = 1. (c) A nonerror-correcting WOM code with k = 2,1 2, nr 2, q = 3, t = 2. (For non-error-correcting WOM codes, Ai+ = = E 0.) We first present in Theorem 1 necessry nd sufficient condition for WOM code to be n error-correcting code. Both conditions re tight. Note tht vlid cell stte vector is cell stte vector tht cn be truly reched by the memory fter sequence of writes, when there is no error. For exmple, ll the cell stte vectors shown in Fig. 1 re vlid cell stte vectors. Given WOM code, we use dmnin to denote the minimum L1 distnce between two distinct vlid cell stte vectors. Theorem 1: For WOM code to be n error-correcting WOM code, the following condition is sufficient: dmin > 2E+ 1; the following condition is necessry: dmin>a++a -+ 1. Proof: The sufficient condition cn be very esily proved with the stndrd bll pcking rgument. Now let's consider the necessry condition. The proof is by contrdiction. Assume tht dmin < A +A+. We need to show tht for ny two vlid cell stte vectors A {,, 2,..., n}, B = {b, b2,..., bn} whose L1 distnce is dmin, there re two error ptterns tht (c) 1392

cn led A nd B to the sme cell stte vector, thus creting cse where decoding becomes impossible. For i = 1, 2,..., n, define Si to be such set of integers: Si = {s min{i, bi} < s < min{i, bi}+ A+, mx{i, bi}- Ai- < s < mx{i, bi}}. Since mx{i, bi} -min{i, bi} = li bil < Z j -bjl = dmin < A+ +,- we get Si 0. Define P, Q to be such two sets of integers: P {i1 <K i < n, i < bil, nd Q = {fll < i' < n, i > bi}. Choose W1, W2. ***,Wn to be non-negtive integers tht mximize the vlue of Zi=1 wi subject to the following two constrints: (1) if i e P, then i + wi e Si; otherwise (nmely, if i e Q), i -wi e Si; (2) En 1 wi < E. It is not difficult to see tht those integers wl, w2,, wn do exist. Define two error vectors EA {e,aea,...,ec}, EB {el, e2,, en } s follows: if i e P, then e = wi nd ei = (i -bi- wi); if i e Q, then e - wi nd B ei = li-bil wi. Let's cll vlid error vector to be n error vector tht stisfies those constrints imposed by the prmeters A+, A-, E. It is not hrd to see tht A is vlid error vector. Now we show tht so is EB. By the definition of Si, we cn see tht -ia- < K.< Ai+. To show tht 1C e B < E, consider three cses: Cse 1: E wi = E. In this cse,,n= 1 lecb = dl(a,b) En Z leai = dmin- 1 Wi < +A+A--E < 2E-E E. Cse 2: there exists jsuchtht "j e Pndwi = A+±"or "je Q ndwj = A". In this cse, Z,n= 1eCB = dl(a,b) En 1 leai = dmin 1 wi < dminwj w < \+ + A- min{a±+, A\-} < E. Cse 3: it is neither of the previous two cses. In this cse, 1 wi < E. Since Wl, W2,, Wn mximize E 1wi by their definition, we get eb = 0 for ll i, so,> ie < E. So both EA nd EB re vlid error vectors; wht's more, A + EA = B + B. So when the received (i.e., red) cell stte vector is A + EA, we cnnot tell if the true cell stte vector is A or B. Thus decoding fils, finishing the proof bsed on contrdiction. So the necessry condition is proved. U The following theorem shows the symptotic performnce of error-correcting WOM codes when n -> oc nd q --> oc. Theorem 2: Let = A+ + A- + 1. Let k, I be fixed, nd let n -> oc, q --> oc. Then, for ny optiml error-correcting WOM code, q- o(qn) < t < (q 1> Proof: First, we show the lower bound to t. It hs been shown in [10] tht when q = 2 nd n -> oo, there is n ordinry WOM code - nmed the tbulr code - tht chieves t = n-o(n). Although the tbulr code is for single vrible, we cn see the k vribles here s one super vrible from n lphbet of size 1k. In this wy, the tbulr code cn be pplied to the k vribles nd still chieve t = n -o(n). Now when q -> oc, we first pply the tbulr code to the cell sttes 0 nd 1; then, pply it to cell sttes 1 nd 2; then to cell sttes 2 nd 3; so on... We obtin n ordinry WOM code with t = qn- o(qn) in this wy. Now we use n pproch of deriving error-correcting WOM codes from ordinry WOM codes tht we presented erlier. The pproch is to mp the cell sttes 0,1, 2, 3... to the cell sttes 0,, 2, 3. By pplying this pproch, we get n error-correcting WOM codes with t = I -o(qn). So for the optiml error-correcting WOM code, t > qj -o(qn). We now show the upper bound. By Theorem 1, dmin >. So every write increses the weight of the cell stte vector by t lest. The weight of the cell stte vector cn never exceed (q -1)n. So the upper bound t < (q- 1)' holds. Theorem 2 shows tht symptoticlly, t = 1>2 o(qn). In prctice, the most common type of errors hve A+ A- = 1. Tht is, only two djcent cell levels my become indistinguishble to the reding circuit. In such cse, we get t = q 31)n_o(qn). It mens tht even if there re mny errors, the errors reduce the vlue of t by only fctor of 3. It hs essentilly been shown in the proof of Theorem 2 tht when n, q re sufficiently lrge, the first pproch introduced t the beginning of this section - which is for deriving errorcorrecting WOM codes from ordinry WOM codes - constructs codes very close to optiml. It is simple to see tht the second pproch introduced there cn construct symptoticlly optiml codes. This cn be regrded s sitution where the seprtion between source coding nd chnnel coding holds. III. THREE OPTIMAL CODES WITH COMPLEXITY CONSTRAINTS Two bsic pproches for code construction hve been shown in Section II. However, they usully produce codes tht re not optiml when n or q is smll. In fct, optiml codes often exhibit irregulr internl structures. For such codes, the bsic method for decoding is to use lookup tble, which mps cell stte vectors to vrible vectors. The complexity of this decoding method is proportionl to the totl number of vlid cell stte vectors, which we shll cll the crdinlity of the code. It is, therefore, useful to study codes with minimum crdinlities. In this section, we study error-correcting WOM codes for two binry vribles. Tht is, k = I = 2. Also, we let E = A+ = A- = 1. Nmely, the code corrects ny single error of mgnitude 1. It is of specil interest to study binry vribles becuse in electronic memories, the 16 bits of word re often stored in 16 prllel blocks t the sme ddress. Consequently, writing word becomes writing bit in ech block. For 0, 1, 2, 3, we define the cell stte vectors of the i-th genertion to be the vlid cell stte vectors tht the memory cn rech fter exctly i writes. (For exmple, in Figure 1 (), the cell stte vectors in the 1st genertion re (3, 0), (0, 3), nd those in the 2nd genertion re (6, 0), (3, 3), (0, 6).) When k = 2 nd I = 2, it is simple to see tht when i > 0, the cell stte vectors in the i-th genertion correspond to exctly two vrible vectors: if i is odd, the two vrible vectors re nd (0, 1); if i is even, they re nd (1, 1). So when i > 0, the i-th genertion contins t lest two cell stte vectors. Therefore, the minimum crdinlity of code is 2t+ 1. We present three codes with the minimum crdinlity 2t + 1, respectively for n = 1, 2, 3 nd rbitrry q. We show tht they re optiml mong ll the codes with crdinlity 2t + 1, in the 1393

sense tht they mximize t, the number of writes. Wht's more, ll the three codes hve periodic internl structures, which significntly reduces the decoding complexity using the lookup method. In fct, the size of the lookup tble is only 4, 9 nd 15, respectively, regrdless of how lrge q is. In the following, we first present the code for n = 3, then the codes for n = 2 nd 1. A. Optiml Code for n = 3 The code for n = 3 is shown in Fig. 2. Its internl structure hs periodic pttern, where every period consists of six consecutive genertions. To see it, observe the 2nd genertion of cell stte vectors nd the 8th genertion. The 2nd genertion consists of cell stte vectors (cl = 2, c2 = 3,c3 = 1) nd (cl = 3, c2 = 2, c3= 2), while the 8th genertion consists of (cl = 10, c/ = 8,C3 = 9) nd (cl = 9, c/ = 9, c3 10). The following simple mpping shows the reltionship between these two genertions: cl = C2 + 7, c/ = c3 + 7, C3 = c1 + 7. More generlly, the bove mpping holds for the i-th genertion nd the (i+6)-th genertion, for i = 2, 3,..., 7. So period consists of six genertions. We keep building the code using such pttern. The code hs the following property: for i = 1, 2,..., 6 nd j =0,1, 2, 3, the bove simple mpping holds for the (6j+i+1)-th genertion nd the (6(j+1)+i+1)-th genertion. The code cn hve infinitely mny genertions. When q is finite, we truncte the code to the mximum genertion subject to the constrints tht every cell's stte does not exceed q -1. It is simple to prove tht the code cn correct ny single error of mgnitude 1. (Note tht here E = A+ = A\- = 1.) For code with the structure s shown in Fig. 2, it is sufficient to verify tht for ny two cell stte vectors either in the sme genertion or connected by n rrow, their L1 distnce is t lest 3. Then by theorem 1, the code cn correct single errors. (0,1) (0,1) (0,1) (0,1) (0,1) (0,1) (0,1) 9,9,10 9, (1, 3(132 3 15,1 6,16 Fig. 2. An error-correcting WOM code with k = 2, 1 = 2, n = 3, A+ A E = 1 nd rbitrry q. It hs t q -2-L q I. In the following, we prove tht mong ll the codes with the minimum crdinlity 2t + 1, the code in Fig. 2 hs the mximum vlue of t. Lemm 1: For code with crdinlity 2t + 1, let Wl, W2 denote the weights of the two cell stte vectors in the 2nd genertion. Then, mx{w1, w2} > 7. Proof: Since the code cn correct ny single error, for ny two vlid cell stte vectors, their Li distnce must be t lest 3. So every write increses the weight of the cell stte vector by t lest 3. Therefore, w1 > 6, w2 > 6. Assume tht w1 = w2 = 6. Then for the two cell stte vectors in the 1st genertion, their weights re both 3. Since the L1 distnce between those two vectors is t lest 3, simple enumertion shows tht without loss of generlity, those two vectors re one of the following seven pirs: (1, 1, 1) nd (3, 0, 0), (2, 1, 0) nd (0, 2, 1), (2, 1, 0) nd (1, 0, 2), (2, 1, 0) nd (0, 1, 2), (2, 1, 0) nd (0, 3, 0), (2, 1, 0) nd (0, 0, 3), (3, 0, 0) nd (0, 3, 0). (Any missing cse cn be obtined by combining one of the seven cses with permuttion of the cells.) If those two vectors re (1, 1,1) nd (3, 0, 0), since every vector in the 1st genertion cn rech every vector in the 2nd genertion through write opertion, we find tht for both vectors in the 2nd genertion, the three cells' sttes hve to be t lest mx{1, 3} = 3, mx{1, 0} = 1, mx{1, 0} = 1, respectively; since their weights re both 6, their L1 distnce is less thn 3, which is contrdiction. The other six cses cn be nlyzed similrly. So the ssumption cnnot be true. So we get mx{wl, w2} > 7. U Lemm 2: For code with crdinlity 2t + 1, let wl, w2 denote the weights of the two cell stte vectors in the i- th genertion, where i = 1, 2,3... Then, mx{ w1, w2} > 7(i 1) + 3 if i is odd, nd mx{wl, w2} > 7i if i is even. 2-2 Proof: By induction. When i = 1, mx{ wl, w2} > 3; when i = 2, by lemm 1, mx{wi, w2} > 7. In both cses, the lemm holds. This is the bse cse of induction. Assume tht the lemm holds for ny i < 2m, where m is positive integer. Let be the cell stte vector in the 2m-th genertion whose weight is t lest 7m. Consider the two genertions following the initil cell stte vector (0, 0, 0) (nmely, the 1st nd the 2nd genertions), nd compre them with the two genertions following (nmely, the (2m + 1)-th nd the (2m + 2)-th genertions). We see tht the nlysis in the proof of lemm 1 lso holds for the ltter cse, becuse ll the constrints on Li distnce must lso be stisfied for the ltter cse. So when i = 2m + 1, mx{wl, w2} -> 7m + 3 = 7(i2 2 1) -1~w1n + 3; when i = 2m + 2, mxfwlwl2} L, J2> 7m + 7 = 2 Tht completes the induction. m Lemm 3: For code with crdinlity 2t + 1, t < q- 2- L72 Proof: The weight of cell sttus vector cnnot exceed 3(q -1). By Lemm 2, we see tht if 3(q-1) mod 7 is less thn 3, then t < 2 3( 7 1)j; otherwise, t < 2 73(7 l)j + 1. We consider seven cses: (1) q = 7i; (2) q 7i + 1;...; (7) q =7i+6. Here i >1 in cses (1), (2), nd i >0in the ltter five cses. As n exmple, consider cse (1): q = 7i. In this cse, 3(q -1) = 3(7i -1) = 21i -3 = (21i -7) + 4. So t < (3i -1) 2 +1 = 6i -1. However, if t = 6i- 1, then the weights of the two cell stte vectors in the t-th genertion re t lest 7(3i -1) + 3 = 3(q -1) -1, so the Li distnce of those two vectors is less thn 3, which is contrdiction. So t < 6i- 2 = q- 2-q]. So the lemm holds. The other six cses cn be nlyzed in similr wy. For simplicity, we omit the detils. m It is not hrd to verify tht the code presented in Fig. 2 hs 1394

t = q- 2-q]. It chieves the upper bound to t in lemm 3. So we get: Theorem 3: The code presented in Fig. 2 hs t = q- 2- [qj. It is optiml mong ll the codes with the minimum crdinlity 2t + 1, in the sense tht it mximizes t. B. Optiml Codes for n = 2 nd ] The codes for n = 2 nd 1 re shown in Fig. 3 () nd (b), respectively. The code for n = 1 is very simple nd clerly optiml. The code for n = 2 hs periodic internl structure, where every period consists of four genertions. To see tht, observe the 1st genertion of cell stte vectors nd the 5th genertion. The 1st genertion consists of vectors (ci = 3, c2 = 0) nd (cl = 1, c2 = 2), while the 5th genertion consists of (Cl = 7, C/ = 10) nd (cl = 9, cl = 8). The following simple mpping shows the reltionship between these two genertions: cl = c2 + 7, cl = Cl + 7. More generlly, for i = 1, 2, 3, 4 nd j 0, 1, 2, 3, the bove simple mpping holds for the (4j + i)-th genertion nd the (4(j + 1) + i)-th genertion. (0,1) (0,1) (0,O) (1,O) (1,I) (1,O) (1,I) () * *b (b) Fig. 3. Two error-correcting WOM codes with k = 2,1 2, Ai+ = A- = F = 1 nd rbitrry q. () n = 2 nd t =L47 6j; (b) ri 1 nd t = Lq6-'. These two codes cn be nlyzes in similr wy s the code for n = 3. For simplicity, we skip the detils. We present the finl conclusion: Theorem 4: The two codes presented in Fig. 3 hs t L4q7 6 (when n = 2) or t = q6ij (when n = 1). They re optiml mong ll the codes with the minimum crdinlity 2t + 1, in the sense tht they mximize t. IV. EXTENDED ANALYSIS ON GENERAL ERROR-CORRECTING WOM CODES In section II, we hve presented bound to t when n nd q re sufficiently lrge. In this section, we present bound for generl error-correcting WOM codes. When n is smll, it cn be (much) better thn the following simple bound: t < (q -)n/(a+ +A- + 1). For exmple, when k = I = 3, n 2,A+ Ai\-1 FE = 1, Theorem 5 gives t < 3 iq7] 2333 q 33while the simple bound only gives t < q-1 i.5 For ny two cell stte vectors C = (C,c2,, c ) nd C/'= (cl C/2:. * c$), we sy tht C is bove C' if nd only... if for i= 1,2~ n, ci > cl Theorem 5: Let = A++A- + 1. Let b = L 21.Letc k 0 (k) (I _ I)i L k2i + 1]. Let d denote the smllest positive integer such tht (n+d) > c(n+b) +b(c- 1). Then, if d- b > 0, every error-correcting WOM code hs t < k* Fdb 1)n 1 Proof: Strting with ny vlid cell stte vector, k consecutive writes cn mke the vrible vector rech or go through ny of the 1k possible vlues (including the current vrible vector). There re (k) (1 _ 1)i vrible vectors t Hmming distnce i from the current vrible vector, nd every such vrible vector cn be reched fter i, i+2, i+4... writes, with the corresponding cell stte vector's weight monotoniclly incresing. So k consecutive writes cn mke the cell stte vector rech or go through c or more distinct vlues (including the current vlue). Let's pick c such cell stte vectors, nd denote them by sl S2, * *, s,. In prticulr, let s, denote the current (the strting) cell stte vector. For i = 1, 2,..., c, let Bi denote the bll of rdius b (mesured by the L1 distnce) centered t si. By theorem 1, when i t j, the two blls Bi nd Bj re disjoint. There re (n+b) elements in Bi tht re bove si; nd if i > 1, there re t lest b elements in Bi tht re bove si nd whose weights re less thn the weight of si by 1, 2,..., b, respectively. All the c(n+b) + b(c -1) elements (which re ll cell stte vectors) discussed bove re bove sl. It is not hrd to see tht mong those c(n+b) + b(c -1) elements, one of them hs weight tht is greter thn the weight of si by t lest d. So there exists sequence of t most k writes tht cn rise the weight of the cell stte vector by t lest d -b. By prtitioning t writes into such sequences, where ech sequence contins t most k writes, we get the conclusion. U REFERENCES [1] G. D. Cohen, P. Godlewski nd F. Merkx, " Liner binry code for writeonce memories," IEEE Trnsctions on Informtion Theory, vol. IT-32, pp. 697-700, September 1986. [2] A. Fit nd A. Shmir, "Generlized 'write-once' memories," IEEE Trnsctions on Informtion Theory, vol. IT-30, pp. 470-480, My 1984. [3] F. Fu nd A. J. Hn Vinck, "On the cpcity of generlized write-once memory with stte trnsitions described by n rbitrry directed cyclic grph," IEEE Trnsctions on Informtion Theory, vol. 45, no. 1, pp. 308-313, 1999. [4] F. Fu nd R. W. Yeung, "On the cpcity nd error-correcting codes of write-efficient memories," IEEE Trnsctions on Informtion Theory, vol. 46, no. 7, pp. 2299-2314, 2000. [5] S. Gregori, A. Cbrini, O. Khouri nd G. Torelli, "On-chip error correcting techniques for new-genertion flsh memories," Proceedings of The IEEE, vol. 91, no. 4, April 2003. [6] C. Heegrd, "On the cpcity of permnent memory," IEEE Trnsctions on Informtion Theory, vol. IT-31, pp. 34-42, Jnury 1985. [7] A. Jing, V. Bohossin nd J. Bruck, "Floting codes for joint informtion storge in write symmetric memories," Proc. IEEE Interntionl Symposium on Informtion Theory (ISIT), Nice, Frnce, June 2007. [8] A. V. Kuznetsov nd A. J. H. Vinck, "On the generl defective chnnel with informed encoder nd cpcities of some constrined memories," IEEE Trns. Inform. Theory, vol. 40, no. 6, pp. 1866-1871, Nov. 1994. [9] F. Merkx, "WOMcodes constructed with projective geometries," Tritement du Signl, vol. 1, no. 2-2, pp. 227-231, 1984. [10] R. L. Rivest nd A. Shmir, "How to reuse 'write-once' memory," Informtion nd Control, vol. 55, pp. 1-19, 1982. [11] J. K. Wolf, A. D. Wyner, J. Ziv nd J. Korner, "Coding for write-once memory," AT&T Bell Lbs. Tech. J., vol. 63, no. 6, pp. 1089-1112, 1984. [12] G. Zemor nd G. D. Cohen, "Error-correcting WOM-codes," IEEE Trns. Informtion Theory, vol. 37, no. 3, pp. 730-734, 1991. 1395