On the self-testing (m,n)-code checker design

We propose an approach to a self-testing (m, n)-code checker design, based on subdividing the set of all code words into special subsets called segments. The checker circuit is constructed by using one- and two-output configurable logic blocks (CLB). Previously, in each output of a CLB, a function representing exactly one segment was implemented. In the proposed approach, at each CLBs output, it is possible to implement functions that represent several segments and to provide the self-testing property. It allows reducing the number of CLBs and simplifying the circuit of the checker.


Introduction
In self-checking circuits, code checkers are used to provide the self-testing property. As a rule, the checker is designed on the same element base as the circuit. In the checker, the weight of an input codeword is usually calculated. For this purpose, threshold elements or parallel counters are used [1][2][3][4][5][6]. This paper proposes a design method of the checker based on configurable logic blocks (CLBs). In papers [7,8], the authors propose a method for design a self-checking finite-state machine. In the case of correct operation of the circuit, the code words of some unordered code are implemented at the output of the circuit. Usually, the (m,n)-code is used, where n is the length of a code word, m is the number of unity components (the weight). The papers also develop a method for self-testing (m,n)code checker design based on the repeated use of a special decomposition formula for a set of the (m,n)-code words and implementing the obtained formula by CLBs. In the method of self-testing checker design proposed in [8], the presence of two-output CLBs is not necessary. This means that the method allows building self-testing checkers using any modern CLBs (Field Programmable Gate Arrays (FPGA), manufacturers Xilinx, Altera, Achronix, Actel, Atmel, Lattice semiconductor, etc.).
There is a special requirement for the implementation of the formula: the checker of the (m,n)codes must be self-testing for a given set of faults, say V. The set V includes all multiple stuck-at faults occurred at CLBs inputs and outputs. In this case, only one CLB in the checker can be defective. It is assumed that in a system consisting of a self-testing circuit and a (m,n)-code checker, either the circuit or the checker can be faulty, but not both.
The self-testing checker should satisfy the following requirements: 1) when a non-code word appears at the circuit output (or at the checker input), the checker should issue a corresponding signal; 2) in the checker itself, a fault from the considered set of faults V may occur, which must be detectable in the working area of the detector, i.e. on the set of all its code words. This means that there must be an (m,n)-code word for which this fault appears at the outputs of the checker. The self-testing checker has two outputs with the following combinations of signal values: a) (01) or (10) mean that the input word is a word of the (m,n)-code and the checker is faultless; b) (00) or (11) mean that either the input word is non-code or the checker is faulty. The checker is designed according to a formula representing the set of all (m,n)-code words, being the implementation of this formula. To represent all (m, n)-code words, a special decomposition formula was proposed in [9]. We divide the set of variables X into two subsets X 1 , X 2 , where X 1 = {x1, ..., xg}, X 2 = {xg + 1, ..., xn}. The whole set of the (m,n)-code words of can be represented by the formula where the  between are the decomposition functions; we call the cardinality of variable subsets after the last use of formula (1) as the decomposition base and denote it as k.
In paper [8], we propose to choose g as the least integer number which is greater than or equal to 2 n , i.e., . If g > k and/or ng > k, then formula (1) is used again for any decomposition Upon doing that, we obtain the formula for all (m,n)- . Multiple decomposition is applied both for the first and to the second multipliers in formula (1).
In this paper, we use only one decomposition step. For example, for 7 14 D and k = 7, where k is the number of CLBs inputs, we have two subsets of variables } , , , . Formula (1) has the form (2): To ensure the self-testing property of the checker, special requirements will be used for the functions implemented by the CLBs. Without loss of generality, we will consider single-output CLBs with not more than 7 inputs and two-output CLBs with not more than 6 inputs.
To provide the self-testing property in the considered class of faults, we use special functions. Let us denote the set of Boolean vectors where the function f(x1, …, xn) is equal to 1 as S1(f). Let us represent the Boolean function by the table where the columns correspond to Boolean variables, and the rows present Boolean vectors from the set S1(f). Definition 1.
We call a function f as function of type 2, if in the table representation, every column contains exactly one unity component, and the number of unity components in all rows is the same. Table 1 demonstrates an example of a type 2 function. For a CLBs output, implementing a type 2 function, and for any input multiple-stuck-at fault, either a test from S1(f) exists, or the multiple fault manifests itself as an output stuck-at-1 fault at the CLB.
Theorem 2. If a type 2 function is implemented on one of the outputs of a two-output CLB, then whatever the second function associated with the CLB, an input multiple-stuck-at fault of the CLB is either detected on the corresponding output type 2 function when the CLB receives a vector from S1(f) in the input, or the fault manifests itself as a stuck-at-1 fault.
Theorems 1 and 2 are proven in [9]   We denote as FrSubset(x1, …, xk) a subset of the set FrSet(x1, …, xk) satisfying the following conditions: 1) It contains at least two segments; 2) if we arrange the weights of the segments in ascending order then in the sequence of weights there will be two neighboring elements with the difference at least two.
Examples. A union of segments with the weights 2, 4, 5 is a FrSubset(x1, …, xk), a union of segments with the weights 2, 3, 4 is not a FrSubset(x1, …, xk). Definition 3. Let us call a function whose domain of unity values coincides with a subset FrSubset(x1, …, xk), as Fsubset(x1, …, xk). Table 2 demonstrates an example of such a function. The subset FrSubset(x1,x2,x3) for the function from table°2 consists of two segments: . Subsets FrSubset(x1, …, xp) can be of different cardinality. Let a CLB implement a function Fsubset(x1, …, xk). Here k is the number of CLBs inputs. Further we represent an input multiple stuck-at fault by a ternary vector with the components from the set {0, 1, -}. Components equal to 0 or 1 are called as outer components, they correspond to inputs with stuck-at-0 or stuck-at-1 faults. Components equal toare called inner components, they correspond to faultless inputs.
Example. Let a CLB have 6 inputs. If it has stuck-at-0 fault at the inputs {x1,x4} and stuck-at-1 fault at the input {x3} then this multiple fault is described by the vector − − −10 0 .  (x1, ..., xk), or a multiple fault manifests itself as a stuck-at-1 fault at the CLBs output.
Proof. Let the CLB implement the function Fsubset(x1, ..., xk), k be the number of the CLBs inputs. Let the fault be described by a ternary vector β and the vector has r outer components, r ≤ k. Consider all possible cases.
1. Let r = k, i.e., all the components of β are outer. So, а) if β is a code word from FrSubset(x1, …, xk) then the fault manifests itself as the output stuck-at-1 fault; б) otherwise, if β is not a code word from FrSubset(x1, …, xk), then the fault is detected by any vector from FrSubset(x1, …, xk); the output value is equal to 0 instead of 1.  (x1, ..., xk) is implemented, whatever the second function associated with the CLB, a multiple input stuck-at fault of this CLB is either detected on the corresponding vector α from FrSubset(x1, ..., xk), or it appears on this output as a stuck-at-1 fault.
Proof. At one of the CLBs outputs, a function of the type Fsubset(x1, ..., xk) is implemented. According to Theorem 1, for a multiple input stuck-at fault , either there is a test from the set FrSubset(x1, ..., xk), or the multiple fault manifests itself as an output stuck-at-1 fault. Both functions implemented by the CLB depend on the same sets of variables , and the functions themselves are implemented on separate memory blocks (LUT). At the second output of the CLB, the multiple stuckat fault may not appear at all. It depends on the type of function implemented by the second output. The theorem is proved.
Consider the subcircuit 1 ( Figure 1). The lower level of this subcircuit consists of a one-or twooutput CLB (CLB1), which implements the function (one of the outputs) Fsubset(x1, ..., xk), and the output of this CLB corresponds to the input of several CLBs implementing the function of type 2 (CLB2 and CLB3). The set of CLBs variables that implement the function of type 2, are different. The outputs of the subcircuit are the outputs of the CLB, implementing a function of type 2. are used, where 0 <q ≤ p, p ≤ k, kis the number of the CLBs inputs. Earlier, in [7,8], at every CLBs output exactly one function q p D (x1, …, xp) was implemented. Theorem 5 allows simplifying the selftesting-checker circuit and to reduce the number of CLBs in it. For example, Figure 2 demonstrates "old" checker 7 14 D , as Figure 3 shows a "new" circuit of the same checker 7 14 D .  Figure 2. The checker of the (7, 14)-code.
x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13  Consider the "old" circuit. Let us construct a checker for 7 14 D , using subcurcuit 2 if k = 7. At the first step of decomposition one can obtain.
To accomplish formula (2) one needs 4 CLBs. Their characteristics are listed in table 5. Outputs of the checker The outputs of CLB19 and CLB20 are the outputs of the checker. Hence, 20 CLBs are used to implement the checker. The circuit is represented in Figure 2.
At the "new" circuit, we use the following functions (tables 6 and 7). Table 6. Boolean functions depending on the variables x1, x2, x3, x4, x5, x6, x7. № Implemented function Output 1 To accomplish formula (2) one needs 2 CLBs. Their characteristics are listed in table 8. The outputs of CLB7 and CLB8 are the outputs of the checker. Hence, to perform checker 8 CLBs are used. The circuit of the detector is represented in Figure 3.

Conclusion
Thus, we propose an approach to design of a self-testing (m,n)-code checker, which allows reducing the number of CLBs and simplifying the checker circuit. Previously, at each output of the CLB, functions representing exactly one segment. In the proposed approach, at each CLBs output, it is possible to implement functions that represent several segments.