Patent Publication Number: US-8983921-B2

Title: System and method having optimal, systematic q-ary codes for correcting all asymmetric and symmetric errors of limited magnitude

Description:
RELATED APPLICATIONS 
     This application claims the benefit of priority of U.S. application Ser. No. 13/155,808, filed on Jun. 8, 2011, which in turn claims the benefit of priority of Provisional Application No. 61/358,109, filed on Jun. 24, 2010, the entire contents of which application(s) are incorporated herein by reference. 
    
    
     GOVERNMENT LICENSE RIGHTS 
     This invention was made with government support under Grant Nos. CCF0701452 and CCF0728810 awarded by National Science Foundation. The government has certain rights in the invention. 
    
    
     FIELD OF THE INVENTION 
     The present invention relates generally to a systems and methods for correcting errors of limited magnitude, and more particularly, but not exclusively, to computer program products and computer-implemented methods for correcting all asymmetric and symmetric errors of limited magnitude. 
     BACKGROUND OF THE INVENTION 
     Classical error control codes have been designed under the assumption of binary symmetric errors, i.e. both 1→0 and 0→1 errors can occur during transmission. Nevertheless, errors in some VLSI and optical systems are asymmetric in nature (5, 8). For example, in VLSI circuits and memories, charges may leak with time but new charges will not be added. Thus, a suitable channel model for such systems is the binary asymmetric channel (Z-channel) where errors are of one dominant type known a priori, say 1→0 errors. In Varshamov et al. (9), Varshamov introduced the q-ary asymmetric channel where the channel&#39;s input/output symbols are over the alphabet Q={0, 1, . . . , q-1}. Moreover, such channel has the property that, when a symbol aεQ is transmitted, the corresponding received symbol is in the set {0, 1, . . . , a}, assuming a decreasing error. 
     Similar to the asymmetric channel is the unidirectional channel; the difference is that the type of error is not known a priori. Asymmetric/unidirectional error control codes have been the subject of many research work (3, 7). 
     Not until recently has the notion of limited magnitude asymmetric errors been introduced (2); we say that a vector (x n-1 , x n-2 , . . . , x 0 ) over Z q  suffers an asymmetric error of maximum magnitude/level l≦q−1 if and only if the corresponding channel output (x′ n-1 , x′ n-2 , . . . , x′ 0 ) is such that x′ i ε{x i −l, x i −l+1, . . . , x i }, with x′ i εQ.  FIG. 1  illustrates the difference between the traditional q-ary asymmetric channel and the q-ary asymmetric channel with level l=1. 
     In Cassuto et al. (4), an interesting application for this special case of q-ary asymmetric channel was pointed out: multi-level flash memories. Unlike traditional single-level flash memories where each cell stores only one bit, multi-level flash memories achieve higher storage capacities and thus lower manufacturing costs by programming the cells into one of q&gt;2 threshold voltage thereby storing log 2  q bits per cell. Nevertheless, increasing the number of threshold levels imposes an important challenge (6): the voltage difference between states is narrowed since—technically—the voltage window is limited. A natural consequence is that reliability issues such as low data retention and read/write disturbs become more significant (4); errors in such cases are typically in one dominant direction and of limited magnitude. 
     In Ahlswede et al. (1), the authors introduced codes capable of correcting all asymmetric errors of limited magnitude l (or l-AEC codes for short). However, the proposed codes are non-systematic. A systematic code, where the information symbols are separated from the check symbols, is advantageous over a non-systematic code because, in a systematic code, the data processing and encoding/decoding can be done in parallel. Thus, there is a need in the art for a systematic codes for correcting all asymmetric and symmetric errors of limited magnitude. 
     SUMMARY OF DISCLOSURE 
     In one of its aspects, the present disclosure provides systems and methods for correcting all q-ary asymmetric errors of limited magnitude l, where l≦q−2. These systems and methods are advantageous in that the information symbols are separable from the check symbols. Moreover, the systems and methods may use the minimum possible redundancy. An optimal systematic code for correcting all symmetric errors of maximum level l (l-SEC code) is also provided, where 
               l   ≤       q   -   2     2       ,         
based on the similarities between l-SEC and l-AEC codes.
 
     For example, an exemplary method includes a computer-implemented method for systematic encoding of an information vector for use in correction of all asymmetric errors of maximum magnitude l, comprising: providing a q-ary information vector having k information digits, (x k-1 , x k-2 , . . . , x 0 ); computing a, the value of (x k-1 , x k-2 , . . . , x 0 ) mod(l+1) as a vector over (l+1) according to the formula a=y k-1 (l+1) k-1 +y k-2  (l+1) k-2 + . . . +y 0 (l+1) 0 , where y i =x i  mod(l+1), iε{0, 1, . . . , k-1}; representing a in radix 
             ⌈     q     l   +   1       ⌉         
number with r digits: (a r-1 , a r-2 , . . . , a 0 ), where
 
               r   ≥       k   ×     log   ⁡     (     l   +   1     )           log   ⁢     ⌈     q     l   +   1       ⌉           ;         
