• Tidak ada hasil yang ditemukan

Decoding Example

5.3 Threshold-Based Message-Passing Algorithms for Decoding

5.3.2 Decoding Example

For brevity, the example is drawn from the smallest non-trivial 4×4 Sudoku code.

Figure5.19a shows the Sudoku squareSwithq =4 (andr =2) that we showed earlier in Figure5.17. The entriesSi j ofScontain the values from 1 toqthat satisfy the Sudoku constraints. For example,S14=4 andS44=1. To the right ofSis anr×rbinary subarray S14corresponding toS14. EachSi j has a corresponding subarraySi j that containsqcells Si j k, withk=1 . . .q.

1 0 0 0

0 0 0 1 0 1

0 0

0 0 1 0 1 0

0 0

1 0 0 0

1 0 0 0 0 1 0 0

0 1 0 0 0 1

0 0 0 0 1 0

0 0 1 0 0 0 0 1

0 0 0 1

0 0 0 1 0 0 1 0 1 2 3 4

3 4 1 2 2 1 4 3 4 3 2 1

0 0 0 1

FIGURE5.19 The (a)q-ary and (b) binary 4×4 Sudoku square

Cellk=1 is on the upper-left corner of the subarray and cellk =q is on the lower- right corner. The cellsSi j k contain all zeros except wherek=Si j. Replacing the values Si j in S with theirr ×r binary subarraysSi j produces a new qr ×qr square S with (qr)2q2zeros andq2ones. Performing this operation on theSshown in Figure5.19a producesS, shown in Figure5.19b.

Figure5.20a is derived from Figure5.19a, showing onlyS11and the other entries ofS related through the Sudoku constraints. EachSi j obeys the three constraints that pre- vent duplicates (1) across any row (2) down any column (3) in the samer×r block (Latin squares use the first two constraints). SinceS11inSis related toS11inS, instead of the q-ary values, Figure5.20b showsS111and the other related binary valuesSi j k .

0 1 0 0 0

0

0

0 0

0 1 2 3 4 0

3 4 2 4

FIGURE5.20 The entries related toS111through the constraints

Figure5.20b gives away the algorithm: the entryS111 is controlled by four constraints:

hh,hv,hb, andhc. The subscripts{h,v,b,c}indicate that the constraint is operating hori- zontally, vertically, in a block, and in a cell. Each constrainth{h,v,b,c}operates on a set of cellsV(h{h,v,b,c}). For example, in Figure5.20we have:

V(hh)={S111 ,S121,S131,S141}, V(hv)={S111 ,S211,S311,S411}, V(hb)={S111 ,S121,S211,S221}, V(hc)={S111 ,S112,S113,S114}.

Each of the otherSi j k’s also has its own constraintshh,hv,hb, andhc(possibly different fromS111’s). Denote byHh(v), Hv(v),Hb(v), andHc(v) the horizontal, vertical, block, and cell constraints controllingv, andH(v)=Hh(v)Hv(v)Hb(v)Hc(v). How many such constraints are there? Let us count the horizontal constraints first. For a fixediand k,Hh(Si j k )=Hh(S

i jk), therefore for alli andk, we haveq2horizontal constraints. The same is true for the vertical constraints. There areq blocks, each withq constraints for k=1 . . .q, for a total ofq2constraints. Finally, each of theq2cells has its own constraint.

Thus, 4q2constraints control theq3entries ofS.

Figure5.21shows the four check nodeshh,hv,hb, andhcforS111. The eleven variable nodes are shown underneath the circles labeled with theiri,j, andk’s. From Figure5.20, S111=1 and 0 for other values ofi,j, andk. Each variable nodeSi j k is entangled in the same structure that enforces codeword integrity, i.e., erasing one symbol affects several check nodes.

⊞ ⊞ ⊞ ⊞

° ° ° ° °

° ° ° °

°

111 121 131 141

311 411 221 112 211 113

°

114

hh hv hb hc

FIGURE 5.21 The check equationshh,hv,hb, andhcforS111

We now provide a our own definition for the check nodes, different from the standard LDPCs. Suppose thathoperates on a set ofqvariable nodesV(h), orV for short. Denote byV1(h) the set of variable nodes with ones, and byV0(h) those with zeros. Likewise,

denote byVe(h) the set of variable nodes with erasures. For anyh,|VeV0V1|=|V|=q. DefineHas a function ofhthat returns four possible values:error,valid,pause, orsolve (ore,v,p, ands). The functionH(h) reports thestateofh. WhenH(h) returns anerror, we say thathis in theerrorstate, orhis anerrornode. WheneverV(h) is updated,his updated unless it is anerrornode.

H(h)=

























error if|V1|>1 or|V0|=q valid if|V1|=1 and|V0|=q1 pause if|Ve|>1 and|V1|=0 solve if|Ve|=1 or|V1|=1.

(5.11)

