ELEC3227/4247 Midterm Quiz2 Solution with explanation · ELEC3227/4247 Midterm Quiz2 Solution with...

14
ELEC3227/4247 Midterm Quiz2 Solution with explanation Ang Man Shun Department of Electrical and Electronic Engineering, University of Hong Kong Document creation date : 20151205 This document explain the solution of linear block code, cyclic code, BCH code and RS code. It is suggest to read this document after revision. Q1. Linear Code C={000000,010101,101010,111111} n = length of code = 6 k = length of message = 2 Explanation : the number of possible message is related to the length of message. Since the message here is binary, so the number of possible message = 2 k Now number of possible message = 4, so k= 2 Now we have a (6,2) linear block code, so the generator matrix G has the following form P = [ 1 0 1 0; P | I ] G =[ 6−2×2 2×2 0101] And since , thus has the following form. H G T =0 H T I | ] H T =[ P T

Transcript of ELEC3227/4247 Midterm Quiz2 Solution with explanation · ELEC3227/4247 Midterm Quiz2 Solution with...

ELEC3227/4247 Mid­term Quiz2 Solution with explanation

Ang Man Shun Department of Electrical and Electronic Engineering, University of Hong Kong

Document creation date : 2015­12­05

This document explain the solution of linear block code, cyclic code, BCH code and RS code. It is suggest to read this document after revision. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ Q1. Linear Code C=000000,010101,101010,111111 n = length of code = 6 k = length of message = 2 Explanation : the number of possible message is related to the length of message. Since the message here is binary, so

the number of possible message = 2k

Now number of possible message = 4, so k = 2 Now we have a (6,2) linear block code, so the generator matrix G has the following form P = [ 1 0 1 0; P | I ]G = [ 6−2×2

2×2

0 1 0 1 ] And since , thus has the following form.HG T = 0 HT

I | ]HT = [ − PT

And in this case H P | I ] [I | ]G T = [ 4×2

2×2 4×4 − PT2×4 = P − P = 0

Because it is binary, so subtraction is same as addition, thus I | P ]HT = [ T After obtaining the matrix G and H , construct the syndrome as Hs = r T

Hs = r T

c )H= ( + e T

H H= c T + e T

GH H= m T + e T

H= e T

Now since e is a vector with only only one “1s”. So

H 00...1...00]H h row of Hs = e T = [ T = i − t

And by comparing the s and rows of H we can find where is the error bits. Q2.Cyclic Code Step. 1. Compute the error detector logic gate pattern, which is equal to the remainder of . The answer here is 1011, which correspond to (x)xn ÷ g

. The error detector logic pattern thus is [TFTT], make sure thex x xx4 3 2 1 order of the AND gate match the expression !

1

Step 2. Draw the decoder. In general, the decoder consists of three parts :

1) The shift register (the uppermost part) 2) The division circuit (the middle part). The connection to the register of

the division circuit is determined by the coefficient of g(x) 3) The error detector AND gate, the AND gate input logic pattern should

match the step 1 solution.

2

Step 3. Compute syndrome The received codeword r is fired into the whole circuit bit­by­bit and the following figure show the computation of the process. In general there are three phase in the process , the first phase is the process of filling the unfilled register. The second phase is the phase when there is external input (from r) and internal input (from the feedback of the last register). The last phase is when there is no external input but only internal.

3

The error is detected when logic of the register match the error detector. At that moment the AND gate will fire a ‘1’ to correct the content in the shift register.

4

