Objective: To become acquainted with the basic concepts of cyclic codes and some aspects of encoder implementations for them.

Similar documents
x n k m(x) ) Codewords can be characterized by (and errors detected by): c(x) mod g(x) = 0 c(x)h(x) = 0 mod (x n 1)

Fault Tolerance & Reliability CDA Chapter 2 Cyclic Polynomial Codes

ECEN 604: Channel Coding for Communications

Cyclic codes. Vahid Meghdadi Reference: Error Correction Coding by Todd K. Moon. February 2008

B. Cyclic Codes. Primitive polynomials are the generator polynomials of cyclic codes.

Cyclic Codes. Saravanan Vijayakumaran August 26, Department of Electrical Engineering Indian Institute of Technology Bombay

Chapter 5. Cyclic Codes

Cyclic codes: overview

Information redundancy

Generator Matrix. Theorem 6: If the generator polynomial g(x) of C has degree n-k then C is an [n,k]-cyclic code. If g(x) = a 0. a 1 a n k 1.

3. Coding theory 3.1. Basic concepts

Linear Cyclic Codes. Polynomial Word 1 + x + x x 4 + x 5 + x x + x

Linear Cyclic Codes. Polynomial Word 1 + x + x x 4 + x 5 + x x + x f(x) = q(x)h(x) + r(x),

Information Theory. Lecture 7

Error Correction Review

A Brief Encounter with Linear Codes

ELG 5372 Error Control Coding. Lecture 12: Ideals in Rings and Algebraic Description of Cyclic Codes

Error Detection & Correction

EE512: Error Control Coding

EECS Components and Design Techniques for Digital Systems. Lec 26 CRCs, LFSRs (and a little power)

Information Redundancy: Coding

MATH3302 Coding Theory Problem Set The following ISBN was received with a smudge. What is the missing digit? x9139 9

Fault Tolerant Computing CS 530 Information redundancy: Coding theory. Yashwant K. Malaiya Colorado State University

Coding Theory and Applications. Solved Exercises and Problems of Cyclic Codes. Enes Pasalic University of Primorska Koper, 2013

Outline. MSRI-UP 2009 Coding Theory Seminar, Week 2. The definition. Link to polynomials

ELEC3227/4247 Mid term Quiz2 Solution with explanation

EE512: Error Control Coding

7.1 Definitions and Generator Polynomials

ECE 4450:427/527 - Computer Networks Spring 2017


Outline. EECS Components and Design Techniques for Digital Systems. Lec 18 Error Coding. In the real world. Our beautiful digital world.

Polynomials. Chapter 4

Chapter 6. BCH Codes

Some math for embedded algorithms

Introduction to Wireless & Mobile Systems. Chapter 4. Channel Coding and Error Control Cengage Learning Engineering. All Rights Reserved.

Cyclic Redundancy Check Codes

Optical Storage Technology. Error Correction

Design and Implementation of Reed-Solomon Decoder using Decomposed Inversion less Berlekamp-Massey Algorithm by

Math 512 Syllabus Spring 2017, LIU Post

Communications II Lecture 9: Error Correction Coding. Professor Kin K. Leung EEE and Computing Departments Imperial College London Copyright reserved

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

Chapter 4 Finite Fields

Part III. Cyclic codes

Cyclic codes. I give an example of a shift register with four storage elements and two binary adders.

Error Correction and Trellis Coding

EECS150 - Digital Design Lecture 21 - Design Blocks

Solutions or answers to Final exam in Error Control Coding, October 24, G eqv = ( 1+D, 1+D + D 2)

Homework 8 Solutions to Selected Problems

6.1.1 What is channel coding and why do we use it?

Physical Layer and Coding

EE 229B ERROR CONTROL CODING Spring 2005

EECS150 - Digital Design Lecture 26 Error Correction Codes, Linear Feedback Shift Registers (LFSRs)

17 Galois Fields Introduction Primitive Elements Roots of Polynomials... 8