IfSis a valid Sudoku square (and thus a valid codeword), then all its 4q2check nodes are validnodes. As entries are erased, some affected check nodes becomesolvenodes. As more entries are erased, the number ofpausenodes increase. A decodeable codeword (or a solvable puzzle) leaves enough unerased entries to recover the numbers uniquely.

Erasure correction starts from thesolvenodes, iteratively attempting to convert all check nodes tovalidnodes.

Figures5.22and5.23show a codewordSand its binary arraySwithqr×qr variable nodes. SurroundingSare four groups of 4q2check nodes. Each block hasq copies of r×r subarrays, each indexed byk=1 . . .q.

Directly aboveSis theHv group. The group has four subarrays j =1 . . . 4, from left to right. Thekth cell in subarrayj containsHv(S1j k ). To the right ofSis theHh group with its four subarraysi =1 . . . 4, from top to bottom. Thekth cell in subarrayi contains Hh(Si1k). To the right is the squareHb group with its subarrays arranged from top left corner to the bottom-right corner. Thekth node in subarrayicontrols all thekth cells in groupiofS. Finally, we have theHcgroup, whose (i,j)thcellcontainsHc(Si j k ). Having established these definitions, the decoding process can now start.

1 3 4

2 4

3 1

FIGURE5.22 One example of a Sudoku puzzle

Figure5.23shows the initial states of all the check nodes. In this Figure, there is no validnode, onlypausenodes andsolvenodes. For example,Hh(S411) andHh(S413) are bothsolvenodes becauseS423andS441contain ones.

0 0 0 1 0 1

0 0 1 0 0 0

1 0 0 0 0 0

1 0

0 0 0 1 0 0 1 0

p s p s s p s p p p p p s s s s

p s s p

s p p s p p s s s p p p

v p p v

v p p v v v p p v p p p

FIGURE5.23 The variable and check nodes

In the first iteration, allsolve nodes attempt to correct their single erasures, update their states tovalid, and propagate the corrections to other check nodes. The result is shown in Figure5.24. As expected, the set ofsolveandvalidnodes grows, while the set ofpausenodes shrinks.

This process is repeated in the next iteration. After the second iteration, the graph contains only five erasures, as shown in Figure5.25. Finally, after the third iteration, all variable nodes are restored to their original values as shown in Figure5.26. First seen as a hindrance to correcting the erasures, the four constraints on each variable node actually help in erasure correction.

Although this example only covers a 4×4 Sudoku square, the concepts can be applied to larger LS squares. Latin square decoders have no block check nodes — only the other 3q2check nodes — and cannot be visualized as easily as the Sudoku decoders because q is not always a square power of an integer.

0 0

0 0 0 1 0 1

0 0

0 0 1 0

0 0

0 0

1 0 0 0 0

0 0 0 0

0

0 0 1 0 0 0

0

0 0 0 1 0 0 1 0 s s

s p s p s p

s p s s s p s s

s s s s s s s s p p p p v s s s

p v v p

v p p v p p v v v p p p

v p p v

v p p v v v p p v p p p

FIGURE5.24 The puzzle after the first iteration

1 0 0 0

0 0 0 1 0 1

0 0

0 0 1 0 1 0

0 0

1 0 0

1 0 0 0 0 1 0 0

0 0 0 0 1

0 0 0 0 1

0 0 1 0 0 0 0 1

0 0

0 0 0 1 0 0 1 0

v v v s

v s v s

v s v v v s v v v v

v v v v v v v p v p v v v v

v v v v

v v v v v p v v v s v p

v v v v

v v v v v v s s v v s p

FIGURE5.25 The puzzle after the second iteration

1 0 0 0

0 0 0 1 0 1

0 0

0 0 1 0 1 0

0 0

1 0 0 0

1 0 0 0 0 1 0 0

0 1 0 0 0 1

0 0 0 0 1 0

0 0 1 0 0 0 0 1

0 0 0 1

0 0 0 1 0 0 1 0

v v v v

v v v v

v v v v v v v v v v

v v v v v v v v v v v v v v

v v v v

v v v v v v v v v v v v

v v v v

v v v v v v v v v v v v

FIGURE 5.26 The puzzle after the third and final iteration

The iterative algorithm we just described inherits the same limitations as the one used for decoding erased LDPC codewords: some puzzles contain stopping sets that halt the algorithm prematurely.

For example, the erasure pattern in Figure5.27a poses no problem, but the one in Figure5.27b has a stopping set. Once stopped, the algorithm can continue by selecting from the (q-ary)S the block, row, or column with the fewest number of erasurese and try all thee! possible completion configurations. For each configuration, the algorithm runs until it encounters an error.

1

2 4 3

1 3

2

3

FIGURE5.27 Squares without and with stopping set

In the best case, one configuration leads to a solution, while all others produce er- rors. In the worst case, more than one configuration leads to solution. In some case, it finds another smaller stopping set, from which the process is repeated recursively until a maximum number of solutions is found.