computing the check part, c, according to the formula c=(c r-1 , c r-2 , . . . , c 0 ), where c i =(l+1)a i , ∀iε{0, 1, . . . , r-1}; and outputting an encoded vector that includes the information digits and check part. In addition, a computer program product is provided, comprising a computer-readable medium having a computer readable program code adapted to be executed to implement the above-method.
 
     Still further, the present disclosure provides a computer-implemented method for systematic decoding of an information vector for use in correction of all asymmetric errors of maximum magnitude l, comprising: providing a q-ary encoded vector that includes an information vector having k received information digits, (x′ k-1 , x′ k-2 , . . . , x′ 0 ) and having received check symbols (c′ r-1 , c′ r-2 , . . . , c′ 0 ), where 
               r   ≥       k   ×     log   ⁡     (     l   +   1     )           log   ⁢     ⌈     q     l   +   1       ⌉           ;         
recovering the check symbols (c r-1 , c r-2 , . . . , c 0 ) by rounding each received check symbol which is not a multiple of (l+1) upwards to the nearest multiple of (l+1); computing a, the value of
 
             (         c     r   -   1         l   +   1       ,       c     r   -   2         l   +   1       ,   …   ⁢           ,       c   0       l   +   1         )         
as a vector over
 
             Z     ⌈     q     l   +   1       ⌉           
as
 
               a   =         (       c     r   -   1         l   +   1       )     ⁢       ⌈     q     l   +   1       ⌉       r   -   1         +       (       c     r   -   2         l   +   1       )     ⁢       ⌈     q     l   +   1       ⌉       r   -   2         +   …   +       (       c   0       l   +   1       )     ⁢       ⌈     q     l   +   1       ⌉     0           ;         
representing a in radix (l+1) number with k digits as y=(y k-1 , y k-2 , . . . , y 0 ); computing e i =(y i −x′ i ) mod(l+1); and computing the corrected codeword, (x k-1 , x k-2 , . . . , x 0 ), as x i =x′ i +e′ i , where i=0, 1, . . . , k-1. The present disclosure also provide analogous correction methods relating to symmetric errors of maximum magnitude l.
 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       The foregoing summary and the following detailed description of the preferred embodiments of the present invention will be best understood when read in conjunction with the appended drawings, in which  FIG. 1  illustrates q-ary asymmetric channel (left) vs q-ary asymmetric channel with level 1 (right). 
     
    
    
     DETAILED DESCRIPTION OF THE DISCLOSURE 
     The present disclosure provides methods and systems that address the need for error correction of q-ary systems, i.e., those for which q&gt;2. In this regard, in one of its aspects the present invention provides systematic q-ary codes for correcting all asymmetric and symmetric errors of limited magnitude. For example, the present disclosure provides a computer-implemented method and a computer program product for systematic encoding of an information vector for use in correction of all asymmetric errors of maximum magnitude l. The rationale and justification for such methods may be understood in view of the following exposition detailing the formulation of the methods and systems of the present disclosure. 
     Turning first to a few preliminary principles upon which the present disclosure builds, it turns out that the knowledge of the maximum error level gives nice properties that can be used in the design of error correcting codes. We start by defining a distance metric capturing these properties as introduced in R. Ahlswede et al. (1) 
     By definition, let x=(x n-1 , x n-2 , . . . , x 0 ) and y=(y n-1 , y n-2 , . . . , y 0 ) be two vectors over Z q , then the distance between x and y is defined as:
 
 d ( x,y )=max{| x   i   −y   i   |:iε{ 0,1 , . . . ,n- 1}}.
 
It is worth noting that, by properties of absolute values, d(x, y) defines a metric. Moreover, d(x, y)≦q−1 by definition.
 
     The following theorem gives the necessary and sufficient conditions on the minimum distance of an l-AEC code. 
     Theorem 1 (1): A code C ⊂ Q n  is an l-AEC code if and only if, for all distinct codewords, x, yεC, d(x, y)≧l+1. 
     Let A a (n, l, q) denote the maximum number of codewords in a q-ary l-AEC code of length n. A bound on A a (n, l, q) and a non-systematic l-AEC code achieving this bound are given in (1): 
     Theorem 2 (1): ∀n ε{1, 2, 3 . . . } and lεQ, 
                 A   a     ⁡     (     n   ,   l   ,   q     )       =         ⌈     q     l   +   1       ⌉     n     .           
Theorem 3 (1): Let C be a code of length n over Z q  defined as
 
 C ={( x   n-1   ,x   n-2   , . . . ,x   0 ): x   i ≡0 mod( l+ 1),∀ iε{ 0,1 , . . . ,n- 1}}
 
Then, C is an l-AEC code with
 
               ⌈     q     l   +   1       ⌉     n         
codewords.
 
     Finally, for further analysis, x mod a denotes the component-wise remainder of a vector x when divided by an integer a. 
     Lower Bound on the Number of Check Digits 
     In the following theorem, the minimum number of check digits needed to encode information vectors of a certain length is presented, which serves, in part, to validate the optimal nature of an l-AEC method/code of the present disclosure. 
     Theorem 4: Let C be a systematic q-ary l-AEC code, such that the number of information digits in a codeword is k. Then, the number of check digits, r, satisfies the following condition, 
             r   ≥         k   ×     log   ⁡     (     l   +   1     )           log   ⁢     ⌈     q     l   +   1       ⌉         .           