Q3. BCH Code Step 1. Obtain the receiver polynomial r(x), where the coefficients are determined by the received codeword. In here, (x)r = x2 + x5 + x14 Step 2. Compute the syndrome as .(α )Si = r i i). Comput , ,... according to the number of detectable error t.S1 S2 S2t If , it means the code can detect at most 1 error. And in this case we t = 1 only need to compute .S1 If , it means the code can detect at most 2 errors. And in this case we t = 2 need to compute .S1 S2 S3 S4 If , it means the code can detect at most 2 errors. And in this case we t = 3 need to compute .S1 S2 S3 S4 S5 S6 In this question t = 3 so we need to determine up to S1 S6 ii) Compute with the helps of the table for simplification.(α )Si = r i iii) When the power (index) of exceed the range [0, n], add or subtract n α until the index fall within the range [0, n]. iv) There is a short cut for BCH code , that is S )S2k = ( k

2

5

Step 3. Compute the error location polynomial as (x)σ Error location polynomial has the following form

(x) x x .. xσ = 1 + σ1 + σ2 2 + . + σt t

It is a t­order polynomial, and thus should havet roots. Recall thatt (x)σ = 0 is the number of detectable error (detectability), so the order of the error location polynomial is related to such detectability of the code.

6

The coefficients of the error location polynomial is obtained by solving Newton’s identities by Peterson’s method and it has different form for different t : When t = 1, it can detect at most 1 error σ1 = S1

(x) xσ = 1 + σ1

When t = 2, it can detect at most 2 errors

σ1 = S1

σ2 = S21 + S1

S3

(x) x xσ = 1 + σ1 + σ2 2

When t = 3, it can detect at most 3 errors

σ1 = S1

σ2 = S +S31 3

S +S21 5

σσ3 = S31 + S

3 + S

1 2

(x) x x xσ = 1 + σ1 + σ2 2 + σ3 3

In this problem, t = 3, so , and the error location(x) x x xσ = 1 + σ1 + σ2 2 + σ3 3

polynomial for this problem is

7

Step 4. Find the error position and correct the error We have a n­bit codeword, but we count the monomial order from 0, 1, 2, … up to n­1, so

bit is error kth ⇔ σ (α )n−(k−1) = 0 After checking all the :σ (α )i

15 bit is errorσ (α )1 = 0 ⇔ th 6 bit is errorσ (α )10 = 0 ⇔ th 3 bit is errorσ (α )13 = 0 ⇔ th

8

Step 5. Chien’s Searching Circuit The Chien’s Searching circuit is the hardware implementation of step 4. Since we need to compute multiplication in step 4, so Chien’s searching circuit is basically a multiplication circuit, with the coefficient equal to the coefficients in the error location polynomial .(x)σ Since t=3 in this problem, so , and we have the (x) x x xσ = 1 + σ1 + σ2 2 + σ3 3 register content of equal to the coefficients , ,σ1 σ2 σ3 i) Write down the register content Refer to the table obtained from the Galois Field

, so the content of the 4 register are101σ1 = α7 = 1

1 1 0 1 , so the content of the 4 register are101σ2 = α9 = 0

0 1 0 1 , so the content of the 4 register are011σ3 = α6 = 0

0 0 1 1 ii) Find the connection pattern between the register The connection pattern between the register is determined by the expression

βαi = αi (b + α α α )0 b1 1 + b2 2 + b3 3 = (b α + α α α )0

i b1 1+i + b2 2+i + b3 3+i

Where coefficient of is the connection pattern to the register.bi Now in­order to simplify , we need to apply the minimal , , ,αi α1+i α2+i α3+i polynomial Φ(x) by solving Φ( ) = 0 , Φ( ) = 0 , Φ( ) = 0 , Φ( ) = 0αi αi+1 αi+2 αi+3

9

In this problem, after applying the Φ : Φ( ) = 0 α4 ⇔ α4 = 1 + α Thus for the 1st part of the circuit :

βα1 = α1 (b + α α α )0 b1 1 + b2 2 + b3 3 α + α α α= b0 1 b1 2 + b2 3 + b3 4

α + α α (1 )= b0 b1 2 + b2 3 + b3 + α + α α= b3 + (b )α0 + b3

b1 2 + b2 3

Therefore the 1st part of the circuit, which the connection is the coefficient of isαi

Now the second part of the circuit :

βα2 = α2 (b + α α α )0 b1 1 + b2 2 + b3 3

α + α α α= b0 2 b1 3 + b2 4 + b3 5

Since Φ( ) = 0 , so α4 ⇔ α4 = 1 + α ⇔ α5 = α + α2

α + α (1 ) (α )= b0 2 b1 3 + b2 + α + b3 + α2

)α + α= b b )α b2 + ( 2 + b3 + ( 0 + b3 2 b1 3

10

So the diagram is :

Now the third part of the circuit :

βα3 = α3 (b + α α α )0 b1 1 + b2 2 + b3 3

α + α α α= b0 3 b1 4 + b2 5 + b3 6

α4 = 1 + α ⇔ α5 = α + α2 ⇔ α6 = α2 + α3

α + (1 ) (α ) (α )= b0 3 b1 + α + b2 + α2 + b3 2 + α3

+ b + )α b )α b )α= b1 ( 1 b2 + ( 2 + b3 2 + ( 0 + b3 3

11

The overall circuit The overall circuit is as shown as follows

Q4. Reed Solomon Code Step 1. Obtain the receiver polynomial r(x), where the coefficients are determined by the received codeword. Step 2. Compute the syndrome , i = 1,2,3,4 (t=2 for this problem)(α )Si = r i Step 3. Compute the error location polynomial as (x) x xσ = 1 + σ1 + σ2 2

where and σ1 = S +S S22 1 3

S S +S S1 4 2 3 σ2 = S +S S22 1 3

S S +S2 423

12

Step 4. Find the error position. After checking all the :σ (α )i

σ (α )1 = 0 ⇔ β1 = α5 βσ (α )2 = 0 ⇔ 2 = α6

Step 5. Find the error magnitude by solvinge1,2

β βS1 = e1 1 + e2 2 β βS2 = e121 + e2

22

Step 6. Correct the received codeword

­END of document­

13