• No results found

Bit flipping algorithm

Chapter 4 – Methodology

4.2 Proposed decoding algorithm

4.2.3 Bit flipping algorithm

The objective of the algorithm is to decrease the shadow area until no errors can be detected. At that point, the assumption is, all the errors would have been corrected and the final vector will be identical to the initial codeword that was sent. Figure 4.7, gives an overview of the proposed bit flipping decoding algorithm.

80 | P a g e

The syndromes of the rows and columns are checked to compute the Candidate Error matrix and obtain the shadow area. All the bits covered by the Candidate Error matrix in the received vector sequence r are flipped using a bitwise XOR function as follows

r'=Mr

(4.6)

where r' is the new sequence and

M

is the Candidate Error Matrix for the sequence r. A new Candidate Error Matrix

M'

is computed from the new sequence. If

M'

is identical to

M

it implies that the error pattern in

r

is a complex error pattern. If

M'

is not equal to

M

it implies the error pattern in r is a simple error pattern. If flipping the bits has decreased the shadow area, then the operation is repeated with r' and

M'

used as input for (4.6). This process is repeated every time

M

is not equal to

M'

after flipping the bits.

After flipping the bits, if

M'

is identical to

M

, we compare the number of rows to the number of columns that have errors. If the number of rows with errors is less than the number of columns, we flip the bits covered by the shadow area, by flipping a single row at a time. On the other hand, if the number of rows with errors is more than the number of columns, we flip a single column at a time. Every time we flip a row or column we compare

M'

to

M

to see if they are identical. If they are, we flip the next row. If they are not, it means the shadow area has decreased, and we start the process afresh by flipping all the bits in the shadow area. If after flipping all the rows and the shadow area has not decreased, we flip the columns one by one checking the shadow area after flipping each column. If the shadow area has remained the same after flipping the column we flip the next. If the shadow area decreases after flipping a column, we start the process from the beginning by flipping all the bits in the new shadow area.

If after flipping one row or column at a time and the shadow area has not decreased, we flip a combination of rows or columns. Initially we flip a combination of two rows or columns and increase the number of rows or columns in the combination while the combination of rows or columns is less than or equal to half the total number of rows or half the total number of columns with errors. After trying all the combinations and the vector still has a shadow area, it means the decoding algorithm has failed to correct the errors. Other means are then used to recover the codeword, like those in Section 2.4.1.

81 | P a g e

The algorithm can be summarized by the pseudo code in Algorithm 4.1

Algorithm 4.1: Iterative decoding of binary product codes using bit flipping Input: received sequence r,

Initialization: find

M

from the received vector sequence

While we have a shadow area, and all combinations have not been tried Flip bits covered by

M

to get a new vector,

r'=Mr

Find new Candidate Error Matrix

M'

based on r'

If

M'

is not identical to

M

then

Save the new vector to be the received vector,

r=r'

Save the new Candidate Error Matrix to be M =M'

Else the error pattern is complex

Flip combinations or rows or columns (see Algorithm 4.2) End if

End while End simple flipping

The flipping of combinations of rows or columns is covered by the pseudo code in Algorithm 4.2. The algorithm for flipping row or column combinations is the same. Even though the pseudo code is written for the rows, the same applies when flipping the columns.

Algorithm 4.2: Combination flipping of rows or columns

Input: current received vector

v

and current Candidate Error Matrix

M

Initialization: ℂ=0 , initialize the complexity by setting it to zero. The complexity is used to keep track of the number of rows or columns being flipped in combination flipping.

Find

, a vector that stores the indexes of the rows with errors.

While the new shadow area is identical to the current shadow area, (M' == M), and ℂ

82 | P a g e

Increment the complexity by one, ℂ= +ℂ 1

Find the possible combinations ℚ of the rows with errors based on ℂ and ℝ   =    ℝ ℚ ℂ

Use the next combination and

M

to create a Flip Matrix, F, to be used for flipping the combination of rows or columns

Flip the bits using F,

r'= ⊕F r

Find new Candidate Error Matrix M' based on r'

End while If M' M≠ then

Save the new vector to be the received vector,

r=r'

Save the new Candidate Error Matrix to be M =M'

Else the error pattern cannot be corrected

Set flag to show all possible combination have been tried but the received vector still has errors

End if

End complex flipping

Related documents