Proof. Consider the subset of information vectors, V={(x k-1 , x k-2 , . . . , x 0 ): 0≦x i ≦l, ∀iε{0, 1, . . . , k-1}}. Vectors of V can be viewed as the set of all vectors of length k over Z i+1 . Hence, ∀x, yεV, d(x, y)≦1, and |V|=(l+1) k . Therefore, by Theorem 1, the checks assigned to vectors in V must be at least l+1 apart for errors to be successfully corrected. Theorem 1 and Theorem 2.2 together give a bound on the number of vectors satisfying such criterion and we get:
 
     
       
         
           
             
               
                 ⌈ 
                 
                   q 
                   
                     l 
                     + 
                     1 
                   
                 
                 ⌉ 
               
               r 
             
             ≥ 
             
               
                 ( 
                 
                   l 
                   + 
                   1 
                 
                 ) 
               
               k 
             
           
         
       
     
     Taking the log on both sides of the above inequality we get the desired property. Q.E.D. 
     One important implication of the above theorem is that it is not possible to design a systematic code correcting all errors of maximum magnitude l when l=q−1, since the expression 
               k   ×     log   ⁡     (     l   +   1     )           log   ⁢     ⌈     q     l   +   1       ⌉             
goes to infinity in this case. Therefore, for the following discussion of the l-AEC case, an assumption is made that l≦q−2.
 
An Optimal Systematic l-AEC Code
 
     A method relating to an encoding algorithm is presented for codes which require exactly 
             r   =     ⌈       k   ×     log   ⁡     (     l   +   1     )           log   ⁢     ⌈     q     l   +   1       ⌉         ⌉           
check digits, though the present disclosure can also encompasses codes in which
 
             r   ≥       ⌈       k   ×     log   ⁡     (     l   +   1     )           log   ⁢     ⌈     q     l   +   1       ⌉         ⌉     .           
l-AEC Encoding Algorithm
 
     Input: The information vector: (x k-1 , x k-2 , . . . , x 0 ) 
     Output: The encoded vector: x=(x k-1 , x k-2 , . . . , x 0 , c r-1 , c r-2 , . . . , c 0 ) 
     A method of the present invention for l-AEC encoding may then include the steps of:
         1. Computing a, the value of (x k-1 , x k-2 , . . . , x 0 ) mod(l+1) as a vector over (l+1):
 
 a=y   k-1 ( l+ 1) k-1   +y   k-2 ( l+ 1) k-2   + . . . +y   0 ( l+ 1) 0 ,
 
where
 
 y   i   =x   i  mod( l+ 1), iε{ 0,1 , . . . ,k- 1}.
           That is, a is the number with radix (l+1) representation of (x k-1 ,x k-2 , . . . ,x 0 )mod(l+1).   
           2. Representing a in radix       

     
       
         
           
             ⌈ 
             
               q 
               
                 l 
                 + 
                 1 
               
             
             ⌉ 
           
         
       
         
         
           
              number with r digits: (a r-1 , a r-2 , . . . , a 0 ). 
             3. Computing the check part: c=(c r-1 ,c r-2 , . . . ,c 0 ), where c i =(l+1)a i , ∀iε{0, 1, . . . , r-1}. 
             4. Outputting the encoded vector x=(x k-1 , x k-2 , . . . , x 0 , c r-1 , c r-2 , . . . , c 0 ) 
           
         
       
    
     Example 1 
     The word (6, 2, 8, 1) is encoded over Z 10 , assuming a maximum error level of 2. The minimum number of check digits needed is 
             r   =       ⌈       4   ⁢           ⁢     log   ⁡     (     2   +   1     )           log   ⁢     ⌈     10     2   +   1       ⌉         ⌉     =   4.           
