Embodiment
First, the present invention basis is described, block code and grouping matrix:
(1) block code
Usual block code can be expressed as (n, k), and n is block size, and k is information bit, and n-k is check digit.When coding, usually use generator matrix G, it is the matrix of a k × n; Input information is E, and it is the matrix (namely row vector) of a 1 × k, and the code character after coding is B, and it is the matrix of 1 × n.B=EG, gives one example: k=4, n=7; G is exactly the matrix of 4 × 7
E is the row vector containing 4 elements, supposes, E=[E
0e
1e
2e
3]
B is the row vector containing 7 elements, supposes, B=[B
0b
1b
2b
3b
4b
5b
6]
According to formula B=EG
So:
B
0=E
0
B
1=E
1
B
2=E
2
B
3=E
3
B
4=E
0+E
1+E
2
B
5=E
0+E
1+E
3
B
6=E
0+E
2+E
3
Can find out, after coding, front 4 elements are still consistent with the A of input, and latter 3 is the check digit calculated.
After the modulated device of data B sends, propagate in noisy channel, at receiving terminal, the data that demodulator receives represent with C,
C=[C
0C
1C
2C
3C
4C
5C
6]
Verify the B whether C that receives is still original, when this just needs to check coding, whether check equations of application is set up, namely
C
4=C
0+C
1+C
2
C
5=C
0+C
1+C
3
C
6=C
0+C
2+C
3
Whether these 3 equations are set up, and this verification relation is decided by check matrix H, H and G is one to one, and they meet GH
t=0, H
tit is the transposed matrix of H.According to G above, the check matrix H corresponding with him can be drawn,
So when decoding, as long as checking HC
twhether be 0, C
tit is the transposed matrix of C.Work as HC
twhen=0, show that check equations is set up, data C is errorless; Otherwise data C is wrong.
Find have three check equations to need to calculate by deriving
Equation is set up, then data C is errorless; Otherwise data C is wrong.Verification relation when these three equations and coding
Consistent (in the computing of a bit, 1+1=1-1=0).
According to analysis above, when decoding, topmost foundation is exactly check matrix H, and he determines the verification relation between information bit and check digit, is finally to carry out decoding by the mode of calculation check equation.
Patent of the present invention proposes a kind of Hardware Implementation of Parallel Iteration Decoding Method of LDPC code, but the method be not suitable for all LDPC code, and he can only be applied to the check matrix H of packet characteristic.
(2) divide into groups matrix (matrix of expansion)
Grouping matrix is the special matrix of a class, first, there is a basis matrix S (m × l, the capable l row of m), then expand it with a factor p, thus obtain a pm × pl matrix S ', in former basis matrix S 0 with a p × p complete zero submatrix replacement, in former basis matrix S 1 replaces (this submatrix is the form after the unit matrix of p × p or unit matrix move to right, and its each row and column all only have one 1) with the non-full zero submatrix of a p × p.
Suppose that S is the matrix of 3 × 7
P=3, first, we all p × p sub-matrix columns out,
It is exactly the unit matrix of 3 × 3
Be exactly P
0in every row ring shift right one, rightmost one row have moved on to the Far Left of matrix
Be exactly P
0in every row ring shift right two
It is full null matrix
Then, P is used
-1to substitute in S original 0, use P
0, P
1, P
2to come in alternative S original 1.Substituting with which submatrix specific to each 1 is to arrange arbitrarily, and we expand according to wherein a kind of alternative hypothesis, obtain 9 × 21 matrix S '
For convenience of description, we usually with this mode below express above 9 × 21 matrix
The second, describe specific implementation of the present invention in detail:
(1) hardware configuration
Ldpc decoder of the present invention, structure as shown in Figure 2, specifically comprises:
P dual-ported memory (ram A
q), be positioned at data input pin, each data block C
ip data (C
i1, C
i2, C
i3... C
ip) stored in p described dual-ported memory (ram A
q) same address i, wherein: p > q>=0, p be greater than 1 natural number, i, q are integers;
For storing the second memory (rom H) of check matrix H, (the ram A of dual-ported memory described in control connection
q); Described check matrix H has packet characteristic;
First data shifts unit, input connects described dual-ported memory (ram A
q), for the numbering x (during x ≠-1) according to check matrix H neutron array P to described dual-ported memory (ramA
q) current address i parallel output data [C
i1, C
i2, C
i3... C
ip] ring shift left x position, wherein: be numbered the P of 0
0be the unit matrix of p × p, be numbered the P of-1
-1be the full null matrix of p × p, be numbered the P of x (during x ≠-1)
xp
0often arrange the matrix behind the x position that moves to right ,-1≤x < p, x is integer;
Subtracter, an input connects the first data shifts unit as subtrahend;
P calculator, input connects described subtractor outputs, each calculator according to check equations to respective N number of serial input data C
j(N>=j > 0) calculates, and parallel computation exports difference d
j(N>=j > 0);
For storing the 3rd memory (the ram d of all difference d
qp > q>=0), input connects p described calculator output, output connects described subtracter another input as minuend, for the result of calculation of each described calculator of parallel output when upper once iteration, i.e. and difference d;
Adder, an input connects described calculator output;
P First Input First Output buffer (FIFO
q), another input that input connects described subtractor outputs, output connects described adder;
Second data shifts unit, input connects described adder output, output connects described dual-ported memory (ram A
q), replace legacy data on described dual-ported memory correspondence position afterwards for exporting the datacycle x position that moves to right according to the numbering x of check matrix H neutron array P to adder.
(2) detailed decoded operation and specific works step
1. input the storage of data
That deliver to decoder is log-likelihood ratio (LLR) the data C that demodulation exports, and these data have rbit (r >=3) bit wide, and are serial inputs.When stored in dual-port ram A, first divide into groups, in the structure of parallel computation, the number of grouping is consistent with the factor p of submatrix, and every p data are a data block, with i (
n is block size, and p is the factor of submatrix) mark different data blocks, according to the length of LDPC code block, i has different maximums.As under the same address that p data of same data block need stored in dual-port ram A, this p data can be read when reading so simultaneously; So we are individual for dual-port ram A p little dual-port ram A
q(p > q>=0) realizes, p the data of same like this data block i, just can stored in the individual little dual-port ram A of p
qall data are first divided into data block and store, just complete step 1 by the same address i of (p > q>=0).
2. data reading and preliminary treatment
According to the factor p of submatrix, one group can calculate p check equations, and the information of check equations is all stored in the check matrix H of LDPC code, and when encoding, H is the foundation of coding; When decoding, H is also the foundation of calculation check equation.In a decoder, we store H with a rom, before calculating, need will to participate in the data block of this group check equations from dual-port ram A according to the information of matrix H
qread in (p > q>=0), this is mainly by control ram A
qread address to realize, first, read first the data block i and C participating in this check equations
i1, C
i2, C
i3... C
ip, put in order (mode by moving to left or moving to right) of this p data is adjusted according to the numbering of check matrix H neutron array P.After displacement, the result d that when also will deduct last iteration, this group check equations calculates
i1, d
i2, d
i3... d
ip(not needing during iteration first), because the result that check equations calculates, be not available to affect he self calculating next time.Secondly, in the same way, read second data block, the 3rd data block that participate in this check equations, until N number of data block, N is the number of the data participating in this check equations, namely basis matrix S often in row element be the number of 1.In realization, p data in same data block be parallel work-flow (while), first data block, second data block, the 3rd data block, until N number of data block they are serial operation (time is successively order).Final output, the data flow that p group is parallel, each data flow C
j(N>=j > 0) comprises N number of serial data and namely constitutes check equations.
3. calculation check equation
Calculator, in the hardware configuration of LDPC realization of decoding, is a very important ring.It is responsible for calculation check equation, provides value and difference that input data need adjustment, for calculating afterwards provides correction.In the structure of parallel computation, the number of the calculator that we introduce is consistent with the factor p of submatrix, and for a calculator, its concrete step is: suppose that input serial data is C
j(N>=j > 0), first, verify whether this check equations is set up, and we calculate
(hd is C
jsign bit, it is 1bit binary data, adds so summation operation here is just equivalent to mould two), its realize hardware logic structure as shown in Figure 3, wherein:
As correct=0, represent that the data sequence of input meets check equations;
As correct=1, represent that the data sequence of input does not meet check equations.
Difference d
j(N>=j > 0), with the C of input
jone to one, be also by symbol and amplitude dimerous, also calculate respectively in calculator.Symbol hd (the d of difference
j)=hd (C
j)+correct (being also that mould two adds here), its realize hardware logic structure as shown in Figure 3, wherein:
Difference d
jamplitude calculate need following step: first to find out serial data C
jmiddle amplitude min value MIN
1, MIN
1=min (amp (C
j)), and it is in sequence C
jin position v; Then sequence C is found out
jin amplitude second little value MIN
2, MIN
2=min (amp (C
j)), for (j ≠ v); 3rd calculates Ivl_out, lvl_out=max (0, MIN
1-f (MIN
2-MIN
1)) wherein the expression formula of function f (x) be:
Amp (d can be obtained thus
j):
amp(d
j)=lvl_out,for(j≠v);amp(d
v)=MIN
2
So difference d
jamplitude have 2 kinds of possible outputs, as j=v, amp (d
v)=MIN
2; For other C
j(j ≠ v), amp (d
j)=lvl_out; Said above, the result of calculating will store, for serial data C
jin each data, all can difference d corresponding to Serial output one
j(N>=j > 0).P calculator concurrent working simultaneously, can parallel output p difference d
i1, d
i2, d
i3... d
ip, with p memory ram d
q, (p > q>=0) stores these data.
4. store revised data
After having calculated, the difference of parallel output and First Input First Output buffer (FIFO
q) output be added; Then result is deposited by the second data shifts unit again and get back to dual-port ram A
qin, then just can start the calculating of next check equations.
3rd, further describe in conjunction with the specific embodiment of the invention:
(1) hardware configuration
The ldpc decoder of the specific embodiment of the invention, structure as shown in Figure 5, specifically comprises:
The splitter of one point three, is positioned at data input pin, serial input is transferred to parallel input;
Three dual-ported memories, connect splitter corresponding ports;
For storing the second memory of check matrix H, dual-ported memory described in control connection; Described check matrix H has packet characteristic;
First data shifts unit, input connects described dual-ported memory, for according to the numbering x of check matrix H neutron array P to described dual-ported memory current address i parallel output data [C
i1, C
i2, C
i3... C
ip] ring shift left x position, wherein: be numbered the P of 0
0be the unit matrix of 3 × 3, be numbered the P of-1
-1be the full null matrix of 3 × 3, be numbered the P of x (during x ≠-1)
xp
0often arrange the matrix behind the x position that moves to right ,-1≤x < p, k is integer;
Subtracter, an input connects the first data shifts unit as subtrahend;
Three calculators, input connects described subtractor outputs, each calculator according to check equations to the respective individual serial input data C of N (in example N=4)
j(N>=j > 0) is (as [C in example
00c
12c
20c
40]) calculate, parallel computation exports difference d
j(N>=j > 0) is (as [d in example
0 00d
0 10d
0 20d
0 40]);
For storing the 3rd memory of all difference d, input connects three described calculator outputs, output connects described subtracter another input as minuend, for each described calculator of parallel output simultaneously or the difference d that exports of same time sequencing;
Adder, an input connects described calculator output;
Three First Input First Output buffers, another input that input connects described subtractor outputs, output connects described adder;
Second data shifts unit, input connects described adder output, output connects described dual-ported memory, for replacing data in original correspondence position according to the numbering x of check matrix H neutron array P afterwards to the x position that moves to right of the datacycle after calculating.
(2) detailed decoded operation and specific works step
Using the matrix S ' as the check matrix H of this example provided, illustrate the embodiment of whole parallel decoding above.
1. the storage of data input
For block code, input data by the input of code block one piece a piece, will suppose that current input code block is C,
C=[C
0C
1C
2C
3C
4C
5C
6C
7C
8C
9C
10C
11C
12C
13C
14C
15C
16C
17C
18C
19C
20]
Each input data are rbit (r >=3) LLR value (log-likelihood ratio), deposit in dual-port ram A, common way is one by one stored in ram A by input data, in the present invention, we first divide into groups input code block C, the foundation of grouping is the spreading factor p (in this instance p=3) of check matrix H, so first by the order of the data in C by input, and every 3 data one group; After grouping, C can be expressed as
C=[C
00C
01C
02C
10C
11C
12C
20C
21C
22C
30C
31C
32C
40C
41C
42C
50C
51C
52C
60C
61C
62]
Wherein C
01in 0 represent the 0th group, in 1 expression group, label is the data of 1;
When storing, needing the dual-port ram A that 3 identical, being expressed as A
0, A
1, A
2.Label in each group is that the data of 0 are stored in A
0in; Label in each group is that the data of 1 are stored in A
1in; Label in each group is that the data of 2 are stored in A
2in; Stored in address determined by little group #.
So, C
00, C
01, C
02will successively stored in A
0, A
1, A
2address 0 in;
C
10, C
11, C
12will successively stored in A
0, A
1, A
2address 1 in;
C
60, C
61, C
62will successively stored in A
0, A
1, A
2address 6 in;
After storing in this manner, when reading, just can by the data of same a small group (such as C
00, C
01, C
02) read out simultaneously.
2. data reading and preliminary treatment
To stored in code block, be about to begin and carry out iterative decoding, main calculating is exactly verify each check equations, revises the LLR value of data by checking check equations.Before the computation, data need according to the needs of check equations from A
0, A
1, A
2middle reading, then through preliminary treatment, then sends in calculator and calculates.
Contain the information of all check equations in check matrix H, according to the grouping situation of H itself, the calculating of check equations also will be divided into groups, all check equations in same group, walks abreast and calculates simultaneously.First by matrix multiplication HC
t, list all check equations.
Totally 9 check equations, because p=3, so by check equations by order every 3 group from top to bottom, the check equations with group realizes parallel computation.The data of carrying out parallel computation, when reading, read, for first group of check equations simultaneously.
1. give A simultaneously
0, A
1, A
2address 0 is read in tax;
2. A
0, A
1, A
2export data simultaneously, be designated as [C
00c
01c
02], because be export simultaneously, so represent with a vector;
3. according to the numbering of check matrix H neutron array P, to [C
00c
01c
02] be shifted;
The corresponding first group of check equations of the first row above in H, the first submatrix P of the first row
0represent [C
00c
01c
02] shift value is 0, do not need displacement.
4. [the C after displacement
00c
01c
02] just deliver to respectively 3 independently in calculator (during only for iteration first), during non-iteration first, the difference [d of this group check equations output when deduct last iteration
0 00d
0 01d
0 02] after, then deliver to 3 respectively independently in calculator.The calculating of difference can be described in the calculator below.
5. A is given
0, A
1, A
2address 1 is read in tax;
6. A
0, A
1, A
2export data simultaneously, be designated as [C
10c
11c
12];
7. second submatrix P of the first row
2represent [C
10c
11c
12] shift value is 2, to [C
10c
11c
12] ring shift left 2;
8. [the C after displacement
12c
10c
11] just deliver to respectively 3 independently in calculator (during only for iteration first), during non-iteration first, the difference [d of this group check equations output when deduct last iteration
0 10d
0 11d
0 12] after, then deliver to 3 respectively independently in calculator.
Perform identical operation below, [C
20c
21c
22], [C
40c
41c
42] read, be shifted, deduct difference feeding calculator.
3. calculation check equation
Because be parallel computation, so will use multiple identical calculator simultaneously, be 3 in this instance, we analyze the process of a calculator, other identical.
We analyze the calculating of first check equations in first group of check equations below:
The serial data being input to check equations is: [C
00c
12c
20c
40]
Whether be 0, because C if first will calculate this check equations
00the data of rbit, so the sign bit will getting him when calculating is added, hd (C
00) be exactly get C
00sign bit.
correct=hd(C
00)+hd(C
12)+hd(C
20)+hd(C
40)
As correct=0, represent that the data sequence of input meets check equations;
As correct=1, represent that the data sequence of input does not meet check equations.
Afterwards, the difference exported is calculated
1. the symbol of calculated difference
hd(d
0 00)=correct+hd(C
00)
hd(d
0 10)=correct+hd(C
12)
hd(d
0 20)=correct+hd(C
20)
hd(d
0 40)=correct+hd(C
40)
2. the amplitude of calculated difference
First serial data [C to be found out
00c
12c
20c
40] middle amplitude min value MIN
1, MIN
1=min (amp (C
00), amp (C
12), amp (C
20), amp (C
40)) amp represents amplitude, and its position v in the sequence; Suppose MIN
1=amp (C
20), then find out the little value MIN of amplitude second in sequence
2, MIN
2=min (amp (C
00), amp (C
12), amp (C
40)); Three, Ivl_out, lvl_out=max (0, MIN is calculated
1-f (MIN
2-MIN
1)) wherein the expression formula of function f (x) be:
There is Ivl_out and MIN
2just can the amplitude of calculated difference, for the C that amplitude is minimum
20,
Its
amp(d
0 20)=MIN
2
For other inputs
amp(d
0 00)=amp(d
0 10)=amp(d
0 40)=lvl_out
Difference stored in memory, when this check equations of next iterative computation, will will read this difference, and deduct from list entries.
4. store revised data
The difference of first group of 3 check equations calculated is respectively:
[d
0 00d
0 10d
0 20d
0 40]
[d
0 01d
0 11d
0 21d
0 41]
[d
0 02d
0 12d
0 22d
0 42]
Be input as:
[C
00C
12C
20C
40]
[C
01C
10C
21C
41]
[C
02C
11C
22C
42]
After addition:
According to address when reading and the numbering of memory, the data after calculating are deposited back again
Deposit A respectively
0, A
1, A
2address 0;
First to be shifted and become
Afterwards, A is deposited respectively
0, A
1, A
2address 1;
Deposit A respectively
0, A
1, A
2address 2;
Deposit A respectively
0, A
1, A
2address 4;
Data, stored in rear, complete the calculating of the check equations of a group; Again from step 2, calculate next group check equations, then complete an iteration for one time when all check equations all calculate; Second time iteration, from step 2, all calculates to all check equations and then completes second time iteration for one time.When completing in certain iteration, all check equations are all satisfied; Or iterations is when reaching the higher limit of setting, iteration ends decoding terminates.
Finally, the foregoing is only preferred embodiment of the present invention, all equalizations done according to the claims in the present invention scope change and modify, and all should belong to the covering scope of the claims in the present invention.