Lecture 12. Block Diagram

Chapter 7. Error Control Coding. 7.1 Historical background. Mikael Olofsson 2005

FPGA BASED DESIGN OF PARALLEL CRC GENERATION FOR HIGH SPEED APPLICATION

Linear Feedback Shift Registers (LFSRs) 4-bit LFSR

GF(2 m ) arithmetic: summary

Continuing discussion of CRC s, especially looking at two-bit errors

Coding Theory: Linear-Error Correcting Codes Anna Dovzhik Math 420: Advanced Linear Algebra Spring 2014

Simplification of Procedure for Decoding Reed- Solomon Codes Using Various Algorithms: An Introductory Survey

The Pennsylvania State University. The Graduate School. Department of Computer Science and Engineering

Part I. Cyclic codes and channel codes. CODING, CRYPTOGRAPHY and CRYPTOGRAPHIC PROTOCOLS

VHDL Implementation of Reed Solomon Improved Encoding Algorithm

Algebra Review 2. 1 Fields. A field is an extension of the concept of a group.

AN EFFICIENT GOLAY CODEC FOR MIL-STD A AND FED-STD-1045 ERIC E. JOHNSON NMSU-ECE FEBRUARY 1991

Error Correction Methods

Binary Primitive BCH Codes. Decoding of the BCH Codes. Implementation of Galois Field Arithmetic. Implementation of Error Correction

An Enhanced (31,11,5) Binary BCH Encoder and Decoder for Data Transmission

7.5 CRC. 20 March r2 SAS-2 CRC fixes

A family Of Cyclic Codes Over Finite Chain Rings

Mathematical Foundations of Cryptography

1 Reed Solomon Decoder Final Project. Group 3 Abhinav Agarwal S Branavan Grant Elliott. 14 th May 2007

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Discussion 6A Solution

Galois Field Algebra and RAID6. By David Jacob

On Irreducible Polynomial Remainder Codes

Finite Fields. Mike Reiter

Implementation of Galois Field Arithmetic. Nonbinary BCH Codes and Reed-Solomon Codes

Chapter 3 Linear Block Codes

Cyclic Codes. Chapter Basics

Finite Fields. SOLUTIONS Network Coding - Prof. Frank H.P. Fitzek

New Algebraic Decoding of (17,9,5) Quadratic Residue Code by using Inverse Free Berlekamp-Massey Algorithm (IFBM)

1 Vandermonde matrices

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162

Lecture 3 : Introduction to Binary Convolutional Codes

Chapter 6 Reed-Solomon Codes. 6.1 Finite Field Algebra 6.2 Reed-Solomon Codes 6.3 Syndrome Based Decoding 6.4 Curve-Fitting Based Decoding

MATH32031: Coding Theory Part 15: Summary

Cryptography Lecture 3. Pseudorandom generators LFSRs

+ 1 3 x2 2x x3 + 3x 2 + 0x x x2 2x + 3 4

Error Detection, Correction and Erasure Codes for Implementation in a Cluster File-system

NOTES ON OCT 9, 2012

ERROR CORRECTING CODES

How might we evaluate this? Suppose that, by some good luck, we knew that. x 2 5. x 2 dx 5

Section 0.2 & 0.3 Worksheet. Types of Functions

Assume that the follow string of bits constitutes one of the segments we which to transmit.

Multimedia Systems WS 2010/2011

Dr. Cathy Liu Dr. Michael Steinberger. A Brief Tour of FEC for Serial Link Systems

ECE8771 Information Theory & Coding for Digital Communications Villanova University ECE Department Prof. Kevin M. Buckley Lecture Set 2 Block Codes

Repeated-Root Self-Dual Negacyclic Codes over Finite Fields

Error Control Codes for Memories

Transcription:

ECE 7670 Lecture 5 Cyclic codes Objective: To become acquainted with the basic concepts of cyclic codes and some aspects of encoder implementations for them. Reading: Chapter 5. 1 Cyclic codes Definition 1 An (n, k) linear block code C is said to be cyclic if for every code word c = (c 0, c 1,..., c n 1 ) in C, there is also a code word c = (c n 1, c 0,..., c n 2 ) that is also in C. (c is a cyclic shift of c.) It will be convenient to represent our codewords as polynomials. The codeword is represented by the polynomial c = (c 0, c 1,..., c n 1 ) c(x) = c 0 + c 1 x + + c n 1 x n 1 using the obvious one-to-one correspondence. A cyclic shift can therefore be represented as follows. Observe that xc(x) = c 0 x + c 1 x + + c n 1 x n. If we not take this product modulo x n 1 we get xc(x) (mod x n 1) = c n 1 + c 0 x + + x n 2 x n 1. So multiplication by x in the ring GF (q)[x]/(x n 1) corresponds to a cyclic shift. Furthermore, any power of x times a codeword yields a codeword (apply the definition recursively), so that, for example, (c n 1, c 0, c 1,..., c n 2 ) xc(x) (c n 2, c n 1, c 0,..., c n 3 ) x 2 c(x) (c 1, c 2,..., c n 1, c 0 ) x n 1 c(x) where the arithmetic is done in the ring GF (q)[x]/(x n 1). Now observe that if we take an polynomial a(x) GF (q)[x] of the form then a(x) = a 0 + a 1 x + + a n 1 x n 1 c(x)a(a) is simply a linear combination of cyclic shifts of c(x) and hence, must also be a codeword. Hence: a cyclic code is an ideal in GF (q)[x]/(x n 1). Because of what we know about ideals in GF (q)[x]/(x n 1) we can immediately make some observations about cyclic codes: A cyclic code has a generator polynomial g(x), which is the generator of the ideal. Let the degree of g be r, where r < n..

ECE 7670: Lecture 5 Cyclic codes 2 Every code polynomial in the code can be expressed as a multiple of the generator. c(x) = m(x)g(x), where m(x) is the message polynomial. The degree of m is less than n r. The generator is a factor of x n 1 in GF (q)[x]. Example 1 We will consider cyclic codes of length 15 with binary coefficients. We need to find the factors of x n 1 in some field. Observe that 15 2 4 1, so we are dealing in the field GF (16). The conjugacy classes in GF (16) are Thus {1} x + 1 {α, α 2, α 4, α 8 } 1 + x + x 4 {α 3, α 6, α 9, α 12 } 1 + x + x 2 + x 3 + x 4 {α 5, α 10 } 1 + x + x 2 {α 7, α 14, α 13, α 11 } 1 + x 3 + x 4 x 15 1 = (x + 1)(1 + x + x 4 )(1 + x + x 2 + x 3 + x 4 )(1 + x + x 2 )(1 + x 3 + x 4 ) So: degrees 1,2,4,4,4. If we want a generator of, say, degree 9, we could take g(x) = (x + 1)(1 + x + x 4 )(1 + x + x 2 + x 3 + x 4 ) If we want a generator of degree 5 we could take or g(x) = (x + 1)(1 + x + x 4 ) g(x) = (x + 1)(1 + x + x 2 + x 3 + x 4 ) In fact, in this case, we can get generator polynomials of any degree from 1 to 15. So we have codes (15, 0)(15, 1),..., (15, 15) A message sequence (m 0, m 1,..., m k 1 ) (where k = n r) corresponds to a message polynomial m(x) = m 0 + + m k 1 x k 1. Then the message polynomial corresponding to m is We can write this as c m (x) = m(x)g(x). c m (x) = [m 0, m 1,..., m k 1 ] g(x) xg(x). x k 1 g(x)