With notations as above, a=0×3 3 +2×3 2 +2×3 1 +1×3 0 =25 and thus (0, 1, 2, 1) is the representation of a in base 4. Therefore, the encoded codeword is (6, 2, 8, 1, 0, 3, 6, 3).
 
     The following theorem further supports the optimal nature of the above method. Theorem 5: The above construction yields codewords of minimum distance l+1. Proof. Given two distinct information vectors: v 1 =(x k-1 , x k-2 , . . . , x 0 ) and v 2 =(y k-1 , y k-2 , . . . , y 0 ), there are two possibilities: v 1  mod(l+1)≠v 2  mod(l+1) in which case each vector is assigned different check digits and, since the check digits are multiples of (l+1), the distance between the resulting codewords is at least l+1. For the second case, v 1  mod(l+1)=v 2  mod(l+1), v 1  and v 2  are assigned the same check digits. Nevertheless, by distinctness of v 1  and v 2 , ∃iε{0, 1, . . . , k-1} such that x i =y i +m (l+1), m≧1. Therefore, d(v 1 , v 2 )≧l+1, and the resulting codewords satisfy the desired property. Q.E.D. 
     l-AEC Decoding Algorithm 
     Input: The channel output: x′=(x′ k-1 , x′ k-2 , . . . , x′ 0 , c′ r-1 , c′ r-2 , . . . , c′ 0 ) 
     Output: The recovered codeword: (x k-1 , x k-2 , . . . , x 0 , c r-1 , c r-2 , . . . , c 0 ) 
     A method of the present invention for l-AEC decoding may then include the steps of:
         1. Recovering the check symbols, (c r-1 , c r-2 , . . . , c 0 ), by rounding each received check symbol which is not a multiple of (l+1) upwards to the nearest multiple of (l+1).   2. Computing a, the value of       

     
       
         
           
             ( 
             
               
                 
                   c 
                   
                     r 
                     - 
                     1 
                   
                 
                 
                   l 
                   + 
                   1 
                 
               
               , 
               
                 
                   c 
                   
                     r 
                     - 
                     2 
                   
                 
                 
                   l 
                   + 
                   1 
                 
               
               , 
               … 
               ⁢ 
               
                   
               
               , 
               
                 
                   c 
                   0 
                 
                 
                   l 
                   + 
                   1 
                 
               
             
             ) 
           
         
       
         
         
           
              as a vector over 
           
         
       
    
     
       
         
           
             
               Z 
               
                 ⌈ 
                 
                   q 
                   
                     l 
                     + 
                     1 
                   
                 
                 ⌉ 
               
             
             ⁢ 
             
               : 
             
           
         
       
       
         
           
             a 
             = 
             
               
                 
                   ( 
                   
                     
                       c 
                       
                         r 
                         - 
                         1 
                       
                     
                     
                       l 
                       + 
                       1 
                     
                   
                   ) 
                 
                 ⁢ 
                 
                   
                     ⌈ 
                     
                       q 
                       
                         l 
                         + 
                         1 
                       
                     
                     ⌉ 
                   
                   
                     r 
                     - 
                     1 
                   
                 
               
               + 
               
                 
                   ( 
                   
                     
                       c 
                       
                         r 
                         - 
                         2 
                       
                     
                     
                       l 
                       + 
                       1 
                     
                   
                   ) 
                 
                 ⁢ 
                 
                   
                     ⌈ 
                     
                       q 
                       
                         l 
                         + 
                         1 
                       
                     
                     ⌉ 
                   
                   
                     r 
                     - 
                     2 
                   
                 
               
               + 
               … 
               + 
               
                 
                   ( 
                   
                     
                       c 
                       0 
                     
                     
                       l 
                       + 
                       1 
                     
                   
                   ) 
                 
                 ⁢ 
                 
                   
                     
                       ⌈ 
                       
                         q 
                         
                           l 
                           + 
                           1 
                         
                       
                       ⌉ 
                     
                     0 
                   
                   . 
                 
               
             
           
         
       
         
         
           
             
               
                 That is, a is the number with radix 
               
             
           
         
       
    
     
       
         
           
             ⌈ 
             
               q 
               
                 l 
                 + 
                 1 
               
             
             ⌉ 
           
         
       
         
         
           
             
               
                  representation of 
               
             
           
         
       
    
     
       
         
           
             
               ( 
               
                 
                   
                     c 
                     
                       r 
                       - 
                       1 
                     
                   
                   
                     l 
                     + 
                     1 
                   
                 
                 , 
                 
                   
                     c 
                     
                       r 
                       - 
                       2 
                     
                   
                   
                     l 
                     + 
                     1 
                   
                 
                 , 
                 
                   … 
                   ⁢ 
                   
                       
                   
                   ⁢ 
                   
                     
                       c 
                       0 
                     
                     
                       l 
                       + 
                       1 
                     
                   
                 
               
               ) 
             
             . 
           
         
       
         
         
           
             3. Representing a in radix (l+1) number with k digits: y=(y k-1 ,y k-2 , . . . ,y 0 ) 
             4. Letting e i =(y i −x′ i ) mod(l+1), where the information symbols are: (x k-1 ,x k-2 , . . . ,x 0 ), such that x i =x′ i +e i , i=0, 1, . . . , k-1. 
             5. Outputting the codeword: (x k-1 , x k-2 , . . . , x 0 , c r-1 , c r-2 , . . . , c 0 ). 
           
         
       
    
     Example 2 
     Let the encoded word be as in Example 1 and the channel output be x′=(4, 2, 7, 1, 0, 3, 5, 1). Rounding the check symbols which are not multiple of three upwards to the nearest multiple of 3, we get (0, 3, 6, 3). As in Steps 2 and 3 of the algorithm, we compute a=0121 4 =25, and y=(0, 2, 2, 1). Thus, the correct information symbols are (6, 2, 8, 1). 
     The following theorem validates the above decoding method. Theorem 6: Let x be a codeword encoded using the encoding algorithm given in above, and let x′ be the l-asymmetric channel output. Then, the above l-AEC decoding method successfully recovers x. Proof. Let x=(x k-1 , x k-2 , . . . , x 0 , . . . , c r-2 , c 0 ), then, by the channel properties, x′=(x′ k-1 , x′ k-2 , . . . , x′ 0 , c′ r-1 , c′ r-2 , . . . , c′ 0 ) is such that x i −l≦x′ i ≦x i  and c i −l≦c′ i ≦c i . Moreover, the encoding algorithm yields check symbols that are multiples of l+1, i.e. c; lies between two successive multiples of l+1. Therefore, the first step of the decoding algorithm successfully recovers the check symbols. It can also be seen that Steps 2 and 3 of the above decoding algorithm do the reverse operations of Steps 1 and 2 of the encoding algorithm. Hence, with notations as above, y=(y k-1 , y k-2 , . . . , y 0 )=(x k-1 , x k-2 , . . . , x 0 )mod(l+1). At Step 4, e i  can be seen as the magnitude of the error at the i th  information symbol, such that
 
 x   i   =x′   i   +e   i   ≡y   i (mod( l+ 1)).
 
