23
Modul #10 TE3223 TE3223 SISTEM KOMUNIKASI SISTEM KOMUNIKASI 2 SISTEM KOMUNIKASI SISTEM KOMUNIKASI 2 CYCLIC BLOCK CODE Program Studi S1 Teknik Telekomunikasi Departemen Teknik Elektro - Sekolah Tinggi Teknologi Telkom Bandung – 2008

Modul 10 Siskom2 Cyclic Code

Embed Size (px)

DESCRIPTION

cyclic

Citation preview

Page 1: Modul 10 Siskom2 Cyclic Code

Modul #10

TE3223 TE3223 SISTEM KOMUNIKASISISTEM KOMUNIKASI 22SISTEM KOMUNIKASI SISTEM KOMUNIKASI 22

CYCLIC BLOCKCODE

Program Studi S1 Teknik TelekomunikasiDepartemen Teknik Elektro - Sekolah Tinggi Teknologi Telkomp gg g

Bandung – 2008

Page 2: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

Cyclic codes are a subclass of linear block codes.block codes.Encoding and syndrome calculation are easily performed using feedback shifteasily performed using feedback shift-registers.

Hence relatively long block codes can beHence, relatively long block codes can be implemented with a reasonable complexity.

BCH and Reed Solomon codes areBCH and Reed-Solomon codes are cyclic codes.

Modul 10 - Siskom 2 - Cyclic Block Code 2

Page 3: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