ECE 7670: Lecture 5 Cyclic codes 3 Taking the next step, we can go back to a matrix representation, g 0 g 1 g r c m = [ g 0 g 1 g r ] g 0 g 1 g r m 0, m 1,..., m k 1......... = mg g 0 g 1 g r g 0 g 1 g r So we have a linear code, and can write the generator matrix corresponding to it. Note: G is k n. Let h(x) be parity check polynomial, that is a polynomial such that x n 1 = g(x)h(x). Since codewords are multiples of g(x), then for a codeword, We let c(x)h(x) = m(x)g(x)h(x) = m(x)(x n 1) 0 (mod x n 1). s(x) = c(x)h(x) (mod x n 1). be the syndrome polynomial. If s(x) is identically zero, then c(x) is a codeword. Now let s put this in matrix form. n 1 n 1 s(x) = c(x)h(x) = c i x i h j x j (mod x n 1). Performing the multiplication, i=0 j=0 n 1 s k = c i h ((k i))n k = 0, 1,..., n 1. i=0 Writing the last n k of these out, we have h k h k 1 h 1 h 0 h k h k 1 h 1 h 0 [s k, s k+1,..., s n 1 ] = [c 0, c 1,..., c n 1 ]...... hk hk 1 h1 h0 h k h k 1 h 1 h 0 Note: H is n k n Example 2 Some cyclic codes of length 7. In GF (8) we have elements of order 7. The minimal polynomials are x + 1 x 3 + x + 1 x 3 + x 2 + 1 We can choose any combination of these factors as factors of g(x). Let us take g(x) = (x 3 + x + 1)(x + 1) = x 4 + x 3 + x 2 + 1 Then h(x) = x 3 + x 2 + 1. Here is the list of codewords m(x)g(x) code polynomial code word 0g(x) 0 0000000 1g(x) 1 + x 2 + x 3 + x 4 1011100 xg(x) x + x 3 + x 4 + x 5 0101110 x 2 g(x) x 2 + x 4 + x 5 + x 6 0010111 (x 2 + 1)g(x) 1 + x 3 + x 5 + x 6 1001011 (x 2 + x + 1)g(x) 1 + x + x 4 + x 6 1100101 (x + 1)g(x) 1 + x + x 2 + x 5 1110010 (x 2 + x)g(x) x + x 2 + x 3 + x 6 0111001 T = ch T.

ECE 7670: Lecture 5 Cyclic codes 4 The corresponding generator and parity check matrix are G = 1 0 1 1 1 0 0 1 1 0 1 0 0 0 0 1 0 1 1 1 0 H = 0 1 1 0 1 0 0 0 0 1 1 0 1 0 0 0 1 0 1 1 1 0 0 0 1 1 0 1 The codes to this point have not been systematic, but are easy to produce. We will now do some tricks to make the code be systematic. We take the message block m = (m 0, m 1,..., m k 1 ) m(x) = m 0 + m 1 x + + m k 1 x k 1. Now take the code polynomial and shift it: x n k m(x) = m 0 x n k + m 1 x n k+1 + + m k 1 x n 1. Observe that the code sequence corresponding to this is (0, 0,..., 0, m 0, m 1,..., m k 1 ) Now we employ the division algorithm (this is the trick) to write x n k m(x) = q(x)g(x) + d(x), where d(x) has degree less than n k. That is, d(x) has the code sequence Now form (d 0, d 1,..., d n k 1, 0, 0,..., 0) x n k (x) d(x) = q(x)g(x). Since the LHS is a multiple of g(x), it is a codeword. It has the form ( d 0, d 1,..., d n k 1, m 0, m 1,..., m k 1 ) We have thus obtained a codeword in which the message data appears explicitly. We have obtained by this trick a systematic code. Example 3 We will demonstrate systematic coding in the (7, 3) code from before. Let m(x) = 1 + x 2 from (1,0,1). 1. Compute x n k m(x) = x 4 m(x) = x 6 + x 4. 2. Employ the division algorithm: x 6 + x 4 = (x 2 + x + 1)(x 4 + x 3 + x 2 + 1) + (x + 1). 3. Then our code polynomial is c(x) = x n k m(x) d(x) = (1 + x) + (x 6 + x 4 ) (1, 1, 0, 0, 1, 0, 1). We can still explicitly see the message part. 2 Some hardware considerations One of the justifications for using cyclic codes, and using the polynomial representation in general, is that there are some interesting and efficient hardware configurations for performing the encoding operation. This has been of particularly historical importance.