Thus,
 
 e   i ≡( y   i   −x′   i )(mod( l+ 1)).
 
Since the maximum error magnitude is l (i.e. 0≦e i ≦1) the value of e i  is successfully computed at Step 4 of the decoding algorithm, recovering the information symbols. Q.E.D.
 
An Optimal Systematic l-SEC Code
 
     In addition to methods relating to correction of all asymmetric errors of limited magnitude, the present invention provides methods for correcting symmetric error of l limited magnitude. 
     For a vector x=(x n-1 , x n-2 , . . . , x 0 ) over Z q  the corresponding channel output x′=(x′ n-1 , x′ n-2 , . . . , x′ 0 ) suffers a symmetric error of maximum magnitude l if and only if x i  e i ≦x′ i ≦x i +e i , where 0≦e i ≦l, ∀iε{0, 1, . . . , n}. As shown below, the similarity between the properties of l-SEC codes and l-AEC codes allows extension of the 1-AEC methods to a family of l-SEC methods. 
     The following theorems serve to set conditions that should be met for an optimal l-SEC code. Theorem 7: A code C is capable of correcting all symmetric errors of maximum magnitude l if and only if C has minimum distance 2l+1. Proof. Let S x  be the set of all words obtained from a codeword xεC, where |x|=n, due to n or less symmetric errors of maximum magnitude l, i.e. S x ={(x′ n-1 , x′ n-2 , . . . , x′ 0 ):x′ i =x i ±e i , e i ε{0, 1 . . . ,l}}. Then, it is easy to see that, if C has minimum distance 2l+1, then ∀x, yεC, S x ∩S y =Ø. Therefore, C is an l-SEC code. Conversely, if ∃x, yεC such that d(x, y)≦2l, then it is possible to obtain a word, say z, from both x and y due to symmetric errors of magnitude l or less. Hence, a decoder for C cannot correct z. Therefore, the minimum distance should be no less than 2l+1 for C to be capable of correcting all symmetric errors of maximum magnitude l. Q.E.D. 
     The above theorem implies that, when 
               l   &gt;       q   -   2     2       ,         
any l-SEC code can have at most one codeword. Thus, we assume
 
     
       
         
           
             l 
             ≤ 
             
               
                 
                   q 
                   - 
                   2 
                 
                 2 
               
               . 
             
           
         
       
     
     Theorem 8: Let A s (n, l, q) denote the maximum number of words in a q-ary l-SEC code of length n. Then 
                 A   s     ⁡     (     n   ,   l   ,   q     )       =         ⌈     q       2   ⁢   l     +   1       ⌉     n     .           
Proof Similar to the proof of Theorem 2. Q.E.D.
 
     Theorem 9: Let C be a code of length n over Z q  defined as:
 
 C ={( x   n-1   ,x   n-2   , . . . ,x   0 ): x   i ≡0(mod(2 l+ 1)),∀ iε{ 0,1 , . . . ,n- 1}}.
 
     Then, C is an l-SEC with A s (n, l, q) codewords. Proof. Similar to the proof of Theorem 3. Digits of the channel output can be decoded in this case by rounding downwards or upwards (whichever is closer) to the nearest multiple of 2l+1. Q.E.D. 
     Theorem 10: Let C be a systematic q-ary l-SEC code, such that the number of information digits in a codeword is k. Then, the number of check digits, r, satisfies the following condition 
     
       
         
           
             r 
             ≥ 
             
               
                 
                   k 
                   × 
                   
                     log 
                     ⁡ 
                     
                       ( 
                       
                         
                           2 
                           ⁢ 
                           l 
                         
                         + 
                         1 
                       
                       ) 
                     
                   
                 
                 
                   log 
                   ⁢ 
                   
                     ⌈ 
                     
                       q 
                       
                         
                           2 
                           ⁢ 
                           l 
                         
                         + 
                         1 
                       
                     
                     ⌉ 
                   
                 
               
               . 
             
           
         
       
     
     Proof. Similar to the proof of Theorem 4. Q.E.D. 
     Now that we have identified the similarities between l-SEC and l-AEC codes, it can easily be seen that the proposed encoding/decoding algorithms for l-AEC codes can be modified in the following way to construct an l-SEC code. 
     l-SEC Encoding Algorithm 
     Input: The information vector: (x k-1 , x k-2 , . . . , x 0 ) 
     Output: The encoded vector: x=(x k-1 , x k-2 , . . . , x 0 , c r-1 , c r-2 , . . . , c 0 ) 
     A method of the present invention for l-SEC encoding may then include the steps of:
         1. Computing a, the value of (x k-1 , x k-2 , . . . , x 0 ) mod(2l+1) as a vector over (2l+1):
 
 a=y   k-1 (2 l+ 1) k-1   +y   k-2 (2 l+ 1) k-2   + . . . +y   0 (2 l+ 1) 0 ,
           where y i =x i  mod(2l+1),iε{0, 1, . . . , k-1}   
           2. Representing a in radix       

     
       
         
           
             ⌈ 
             
               q 
               
                 
                   2 
                   ⁢ 
                   l 
                 
                 + 
                 1 
               
             
             ⌉ 
           
         
       
         
         
           
              number with r digits: ( a   r-1   ,a   r-2   , . . . ,a   0 ). 
             3. Computing the check part: c=(c r-1 ,c r-2 , . . . ,c 0 ),
           where c i =(2l+1)a i , ∀iε{0, 1, . . . , r-1}.   
         
             4. Outputting the encoded vector x=(x k-1 , x k-2 , . . . , x 0 , c r-1 , c r-2 , . . . , c 0 ) 
           
         
       
    
     Example 3 
     We encode the word (5, 3, 7, 0) over Z 10 , assuming a maximum symmetric error level of 1. The number of check digits needed is 
             r   =       ⌈       4   ⁢     log   ⁡     (       2   ×   1     +   1     )           log   ⁢     ⌈     10       2   ×   1     +   1       ⌉         ⌉     =   4.           
