A Comparative Study of Construction Techniques of t -Error Correction/All Unidirectional Error Detection Codes

: The theory and application of ( t -EC-AUED) codes was presented and among the methods proposed in literature, the most efficient was chosen and a software was written for encoding and decoding of the codes. Comparison and evaluation of the construction techniques were carried out. A t -Error Correction (EC)/All Unidirectional Error Detection (AUED) codes are constructed by appending a single check symbol to a linear t -EC code to achieve the AUED property.


Introduction
The use of codes for error correction and detection is long established in the design of large digital systems and provides for the occurrence of faults, which must ultimately develop in any system. For a computer system, an important consideration is the balance between error detection and error correction. Error correction seems to be more desirable than error detection; however, the possibility of erroneous correction exists and has to be guarded against.
One of the most important ways of guarding against erroneous correction is by the use of codes, which detect All Unidirectional Errors (AUE). In (Nikolos et al., 1986) the most important mechanisms for unidirectional errors are described. These errors are likely to occur when a fault in VLSI devices such as ROM and RAM memories exists. Other possible reasons for production of these errors are bridging faults in PLA ' s, stuck at faults, power supply failures, burst in magnetic recording surfaces due to foreign particles or permanent failure of stages in shift register type memory.
Unidirectional errors can occur in a large number compared to the limited number of random errors likely to occur.
A t-EC/AUED code can be constructed by appending a check symbol to each word of linear binary t-EC code and the first construction technique was proposed by (Pradhan and Stifller, 1980). After that many methods have been presented. In (Bose et al., 2007), a design technique for a class of tunidirectional error detection codes over Z m is presented. A survey of unidirectional error detection codes for memory systems is presented in (Al-Ani and Al-Shayea, 2010). In (Nikolos et al., 1986) two techniques were proposed in which (t+1) check symbols are added. Andrew (1988) has proposed a more powerful technique than those of (Nikolos et al., 1986). An efficient technique was proposed in (Tao et al., 1988), but it is not as efficient as that of (Andrew, 1988).
In the next section of this research, a definition of the theory of codes and some of the terms related to them are introduced. The other section includes the categories of errors in computers and digital systems. The section followed presents an introduction to the theory of t-EC/AUED codes is presented. In the reset sections we can see a description of a number of construction techniques that are found to be the most efficient. A brief idea about the construction of the software package, the results obtained from running the software are tabulated and discussed and the last section presents conclusions.

Error Control Codes
The theory of control coding is concerned with encoding and decoding of data and the mean of implementing them in hardware and software. Coding theory is also concerned with n-bits words that are of the form given in Equation 1: where, a 1 , a 2 ………a n are symbol of a set S. Let q be the number of symbol that are contained in S. There are q n possible words of length n, of total of q symbols. A code C is defined to be a subset of all possible code words.
If the set of symbols are elements of a finite field with q = 2, then binary codes will be constructed and these codes are the most important, hence they will receive the greatest emphasis in this work.
There are two main types of codes in common use today block codes in which n is fixed and conventional codes in which n is not fixed.
Following are some definitions, which are related to codes.

Definition 1
The Hamming distance between two n-bit words v and w denoted d (v, w) is defined as the number of places where they differ.

Definition 2
The weight w(v) of a word v is the number of nonzero digits in it.
Linearity forms a common feature for a large number of codes which are referred to as linear codes (Lin, 2004). An (n, k) binary block code C is called linear if its set of 2 k n-tuples code words are a subset of all n-tuples over GF(2) and can be expressed as a linear combination of a set of k basis vectors.

Error Detection and Error Correction
Computers and digital systems are exposed to faults, which are many and varied. The faults lead to errors in data which are usually categorized as follows: • Symmetric (random) Errors: When both (1 → 0) and (0 → 1) errors are likely to occur • Asymmetric Errors: When either (1 → 0) or (0 → 1) errors occur with different probabilities • Unidirectional Errors: When both types (1 → 0) and (0 → 1) errors can occur, but in a particular word all errors are of one type The statistics of errors are strongly dependent on the way the data is organized and when the organization of a RAM memory, for example, consists of several bits per card, a defect in a memory card can affect several bits in the same word. Similarly a defect on a tape due to handling or the presence of foreign particles usually effects one track; however, it will cause possibly a large number of errors on this track.
Early errors correcting codes, which were designed under the assumption that errors are random, may not be entirely appropriate for errors which may occur in RAM's or magnetic tapes. This fact has led to the design of a new class of codes, which are capable of detecting unidirectional errors. This category of errors is the most probable to occur in digital systems and devices. Among the all-unidirectional error detection codes are the m-out-of-n codes (Pradhan and Stifller, 1980) and the Berger codes (Pradhan, 1986).