ECE 7670: Lecture 5 Cyclic codes 5 2.0.1 Galois field operations If we represent elements in a Galois field using the m-tuple representation, addition is easy, element-by element, using exclusive-or gates to perform the addition. Multiplication by a fixed Galois field element is also fairly straightforward. Let us take, as an example, multiplication in GF (2 4 ). Let β be in GF (2 4 ), and represent it as β = b 0 + b 1 α + b 2 α 2 + b 3 α 3. That is, β has the m-tuple representation (b 0, b 1, b 2, b 3 ). Let g be a fixed element in GF (2 4 ), and suppose for this example, that g = 1 + α. Let χ = βg. Then χ = c 0 + c 1 α + c 2 α 2 + c 3 α 3 = (b 0 + b 1 α + b 2 α 2 + b 3 α 3 )(1 + α) = b 0 + (b 0 + b 1 )α + (b 1 + b 2 )α 2 + (b 2 + b 3 )α 3 + b 3 α 4 = (b 0 + b 3 ) + (b 0 + b 1 + b 3 )α + (b 1 + b 2 )α 2 + (b 2 + b 3 )α 3. A hardware implementation is straightforward. (Draw a diagram.) 2.0.2 Polynomial multiplication Now to compute m(x)g(x). This is simply a feed-forward (FIR) filter. The message bits are fed in in descending order: m k 1, m k 2,..., m 0 : As a specific example, we have, for g(x) = 1 + x 2 + x 3 + x 4 the following Consider a specific example: m(x) = m 0 +m 1 x+m 2 x 2 and g(x) = g 0 +g 1 x+g 2 x 2. What about further shifts? For the systematic encoding, we have three steps:

ECE 7670: Lecture 5 Cyclic codes 6 1. Multiply by x n k. This is accomplished by feeding into the middle of the shift register: 2. Divide by g(x). Polynomial division is obtained using LFSR. To form a(x)/g(x), we recognize (from signal processing experience) that division is accomplished using a feedback connection. The inputs are fed in in decreasing index order: a n 1, a n 2,..., a 0. After the last symbol has been fed in, the LFSR contains the remainder of a(x)/g(x).

ECE 7670: Lecture 5 Cyclic codes 7 3. Set c(x) = x n k m(x) d(x). Here we simply employ some switching circuitry: Start in X: pass in message, which appears at output and goes into divider. Then switch to Y and read out the parity bits. 3 Syndrome decoding We now examine the question of decoding cyclic codes. Recall that for any linear code, we can form a standard array; or we can use the reduced standard array using syndromes. We will be able to exploit the cyclic structure of the codes to decrease the memory requirements. Consider the systematically-encoded codeword c = ( d 0, d 1,..., d n k 1, m 0, m 1,..., m k 1 ) = ( d, m) We can perform error detection as follows: 1. Estimate a message based on the systematic message part. Call this m. 2. We then encode m. Compute the parity bits from this to the received parity bits. If they don t match, then an error is detected. We can also use shift-register techniques. Recall that if we take r(x)h(x) modulo x n 1, we get a syndrome polynomial. But since g(x)h(x) = x n 1 we can use the division algorithm, dividing by g(x) r(x) = a(x)g(x) + s(x). But the division we can compute as we saw before. We have the following useful result about cyclic codes and syndromes.