Then, (y 3 , y 2 , y 1 , y 0 )=(2, 0, 1, 0) and a=2×3 3 +0×3 2 +1×3 1 +0×3 0 =57. Now, a=57 in radix
 
               ⌈     q       2   ⁢   l     +   1       ⌉     =       ⌈     10   4     ⌉     =   4           
representation is (0, 3, 2, 1) and so, the check is (0, 9, 6, 3). Therefore, the encoded codeword is (5, 3, 7, 0, 0, 9, 6, 3).
 
l-SEC Decoding Algorithm
 
     Input: The channel output: x′=(x′ k-1 , x′ k-2 , . . . , x′ 0 , c′ r-1 , c′ r-2 , . . . , c′ 0 ) 
     Output: The recovered codeword: (x k-1 , x k-2 , . . . , x 0 , c r-1 , c r-2 , . . . , c 0 ) 
     A method of the present invention for l-SEC decoding may then include the steps of:
         1. Recovering the check symbols, (c r-1 , c r-2 , . . . , c 0 ), by rounding each received check symbol which is not a multiple of 2l+1 either upwards or downwards to the nearest multiple of 2l+1, whichever is closer.   2. Computing a, the value of       

     
       
         
           
             ( 
             
               
                 
                   c 
                   
                     r 
                     - 
                     1 
                   
                 
                 
                   
                     2 
                     ⁢ 
                     l 
                   
                   + 
                   1 
                 
               
               , 
               
                 
                   c 
                   
                     r 
                     - 
                     2 
                   
                 
                 
                   
                     2 
                     ⁢ 
                     l 
                   
                   + 
                   1 
                 
               
               , 
               … 
               ⁢ 
               
                   
               
               , 
               
                 
                   c 
                   0 
                 
                 
                   
                     2 
                     ⁢ 
                     l 
                   
                   + 
                   1 
                 
               
             
             ) 
           
         
       
         
         
           
              as a vector over 
           
         
       
    
     
       
         
           
             
               
                 Z 
                 
                   ⌈ 
                   
                     q 
                     
                       
                         2 
                         ⁢ 
                         l 
                       
                       + 
                       1 
                     
                   
                   ⌉ 
                 
               
               : 
               
                 
 
               
               ⁢ 
               a 
             
             = 
             
               
                 
                   ( 
                   
                     
                       c 
                       
                         r 
                         - 
                         1 
                       
                     
                     
                       
                         2 
                         ⁢ 
                         l 
                       
                       + 
                       1 
                     
                   
                   ) 
                 
                 ⁢ 
                 
                   
                     ⌈ 
                     
                       q 
                       
                         
                           2 
                           ⁢ 
                           l 
                         
                         + 
                         1 
                       
                     
                     ⌉ 
                   
                   
                     r 
                     - 
                     1 
                   
                 
               
               + 
               
                 
                   ( 
                   
                     
                       c 
                       
                         r 
                         - 
                         2 
                       
                     
                     
                       
                         2 
                         ⁢ 
                         l 
                       
                       + 
                       1 
                     
                   
                   ) 
                 
                 ⁢ 
                 
                   
                     ⌈ 
                     
                       q 
                       
                         
                           2 
                           ⁢ 
                           l 
                         
                         + 
                         1 
                       
                     
                     ⌉ 
                   
                   
                     r 
                     - 
                     2 
                   
                 
               
               + 
               … 
               + 
               
                 
                   ( 
                   
                     
                       c 
                       0 
                     
                     
                       
                         2 
                         ⁢ 
                         l 
                       
                       + 
                       1 
                     
                   
                   ) 
                 
                 ⁢ 
                 
                   
                     ⌈ 
                     
                       q 
                       
                         
                           2 
                           ⁢ 
                           l 
                         
                         + 
                         1 
                       
                     
                     ⌉ 
                   
                   0 
                 
               
             
           
         
       
         
         
           
             3. Representing a in radix (2l+1) number with k digits:
           y=(y k-1 , y k-2 , . . . , y 0 ) where the information symbols are
 
