May 13, 2015 - Therefore, there is at least one solution for the vector z such that y masks .... [1,q â 1]u, the value of the minimum redundancy rq (n, u, s) to mask ...
1
Codes for Partially Stuck-at Memory Cells Antonia Wachter-Zeh and Eitan Yaakobi Department of Computer Science Technion—Israel Institute of Technology, Haifa, Israel Email: {antonia, yaakobi}@cs.technion.ac.il
arXiv:1505.03281v1 [cs.IT] 13 May 2015
Abstract In this work, we study a new model of defect memory cells, called partially stuck-at memory cells, which is motivated by the behavior of multi-level cells in non-volatile memories such as flash memories and phase change memories. If a cell can store the q levels 0, 1, . . . , q − 1, we say that it is partially stuck-at level s, where 1 ≤ s ≤ q − 1, if it can only store values which are at least s. We follow the common setup where the encoder knows the positions and levels of the partially stuck-at cells whereas the decoder does not. Our main contribution in the paper is the study of codes for masking u partially stuck-at cells. We first derive lower and upper bounds on the redundancy of such codes. The upper bounds are based on two trivial constructions. We then present three code constructions over an alphabet of size q, by first considering the case where the cells are partially stuck-at level s = 1. The first construction works for u < q and is asymptotically optimal if u + 1 divides q. The second construction uses the reduced row Echelon form of matrices to generate codes for the case u ≥ q, and the third construction solves the case of arbitrary u by using codes which mask binary stuck-at cells. We then show how to generalize all constructions to arbitrary stuck levels. Furthermore, we study the dual defect model in which cells cannot reach higher levels, and show that codes for partially stuck-at cells can be used to mask this type of defects as well. Lastly, we analyze the capacity of the partially stuck-at memory channel and study how far our constructions are from the capacity. Index Terms (partially) stuck-at cells, defect cells, flash memories, phase change memories
I. I NTRODUCTION Non-volatile memories such as flash memories and phase change memories (PCMs) have paved their way to be a dominant memory solution for a wide range of applications, from consumer electronics to solid state drives. The rapid increase in the capacity of these memories along with the introduction of multi-level technologies have significantly reduced their cost. However, at the same time, their radically degraded reliability has demanded for advanced signal processing and coding solutions. The cells of PCMs can take distinct physical states. In the simplest case, a PCM cell has two possible states, an amorphous state and a crystalline state. Multi-level PCM cells can be designed by using partially crystalline states [3]. Failures of PCM cells stem from the heating and cooling processes of the cells. These processes may prevent a PCM cell to switch between its states and thus the cells become stuck-at [7], [11], [18], [20]. Similarly, in the multi-level setup, a cell can get stuck-at one of the two extreme states, amorphous or crystalline. Or, alternatively, the cells cannot be programmed to a certain state, but can be in all other ones; for example, if a cell cannot be programmed to the amorphous state it can still be at the crystalline state as well as all intermediate ones. A similar phenomenon appears in flash memories. Here, the information is stored by electrically charging the cells with electrons in order to represent multiple levels. If charge is trapped in a cell, then its level can only be increased, or it may happen that due to defects, the cell can only represent some lower levels. Inspired by these defect models, the goal of this paper is the study of codes which mask cells that are partially stuck-at. In the classical version of stuck-at cells (see e.g. [15]), the memory consists of n binary cells of which u are stuck-at either in the zero or one state. A cell is said to be stuck-at level s ∈ {0, 1} if the value of the cell cannot be changed. Therefore, only data can be written into the memory which matches the fixed values at the stuck-at cells. A code for stuck-at cells maps message vectors on codewords which mask the stuck-at cells, i.e., the values of each codeword at the stuck positions coincide with their stuck level. The encoder knows the locations and values of the stuck-at cells, while the decoder does not. Hence, the task of the decoder is to reconstruct the message given only the codeword. The challenge in this defect model is to construct schemes where a large number of messages can be encoded and successfully decoded. If u cells are stuck-at, then it is not possible to encode more than n − u bits, and thus the problem is to design codes with redundancy close to u. The same problem is relevant for the non-binary setup of this model, where the cells can be stuck at any level. The study of codes for memories with stuck-at cells, also known as memories with defects, takes a while back to the 1970s. To the best of our knowledge, the problem was first studied in 1974 by Kuznetsov and Tsybakov [15]. Since then, several more papers have appeared, e.g. [1], [2], [4], [9], [13], [14], [19], [22]–[24]. The main goal in all these works was to find Parts of this work have been presented at the 10th International ITG Conference on Systems, Communications and Coding (SCC) 2015, Hamburg, Germany [25].
2
constructions of codes which mask a fixed number of stuck-at cells and correct another fixed number of additional random errors. Recently, the connection between memories with stuck-at cells and the failure models of PCM cells has attracted a renewed attention to this prior work. Several more code constructions as well as efficient encoding and decoding algorithms for the earlier constructions were studied; see e.g. [5], [12], [16], [17], [21]. This paper studies codes which mask cells that are partially stuck-at. We assume that cells can have one of the q levels 0, 1, . . . , q − 1. Then, it is said that a cell is partially stuck-at level s, where 1 ≤ s ≤ q − 1, if it can only store values which are greater than or equal to s. In this work, we provide upper and lower bounds on the redundancy and give several code constructions with small redundancy in order to mask partially stuck-at cells. To facilitate the explanations, our constructions are first given for the case s = 1, and later generalized to arbitrary levels. In the first part of the paper, we derive lower and upper bounds on the redundancy of codes that mask partially stuck-at memory cells. The first lower bound is based on the number of states that each partially stuck-at cell can attain. For the case where all cells are partially stuck-at the same level s, we also derive an improved lower bound. Further, codes which mask any number of partially stuck-at cells can simply be constructed by using only the levels maxi si , . . . , q − 1 in each cell. Alternatively, codes which mask u stuck-at cells (not partially) can be used to mask u partially stuck-at cells. Thus, these two schemes provide an upper bound on the minimum redundancy of codes that is necessary to mask u partially stuck-at cells. In the course of this paper, we provide several code constructions and analyze how far they are from our lower and upper bounds on the redundancy. In particular, for u < q, we first show that one redundancy symbol is sufficient to mask all partially stuck-at cells. Further, an improvement of this construction turns out to be asymptotically optimal in terms of the redundancy. Our second construction uses the parity-check matrix of q-ary error-correcting codes. The third construction uses binary codes which mask (usual) stuck-at cells. We also show how the codes we propose in the paper can be used for the dual defect model in which cells cannot reach higher levels. Lastly, we analyze the capacity of the partially stuck-at memory channel and study how far our constructions are from the capacity. The rest of the paper is organized as follows. In Section II, we introduce notations and formally define the model of partially stuck-at cells studied in this paper. Our lower and upper bounds on the redundancy are presented in Section III. In Section IV, we propose codes along with encoding and decoding algorithms for the case u < q. In Section V, we give a construction based on q-ary codes and in Section VI we show a more general solution by using codes which mask binary stuck-at cells. Section VII generalizes the previous constructions to cells which are partially stuck-at arbitrary (possibly different) levels s0 , s1 , . . . , su−1 . The (dual) problem of codes for unreachable levels is studied in Section VIII and Section IX analyzes the capacity of the partially stuck-at channel. Finally, Section X concludes this paper. II. D EFINITIONS AND P RELIMINARIES A. Notations In this section, we formally define the models of (partially) stuck-at cells studied in this paper and introduce the notations and tools we will use in the sequel. In general, for positive integers a, b, we denote by [a] the set of integers {0, 1, . . . , a − 1} and [a, b − 1] = {a, a + 1, . . . , b − 1}. Vectors and matrices are denoted by lowercase and uppercase boldface letters, e.g. a and A, and are indexed starting from 0. The all-zero and all-one vectors of length n are denoted by 0n and 1n . Further, for a prime power q, Fq denotes the finite field of order q. We consider n memory cells with q levels, i.e., they are assumed to represent q-ary symbols having values belonging to the set [q]. We can therefore represent the memory cells as a vector in [q]n . In the classical model of stuck-at cells, a cell is said to be stuck-at level s ∈ [q] if it can store only the value s. In our new model of partially stuck-at cells, a cell is partially stuck-at level s ∈ [q] if it can store only values which are at least s. In the first part of this work, when studying partially stuck-at cells, we only consider s = 1 and we call such cells partially stuck-at-1. Throughout this paper, we also use the notation partially stuck-at-s, when one or several cells are partially stuck-at level s, Lastly, in the most general case, u cells are partially stuck-at-s, where s = (s0 , s1 , . . . , su−1 ) is a vector and contains the different stuck levels s0 , s1 , . . . , su−1 of the u defect cells. B. Definitions for (Partially) Stuck-at Cells We use the notation (n, M )q to indicate a coding scheme to encode M messages into vectors of length n over the alphabet [q]. Its redundancy is denoted by r = n − logq M . A linear code over [q] (in which case q is a power of a prime and [q] corresponds to the finite field Fq of order q), will be denoted by [n, k]q , where k is its dimension and its redundancy is r = n − k. Whenever we speak about a linear [n, k, d]q code, then d refers to the minimum Hamming distance of an [n, k]q code. We also denote by ρq (n, d) the smallest (known) redundancy of any linear code of length n and minimum Hamming distance d over Fq . For the purpose of the analysis and the simplicity of notations in the paper, we let ρq (n, d) = ∞ in case q is not a power of a prime. Codes for (partially) stuck-at cells are defined as follows. Definition 1 (Codes for (Partially) Stuck-at Cells) We define the following code properties:
3
1) An (n, M )q u-stuck-at-masking code (u-SMC) C is a coding scheme with encoder E and decoder D. The input to the encoder E is the set of locations {φ0 , φ1 , . . . , φu−1 } ⊆ [n], the stuck levels s0 , s1 , . . . , su−1 ∈ [q] of some u ≤ n stuck-at cells and a message m ∈ [M ]. Its output is a vector y(m) ∈ [q]n which matches the values of the u stuck-at cells, i.e., (m)
yi and its decoded value is m, that is D(y
(m)
= si , ∀i ∈ {φ0 , φ1 , . . . , φu−1 },
) = m.
2) An (n, M )q (u, s)-partially-stuck-at-masking code ((u, s)-PSMC) C is a coding scheme with encoder E and decoder D. The input to the encoder E is the set of locations {φ0 , φ1 , . . . , φu−1 } ⊆ [n], the partially stuck levels s = (s0 , s1 , . . . , su−1 ) ∈ [1, q − 1]u of some u ≤ n partially stuck-at cells and a message m ∈ [M ]. Its output is a vector y(m) ∈ [q]n which masks the values of the u partially stuck-at cells, i.e., (m)
yi
≥ si , ∀i ∈ {φ0 , φ1 , . . . , φu−1 },
and its decoded value is m, that is D(y(m) ) = m. Notice that in contrast to classical error-correcting codes, (P)SMCs are not just a set of codewords, but also an explicit coding scheme with encoder and decoder. Further, the partially stuck levels stored in s have to be known to the decoder of a PSMC, whereas the decoders of SMCs are independent of the stuck levels. Clearly, a (u, s)-PSMC is also a (u0 , s0 )-PSMC, where u0 ≤ u and s0 is a subvector of s of length u0 . Whenever we speak about (u, s)-PSMCs (i.e., s is a scalar), we refer to a code that masks at most u partially-stuck-at-s cells and when simply we speak about a u-PSMC, we mean a code which masks at most u partially-stuck-at-1 cells. In the design of (P)SMCs, the goal is therefore to minimize the redundancy n − logq M for fixed values u and s, while providing efficient encoding and decoding algorithms. For positive integers n, q, u, where u ≤ n, and a vector s ∈ [1, q − 1]u , we denote by rq (n, u, s) the minimum redundancy of a (u, s)-PSMC over [q]. Note that throughout this paper we only consider the problem of masking partially stuck-at cells, without correcting additional (random) errors as e.g. in [9] for stuck-at cells. C. Codes for Stuck-at Cells Codes for masking stuck-at cells were studied before and one such construction is stated in the following theorem; see e.g. [9]. We show the proof of this theorem, which includes the encoding and decoding of SMCs, for the completeness of results in this paper and since our encoding and decoding algorithms use similar ideas. Theorem 1 (Masking Stuck-At Cells, [9]) Let C be an [n, k, d]q code with minimum distance d ≥ u + 1, where q is a prime power. Then, there exists a u-SMC with redundancy r = n − k. Proof: The proof is based on explicitly showing in the following two algorithms how to use the error-correcting code C to mask stuck-at cells. We assume that H is a systematic (n − k) × n parity-check matrix of the code C which is known to both, encoder and decoder. Algorithm 1 describes the encoding process. We have to prove that in Step 2, a vector z always exists such that the encoded vector y masks the u stuck-at cells. Define x = (x0 , x1 , . . . , xn−1 ) = z · H. We have to fulfill the following u equations: wφi + xφi = si ,
∀i ∈ [u].
Denote by Hu the u columns of H indexed by φ0 , . . . , φu−1 . Then, we have to find z such that z · Hu = (s0 − wφ0 , s1 − wφ1 , . . . , su−1 − wφu−1 ). This is a heterogeneous linear system of equations with at most u ≤ d − 1 ≤ n − k linearly independent equations and n − k unknowns (the elements of z). Therefore, there is at least one solution for the vector z such that y masks the stuck-at cells.
4
Algorithm 1. E NCODING S TUCK m; φ0 , φ1 , . . . , φu−1 ; s0 , s1 , . . . , su−1 Input: • message: m = (m0 , m1 , . . . , mk−1 ) ∈ [q]k • positions of stuck-at cells: {φ0 , φ1 , . . . , φu−1 } ⊆ [n] • levels of stuck-at cells: s0 , s1 , . . . , su−1 ∈ [q] 1
w = (w0 , w1 , . . . , wn−1 ) ← (0n−k , m0 , m1 , . . . mk−1 )
2
Find z ∈ [q]n−k such that y ← w + z · H masks the stuck-at cellsa Output: vector y with yφi = si , ∀i ∈ {φ0 , . . . , φu−1 }
a We assume here and in the rest of the paper that there is a one-to-one mapping F : [q] → Fq so arithmetic operations like multiplication and addition in w + z · H are defined as F (w) + F (z) · H.
Algorithm 2 describes the decoding process. Algorithm 2. D ECODING S TUCK y) Input: • stored vector: y = (y0 , y1 , . . . , yn−1 ) ∈ [q]n 1
b z ← (y0 , y1 , . . . , yn−k−1 )
2
b = (w w b0 , w b1 , . . . , w bn−1 ) ← y − b z·H
3
b ← (w m bn−k , w bn−k+1 , . . . , w bn−1 ) b ∈ [q]k Output: message vector m
b = m. Note that H is a systematic parity-check matrix and therefore, the first n − k positions of We have to prove that m the output vector y of Algorithm 1 (which is at the same time the input of Algorithm 2) equal z. Therefore, in Step 1 in b = y − z · H = w and in Step 3, m b = m. Algorithm 2, we obtain b z = z and thus, in Step 2, w It is not completely known whether the scheme of Theorem 1 is optimal with respect to its achieved redundancy. However, the redundancy of such a code has to be at least u since there are u stuck-at cells that cannot store information. Let us illustrate Theorem 1 (and Algorithms 1 and 2) with an example. Example 1 Let u = 2, q = 3 and n = 5. Therefore, we need a ternary code of minimum distance at least u + 1 = 3. The largest such code is a [5, 2, 3]3 code (see [8]) with a systematic parity-check matrix 1 0 0 1 0 H = 0 1 0 1 1 . 0 0 1 0 1 We will show how to construct a (5, 32 = 9)3 2-SMC which masks any u0 ≤ u = 2 stuck-at cells. For the encoding, we proceed as in Algorithm 1. Let m = (m0 , m1 ) = (2, 1) be the information we want to store and assume that the cells at positions φ0 = 0 and φ1 = 4 are stuck-at s0 = 1 and s1 = 2. Further, let w = (0, 0, 0, m0 , m1 ) = (0, 0, 0, 2, 1). Given w, φ0 , φ1 and s0 , s1 , our goal is to find a vector x ∈ [3]5 such that y ≡ (w + x) mod 3 matches the partially stuck-at cells and yet the information stored in m can be reconstructed from y. We use z = (1, 0, 1). Then, x = z · H = (1, 0, 1, 1, 1) and y = w + x = (1, 0, 1, 0, 2) which masks the stuck-at cells. To reconstruct w, given y, we notice that (y0 , y1 , y2 ) = z = (1, 0, 1) and we can simply calculate y − (y0 , y1 , y2 ) · H to obtain w and therefore m. Thus, the required redundancy for masking u = 2 stuck-at cells with Theorem 1 is r = 3 (the first three symbols). III. B OUNDS ON THE R EDUNDANCY For deriving upper and lower bounds on the minimum redundancy of PSMCs, we assume the most general case of (u, s)PSMCs, where s = (s0 , s1 , . . . , su−1 ) ∈ [1, q − 1]u . Hence, when a cell at position φi is partially stuck-at level si , it can only store the values {si , si + 1, . . . , q − 1}.
5
Theorem 2 (Bounds on the Redundancy) For any number of u ≤ n partially stuck-at cells and any levels s = (s0 , s1 , . . . , su−1 ) ∈ [1, q − 1]u , the value of the minimum redundancy rq (n, u, s) to mask these cells satisfies ! u−1 Y u − logq (q − si ) i=0
≤ rq (n, u, s) n o ≤ min n · 1 − logq q − max{si } , ρq (n, u + 1) . i
Proof: Let us start with the lower bound. The n − u cells, which are not partially stuck-at, can each carry a q-ary information symbol and the u partially Q stuck-at cells can still represent q − si possible values (all values except for [si ]). u−1 Hence, we can store at most M ≤ q n−u i=0 (q − si ) q-ary vectors and the code redundancy satisfies ! ! u−1 u−1 Y Y n−u (q − si ) = u − logq (q − si ) . r ≥ n − logq q i=0
i=0
Second, we prove the upper bound. A trivial construction to mask any u ≤ n partially stuck-at cells is to use only the values maxi {si }, . . . , q − 1 as possible symbols in any cell. Any cell therefore stores logq (q − maxi {si }) q-ary information symbols. The achieved redundancy is n − logq (q − max{si })n = n 1 − logq (q − max{si }) , i i and therefore rq (n, u, s) ≤ n 1 − logq (q − maxi {si }) . Furthermore, every u-SMC can also be used as (u, s)-PSMC since the SMC restricts the values of the stuck-at cells more than the PSMC. With Theorem 1, the redundancy of an SMC is ρq (n, u + 1), which provides another upper bound on the value of rq (n, u, s). Note that ρq (n, u + 1) ≥ u (by the Singleton bound). The bounds from Theorem 2 will serve as a reference for our constructions, as we should ensure to construct codes with smaller redundancy than the upper bound and study how far their redundancy is from the lower bound. For the special case of partially stuck-at-1 cells, we obtain the following bounds on the redundancy rq (n, u, 1) of a u-PSMC for all positive integers n, q, u where u ≤ n: u 1 − logq (q − 1) (1)
≤ rq (n, u, 1)
≤ min n 1 − logq (q − 1) , ρq (n, u + 1) . For partially stuck-at-s cells, we further improve the lower bound on the redundancy in the next theorem. n n Theorem 3 (Improved Lower Bound) For any (n, M )q (u, s)-PSMC, we have M ≤ q +u(q−s) , and therefore u+1 rq (n, u, s) ≥ logq (u + 1) − logq 1 + u(1 − s/q)n . Proof: Assume that there exists an (n, M )q (u, s)-PSMC, and let E, D be its encoder, decoder, respectively. In this case we assume that the encoder’s input is a message m ∈ [M ] and U ⊆ [n], |U | ≤ u, of the locations of the cells na set ofnindices which are partially stuck-at level s. We will show that M ≤ q +(q−s) . For every m ∈ [M ], let u+1 D−1 (m) = {y ∈ [q]n | D(y) = m}. For every m ∈ [M ] such that D−1 (m) ∩ ([q] \ [s])n = ∅, we have that |D−1 (m)| ≥ u + 1. To see that, assume on the contrary that |D−1 (m)| = u (the same proof holds if |D−1 (m)| < u), so we can write D−1 (m) = {y0 , y1 , . . . , yu−1 }, while yj ∈ / ([q] \ [s])n for j ∈ [u]. For j ∈ [u], let ij ∈ [n] be such that yj,ij < s, and U = {i0 , i1 , . . . , iu−1 }. Then, E(m, U ) 6= yj for all j ∈ [u] (where the message m and the positions set U are the input to the encoder E) and thus |D−1 (m)| ≥ u + 1, in contradiction. Since there are (q −s)n vectors all with values at least s, there are M −(q −s)n vectors of the described type above where for each such vector there exists a message m where |D−1 (m)| ≥ u+1. Therefore, we get that (q−s)n +(u+1)(M −(q−s)n ) ≤ q n , or n q + u(q − s)n M≤ . u+1 We also conclude that q n + u(q − s)n rq (n, u, s) ≥ n − logq u+1 = logq (u + 1) − logq 1 + u(1 − s/q)n .
6
For u = 1, we obtain from Theorem 3: rq (n, 1, s) ≥ logq 2 − logq 1 + (1 − s/q)n . For s = (s0 , s1 , . . . , su−1 ) and smax = maxi∈[u] {si } and smin = mini∈[u] {si }, we have rq (n, u, smax ) ≥ rq (n, u, s) ≥ rq (n, u, smin ) ,
(2)
so we can always use rq (n, u, 1) as a lower bound for partially stuck-at-s0 , s1 , . . . , su−1 cells. Examples 2 and 3 show cases where the lower bound from Theorem 3 is better than the lower bound from (1). IV. A C ONSTRUCTION FOR PARTIALLY S TUCK - AT L EVEL s = 1 C ELLS FOR u < q A. Code Construction In this section, we show a simple construction of u-PSMCs for masking any u < q partially stuck-at-1 cells, which works for any q (not necessarily a prime power). Let us illustrate the idea of this construction with an example. Example 2 Let u = 2, q = 3 and n = 5. We will show how to construct a (5, 34 = 81)3 u-PSMC. Let m = (m0 , m1 , m2 , m3 ) = (2, 0, 1, 0) be the information we want to store and assume that the two cells at positions φ0 = 1 and φ1 = 2 are partially stuck-at-1. We set w = (0, m0 , m1 , m2 , m3 ) = (0, 2, 0, 1, 0). Given w, φ0 and φ1 , our goal is to find a vector x such that y ≡ (w + x) mod 3 masks the partially stuck-at-1 cells and yet the information stored in m can be reconstructed from y. We use x = z · 15 , for some z ∈ [3]. Since w1 = 2, we can choose any value from [3] for z except for 1, and since w2 = 0, we can choose any value but 0. Thus, we choose z = 2 and encode the vector y to be y = w + 2 · 15 = (2, 1, 2, 0, 2), which masks the two partially stuck-at-1 cells. To reconstruct w, given y, notice that y0 = z = 2 and we can simply calculate y − y0 · 15 to obtain w and therefore m. Thus, the required redundancy for masking u = 2 partially stuck-at-1 cells is r = 1 (the first symbol). The lower bound from (1) is 2 · (1 − log3 2) = 0.738, the lower bound from Theorem 3 gives 0.787 (and therefore improves upon the bound from Theorem 2) and the upper bound is min{5 · (1 − log3 2), ρ3 (5, 3) = 3} = 1.845, where the second part was shown in Example 1. The following theorem shows that it is possible to construct a u-PSMC with this strategy for any u < q. Theorem 4 (Construction I for u < q) If u < q and u ≤ n, then for all n, there exists an (n, M = q n−1 )q u-PSMC with redundancy of one symbol. Proof: As in the proof of Theorem 1, we give the explicit encoding and decoding algorithms. The encoding is shown in Algorithm 3. Let φ0 , φ1 , . . . , φu−1 be the positions of some u partially stuck-at-1 cells and let m = (m0 , m1 , . . . , mn−2 ) ∈ [q]n−1 be the message to be written to the memory w. We first set w = (0, m0 , m1 , . . . , mn−2 ). Since u < q, there exists at least one value v ∈ [q] such that wφ0 , wφ1 , . . . , wφu−1 6= v. Choose z = q − v ≡ −v mod q and therefore, wφi + z ≡ (wφi − v) mod q 6= 0. Thus, the output vector y masks all u partially stuck-at-1 cells. Algorithm 3. E NCODING -I m; φ0 , φ1 , . . . , φu−1
Input: • message: m = (m0 , m1 , . . . , mn−2 ) ∈ [q]n−1 • positions of partially stuck-at-1 cells: {φ0 , φ1 , . . . , φu−1 } ⊆ [n] 1
w = (w0 , w1 , . . . , wn−1 ) ← (0, m0 , m1 , . . . mn−2 )
2
Set v ∈ [q] such that v ∈ / {wφ0 , wφ1 , . . . , wφu−1 }
3
z ←q−v
4
y ← (w + z · 1n ) mod q Output: vector y with yφi ≥ 1, ∀i ∈ [u]
The decoding algorithm is shown in Algorithm 4 and it simply uses the fact that y0 is used to store the value of z. Thus, b = m. m
7
Algorithm 4. D ECODING -I y) Input: • stored vector: y = (y0 , y1 , . . . , yn−1 ) ∈ [q]n 1
zb ← y0
2
b ← ((y1 , y2 , . . . , yn−1 ) − zb · 1n ) mod q m b ∈ [q]n−1 Output: message vector m
Lastly, since we need only one symbol to store the value of z = q − v in the first cell, the redundancy is one. This principle works for any n since 1n always exists. Further, q does not have to be a prime power and we can use this strategy even if [q] does not constitute a finite field. Theorem 4 provides a significant improvement compared to codes for the (stronger) model of usual stuck-at cells, where the required redundancy is ρq (n, u + 1) ≥ u. In order to compare our result to the first term in the upper bound from (1), we use the approximation ln(q) − ln(q − 1) ≈ 1/q for q large enough and thus, 1 − logq (q − 1) ≈
1 . q ln q
Hence, for n ≥ q ln q, the construction from Theorem 4 achieves smaller redundancy than the upper bound from (1). However, for u < q and n large enough the lower bound on the redundancy from Theorem 3 is logq (u + 1) < 1. This suggests that codes with better redundancy might exist, as we shall see in the next subsection. B. Improvement of Construction I In this subsection, we show how to improve Construction I from Theorem 4 and therefore, how to reduce the required redundancy. Let us first show an example of this modification. Example 3 Let u = 2 and q = 6. Then, with the same principle as in Algorithm 1 and z ∈ [3], we can mask any two partially stuck-at-1 cells with one redundancy symbol. The important observation here is that z can always be chosen from a small subset of [q]. Assume, the first cell stores the redundancy, namely y0 = z, and takes therefore only three out of six possible values. We can store additional information in this cell e.g. as follows: 0 is represented by 0 or 3; 1 is represented by 1 or 4; and 2 is represented by 2 or 5. By choosing e.g. between storing 1 or 4, we store additional information in the redundancy cell. Thus, the information stored (in terms of q-ary symbols) increases by log6 (6/3) and the required redundancy reduces from one symbol to 1 − log6 (2) ≈ 0.613 symbols while the lower bound from (1) gives ≈ 0.204. The lower bound from Theorem 3 gives 0.284 for n = 5, and 0.457 for n = 10. For n → ∞, the lower bound from Theorem 3 reaches 0.613 which is exactly the redundancy achieved by our construction. In general, assume that u < q, then there is some v ∈ [u + 1] such that wφ0 , wφ1 , . . . , wφu−1 6= v. Hence, if u is significantly smaller than q, then there is more than one value to choose the value of v from and the redundancy decreases by logq (bq/(u + 1)c) symbols. Thus, with Theorem 4 and the previous considerations, we obtain the following result. Theorem 5 (Construction IB) If u < q and u ≤ n, then for all n, there exists a u-PSMC over [q] of length n and redundancy q r = 1 − logq . u+1 Proof: In order to prove the statement, we modify Algorithm 3 to obtain an encoding procedure for the improved construction from Theorem 5.
8
Algorithm 5. E NCODING -I B m; m0 ; φ0 , φ1 , . . . , φu−1
n−1 Input: • message: m = (m0 , m1 , . .h. , mn−2 i ) ∈ [q] q • additional message: m0 ∈ u+1 • positions of stuck-at-1 cells: {φ0 , φ1 , . . . , φu−1 } ⊆ [n] 1 2
w = (w0 , w1 , . . . , wn−1 ) ← (0, m0 , m1 , . . . , mn−2 ) Set v ∈ [u + 1] such that v∈ / wφ0 mod (u + 1), . . . , wφu−1 mod (u + 1)
3
z ← q − v − m0 (u + 1)
4
y ← (w + z · 1n ) mod q Output: vector y with yφi ≥ 1, ∀i ∈ [u]
The encoding algorithm is a generalization of Algorithm 3. We will prove that theoutput vector y masks the partially stuck-at-1 cells. In Step 2, we can always find a value v ∈ [u + 1] as required since the set wφ0 mod (u + 1), . . . , wφu−1 mod (u + 1) has cardinality u and there are u + 1 possible values to choose from. Note that in Step 3, z ∈ [q] since v ∈ [u + 1] and m0 (u + 1) ∈ [q − u]. In Step 4, we obtain: yφi = (wφi − v − m0 (u + 1)) mod q. Since v 6= wφi mod (u + 1) from Step 2, we conclude that yφi 6= 0, for all i ∈ [u], and the partially stuck-at-1 positions are masked. The decoding algorithm has to guarantee that we can recover m and m0 and is shown in Algorithm 6. Here, we notice that y0 = z = q − v − m0 (u + 1) from the encoding step and therefore, in Step 1, zb = z and in Step 2, vb = v. Solving c0 = m0 . Since y0 = q − v − m0 (u + 1) for m0 shows that in Step 3, the result of the fraction is always an integer and that m b = m in Step 4. zb = z, it follows that m Algorithm 6. D ECODING -I B y) Input: • stored vector: y = (y0 , y1 , . . . , yn−1 ) ∈ [q]n 1 2 3 4
zb ← y0 vb ← (q − zb) mod (u + 1) c0 ← q − zb − vb m u+1 b ← ((y1 , y2 , . . . , yn−1 ) − zb · 1n−1 ) mod q m b ∈ [q]n−1 Output: message vector m c0 additional message m
Clearly, for u < q, the redundancy is r ≤ 1. The following lemma shows that this construction is asymptotically optimal. Theorem 6 (Optimality of Theorem 5) If (u + 1) divides q, the u-PSMC from Theorem 5 is asymptotically optimal in terms of the redundancy. Proof: If (u+1)|q, then the redundancy from Theorem 5 is r = logq (u+1). The lower bound on the minimum redundancy from Theorem 3 is rq (n, u, 1) = logq (u + 1) − logq 1 + u(1 − 1/q)n . The difference between both is ∆q (n, u) = r − rq (n, u, 1) = logq 1 + u(1 − 1/q)n . For n → ∞ and since (1 − 1/q) < 1, this value approaches logq 1 + u(1 − 1/q)n → logq 1 + 0 = 0. Thus, the construction is asymptotically optimal.
9
V. C ONSTRUCTIONS U SING q- ARY C ODES FOR PARTIALLY S TUCK - AT L EVEL s = 1 C ELLS For u ≥ q, it is not always possible to construct u-PSMCs with the strategy from Theorem 4 (and Algorithms 3, 4). Therefore, this section provides a construction which works well for u ≥ q and can be seen as a generalization of Construction I (instead of the all-one vector, we use a parity-check matrix). Let us start with a general statement for any u and any prime power q. i∈[κ] Theorem 7 Let q be a prime power and let a κ × n matrix H = Hi,j j∈[n] over Fq be given. If the reduced row Echelon (RRE) form of any κ × u submatrix (denoted by H(u) ) has the following form (up to column permutations)1 : RRE(H(u) ) = 1 . . . •} ◦ ◦ . . . ◦ | • {z ≤q−1 . . . •} |1 • {z ≤q−1
0
(3) ... ... ◦ ◦ ... ◦ ... 1| • {z . . . •} ◦ . . . .. ≤q−1 .
... ◦ ... ◦ ... ◦ .. .
,
1| • {z . . . •} ≤q−1
where • has to be a non-zero element from Fq and ◦ is any element from Fq , then, there exists a u-PSMC over Fq of length n and redundancy r = κ. Proof: Assume w.l.o.g. that the partially stuck-at-1 positions are [u]. As before, if q is a prime power, we fix a mapping from the elements of the extension field Fq to the set of integers [q]. The encoding and decoding follow similar steps as Algorithm 1. From a given message vector m ∈ [q]n−κ , we first define a vector w = (0κ , m). Then, we search a vector z such that y = w + z · H masks all the partially stuck-at-1 cells. First, assume that RRE(H) can mask any u partially stuck-at-1 cells and let us show that then also H can mask any u partially stuck-at-1 cells. By assumption, there is a vector z = (z0 , z1 , . . . , zκ−1 ) such that y = w + z · RRE(H) masks all the partially stuck-at-1 cells. Since H = T · RRE(H), for some κ × κ full-rank matrix T, the vector e z = z · T−1 masks the −1 same stuck-at cells when multiplied by H since e z · H = z · T H = z · RRE(H). Second, we prove that RRE(H) can mask any u partially stuck-at-1 cells. To simplify notations, assume w.l.o.g. that each “block” of RRE(H(u) ) has length exactly q − 1, if is shorter it is clear that the principle also works. Similar to the proof of Theorem 4, there is (at least) one value z0 ∈ Fq such that (4)
z0 · H0,i 6= −wi , ∀i ∈ [q − 1],
since (4) consists of (at most) q − 1 constraints and there are q possible values for z0 . Hence, (z0 , z1 , . . . , zκ−1 ) · RRE(H(u) ) will mask the first q − 1 partially stuck-at-1 cells for any z1 , . . . , zκ−1 since wi + z0 · H0,i 6= 0, for all i = 0, . . . , q − 2. Similarly, there is (at least) one value z1 ∈ Fq such that z1 · H1,i 6= −(wi + z0 · H0,i ), ∀i ∈ [q − 1, 2q − 3], and (z0 , z1 , . . . , zκ−1 ) · RRE(H(u) ) will mask the second q − 1 partially stuck-at-1 cells for any z2 , . . . , zκ−1 . This principle can be continued for each block of q − 1 cells and clearly, column permutations of RRE(H(u) ) pose no problem on this strategy. In contrast to Theorem 4, it is not clear if a similar statement as Theorem 7 also holds if q is not a prime power. n Example 4 Based on Theorem 7, the following κ × n matrix, where κ = d q−1 e, can clearly mask up to u = n partially stuck-at-1 cells over Fq : 1 . . . 1} | 1 {z q−1 . . . 1} |1 1 {z 1| 1 {z . . . 1} q−1 . . q−1 . . 1| 1 {z . . . 1}
0
0
≤q−1
n The redundancy of this code for masking any u ≤ n stuck-at-one cells is r = κ = d q−1 e. Thus, for q ≥ n + 1, this provides codes for masking up to u = n partially stuck-at-1 cells with redundancy r = 1. However, for u = n partially stuck-at-1 cells, we can always use the trivial construction from Section II, which outperforms the previous matrix for all q > 2. 1 Notice
that RRE(H(u) ) can have less than κ rows.
10
The following theorem shows a construction of u-PSMCs based on the parity-check matrix of linear codes. The proof uses Theorem 7. Theorem 8 (Construction II) Let u ≤ q + d − 3, u ≤ n, k < n, and let H be a systematic (n − k) × n parity-check matrix of an [n, k, d]q code. Then, there exists a u-PSMC over Fq of length n and redundancy r = n − k. Proof: Since H is the parity-check matrix of an [n, k, d]q code, for ` ≥ d − 1, any (n − k) × ` submatrix of H has rank at least d − 1 and contains no all-zero column. Let us consider the reduced row echelon (RRE) of any u columns of H. If u < d − 1, it is a square u × u matrix of rank u and a special case of (3) with exactly one element in each “block”. Else, it has at least d − 1 rows and u columns of the following form: 1 ◦ ... ... ... ◦ ◦ ... ◦ 1 ◦ . . . . . . ◦ ◦ . . . ◦ 1 ◦ . . . ◦ ◦ . . . ◦ (5) , .. .. . . ◦ ◦ ... ◦ 1 ◦| ◦ {z . . . ◦}
0
≤u−d+1
where ◦ is some element from Fq . The matrix H contains no all-zero columns, and thus its RRE contains no all-zero columns. This holds since RRE(H) = T · H for some full-rank matrix T and therefore, for some column vector bT (which denotes an arbitrary column of H), the column vector aT = T · bT (the corresponding column of RRE(H)) is all-zero if and only if b = 0. Hence, each of the (at most) u − d + 1 rightmost columns in (5) has at least one non-zero element. For any of these u − d + 1 columns, its lowermost non-zero symbol determines to which of the first d − 1 columns it will be associated. Hence, in the worst case, there is one such set of columns of size u − d + 2 (the rightmost u − d + 1 columns and one of the leftmost d − 1 columns). Thus, for u − d + 2 ≤ q − 1, (5) is a special case of (3). According to Theorem 7, we can therefore mask any u partially stuck-at-1 cells with this matrix and the redundancy is r = n − k. Algorithm 7 shows the encoding procedure for this u-PSMC. For simplicity, a systematic (n − k) × n parity-check matrix H of the [n, k, d]q code is used. Algorithm 7. E NCODING -II m; φ0 , φ1 , . . . , φu−1
Input: • message: m = (m0 , m1 , . . . , mk−1 ) ∈ [q]k • positions of partially stuck-at-1 cells: {φ0 , φ1 , . . . , φu−1 } ⊆ [n] 1
w = (w0 , w1 , . . . , wn−1 ) ← (0n−k , m0 , m1 , . . . mk−1 )
2
Find z = (z0 , z1 , . . . , zn−k−1 ) as explained in the proof of Theorem 7
3
y ←w+z·H Output: vector y with yφi ≥ 1, ∀i ∈ [u]
The decoding is shown in Algorithm 8. Both algorithms work similarly as Algorithms 1 and 2, but the restriction on the error-correcting code [n, k, d]q is weaker and therefore our u-PSMC has a smaller redundancy than the u-SMC. Algorithm 8. D ECODING -II y) Input: • stored vector: y = (y0 , y1 , . . . , yn−1 ) ∈ [q]n 1
b z ← (y0 , y1 , . . . , yn−k−1 )
2
b = (w w b0 , w b1 , . . . , w bn−1 ) ← y − b z·H
3
b ← (w m bn−k , w bn−k+1 , . . . , w bn−1 ) b ∈ [q]k Output: message vector m
Notice that for q = 2, a PSMC is just an SMC and the construction from Theorem 8 is equivalent to the one from Theorem 1. Theorem 8 leads to the following corollaries.
11
Corollary 1 If q ≥ 2 is a prime power, then for all u ≤ n, there exists a u-PSMC with redundancy r = max{1, ρq (n, u − q + 3)} and therefore rq (n, u, 1) ≤ max{1, ρq (n, u − q + 3)}. Corollary 2 (Construction II for u = q) If q ≥ 2 is a prime power, then for all u = q ≤ n, there exists a q-PSMC with redundancy r = ρq (n, 3) and therefore rq (n, q, 1) ≤ ρq (n, 3). Theorem 8 shows that in many cases, we can decrease the redundancy by several q-ary symbols compared to SMCs. More specifically, according to Theorem 1, in order to construct codes which correct u = q stuck-at cells, one needs to use a linear code with minimum distance u + 1, while according to Theorem 8, for u = q partially stuck-at-1 cells, it is enough to use a linear code with minimum distance 3. The next example demonstrates that in many cases, this improvement is quite large. Example 5 Let u = q = 5 and n = 30. To mask u partially stuck-at-1 cells, we use the parity-check matrix of a [30, 27, 3]5 code, which is the code of largest cardinality over F5 for n = 30 and d = 3 and thus its redundancy is r = 3 (see [8]). To compare with SMCs, we need a code with minimum distance d = 6 (compare Theorem 1). The best known one according to [8] has parameters [30, 22, 6]5 so its redundancy is r = 8. The trivial construction from the upper bound requires redundancy 4.16. Therefore, we improve upon both constructions. However, note that it is still far from the lower bounds from (2) (which is 0.69) and from Theorem 3 (which is 1.11). Another application of Theorem 8 (and Corollary 2) uses the parity-check matrix of the ternary Hamming code with r parameters [n = 3 2−1 , n − r, 3]3 to obtain a 3-PSMC. The redundancy of this construction is r = log3 (2n + 1). The following example shows how to use the same Hamming code, but double the code length and thus reduce the redundancy.
Example 6 Let u = q = 3, and n = 8. We will show how to encode 6 ternary symbols using the matrix 1 1 0 0 1 1 1 1 H= . 0 0 1 1 1 1 2 2 Any two columns of ( 10 01 11 12 ) are linearly independent (it is the parity-check matrix of the [4, 2, 3]3 Hamming code), and therefore, any submatrix of H, which consists of three columns, has rank two and its RRE is of the form stated in (3). Let m = (m0 , m1 , m2 , m3 , m4 , m5 ) = (1, 0, 2, 0, 1, 2) be the message and assume that the cells at positions 0, 2, 4 are partially stuck-at-1. We first set the memory state to be w = (0, 0, m0 , m1 , m2 , m3 , m4 , m5 ) = (0, 0, 1, 0, 2, 0, 1, 2). Similar to the construction in Theorem 4, we seek to find a length-2 ternary vector z = (z0 , z1 ) such that the vector y = w + z · H masks the three partially stuck-at-1 cells. Hence, we can choose z = (1, 1) and thus, y = (1, 1, 2, 1, 1, 2, 1, 2) masks the three partially stuck-at-1 cells. It is possible to show that this property holds for any three partially stuck-at-1 cells and any message vector of length 6. This provides a code of length n = 8 and redundancy r = 2 for masking any u = 3 partially stuck-at-1 cells. The first part of the upper bound from (1) uses the trivial construction and gives 2.95. The second part of the upper bound is ρ4 (8, 4) = 4 (compare [8]) and thus, our construction requires less redundancy. The lower bound on the redundancy from (1) is 1.107, and the one from Theorem 3 is 1.161. Example 6 is not a special case of Theorem 8. The principle from Example 6 works for u = 3 and arbitrary q with the corresponding q-ary Hamming code. Unfortunately, it is not clear how to generalize it to arbitrary values of u or how to find other non-trivial matrices which fulfill the requirements of Theorem 7. VI. C ONSTRUCTION U SING B INARY C ODES FOR PARTIALLY S TUCK - AT L EVEL s = 1 C ELLS In this section, we describe a construction of u-PSMCs for masking u partially stuck-at-1 cells by means of binary SMCs. This construction works for any u; however, for u < q, the constructions from the previous sections achieve smaller redundancy, therefore and unless stated otherwise, we assume in this section that n ≥ u ≥ q. For a vector w ∈ [q]n and a set U ⊆ [n], the notation wU denotes the subvector of w of length |U | which consists of the positions in U . Let U contain the locations of the u partially stuck-at-1 cells, and let a vector w ∈ [q]n be given, then our construction of PSMCs has two main parts: 1) Find z ∈ [q] such that the number of zeros and (q − 1)s is minimized in the vector (w(z) )U = (w + z · 1n+1 )U , and denote this value by u e. 2) Use a binary u e-SMC to mask these u e stuck-at cells. This idea provides the following theorem.
12
Theorem 9 (Construction III Using Binary Codes) Let n, q ≥ 4 and u ≤ n be positive integers and let u e = b2u/qc. e given by Theorem 1. Then, there exists Assume that Ce is an [n, k, d ≥ u e + 1]2 binary u e-SMC with encoder Ee and decoder D a u-PSMC over [q] of length (n + 1) and redundancy q + 2. r = (n − k − 1) logq bq/2c Proof: We will give the explicit algorithms for encoding and decoding. We assume that H is a systematic (n − k) × n e of the code C, e parity-check matrix of the code Ce and we refer to Algorithms 1 and 2 as the encoder Ee and decoder D respectively. Let us start with the encoding algorithm for the u-PSMC. Algorithm 9. E NCODING -III m; m0 ; U
Input: • messages: m = (m0 , m1 , . . . , mk−1 ) ∈ [q]k and n−k−1 m0 = (m00 , m01 , . . . , m0n−k−2 ) ∈ bq/2c • positions of partially stuck-at-1 cells: U = {φ0 , φ1 , . . . , φu−1 } ⊆ [n + 1] 1 2
3 4
5
w = (w0 , w1 , . . . , wn ) ← (0n−k , m0 , m1 , . . . , mk−1 , 0) Find z ∈ [q] such that the vector (w(z) )U has at most u e zeros and (z) e (q − 1)s, where w = (w + z · 1n+1 ) mod q. Let U be the set of these positions. (z)
(z)
If z > 0 then wn ← z, else wn ← q − 2 (z)
Let v = (v0 , v1 , . . . , vn−1 ) ∈ [2]n be such that vi ← 1 if wi = q − 1, else vi ← 0 e ; 1n Apply Algorithm 1: c0 ← Ee (vn−k , vn−k+1 , . . . , vn−1 ); U e c ← (c0 0)
6
e ← (2m00 , 2m01 , . . . , 2m0n−k−2 , 0k+2 ) ∈ [q]n+1 m
7
e mod q y ← (w(z) + e c + m) Output: vector y ∈ [q]n+1 with yφi ≥ 1, ∀i ∈ [u]
First, we show that in Step 2 of Algorithm 9, there exists z ∈ [q] such that the vector (w(z) )U has at most u e zeros and (q − 1)s, where w(z) = (w + z · 1) mod q. The value u e is equivalent to the minimum number of cells in any two (cyclically) consecutive levels in w. That is, let us denote vi = |{j : wj = i, j ∈ {φ0 , . . . , φu−1 }|, for all i ∈ [q]. Then, we seek to minimize the value of vi + v(i+1) mod q , Pq−1 where i ∈ [q]. Since i=0 (vi + v(i+1) mod q ) = 2u, according to the pigeonhole principle, there exists an integer z ∈ [q] such that vz + v(z+1) mod q ≤ b2u/qc = u e. Therefore, the vector (w(z) )U has at most u e zeros and (q − 1)s, and the set of these e positions is denoted by U . We write the value of z in the last cell and if z = 0, we write wn = q − 1 which is necessary in the event where the last cell is partially stuck-at-1. Next, we treat the u e cells of w(z) of value 0 or q − 1 as binary stuck-at cells since adding 0 or 1 to the other u − u e cells still masks those partially stuck-at-1 cells as they will not reach level 0. Therefore, according to Theorem 1, we can use the encoder of Ee of the code Ce as done in Steps 4 and 5. The first part of Step 5 is a call of Algorithm 1. In order to do so, we first generate a length-n binary vector v where its value is 1 if and only if the corresponding cell has value q − 1. Then, we require that the u e cells will be stuck-at level 1. This will guarantee that the output e c has value 1 if the corresponding partially stuck-at cell was in level 0 and its value is 0 if the corresponding cell was in level q − 1. We note that here we took only the last n − k indices of the vector v as this is the form of the input vector in Algorithm 1, while the vector v corresponds to the vector w in Algorithm 1. The first n−k cells contain so far only binary values, thus, we use the first n−k −1 cells to write another symbol with bq/2c values in each cell, as done in Steps 6 and 7. The last cell in this group of n − k cells remains to store only a binary value, which is necessary to determine the value of z in the decoding algorithm. To complete the proof, we present the decoding algorithm.
13
Algorithm 10. D ECODING -III y) Input: • stored vector: y = (y0 , y1 , . . . , yn ) ∈ [q]n+1 1 2 3 4 5 6
If (yn−k−1 − yn ) mod q ≤ 1 then zb ← yn , else zb ← 0 b ← y − zb · 1n+1 y c0 ← (bb m y0 /2c , bb y0 /2c , . . . , bb yn−k−2 /2c) b t ← (b y0 − 2m b 00 , . . . , ybn−k−2 − 2m b 0n−k−2 , ybn−k−1 ) mod q cb0 ← b t·H b ← (b m yn−k − b c0n−k , . . . , ybn−1 − b c0n−1 ) mod q c0 ∈ bq/2c n−k−1 b ∈ [q]k and m Output: message vectors m
In Step 1, we first determine the value of z. Note that if z 6= 0 then yn−k = yn = z or yn−k = (yn + 1) mod q and in either case the condition in this step holds. In case z = 0 then yn = q − 2 and yn−k = 0 or yn−k = 1 so (yn−k−1 − yn ) mod q ≥ 2 (since q ≥ 4). Therefore, we conclude that zb = z. c0 = m0 . In Steps 4 and 5, we In Step 3, we determine the value of the second message m0 . Since zb = z, we get that m 0 0 0 b follow Algorithm 2 in order to decode the vector c and get that c = c . Lastly, in Step 5 we retrieve the first message vector b = m. and get m The size of the message we store in this code is M = q k · b(q/2)cn−k−1 and the redundancy of this u-PSMC is r = n + 1 − logq M = n + 1 − logq (q k · bq/2cn−k−1 ) = n − k + 1 − (n − k − 1) · logq (bq/2c) q + 2. = (n − k − 1) logq bq/2c The following examples shows the complete encoding and decoding processes described in Theorem 9. Example 7 Let q = 4, n = 15, k = 11, u = 5 and U = {1, 4, 8, 12, 15} ⊂ [16] be the set of partially stuck-at-1 positions. Then, u e = b2u/qc = 2 and we can use the [15, 11, 3]2 code Ce as the binary 2-SMC. The following matrix is a systematic e parity-check matrix of C: H=
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 1
.
Let m = (0, 3, 2, 1, 2, 2, 3, 1, 3, 2, 2) and m0 = (1, 0, 1). Let us first show the steps of the encoding algorithm. With z = 1 in Step 2, we have in the different steps of Algorithm 9 (the partially stuck-at-1 positions are underlined): Step 1:
w = (0, 0, 0, 0, 0, 3, 2, 1, 2, 2, 3, 1, 3, 2, 2, 0)
Steps 2&3: w(z) = (1, 1, 1, 1, 1, 0, 3, 2, 3, 3, 0, 2, 0, 3, 3, 1) Therefore, (w(z) )U = (1, 1, 3, 0, 1) has two 0s/3s which equals u e. Further, we obtain: Step 4:
v = (0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1)
Step 5:
c0 = (1, 0, 0, 0) · H =
Step 6:
= (1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1) e c = (1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0) e = (2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) m
Step 7:
y = (0, 1, 3, 1, 1, 0, 3, 2, 3, 0, 1, 3, 1, 0, 0, 1)
Clearly, the partially stuck-at-1 positions are masked in the vector y.
14
Let us now show the decoding process, i.e., Algorithm 10. Step 1: y3 −y15 = 0 =⇒ zb = 1 b = (3, 0, 2, 0, 0, 3, 2, 1, 2, 3, 0, 2, 0, 3, 3, 0) Step 2: y c0 = (b3/2c , 0, b2/2c) = (1, 0, 1) Step 3: m Step 5:
b t = (3 − 2, 0 − 0, 2 − 2, 0) = (1, 0, 0, 0) cb0 = b t · H = (1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1)
Step 6:
b = (0, 3, 2, 1, 2, 2, 3, 1, 3, 2, 2). m
Step 4:
We have therefore successfully recovered the messages m and m0 and the redundancy to mask these five partially stuck-at-1 cells is r = 3.5 q-ary cells. Construction II from Corollary 1 requires redundancy ρ4 (16, 4) = 4. The lower bound from (1) gives 1.037 and the lower bound from Theorem 3 gives 1.26. As a comparison, to mask u = 5 usual stuck-at cells in a block of 16 cells, we need a quaternary code of length n = 16 and distance d ≥ u + 1 = 6. The largest such code is a [16, 9, 6]4 code with 7 redundancy symbols. The trivial construction from Theorem 2 needs redundancy 3.11. For this example, the new construction is thus worse than the trivial one. However, for larger n, the influence of the +2 in the redundancy diminishes and our construction outperforms the trivial one (see Example 8), but the principle of the construction is easier to show with short vectors. Example 8 Let q = 4, n = 63, k = 57 and u = 5. Then, the required redundancy for Construction II from Corollary 1 is ρ4 (64, 4) = 6 and for Construction III from Theorem 9, it is r = 4.5. This improves significantly upon the upper bounds from Theorem 2 since the trivial construction from Theorem 2 needs redundancy 13.1 and ρ4 (64, 6) = 13. The next corollary summarizes this upper bound on the redundancy for n cells. Corollary 3 For all 4 ≤ q ≤ u ≤ n we have that + 1 −1 · log rq (n, u, 1) ≤ ρ2 n − 1, 2u q q
q bq/2c
+ 2.
Therefore, if we use a binary [n = 2rH − 1, n − rH , 3]2 Hamming code as a u e-SMC with u e = 2, then u ≤ q + q−1 2 has to hold. For even q, we therefore have u ≤ q + q/2 − 1. Then, the required redundancy is r = (rH − 1) logq (2) + 2 = (log2 (n + 1) − 1) · logq (2) + 2. Note that for u → n and for large q, the trivial construction from Section II is quite good. Construction III outperforms the trivial construction if u > q and n u. VII. G ENERALIZATION OF THE C ONSTRUCTIONS TO A RBITRARY PARTIALLY S TUCK - AT L EVELS The main goal of this section is to consider the generalized model of partially stuck-at cells as in Definition 1. This model is applicable in particular for non-volatile memories where the different cells might be partially stuck-at different levels. Let U = {φ0 , φ1 , . . . , φu−1 } be the set of locations of the partially stuck-at cells where the i-th cell, for i ∈ {φ0 ,P φ1 , . . . , φu−1 }, q−1 is partially stuck-at level si . We denote by ui , i ∈ [q], the number of cells which are partially stuck-at level i (thus, i=1 ui = u) and by Ui ⊆ [n], ∀i ∈ [q], the set of positions which are partially stuck-at-i. Note that some values of ui might be zero and thus the corresponding sets Ui are the empty set. In the sequel of this section, we generalize the constructions from Sections IV, V and VI to the generalized model of partially stuck-at-s cells, where s = (s0 , s1 , . . . , su−1 ) ∈ [1, q − 1]u . We only give the main theorems without showing the explicit decoding algorithms and mostly without examples since these results are a direct consequence of the previous sections. A. Generalization of Construction I Construction I from Theorem 4 (including its improvement from Theorem 5) generalizes as follows. Pu−1 Theorem 10 (Generalized Construction I) If i=0 si < q and u ≤ n, then for all n, there exists a (u, s)-PSMC, where s = (s0 , s1 , . . . , su−1 ) ∈ [0, q − 1]u , over [q] of length n and redundancy $ % q r = 1 − logq Pu−1 . i=0 si + 1 Proof: The proof is a generalization of the proofs of Theorem 4 and Theorem 5. Let m ∈ [q]n−1 be the message vector, define w = (0 m) and let y = w + z · 1n be the vector that we will store. We have to find z such that yφi = (wφi + z) ∈ / [si ],
15
∀i ∈ [u]. Each partially P stuck-at-si cell excludes at most si possible values for z, in total the u cells therefore exclude at most P u−1 u−1 s values and if is at least one value z ∈ [q] such that yΦi = (wΦi + z) ∈ / [si ], ∀i ∈ [u]. i i=0 i=0 si < q, there Pu−1 / [si ], for all i ∈ [u]. Therefore, we can save In particular, there is always a z ∈ [ i=0 si + 1] such that yφi = (wφi + z) ∈ additional information in the redundancy cell and as a generalization of Theorem 5, the statement follows. The encoding and decoding processes are analogous to Algorithms 3 and 4, and Algorithms 5 and 6, respectively. Unfortunately, we cannot claim (as in Theorem 6 for si = 1, ∀i) that this construction is asymptotically optimal, since the lower bound on the redundancy in Theorem 3 does not depend asymptotically on the value of s. For example, if si = s, ∀i, and (su + 1) | q, then the redundancy of Theorem 10 is r = logq (su + 1), but the lower bound form Theorem 3 approaches only rq (n, u, s) = logq (u + 1) for n large enough. B. Generalization of Construction II In order to generalize Construction II from Theorem 8, let us first generalize Theorem 7. i∈[κ] Theorem 11 Let q be a prime power and let a κ × n matrix H = Hi,j j∈[n] over Fq be given. Let s = maxi∈[u] si . If the RRE of any κ × u submatrix (denoted by H(u) ) has the following form (up to column permutations:) RRE(H(u) ) = 1 . . . •} ◦ ◦ . . . ◦ | • {z ≤dq/se−1 1 • . . . • | {z } ≤dq/se−1
0
(6) ... ... ◦ ◦ ... ◦ ... 1| • {z . . . •} ◦ . . . .. ≤dq/se−1 .
... ◦ ... ◦ ... ◦ .. .
,
1| • {z . . . •} ≤dq/se−1
where • has to be a non-zero element from Fq and ◦ is any element from Fq , then, there exists a (u, s)-PSMC over [q] of length n and redundancy r = κ. Proof: Follows from the proof of Theorem 11 with similar generalizations as in Theorem 10. Notice that the largest si restricts the size of the matrix and it is not clear how to consider the explicit values si in this generalization and not only the maximum value. Based on Theorem 11, we can generalize Construction II as follows. Theorem 12 (Generalized Construction II) Given s = (s0 , s1 , . . . , su−1 ) ∈ [1, q − 1]u . Let s = maxi∈[u] si , let u ≤ dq/se + d − 3, u ≤ n, k < n, and let H be a systematic (n − k) × n parity-check matrix of an [n, k, d]q code. Then, there exists a (u, s)-PSMC over Fq of length n and redundancy r = n − k. Proof: Similar to the proof of Theorem 8 using Theorem 11. Corollary 4 If q ≥ 2 is a prime power, then for all u ≤ n and s ∈ [1, q − 1], there exists a (u, s)-PSMC with redundancy r = max{1, ρq (n, u − dq/se + 3)} and therefore rq (n, u, s) ≤ max{1, ρq (n, u − dq/se + 3)}. C. Generalization of Construction III In the following, we want to generalize Construction III from Theorem 9. In the first step, we suggest a generalization to the case where all partially stuck-at cells are stuck at the same level s, for some 1 ≤ s ≤ q − 1. For this purpose, we use a Q-ary code, where Q ≥ s + 1 is a prime power, and the principle consists of the following two steps: 1) Find z ∈ [q] such that the number of the values contained in the set S = {q − Q + 1, . . . , q − 1, 0, . . . , s − 1} of size Q + s − 1 is minimized in (w(z) )U = (w + z · 1n )U . Denote the number of values from S in (w(z) )U by u e. 2) Use a Q-ary u e-SMC to mask these u e stuck cells. This leads to the following theorem. Theorem 13 (Generalized Construction III for si = s) Let n, q ≥ 4, u be positive integers, let s ∈ [1, q − 1], and let Q ≥ s + 1 be a prime power. Denote (Q + s − 1)u . u e= q
16
e given by Theorem 1. Then, there exists Assume that Ce is an [n, k, d ≥ u e + 1]Q Q-ary u e-SMC with encoder Ee and decoder D a (u, s)-PSMC over [q] of length (n + 1) and redundancy q + 2. (7) r = (n − k − 1) logq bq/Qc Proof: Let S = {q − Q + 1, . . . , q − 1, 0, . . . , s − 1} of cardinality Q + s − 1. As in the proof of Theorem 9, we first show that there is some scalar z such that (w(z) )U has at most u e entries from S. The value u e is equivalent to the minimum number of any Q + s − 1 consecutive values in wU . Denote vi = |{j : wj = i, j ∈ {φ0 , . . . , φu−1 }|, for all i ∈ [q]. Hence, we PQ+s−2 Pq−1 PQ+s−2 want to minimize j=0 vi+j mod q , i ∈ [q]. Since i=0 j=0 vi+j mod q = (Q + s − 1)u, there exists an integer i such PQ+s−2 c and therefore, there is a z such that (w(z) )U contains at most u e = b (Q+s−1)u c values that j=0 vi+j mod q ≤ b (Q+s−1)u q q from S. Second, we treat those u e cells of (w(z) )U , which have values in S, like usual Q-ary stuck cells. Note that adding any value from the set [Q] to the other u − u e cells still masks the partially stuck-at-s cells. Therefore, we can use an [n, k, d ≥ u e + 1]Q code to mask these cells (see Theorem 1). n−k−1 As a generalization of Theorem 9, we choose m ∈ [q]k and m0 ∈ bq/Qc and the statement on the redundancy follows. Note that if Q + s − 1 ≥ q, then u e ≥ u and instead of using Theorem 13, we should use a q-ary u-SMC or another construction. Let us now describe a method to generalize the construction from Theorem 9 (respectively Theorem 13) to the case where the cells are partially stuck-at different levels, given by s = (s0 , s1 , . . . , su−1 ). We want to use a Q-ary SMC, where Q ≥ maxi {si } + 1, to obtain an (u, s)-PSMC. Of course, one way is to define s = maxi {si } and to consider the cells as partially stuck-at-s cells and use Theorem 13. However, we can do better by refining the “minimization step” as done in the following theorem. Theorem 14 (Generalized Construction III) Let n, q ≥ 4 and u be P positive integers. Let s = (s0 , s1 , . . . , su−1 ) ∈ [1, q − 1]u q−1 be given and denote ui = |{sj = i, ∀j ∈ [u]}|, ∀i ∈ [q]. Then, u = i=1 ui and let Q ≥ maxi {si } + 1 be a prime power. Denote σi = min{q, Q + i − 1}, ∀i ∈ [q], and $P % q−1 u · σ i i i=1 u e= . q e given by Theorem 1. Then, there exists Assume that Ce is an [n, k, d ≥ u e + 1]Q Q-ary u e-SMC with encoder Ee and decoder D a (u, s)-PSMC over [q] of length (n + 1) and redundancy q r = (n − k − 1) logq + 2. (8) bq/Qc Proof: If a cell in Ui has a cell level in [1, q − 1], then this partially stuck-at cell is still masked after adding any value from [Q]. Thus, we want to find z ∈ [q] such that the partially stuck-at positions in the vector (w(z) )Ui = (w + z · 1n+1 )Ui contain as many values in [i, q − Q], ∀i ∈ [1, q − 1], as possible. Equivalently, we want to minimize the number of values from [q] \ [i, q − Q] in (w(z) )Ui , for all i ∈ [1, q − 1]. In the sequel, we describe a way how accomplish this. We have def σi = [q] \ [i, q − Q] = min{q, Q + i − 1}, ∀i ∈ [q], and generalizing Theorems 9 and 13, we define: (i)
v` = |{j : wj = `, j ∈ Ui }|, ∀` ∈ [q], i ∈ [1, q − 1]. We want to minimize (subject to ` ∈ [q])
q−1 σX i −1 X
(i)
v`+j mod q .
i=1 j=0
We know that
q−1 X q−1 σX i −1 X `=0 i=1 j=0
(i)
v`+j mod q =
q−1 X
ui · σi .
i=1
Thus, by the pigeonhole principle, there exists an integer ` ∈ [q] such that $P % q−1 σX q−1 i −1 X def (i) i=1 ui · σi v`+j mod q ≤ = u e. q i=1 j=0
(9)
17
Similar to Theorems 9 and 13, we can treat these u e partially stuck-at cells as Q-ary cells which are usually stuck-at. With a similar proof as in Theorems 9 and 13, this leads to the statement. Example 9 Let n = 31, q = 8, and s = (1 1 1 1 2 2 3). Hence, u1 = 4, u2 = 2, u3 = 1 and u = 7. We choose Q = 4 and we want to use a 4-ary SMC to construct a (u, s)-PSMC of length 32. The first approach is to consider all cells as partially stuck-at level s = maxi {si } = 3. Then, with Theorem 13 and Q = 4, we have u e = 5 and we need a code over F22 of length 31 and distance at least 6. The largest known such code is a [31, 23, 6]4 code (see [8]) and therefore, with (7), the required redundancy is 6.66. Let us now compare this to Theorem 14. We denote σ1 = 4, σ2 = 5 and σ3 = 6 and therefore, 4u1 + 5u2 + 6u3 = 4. u e= q We need a code over F22 of length 31 and distance at least u e + 1 = 5. The largest such known code is a [31, 24, 5]4 code (see [8]) and with (8), the required redundancy is r = 6, i.e., compared to the approach of Theorem 13, we have decreased the redundancy. The generalized Construction II from Theorem 12 needs redundancy ρ8 (32, 7) = 10. Further, the upper bound from Theorem 2, gives 7.01 and we also improve upon this bound. VIII. C ODES FOR C ELLS WITH U NREACHABLE L EVELS In flash memories, it might happen that certain levels cannot be reached or should not be programmed anymore since they are highly unreliable, see e.g. [6]. Finding codes that mask these cells can be seen as the dual problem to finding PSMCs. Namely, we want to find a code as follows. Definition 2 (Codes for Unreachable Levels) An (n, M )q (u, s)-unreachable-masking code ((u, s)-UMC) C is a coding scheme with encoder E and decoder D. The input to the encoder E is the set of locations {φ0 , . . . , φu−1 } ⊆ [n], the unreachable levels s = (s0 , s1 , . . . , su−1 ) ∈ [q − 1]u of some u ≤ n cells and a message m ∈ [M ]. Its output is a vector y(m) ∈ [q]n which masks the values of the u cells with unreachable levels, i.e., (m)
yi
≤ si , ∀i ∈ {φ0 , φ1 , . . . , φu−1 },
and its decoded value is m, that is D(y(m) ) = m. The following theorem establishes a connection between PSMCs and UMCs. Theorem 15 Given a (u, s)-PSMC with s = (q − 1 − s0 , q − 1 − s1 , . . . , q − 1 − su−1 ) and redundancy r. Then, this code can be used as a (u, e s)-UMC with e s = (s0 , s1 , . . . , su−1 ) and redundancy r. Proof: Assume we want to write a message into n memory cells where the levels at positions φ0 , φ1 , . . . , φu−1 can be at most s0 , s1 , . . . , su−1 . We construct a (u, s)-PSMC with redundancy r for the levels s = (q−1−s0 , q−1−s1 , . . . , q−1−su−1 ). (m) The output of this encoder is a vector y(m) such that yi ≥ q − 1 − si , ∀i ∈ {φ0 , φ1 , . . . , φu−1 }. def (m) (m) (m) Therefore, the vector y(m) = (q − 1 − y0 , q − 1 − y1 , . . . , q − 1 − yn−1 ) has the property that (m)
yi
≤ q − 1 − (q − 1 − si ) = si ,
∀i ∈ {φ0 , . . . , φu−1 },
and therefore, we write y(m) into the cells and have constructed a (u, e s)-UMC with e s = (s0 , s1 , . . . , su−1 ) and redundancy r. The construction by Gabrys, Sala and Dolecek from [6] is based on tensor product codes and can mask unreliable cells and correct additional random errors. To compare their construction to our results, we assume that no random errors occur (i.e., in their notation t1 = t2 = 0). Then, their matrix H3 defines an [n, n, 0]4 code (in their notation, meaning it does not correct any error), H4 defines an [n, k4 , 0, `]2 code (meaning it is a `-SMC which cannot correct additional random errors). Therefore, d4 ≥ ` + 1, see e.g., [9] and due to the Singleton bound k4 ≤ n − d4 + 1 = n − `. The construction from [6, p. 1492] yields a code for masking the unreliable cells of length 3n and dimension 2k3 + k4 ≤ 3n − `. Thus, their required redundancy is r ≥ `, which is the same as the one for a `-SMC and thus, their construction does not give any improvement compared to [9]. As shown in the previous sections and in Theorem 15, our constructions therefore improve on both, [9] and [6], when masking memory cells with unreachable levels.
18
IX. T HE C APACITY OF THE PARTIALLY S TUCK - AT C ELL C HANNEL In this section, we study the setup of partially stuck-at cells from the capacity point of view. For fixed integers q > 1 and 0 < s < q, we consider the storage channel in which a cell can be partially stuck-at level s with probability p. This channel model is an example of a discrete memoryless memory cell which was studied by Heegard and El Gamal in [10]. In the partially stuck-at cell model, we assume that a cell is partially stuck-at level s with some probability p. If a letter x ∈ X = {0, 1, . . . , q − 1} is stored in a cell, then the letter y ∈ Y = {0, 1, . . . , q − 1} is retrieved where y = max{x, s} with probability p. If both, the encoder and decoder, know the state of the memory, i.e. the locations and levels of the partially stuck-at cells, then the capacity of this channel is q . (10) Cq (p, s) = 1 − p + p logq (q − s) = 1 − p logq q−s To see this, notice that the lower bound on the redundancy from Theorem 2 holds also in this case as this is the number of all different memory states that can be programmed. The capacity is achievable since both the encoder and decoder know the locations of the partially stuck-at memory cells and thus can use all programmable memory states. Furthermore, according to [10], the capacity of any discrete memoryless memory cell channel in the case where only the encoder knows the memory state is the same as the one where both the encoder and decoder know the memory state. Thus, we conclude that (10) is the capacity of the model studied in this work. In the following, we want to analyze how close our constructions are to the capacity. Let us first consider the case s = 1. The construction based on binary codes from Section VI can mask u = pn partially stuck-at-1 memory cells if there exists an [n, k, d]2 binary code that can mask u e = b2u/qc = b2pn/qc binary usual stuck-at cells (which is the case if d ≥ u e + 1, see Theorem 1). Assume there exists a family of capacity-achieving linear binary codes with these properties, then we can use this family of codes in order to construct a family of PSMCs. Asymptotically, for large n and any q, the maximum achievable code rate of the construction from Theorem 9 approaches the value 2p q n−r =1− logq . Rq (p, 1) = n q bq/2c Similarly, for arbitrary s (for simplicity assume that Q = s + 1 is a power of a prime), we obtain a family of PSMCs whose maximum achievable rate approaches the value q 2sp logq . Rq (p, s) = 1 − q bq/(s + 1)c Finally, we conclude that the difference between the capacity and the redundancy of this construction is given by Cq (p, s) − Rq (p, s) 2s q q =p· , logq − logq q bq/(s + 1)c q−s {z } |
(11)
def
= ∆(q,s)
where we call ∆(q, s) the difference coefficient. Table I shows the values of the difference coefficient ∆(q, s) for different values of q and s. Table I T HE DIFFERENCE COEFFICIENT ∆(q, s) FOR DIFFERENT VALUES OF q AND s, WHERE 0 < s < q WHERE s + 1 IS A PRIME POWER .
q=2 q=3 q=4 q=5 q=6 q=7 q=8 q = 11 q = 13 q = 16 q = 21 q = 32
s=1
s=2
s=3
s=4
s=6
s=7
0 0.29 0.042 0.089 0.027 0.045 0.019 0.020 0.015 0.0079 0.0072 0.0033
0.33 0.5 0.48 0.18 0.19 0.19 0.11 0.076 0.057 0.036 0.023
0.5 0.63 0.61 0.57 0.27 0.25 0.16 0.11 0.084 0.047
0.6 0.72 0.71 0.67 0.33 0.31 0.19 0.14 0.082
0.71 0.83 0.76 0.68 0.39 0.25 0.17
0.75 0.85 0.77 0.45 0.38 0.19
In the same way, Figure 1 illustrates the difference coefficient for some values of q and s. We see that the difference coefficient tends to zero for q large enough. The “plateaus” in the plots occur due to the floor operation in (11). A similar analysis can be done for the (u, s)-PSMC construction from Theorem 14.
19
1
s = 1 s = 2 s = 3
0.8
s = 6 s = 10
0.6 ∆(q, s) 0.4 0.2 0
Figure 1.
0
5
10
15 q
20
25
30
The difference coefficient ∆(q, s) for different values of q and s.
For the special case s = 1 and when q is large enough, we neglect the floor operation and we can use the approximation ln(q) − ln(q − 1) ≈ 1/q and obtain Cq (p, 1) − Rq (p, 1) = 2 logq (2) q ≈p − logq q q−1 2 ln(2) 1 p − . ≈p ≈ 0.38 q ln(q) q ln(q) q ln(q)
(12)
Thus, we can evaluate how close the code rate from Theorems 9 and 13 come to the capacity from (10). Further, (12) shows that asymptotically, the coefficient ∆(q, 1) approaches zero when q increases. In the same way, for fixed s, the coefficient ∆(q, s) approaches 0 with increasing q. We note that the trivial construction from Theorem 2, in which only the levels s, . . . , q − 1 are used, can also be used to mask any number of cells which are partially stuck-at-s. The rate of this construction is logq (q − s), and it is greater than the value of Rq (p, s), when q is a multiple of s + 1, if 2sp logq (s + 1), q q q p≥ logs+1 . 2s q−s
logq (q − s) ≥ 1 − or
For example, for s = 1 we get that this threshold equals q log 2
q q−1
and for q large enough, this value approaches 1/(2 ln 2) ≈ 0.7213. We conclude that the maximum achievable rates, denoted by Rqmax (p, s), according to the constructions from Theorems 2, 9 and 13, when q is a multiple of s + 1, is given by ( q q 1 − 2sp log (s + 1) if p ≤ log max q s+1 q 2s q−s Rq (p, s) = logq (q − s) else In Figures 2 and 3, we plot the graphs of the capacity C(p, s) and the maximum achievable rates Rqmax (p, s) for q = 8, s = 1, 3 and q = 12, s = 1, 3, 5. Notice that asymptotically, both an SMC and Construction II have rate R = 1 − p and are therefore worse than Rqmax (p, s).
20
Cq (p, s), Rqmax (p, s)
1 0.8 0.6 0.4 C8 (p, 1) R8max (p, 1)
0.2 0
C8 (p, 3) R8max (p, 3) SMC
0
0.2
0.4
0.6
0.8
1
0.8
1
p Figure 2.
Capacity Cq (p, s) and maximum achievable rate Rqmax (p, s) for q = 8.
Cq (p, s), Rqmax (p, s)
1 0.8 0.6 C12 (p, 1)
0.4
max (p, 1) R12
C12 (p, 3) max R12 (p, 3)
0.2 0
C12 (p, 5) max R12 (p, 5) SMC
0
0.2
0.4
0.6 p
Figure 3.
Capacity Cq (p, s) and maximum achievable rate Rqmax (p, s) for q = 12.
X. C ONCLUSION In this paper, we have considered codes for masking partially stuck-at memory cells. After defining the defect model, we have derived lower and upper bounds on the minimum redundancy which is required to mask partially stuck-at cells in multilevel memories. We have presented three constructions of partially stuck-at masking codes (PSMCs). The first one masks any u < q partially stuck-at cells, where q is the number of cell levels, and requires less than one redundancy symbol. When the cells are partially stuck-at level 1 (i.e., s = 1), this construction is asymptotically optimal. The second construction is based on the parity-check matrix of an error-correcting code and works well for u ≥ q (where q is a prime power). The last construction is based on using a binary error-correcting code and can be applied for any u and q. The three constructions were first derived for s = 1 and then generalized to arbitrary stuck levels. We have further shown how these PSMCs can be applied for cells with unreachable levels (which can be seen as the dual problem to partially stuck-at cells) and that they outperform known code constructions for this model. Further, we have considered the capacity of the partially stuck-at channel and have analyzed the gap between the capacity and the achieved code rate. For s = 1, we achieve the capacity asymptotically. The following table for s = 1 provides an overview of our constructions and their required redundancies. Recall that ρq (n, d) denotes the smallest redundancy of a linear error-correcting code of length n and minimum Hamming distance d over Fq .
21
u