Error Correction/All Unidirectional Error Detection
In spite of their ability of detecting all unidirectional errors, the m-out-of-n and the Berger codes, mentioned earlier, are limited in application because they are not able to correct errors; and are incompatible with parity check codes which are the most used codes in computers. Consequently, recent researches has been directed to develop codes that correct all patterns of up to (t) random errors and detect either all or d (d > t) unidirectional errors.
In order to study these codes, the following definitions will be made: Let X and Y be n-tuples over GF (2) then: • D (X, Y): refers to the Hamming distance between X and Y • N (X, Y): denotes the number of (1 → 0) crossovers from X to Y The Hamming distance can be expressed in terms of crossovers as per Equation 2: Example If X = (101110) and Y = (010110) then: The following theorems describe the error correction/detection properties of binary codes.

Theorem 1
A code C is capable of detecting up to (t) random errors if the condition of Equation 3 satisfies: for all X and Y Є C ≥ + (3)

Theorem 2
A code C is capable of detecting up to (t) random errors and all unidirectional errors if the condition of Equation 4 satisfies: for all X and Y Є C and X Y

Theorem 3
A code C is capable of correcting up to (t) random errors and detects all unidirectional errors if the condition of Equation 5 satisfies:

Construction Techniques of t-EC/AUED Codes
In all proposed t-EC/AUED design techniques, attempts were made to construct as efficient code as possible. It's however, that most of the proposed techniques are difficult to implement. Such codes are either having no encoding/decoding algorithms or the algorithms given are inefficient.
The construction techniques adopted in this work are found promising and their implementation is not difficult. Their encoding algorithms, which produce systematic t-EC/AUED codes are reviewed and implemented in a software package. The three adopted techniques are featured in that a universal decoding algorithm can be applied on them (Mohammed, 1988).
Two of the algorithms are given in (Nikolos, 1986). In these two techniques, (t+1) check symbols are applied to a t-EC systematic code with Hamming distance (d H = 2t +1). The third technique is given in (Andrew, 1988).
For ease of reference, the construction techniques given in (Nikolos, 1986) are referred to as TECH1 and TECH2 in the next sections, while the technique presented in (Andrew, 1988) is referred to as TECH3.

Description of Techniques TECH1 and TECH2
For these two techniques the proposed codes have the form shown in Equation 6: where, X i is n-tuple from GF (2).
CH 1 …..CH t+1 are the values of check words corresponding to Xi. They will be calculated using TECH1 or TECH2.
Consider n-tuples words over GF(2) with weights of 0,1,…..n and that class i contains all n-tuples of weight i. The classes can be arranged in an ascending order according to their weight.
In order to calculate CH 1 …CH t+1 , partition (t+1) times the pre-arranged classes into check words where the number and size of these check words will be decided by using either TECH1 or TECH2.

TECH1
Step 1: Set m = 1 Step 2: Partition the ordered classes 0,1,2,….n into check words of size d H -2(t-m + 1), so that each check word contains consecutive classes with each class appearing in only one check word. Begin the partition from class n. In this way there are ( 1)

TECH2
Step 1: Set m = 1 Step 2 Step 4: Give numbers to check words, start with number 0 to the check word contains class n Step 5: If m = t + 1 end. Else set m = m + 1 repeat from step 2.

Description of Technique TECH3
By this technique a systematic t-EC/AUED code can be constructed by concatenation of any (n, k) t-EC code and a single check symbol.
The necessary conditions for the check symbols is given by Theorem 4 as follows:

Theorem 4
Let S(s, t) = S 0 , S1,………S m be an alphabet of m + 1 symbols which satisfies: where, S(s, t) is an alphabet of binary s-tuples.
The number of check symbols S(s, t) is related to the i-EC code C of minimum distance 2t +2 of even weight such that shown in Equatin 8:

Check Symbol Construction
The construction of the alphabet S (s, t) will be started with S 0 = (11 …1) in the first symbol and cyclic shifts of a block of P adjacent 1's and (s-p) adjacent 0's, which is arbitrary when p = s.
Check symbols are constructed by generating S i successively according to the following algorithm: Three functions used in the algorithm are defined as follows: • CSR is the Cyclic Shift Right (e.g., CSR (111001)

The Software Program
The software package is designed to implement the techniques defined in the previous section (i.e., to calculate the check symbols). Calculated check symbols are then appended to a t-EC code in order to make a t-EC/ AUED code.
The program interacts either with the user or with a stored data file in order to get the information and check bits of an (n, k) binary code. The generator polynomial of the code and its number of correctable errors (t), are also entered.
The check polynomial is then calculated by the program and the generator and check matrices are produced. One out of three techniques (i.e., TECH1, TECH2 or TECH3) is to be chosen where check symbols are calculated.
The encoding procedure of a t-EC code is executed in the program, where message words of kinformation bits are produced and multiplied by the generator matrix. Finally, a t-EC/AUED code is constructed by appending the appropriate check symbol.

Results
The three construction techniques described in the previous section are illustrated in the following case study:
By applying the techniques TECH1, TECH2 and TECH3 check symbols will be calculated and hence a 2-EC/AUED code can be constructed.

TECH1
The number of classes is equal to the length of the code (n = 15) and the classes will be arranged is an ascending order.
Classes will be divided (t +1= 3) times into check words. The division is shown in Table 1.
The software program works out the steps of TECH1 in the following order: Step 1: m = 1 Step 2: the classes will be divided into check words of size So that each check word contains consecutive classes, with each class appears in only one check word.
The division start from class n and the number of check words is calculated as follows: ( 1)/ (15 1)/1 16 Step 3: The check words are numbered and number 0 is given to the check words contained in class n Step 4: Step 2 and 3 are repeated for m = 2 and m = 3 The calculated check symbols are shown in Table 1. Note that the length of the check symbol is 9 bits.

TECH2
This technique is quite similar to that of TECH1. The only notable difference is that when the size of a check word (R) calculated by the formula: R = d H -2 (tm + 1) is found to be equal to 2 u -1 (u is an integer), then R is set equal to 2 u This obviously means that the check word will be increased and a code with less number of bits may be generated.
TECH2 is not always superior to TECH1 but becomes so as the value of t increases.
The software program executes the steps of TECH2 as follows: Step 1: m = 1 Step 2: The classes are divided into check words of size: The number of check words is: Step 3: The check words are numbered and number 0 is given to the check word contained in class n Step 4: Steps 2 and 3 are repeated for m = 2 and m = 3 Note that when m = 2, then R = 5-2(2-2+1) = 3= 2 2 -1. In this case, R is set equal 4 instead of 3 classes which lead to a redundancy of 1 bit lower than the code derived from TECH1. This actually implies when the parity check code has a hamming distance of exactly (2t+1). Table 2 shows the calculated check symbols using TECH2. In this table, the length of the check symbols is 8 bits.

TECH3
A systematic 2-EC/ AUED code can be constructed if a single check symbol is appended to each code word of a 2-EC code with even weight.
Consider the (15,7) code with an overall parity check bit added to its code words to make it of distance 2t+2 and length n = 16.
The t-EC/AUED code C formed by the concatenation of code C and S(s, t), is defined by Equation 11: From this case study it can be noticed that, the code constructed using TECH3 is shorter by 1 bit than the code constructed in TECH2 and by 2 bits than that of TECH1. Therefore a more efficient code might be generated when using the construction technique TECH3.

Discussion
The results obtained from the several software runs are tabulated such that the three construction techniques explained before and the technique given in (Tao et al., 1988), which we will refer to as TECH4, are compared together and discussed.

Conclusion
For computers and digital systems, one of the ways of guarding against erroneous correction is by the use of codes which detect all unidirectional errors. In order to investigate and compare the several methods and techniques proposed for constructing t-EC/AUED codes, software was developed, by means of which the three most efficient techniques are investigated.
Using the outputs obtained from the software runs, a comparison is made, where the results are tabulated for the most efficient techniques. From the tabulated results it was noticed that, in many cases, TECH3 is the most efficient. In few cases, however, TECH3 fails to be superior to other techniques. The value of ST represents an indication to the efficiency of this technique. When the value of ST is low, efficient codes are constructed. In contrast, higher value of ST leads to less efficient codes.
Another property that favors the codes constructed by TECH3 is the fact that each symbol in the alphabet S is a cyclic shift of adjacent 1's. This property can be invested for the hardware implementation, where the general scheme of the encoder circuit will be a series of shift registers with feedback.