( x   k-1   ,x   k-2   , . . . ,x   0 ),
   such that ∀iε{0, 1, . . . , k-1} x i =x′ i +e i , where
 
 e   i ≡( y   i   −x′   i )mod(2 l+ 1)
   such that −l≦e i ≦1 and
 
 x   i   ≡y   i (mod(2 l +1)).
   
         
             5. Outputting the codeword: (x k-1 , x k-2 , . . . , x 0 , c r-1 , c r-2 , . . . , c 0 ). 
           
         
       
    
     Example 4 
     Let the encoded word be as in Example 3 and the channel output be x′=(4, 2, 8, 1, 1, 8, 7, 2). Rounding the check symbols (that are not multiple of 3) upwards or downwards to the nearest multiple of 3 we get (0, 9, 6, 3). As in Steps 2 and 3 of the l-SEC algorithm, we compute a=0321 4 =57, and 57 in radix (2l+1)=3 representation is y=(y 3 , y 2 , y 1 , y 0 )=(2, 0, 1, 0). Thus the error vector is
 
 e =( e   3   ,e   2   ,e   1   ,e   0 )=( y   3   −x′   3   ,y   2   −x′   2   ,y   1   −x′   1   ,y   0   −x′   0 )(mod(2 l+ 1))=((2−4)mod 3,(0−2)mod 3,(1−8)mod 3,(0−1)mod 3)=(1,1,−1,−1).
 
Then the correct information word is (4+1, 2+1, 8−1, 1−1)=(5, 3, 7, 0).
 
     Since our code constructions and resulting methods are systematic, information symbols are separable from the check symbols resulting in faster encoding/decoding operations. Fortunately, the cost of having systematic code is low: we show that the rate of our l-AEC code is very close to the one given in (1). The rate R of an error correcting code is given as 
             R   =     k   n           