A linear (n,k) code is called a Cyclic code if ll li hift f d d lif all cyclic shifts of a codeword are also a codeword.

)(

),...,,,()(

1210 −=i

n

uuuuuuu

uuuu

U

U “i” cyclic shifts of U

Example:

),...,,,,,...,,( 121011)(

−−−+−−= inninin uuuuuuuU

U )1101(UUUUU

U=====

=

)1101( )1011( )0111( )1110()1101(

)4()3()2()1(

Modul 10 - Siskom 2 - Cyclic Block Code 3

Page 4: Modul 10 Siskom2 Cyclic Code

Example: (7,4) cyclic codeInformation Message (m) Codeword (U) Code Polynomial U(X)Information Message (m) Codeword (U) Code Polynomial U(X)

(0 0 0 0) (0 0 0 0 0 0 0) 0

(1 0 0 0) (1 1 0 1 0 0 0) 1+X+X3

(0 1 0 0) (0 1 1 0 1 0 0) X+X2+X4(0 1 0 0) (0 1 1 0 1 0 0) X+X2+X4

(1 1 0 0) (1 0 1 1 1 0 0) 1+X2+X3+X4

(0 0 1 0) (0 0 1 1 0 1 0) X2+X3+X5

(1 0 1 0) (1 1 1 0 0 1 0) 1+X+X2+X5(1 0 1 0) (1 1 1 0 0 1 0) 1+X+X2+X5

(0 1 1 0) (0 1 0 1 1 1 0) X+X3+X4+X5

(1 1 1 0) (1 0 0 0 1 1 0) 1+X4+X5

(0 0 0 1) (0 0 0 1 1 0 1) X3+X4+X6(0 0 0 1) (0 0 0 1 1 0 1) X3+X4+X6

(1 0 0 1) (1 1 0 0 1 0 1) 1+X+X4+X6

(0 1 0 1) (0 1 1 1 0 0 1) X+X2+X3+X6

(1 1 0 1) (1 0 1 0 0 0 1) 1+X2+X6(1 1 0 1) (1 0 1 0 0 0 1) 1+X2+X6

(0 0 1 1) (0 0 1 0 1 1 1) X2+X4+X5+X6

(1 0 1 1) (1 1 1 1 1 1 1) 1+X+X2+X3+X4+X5+X6

(0 1 1 1) (0 1 0 0 0 1 1) X+X5+X6

4

(0 1 1 1) (0 1 0 0 0 1 1) X+X5+X6

(1 1 1 1) (1 0 0 1 0 1 1) 1+X3+X5+X6

Page 5: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

Algebraic structure of Cyclic codes, implies expressing codewords in polynomial formp y

R l ti hi b t d d d it li hift

)1( degree ...)( 11

2210 n-XuXuXuuX n

n−

−++++=U

Relationship between a codeword and its cyclic shifts:

...

...,)(

111

22

101

11

22

10

++++++=

+++=

−−−

−−

−−

nn

nn

nn

nn

nn

uXuXuXuXuu

XuXuXuXuXXU

)1()( 1)1(

)1(

11

)(

2101

1)1(

++= −

+−

nn

Xu

nn

X

nn

XuX

nn

UU

4434421444444 3444444 21

Hence:)1( modulo )()()( += nii XXXX UU

By extension

)1( modulo )()()1( += nXXXX UU

Modul 10 - Siskom 2 - Cyclic Block Code 5

Page 6: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

Basic properties of Cyclic codes:Let C be a binary (n k) linear cyclic codeLet C be a binary (n,k) linear cyclic code1. Within the set of code polynomials in C, there

is a unique monic polynomial with )(Xg)(Xminimal degree is called the

generator polynomials.)( . Xnr g<

rr XgXggX +++= ...)( 10g

2. Every code polynomial in C, can be expressed uniquely as

3 The generator polynomial is a factor of

r10

)(XU)()()( XXX gmU =

)(Xg3. The generator polynomial is a factor of )(Xg1+nX

Modul 10 - Siskom 2 - Cyclic Block Code 6

Page 7: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

The orthogonality of G and H in polynomial form is expressed as This1)()( += nXXX hgform is expressed as . This means is also a factor of

1)()( +XXX hg1+nX)(Xh

k1. The row , of generator matrix is formed by the coefficients of the cyclic shift of the generator polynomial.

kii ,...,1, ="1" −i

g p y

⎥⎥⎥⎥⎤

⎢⎢⎢⎢⎡

=⎥⎥⎥⎤

⎢⎢⎢⎡

=r

r

gggggg

XXX

OOOO

L

L

M

10

10

)()(

0

gg

G

⎥⎥⎥⎥

⎦⎢⎢⎢⎢

⎥⎥

⎦⎢⎢

⎣−

r

rk

gggggg

XXL

L

OOOOM

10

101 )(0

g

G

Modul 10 - Siskom 2 - Cyclic Block Code 7

Page 8: Modul 10 Siskom2 Cyclic Code

Example: Generator Matrix of Cyclic Codes

00gggg00000gggg00000gggg

n-k210

n-k210

.......

.......

00gggg00=G n-k210

.

........

gggg0000 n-k210 .......

Example: (7,4) Cyclic Code with g(X)=1+X+X3Example: (7,4) Cyclic Code with g(X) 1 X X

010110000101100001011

=G

Could be converted to systematic form with the help of row

ti 010011100101100001011

=G'

10110000101100 operations

10001010100111

8Modul 10 - Siskom 2 - Cyclic Block Code

Page 9: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

Systematic encoding algorithm for an ( k) C li d(n,k) Cyclic code:

1. Multiply the message polynomial by )(Xm knX −

2. Divide the result of Step 1 by the generator polynomial . Let be the reminder.)(Xg )(Xppolynomial . Let be the reminder.

3. Add to to form the codeword

)(g )(Xp

)(p X )(XX kn m− )()(XU

Modul 10 - Siskom 2 - Cyclic Block Code 9

Page 10: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

Example: For the systematic (7,4) Cyclic code with generator polynomial 31)( XXX ++=gwith generator polynomial

1. Find the codeword for the message3 ,4 ,7 =−== knkn

)1011(=m1)( XXX ++=g

:(by)(Divide)1()()(

1)()1011(6533233

32

++=++==

++=⇒=

gmmm

mm

X)XXXXXXXXXXXX

XXX

kn

kn

:polynomialcodewordtheForm

1)1()1(:(by )( Divide

)(remainder generator

3

quotient

32653

4342143421444 3444 21++++++=++

gm

pgq

XXXXXXXXX)XX

X(X)(X)

)1 1 0 1 0 0 1(1)()()(

:polynomialcodeword theForm

bitsmessagebitsparity

6533

321321=+++=+=

UmpU XXXXXXX

Modul 10 - Siskom 2 - Cyclic Block Code 10

gp y

Page 11: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

Find the generator and parity check matrices, G and H, respectively.

⎥⎥⎤

⎢⎢⎡

=⇒⋅+⋅+⋅+=

00101100001011

)1101(),,,(1011)( 321032g ggggXXXX

Not in systematic form.

⎥⎥⎥

⎦⎢⎢⎢

=

101100001011000010110

G We do the following:

row(4)row(4)row(2)row(1)row(3)row(3)row(1)

→++→+

⎥⎥⎥⎥⎤

⎢⎢⎢⎢⎡

=010011100101100001011

G⎥⎥⎥⎤

⎢⎢⎢⎡

=111010001110101101001

H

⎥⎦

⎢⎣ 1000101

⎥⎦⎢⎣ 1110100

44×I33×I TPP

Modul 10 - Siskom 2 - Cyclic Block Code 11

Page 12: Modul 10 Siskom2 Cyclic Code

Encoding of Cyclic Codes in Systematic Form

Encoding Circuit is a Division CircuitEncoding Circuit is a Division CircuitEncoding Circuit is a Division CircuitEncoding Circuit is a Division Circuit

Gate

g1 g2 g k 1

++R0 ++

g1

R1 ++

g2

R2 ++

gn-k-1

.. Rn-k-1

Xn-k m(X)

Parity Check Bits

Information BitsCodeword

y

12Modul 10 - Siskom 2 - Cyclic Block Code

Page 13: Modul 10 Siskom2 Cyclic Code

Encoding Circuit Example: Implementation

Encoding Circuit of (7,4) Cyclic Code with g(X)=1+X+X3Encoding Circuit of (7,4) Cyclic Code with g(X)=1+X+X3

Gate

++++ R2

Xn-k m(X) Codeword

R1R0

Xn k m(X)

Parity Check Bits

Information BitsCodeword

Assume m=(1 0 1 1)Input Register Contents

0 0 0 (Initial State)( )

1 1 1 0 (First Shift)

1 1 0 1 (Second Shift)

0 1 0 0 (Third Shift)

Codeword:(1 0 0 1 0 1 1)

13

( )

1 1 0 0 (Fourth Shift)

Page 14: Modul 10 Siskom2 Cyclic Code

Encoding Circuit Example: Verification

m=(1 0 1 1) m(X) = 1+X2+X3

1 X3 (X) X3 X5 X61. X3m(X) = X3+X5+X6

2. X3m(X)/g(X) = (1+X+X2+X3) +1/g(X) p(X) = 13 U(X) = 1+X3+X5+X6 U = (1 0 0 1 0 1 1)3. U(X) = 1+X3+X5+X6 U = (1 0 0 1 0 1 1)

14Modul 10 - Siskom 2 - Cyclic Block Code

Page 15: Modul 10 Siskom2 Cyclic Code

Cyclic block codes

Syndrome decoding for Cyclic codes:Received codeword in polynomial form is given byReceived codeword in polynomial form is given by

)()()( XXX eUr +=Received codeword

Error pattern

The syndrome is the reminder obtained by dividing the received polynomial by the generator polynomial.

With syndrome and Standard array, error is estimated.

)()()()( XXXX Sgqr +=Syndrome

In Cyclic codes, the size of standard array is considerably reduced.

Modul 10 - Siskom 2 - Cyclic Block Code 15

Page 16: Modul 10 Siskom2 Cyclic Code

Syndrome Circuit

Syndrome Circuit is a Division CircuitSyndrome Circuit is a Division CircuitGate

g1 g2 gn-k-1

(X)++ s0 ++ s1 ++ s2 ++.. sn-k-1

r(X)

Received Vector

16Modul 10 - Siskom 2 - Cyclic Block Code

Page 17: Modul 10 Siskom2 Cyclic Code

Encoding Circuit Example: Implementation

Gate

Syndrome Circuit of (7,4) Cyclic Code with g(X)=1+X+X3Syndrome Circuit of (7,4) Cyclic Code with g(X)=1+X+X3

Gate

++ ss1s++ ++ s2s1s0

Assume r=(0 0 1 0 1 1 0)Input Register Contents

0 0 0 (I iti l St t )

++

0 0 0 (Initial State)

0 0 0 0

1 1 0 0

1 1 1 0 Syndrome:1 1 1 0

0 0 1 1

1 0 1 1

0 1 1 1

Syndrome:(1 0 1)

0 1 0 1

17

Page 18: Modul 10 Siskom2 Cyclic Code

Cyclic Code Decoder

Gate

Buffer RegisterGate +

Received Vector

Corrected Vector

r(X)

ri

Gate GateFeedback Connection

+ Syndrome Register

Error Pattern Detection Circuit Gate

ei

Syndrome Modification

18Modul 10 - Siskom 2 - Cyclic Block Code

Page 19: Modul 10 Siskom2 Cyclic Code

Example Decoding of (7,4) Cyclic Code g(X)=1+X+X3

E P S d S d V

Syndrome Table

Error Pattern e(X)

Syndrome s(X)

Syndrome Vector (s0 ,s1 , s2)

e6(X)=X6 s(X)=1+X2 (1 0 1)

e5(X)=X5 s(X)=1+X+X2 (1 1 1)

e4(X)=X4 s(X)=X+X2 (0 1 1)

e3(X)=X3 s(X)=1+X (1 1 0)3( ) ( ) ( )

e2(X)=X2 s(X)=X2 (0 0 1)

e1(X)=X1 s(X)=X (0 1 0)

e (X) X0 s(X) 1 (1 0 0)e0(X)=X0 s(X)=1 (1 0 0)

- e6(X) is the only error pattern with an error at location X6

- (1 0 1) is the only syndrome that needs to be stored in the ( ) y y- decoder circuit

19

Page 20: Modul 10 Siskom2 Cyclic Code

Example Decoding of (7,4) Cyclic Code g(X)=1+X+X3:Decoder Circuit

Corrected

Gate

Gate +

Buffer RegisterReceived Vector

Corrected Vector

r(X)

ri

Gate Gate

+ +

Gate

20

Page 21: Modul 10 Siskom2 Cyclic Code

Example Decoding of (7,4) Cyclic Code g(X)=1+X+X3:Decoder Steps, e(X)=X2

1 0 1 1 0 1 1 +

1 1 0 1 1 0 1 +

00 0 1

1 1 0

Initial

1st Shift 1 1 0 1 1 0 1 +

1 1 1 0 1 1 0 +

0

0

1 1 0

0 1 1

1 Shift

2nd Shift

0 1 1 1 0 1 1 +

1 0 1 1 1 0 1 +

01 1 1

1 0 1

3rd Shift

4th Shift 1 0 1 1 1 0 1 +

0 1 0 1 1 1 0 +

1

0

1 0 1

0 0 0

4th Shift

5th Shift

0 0 1 0 1 1 1 +0

0 0 06th Shift

1 0 0 1 0 1 1 +0

0 0 07th Shift

21

Page 22: Modul 10 Siskom2 Cyclic Code

Tugas !Problem 5.21 (Bernard Sklar 1st edition) or Problem 6.21 (Bernard Sklar 2nd edition)

Modul 10 - Siskom 2 - Cyclic Block Code 22

Page 23: Modul 10 Siskom2 Cyclic Code

Tugas !Problem 5.22 (Bernard Sklar 1st edition) or Problem 6.22 (Bernard Sklar 2nd edition)

Consider the (15, 11) cyclic code generated by g(X)=1+X+X4

1) Devise a feedback register encoder and decoder for this code2) Illustrate the encoding procedure with the message vector

11001101011 by listing the states of register (the rightmost bit is y g g ( gearliest bit

3) Repeat part b) for decoding procedure ( + proses error correcting )

Modul 10 - Siskom 2 - Cyclic Block Code 23