ECE 7670: Lecture 5 Cyclic codes 8 theorem 1 Let s(x) be the syndrome corresponding to r(x). Let r (1) (x) be the polynomial obtained by cyclicly right-shifting r(x). Then the remainder obtained when dividing xs(x) by g(x) is the syndrome denoted s (1) corresponding to r (1) (x). In other words, shifts of r (mod x n 1) correspond to shifts of s (modulo g). Proof Write (Show how this works.) Let us write Then Let us write this as r (1) (x) = xr(x) r n 1 (x n 1). r(x) = a(x)g(x) + s(x). r (1) (x) = x[a(x)g(x) + sb(x)] r n 1 [g(x)h(x)]. r (1) (x) = b(x)g(x) + d(x). We note that d(x) must be the syndrome of r (1) (x). We also note from the previous result, solving for xs(x), xs(x) = [b(x)g(x)+d(x)] xa(x)g(x)+r n 1 g(x)h(x) = (b(x) xa(x)+r n 1 h(x))g(x)+d(x). Thus d(x) is the remainder of xs(s) divided by g(x), establishing the theorem. We conclude we can reduce the size of the syndrome lookup table. We need to only store one syndrome s for an error e and all cyclic shifts of e. And we can compute the shifts necessary using the same circuit that computes the syndrome in the first place. Example 4 error syndrome syndrome poly 0000000 000 0 1000000 100 1 0100000 010 x 0010000 001 x 2 0001000 110 1 + x 0000100 011 x + x 2 0000010 111 1 + x + x 2 0000001 101 1 + x 2 Comment on the pattern. So all we have to do in this case is look for is any one of the syndrome patterns (instead of many of them). We choose to look for 101,

ECE 7670: Lecture 5 Cyclic codes 9 since if we find the error in that location, we can shift correct it on the end. 4 CRC codes CRC codes are very commonly used for ARQ (automatic repeat request). Every modem and network protocol uses ARQ, reverse error correction, even where forward error correction may not be. They provide powerful error detection capability, and are easily implemented. They are appropriate to talk about here, because they are basically cyclic codes, with syndrome computation computed using LFSR. CRC codes are simply binary cyclic codes with particular polynomials, chosen to obtain good error detection capability. We will explain the idea using notation from Data and Computer Communications by W. Stallings (5th Ed., Prentice-Hall). Let M(x) be a message polynomial of degree k 1, and let R(X) be a parity check polynomial of degree n 1. Then form T (x) = x n M(x) + R(x). Then we have a systematic representation of M(x) in T. This is the encoding operation. The decoder takes the received signal and divides by some polynomial P (x). We want to choose R(x) so that the remainder when T (x) is divided by P (x)

ECE 7670: Lecture 5 Cyclic codes 10 is exactly zero. We obtain R(x) as follows: Observe that we can write x n M(x) P (x) = Q(x) + r(x) P (x) Then if we set R(x) = r(x) (the remainder) we get the zero remainder that we want. That is, we encode by forming Then we decode by dividing: T (x) = x n M(x) + R(x). T (x) P (x) = xn M(x) + R(x) = Q(x) + R(x) P (x) P (x) + R(x) P (x) = Q(x). (all operations in GF (2)). Example 5 Let M = 1010001101 M(x) = x 9 + x 7 + x 3 + x 2 + 1 and P = 110101 P (x) = x 5 + x 4 + x 2 + 1. 1. Message is shifted by 2 5, yielding 10100011010000. 2. Product is divided by P : 3. The remainder R = 01110 is added to give T = 101000110101110.

ECE 7670: Lecture 5 Cyclic codes 11 4. At the receiver, divide again by P : If there is no remainder, it is assumed that there have been no errors. A couple of common polynomials: CRC-16x 16 + x 14 + x 2 + 1 CRC-CCITTx 16 + x 12 + x 5 + 1 How well do they work? We first observe that an error is undetectable only if it is divisible by P (x). A summary of some performance results follows for detectable errors. All single-bit errors. All double-bit errors if weight(p (x)) 3. Any odd number of errors if x + 1 P (x). Any burst error for which the length of the burst is less than the length of P (x). Most larger burst errors. The book provides some specifics: CRC-16 or CRC-CCITT detects the following: 1. All single bursts of length 16 or less. 2. 99.997% of all error bursts of length 17. 3. 99.9985% of all error bursts of length > 17.