where k is the number of information digits and n is the length of the code. For the code given in (1), the rate, R non-systematic , is
 
     
       
         
           
             
               R 
               
                 non 
                 - 
                 systematic 
               
             
             = 
             
               
                 
                   
                     log 
                     q 
                   
                   ⁢ 
                   
                     
                       ⌈ 
                       
                         q 
                         
                           l 
                           + 
                           1 
                         
                       
                       ⌉ 
                     
                     n 
                   
                 
                 n 
               
               = 
               
                 
                   log 
                   q 
                 
                 ⁢ 
                 
                   
                     ⌈ 
                     
                       q 
                       
                         l 
                         + 
                         1 
                       
                     
                     ⌉ 
                   
                   . 
                 
               
             
           
         
       
     
     The rate of the proposed code, R systematic , is 
     
       
         
           
             
               
                 R 
                 systematic 
               
               = 
               
                 
                   k 
                   
                     k 
                     + 
                     r 
                   
                 
                 = 
                 
                   
                     k 
                     
                       k 
                       + 
                       
                         k 
                         ⁢ 
                         
                           ⌈ 
                           
                             
                               
                                 log 
                                 q 
                               
                               ⁡ 
                               
                                 ( 
                                 
                                   l 
                                   + 
                                   1 
                                 
                                 ) 
                               
                             
                             
                               
                                 log 
                                 q 
                               
                               ⁢ 
                               
                                 ⌈ 
                                 
                                   q 
                                   
                                     l 
                                     + 
                                     1 
                                   
                                 
                                 ⌉ 
                               
                             
                           
                           ⌉ 
                         
                       
                     
                   
                   = 
                   
                     1 
                     
                       1 
                       + 
                       
                         ⌈ 
                         
                           
                             
                               log 
                               q 
                             
                             ⁡ 
                             
                               ( 
                               
                                 l 
                                 + 
                                 1 
                               
                               ) 
                             
                           
                           
                             
                               log 
                               q 
                             
                             ⁢ 
                             
                               ⌈ 
                               
                                 q 
                                 
                                   l 
                                   + 
                                   1 
                                 
                               
                               ⌉ 
                             
                           
                         
                         ⌉ 
                       
                     
                   
                 
               
             
             , 
           
         
       
     
     which can be approximated to 
     
       
         
           
             
               
                 R 
                 systematic 
               
               ≈ 
               
                 1 
                 
                   1 
                   + 
                   
                     
                       
                         log 
                         q 
                       
                       ⁡ 
                       
                         ( 
                         
                           l 
                           + 
                           1 
                         
                         ) 
                       
                     
                     
                       
                         log 
                         q 
                       
                       ⁢ 
                       
                         q 
                         
                           l 
                           + 
                           1 
                         
                       
                     
                   
                 
               
             
             = 
             
               
                 
                   
                     log 
                     q 
                   
                   ⁢ 
                   
                     q 
                     
                       l 
                       + 
                       1 
                     
                   
                 
                 
                   
                     
                       log 
                       q 
                     
                     ⁢ 
                     
                       q 
                       
                         l 
                         + 
                         1 
                       
                     
                   
                   + 
                   
                     
                       log 
                       q 
                     
                     ⁡ 
                     
                       ( 
                       
                         l 
                         + 
                         1 
                       
                       ) 
                     
                   
                 
               
               = 
               
                 
                   
                     
                       log 
                       q 
                     
                     ⁢ 
                     
                       q 
                       
                         l 
                         + 
                         1 
                       
                     
                   
                   
                     
                       
                         log 
                         q 
                       
                       ⁢ 
                       q 
                     
                     - 
                     
                       
                         log 
                         q 
                       
                       ⁡ 
                       
                         ( 
                         
                           l 
                           + 
                           1 
                         
                         ) 
                       
                     
                     + 
                     
                       
                         log 
                         q 
                       
                       ⁡ 
                       
                         ( 
                         
                           l 
                           + 
                           1 
                         
                         ) 
                       
                     
                   
                 
                 = 
                 
                   
                     log 
                     q 
                   
                   ⁢ 
                   
                     
                       q 
                       
                         l 
                         + 
                         1 
                       
                     
                     . 
                   
                 
               
             
           
         
       
     
     The table below illustrates the closeness of the values of R systematic  and R non-systematic  for q=8 and q=16: 
     
       
         
           
               
               
               
               
               
             
               
                   
                   
               
               
                   
                 q 
                 l 
                 R non-systematic   
                 R systematic   
               
               
                   
                   
               
             
            
               
                   
               
            
           
           
               
               
               
               
               
            
               
                   
                 8 
                 1 
                 0.66 
                 0.5 
               
               
                   
                   
                 2 
                 0.52 
                 0.5 
               
               
                   
                   
                 3 
                 0.33 
                 0.33 
               
               
                   
                   
                 4 
                 0.33 
                 0.25 
               
               
                   
                   
                 5 
                 0.33 
                 0.25 
               
               
                   
                   
                 6 
                 0.33 
                 0.25 
               
               
                   
                 16 
                 1 
                 0.75 
                 0.5 
               
               
                   
                   
                 2 
                 0.64 
                 0.5 
               
               
                   
                   
                 3 
                 0.5 
                 0.5 
               
               
                   
                   
                 4 
                 0.5 
                 0.33 
               
               
                   
                   
                 5 
                 0.39 
                 0.33 
               
               
                   
                   
                 6 
                 0.39 
                 0.33 
               
               
                   
                   
                 7 
                 0.25 
                 0.25 
               
               
                   
                   
                 8 
                 0.25 
                 0.25 
               
               
                   
                   
                 9 
                 0.25 
                 0.25 
               
               
                   
                   
                 10 
                 0.25 
                 0.25 
               
               
                   
                   
                 11 
                 0.25 
                 0.25 
               
               
                   
                   
                 12 
                 0.25 
                 0.25 
               
               
                   
                   
                 13 
                 0.25 
                 0.25 
               
               
                   
                   
                 14 
                 0.25 
                 0.25 
               
               
                   
                   
               
            
           
         
       
     
     These and other advantages of the present invention will be apparent to those skilled in the art from the foregoing specification. Accordingly, it will be recognized by those skilled in the art that changes or modifications may be made to the above-described embodiments without departing from the broad inventive concepts of the invention. It should therefore be understood that this invention is not limited to the particular embodiments described herein, but is intended to include all changes and modifications that are within the scope and spirit of the invention as set forth in the claims. 
     Several publications are referenced in this application, the disclosures of each of these publications are incorporated by reference herein. 
     References 
     (1) R. Ahlswede, H. Aydinian, L. H. Khachatrian, and L. M. G. M. Tolhuizen, “On q-ary codes correcting all unidirectional errors of a limited magnitude”, Proceedings of Ninth International Workshop on Algebraic and Combinatorial Coding Theory, Kranevo, Bulgaria, pp. 20-26, June 2004. 
     (2) R. Ahlswede, H. Aydinian and L. H. Khachatrian, “Unidirectional error control codes and related combinatorial problems”, Proceedings of Eight International Workshop on Algebraic and Combinatorial Coding Theory, Russia, pp. 6-9, September 2002. 
     (3) M. Blaum, “Codes for Detecting and Correcting Unidirectional Errors”, IEEE Computer Society Press, Los Alamitos, Calif., 1993. 
     (4) Y. Cassuto, M. Schwartz, V. Bohossian and J. Bruck, “Codes for multi-level flash memories: correcting asymmetric limited-magnitude errors”, Proceedings of ISIT2007, Nice, France, June 2007. 
     (5) S. D. Constantin and T. R. N. Rao, “On the theory of binary asymmetric error correcting codes”, Information and computation, vol. 40, pp. 20-36, 1979. 
     (6) B. Eitan, R. Kazerounian, A. Roy, G. Crisenza, P. Cappelletti and A. Modelli, “Multilevel flash cells and their trade-offs”, International Electron Devices Meeting, pp. 169-172, December 1996. 
     (7) T. Klove, “Error correcting codes for the asymmetric channel”, In Dept. Mathematics, Univ. Bergen, Bergen, Norway, Tech. Rep. 1809-0781, 1995. 
     (8) J. R. Pierce, “Optical Channels: Practical Limits with Photon Counting”, IEEE Trans. Communications, vol. 26, no. 12, pp. 1819-1821, December 1978. 
     (9) R. R. Varshamov, “A class of codes for asymmetric channels and a problem from the additive theory of numbers”, IEEE Trans. Inform. Theory, vol. 19, no. 1, pp. 92-95, January 1973.