Forward Error Correction via Channel Coding [1st ed. 2020] 978-3-030-33379-9, 978-3-030-33380-5

This book provides a comprehensive explanation of forward error correction, which is a vital part of communication syste

600 153 10MB

English Pages X, 319 [326] Year 2020

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Forward Error Correction via Channel Coding [1st ed. 2020]
 978-3-030-33379-9, 978-3-030-33380-5

Table of contents :
Front Matter ....Pages i-x
Review of Linear Algebra (Orhan Gazi)....Pages 1-32
Linear Block Codes (Orhan Gazi)....Pages 33-78
Syndrome Decoding and Some Important Linear Block Codes (Orhan Gazi)....Pages 79-118
Cyclic Codes (Orhan Gazi)....Pages 119-142
Galois Fields (Orhan Gazi)....Pages 143-175
BCH Codes (Orhan Gazi)....Pages 177-217
Reed-Solomon Codes (Orhan Gazi)....Pages 219-258
Convolutional Codes (Orhan Gazi)....Pages 259-315
Back Matter ....Pages 317-319

Citation preview

Orhan Gazi

Forward Error Correction via Channel Coding

Forward Error Correction via Channel Coding

Orhan Gazi

Forward Error Correction via Channel Coding

Orhan Gazi Electronic & Communication Engineering Department Cankaya University Ankara, Turkey

ISBN 978-3-030-33379-9 ISBN 978-3-030-33380-5 https://doi.org/10.1007/978-3-030-33380-5

(eBook)

© Springer Nature Switzerland AG 2020 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

Preface

Coding and decoding can be considered as a mapping and de-mapping between the elements of two sequence sets. For the two sequence sets A and B, mapping a symbol sequence belonging to set A to a symbol sequence in set B can be considered as coding and the reverse operation can be considered as decoding. The purpose of mapping depends on the aim of design. If the sequences in set A are shorter than the sequences in set B, such a mapping can be considered as data compression or source coding in short. If the aim of the mapping is to hide the information content of the sequences in set A, then this type of coding can be named as encryption. On the other hand, if the sequences in set B are longer compared to sequences in set A, and they are more robust to noisy transmissions, then such a mapping is named as channel coding. The purpose of channel coding is to transmit more information bits reliably through a communication channel using a fixed amount of energy in unit time. For this purpose, instead of transmitting information bit sequences directly, a mapping can be performed to longer information sequences, and such a mapping is done mathematically. Since as the length of the information sequence increases, the total number of data words, i.e., information sequences, become a huge number, and it becomes almost impossible to do a manual mapping and de-mapping. The use of channel codes for error correction purpose in communication engineering became a hot subject of the researchers after the publication of Shannon’s paper titled as “A Mathematical Theory of Communication” in 1948. In his paper, Shannon drew the limits for the maximum speed of reliable communication, i.e., maximum number of bits transmitted reliable per unit of time, for a definite signal bandwidth and signalto-noise ratio, and it is also mentioned in the paper that the Shannon’s limits can be achieved via the use of channel codes. Since then numerous channel codes have been designed to get the highest reliable speed of communication. Most of the channel codes are designed in a trivial manner until 2009 in which the first mathematically designed channel codes, polar codes, are introduced. Hence, it took almost 60 years for the researches to design the first channel code, achieving Shannon’s limits, in a mathematical manner. v

vi

Preface

The use of channel codes in communication engineering is a must issue. Without the use of channel codes, it is not possible to design energy-efficient communication systems. In this book, preliminary information is provided about the channel coding. Channel codes can be divided into two main categories which are block and convolutional codes. Block codes are nothing but vector subspaces. For this reason, the first chapter of this book is devoted to the fundamental subjects of linear algebra. Without a good knowledge of linear algebra, it is not possible to comprehend the construction and use of channel codes. We suggest the reader not to skip the first chapter of this book. The second chapter deals with the binary linear block codes, and fundamental information is provided about the construction and error correction capability of the binary linear block codes. The preliminary decoding approach, syndrome decoding, is explained in the third chapter along with some well-known binary linear block codes. Cyclic codes which can be considered as a subset of linear block codes are explained in the fourth chapter. Galois fields, which are the background subject for algebraic design of linear block codes, are explained in the fifth chapter. For the understandability of the topics presented in the sixth and seventh chapters, the subjects explained in the fifth chapter should be comprehended very well. In the sixth and seventh chapters, two important cyclic codes, which are BCH and Reed Solomon codes, are explained. BCH codes are binary cyclic codes; on the other hand, Reed Solomon codes are non-binary cyclic codes. These two types of codes were employed in practical communication and data storage systems; for instance, Reed Solomon codes were used in compact disc and digital video broadcasting (DVB) standard DVB-S, and similarly BCH codes were employed in satellite communications, DVDs, disk drives, solid-state drives, two-dimensional bar codes, etc. In the eighth chapter, the second type of channel codes, convolutional codes, are explained with Viterbi decoding algorithm. Convolutional codes are used in some mobile communication standards such as GSM. This book can be studied in one semester graduate or undergraduate course, or it can be read by anyone interested in the fundamentals of error-correcting codes. We tried to be simple and brief while writing the book. We avoided the use of heavy mathematics in the book and unnecessary long explanations which distracts the readers’ attention to focus on the main points. We tried to provide as many simple solved examples as we could do. As a last word, I dedicate this book to my lovely daughter Vera Gazi who was six years old when this book was being written. Her love was an energy source for my studies. Ankara, Turkey Monday, November 25, 2019

Orhan Gazi

Contents

1

Review of Linear Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.1 Subgroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1.2 Cosets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.1 Binary or Galois Field . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.2 Prime Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.1 Vector Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.2 Subspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.3 Dual Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.4 Linear Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.5 Basis Vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.6 Matrices Obtained from Basis Vectors . . . . . . . . . . . . . . 1.3.7 Polynomial Groups and Fields . . . . . . . . . . . . . . . . . . . 1.4 Ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1 1 8 11 14 14 16 17 19 22 23 23 25 27 28 29 30

2

Linear Block Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 Binary Linear Block Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Generator Matrix of a Linear Code . . . . . . . . . . . . . . . . . . . . . . . 2.3 Hamming Weight of a Code-Word . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Hamming Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2 Minimum Distance of a Linear Block Code . . . . . . . . . . 2.4 Performance Enhancement of Communication Systems and Encoding Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.5 The Philosophy of Channel Encoding . . . . . . . . . . . . . . . . . . . . . 2.6 Encoding and Decoding Operations . . . . . . . . . . . . . . . . . . . . . . 2.6.1 Encoding Operation Using the Generator Matrix . . . . . . 2.7 Dual Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33 33 36 38 39 40 41 43 44 47 49 vii

viii

Contents

2.8 2.9

Parity Check Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Systematic Form of a Generator Matrix . . . . . . . . . . . . . . . . . . . 2.9.1 Construction of Parity Check Matrix from Systematic Generator Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.10 Equal and Equivalent Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.11 Finding the Minimum Distance of a Linear Block Code Using Its Parity Check Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 2.12 Error Detection and Correction Capability of a Linear Block Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.13 Hamming Spheres . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.13.1 The Total Number of Words Inside a Hamming Sphere with Radius r . . . . . . . . . . . . . . . . . . . . . . . . . . 2.14 Some Simple Bounds for the Minimum Distances of Linear Block Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

4

51 55 57 58 60 61 68 72 72 76

Syndrome Decoding and Some Important Linear Block Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 Syndrome Decoding of Linear Block Codes . . . . . . . . . . . . . . . . 3.2 Standard Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Error Correction Using Standard Array . . . . . . . . . . . . . . . . . . . . 3.4 Syndrome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Syndrome Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Syndrome Decoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 Some Well-Known Linear Block Codes . . . . . . . . . . . . . . . . . . . 3.6.1 Single Parity Check Codes . . . . . . . . . . . . . . . . . . . . . . 3.6.2 Repetition Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.3 Golay Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.4 Reed-Muller Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6.5 Hamming Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.7 Non-Systematic Form of Generator and Parity Check Matrices of the Hamming Codes . . . . . . . . . . . . . . . . . . . 3.8 Extended Hamming Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Syndrome Decoding of Hamming Codes . . . . . . . . . . . . . . . . . . 3.10 Shortened and Extended Linear Codes . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

108 110 112 113 116

Cyclic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 Cyclic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Polynomials and Cyclic Codes . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 The Generator Polynomial for Cyclic Codes . . . . . . . . . . . . . . . 4.4 Non-Systematic Encoding of Cyclic Codes . . . . . . . . . . . . . . . . 4.5 Systematic Encoding of Cyclic Codes . . . . . . . . . . . . . . . . . . . 4.5.1 Code-Word in Systematic Form . . . . . . . . . . . . . . . . . 4.6 Decoding of Cyclic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . .

119 119 120 123 123 124 127 129

. . . . . . . .

79 79 81 87 90 92 94 100 100 101 102 103 105

Contents

ix

4.7 Selection of Generator Polynomials of the Cyclic Codes . . . . . . 4.8 Parity Check Polynomials of the Cyclic Codes . . . . . . . . . . . . . 4.9 Dual Cyclic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.10 Generator and Parity Check Matrices for Cyclic Codes . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . .

131 134 137 138 141

5

Galois Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 Equation Roots and Concept of Field Extension . . . . . . . . . . . . 5.1.1 Extension of Finite Fields . . . . . . . . . . . . . . . . . . . . . . 5.1.2 Irreducible Polynomial . . . . . . . . . . . . . . . . . . . . . . . . 5.1.3 Primitive Polynomial . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Construction of Extended Finite Fields . . . . . . . . . . . . . . . . . . . 5.3 Conjugate Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Order of a Finite Field Element . . . . . . . . . . . . . . . . . . . . . . . . 5.5 Minimal Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.6 Polynomials in Extended Fields . . . . . . . . . . . . . . . . . . . . . . . . 5.7 Binary Representation of Extended Field Elements . . . . . . . . . . 5.8 Equations in Extended Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 5.9 Matrices in Extended Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

143 143 145 147 148 149 153 158 159 166 169 170 171 174

6

BCH Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 BCH Codes and Generator Polynomials of BCH Codes . . . . . . . 6.2 Parity Check and Generator Matrices of BCH Codes . . . . . . . . . 6.2.1 Second Method to Obtain the Generator and Parity Check Matrices of BCH Codes . . . . . . . . . . 6.3 Syndrome Calculation for BCH Codes . . . . . . . . . . . . . . . . . . . 6.4 Syndrome Equations and Syndrome Decoding . . . . . . . . . . . . . 6.4.1 The Error Location Polynomial . . . . . . . . . . . . . . . . . . 6.4.2 The Peterson-Gorenstein-Zierler (PGZ) Decoder . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. 177 . 177 . 183

7

. . . . . .

189 195 199 205 212 217

Reed-Solomon Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 Reed-Solomon Codes and Generator Polynomials of Reed-Solomon Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Decoding of Reed-Solomon Codes . . . . . . . . . . . . . . . . . . . . . . . 7.2.1 Syndrome Decoding of Reed-Solomon Codes . . . . . . . . 7.2.2 The Error Evaluator Polynomial . . . . . . . . . . . . . . . . . . 7.2.3 Berlekamp Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 7.3 Generator Matrices of Reed-Solomon Codes . . . . . . . . . . . . . . . . 7.3.1 Encoding of Reed-Solomon Codes . . . . . . . . . . . . . . . . 7.3.2 Systematic Encoding Using Generator Polynomial . . . . . 7.4 Reed-Solomon Code as a Cyclic Code . . . . . . . . . . . . . . . . . . . . 7.4.1 Parity Check Matrix of Reed-Solomon Code and Syndrome Calculation . . . . . . . . . . . . . . . . . . . . . .

219 219 222 224 227 229 240 240 245 246 248

x

Contents

7.4.2 Parity Check Polynomials for RS Codes . . . . . . . . . . . . 254 7.4.3 Chien Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258 8

Convolutional Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1 Convolutional Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.1.1 Convolutional Encoder Circuit . . . . . . . . . . . . . . . . . . . 8.2 Impulse Response of a Convolutional Encoder . . . . . . . . . . . . . . 8.2.1 Short Method to Find the Impulse Response of a Convolutional Encoder . . . . . . . . . . . . . . . . . . . . . 8.2.2 Parallel Path Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.3 Transfer Function Approach to Find the Impulse Responses of Convolutional Codes . . . . . . . . . . . . . . . . . . . . . . . . 8.2.4 Convolution Operation . . . . . . . . . . . . . . . . . . . . . . . . . 8.2.5 Recursive Convolutional Encoders . . . . . . . . . . . . . . . . 8.3 Generator Matrices for Convolutional Codes . . . . . . . . . . . . . . . . 8.4 Polynomial Representation of Convolutional Codes . . . . . . . . . . 8.4.1 Generator Matrix in Polynomial Form . . . . . . . . . . . . . . 8.5 Generator Matrices of the Recursive Convolutional Encoders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8.6 Graphical Representation of Convolutional Codes . . . . . . . . . . . . 8.6.1 State Diagram Representation . . . . . . . . . . . . . . . . . . . . 8.6.2 Trellis Diagram Representation of Convolutional Codes . . . . . . . . . . . . . . . . . . . . . . . . 8.7 Decoding of Convolutional Codes . . . . . . . . . . . . . . . . . . . . . . . 8.7.1 Viterbi Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

259 259 259 265 268 269

269 271 276 277 283 284 286 294 294 300 304 305 312 315

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

Chapter 1

Review of Linear Algebra

1.1

Group

A group is a set G together with a binary operation  defined on the set elements, and the set elements together with the binary operation satisfy a number of properties. These properties are as follows: 1. Closure If a set G is closed under binary operation , then we have 8a, b 2 G ! a  b 2 G:

ð1:1Þ

2. Associative If a set G has associative property under binary operation , then we have ða  bÞ  c ¼ a  ðb  cÞ:

ð1:2Þ

3. Identity element If a set G has identity element e under binary operation , then we have 8a 2 G, a  e ¼ e  a ¼ a:

ð1:3Þ

4. Inverse element If a set G has inverse property under binary operation , then 8a 2 G; there exists an element b such that

© Springer Nature Switzerland AG 2020 O. Gazi, Forward Error Correction via Channel Coding, https://doi.org/10.1007/978-3-030-33380-5_1

1

2

1 Review of Linear Algebra

a  b ¼ b  a ¼ e:

ð1:4Þ

5. Commutative (not must) If a set G has commutative property under binary operation , then 8a, b 2 G; we have a  b ¼ b  a:

ð1:5Þ

If the properties 1 – 4 are satisfied, then the set is called a group under binary operation . On the other hand, if all the properties are satisfied, then the set is called a commutative group under binary operation . Now, let’s give some examples to the groups. Example 1.1 Let’s show that the set of integers Ζ with the ordinary addition operation + form a group, i.e., the pair (Ζ, +) forms a group. For this purpose, let’s verify all the properties of the group (Ζ, +). 1. Closure If a, b 2 Ζ, then it is obvious that a + b 2 Ζ. Thus, closure property is satisfied √. 2. Associative If a, b, c 2 Ζ, then it is obvious ða þ bÞ þ c ¼ a þ ðb þ cÞ √:

ð1:6Þ

3. Identity element For + operation, 0 is the identity element such that a 2 Ζ ! a þ 0 ¼ 0 þ a ¼ a √:

ð1:7Þ

4. Inverse element The inverse of the integer a 2 Ζ is –a such that a þ ðaÞ ¼ 0 √:

ð1:8Þ

These four properties are sufficient for the set of integers Ζ to be a group under ordinary addition operation +. In fact, the set of integers under addition operation satisfies the commutative property also. Let’s show that commutative property is also satisfied. 5. Commutative

1.1 Group

3

Table 1.1 Mod-5 addition table ⊕

0

1

2

3

4

0

0

1

2

3

4

1

1

2

3

4

0

2

2

3

4

0

1

3

3

4

0

1

2

4

4

0

1

2

3

If a, b 2 Ζ, then it is clear that a þ b ¼ b þ a √:

ð1:9Þ

Hence, we can say that the set of integers under addition operation is a commutative group, and this group includes infinite number of elements. We can categorize it as infinite group. Now let’s give an example for a group including finite number of elements. Example 1.2 The finite set G and the operation  are given as G ¼ f0, 1, 2, 3, 4g  ! Mod  5 addition operation: Determine whether G is a group under the defined operation  or not. Solution 1.2 Let’s check each property of the group for G using the operation . Since G is a finite set, we should consider all possible pairs while checking the closure property, and we have to inspect all the triples while checking the associative property. To make it practical, we can make a table as Table 1.1 for Mod-5 addition operation considering the elements of G, and check the group properties in a quick manner using the table. If we inspect the table, we see that closure property is satisfied √ . From the table, it is seen that associative property is satisfied √ . Identity element is 0 √ . Identity element is available at every row. This means that every element has an inverse. For example, we can find the inverse of 2 as 3. This is illustrated in Fig. 1.1. 5. Commutative property is also satisfied √ . 1. 2. 3. 4.

Hence, we can say that the finite set

4

1 Review of Linear Algebra

Fig. 1.1 Finding the inverse of 3



0

1

2

3

4

0

0

1

2

3

4

1

1

2

3

4

0

2

2

3

4

0

1

3

3

4

0

1

2

4

4

0

1

2

3

Table 1.2 Mod-4 addition table



1

2

3

1

2

3

0

2

3

0

1

3

0

1

2

G ¼ f0, 1, 2, 3, 4g is a group under Mod-5 addition operation. That is, the pair (G, ) forms a group. Example 1.3 The finite set G and the operation  are given as G ¼ f1, 2, 3g  ! Mod  4 addition operation: Determine whether G is a group under the defined operation  or not. Solution 1.3 In Table 1.2, we show the Mod-4 addition operation results considering the elements of G. If we inspect the table, we see that closure property is not satisfied. Since 2  2 ¼ 0 and 0 2 = G, then closure is violated. If one property is not satisfied, then no need to check the rest of the properties. We can say that the given set G is NOT a group under Mod-4 addition operation. Example 1.4 The finite set G and the operation  are given as G ¼ f1, 2, 3, 4g

1.1 Group

5

Table 1.3 Mod-4 multiplication table



1

2

3

1

1

2

3

2

2

0

2

3

3

2

1

 ! Mod  5 addition operation: The set G is not a group under Mod-5 addition operation. Closure property is not satisfied, since 1  4 ¼ 0 2 = G. Definition The number of elements in G is denoted by jGj and it is named as the order of the group G. Example 1.5 The finite set G and the operation  are given as G ¼ f1, 2, 3g  ! Mod  4 multiplication operation: Determine whether G is a group under the defined operation  or not. Solution 1.5 In Table 1.3, we show the results of Mod-4 multiplication operation considering the elements of G. If we inspect the Table 1.3, we see that closure and inverse group properties are not satisfied, since 2  2 ¼ 0 2 = G, and the element 2 does not have an inverse, i.e., we cannot find an element x such that 2  x ¼ 1 where 1 is the identity elements of the Mod-4 multiplication operation. Example 1.6 The finite set G and the operation  are given as G ¼ f1, 2, 3, 4g  ! Mod  5 multiplication operation: Determine whether G is a group under the defined operation  or not. Solution 1.6 In Table 1.4, we show the Mod-5 multiplication operation results considering the elements of G. If we inspect the Table 1.4, we see that all the properties of a group are satisfied. Then, we can say that G is a group under Mod-5 multiplication operation.

6

1 Review of Linear Algebra

Table 1.4 Mod-5 multiplication table



1

2

3

4

1

1

2

3

4

2

2

4

1

3

3

3

1

4

2

4

4

3

2

1

Example 1.7 The set G and the operation  are given as G ¼ fSet of 2  2 matrices with nonzero determinantsg  ! Matrix multiplication operation: Determine whether G is a group under the defined operation  or not. Solution 1.7 The set G owns all the four properties of a group, i.e., “closure, associative, identity element, and inverse element” properties are satisfied. Thus, G is a group. However, commutative property is not satisfied. Since A and B square matrices are of the same size, then we can write for some matrices A and B that A  B 6¼ B  A: Although G is a group, it is not a commutative group. Summary If G and  are given as G ¼ f0, 1, . . . , M  1g  ! Mod  M addition operation, then it can be shown that G is a group under Mod-M addition operation. If G and  are given as G ¼ f1, . . . , M  1g

1.1 Group

7

 ! Mod  M addition operation, then it can be shown that G is NOT a group under Mod-M addition operation. If G and  are given as G ¼ f1, . . . , M  1g  ! Mod  M multiplication operation, then it can be shown that if M is a prime number, then G is a group under Mod-M multiplication operation; otherwise, G is NOT a group under Mod-M multiplication operation. Example 1.8 The finite set G and the operation  are given as G ¼ f1, 2, . . . , 15g  ! Mod  16 multiplication operation: Determine whether G is a group under the defined operation  or not. Solution 1.8 According to the information provided in the previous summary part, for G ¼ f1, . . . , M  1g to be a group under Mod-M multiplication operation, M should be a prime number. For our example, M ¼ 16 which is not a prime number. Thus, G is not a group under Mod-16 multiplication operation. Example 1.9 For a set to be a group which properties should be owned by the set, list the properties. Solution 1.9 Fundamentally, there are four basic properties, and these properties are “closure, associative, identity element, and inverse element.” If the set has these four properties, then the set is a group. Besides, if the “commutative” property is also available, then the set becomes a commutative group. Example 1.10 Let G be a group under  operation, and a, b 2 G. Show that ða  bÞ1 ¼ b1  a1 :

ð1:10Þ

8

1 Review of Linear Algebra

Solution 1.10 Let x ¼ a  b. If the inverse of x is x1 ¼ b1  a1, then we have x  x1 ¼ a  b  b1  a1 where, employing the associative property for the right-hand side, we get ! a

1

b|fflfflffl{zfflfflffl} b

 a1 ! a  e  a1 ! a  a1 ! e ! x  x1 ¼ e:

¼e

Thus, the inverse of x ¼ a  b is x1 ¼ b1  a1. Exercise Let G be a group under  operation, and a, b 2 G. Verify that if ða  bÞ1 ¼ a1  b1

ð1:11Þ

then G is a commutative, i.e., abelian, group. Exercise Let G be a commutative group under  operation, and a, b 2 G. Show that a2  b2 commute, i.e., a2  b2 ¼ b2  a2. Note that a2 ¼ a  a and b2 ¼ b  b.

1.1.1

Subgroup

A subgroup (H, ) is a subset of a group (G, ) having all the group properties. Note that the same operation  is considered by subgroup and group. Example 1.11 The finite set G and the operation  are given as G ¼ f0, 1, 2, 3, 4, 5g  ! Mod  6 addition operation: G is a group under Mod-6 addition operation. Find a subgroup of G. Solution 1.11 We can form a subgroup of G as H ¼ f0, 2, 4g: If we check the properties “closure, associative, identity element, and inverse element,” we see that H has all these properties under Mod-6 addition operation. Note that every subset of G is not a subgroup. For instance, L ¼ {1, 3, 4, 5} is a subset of G such that

1.1 Group

9

G ¼ H [ L: However, L is not a subgroup of G. Closure property is not satisfied since 1  5 ¼ 02 = L. Example 1.12 The finite set G and the operation  are given as G ¼ f1, 2, 3, 4, 5, 6g  ! Mod  7 multiplication operation: G is a group under Mod-7 multiplication operation. Find a subgroup of G. Solution 1.12 We can form a subgroup of G as H g1 ¼ f1, 2, 4g: Another subgroup of G can be formed as H g2 ¼ f1, 6g: Definition Let G be a group under the operation , and a 2 G. Then, an is defined as an ¼ a|fflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflffl}  a  ...  a

ð1:12Þ

n times

and an is calculated as an ¼ |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} a1  a1  . . .  a1

ð1:13Þ

n times

where a1 is the inverse element of a considering the operation , i.e., a  a1 ¼ e where e is the identity element. Definition Let G be a group. If there exists an element a of G such that an, n 2 Z generates all the elements of G, then the group G is a cyclic group. In this case, the element a is named as a generator element of G. Similarly, let H be a subgroup of G. If there exists an element b of H such that bn, n 2 Z generates all the elements of H, then the subgroup H is a cyclic subgroup. In this case, the element b is named as a generator element of H. Example 1.13 The finite set G and the operation  are given as G ¼ f0, 1, 2, 3, 4g

10

1 Review of Linear Algebra

 ! Mod  5 addition operation: G is a group under the Mod-5 addition operation. Determine whether G is a cyclic group or not. Solution 1.13 For G to be a cyclic group, we need to find an element a of G such that an, n 2 Z generates all the elements of G. In fact, one can find more than one generator element for G. One such generator element is 2, since using 2n we can generate all the elements of G as in 22 ! 2  2 ¼ 4 23 ! 2  2  2 ¼ 1 24 ! 2  2  2  2 ¼ 3 25 ! 2  2  2  2  2 ¼ 0: Similarly, using 3, we can generate all the elements of G as in 32 ! 3  3 ¼ 1 33 ! 3  3  3 ¼ 4 34 ! 3  3  3  3 ¼ 2 35 ! 3  3  3  3  3 ¼ 0: In fact, using the elements 1 and 4, we can generate all the other elements of G. Thus, we can say that all the elements of G are generator elements except for 0. Definition Let G be a group, and the identity element of G be e. Let a be an arbitrary element of G. If there exists m 2 Z such that am ¼ e,

ð1:14Þ

then m is said to be the order of a. Example 1.14 The finite set G and the operation  are given as G ¼ f1, 2, 3, 4g  ! Mod  5 multiplication operation: G is a group under Mod-5 multiplication operation. Find the order of every element of G. Solution 1.14 For a 2 G, the order of a is ma, if ama ¼ e. For our example, the identity element is e ¼ 1. We can determine the order of each element as in

1.1 Group

11

11 ¼ 1 ! m1 ¼ 1 24 ¼ 1 ! m2 ¼ 4 34 ¼ 1 ! m3 ¼ 4 42 ¼ 1 ! m4 ¼ 2: Theorem If G is a noncyclic group, then G can be written as the union of subgroups.

1.1.2

Cosets

Let G be a group and H be a subgroup under the operation , and a 2 G. The left and right cosets of H are the sets obtained using a  H ¼ fa  hjh 2 H g and H  a ¼ fh  ajh 2 H g: For a commutative group, the left and the right cosets are the same of each other. Example 1.15 The finite set G and the operation  are given as G ¼ f0, 1, 2, 3, 4, 5g  ! Mod  6 addition operation: G is a group under Mod-6 addition operation. A subgroup of G can be determined as H ¼ f0, 2, 4g: Find the cosets of H. Solution 1.15 To find a coset of H, we will find an element a of G such that a 2 = H, and if there are any cosets formed, a should not also be an element of the previously determined cosets. Considering this, we can form the cosets as 1 2 G, 1= 2H ! C ¼ 1  H ¼ f1, 3, 5g: There is only a single coset of H, and the group G can be written as G ¼ H [ C:

12

1 Review of Linear Algebra

Example 1.16 The finite set G and the operation  are given as G ¼ f0, 1, 2, 3, 4, 5, 6, 7, 8, 9g  ! Mod  10 addition operation: G is a group under Mod-10 addition operation. A subgroup of G can be determined as H ¼ f0, 5g: Find the cosets of H. Solution 1.16 To find a coset of H, we will find an element a of G such that a 2 = H, and if there are any cosets formed, a should not also be an element of the previously determined cosets. Considering this, we can form the cosets as 1 2 G, 1= 2H ! C a ¼ 1  H ¼ f1, 6g 2 2 G, 2= 2H, 2= 2C a ! C b ¼ 2  H ¼ f2, 7g 3 2 G, 3= 2H, 3= 2C a , 3= 2Cb ! C c ¼ 3  H ¼ f3, 8g 4 2 G, 4= 2H, 4= 2C a , 4= 2C b , 4= 2Cc ! Cd ¼ 4  H ¼ f4, 9g: The given group G can be written as the union of subgroup and cosets, that is G ¼ H [ Ca [ Cb [ Cc [ Cd : Example 1.17 The set of integers Z under addition operation + is a group. A subgroup of Z can be formed as H ¼ 4Z ! H ¼ f. . .  8, 4, 0, 4, 8, . . .g: Find the cosets of H. Solution 1.17 The cosets of H can be formed as in C a ¼ 1 þ H ! Ca ¼ f. . . , 7, 3, 1, 5, 9, . . .g C b ¼ 2 þ H ! Cb ¼ f. . . , 6, 2, 2, 6, 10, . . .g C c ¼ 3 þ H ! C c ¼ f. . . , 5, 1, 3, 7, 11, . . .g: The group Z can be written as

1.1 Group

13

Z ¼ H [ Ca [ Cb [ Cc : Lemma The subgroup H and its cosets Ca, Cb, . . ., have the same number of elements. In other words, the subgroup and its cosets have the same order. Theorem Let G be a finite group and H be a subgroup of G. The order of H, i.e., the number of elements of H, divides the order of G. Proof A group can be written as the union of subgroups and its cosets. That is, the group G can be written as G ¼ H [ S a [ Sb [ . . . Si

ð1:15Þ

where any two sets are disjoint with each other, and they have equal number of elements. Let’s say that there are N  1 cosets, and the order of a coset is K, then we can write jGj ¼ jH j þ jSa j þ jSb j þ . . . þ j Si j! jGj ¼ KN ! K ¼

jGj N

ð1:16Þ

which means that jGj is a multiple of K. Example 1.18 The finite set G and the operation  are given as G ¼ f1, 2, 3, 4, 5, 6g  ! Mod  7 multiplication operation: G is a group under Mod-7 multiplication operation. A subgroup of G can be formed as H ¼ f1, 2, 4g: Determine the cosets of H. Solution 1.18 The coset of H can be formed as in Ca ¼ 3  H ! C a ¼ f3, 5, 6g The given group G can be written as the union of subgroup and coset, that is G ¼ H [ Ca :

14

1.2

1 Review of Linear Algebra

Fields

Let F be a set and assume that two operations denoted by  and  are defined on the set elements. For the set F to be a field under  and  operations, the following properties are to be satisfied: 1. F is a commutative group under  operation. 2. F is a commutative group under  operation. 3. If a, b, c 2 F, then we have a  ð b  c Þ ¼ ð a  bÞ  ð a  c Þ

ð1:17Þ

which implies the distributive property of  over . For a commutative group, we need to check five properties. If the items 1), 2), and 3) are considered, it is clear that to determine whether a set is a field or not under the defined operations  and , we need to check 11 properties in total. Since fields are sets with some special properties, fields as sets can contain finite or infinite number of elements. Note that if the set contains “zero” as one of its elements, we ignore the “zero” element while searching for the inverse property.

1.2.1

Binary or Galois Field

The smallest finite field is the binary field F2 defined as (Table 1.5) F 2 ¼ f0, 1g  ! Mod  2 addition operation  ! Mod  2 multiplication operation: If we check the field properties, we see that F2 is a commutative group under mod-2 addition and mod-2 multiplication operations, and multiplication operation has the distributive property over addition operation. Table 1.5 Mod-2 addition and multiplication tables ⊕

0

1



0

1

0

0

1

0

0

0

1

1

0

1

0

1

1.2 Fields

15

Binary field is sometimes denoted by GF(2) or by GF2. Example 1.19 The finite set F and the operations  and  are given as F ¼ f0, 1, 2, 3, 4g  ! Mod  5 addition operation  ! Mod  5 multiplication operation: Determine whether F is a field or not under the defined operations  and . Solution 1.19 If we check the field properties, we see that 1. (F, ) form a commutative group. 2. (F  {0}, ) form a commutative group. 3. It can be shown that for the given field elements and defined operations, we see that  has distributive property over . Thus, we can say that F is a field under Mod-5 addition and Mod-5 multiplication operations. Example 1.20 Determine whether the set of integers Z ¼ f. . . , 3, 1, 1, 0, 1, 2, 3, . . .g under ordinary addition “+” and multiplication “” operations is a field or not. Solution 1.20 It can be shown that Z is a commutative group under “+” operation. However, Z is not a commutative group under “” operation, since every element does not have an inverse. For instance, the inverse of 2 is 1/2 which is not an element of Z. So, inverse property is violated for “” operation. Thus, Z is not a field under ordinary addition “+” and multiplication “” operations. Example 1.21 Determine whether the set of real numbers R under ordinary addition “+” and multiplication “” operations is a field or not. Solution 1.21 The set of real numbers is a commutative group under ordinary addition “+” and multiplication “” operations, and multiplication operation has distributive property over addition operation. Then, we can say that the set of real numbers is a field under ordinary addition “+” and multiplication “” operations. Example 1.22 The finite set S and the operations  and  are given as S ¼ f0, 1, 2, 3g  ! Mod  4 addition operation

16

1 Review of Linear Algebra

 ! Mod  4 multiplication operation: Determine whether S is a field or not under the defined operations  and . Solution 1.22 If we check the field properties, we see that 1. (S, ) form a commutative group. 2. (S  {0}, ) does not form a commutative group. Inverse property is violated. The inverse of 2 is not available. Thus, we can say that S is NOT a field under Mod-4 addition and Mod-4 multiplication operations.

1.2.2

Prime Fields

If the set F ¼ f0, 1, . . . , M  1g, where M is a prime number, satisfies all the properties of a field under the operations  ! Mod  M addition  ! Mod  M multiplication, then this set is called a “prime” field. Example 1.23 Find a prime field under Module-7 arithmetic operations. Solution 1.23 The required prime field can be formed as F ¼ f0, 1, 2, 3, 4, 5, 6g  ! Mod  7 addition  ! Mod  7 multiplication: Indeed, we can show that 1. (F, ) is a commutative group. 2. (F  {0}, ) is a commutative group. 3.  has distributive property over . The Mod-7 additions and Mod-7 multiplications are shown in Table 1.6.

1.3 Vector Spaces

17

Table 1.6 Mod-7 multiplication and addition tables



0

1

2

3

4

5

6



1

2

3

4

5

6

0

0

1

2

3

4

5

6

1

1

2

3

4

5

6

1

1

2

3

4

5

6

0

2

2

4

6

1

3

5

2

2

3

4

5

6

0

1

3

3

6

2

5

1

4

3

3

4

5

6

0

1

2

4

4

1

5

2

6

3

4

4

5

6

0

1

2

3

5

5

3

1

6

4

2

5

5

6

0

1

2

3

4

6

6

5

4

3

2

1

6

6

0

1

2

3

4

5

1.3

Vector Spaces

Before giving the definition of vector space, let’s explain the meaning of a vector. Vector Let (F,  , ) be a field where  and  are the two operations defined on the field elements. A vector v is a sequence of field elements in any number. The number of elements in vector v is called the length of the vector. Example 1.24 The field(F,  , ) is given as F ¼ f0, 1, 2, 3, 4g  ! Mod  5 addition  ! Mod  5 multiplication: Using the field elements, we can define some vectors as in u ¼ ½2 2 3 1 1 2 3 2 3 4 2 1 1 3 v ¼ ½2 3 0 4 4 3 1 2 3 4 2 k ¼ ½1 2 2 3 4:

18

1 Review of Linear Algebra

Let (F,  , ) be a field under  and  operations. Using the field elements, let’s define two vectors u and v of equal length as u ¼ ½ u1 u2 . . . uk  v ¼ ½v1 v2 . . . vk : Vector Addition The sum of the vectors u and v is performed as u  v ¼ ½u1  v1 u2  v2 . . . uk  vk : Example 1.25 The field(F,  , ) is given as F ¼ f0, 1, 2, 3, 4g  ! Mod  5 addition  ! Mod  5 multiplication: Using the field elements, we can define some vectors as in u ¼ ½2 1 3 1 4 v ¼ ½4 4 3 1 3: The sum of the vectors u and v is performed as u  v ¼ ½ð2  4Þ ð1  4Þ ð3  3Þ ð1  1Þ ð4  3Þ ! u  v ¼ ½1 0 1 2 2: Multiplication of a Vector by a Scalar Let a 2 F. a  u is performed as a  u ¼ ½a  u1 a  u2 . . . a  uk : Example 1.26 The field(F,  , ) is given as F ¼ f0, 1, 2, 3, 4g  ! Mod  5 addition

ð1:18Þ

1.3 Vector Spaces

19

 ! Mod  5 multiplication: Using the field elements, we can define a vector as u ¼ ½2 1 3 1 4: We can multiply the vector u by the scalar 2 2 F as in 2  u ¼ ½ð2  2Þ ð2  1Þ ð2  3Þ ð2  1Þ ð2  4Þ ! 2  u ¼ ½4 2 1 2 3: Dot Product of Two Vectors The dot product of u and v is performed as u  v ¼ ½u1  v1 u2  v2 . . . uk  vk :

ð1:19Þ

Example 1.27 The field(F,  , ) is given as F ¼ f0, 1, 2, 3, 4g  ! Mod  5 addition  ! Mod  5 multiplication: Using the field elements, we can define a vector as u ¼ ½2 1 3 2 3 v ¼ ½3 1 3 4 4: u  v is calculated as u  v ¼ ½ð2  3Þ ð1  1Þ ð3  3Þ ð2  4Þ ð3  4Þ ! u  v ¼ ½1 1 4 3 2:

1.3.1

Vector Spaces

Let (F,  , ) be a field under  and  operations. Using the field elements, let’s define some vectors and let’s denote the set of vectors generated using the field elements by V ¼ ½ v1 v2 . . . vM  where vi, i ¼ 1. . .M is defined as

ð1:20Þ

20

1 Review of Linear Algebra

vi ¼ ½v1 v2 . . . vN :

ð1:21Þ

The set of vectors V is called a vector space if the following properties are satisfied by the elements of V: 1. ðV, Þ is a commutative group. 2. For every α, β 2 F and vi , vj 2 V, we have   ð α  vi Þ  β  vj 2 V

ð1:22Þ

which is named as the closure property. 3. For every α, β 2 F and vi 2 V, we have ð α  βÞ  vi ¼ ðα  vi Þ  ðβ  vi Þ:

ð1:23Þ

4. For every α 2 F and vi , vj 2 V, we have     α  vi  vj ¼ ð α  vi Þ  α  vj :

ð1:24Þ

5. The operation  has associative property, i.e., ðα  βÞ  vi ¼ α  ðβ  vi Þ:

ð1:25Þ

Example 1.28 The field(F,  , ) is given as F ¼ f0, 1, 2g  ! Mod  3 addition  ! Mod  3 multiplication: Using the field elements, we construct vectors, and using these vectors, we form a vector set as in V ¼ ½ð0 0 0Þ ð1 1 1 Þ ð2 2 2Þ: Determine whether V is a vector space or not. Solution 1.28 For the given vector set V, we check the properties of a vector space as in 1. ðV, Þ is a commutative group. 2. For every α, β 2 F and vi , vj 2 V, we have

1.3 Vector Spaces

21

  ðα  vi Þ  β  vj 2 V: For instance, 1, 2 2 F and ð1 1 1 Þ, ð2 2 2Þ 2 V ! ð1  ð1 1 1 ÞÞ  ð2  ð2 2 2ÞÞ ¼ ð2 2 2Þ 2 V: 3. For every α, β 2 F and vi 2 V, we have ð α  βÞ  vi ¼ ðα  vi Þ  ðβ  vi Þ: For instance, 1, 2 2 F and ð1 1 1 Þ 2 V ! ð1  2Þ  ð1 1 1 Þ ¼ ð1  ð1 1 1 ÞÞ  ð2  ð1 1 1 ÞÞ: 4. For every α 2 F and vi , vj 2 V, we have     α  vi  vj ¼ ð α  vi Þ  α  vj : For instance, 2 2 F and ð1 1 1 Þ, ð2 2 2Þ 2 V ! 2  ðð1 1 1 Þ  ð2 2 2ÞÞ ¼ ð2  ð1 1 1 ÞÞ  ð2  ð2 2 2ÞÞ: 5. The operation  has associative property, i.e., ðα  βÞ  vi ¼ α  ðβ  vi Þ: For instance, 1, 2 2 F and ð2 2 2 Þ 2 V ! ð1  2Þ  ð2 2 2 Þ ¼ 1  ð2  ð2 2 2 ÞÞ: Since all the vector space properties are satisfied by V, we can say that the set of vectors V is a vector space. N-Tuple A number vector consisting of N elements is also called N-tuple.

22

1 Review of Linear Algebra

1.3.2

Subspace

Let V be a vector space defined on a scalar field (F,  , ). A subset of V denoted by W is called a subspace if the condition   8α, β 2 F and wi , wj 2 W ! ðα  wi Þ  β  wj 2 W

ð1:26Þ

is satisfied for 8wi, wj 2 W. Example 1.29 The field(F,  , ) is given as F ¼ f0, 1, 2g  ! Mod  3 addition  ! Mod  3 multiplication: Using the field elements, we construct vectors, and using these vectors, we form a vector set as in V ¼ ½ð0 0 0Þ ð1 0 2Þ ð2 1 1 Þ ð2 0 1Þ ð1 2 2 Þ ð0 1 0Þ ð2 2 1Þ : It can be shown that V is a vector space. A subset of V is given as W ¼ ½ð0 0 0Þ ð2 1 1 Þ ð1 2 2 Þ: Determine whether W is a subspace or not. Solution 1.29 For any two elements wi, wj of W, it can be shown that   ðα  wi Þ  β  wj 2 W: For instance, w1 ¼ ð2 1 1 Þ w2 ¼ ð1 2 2 Þ ! ð1  w1 Þ  ð2  w2 Þ ¼ ð1 2 2Þ 2 W: Thus, we can say that W is a subspace. Example 1.30 The field (F,  , ) is given as F ¼ f0, 1g  ! Mod  2 addition

1.3 Vector Spaces

23

 ! Mod  2 multiplication: Using the field elements, we construct vectors, and using these vectors, we form a vector set as in V ¼ ½ð0 0 0Þ ð1 0 0Þ ð0 1 0 Þ ð0 0 1Þ ð1 1 0 Þ ð1 1 1Þ ð0 1 1Þ ð1 0 1Þ: It can be shown that V is a vector space. A subset of V is given as W ¼ ½ð0 0 0Þ ð1 0 0Þ ð0 1 0 Þ ð1 1 0 Þ: Determine whether W is a subspace or not. Solution 1.30 For any two elements wi, wj of W, it can be shown that   ðα  wi Þ  β  wj 2 W: For instance, w1 ¼ ð1 1 0 Þ w2 ¼ ð1 0 0 Þ ! ð1  w1 Þ  ð1  w2 Þ ¼ ð0 1 0Þ 2 W: Thus, we can say that W is a subspace.

1.3.3

Dual Space

Let W be a subspace of the vector space V. The dual space of W denoted by Wd is a subspace of V such that for8wi 2 W and8wj 2 W d we have wi  wj ¼ 0

ð1:27Þ

where 0 is the zero vector defined as 0 ¼ ½0 0 . . . 01N :

1.3.4

Linear Combinations

Let V be a vector space defined on a scalar field (F,  , ) and v1, v2, . . ., vk be a set of vectors in V . Let a1, a2, . . ., ak be some scalars in the field F. The linear combination of the vectors v1, v2, . . ., vk is calculated using

24

1 Review of Linear Algebra

ða1  v1 Þ  ða2  v2 Þ  , . . . ,  ðak  vk Þ:

ð1:28Þ

Linear combination can also be represented via matrix multiplication using either 2

v1

3

6v 7 6 27 ½a1 a2 . . . ak   6 7 4⋮5

ð1:29Þ

vk or 2

3 a1 6a 7 6 27 ½ v1 v2 . . . vk   6 7 : 4⋮5

ð1:30Þ

ak Linear Independence and Dependence Let V be a vector space defined on a scalar field (F,  , ) and v1, v2, . . ., vk be a set of vectors in V. Let a1, a2, . . ., ak be some scalars in the field F. If ð a1  v 1 Þ  ð a2  v 2 Þ  , . . . ,  ð ak  v k Þ ¼ 0

ð1:31Þ

is satisfied for only a1 ¼ a2 ¼ . . . ¼ ak ¼ 0, then the vectors v1, v2, . . ., vk are said to be linearly independent of each other. On the other hand, if there exists a nonzero ai value for Eq. (1.31), then the vectors v1, v2, . . ., vk are said to be linearly dependent vectors. Example 1.31 The field (F,  , ) is given as F ¼ freal numbersg  ! Mod  10 addition  ! Mod  10 multiplication: It can be shown that the set of real number vectors, each having three numbers, is a vector space. Some sets of vectors from the vector space are given as (a) v1 ¼ [3 8 5] v2 ¼ [2 2 12] v3 ¼ [1 10 17] (b) v1 ¼ [2 0 0] v2 ¼ [1 7 0] v3 ¼ [2 5 3] Determine whether the set of vectors given in (a) and (b) are linearly independent or not.

1.3 Vector Spaces

25

Solution 1.31 For part (a), ða1  v1 Þ  ða2  v2 Þ  ða3  v3 Þ ¼ 0 can be satisfied for only a1 ¼ a2 ¼ 1 and a3 ¼  1. This means that v3 can be written as the linear combination of v1 and v2, i.e., we have v3 ¼ v1 þ v2 : Hence, the vectors of part (a) are linearly dependent vectors. For part (b), ða1  v1 Þ  ða2  v2 Þ  ða3  v3 Þ ¼ 0 is satisfied for only a1 ¼ a2 ¼ a3 ¼ 0. This also means that one vector cannot be written as the linear combination of the other vectors. Hence, the vectors of part (a) are linearly independent.

1.3.5

Basis Vectors

In a vector space, there exist a number of linearly independent vectors from which all other vectors can be generated. These linearly independent vectors are called basis vectors, and the set of basis vectors is referred to as basis. Each vector in the vector space can be expressed as the linear combination of basis vectors. Span The basis vectors are said to span the vector space. Dimension The number of vectors in the basis is called the dimension of the vector space. Subspace Formation If we have the basis vectors of a vector space, then using a subset of the basis vectors, we can generate the elements of a subspace via linear combination of the subset of the basis vectors. In fact, the subset of the basis vectors is the basis of a subspace. Standard Basis In an m-dimensional vector space, the vectors b1 ¼ ½ 1 . . . 0

b2 ¼ ½0 1 . . . 0  bm ¼ ½0 . . . 1

are referred to as the standard basis vectors.

ð1:32Þ

26

1 Review of Linear Algebra

Number of Bases For an m-dimensional vector space, we can generate other bases using the standard basis. This can be achieved keeping the linear independence properties of the vectors in the basis. Example 1.32 The standard basis of a vector space V is given as B ¼ ½ b1 b2 b3  where we have b1 ¼ ½1 0 0 b2 ¼ ½0 1 0 b3 ¼ ½0 0 1: Using standard basis vectors, we can generate another basis as B1 ¼ ½b1 þ b2 b2 b3 þ b2  leading to B1 ¼ ½110 010

011:

Both B and B1 can generate all the elements of vector space V which contains eight vectors. Assume that a vector space is constructed from a field consisting of q numbers, and the vectors contain n numbers. The total number of bases for this vector space can be calculated using   1 n ðq  1Þðqn  qÞ . . . qn  qn1 : n!

ð1:33Þ

For our example, we can calculate the total number of bases as    1 3 2  1 23  2 23  22 ! 28: 3! Orthogonality If the dot product of two vectors is zero, then these vectors are said to be orthogonal to each other, i.e., vi is orthogonal to vj if we have vi  vj ¼ 0:

ð1:34Þ

1.3 Vector Spaces

1.3.6

27

Matrices Obtained from Basis Vectors

We can form a matrix by placing the basis vectors of a vector space as the rows or columns of the matrix. If the basis vectors are used for the rows of the matrix, then the row span of the matrix generates the vector space. On the other hand, if the basis vectors are used as the columns of the matrix, then the column space of the matrix generates the vector space. The number of basis vectors used as the rows or columns of the matrix is referred to as the rank of the matrix. Elementary Row Operations For a matrix of size N  M, the elementary row operations are outlined as follows: 1. Interchanging any two rows 2. Multiplying a row by a nonzero scalar 3. Adding a row to another row Elementary row operations do not affect the row space of the matrix. Example 1.33 For the given matrix 2

1

6 A ¼ 40 0

0

1

1 1

0 1

1 0

3

7 1 15 0 0

we can perform some elementary row operations as in 2

1 6 R2 $ R3 ! A1 ¼ 4 0

R1

0 1

1 1

1 0

3 0 7 05

0 1 0 1 1 2 3 1 1 1 0 1 6 7 R1 þ R3 ! A2 ¼ 4 0 1 1 0 0 5 0 1 0 1 1

where “$” refers to exchange of two rows and “ right argument to the left one.

” refers to the assignment of the

Theorem Let (F,  , ) be a finite field, and assume that that there are q elements in F. If we construct an n-dimensional vector space V using field elements, then the number of vectors in the vector space happens to be qn which is denoted by jV j.

28

1 Review of Linear Algebra

1.3.7

Polynomial Groups and Fields

Groups and fields are some sets satisfying a number of properties under some defined operations. We can construct polynomial sets satisfying the properties of a group or field. Let’s illustrate the concept by examples. Example 1.34 The field (F, + , ) is given as F ¼ f0, 1g þ ! Mod  2 addition  ! Mod  2 multiplication: Using field elements for coefficients, we can construct the polynomials of the form α, β 2 F, αx þ β, and from these polynomials, we can obtain a polynomial set as in S ¼ f0, 1, x, x þ 1g: (a) Show that (S, +) is a group. (b) Find the inverse of the elements x and x + 1. Solution 1.34 (a) Using the elements of S and mod-2 addition operation, we can construct addition Table 1.7.

If the Table 1.7 is inspected, we see that (S, +) is a group. (b) Using Table 1.7, we can determine the inverses of x and x + 1 as x and x + 1, respectively. Example 1.35 Consider the polynomial set of the previous example again. For the elements of S, we define two operations ,  as Table 1.7 Mod-2 polynomial addition



0

1

+1

0

0

1

1

1

0

+1

+1

0

1

+1

+1

1

0

+1

1.4 Ring

29

Table 1.8 Polynomial tables for

L N , operations



0

1



0

1

0

0

1

0

0

0

1

1

0

1

0

1

0

1

0

1

0

0

0

0 1 x

1

pðxÞ  qðxÞ ! Rx2 þxþ1 ðpðxÞ þ qðxÞÞ pðxÞ  qðxÞ ! Rx2 þxþ1 ðpðxÞqðxÞÞ where Rx2 þxþ1 ðÞ means the remainder polynomial after division of the input argument by x2 + x + 1. Determine whether (S,  , ) is a field or not. Solution 1.35 Using the elements of S, we can construct tables for defined ,  operations as in Table 1.8. When Table 1.8 is inspected, we see that 1. (S, ) is a commutative group. 2. (S  {0}, ) is a commutative group. 3.  has distributive property over . Hence, we can say that S is a field under the defined operations  and .

1.4

Ring

Let R be a set and assume that two operations denoted by  and  are defined on the set elements. For the set R to be a ring under  and  operations, the following properties are to be satisfied: 1. R is a commutative group under  operation. 2.  operation has associative property. That is, if a, b, c 2 R, then we have a  ðb  cÞ ¼ ða  bÞ  c:

ð1:35Þ

30

1 Review of Linear Algebra

3.  operation has left and right distribution properties over . That is, if a, b, c 2 R, then we have a  ðb  cÞ ¼ ða  bÞ  ða  cÞ ða  bÞ  c ¼ ða  cÞ  ðb  cÞ:

ð1:36Þ

In addition, if the commutative property also holds, then the ring is said to be a commutative ring. If the ring has identity element for  operation, then the ring is said to be an identity ring, and it is typically denoted by IR. Note that for a set to be a ring, we do not require that R is a commutative group under  operation. Inverse and commutative properties may not even hold for  operation. Example 1.36 The set of 4  4 matrices under ordinary addition and multiplication operations form a ring. This ring does not have commutative and inverse properties.

Problems 1. The finite set G and the operation  are given as G ¼ f0, 1, 2, 3g  ! Mod  4 addititon operation: Determine whether G is a group under the defined operation  or not. 2. The finite set G and the operation  are given as G ¼ f0, 1, 2, 3, 4g  ! Mod  5 multiplication operation: Determine whether G is a group under the defined operation  or not. 3. The finite set G and the operation  are given as G ¼ f1, 2, 3, 4g

Problems

31

 ! Mod  5 multiplication operation: Show that G is a group under Mod-5 multiplication operation. Find a subgroup of G, and determine all the cosets using the subgroup. 4. The set of integers Z under addition operation + is a group. A subgroup of Z can be formed as H ¼ 6Z ! H ¼ f. . .  12, 6, 0, 6, 12, . . .g: Find the cosets of H. 5. The finite set S and the operations  and  are given as S ¼ f0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10g  ! Mod  11 addition operation  ! Mod  11 multiplication operation: Determine whether S is a field or not under the defined operations  and . 6. The field(F,  , ) is given as F ¼ f0, 1g  ! Mod  2 addition  ! Mod  2 multiplication: Using the field elements, we construct vectors, and using these vectors, we form a vector set as in V ¼ ½0000 1011 0101 1110 : Determine whether V is a vector space or not. 7. The dimension of a vector space constructed using the elements of the binary field is 4. Write all the elements of the vector space, and find three different bases of this vector space. 8. The dimension of a vector space constructed using the elements of the binary field is 5. Find a basis of this vector space other than the standard basis, and using the basis, determine a subspace of the vector space.

32

1 Review of Linear Algebra

9. Using the elements of the prime field F3 ¼ {0, 1, 2}, construct a basis of a vector space whose dimension is 3, and determine all the elements of the vector space. 10. The basis of a vector space constructed using the binary field is given as B ¼ ½00101 01010 10010 10101: Find the elements of the vector space, and find a subspace of this vector space. 11. Explain the difference between linear independence and orthogonality.

Chapter 2

Linear Block Codes

2.1

Binary Linear Block Codes

In this chapter, we will only inspect the binary block codes, and for the simplicity of writing, we will use the term “linear block codes” for the place of “binary linear block codes” otherwise indicated. Now, let’s give the definition of binary linear block codes, i.e., linear block codes. Definition The binary field F is given as F ¼ f0, 1g  ! Mod  2 addition operation  ! Mod  2 multiplication operation: Let V be an n-dimensional vector space constructed using the elements of F and C be k-dimensional subspace of the vector space V. The subspace C is called a linear block code, and the elements of C are denoted as code-words. Note that from now on while considering the vector spaces, we will assume that the vector spaces are constructed using the binary field. We will not explicitly mention that the vector spaces are constructed using the binary field. Example 2.1 A vector space of dimension 3 has the standard basis B ¼ f001, 010, 100g: Find the elements of vector space V generated by B. How many elements do V have? Find a subspace, i.e., code, using the generated vector space. Solution 2.1 The basis vectors span the vector space. In other words, the elements of the vector space can be obtained by taking the linear combinations of the basis © Springer Nature Switzerland AG 2020 O. Gazi, Forward Error Correction via Channel Coding, https://doi.org/10.1007/978-3-030-33380-5_2

33

34

2 Linear Block Codes

vectors. Since there are 3 elements in the basis, it is possible to generate 23 ¼ 8 vectors by taking the linear combinations of the basis vectors. Thus, the vector space generated by B has 8 vectors. The elements of the vector space can be generated as in 0  001 ! 000 1  001 ! 001 1  010 ! 010 1  100 ! 100 1  001 þ 1  010 ! 011 1  001 þ 1  100 ! 101 1  010 þ 1  100 ! 110 1  001 þ 1  010 þ 1  100 ! 111: Writing the generated vectors as the elements of a set, we get V ¼ f000, 001, 010, 100, 011, 101, 110, 111g which is a vector space. To find a subspace of the vector space, we can first find a subset of the basis B, and then, by taking the linear combinations of the vectors in this subset of the basis, we can generate the elements of the subspace. We can choose a subset of B as Bs ¼ f001, 010g: By taking the linear combinations of the elements of Bs, we can obtain the generated vectors, i.e., code-words, as 0  001 ! 000 1  001 ! 001 1  010 ! 010 1  001 þ 1  010 ! 011: Writing the generated vectors, i.e., code-words, as the elements of a set, we get C ¼ f000, 001, 010, 011g which is a linear block code of dimension 2. Note that for a vector space there are more than a single basis, and considering the availability of many bases, we can construct a subspace in many different ways. For

2.1 Binary Linear Block Codes

35

instance, assume that a vector space has 20 bases; then, the basis of a subspace can be formed considering many different subsets from these 20 bases. Example 2.2 The vector space of dimension 6 has the standard basis B ¼ f000001, 000010, 000100, 001000, 010000, 1000000g: Find the elements of vector space V generated by B. How many elements do V have? Find a subspace, i.e., code, using the generated vector space. Solution 2.2 The basis vectors span the vector space. In other words, the elements of the vector space can be obtained by taking the linear combinations of the basis vectors. Since there are 6 elements in the basis, it is possible to generate 26 ¼ 64 vectors by taking the linear combinations of the basis vectors. Thus, the vector space generated by B has 64 vectors. The generated vector space can be shown as V ¼ f000000, 000001, . . . 011111, 111111g: To find a subspace of the vector space, we can first find a subset of the basis B, and then, by taking the linear combinations of the vectors in this subset of the basis, we can generate the elements of the subspace. We can choose a subset of B as Bs ¼ f100000, 010000, 000100g: By taking the linear combinations of the elements of Bs, we can construct the linear code as in C ¼ f000000, 100000, 010000, 000100, 110000, 100100, 010100, 110100g: For the simplicity of illustration, we used the standard basis for the vector space of this example and used a subset of it to generate the elements of a subspace, i.e., code. However, note that there are many bases of the vector space under concern, and many subsets of them can be obtained for the basis of the subspace and many codes can be generated with the same dimension. Example 2.3 A linear code should always include the all-zero code-word. Is this statement correct or not? If it is correct, explain the reasoning behind it. Solution 2.3 A linear code is a vector subspace, and a vector subspace satisfies all the properties of a vector space. We know that a vector space is a vector set V, and this vector set is a group under + operation, i.e., ðV, þÞ is a group. This means that V has an identity element under + operation, and this identity element is the all-zero vector. Thus, a linear code always includes the all-zero vector as one of its codewords.

36

2 Linear Block Codes

Example 2.4 A linear code C is given as C ¼ f0000, 0001, 0010, 0011g: (a) What is the dimension of the vector space from which the linear code is generated? (b) What is the dimension of the linear code? Solution 2.4 (a) The number of elements, i.e., bits, in the code-words indicates the dimension of the vector space. Since there are four bits in the code-words, the dimension of the vector space is 4. (b) If the dimension of the linear code is k, then there are 2k code-words in the code. Since there are four code-words in the code, the dimension of the code can be found as 2k ¼ 4 ! k ¼ 2:

2.2

Generator Matrix of a Linear Code

We can construct the generator matrix of a linear code using the basis vectors of the subspace from which the linear code is formed. Let V be a vector space of dimension n and C be a linear code, i.e., a subspace, whose basis is given as Bs ¼ ½b1 , b2 , . . . , bk 

ð2:1Þ

where row vectors bi, i ¼ 1. . .k are the basis vectors, and k is the dimension of the subspace. The span of the basis vectors is the linear code C. Let’s write the elements of Bs as the rows of a matrix, and let’s denote this matrix by G; then, G happens to be as 2

b1

3

6 7 6 b2 7 6 7 G¼6 7 6⋮7 4 5 bk kn

ð2:2Þ

2.2 Generator Matrix of a Linear Code

37

where k is the dimension of the linear code, and n is the dimension of the vector space. The matrix G is called the generator matrix of the linear code. If we use the notation gi for the place of bi, the generator matrix becomes as 2

g1

3

6 7 6 g2 7 6 7 G¼6 7 6⋮7 4 5 gk

:

ð2:3Þ

kn

Example 2.5 The dimension of a vector space is n ¼ 4. Design a linear code with dimension k ¼ 2, and find the generator matrix of the designed code. Solution 2.5 The standard basis of the vector space with dimension 4 can be written as B ¼ f0001, 0010, 0100, 1000g: The span of basis vectors in B gives us the vector space which can be written as V ¼ f0000, 0001, 0010, . . . , 1111g: It is clear that V includes all the 4-tuples, i.e., all the binary vectors with 4 elements. To construct a linear code from the given vector space, first, we select a subset of the basis B as Bs ¼ f0010, 0100g: If we write the elements of Bs as the rows of a matrix, we obtain the generator matrix " G¼

0010 0100

# 24

where the size of the matrix 2  4 gives information about the dimension of the code and vector space from which the code is formed. Once we have the generator matrix of a linear code, we can generate the codewords by taking the span of the rows of the generator matrix. Considering this information, we can generate the linear code as in C ¼ f0000, 0010, 0100, 0110g: If we choose the basis other than the standard basis as

38

2 Linear Block Codes

B ¼ f1001, 0110, 0101, 1000g, select a subset of the basis B Bs ¼ f0110, 0101g, and wring the elements of Bs as the rows of a matrix, we obtain the generator matrix " G¼

0110

#

0101

24

Exercise Consider the vector space with the basis B ¼ f10001, 00110, 00100, 11001, 10010g: Construct a linear code with dimension k ¼ 3 from this vector space.

2.3

Hamming Weight of a Code-Word

Let C be a binary code and ci 2 C be a code-word. If the code-word ci is defined as ci ¼ ½ci1 ci2 . . . cin  where cim 2 F ¼ f0, 1g and m ¼ 1, . . . , n

ð2:4Þ

then the Hamming weight of the code-word ci is calculated using d H ð ci Þ ¼

n X

cim :

ð2:5Þ

m¼1

That is, the number of ones in the code-word is called the Hamming weight of the code-word. Example 2.6 A binary code, i.e., a binary linear block code, is given as C ¼ f00000, 10011, 01000, 11011g: Find the Hamming weight of each code-word for this code. Solution 2.6 Let’s denote the code-words available in this code as c1 ¼ ½00000

c2 ¼ ½10011

c3 ¼ ½01000

c4 ¼ ½11011:

2.3 Hamming Weight of a Code-Word

39

According to the definition given in Eq. (2.5), we can calculate the Hamming weight of each code-word as d H ð c1 Þ ¼ 0

2.3.1

d H ð c2 Þ ¼ 3

d H ð c3 Þ ¼ 1

dH ðc4 Þ ¼ 4:

Hamming Distance

Let C be a binary code and ci, cj 2 C be two code-words. If the code-words ci, cj are defined as ci ¼ ½ci1 ci2 . . . cin  where cim 2 F ¼ f0, 1g and m ¼ 1, . . . , n   cj ¼ cj1 cj2 . . . cjn where cjm 2 F ¼ f0, 1g and m ¼ 1, . . . , n then the Hamming distance between the code-words ci and cj is calculated using n    X  cim þ cjm : d ci , cj ¼

ð2:6Þ

m¼1

where + is the mod-2 addition operation. Equation (2.6) can also be written as     d ci , cj ¼ sum ci þ cj :

ð2:7Þ

That is, Hamming distance is the number of positions in which ci and cj have different values. Note that when the word “distance” appears, the readers usually think the “” operation, and the distance expression can be considered as n   X   cim  cjm : d  ci  cj  ¼

ð2:8Þ

m¼1

However, our code-words are constructed using the binary field F ¼ {0, 1} for which mod-2 “+” and “” operations are available. There is no “” operation defined for the binary field elements. Thus, the formula in Eq. (2.8) has no meaning. The correct formula is the one in Eq. (2.6). Example 2.7 Code-words of a binary code are given as c1 ¼ ½00000

c2 ¼ ½10011

c3 ¼ ½01000

c4 ¼ ½11011:

Find the Hamming distance between the code-words c2 and c3.

40

2 Linear Block Codes

Solution 2.7 According to the definition given in Eq. (2.6), we can calculate the Hamming distance between c3 and c4 as d ð c3 , c4 Þ ¼

5  X

 cim þ cjm !

m¼1

dðc3 , c4 Þ ¼ ð0 þ 1Þ þ ð1 þ 1Þ þ ð0 þ 0Þ þ ð0 þ 1Þ þ ð0 þ 1Þ ! d ðc3 þ c4 Þ ¼ 3:

2.3.2

Minimum Distance of a Linear Block Code

Let C be a binary code and ci, cj 2 C be two code-words. Considering all the codeword pairs ci, cj, the minimum distance of a linear block code is defined as dmin ¼ min fdH ðci , cj Þ i, j ¼ 1, . . . , kg,

i 6¼ j

ð2:9Þ

which means that we consider the Hamming distance between all possible pairs ci, cj and choose the smallest value as the minimum distance of the code. Although Eq. (2.9) is the formal definition of the minimum distance, we can simplify it more. Using Eq. (2.7), we can write the expression in Eq. (2.9) as d min ¼ min fsumðci þ cj Þ i, j ¼ 1, . . . , kg,

i 6¼ j:

ð2:10Þ

where + is the mod-2 addition operation. Since the summation of two code-words produces another code-word, the expression in Eq. (2.10) can be written as dmin ¼ min fsumðcl Þ, l ¼ 1, . . . , kg,

dmin > 0

ð2:11Þ

d min > 0

ð2:12Þ

where, substituting dH(cl) for sum(cl), we obtain dmin ¼ min fdH ðcl Þ, l ¼ 1, . . . , kg,

which means that the minimum distance of a linear block code is the minimum Hamming weight of all the code-words other than the zero code-word. Example 2.8 A binary code, i.e., a binary linear block code, is given as C ¼ f00000, 10011, 01000, 11011g: The code-words of this code are denoted as c1 ¼ ½00000

c2 ¼ ½10011

c3 ¼ ½01000

c4 ¼ ½11011:

The Hamming weight of each code-word can be calculated as

2.4 Performance Enhancement of Communication Systems and Encoding Operation

d H ð c1 Þ ¼ 0

d H ð c2 Þ ¼ 3

d H ð c3 Þ ¼ 1

41

dH ðc4 Þ ¼ 4:

Find the minimum distance of C. Solution 2.8 Minimum distance of a code is the minimum Hamming weight of all the code-words, i.e., d min ¼ min fdH ðcl Þ, l ¼ 1, . . . , k g:

ð2:13Þ

Using the given values in question, we can decide the minimum distance of the code as d min ¼ 1:

2.4

Performance Enhancement of Communication Systems and Encoding Operation

Let C be a binary code and ci, cj 2 C be two code-words. Assume that we transmit ci, and at the receiver side, we get cj. The Hamming distance between ci and cj is dH(ci, cj) which indicates the number of positions by which two codewords differ. It is clear that as the value of dH(ci, cj) increases, the probability of receiving cj instead of ci decreases, since more bits have to be flipped. If dH(ci, cj) has a small value, then the probability of receiving wrong code-word at the receiver side becomes larger. Let’s define a probability of error function pe(ci, cj) for receiving cj instead of ci at the receiver side as      pe c i , c j ¼ E d c i , c j

ð2:14Þ

in which using     d ci , cj ¼ sum ci þ cj we get      pe ci , cj ¼ E sum ci þ cj

ð2:15Þ

where using c ¼ (ci + cj), we obtain     pe ci , cj ¼ E ðsumðcÞÞ ! pe ci , cj ¼ Eðd H ðcÞÞ:

ð2:16Þ

42

2 Linear Block Codes

For the transmission through AWGN channel employing BPSK modulation, it is known that the function E() in Eq. (2.16) is the Q() function and the error expression in Eq. (2.16) is calculated using 0sffiffiffiffiffiffiffiffiffiffiffiffiffi1 d 2H ðcl ÞA pe ci , cj ¼ Q@ : N0 



ð2:17Þ

If we consider the transmission of all the code-words in our code, the code probability of error can be written as

P e ðC Þ ¼

2k X l¼1

0sffiffiffiffiffiffiffiffiffiffiffiffiffi1 d 2H ðcl ÞA Q@ : N0

ð2:18Þ

There may be many code-words with the same Hamming weight. Denoting d2H ðcl Þ by d 2l , we can write Eq. (2.18) as 0sffiffiffiffiffiffi1 X d2l A Pe ðC Þ ¼ Al Q@ N0 l

ð2:19Þ

where Al indicates the number of code-words with Hamming weight dl. When Eq. (2.19) is expanded, we obtain 0sffiffiffiffiffiffi1 0sffiffiffiffiffiffi1 2 d d22 A 1A Pe ðC Þ ¼ A1 Q@ þ A2 Q@ þ ... N0 N0

ð2:20Þ

The function Q() is a nonlinear decreasing function, and the graph of this function is depicted in Fig. 2.1 where it is seen that as the input argument of the function gets large values, the function converges to zero. In the summation expression of Eq. (2.20), the dominant term is the one in which d2min appears, i.e., the dominant term in the summation can be written as 0sffiffiffiffiffiffiffiffi1 d2min A Amin Q@ : N0

ð2:21Þ

We can approximate the summation expression in Eq. (2.20) considering the dominant terms as 0sffiffiffiffiffiffiffiffi1 d2min A Pe ðC Þ  Amin Q@ : N0

ð2:22Þ

2.5 The Philosophy of Channel Encoding

43

Fig. 2.1 The graph of the Q() function

Equation (2.22) implies that if we increase the distance between vectors of a vector space, then the probability of the transmission error of the code decreases.

2.5

The Philosophy of Channel Encoding

Assume that we have k-dimensional data vector space, and we want to transmit the data available in the vector space via electronic communication devices. For this purpose, the data available in the binary vector space can be put into a matrix of size m  k where k is the number of data bits in each row of the matrix, and there are m ¼ 2k rows. The set of rows of the matrix is a vector space and the dimension of the data vector space is k. This vector space denoted by W can be written as W ¼ ½w1 w2 . . . wm  where

m ¼ 2k

ð2:23Þ

44

2 Linear Block Codes

wi ¼ ½wi1 wi2 . . . wik 

ð2:24Þ

is a k-bit data vector to be transmitted. If we transmit the data vectors directly, the probability of the error at the receiver side approximately equals to 0sffiffiffiffiffiffiffiffiffi1 w2min A Pe ðW Þ  W min Q@ N0

ð2:25Þ

where wmin is the minimum Hamming weight of all the data-words, i.e., data vectors, and Wmin is the number of data vectors with minimum Hamming weight wmin. Now, consider this question (“How can we decrease the transmission error?”), i.e., how can we decrease the value of Pe(W) in Eq. (2.25)?” Answer: To decrease Pe(W ) in Eq. (2.25), we need to increase the value of w2min . However, we cannot change the data to be transmitted. We should look for another solution. Consider that there is another set of m ¼ 2k vectors, but this vector set has a larger minimum Hamming weight. Instead of transmitting data vectors directly, we can make a mapping among the data vectors and the vectors available in other vector space and transmit the mapped vectors. And at the receiver side after demodulation operation, we can make de-mapping to recover the original data vectors. So this solution seems to be feasible. Now we can state the encoding operation.

2.6

Encoding and Decoding Operations

Assume that we have a k-dimensional data vector space denoted by W. We have 2k data vectors in this vector space. Consider another vector space V with dimension n such that n > k. Obviously the vector space with dimension n includes more vectors since 2n > 2k. Consider a k-dimensional subspace of V denoted by C called code. There are 2k code-words, i.e., vectors, in C. However, the vectors in C include n-bits, whereas the vectors in W include k-bits although the dimensions of both C and W are equal to the same number k. The mapping of the vectors from W to C is called encoding. Since the vectors in C include more bits than the vectors in W, by transmitting the mapped vectors, i.e., code-words, instead of the data vectors, it may be possible to decrease the transmission error, since it is possible to have a larger minimum distance for C compared to W. Once transmission of the code-words is complete, at the receiver side, we perform de-mapping of the code-words to the data vectors. The de-mapping of the received code-words to the data vectors at the receiver side is called decoding. The graphical illustration of the encoding and decoding operations is depicted in Fig. 2.2.

2.6 Encoding and Decoding Operations

K-dimensional data vector space

45

K-dimensional n-dimensional vector space code

v1

c1

v2

c2

cm + 2

cm

cN

vm

m = 2k

Encoding (Mapping)

n >k

K-dimensional data vector space

v1

cm +1

v2 Decoding (Mapping)

vm

m = 2k

N = 2n

Fig. 2.2 The graphical illustration of the encoding and decoding operations

Example 2.9 The k ¼ 2 dimensional data vector space is given as W ¼ ½00 01 10 11: The data vectors of W can be denoted as d1 ¼ ½00

d2 ¼ ½01

d3 ¼ ½10

d4 ¼ ½11:

n ¼ 3 dimensional vector space can be written as V ¼ ½000 001 010 011 100 101 110 111: A k ¼ 2 dimensional subspace of V, i.e., a k ¼ 2 dimensional code, is given as C ¼ ½000 001 100 101: A mapping operation, i.e., an encoding operation, and de-mapping operation, i.e., decoding operation, among data-words and code-words are illustrated in Fig. 2.3. Example 2.10 The dimensions of a data vector space and a vector space are k ¼ 8 and n ¼ 16, respectively. (a) (b) (c) (d)

How many data-words, i.e., vectors, are available in the data vector space? How many bits are available in the data vector space? How many vectors are available in the vector space? How many bits are available in the vector space?

Solution 2.10 (a) There are 2k ! 28 ¼ 256 data-words available in the data vector space. (b) There are k  2k ! 8  28 ¼ 2048 bits available in the data vector space.

46

2 Linear Block Codes

2-dimensional data vector space

2-dimensional code

v1 = [00]

c1 = [000]

v2 = [01]

c2 = [001]

v3 = [10]

c3 = [100] c4 = [101]

v4 = [11]

Encoding (Mapping)

m = 22 → m= 4

3-dimensional vector space

2-dimensional data vector space

c5 = [010]

v1 = [00]

c6 = [011] c7 = [110] c8 = [111]

v2 = [01] v3 = [10] Decoding (DeMapping)

3

N = 2 → N= 8

v4 = [11] m = 22

Fig. 2.3 Example for encoding and decoding operations

(c) There are 2n ! 216 ¼ 26  210 ! 216 ¼ 65,536 vectors available in the vector space. (d) There are n  2n ! 16  216 ¼ 24  216 ! 1,048,576 bits available in vector space. Example 2.11 We have two vector subspaces, i.e., codes, of dimension 1. The subspaces, i.e., codes, are given as C 1 ¼ ½0000 1010 C2 ¼ ½00000000 10101101: Compare the transmission error probability of the code-words available in these two codes. Solution 2.11 Assume that the bits are transmitted through the binary symmetric channel whose graphical illustration is shown in Fig. 2.4. The crossover probability of the binary symmetric channel is p ¼ Prob(y| x) ¼ 0.2. Assume that we use the first code C1 for transmission. Consider that we transmit the code-word 1010. If during the transmission two “1” flip, 000 will be available at the receiver. This is a transmission error that cannot be detected, and the probability of the transmission error can be calculated as pe ¼ 0:22  0:82 ! pe ¼ 0:0256:

ð2:26Þ

On the other hand, if we use the code C2 for transmission and transmit the codeword 10101101, a transmission error occurs if five “1” flips. And this transmission error cannot be detected at the receiver side. The probability of this transmission error can be calculated as

2.6 Encoding and Decoding Operations

47

Fig. 2.4 Binary symmetric channel with crossover probability p ¼ 0.2

0

1 – p = 0.8

0

p=0.2

y

x p= 0.2

1

1 – p = 0.8

qe ¼ 0:25  0:83 ! qe  0:000164:

1

ð2:27Þ

If we compare Eqs. (2.26) and (2.27), we see that qe pe.

2.6.1

Encoding Operation Using the Generator Matrix

Assume that we have k-dimensional data vector space, and a data vector in this vector space is given as di ¼ ½di1 di2 . . . d ik  i ¼ 1, 2 . . . , m where m ¼ 2k : We have a code of dimension n such that n > k, and the generator matrix of the code is given as 2

g1

3

6 7 6 g2 7 6 7 G¼6 7 6⋮7 4 5 gk

kn

where gi, i ¼ 1, . . ., k are the basis vectors of the code. The mapping of the datawords to code-words can be achieved using 2

g1

3

6 7 6 g2 7 6 7 ci ¼ di  G ! ci ¼ ½di1 di2 . . . d ik   6 7 ! ci ¼ di1 g1 þ d i2 g2 þ . . . þ dik gk 6⋮7 4 5 gk ð2:28Þ where the code-word ci is a vector having n-bits, and it can be written as ci ¼ ½ci1 ci2 . . . cin  i ¼ 1, 2 . . . , m

where m ¼ 2k :

ð2:29Þ

48

2 Linear Block Codes

When Eq. (2.28) is inspected, we see that the code-word is generated by taking the linear combination of the basis vectors considering the values of the bits in the data vector. Example 2.12 The generator matrix of a linear block code is given as 2

100011

3

6 7 7 G¼6 4 010100 5: 001010 (a) What is the dimension of the data vector space, i.e., k¼? How many data vectors are available? (b) What is the dimension of the code, i.e., n¼? How many code-words are available? (c) Write the basis vectors of the code. (d) Find the code-words after encoding the data-words d1 ¼ ½101 d2 ¼ ½111 d3 ¼ ½011 using the given generator matrix. Solution 2.12 (a–b) The size of the generator matrix is 3  6 which means that k ¼ 3 and n ¼ 6, and this implies that the dimension of the data vector space is 3 and the dimension of the vector space is 6. There are 2k ¼ 23 ! 8 data vectors and 2n ¼ 26 ! 64 vectors from which 8 of them are selected for subspace and used for encoding, i.e., mapping operation. (c) The basis vectors of the code are the rows of the generator matrix. The basis of the code can be written as B ¼ f100011, 010100, 001010g: (d) Employing ci ¼ d i  G for the given data-vectors, we obtain the code-words as c1 ¼ d 1  G ! 2 3 100011 6 7 7 c1 ¼ ½101  6 4 010100 5 ! 001010

2.7 Dual Code

49

c1 ¼ 1  ½100011 þ 0  ½010100 þ 1  ½001010 ! c1 ¼ ½101001 c2 ¼ d 2  G ! 2 3 100011 6 7 7 c2 ¼ ½111  6 4 010100 5 ! 001010 c2 ¼ 1  ½100011 þ 1  ½010100 þ 1  ½001010 ! c2 ¼ ½111101 c3 ¼ d 3  G ! 2 3 100011 6 7 7 c3 ¼ ½011  6 4 010100 5 ! 001010 c3 ¼ 0  ½100011 þ 1  ½010100 þ 1  ½001010 ! c3 ¼ ½011110:

2.7

Dual Code

We mentioned before that a code is a subspace of a vector space. A subspace has a dual subspace whose elements are orthogonal to the elements of the subspace. This means that a code has a dual code, and the dual code-words are orthogonal to the code-words. If the dimensions of the vector space and subspace equal to n and k, then the dimension of the dual subspace equals to n  k. This means that to construct a code, we construct k basis vectors out of the n basis vectors of the vector space, and the span of the k basis vectors is the code, and some n  k basis vectors can be used to construct the generator matrix of the dual code. Let’s illustrate the concept by an example. Example 2.13 The standard basis of a vector space V is given as Bs ¼ ½0000001 0000010 0000100 0001000 0010000 0100000 1000000: There are seven vectors in basis, and by taking the linear combinations of the basis vectors, we can generate 27 ¼ 128 vectors belonging to the vector space. By taking the linear combinations of the basis vectors in Bs, we can find another set of 7 linearly independent vectors which can be considered another basis for V. Note that a basis for a vector space V containing N elements is a set of n linearly independent vectors included in V such that N ¼ 2n.

50

2 Linear Block Codes

Considering the given information in the previous paragraph, another basis for V using the standard basis can be constructed as just changing the first element of Bs as Bs1 ¼ ½0000011 0000010 0000100 0001000 0010000 0100000 1000000: We can construct a code and its dual code as follows. A subset of Bs1 can be selected as Bs2 ¼ ½0000011 0100000 1000000: The elements of Bs2 can be used for the rows of a generator matrix of a block code as in 2

0000011

3

6 7 7 G¼6 4 0100000 5: 1000000 By taking the linear combinations of the rows of G, we obtain the code C ¼ ½0000000 0000011 0100000 1000000 0100011 1000011 1100000 1100011: Now, let’s construct the dual code. For this purpose, first, we write the basis vectors which appear in Bs1 and do not appear in Bs2 as ½0000010 0000100 0001000 0010000

ð2:30Þ

We can use all the vectors in Eq. (2.30) for the basis of the dual code. However, to make it a little bit different, let’s take the first row of the generator matrix and the elements [ 0000100 0001000 0010000] from Eq. (2.30) and form the basis of the dual code as Bs3 ¼ ½0000011 0000100 0001000 0010000 for which the linear independence rule still holds. By writing the elements of Bs3 as rows, we obtain the generator matrix as 2

0000011

3

7 6 6 0000100 7 7 6 H¼6 7: 6 0001000 7 5 4 0010000 By taking the linear combinations of the rows of H, we obtain the dual code as

2.8 Parity Check Matrix

51

Cd ¼ ½0000000 0010000

0000011 0000111

0000100 0001011

0001000 0010011

0001100

0010100

0011000

0001111

0010111

0110111

0010100

0011111:

If the code-words in C and dual code-words in Cd are inspected, we see that, for 8c 2 C and 8cd 2 Cd, we have c  cd ¼ 0. For instance, for c ¼ [1000011] and cd ¼ [0110111], we have c  cd ¼ ½1000011  ½0110111 ! c  cd ¼ 1  0 þ 0  1 þ 0  1 þ 0  0 þ 0  1 þ 1  1 þ 1  1 ! c  cd ¼ 0: Note that a code and its dual code may have common elements. In fact, even the dual of a code can be the code itself. Example 2.14 The dimensions of a vector space and the code obtained from the vector space are given as n ¼ 4 and k ¼ 2, respectively. Find a code such that its dual equals to the code itself. Solution 2.14 The required code can be generated trivially as C ¼ ½0000 0011 1100 1111: Property Let n be the dimension of a vector space. If the dimension of a code is k, then the dimension of the dual code is n  k.

2.8

Parity Check Matrix

Let C be a linear block code whose generator matrix is G with size k  n, and the dual code of C be Cd. The generator matrix of the dual code Cd denoted by H with size (n  k)  n is called the parity check matrix of the code C. We have G  HT ¼ 0

ð2:31Þ

where HT is the transpose of H, or with the explicit size information, we can write Gkn  H TnðnkÞ ¼ 0

ð2:32Þ

Example 2.15 The size of the parity check matrix of a linear block code is given as 4  10.

52

2 Linear Block Codes

(a) Find the dimension of the code, and find the number of code-words in the code. (b) How many vectors are available in the vector space? (c) Find the dimension of the dual code, and find the number of code-words in the dual code. (d) Write the size of the generator matrix of the code. Solution 2.15 Equating (n  k)  n to 4  10, we obtain k ¼ 6, n ¼ 10. (a) The dimension of the code is k ¼ 6, and the number of code-words can be calculated as 2k ! 26 ! 64: (b) The number of vectors in the vector space can be calculated as 2n ! 210 ! 1024: (c) The dimension of the dual code is n  k ¼ 10  6 ! 4. The number of dual code-words can be calculated as 2nk ! 24 ! 16: (d) The size of the generator matrix is k  n ¼ 6  10. Example 2.16 The standard basis of a vector space with dimension 5 is given as Bstd ¼ ½00001 00010 00100 01000 10000: Let’s denote the basis vectors of the standard basis as c1 ¼ ½00001

c2 ¼ ½00010 c3 ¼ ½00100 c4 ¼ ½01000 c5 ¼ ½10000:

Another basis for the vector space using the standard basis vectors can be formed as ½c1 c2 c3 c4 c5  ! ½c1 ðc2 þ c1 Þ ðc3 þ c1 Þ ðc4 þ c1 Þ ðc5 þ c1 Þ ! ½ c1 ð c2 þ c1 Þ ð c3 þ c1 Þ ð c4 þ c1 þ c2 Þ ð c5 þ c1 Þ  ! ½c1 ðc2 þ c1 Þ ðc3 þ c1 Þ ðc4 þ c1 þ c2 þ c3 Þ ðc5 þ c1 þ c3 Þ leading to Bs ¼ ½00001 00011 00101 01111 10101: Note that in Bs, there are no two identical basis vectors. Let’s selects a subset of Bs as

2.8 Parity Check Matrix

53

Bs1 ¼ ½00001 10101: The elements of Bs1 can be used to construct the generator matrix of a code as " G¼

00001 10101

# : 25

By taking all the possible linear combinations of the rows of the generator matrix G, we obtain the linear code C ¼ ½00000 00001 10101 10100: Now, let’s find the dual code. Let cd ¼ [a b c d e ] be a dual code-word. As we stated before, for 8c 2 C and 8cd 2 Cd, we have c  cd ¼ 0. Using the code-words in C for the equation c  cd¼0, we obtain the equation set d¼0

aþcþd ¼0

ð2:33Þ

a þ c ¼ 0: The solution of Eq. (2.33) can be found as 0X0X0

1X1X0

ð2:34Þ

where X 2 F ¼ {0, 1}. Considering all the possible values of X in Eq. (2.34), we can get the dual code as Cd ¼ ½00000 10100 10110 11100 11110 01000 00010 01010: Since Cd has eight dual code-words, we can trivially choose three independent vectors from Cd as the basis vectors, and writing the chosen vectors as the row of a matrix, we can form the generator matrix of the dual code as 2

10100

3

6 7 7 H¼6 4 10110 5 : 11100 35

ð2:35Þ

Notice that the rows of H are not available in Bs. Example 2.17 Let Bs be a basis of a vector space. Let’s select two subsets of Bs as Bs1 and Bs2 such that Bs ¼ Bs1 [ Bs2 and Bs1 \ Bs2 ¼ ϕ. If I choose the elements of Bs1 as the rows of a generator matrix of a code as, can I choose the elements of the Bs2 as the rows of the generator matrix of the dual code?

54

2 Linear Block Codes

Solution 2.17 If we choose the elements of Bs1 for the rows of a generator matrix, there is no guarantee that the elements of Bs2 can be chosen for the rows of the generator matrix of the dual code. It may work, or it may not work. If the basis Bs is a standard basis, then it works; otherwise, there is no guarantee. Theorem Let C be a linear block code whose generator and parity check matrices are Gk  n and H(n 2 k)  n. For any code-word c1  n 2 C, we have c1n  H TnðnkÞ ¼ 01ðnkÞ

ð2:36Þ

where 01  (n 2 k) is all-zero vector with (n  k) elements. Equation (2.36) can be written in a more compact form as cH T ¼ 0:

ð2:37Þ

Proof The parity check matrix H is the generator matrix of the dual code, and the rows of HT are a set of linearly independent dual code-words which can be used for the generation of all the other dual code-words via linear combination. Let’s represent H by 2

3 h1 6 h 7 6 2 7 H¼6 7 4 ⋮ 5 hnk where hi ¼ [hi1 hi2. . .hin] are the row vectors with length n. For a given code-word cj ¼ [cj1 cj2. . .cjn], the product cj  HT can be calculated as 2

h11 6   6 h12 cj  H T ¼ cj1 cj2 . . . cjn  6 4⋮

h21 h22 ⋮

3 hðnkÞ1 . . . hðnkÞ2 7 7 7! ⋮ 5

h1n

h2n

hðnkÞn

cj  HT ¼ cj  hT1 þ cj  hT2 þ . . . þ cj  hTnk where, employing the property c  cd ¼ 0, we obtain cj  HT ¼ 0, or in a more general form, we can write c  H T ¼ 0: Exercise Let C be a linear block code whose generator and parity check matrices are G and H. Show that G  H T ¼ 0:

ð2:38Þ

2.9 Systematic Form of a Generator Matrix

2.9

55

Systematic Form of a Generator Matrix

Using elementary row operations, the generator matrix of a linear block code can be put into the forms G ¼ ½I P or G ¼ ½P I

ð2:39Þ

which are called the systematic forms of the generator matrix. The size of the matrices I and P is k  k and k  (n  k), respectively. Out of these two forms, the first one, i.e., G ¼ [I P], is more widely used in the literature. Note that every generator matrix may not be put into systematic form using only elementary row operations. If the generator matrix is in systematic form, then using the formula c¼dG

ð2:40Þ

  c ¼ d  ½I P ! c ¼ ½d  I d  P ! c ¼ d dp

ð2:41Þ

we obtain the code-word

where dp ¼ d  P. The first k-bits of the code-word are data bits, and the next n  k bits are the parity bits. Example 2.18 The generator matrix of a linear block code is given as 2

10100

3

6 7 7 G¼6 4 01001 5: 01110 Obtain the systematic form of this generator matrix. Solution 2.18 Using only elementary row operations, we can get the systematic form of the generator matrix as 2

10100

3

6 7 7 G¼6 4 01001 5 : ðR3 01110 2

10100

3

6 7 G1 ¼ 4 01001 5 : ðR1 00111

2

10100

3

6 7 7 R2 þ R3Þ :! G1 ¼ 6 4 01001 5 00111  2 3 100  11  6 7 6 010  01 7 R1 þ R3Þ : ! Gs ¼ 6  7: 4 001  11 5 |{z}  |{z}  P32 I 33

We obtained the systematic form of the generator matrix in G ¼ [I P] model.

56

2 Linear Block Codes

Example 2.19 The generator matrix of a linear block code is given as " G¼

10001 00100

# :

Obtain the systematic form of this generator matrix. Solution 2.19 Using only elementary row operations, we cannot put the generator matrix into systematic form. On the other hand, if we do column permutations, we can obtain the systematic form as " G¼

10001 00100

#

" : ðC2 $ C3Þ : G0 ¼

10001 01000

# :

The obtained generator matrix G0 corresponds to a different code which is an equivalent code to the one that can be constructed using the matrix G. Example 2.20 The generator matrix of a linear block code is given as 2

10100

3

6 7 7 G¼6 4 11011 5: 01110 Obtain the systematic form of this generator matrix. Solution 2.20 Using only elementary row operations, we can get the systematic form of the generator matrix as 2

10100

3

6 7 7 G¼6 4 11011 5 : ðR3 01110 2 3 10100 6 7 7 G1 ¼ 6 4 11011 5 : ðR2 11010

2

10100

3

6 7 7 R1 þ R3Þ :! G1 ¼ 6 4 11011 5 11010 2

3 10100 6 7 R2 þ R3Þ :! G2 ¼ 4 00001 5

11010  2 3 2 3 10  100 10100 6 11  010 7  6 7 6 7 G2 ¼ 4 00001 5 : ðR2 $ R3Þ : ! Gs ¼ 6  7: 4 00  001 5 |{z}  |{z} 11010  I P We obtained the systematic form of the generator matrix in G ¼ [P I] form.

2.9 Systematic Form of a Generator Matrix

57

Note that some generator matrices can be put into G ¼ [I P], whereas some others can be put into G ¼ [P I] form, and some may not have systematic form.

2.9.1

Construction of Parity Check Matrix from Systematic Generator Matrix

If the generator matrix of a linear block code is in systematic form   Gkn ¼ Ikk PkðnkÞ

ð2:42Þ

then the parity check matrix of this code can be calculated as H ðnkÞn ¼ ½PTðnkÞk IðnkÞðnkÞ :

ð2:43Þ

Example 2.21 The generator matrix of a linear block code is given as 2

10011

3

6 7 7 G¼6 4 01001 5: 00111 Obtain the parity check matrix of this code. Solution 2.21 When the given generator matrix is inspected, we see that it is in the form G ¼ ½I P  where 2

100

3

2

11

3

6 7 6 7 7 6 7 I¼6 4 010 5 P ¼ 4 01 5: 001

11

The parity check matrix of the code can be obtained using the formula   H ¼ PT I as

58

2 Linear Block Codes

"

10110



#

11101

where " P ¼ T

101

"

# I¼

111

10

#

01

:

As an extra information, let’s calculate G  HT as 2

11

3

36 7 2 3 7 10011 6 00 6 01 7 6 76 7 6 7 T T 7 6 6 7 6 G  H ¼ 4 01001 56 11 7 ! G  H ¼ 4 00 7 5: 6 7 7 00111 6 00 4 10 5 01 2

We see that G  H T ¼ 0:

2.10

Equal and Equivalent Codes

Equal Codes Let G1 be the generator matrix of a linear block code. If we perform elementary row operations on G1 and obtain G2, the codes generated by G1 and G2 are said to be equal codes. This means that the same code-words are generated by both generator matrices, and data-words are mapped to the same code-word by both codes. Let’s give an example to illustrate this concept. Example 2.22 The generator matrix of a linear block code is given as 2

10011

3

6 7 7 Ga ¼ 6 4 01001 5: 00111 Adding the first row to the second row, and exchanging the second and third rows, we obtain the matrix

2.10

Equal and Equivalent Codes

59

2

10011

3

6 7 7 Gb ¼ 6 4 00111 5: 11010 Using the formula c ¼ d  G, we can obtain the code-words for all possible data-words for the matrices Ga and Gb as indicated in Table 2.1. When Table 2.1 is inspected, we see that the same set of code-words are generated by both generator matrices; however, the mapping between data-words and code-words are different for both codes. For instance, if da ¼ [110] and db ¼ [001], the encoding operations da  Ga and db  Gb yield the same code-word c ¼ [11010]. Equivalent Codes If we perform elementary row operations and column permutations on G1 and obtain G2, the code generated by G2 is said to be equivalent to the code generated by G1. Note that a code can have many equivalent codes, since many different column permutations are possible. Example 2.23 The generator matrix of a linear block code is given as 2

10010

3

6 7 7 Ga ¼ 6 4 01001 5: 00111 Adding the first row to the third row, and exchanging the second and fourth columns, we obtain the matrix 2

11000

3

6 7 7 Gb ¼ 6 4 00011 5: 10101 Using the formula c ¼ d  G, we can obtain the code-words for all possible data-words for the matrices Ga and Gb as indicated in Table 2.2. When Table 2.2 is inspected, we see that different sets of code-words are generated by both generator matrices.

60

2 Linear Block Codes

Table 2.1 Data-words and corresponding code-words

d 000 001 010 011 100 101 110 111

ca 00000 00111 01001 01110 10011 10100 11010 11101

cb 00000 11010 00111 11101 10011 01001 10100 01110

Table 2.2 Data-words and corresponding code-words

d 000 001 010 011 100 101 110 111

ca 00000 00111 01001 01110 10010 10101 11011 11100

cb 00000 10101 00011 10110 11000 01101 11011 01110

2.11

Finding the Minimum Distance of a Linear Block Code Using Its Parity Check Matrix

The minimum distance of a linear block code can be determined using the parity check matrix of the code. We know that for a given code-word c, we have c  HT ¼ 0 in which employing c ¼ [c1 c2. . .cn] and H ¼ ½l1 l2   ln 

ð2:44Þ

where lj, j ¼ 1, . . ., n are the column vectors consisting of (n  k) bits, we obtain c1  lT1 þ c2  lT2 þ . . . cn  lTn ¼ 0:

ð2:45Þ

When Eq. (2.45) is inspected, we see that the minimum distance of a linear block code equals to the minimum number of columns of the parity check matrix whose sum equals to zero. Note The linear block code obtained using the generator matrix Gk denoted as C(n, k).

 n

will be

2.12

Error Detection and Correction Capability of a Linear Block Code

61

Example 2.24 The size of the generator matrix of a linear block code is k  n ¼ 3  6. The parity check matrix of this code is in the form H ¼ ½l1 l2 l3 l4 l5 l6 : Let the minimum distance of the code be 3. Let c ¼ [0 0 1 1 0 1] be a code-word with minimum distance. Using the formula c  HT ¼ 0 we obtain 0  lT1 þ 0  lT2 þ 1  lT3 þ 1  lT4 þ 0  lT5 þ 1  lT6 ¼ 0 ! lT3 þ lT4 þ lT6 ¼ 0 where we see that the sum of the three, which is the minimum distance of the code, columns of the parity check matrix equals to zero. Example 2.25 The parity check matrix of a code is given as 2

1110100

3

6 7 7 H¼6 4 1101010 5: 1010001 Find the minimum distance of this code. Solution 2.25 The sum of the columns l1, l2, and l7 equals to zero. We cannot find any two columns whose sum equals to zero. Then, the minimum distance of the code is 3. Properties of Linear Block Codes Let C(n, k) be a linear block code with generator matrix Gk  n, and ci, cj 2 C(n, k) be two code-words. We have the properties 1. ci + cj 2 C(n, k). 2. All-zero code-word, i.e., 01  n, is an element of C(n, k).

2.12

Error Detection and Correction Capability of a Linear Block Code

Assume that a code-word is transmitted. At the receiver side, if the transmitted codeword is not received, we understand that some bit errors occurred during the transmission. This is called error detection. If we are able to identify the error locations, then it is possible to correct the bit errors. This is called error correction or forward error correction.

62

2 Linear Block Codes

The error correction and detection capability of a linear block code is related to the minimum distance of the code. Depending on the minimum distance value, only error detection or both error detection and correction can be possible. If the minimum distance of the linear block code C is dmin, then this code can detect t d ¼ d min  1

ð2:46Þ

bit errors and can correct  tc ¼

dmin  1 2

ð2:47Þ

bit errors, and bc is the floor function. Let r be the received word. We decide on the transmitted code-word at the receiver side using the formula

  c ¼ ci j dH ðr, ci Þ > d H r, cj j ¼ 1 . . . 2k , j 6¼ i

ð2:48Þ

  where dH ðr, ci Þ and d H r, cj indicate the Hamming distances between r and ci and between r and cj, respectively. Example 2.26 Consider the linear block code C ¼ ½0000 1111: The minimum distance of this code is dmin ¼ 4. The code-words are denoted as c1 ¼ [0000] and c2 ¼ [1111]. Assume that the code-word c ¼ [1111] is transmitted. Then, we have the following scenarios: Let’s say that a single-bit error occurs, and the received word is r ¼ ½1110. To find the transmitted code-word, we calculate the Hamming distance between the received word and the two candidate code-words in a sequential manner and choose the one which is closer to the received word in terms of Hamming distance. According to this information, we decide on the transmitted code-word as in dH ðr, c1 Þ ¼ 3

dH ðr, c2 Þ ¼ 1 ! the transmitted code  word is c2 :

Assume that two-bit errors occur, and the received word is r ¼ ½1100. The Hamming distances are dH ðr, c1 Þ ¼ 2 dH ðr, c2 Þ ¼ 2: Since Hamming distances are equal to each other, we cannot decide on the transmitted code-word. But we are sure that some errors occurred during

2.12

Error Detection and Correction Capability of a Linear Block Code

63

transmission, i.e., the availability of the errors is detected, since the received word is not a code-word. Assume that three-bit errors occur, and the received word is r ¼ ½1000. The Hamming distances are dH ðr, c1 Þ ¼ 1

dH ðr, c2 Þ ¼ 3:

We are sure that some errors occurred during transmission, i.e., the availability of the errors is detected. Since the received word is not a code-word, and considering the Hamming distances calculated, we choose the code-word c1 as the transmitted code-word. However, this decision is not correct, since c2 is transmitted. This means that if three-bit errors occur, we can detect the occurrence of the errors; however, we cannot decide on the transmitted code-word correctly, i.e., the erroneous bits cannot be corrected, and we make a wrong decision on the transmitted code-word. Assume that four-bit errors occurred, and the received word is r ¼ ½0000. Since r ¼ c1 , we accept that c1 is the transmitted code-word, and we assume that no errors occurred during the transmission. However, all our decisions are wrong. This means that if four error occurs during the transmission, we can neither detect nor correct the bit errors. Now, using Eqs. (2.46) and (2.47), let’s calculate the error detection and error correction capability of our code. Our code can detect t d ¼ dmin  1 ! t d ¼ 4  1 ! t d ¼ 3 bit errors and can correct  tc ¼

j k dmin  1 41 ! tc ¼ ! t c ¼ b1:5c ! t c ¼ 1 2 2

bit error, and obtained numbers coincide with the discussion we made for possible transmission scenarios. Example 2.27 Consider the linear block code C ¼ ½00000 11111: The minimum distance of this code is dmin ¼ 5. The code-words are denoted as c1 ¼ [00000 ] and c2 ¼ [11111 ]. Assume that the code-word c ¼ [11111 ] is transmitted. Now, using Eqs. (2.46) and (2.47), let’s calculate the error detection and error correction capability of our code. Our code can detect t d ¼ dmin  1 ! t d ¼ 5  1 ! t d ¼ 4 bit errors and can correct

64

2 Linear Block Codes

  d min  1 51 ! tc ¼ ! t c ¼ b 2c ! t c ¼ 2 tc ¼ 2 2 bit errors. Assume that the code-word c ¼ [11111] is transmitted. Let’s say that a single-bit error occurs, and the received word is r ¼ ½11110. Considering the Hamming distances, we decide on the transmitted code-word as dH ðr, c1 Þ ¼ 4

dH ðr, c2 Þ ¼ 1 ! the transmitted code  word is c2 :

Assume that two-bit errors occurred, and the received word is r ¼ ½11100. The Hamming distances are dH ðr, c1 Þ ¼ 3

dH ðr, c2 Þ ¼ 2 ! the transmitted code  word is c2 :

Assume that three-bit errors occurred, and the received word is r ¼ ½11000. The Hamming distances are dH ðr, c1 Þ ¼ 2

dH ðr, c2 Þ ¼ 3:

Considering the Hamming distances, we decide on c1 as the transmitted codeword. We are sure that some errors occurred during transmission, i.e., the availability of the errors is detected. Since the received word is not a code-word, and considering the Hamming distances calculated, we choose the code-word c1 as the transmitted code-word. However, this decision is not correct. Since c2 is transmitted. This means that if three-bit errors occur, we can detect the occurrence of the errors; however, we cannot decide on the transmitted code-word correctly, i.e., the erroneous bits cannot be corrected. Assume that four-bit errors occurred, and the received word is r ¼ ½10000. The Hamming distances are dH ðr, c1 Þ ¼ 1

dH ðr, c2 Þ ¼ 1:

Since Hamming distances are equal to each other, we cannot decide on the transmitted code-word. But we are sure that some errors occurred during transmission, i.e., the availability of the errors is detected, since the received word is not a code-word. Assume that five-bit errors occurred, and the received word is r ¼ ½00000. Since r ¼ c1 , we accept that c1 is the transmitted code-word and no errors occurred during the transmission. However, all our decisions are wrong. This means that if five errors occur during the transmission, we can neither detect nor correct the bit errors. We said that the error detection and correction capability of a linear block code can be calculated using the formulas 

t d ¼ d min  1

dmin  1 : tc ¼ 2

ð2:49Þ

2.12

Error Detection and Correction Capability of a Linear Block Code

65

However, this does not mean that more errors cannot be detected or corrected. The numbers obtained from these formulas are the guaranteed numbers. That means that for every case these numbers are valid. In fact, some code-words with minimum distances can correct or detect more errors than the ones indicated in these formulas. Let’s show it with an example. Example 2.28 Consider the linear block code given as C ¼ ½000000 111000 000111 111111: The minimum distance of this code is dmin ¼ 3. This code can detect t d ¼ dmin  1 ! t d ¼ 3  1 ! t d ¼ 2 bit errors, and can correct 

j k dmin  1 31 ! tc ¼ ! t c ¼ b 1c ! t c ¼ 1 tc ¼ 2 2 bit error. This means that two-bit errors can be detected and single-bit error can be corrected for every code-word, but this does not mean that some code-words cannot detect or correct more errors. For example, consider the transmission of the code-word c ¼ [111111], and assume that three-bit errors occurred and the received word is r ¼ ½101010. It is clear that r= 2C, and this implies that some errors occurred during the communication. As we see, more errors than dmin  1 can be detected for some code-words. Example 2.29 The generator matrix of a linear block code is given as 2

1001100

3

6 7 7 G¼6 4 0100011 5: 0010111 The code generated by this matrix can be obtained as C ¼ ½0000000 1001100 0100011 0010111 1101111 1011011 0110100 1111000: The code-words are denoted as c1 ¼ ½0000000 c2 ¼ ½1001100 c3 ¼ ½0100011 c4 ¼ ½0010111 c5 ¼ ½1101111 c6 ¼ ½1011011 c7 ¼ ½0110100 c8 ¼ ½1111000: The minimum distance of this code is dmin ¼ 3. This code can detect

66

2 Linear Block Codes

t d ¼ dmin  1 ! t d ¼ 3  1 ! t d ¼ 2 bit errors, and can correct 

j k dmin  1 31 tc ¼ ! tc ¼ ! t c ¼ b 1c ! t c ¼ 1 2 2 bit error. This means that 2-bit errors can be detected and 1-bit error can be corrected for every code-word, but this does not mean that more code-words cannot detect or correct more errors. For example, consider the transmission of the code-word c ¼ [0000000], and assume that two-bit errors occurred and the received word is r ¼ ½1000001. It is clear that r= 2C, and this implies that some errors occurred during the communication. The Hamming distances between the received word and code-words can be calculated as d H ðr, c1 Þ ¼ 2

dH ðr, c2 Þ ¼ 3

dH ðr, c3 Þ ¼ 3

d H ðr, c4 Þ ¼ 4

d H ðr, c5 Þ ¼ 4

dH ðr, c6 Þ ¼ 3

dH ðr, c7 Þ ¼ 5 d H ðr, c8 Þ ¼ 4:

Considering the calculated Hamming distances, we can decide on the transmitted code-word as c1, i.e., all-zero code-word. This result shows that more than 

dmin  1 2

ð2:50Þ

bit errors may be corrected; however, corrections are not guaranteed for every case. On the other hand, we are sure that every code-word can correct 

dmin  1 2



bit errors for sure. Example 2.30 The error correction capability of a linear block code is given as tc. What can be the minimum distance of this linear block code? Solution 2.30 If dmin is an odd number, i.e., dmin ¼ 2m + 1, then using the equation  tc ¼ we obtain

dmin  1 2



2.12

Error Detection and Correction Capability of a Linear Block Code

67

tc ¼ m which implies that dmin ¼ 2t c þ 1: On the other hand, if dmin is an even number, i.e., dmin ¼ 2m, then using the equation 

d 1 t c ¼ min 2



we obtain j k 1 tc ¼ m  ! tc ¼ m  1 2 which implies that dmin ¼ 2t c þ 2: In summary, for a given tc, the minimum distance of the code can be either equal to d min ¼ 2t c þ 1 or be equal to dmin ¼ 2t c þ 2: Example 2.31 If a linear block code can correct tc ¼ 5-bit errors, what can be the minimum distance of this linear block code? Solution 2.31 The minimum distance of the code can either be calculated as dmin ¼ 2t c þ 1 ! dmin ¼ 11 or it can be calculated as dmin ¼ 2t c þ 2 ! dmin ¼ 12:

68

2.13

2 Linear Block Codes

Hamming Spheres

Let v be a n-dimensional vector, i.e., word with n-bits. The sphere whose center is indicated by the vector v and its radius is determined by the Hamming distance r is called the Hamming sphere. A Hamming sphere has r orbits, and the vectors in each orbit have equal distance to the center. Example 2.32 Assume that we have a vector space V with dimension n ¼ 4. (a) Draw a Hamming sphere with radius r ¼ 1, and at the center of the sphere, all-zero vector resides. (b) Draw a Hamming sphere with radius r ¼ 2, and at the center of the sphere, all-zero vector resides. Solution 2.32 (a) For the Hamming sphere with radius r ¼ 1, there is a single orbit, and the words at this orbit have equal Hamming distance to the center, and the value of the Hamming distance is 1. The required Hamming sphere is drawn in Fig. 2.5. (b) In this case, there are two orbits with radiuses r1 ¼ 1 and r2 ¼ 2. The words at orbit-1 have equal distances r1 to the center, and the words at orbit-2 have equal distances r2 to the center. In the orbit-1, we have 4 ¼4 1 words, i.e., vectors, and in orbit-2, we have 4 ¼6 2 words. The required Hamming sphere is drawn in Fig. 2.6. Example 2.33 Assume that we have a vector space V with dimension n ¼ 4. Consider the Hamming sphere with radius r ¼ 4 around the all-zero vector. We can consider four different Hamming spheres with radiuses r1 ¼ 1

r2 ¼ 2

r3 ¼ 3

r 4 ¼ 4:

The Hamming sphere with radius r1 ¼ 1 has a single orbit, and the number of vectors in this orbit can be calculated using 4 : 1 The Hamming sphere with radius r2 ¼ 2 has two orbits, and the number of vectors in these orbits are

2.13

Hamming Spheres

69

Fig. 2.5 Hamming sphere with radius r ¼ 1

0010

0001

0000

r1 = 1 0100

1000

Fig. 2.6 Hamming spheres with radiuses r1 ¼ 1 and r2 ¼ 2

0011

1001

0110 0010

0001

0000 0101

1100

r1 = 1

0100

1000

r2 = 2 1010

4 4 and : 1 2 The total number of vectors in Hamming sphere with radius r2 ¼ 2 including the vector at the center can be calculated as 1þ

4 4 þ : 1 2

The Hamming sphere with radius r3 ¼ 3 has three orbits, and the number of vectors in these orbits are 4 4 4 and and : 1 2 3 The total number of vectors in Hamming sphere with radius r3 ¼ 3 is 1þ

4 4 4 þ þ : 1 2 3

The Hamming sphere with radius r4 ¼ 4 has four orbits, and the number of vectors in these orbits are

70

2 Linear Block Codes

4 4 4 4 and and and : 1 2 3 4 The total number of vectors in Hamming sphere with radius r4 ¼ 4 is 1þ

4 4 4 4 þ þ þ 1 2 3 4

which is equal to 2n ¼ 24, and this number is the total number of vectors in vector space V whose dimension is n ¼ 4. Example 2.34 The generator matrix of a linear block code is given as 2

1001100

3

6 7 7 G¼6 4 0100011 5: 0010111 Write all code-words. How many bit errors can this code correct, i.e., tc ¼ ? Draw Hamming spheres with radiuses tc around each code-word, and determine all the words inside each Hamming sphere. Solution 2.34 By taking all the possible linear combinations of the rows of the generator matrix, we can obtain the code C ¼ ½0000000 1001100 0100011 0010111 1101111 1011011 0110100 1111000 from which we can determine the minimum distance of the code as d min ¼ 3: The designed code can correct 

dmin  1 tc ¼ ! tc ¼ 1 2 bit error and can detect t d ¼ dmin  1 ! t d ¼ 2 bit errors. The Hamming spheres with radiuses r ¼ 1 around each code-word are depicted in Fig. 2.7. There are eight words inside each Hamming sphere including the code-word at the center. Since there are eight Hamming spheres, the total number of words inside the spheres equals to 8  8 ¼ 64. On the other hand, the number of words in the vector space equals to 27 ¼ 128. This means that 128  64 ¼ 64 words are available outside the spheres.

2.13

Hamming Spheres

71 1001101

0000001

1001110

0000010

1000000

0000000

r=1

0000100

0001000

0100000

1001100

0001100

r =1

1000100

1101100

1011100

0010000

0010110

0100010

0010101

0100001

1100011

0000011

0100011

r=1

0100111

0101011

1010111

0010111

r =1

0000111

1011011

1101110

1011011

1101101

1101111

r =1

1101011

1100111

1001111

1011011

1011011

r =1

1011011

1111001

0110101

1111010

0110110

0110100

r =1

0110000

0111100

0010100

1011011

1011011

1011011

1111111

1110100

0010011

0011111

0110111

0110011

0101111

1001000

0111000

1111000

r =1

1110000

1011000

0100100

Fig. 2.7 Hamming spheres with radius r ¼ 1 around code-words

1111100

1101000

72

2 Linear Block Codes

Assume that we design a code with 16 code-words, i.e., we have 16 Hamming spheres, then the total number of words inside the spheres would be 16  8 ¼ 128, and this means that all the words of the vector space are inside the Hamming spheres, i.e., no word is left outside the spheres.

2.13.1 The Total Number of Words Inside a Hamming Sphere with Radius r Given a vector space of dimension n, the number of words, i.e., vectors, inside a Hamming sphere with radius r can be calculated using r   X n NH ¼ : j j¼0

ð2:51Þ

Example 2.35 Considering a vector space of dimension n ¼ 8, calculate the total number of words inside a Hamming sphere with radius r ¼ 4. Solution 2.35 Using the formula NH ¼

r   X n j¼0

j

for the given values, we calculate the total number of words inside a Hamming sphere with radius r ¼ 4 as NH ¼

4   X 8 j¼0

2.14

j

! NH ¼

  8 0

þ

  8 1

þ

  8 2

þ

  8 3

þ

  8 4

! N H ¼ 163:

Some Simple Bounds for the Minimum Distances of Linear Block Codes

In this subsection, we will provide some bound expressions for dmin of linear block codes. Singleton Bound For a C(n, k) linear block code, the minimum distance is bounded by

2.14

Some Simple Bounds for the Minimum Distances of Linear Block Codes

d min n  k þ 1

73

ð2:52Þ

which is called singleton bound. Proof Consider a data-word of k-bits such that the Hamming weight of the dataword is 1, i.e., there is only a single one and all the other bits are zero. The systematic code-word obtained from this data-word contains n  k parity bits. If all the parity bits are equal to 1, the Hamming weight of the code becomes equal to n  k + 1, and this implies that d min n  k þ 1: Maximum Distance Separable Codes A linear block code C(n, k) is a maximum distance separable code if its minimum distance satisfies the equality d min ¼ n  k þ 1:

ð2:53Þ

For a maximum distance separable code, the Hamming spheres with code-words at their centers contain all the words of the vector space. No words are left outside the Hamming spheres. Example 2.36 The minimum distance of a linear block code C(n ¼ 10, k ¼ 5) is given as d min ¼ 8: Comment on the given minimum distance. Solution 2.36 The minimum distance of the code should satisfy the bound d min n  k þ 1: However, for the given parameters, we have dmin n  k þ 1 ! 8 10  5 þ 1 which is not correct. This means that for the given n and k values, it is not possible to design a linear block code with minimum distance dmin ¼ 8. Hamming Bound Assume that the linear block code C(n, k) can correct tc number of errors. The Hamming bound for this code is defined as tc   X n j¼0

j

2nk :

ð2:54Þ

74

2 Linear Block Codes

Proof The total number of words in the vector space, from which the linear block code is constructed, can be calculated as 2n. There are 2k code-words, and using these code-words, we can construct 2k Hamming spheres centered at the code-words. A Hamming sphere includes tc   X n

ð2:55Þ

j

j¼0

number of words. The total number of words inside all the Hamming spheres can be calculated as 2

k

tc   X n

ð2:56Þ

j

j¼0

where 2k indicates the number of Hamming spheres. Since the total number of words inside the Hamming spheres is smaller than or equal to the total number of words in the vector space, we can write the inequality 2

k

tc   X n

2n

ð2:57Þ

2nk

ð2:58Þ

j

j¼0

from which we obtain the inequality tc   X n j¼0

j

which is called the Hamming bound. Example 2.37 Using the Hamming bound for the code C(n ¼ 10, k) for which the minimum distance is given as dmin ¼ 5, determine the largest possible value of k. Solution 2.37 The error correction capability of the code can be calculated as 

d min  1 ! t c ¼ 2: tc ¼ 2 Using the given parameters, we can write the Hamming bound as 2

k

tc   X n j¼0

j

2 !2 n

k

 2  X 10 j¼0

When Eq. (2.59) is expanded, we obtain

j

210 : ð2:27Þ

ð2:59Þ

2.14

Some Simple Bounds for the Minimum Distances of Linear Block Codes

2k

75

1024 1024 ! 2k 18:2 ! k 4 ! 2k

10 10 56 ð10 Þ þ ð Þ þ ð Þ 0 1 2

from which it is clear that the largest value of k can be 4. Gilbert-Varshamov Bound There exists a linear block code C(n, k) with minimum distance dmin, if the bound

 



n1 n1 n1 < 2nk þ þ ... 0 1 dmin  1

ð2:60Þ

is satisfied for the given parameters. Using Eq. (2.60), we can obtain the bound 2n1  : 2k



n1 n1 n1 þ þ ... 0 1 dmin  1

ð2:61Þ

Example 2.38 Does there exist a linear block code C(n ¼ 5, k ¼ 2) with minimum distance dmin ¼ 4? Solution 2.38 Employing Eq. (2.61) for the given parameters, we obtain 22 4 0

þ

4 1

24 16  !4> 15 þ 42 þ 43

which is correct, and this means that a code exists with the given parameters. Plotkin Bound For a linear block code C(n, k), the minimum distance satisfies the bound d min n

2k1 2k  1

ð2:62Þ

which is called the Plotkin bound. For large k values, the Plotkin bound can be approximated as n dmin  : 2

ð2:63Þ

76

2 Linear Block Codes

Problems 1. What is a vector space? State the properties of a vector space. 2. What is a subspace? How do we determine whether a vector space is a subspace or not? 3. What is a linear block code? Is it a subspace or an ordinary vector set? 4. The prime field F3 is defined as F 3 ¼ f0, 1, 2g

þ ! Mod  3 addition ! Mod  3 multiplication: Assume that, using the field elements, we construct a vector space with dimension 4, and v1 and v2 are two vectors chosen from this vector space. We calculate the subtraction of these two vectors as v1  v3 :

ðP2:1Þ

Is Eq. (P2.1) a meaningful operation? 5. A linear block code should always include all-zero code-word as one of its codewords. Is this statement correct or not? If it is correct, then why it is correct, and explain it. If it is not correct, then explain why it is not correct. 6. Using the binary field elements, construct a vector space with dimension 4, and from this vector space, find a subspace with dimension 3. 7. Write the standard basis elements of a vector space with dimension 5, and using the standard basis, generate three different bases of this vector space. 8. What is encoding? Explain it very briefly without mentioning any formula. 9. What is decoding? Explain it very briefly without mentioning any formula. 10. Why do we do encoding and decoding operations? Explain the reasoning behind them. 11. Assume that we have two binary linear block codes with the same dimension and length, i.e., code-words include the same number of bits and the number of code-words in both codes is the same. Which one do you choose? And which criteria is important in your choice? 12. The generator matrix of a binary linear block code is given as 2

101001

3

6 7 7 G¼6 4 110110 5: 101101

Problems

77

Determine all the code-words for this code, and calculate the Hamming weight of each code-word. What is the minimum distance of this code? 13. The generator matrix of a binary linear block code is given as 2

1001001

3

7 6 6 1110010 7 7 6 G¼6 7: 6 1010100 7 5 4 1001001 Find the systematic form of this matrix and determine the parity check matrix of this code. 14. A binary subspace with dimension 2 is given as B ¼ f10010, 01010, 00110, 10001g: Find a dual space of this subspace. 15. The parity check matrix of a code is the generator matrix of its dual code. Is this statement correct or not? 16. The parity check matrix of a code is given as 2

1001100

3

7 6 6 0110100 7 7 6 H¼6 7: 6 1011010 7 5 4 1011001 Find the generator matrix of this code. 17. The generator matrix of a code is given as 2

1001001

3

6 7 7 G¼6 4 1110010 5: 1010110 (a) How many data-words can be encoded using this generator matrix? (b) What is the dimension of the vector space from which this code is constructed? (c) What is the dimension of code?

78

2 Linear Block Codes

(d) How many vectors are available in the vector space from which this code is generated? (e) How many code-words are available in this code? 18. The parity check matrix of a binary linear block code is given as 2

1001100

3

6 7 7 H¼6 4 1100111 5: 1011100 Find the minimum distance of this code. 19. If I sum two code-words belonging to a linear block code, I obtain another codeword. Explain the reasoning behind this statement. 20. The minimum distance of a linear block code is given as d min ¼ 7: (a) How many errors can this code detect? (b) How many errors can this code correct? 21. The error correction capability of a linear block code is tc ¼ 5. What can be the minimum distance of this code? 22. We are informed that a linear block code can correct tc ¼ 3 bit errors. Does this mean that four errors can never be corrected? Explain your reasoning behind your answer. 23. Consider a vector space with dimension 5. Write all the vectors of this vector space. Locate all the vectors of this vector space on Hamming spheres with different radiuses, and at the center of the innermost Hamming sphere, we have the all-zero vector. 24. The minimum distance of a linear block code C(n ¼ 15, k ¼ 7) is given as dmin ¼ 10. Comment on the correctness of this minimum distance using the singleton bound. 25. What is maximum distance separable code? Explain it. 26. Write the Hamming bound formula. 27. Using the Hamming bound formula for the code C(n ¼ 16, k) for which the minimum distance is given as dmin ¼ 6, determine the largest possible value of k.

Chapter 3

Syndrome Decoding and Some Important Linear Block Codes

3.1

Syndrome Decoding of Linear Block Codes

In this section, we will explain the decoding of linear block codes using syndromes. Cosets of a Linear Clock Code The binary field F is given as F ¼ f0, 1g  ! Mod  2 addition operation  ! Mod  2 multiplication operation: Let V be an n-dimensional vector space constructed using the elements of binary field and C be k-dimensional linear block code which is a subspace of V. We can write the code C as C ¼ ½ c1 c2 . . . cM 

ð3:1Þ

where ci, i ¼ 1, 2, . . ., M are the code-words consisting of n-bits and M ¼ 2k. The number of words in the vector space V can be calculated as N ¼ 2n. Let w be a word which appears in V , and it does not appear in C and in the previously formed cosets. A coset of C is obtained as Cs ¼ w  C ! Cs ¼ ½ðw  c1 Þ ðw  c2 Þ . . . ðw  cM Þ:

ð3:2Þ

The cosets of C contain the same number of elements as C. The total number of cosets of C can be calculated as

© Springer Nature Switzerland AG 2020 O. Gazi, Forward Error Correction via Channel Coding, https://doi.org/10.1007/978-3-030-33380-5_3

79

80

3 Syndrome Decoding and Some Important Linear Block Codes

2n  1 ! 2nk  1: 2k

ð3:3Þ

While determining w, we pay attention to choose it among the words having smallest Hamming weights, and the first element of a coset is called coset leader. Example 3.1 A linear block code C(n ¼ 4, k ¼ 3) is given as C ¼ ½0000 1001 1101 0111 0100 1110 1010 1011: Find all the cosets of C. Solution 3.1 There is 2nk  1 ¼ 243  1 ! 1 coset, and we can find the single coset of C as let w ¼ ½1000 and w 2 V, w= 2C ! Cs ¼ w  C ! Cs ¼ ½1000  0000 1000  1001 1000  1101 1000  0111 1000  0100 1000  1110 1000  1010 1000  1011 ! Cs ¼ ½1000 0001 0101 1111 1100 0110 0010 0011: It is clear that the vector space can be written as V ¼ C [ Cs : Example 3.2 A linear block code C(n ¼ 4, k ¼ 2) is given as C ¼ ½0000 1001 0101 1100 : Find all the cosets of C. Solution 3.2 There are 2nk  1 ¼ 242  1 ! 3 cosets, and we can find the cosets of C as follows: The first coset can be found as

ð3:4Þ

3.2 Standard Array

81

let w ¼ ½1000 and w 2 V, w= 2C ! Cs1 ¼ w  C ! Cs1 ¼ ½1000  0000 1000  1001 1000  0101 1000  1100  ! Cs1 ¼ ½1000 0001 1101 0100 : The second coset can be found as let w ¼ ½0010 and w 2 V, w= 2C, w= 2Cs1 ! Cs2 ¼ w  C ! Cs2 ¼ ½0010  0000 0010  1001 0010  0101 0010  1100  ! Cs2 ¼ ½0010 1011 0111 1110 : The third coset can be found as let w ¼ ½1010 and w 2 V, w= 2C ! Cs3 ¼ w  C ! Cs3 ¼ ½1010  0000 1010  1001 1010  0101 1010  1100  ! Cs3 ¼ ½1010 0011 1111 0110 : It is clear that the vector space can be written as V ¼ C [ Cs1 [ Cs2 [ Cs3 :

3.2

ð3:5Þ

Standard Array

Using the code and its cosets, we can form a matrix such that the first row of the matrix is the code and the other rows are cosets. This matrix is also called standard array. For instance, using the code and cosets of the previous example, we can form a standard array as

82

3 Syndrome Decoding and Some Important Linear Block Codes

2

C

: 0000 1001 0101 1100

3

7 6 6 Cs1 : 1000 0001 1101 0100 7 7 6 SA ¼ 6 7: 6 Cs2 : 0010 1011 0111 1110 7 5 4 Cs3 : 1010 0011 1111 0110

ð3:6Þ

The standard array contains 2n  k rows and 2k columns, and the total number of elements in the standard array equals to 2n  k  2k ¼ 2n which is the total number of elements in the vector space. Note that as we have mentioned before, the first element in each coset is called the coset leader. For a tc error-correcting linear block code, we draw a horizontal line in the standard array to separate the rows whose coset leaders have Hamming weights less than or equal to tc from the rows whose coset leaders have Hamming weight greater than tc. Example 3.3 The generator matrix of a linear block code is given as " G¼

10111

#

01101

: 25

Find the code generated by this generator matrix, and find the cosets of the code and construct the standard array. Solution 3.3 The code generated by G can be obtained as C ¼ ½00000 10111 01101 11010: The minimum distance of this code is d min ¼ 3: This code can detect t d ¼ dmin  1 ! t d ¼ 3  1 ! t d ¼ 2 bit errors and can correct  tc ¼ bit error.

 j k dmin  1 31 ! tc ¼ ! t c ¼ b 1c ! t c ¼ 1 2 2

3.2 Standard Array

83

Table 3.1 Standard array for Example 3.3

For the obtained code, we have 2n  k  1 ¼ 25  2  1 ! 7 cosets. The size of the standard array, i.e., matrix, is 2n  k  2k ¼ 8  4, and the total number of elements in the standard array is 32. Now, let’s form the standard array as follows. First, we write the code as the first row of the array as in Table 3.1. To determine the first coset, we first determine w which has the smallest Hamming weight. In fact, while determining the words w, we pay attention to the errorcorrecting capability of the code and select the words w such that, if possible, their Hamming weights are smaller than or equal to tc. Considering this, we can choose w ¼ [10000], and determine the first coset as w ¼ ½10000 and w 2 V, w= 2C ! Cs1 ¼ w  C ! Cs1 ¼ ½10000  00000 10000  10111 10000  01101 10000  11010 ! Cs1 ¼ ½10000 00111 11101 01010 : Placing the first coset into the second row, we update the standard array as in Table 3.2. The second coset can be found as let w ¼ ½01000 and w 2 V, w= 2C, w= 2Cs1 ! Cs2 ¼ w  C ! Cs2 ¼ ½01000  00000 01000  10111 01000  01101 01000  11010  ! Cs2 ¼ ½01000 11111 00101 10010: Placing the second coset into the third row, we get the standard array as in Table 3.3.

84

3 Syndrome Decoding and Some Important Linear Block Codes

Table 3.2 Standard array formation for Example 3.3

Table 3.3 Standard array formation for Example 3.3

The third coset can be found as let w ¼ ½00100 and w 2 V, w= 2C, w= 2Cs1 , w= 2Cs2 ! Cs3 ¼ w  C ! Cs3 ¼ ½00100  00000 00100  10111 00100  01101 00100  11010  ! Cs3 ¼ ½00100 10011 01001 11110: Placing the third coset into the fourth row, we get the standard array as in Table 3.4. The fourth coset can be found as let w ¼ ½00010 and w 2 V, w= 2C, w= 2Csi , i ¼ 1, . . . , 3 ! Cs4 ¼ w  C ! Cs4 ¼ ½00010  00000 00010  10111 00010  01101 00010  11010  !

3.2 Standard Array

85

Table 3.4 Standard array formation for Example 3.3

Table 3.5 Standard array formation for Example 3.3

Cs4 ¼ ½00010 10101 01111 11000: Placing the fourth coset into the fifth row, we get the standard array as in Table 3.5. The fifth coset can be found as let w ¼ ½00001 and w 2 V, w= 2C, w= 2Csi , i ¼ 1, . . . , 4 ! Cs5 ¼ w  C ! Cs5 ¼ ½00001  00000 00001  10111 00001  01101 00001  11010  ! Cs5 ¼ ½00001 10110 01100 11011: Placing the fifth coset into the sixth row, we get the standard array as in Table 3.6. For the sixth coset, there is no word w left with the Hamming weight “1.” Then, we need to search a word w with Hamming weight “2” such that it should not be available in Table 3.6. Considering this, we can choose w ¼ [00011] and determine the sixth coset as

86

3 Syndrome Decoding and Some Important Linear Block Codes

Table 3.6 Standard array formation for Example 3.3

w ¼ ½00011 and w 2 V, w= 2C, w= 2Csi , i ¼ 1, . . . , 5 ! Cs6 ¼ w  C ! Cs6 ¼ ½00011  00000 00011  10111 00011  01101 00011  11010  ! Cs6 ¼ ½00011 10100 01110 11001: Placing the sixth coset into the seventh row, we get the standard array as in Table 3.7. For the seventh coset, we need to search a word w with Hamming weight 2 such that it should not be available in Table 3.7. Considering this, we can choose w ¼ [00110] and determine the sixth coset as w ¼ ½00110 and w 2 V, w= 2C, w= 2Csi , i ¼ 1, . . . , 6 ! Cs7 ¼ w  C ! Cs7 ¼ ½00110  00000 00110  10111 00110  01101 00110  11010  ! Cs7 ¼ ½00110 10001 01011 11100: Placing the seventh coset into the eighth row, we get the standard array as in Table 3.8. If we omit the leftmost column of Table 3.8, and draw a horizontal line below to the coset leaders with Hamming weight less than or equal to tc, we get the final form of standard array as in Table 3.9.

3.3 Error Correction Using Standard Array

87

Table 3.7 Standard array formation for Example 3.3

Table 3.8 Standard array formation for Example 3.3

C Cs1 Cs2 Cs3 Cs4 Cs5 Cs6 Cs7

00000 10000 01000 00100 00010 00001 00011 00110

10111 00111 11111 10011 10101 10110 10100 10001

01101 11101 00101 01001 01111 01100 01110 01011

11010 01010 10010 11110 11000 11011 11001 11100

Table 3.9 Standard array formation for Example 3.3

00000 10000 01000 00100 00010 00001 00011 00110

3.3

10111 00111 11111 10011 10101 10110 10100 10001

01101 11101 00101 01001 01111 01100 01110 01011

11010 01010 10010 11110 11000 11011 11001 11100

Error Correction Using Standard Array

The code whose standard array is given in Table 3.9 can correct single errors, and the first row of the table is the code; the other rows are the cosets of this code. We can use the standard array for error correction operations. Let’s illustrate the concept by an example.

88

3 Syndrome Decoding and Some Important Linear Block Codes

Table 3.10 Transmitted and received words

00000 10000 01000 00100 00010 00001 00011

00111 11111 10011 10101

01101 11101 00101 01001 01111 01100

11010 01010 10010 11110 11000 11011

Example 3.4 Assume that the code-word c1 ¼ [10111] is transmitted, and during transmission, a single-bit error occurs. Assume that the error word is e ¼ [00001]. Then, the received word happens to be r ¼ c1 + e ! r ¼ [10110] where the erroneous bit is indicated by a . The transmitted code-word and the received word are indicated in bold-black and bold-red colors in Table 3.10. The received word is an element of a coset that is above the bold line, and looking at the coset leader, we can determine the error word as e ¼ [00001]. This is illustrated in Table 3.11. Adding the error word to the received word, we find the transmitted code-word. That is c ¼ r þ e ! c ¼ ½10110 þ ½00001 ! c ¼ ½10111: Now, assume that c1 ¼ [10111] is transmitted, and during transmission, two-bit errors occur. Assume that the error word is e ¼ [00011]. Then, the received word happens to be r ¼ c1 þ e ! r ¼ ½10100: The transmitted code-word and the received word are indicated in bold-black and bold-red colors in Table 3.12. The received word is an element of a coset, and looking at the coset leader, we can determine the error word as e ¼ [00011]. This is illustrated in Table 3.12. Adding the error word to the received word, we find the transmitted code-word. That is c ¼ r þ e ! c ¼ ½10100 þ ½00011 ! c ¼ ½10111: Although our code is a single-error-correcting code, we were able to correct two-bit errors using the standard array.

3.3 Error Correction Using Standard Array

89

Table 3.11 Determination of coset leader

00000 10000 01000 00100 00010

00111 11111 10011 10101

00011

01101 11101 00101 01001 01111 01100

11010 01010 10010 11110 11000 11011

Table 3.12 Case of two-bit errors

00000 10000 01000 00100 00010 00001

00111 11111 10011 10101 10110

01101 11101 00101 01001 01111 01100

11010 01010 10010 11110 11000 11011

Now, assume that c1 ¼ [10111] is transmitted, and during transmission, two-bit errors occur. Assume that the error word is e ¼ [01001]. Then, the received word happens to be r ¼ c1 þ e ! r ¼ ½11110: The transmitted code-word and the received word are indicated in bold-black and bold-red colors in Table 3.13. The received word is an element of a coset, and looking at the coset leader, we can determine the error word as e ¼ [00100]. This is illustrated in Table 3.13. Adding the error word to the received word, we find the transmitted code-word as shown in Table 3.13. That is c ¼ r þ e ! c ¼ ½11110 þ ½00100 ! c ¼ ½11010: However, this result is wrong. As we see, our code couldn’t correct two-bit errors. Our code can correct single-error bits for sure. However, more errors can sometimes be corrected also, but this can happen only for some specific cases.

90

3 Syndrome Decoding and Some Important Linear Block Codes

Table 3.13 Case of two-bit errors

00000 10000 01000 00010 00001

3.4

00111 11111 10011 10101 10110

01101 11101 00101 01001 01111 01100

01010 10010 11000 11011

Syndrome

Let c be a code-word transmitted, and r is the received word such that r ¼ c + e where e is the error word. We know that c  H T ¼ 0:

ð3:7Þ

r  HT ¼ 0

ð3:8Þ

The Eq. (3.7) implies that if

then we accept that no error did occur during the transmission, and r ¼ c. On the other hand, if r  H T 6¼ 0

ð3:9Þ

then we understand that some bit errors occurred during the transmission. Definition The syndrome for the received word r is defined as s ¼ r  HT :

ð3:10Þ

If s ¼ 0, then we accept that no error occurred during the transmission; otherwise, we accept that some errors occurred during the transmission. If we substitute r ¼ c + e in Eq. (3.10), we get s ¼ ðc þ eÞ  H T ! s ¼ |fflfflffl{zfflfflffl} c  HT þ e  HT ! s ¼ e  HT : ¼0

That is, we can define the syndrome for the received word r as

3.4 Syndrome

91

s ¼ e  HT :

ð3:11Þ

Example 3.5 The dimension of a vector space is given as n ¼ 6. Using this vector space, a linear block code is designed, and the parity check matrix of this linear block code is provided as   H ¼ hT1 hT2 hT3 hT4 hT5 hT6 where hTi , i ¼ 1, . . . , n are the column vectors of length n  k where k ¼ 3. Assume that the designed code is a single-error-correcting code. Using single-error pattern e1 ¼ ½100000 a syndrome of this code is calculated as 2

h1

3

6 7 6 h2 7 6 7 6 7 6 h3 7 6 7 s1 ¼ e1  H T ! s1 ¼ ½100000  6 7 ! s1 ¼ h1 : 6 h4 7 6 7 6 7 6 h5 7 4 5 h6

ð3:12Þ

For the other single-error patterns e2 ¼ ½010000 e3 ¼ ½001000 e4 ¼ ½000100 e5 ¼ ½000010 e6 ¼ ½000001 using si ¼ ei  HT, we can calculate the syndromes as s2 ¼ h2

s3 ¼ h3

s4 ¼ h4

s5 ¼ h5

s6 ¼ h6 :

ð3:13Þ

From Eqs. (3.12) and (3.13),we see that for single-error-correcting codes, the syndromes are columns of parity check matrix transposed. Assume that the designed code is a double-error-correcting code. For single-error patterns, the syndromes happen to be the columns of the parity check matrix. On the other hand, for double-error patterns, the syndromes are obtained by summing any two columns of the parity check matrix considering the error pattern. For instance, if the error pattern is e1 ¼ ½100001, the syndrome is calculated as

92

3 Syndrome Decoding and Some Important Linear Block Codes

2

h1

3

6 7 6 h2 7 6 7 6 7 6 h3 7 6 7 T s1 ¼ e1  H ! s1 ¼ ½100001  6 7 ! s1 ¼ h1 þ h6 : 6 h4 7 6 7 6 7 6 h5 7 4 5

ð3:14Þ

h6 If the designed code can correct tc errors, then a syndrome equals to the sum of tc columns of parity check matrix. For instance, for three-error-correcting code, the syndrome for the error pattern e1 ¼ ½011001 is calculated as 2

h1

3

6 7 6 h2 7 6 7 6 7 6 h3 7 6 7 T s1 ¼ e1  H ! s1 ¼ ½011001  6 7 ! s1 ¼ h2 þ h3 þ h6 6 h4 7 6 7 6 7 6 h5 7 4 5

ð3:15Þ

h6 which is the sum of the transposed three columns of parity check matrix.

3.4.1

Syndrome Table

Standard array may be difficult to construct for some codes. Instead syndrome table is used for its easiness. Syndrome table can be accepted as a concise representation of the standard array. For a tc-bit error-correcting code, we can construct a syndrome table including all the error patterns with Hamming weights tc, and using the syndrome table, we can correct the transmission bit errors. We can construct a table involving 2n  k  1 rows just as we construct the standard array. However, for those error patterns involving more than tc-bit errors, correction is not guaranteed. For this reason, we usually construct the syndrome table for those error patterns with Hamming weights less than or equal to tc.

3.4 Syndrome

93

Example 3.6 Let’s construct the syndrome table of a single-error-correcting code whose parity check matrix is given as 2

011100

3

6 7 7 H¼6 4 101010 5: 110001 Although our code is a single-error-correcting code, let’s construct the syndrome table such that it contains 2n  k  1 rows. First, considering all the single-error patterns, and using the equation s ¼ e  HT, we can construct part of the table as in Table 3.14. Now, let’s choose the double-error pattern as e ¼ ½000011: If we calculate the syndrome using s ¼ e  HT, we obtain s ¼ ½011: However, this syndrome appears in the last row of the table. For this reason, we should change the error pattern. In fact, we should continue trying the error patterns until we obtain a syndrome not appearing in the table. If we choose the double-error pattern as e ¼ ½001001 and calculate the syndrome using s ¼ e  HT, we obtain s ¼ ½111: Thus, our complete syndrome table happens to be as in Table 3.15. If we choose other error patterns involving two or more “1’s,” the generated syndromes will be a replica of those available in the second column of Table 3.15. For instance, if we choose the error pattern as e ¼ [110001], we obtain the syndrome s ¼ ½111. Interestingly, for some error patterns involving more than one “1,” we can calculate the syndrome as s ¼ [000] which means error-free transmission. However, this is not correct. The reason for obtaining zero syndromes for nonzero error patterns is that the error patterns are beyond the error correction capability of our code. For instance, for error pattern e ¼ [100011], the syndrome happens to be s ¼ [000].

94

3 Syndrome Decoding and Some Important Linear Block Codes

Table 3.14 Syndrome table for Example 3.6

000001 000010 000100 001000 010000 100000

=

× 001 010 100 110 101 011

Table 3.15 Syndrome table for Example 3.6

3.5

s ¼ e  HT 001 010 100 110 101 011 111

e 000001 000010 000100 001000 010000 100000 001001

Syndrome Decoding

Assume that we transmit the code-word c, and r ¼ c + e is the received word. To identify the error pattern e at the receiver side, we can employ syndrome decoding which needs the syndrome table of the linear block code. The syndrome decoding operation is outlined as follows: Syndrome Decoding 1. Using the received word and parity check matrix of the linear block code, calculate the syndrome s ¼ r  HT :

ð3:16Þ

2. Locate the calculated syndrome in the syndrome table and find the corresponding error pattern e. 3. Perform the error correction operation using

3.5 Syndrome Decoding

95

c ¼ r þ e:

ð3:17Þ

Example 3.7 The parity check matrix of a single-error-correcting linear block code is given as 2

001011

3

6 7 7 H¼6 4 101100 5: 110001 (a) Obtain the syndrome table of this code. (b) Assume that the code-word c ¼ [100111] is transmitted. Determine the decoder’s estimate about the transmitted code-word when c incurs the error patterns: 1. e1 ¼ [010000]

2) e2 ¼ [110000] 3) e3 ¼ [011010]

4) e4 ¼ [011101].

Solution 3.7 (a) Our code is a single-error-correcting code, and for this reason, it is sufficient to use only single-error patterns while constructing the syndrome table. First, we place the single-error patterns to the left column as shown in Table 3.16. In the sequel, we calculate the syndromes using s ¼ e  HT and place them into the right column. Note that for single-error patterns, syndromes are the transposed columns of the parity check matrix. For instance, for the error pattern e ¼ [100000], the syndrome is the transpose of the first column of the parity check matrix, i.e., the syndrome is 2

3T

2 3T 0 6 7 6 7 7 6 7 s ¼ ½100000  6 4 101100 5 ! s ¼ 4 1 5 ! s ¼ ½011: 110001 1 001011

When all the syndromes are calculated and placed to the right column, we get the syndrome Table 3.17. (b) Using the error pattern e1 ¼ [010000], the received word is calculated as r ¼ c þ e1 ! r ¼ ½100111 þ ½010000 ! r ¼ ½110111: At the receiver side, we first calculate the syndrome using the received word as

96

3 Syndrome Decoding and Some Important Linear Block Codes

Table 3.16 Syndrome table formation for Example 3.7

e 000001 000010 000100 001000 010000 100000

s ¼ e  HT

Table 3.17 Syndrome table for Example 3.7

e 000001 000010 000100 001000 010000 100000

s ¼ e  HT 101 100 010 110 001 011

2

001011

3T

6 7 7 s ¼ r  H T ! s ¼ ½110111  6 4 101100 5 ! 110001 2 3T 2 3T 2 3T 2 3T 2 3T 0 0 0 1 1 6 7 6 7 6 7 6 7 6 7 7 6 7 6 7 6 7 6 7 s¼6 415 þ 405 þ 415 þ 405 þ 405 ! 1 1 0 0 1 2 3T 0 6 7 6 s ¼ 407 5 ! s ¼ ½001: 1 Since syndrome is not equal to zero vector, we understand that bit errors did occur during the transmission. That is, errors are detected. We search the syndrome in the syndrome table and find the corresponding error pattern. This is illustrated in Table 3.18. In the last stage, we add the error pattern found from the syndrome table to the received word to correct the transmission errors as c ¼ r þ e ! c ¼ ½110111 þ ½010000 ! c ¼ ½100111:

ð3:18Þ

3.5 Syndrome Decoding

97

Table 3.18 Syndrome table

 000001 000010 000100 001000

101 100 010 110

When we inspect the code-word in Eq. (3.18), we see that it is the correct transmitted code-word. Since a single-bit error did occur during the transmission, our code was able to correct it. 2. Using the error pattern e2 ¼ [110000], the received word is calculated as r ¼ c þ e2 ! r ¼ ½100111 þ ½110000 ! r ¼ ½010111: At the receiver side, we first calculate the syndrome using the received word as 2

001011

3T

6 7 7 s ¼ r  H T ! s ¼ ½010111  6 4 101100 5 ! s 110001 2 3T 2 3T 2 3T 2 3T 0 0 1 1 6 7 6 7 6 7 6 7 7 6 7 6 7 6 7 ¼6 405 þ 415 þ 405 þ 405 ! 1 0 0 1 2 3T 0 6 7 7 s¼6 4 1 5 ! s ¼ ½010: 0 Since syndrome is not equal to zero vector, we understand that bit errors did occur during the transmission. That is, errors are detected. We search the syndrome in the syndrome table and find the corresponding error patter. This is illustrated in Table 3.19. In the last stage, we add the error pattern found from the syndrome table to the received word to correct the transmission errors as

98

3 Syndrome Decoding and Some Important Linear Block Codes

Table 3.19 Determination of error pattern using syndrome table

000001 000010

101 100

001000

110

c ¼ r þ e ! c ¼ ½010111 þ ½000100 ! c ¼ ½010011:

ð3:19Þ

For the word obtained in Eq. (3.19), we check c  H T ¼ 0 condition to determine whether the obtained word is a code-word or not. The obtained word satisfies the condition c  H T ¼ 0. That means that it is a code-word. However, we see that it is NOT the correct transmitted code-word. Since two-bit errors did occur during the transmission, our code was NOT able to correct it. 3. Using the error pattern e3 ¼ [011010], the received word is calculated as r ¼ c þ e3 ! r ¼ ½100111 þ ½011010 ! r ¼ ½111101: At the receiver side, we first calculate the syndrome using the received word as 2

001011

3T

6 7 7 s ¼ r  H T ! s ¼ ½111101  6 4 101100 5 ! 110001 2 3T 2 3T 2 3T 2 3T 2 3T 0 0 1 0 1 6 7 6 7 6 7 6 7 6 7 7 6 7 6 7 6 7 6 7 s¼6 415 þ 405 þ 415 þ 415 þ 405 ! 1 1 0 0 1 2 3T 0 6 7 7 s¼6 4 1 5 ! s ¼ ½011: 1 Since syndrome is not equal to zero vector, we understand that bit errors did occur during the transmission. That is, errors are detected. We search the syndrome in the

3.5 Syndrome Decoding

99

syndrome table and find the corresponding error pattern. This is illustrated in Table 3.20. In the last stage, we add the error pattern found from the syndrome table to the received word to correct the transmission errors as follows: c ¼ r þ e ! c ¼ ½111101 þ ½100000 ! c ¼ ½011101:

ð3:20Þ

For the word obtained in Eq. (3.20), we check c  HT ¼ 0 condition to determine whether the obtained word is a code-word or not. The obtained word satisfies the condition c  HT ¼ 0. That means it is a code-word. However, we see that it is NOT the correct transmitted code-word. Since three-bit errors did occur during the transmission, our code was NOT able to correct it. 4. Using the error pattern e4 ¼ [011101], the received word is calculated as r ¼ c þ e4 ! r ¼ ½100111 þ ½011101 ! r ¼ ½111010: At the receiver side, we first calculate the syndrome using the received word as 2

001011

3T

6 7 7 s ¼ r  H T ! s ¼ ½011010  6 4 101100 5 ! s ¼ ½000: 110001 We see that s ¼ [000], and this means that no error did occur during the transmission. However, this is wrong result. Since four-bit errors occurred during the transmission, our code was not able to detect or correct the errors.

Table 3.20 Case of three errors

000001 000010 000100 001000

101 100 010 110

100

3 Syndrome Decoding and Some Important Linear Block Codes

Example 3.8 The parity check matrix of a linear block code is given as 2

0010110

3

7 6 6 1011000 7 7 6 H¼6 7: 6 1100010 7 5 4 1111111 Find the syndrome corresponding to the error pattern e ¼ ½0100101: Solution 3.8 When the syndrome equation s ¼ e  HT is used for the given error pattern and parity check matrix, we obtain 2 3T 2 3T 2 3T 1 0 0 6 7 6 7 6 7 607 607 607 6 7 6 7 6 7 s ¼ 6 7 þ 6 7 þ 6 7 ! s ¼ ½1011 607 607 617 4 5 4 5 4 5 1 1 1 where the it is seen that the transposed column vectors are chosen according to the indexes of the “1’s” appearing in the error pattern, i.e., “1’s” appear at the 2. , 5. ,and 7. positions in the error vector, and we choose the columns at the 2. , 5. ,and 7. positions in the parity check matrix.

3.6

Some Well-Known Linear Block Codes

In this section, we will provide a brief information about some linear block codes well-known in the literature.

3.6.1

Single Parity Check Codes

The generator matrix of a single parity check code is given as

3.6 Some Well-Known Linear Block Codes

101

 3 100 00  1  6 010 00  1 7  7 6 G¼6  7 4 ⋮ ⋮5  000 01  1 2

:

ð3:21Þ

kn

When the data-word d ¼ ½d 1 d 2 . . . d k 

ð3:22Þ

is encoded using the generator matrix in Eq. (3.21), we obtain c ¼ d  G ! c ¼ ½d1 d 2 . . . d k p where p ¼ d 1 þ d2 þ . . . d k :

ð3:23Þ

Example 3.9 The generator matrix of a single parity check code is given as  3 1000  1  7 6 6 0100  1 7  7 6 G¼6  7 : 6 0010  1 7  5 4  0001  1 45 2

Find the parity check matrix of this code. Solution 3.9 If G is in the form G ¼ [I| P], then the parity check matrix is obtained as   H ¼ PT jI : Accordingly, we get the parity check matrix as H ¼ ½1111j115 :

3.6.2

Repetition Codes

The generator matrix of a repetition code is given as G ¼ ½11 . . . 11n : When the data bit

ð3:24Þ

102

3 Syndrome Decoding and Some Important Linear Block Codes

d ¼ ½d 1 

ð3:25Þ

is encoded using the generator matrix in Eq. (3.24), we obtain c ¼ d  G ! c ¼ ½d1 d 1 . . . d 1 :

ð3:26Þ

Example 3.10 The generator matrix of a repetition code is given as G ¼ ½11111 Find the parity check matrix of this code. Solution 3.10 If G is in the form G ¼ [I| P], then the parity check matrix is obtained as   H ¼ PT jI : Accordingly, we get the parity check matrix as 3 2   1  1000 7 6  6  0100 7 7 61  7 : H¼6 7 6  6 1  0010 7 5 4   1  0001 45

3.6.3

Golay Code

The Golay code is discovered in the late of 1940s. The generator matrix of the Golay code is in the form G ¼ ½IjP1224

ð3:27Þ

where I is the identity matrix with size 12  12, P is the parity matrix with size 12  12, and it is defined as

3.6 Some Well-Known Linear Block Codes

2

011111111111

103

3

7 6 6 111011100010 7 7 6 7 6 6 110111000101 7 7 6 7 6 6 101110001011 7 7 6 7 6 6 111100010110 7 7 6 7 6 6 111000101101 7 7 6 P¼6 7: 6 110001011011 7 7 6 7 6 6 100010110111 7 7 6 7 6 6 100101101110 7 7 6 7 6 6 101011011100 7 7 6 7 6 6 110110111000 7 5 4

ð3:28Þ

101101110001 The Golay code is self-dual code, that is, GGT ¼ 0. The Hamming weight of any code-word is a multiple of 4, i.e., the Hamming weights of the code-words can be 0, 8, 12, 16, or 24. The minimum distance of the Golay code is 8, and this means that the Golay code is a three-error-correcting linear block code. Golay codes were used for the encoding and decoding of the science and engineering data in Voyager 1 and Voyager 2 spacecrafts which were launched toward Jupiter and Saturn in 1977. Exercise Find the number of rows and columns for the standard array of the Golay code.

3.6.4

Reed-Muller Codes

Reed-Muller code is a block code C(n, k) whose code parameters k and n are calculated according to k ¼ m þ 1 n ¼ 2m where m is an integer such that m 1. A Reed-Muller code is indicated by RM ðmÞ: The generator matrix of the Reed-Muller code RM(1) is defined as

ð3:29Þ

104

3 Syndrome Decoding and Some Important Linear Block Codes

" G1 ¼

11 01

# :

The generator matrix of the Reed-Muller code RM(m) is calculated in a recursive manner as " Gm ¼

Gm 2 1

Gm 2 1

0...0

1...1

"

# ! Gm ¼

Gm 2 1 Gm 2 1 0

1

# :

ð3:30Þ

The minimum distance of the Reed-Muller code RM(m) is d min ¼ 2m1

ð3:31Þ

which implies that the error detection and correction capability of the Reed-Muller code RM(m) can be calculated using t d ¼ 2m1  1

ð3:32Þ

and  tc ¼

 2m1  1 : 2

ð3:33Þ

Example 3.11 Find the generator matrices of the Reed-Muller codes RM(2), RM(3), and determine minimum distances of the corresponding codes. Solution 3.11 Using the G1 matrix which is given as " G1 ¼

11

#

01

and employing the recursion " Gm ¼

Gm 2 1 Gm 2 1 0

#

1

for m ¼ 2 and m ¼ 3, we obtain the generator matrices of the Reed-Muller codes RM (2), RM(3) as

3.6 Some Well-Known Linear Block Codes

" G2 ¼

G1 G1

#

0 1

105

2

11 11

3

2

1111

3

6 7 6 7 7 6 7 ! G2 ¼ 6 4 01 01 5 ! G2 ¼ 4 0101 5 00 11 0011

and 2 " G3 ¼

G2 G2 0 1

#

1111 1111

3

2

11111111

3

7 7 6 6 6 0101 0101 7 6 01010101 7 7 7 6 6 ! G3 ¼ 6 7 ! G3 ¼ 6 7: 6 0011 0011 7 6 00110011 7 5 5 4 4 0000 1111 00001111

The minimum distances of the Reed-Muller codes RM(2), RM(3) can be calculated using the formula d min ¼ 2m1 as dmin ¼ 221 ! d min ¼ 2 and d min ¼ 231 ! dmin ¼ 4: Exercise Find the generator matrix of RM(4) and find its minimum distance.

3.6.5

Hamming Codes

Hamming codes are single-error-correcting linear block codes. For a Hamming code C(n, k), the code parameters k and n are calculated according to n ¼ 2m  1 k ¼ n  m

ð3:34Þ

where m is an integer such that m 2. In Eq. (3.34), using the second equation, i.e., using k ¼ n  m, we can also write that m¼nk

ð3:35Þ

106

3 Syndrome Decoding and Some Important Linear Block Codes

which indicates the number of parity bits used for the transmission of data-word consisting of k-bits. The parity check matrix of the Hamming code C(n, k) can be constructed by placing all the m-bit words as the columns of H. Example 3.12 Obtain the parity check and generator matrices of the Hamming code for which m ¼ 3. Solution 3.12 Using m ¼ 3 bits, we can write 7 nonzero bit vectors, and these vectors and their integer equivalents can be listed as 001 ! 1 010 ! 2 011 ! 3 100 ! 4 101 ! 5 110 ! 6 111 ! 7: We construct the parity check matrix of the Hamming code by placing the transpose of the binary equivalents of the digits listed in the previous paragraph as columns of the matrix, that is, we obtain the parity check matrix as 2

1 6 6# 6 H¼6 60 6 40 1

2 #

3 4 # #

5 #

6 #

0

0 1

1

1

1 0

1 0 1 0

0 1

1 0

3 7 2 3 7 0001111 #7 7 6 7 6 7 17 7 ! H ¼ 4 0110011 5: 7 15 1010101 1

ð3:36Þ

The order of the columns of the parity check matrix is not an important issue. For this reason, while we construct the parity check matrix of the Hamming code, we prefer to construct it in the form   H ¼ PT jI

ð3:37Þ

3.6 Some Well-Known Linear Block Codes

107

which can be used to find the generator matrix of the code in the form G ¼ [I| PT]. Considering this issue, we can construct the parity check matrix of the Hamming code with parameter m ¼ 3 as in  3    7 6 6 3 5 6 7 4 2 17  7 6 2 3 6 # # # # # # #7 0111100  7 6  6 7 7 6 H ¼ 6 0 1 1 1  1 0 0 7 ! H ¼ 4 1011010 5:  7 6 6 1 0 1 1 0 1 07 1101001  7 6  7 6 4 1 1 0 1 0 0 15 |fflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflffl} |fflfflfflfflffl{zfflfflfflfflffl}  I PT 2

ð3:38Þ

Permuting the columns of PT in Eq. (3.38), it is possible to write 4 ! ¼ 24 different parity check matrices in systematic form. However, all the generated matrices have the same error-correcting capability. Hence, it is sufficient to construct one of them. The generator matrix of the Hamming code corresponding to the parity check matrix in Eq. (3.38) can be obtained using the equation G ¼ [I| P] as  3 1000  011  7 6 6 0100  101 7  7 6 G¼6  7: 6 0010  110 7  5 4  0001  111 2

It can also be verified that G  H T ¼ 0:

ð3:39Þ

Example 3.13 Find the parity check matrix and generator matrix of the Hamming code in systematic form for m ¼ 4. Solution 3.13 The parity check matrix of the required Hamming code can be constructed using the bit vectors containing m ¼ 4 bits as the columns of the matrix. Note that the order of the column vectors is not an important issue. We can form the systematic form of the parity check matrix as

108

3 Syndrome Decoding and Some Important Linear Block Codes

2 6 6 3 5 6 7 9 10 11 12 13 14 15 6 6# # # # # # # # # # # 6 6 60 0 0 0 1 1 1 1 1 1 1 H¼6 60 1 1 1 0 0 0 1 1 1 1 6 6 61 0 1 1 0 1 1 0 0 1 1 6 61 1 0 1 1 0 1 0 1 0 1 4|fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl} PT

                   

3 7 17 7 #7 7 7 1 0 0 07 7! 0 1 0 07 7 7 0 0 1 07 7 0 0 0 17 |fflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflffl}5 8 4 # #

2 #

I

 3 00001111111  1000  6 01110001111  0100 7  6 7 H¼6  7: 4 10110110011  0010 5  11011010101  0001 2

3.7

ð3:40Þ

Non-Systematic Form of Generator and Parity Check Matrices of the Hamming Codes

Let G and H be the generator and parity check matrices of a Hamming code. The matrices G, H are denoted as   G ¼ ½g1 g2 . . . gn kn H ¼ hT1 hT2 . . . hTn ðn 2 kÞn

ð3:41Þ

 T where gi ¼ [gi1 gi2. . .gik]T, i ¼ 1. . .n and hTi ¼ hi1 hi2 . . . hiðnkÞ are column vectors. Employing G  HT ¼ 0 in Eq. (3.41), we obtain

3.7 Non-Systematic Form of Generator and Parity Check Matrices of the Hamming Codes 109

2

3 h1 6h 7 6 27 ½g1 g2 . . . gn   6 7 ¼ 0 ! g1  h1 þ g2  h2 þ . . . gn  hn ¼ 0: 4⋮5

ð3:42Þ

hn Assume that the parity check matrix of a Hamming code is in non-systematic form. To obtain the generator matrix corresponding to this parity check matrix, we benefit from Eq. (3.42). That is, to find the generator matrix corresponding to a non-systematic parity check matrix, first, we obtain the systematic form of H using column permutations only and note the permutation information. Next, using the systematic form of H, we can obtain the systematic form of the generator matrix G. In the last step, we apply the inverse permutation information on the columns of G and obtain the generator matrix in non-systematic form. Example 3.14 The non-systematic parity check matrix of a Hamming code is given in Eq. (3.43). Obtain the generator matrix corresponding to the parity check matrix in Eq. (3.43) 2

1

6 6# 6 H¼6 60 6 40 1

2

3 4

5

6

# 0

# # 0 1

# 1

# 1

1

1 0

0

1

0

1 0

1

0

7

3

2 3 7 0001111 #7 7 6 7 6 7 17 7 ! H ¼ 4 0110011 5: 7 15 1010101 1

ð3:43Þ

Solution 3.14 Using column permutations, we put the parity check matrix into the systematic form as in Eq. (3.44)    63 5 6 7  6  6  6 6# # # #  6  6 Hs ¼ 6 0 1 1 1   6  6 61 0 1 1  6  6 41 1 0 1 |fflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflffl}  T

3

2

P

17 7 7 2 3 7 # # #7 0111100 7 6 7 7 7 1 0 0 7 ! Hs ¼ 6 4 1011010 5: 7 7 0 1 07 1101001 7 7 0 0 15 |fflfflfflfflffl{zfflfflfflfflffl} 4

2

I

The permutation information is noted as in Fig. 3.1. Using Eq. (3.44), we obtain the generator matrix in systematic form as

ð3:44Þ

110

3 Syndrome Decoding and Some Important Linear Block Codes

Fig. 3.1 Permutation information

1

1

2

2

3

3

4

4

5

5

6

6

7

7

 3 1000  011  6 0100  101 7  6 7 Gs ¼ 6  7: 4 0010  110 5  0001  111 2

In the last step, we perform reverse permutation operation on the columns of Gs. We consider a new matrix Gns of the same size as Gs, and column 7 of Gs is used as column 1 of Gns, column 6 of Gs is used as column 2 of Gns, column 2 of Gs is used as column 3 of Gns, and so on resulting in   3 2 3 1000  011 1110  000   6 0100  101 7 6 1001  100 7   6 7 6 7 Gs ¼ 6   7 ! Gns ¼ 6 7: 4 0010  110 5 4 0101  010 5   0001  111 1101  001 2

3.8

Extended Hamming Codes

Let H be the parity check matrix of a Hamming code. The parity check matrix of the extended linear block code is obtained adding a row vector consisting of all ones and adding a column vector consisting of all zeros as shown in

3.8 Extended Hamming Codes

111

If G is the generator matrix corresponding to H, the generator matrix corresponding to He is obtained by concatenating a column vector to G, and the bits of the column are obtained by summing the bits in each row of G. Example 3.15 The parity check matrix of a Hamming code is given as 2

0111100

3

6 7 7 H¼6 4 1011010 5: 1101001 Extend the given Hamming code and obtain the parity check and generator matrices of the extended Hamming code. Solution 3.15 First, we concatenate all zero vectors as the column of the parity check matrix as shown in 2

0111100

3

2

01111000

3

6 7 6 7 H ¼ 4 1011010 5 ! H e1 ¼ 4 10110100 5: 1101001 11010010 Next, we concatenate all ones vectors as the last row of the parity check matrix as in 2

H e1

3

2

01111000

3

01111000 7 6 6 10110100 7 6 7 7 6 6 7 ¼ 4 10110100 5 ! H e ¼ 6 7: 6 11010010 7 5 4 11010010 11111111

The generator matrix corresponding to the parity check matrix H can be obtained as 2

1000011

3

7 6 6 0100101 7 7 6 G¼6 7: 6 0010110 7 5 4 0001111

112

3 Syndrome Decoding and Some Important Linear Block Codes

Summing the rows of G and concatenating it as the last column of the generator matrix, we can get the generator matrix of the extended Hamming code as in 2

1000011 ! 1 þ 0 þ 0 þ 0 þ 0 þ 1 þ 1 ! 1

3

2

10000111

3

7 7 6 6 6 0100101 ! 0 þ 1 þ 0 þ 0 þ 1 þ 0 þ 1 ! 1 7 6 01001011 7 7 7 6 6 Ge ¼ 6 7 ! Ge ¼ 6 7: 6 0010110 ! 0 þ 0 þ 1 þ 0 þ 1 þ 1 þ 0 ! 1 7 6 00101101 7 5 5 4 4 0001111 ! 0 þ 0 þ 0 þ 1 þ 1 þ 1 þ 1 ! 0 00011110 If we check the equation Ge  H Te ¼ 0 we see that it is satisfied, i.e., 2

0111

3

7 6 6 1011 7 7 6 7 2 3 3 6 2 6 1101 7 0000 10000111 7 6 7 7 6 7 6 6 6 01001011 7 6 1111 7 6 0000 7 7 7 6 7 6 6 7: 7¼6 76 6 6 00101101 7 6 1001 7 6 0000 7 5 7 4 5 6 4 7 6 7 6 0000 00011110 6 0101 7 7 6 6 0011 7 5 4 0001

3.9

Syndrome Decoding of Hamming Codes

Hamming codes are single-error-correcting codes. Due to this reason, for the construction of syndrome tables, it is sufficient to consider only single-error patterns, and for the single-error patterns, the syndromes correspond to the columns of the parity check matrix.

3.10

Shortened and Extended Linear Codes

113

Example 3.16 The parity check matrix of a Hamming code is given as 2

0111100

3

6 7 7 H¼6 4 1011010 5: 1101001 Obtain the syndrome table of this Hamming code. Solution 3.16 Considering only single-error patterns, we can construct the syndrome table as in Table 3.21 where it is clear that the syndromes are the columns of the parity check matrix.

3.10

Shortened and Extended Linear Codes

Code Shortening Using a designed linear block code C(n, k), it is possible to obtain a shortened code Cðn  i, k  iÞ:

ð3:45Þ

If G and H are the generator and parity check matrices of the linear block code C(n, k), the generator matrix of the shortened code C(n  i, k  i) can be obtained by omitting the first i rows and columns of G, and the parity check matrix of the shortened code is obtained by omitting the first i columns of H. Example 3.17 The generator and parity check matrices of C(9, 5) linear block code are given as 2

3

3 2 011101000 7 6 6 010001101 7 7 6 7 6 6 110100100 7 7 6 7 6 7 G¼6 7: 6 001001011 7 H ¼ 6 6 101110010 7 7 6 5 4 6 000101110 7 5 4 111010001 000010011 100000111

Using code shortening, obtain the generator and parity check matrices of the linear block code C(7, 3). Solution 3.17 Omitting the first two rows and columns of G, we get the generator matrix of the shortened code as

114

3 Syndrome Decoding and Some Important Linear Block Codes

Table 3.21 Syndrome table for Example 3.16

s ¼ e  HT 001 010 100 111 110 101 011

e 0000001 0000010 0000100 0001000 0010000 0100000 1000000

2

100000111

3

7 6 2 3 6 010001101 7 1001011 7 6 7 6 6 7 7 6 7 G¼6 6 001001011 7 ! Gr ¼ 4 0101110 5: 7 6 6 000101110 7 0010011 5 4 000010011 Omitting the first two columns of H, we get the parity check matrix of the shortened code as 2

011101000

3

2

1101000

3

7 7 6 6 6 0100100 7 6 110100100 7 7 7 6 6 H¼6 7: 7 ! Hr ¼ 6 6 1110010 7 6 101110010 7 5 5 4 4 1010001 111010001 We can verify that Gr  H Tr ¼ 0: Code Extension A linear block code C(n, k) can be extended to another linear block code Cðn þ 1, k Þ:

ð3:46Þ

If G and H are the generator and parity check matrices of the linear block code C(n, k), the generator matrix of the extended code C(n + 1, k) can be obtained by concatenating a column to the last column of G, and the concatenated column is obtained by summing all the other columns, i.e., by summing the bits in each row separately.

3.10

Shortened and Extended Linear Codes

115

Example 3.18 The generator matrix of C(9, 5) linear block code is given as 2

100000111

3

7 6 6 010000101 7 7 6 7 6 6 G ¼ 6 001001011 7 7 7 6 6 000101011 7 5 4 000011010 Using code extension, obtain the generator matrix of the linear block code C(10, 5). Solution 3.18 We can obtain the generator matrix of the extended code C(10, 5) as 2

100000111 ! 1 þ 0 þ 0 þ 0 þ 0 þ 0 þ 1 þ 1 þ 1 ! 0

3

7 6 6 010000101 ! 0 þ 1 þ 0 þ 0 þ 0 þ 0 þ 1 þ 0 þ 1 ! 1 7 7 6 7 6 6 G ¼ 6 001001011 ! 0 þ 0 þ 1 þ 0 þ 0 þ 1 þ 0 þ 1 þ 1 ! 0 7 7! 7 6 6 000101011 ! 0 þ 0 þ 0 þ 1 þ 0 þ 1 þ 0 þ 1 þ 1 ! 1 7 5 4 000011010 ! 0 þ 0 þ 0 þ 1 þ 0 þ 1 þ 0 þ 1 þ 1 ! 0 3 2 1000001110 7 6 6 0100001011 7 7 6 7 6 6 ð3:47Þ Ge ¼ 6 0010010110 7 7: 7 6 6 0001010111 7 5 4 0000110100 Since the generator matrix of the extended code in Eq. (3.47) has systematic form, the parity check matrix can easily be found using the equation H ¼ [PT| I] as 2

0011110000

3

7 6 6 1100001000 7 7 6 7 He ¼ 6 6 1011100100 7: 7 6 4 1111000010 5 0101000001

ð3:48Þ

116

3 Syndrome Decoding and Some Important Linear Block Codes

Problems 1. The generator matrix of a binary linear block code is given as 2

100110

3

6 7 7 G¼6 4 110011 5: 101101 Find all the code-words, and construct the standard table for this code. 2. The generator matrix of a binary linear block code is given as 2

1001100

3

6 7 7 G¼6 4 1100111 5: 1111011 Determine the standard array of the dual code. 3. The generator matrix of a binary linear block code is given as 2

11010101

3

6 7 7 G¼6 4 01001010 5: 10111010 Obtain the syndrome table of this code. 4. The parity check matrix of a single-error-correcting binary linear block code is given as 2

0010111

3

6 7 7 H¼6 4 0101011 5: 1001101 (a) Obtain the syndrome table of this code.

Problems

117

(b) Find the generator matrix of this code, and encode the data-word d ¼ [1011]. (c) For part (b), assume that during the transmission, a single-bit error occurs, and the error pattern is given as e ¼ [0010]. Determine the decoder’s estimate using the syndrome table. 5. Find the generator and parity check matrices of the Reed-Muller code for m ¼ 4. Determine the minimum distance of this code. 6. Determine the generator and parity check matrices of the Hamming code for r ¼ 3, and obtain the parity check matrix of the extended Hamming code. 7. Syndromes are noting but the linear combinations of the transposed columns of the parity check matrix according to the error patterns. Determine whether this statement is correct or not. 8. What is the minimum distance of a Golay code? 9. The generator matrix of a linear block code C(7, 3) is given as 2

11100100

3

6 7 7 G¼6 4 01011010 5: 11101101 (a) (b) (c) (d) (e) (f)

Determine the systematic form of the given generator matrix. Find the parity check matrix. Find the minimum distance of the code. Decide on the error detection and correction capability of this code. Construct the syndrome table of this code. Extend this code to a C(8, 3) linear block code. Find the generator and parity check matrices of the extended code.

10. The parity check matrix of a linear block code C(7, 4) is given as 2

1110100

3

6 7 7 H¼6 4 0111010 5: 1101001 (a) (b) (c) (d)

Find the generator matrix in systematic form. Find the minimum distance of the code using the parity check matrix. Decide on the error detection and correction capability of this code. Let tc be the number of bit errors that the code can correct. Determine the number of words inside a Hamming sphere of radius tc; at the center of the sphere, a code-word exists. (e) Construct the syndrome table of this code.

118

3 Syndrome Decoding and Some Important Linear Block Codes

(f) Extend this code to a C(8, 4) linear block code. Find the generator and parity check matrices of the extended code, and besides, find the minimum distance of the extended code. (g) Decide on the error detection and correction capability of the extended code. (h) Verify the singleton and Hamming bounds for this code and its extended version.

Chapter 4

Cyclic Codes

4.1

Cyclic Codes

Before explaining the cyclic codes, let’s briefly explain the cyclic shift operation. Cyclic Shift Let C(n, k) be a linear block code, and c ¼ [cn  1. . .c1 c0] be a code-word. A cyclic leftward shift of c is defined as CLSðcÞ ¼ ½cn2 . . . c0 cn1 :

ð4:1Þ

Similarly, a cyclic rightward shift of c is defined as CRSðcÞ ¼ ½c0 cn1 . . . c2 c1 :

ð4:2Þ

Cyclic Code A linear block code C(n, k) is a cyclic code if a cyclic shift of any code-word produces another code-word of C(n, k). Example 4.1 The linear block code given as C ¼ ½000 110 101 011 is a cyclic code. We can verify that 8c 2 C, CLS(c) 2 C and CRS(c) 2 C; for instance, CLSð 110Þ ! 101 2 C

© Springer Nature Switzerland AG 2020 O. Gazi, Forward Error Correction via Channel Coding, https://doi.org/10.1007/978-3-030-33380-5_4

119

120

4 Cyclic Codes

CRSð 011Þ ! 101 2 C: Note that for a linear block code, the sum of any two code-words produces another code-word, and this property is also valid for cyclic codes, since cyclic codes are a class of linear block codes. Example 4.2 The linear block code C ¼ ½0000000 1011100 0101110 0010111 1110010 0111001 1001011 1100101 is a cyclic code. We can verify that 8c 2 C, CLS(c) 2 C and CRS(c) 2 C; for instance, CLSð 1011100Þ ! 0111001 2 C CRSð 1001011Þ ! 1100101 2 C:

4.2

Polynomials and Cyclic Codes

An n-bit word w ¼ [an  1. . .a1 a0] can be represented in polynomial form as wðxÞ ¼ an1 xn1 þ an2 xn2 þ . . . a0 x0 :

ð4:3Þ

Example 4.3 The word w1 ¼ [0110010] can be represented in polynomial form as w1 ðxÞ ¼ 0  x6 þ 1  x5 þ 1  x4 þ 0  x3 þ 0  x2 þ 1  x1 þ 0  x0 ! w1 ðxÞ ¼ x5 þ x4 þ x: Example 4.4 The word w2 ¼ [001011] can be represented in polynomial form as w 2 ð xÞ ¼ 0  x5 þ 0  x4 þ 1  x3 þ 0  x2 þ 1  x1 þ 1  x 0 ! w2 ðxÞ ¼ x3 þ x þ 1: In a polynomial p(x), the largest power of x is called the degree of p(x). Note that, in our book, we are only interested in the words whose elements are bits chosen from the binary field F ¼ {0, 1} for which mod-2 addition and multiplication operations are used.

4.2 Polynomials and Cyclic Codes

121

Polynomials can be added, multiplied, and divided. Since polynomial coefficients are field elements, while summing two polynomials, we pay attention to sum the coefficients of the same x p terms, and while summing the coefficients, we use the operation defined for the field elements. In our case, that is the mod-2 addition operation. Note that we did not mention the subtraction of two polynomials, since there is no subtraction operation defined for the elements of binary field; then, it becomes unlogical to consider the subtraction of two polynomials. Exercise Divide the polynomial w1(x) ¼ x12 + x7 + x4 + x3 + 1 by w2(x) ¼ x3 + x2 + 1, and find the dividend and remainder polynomials. Exercise Divide the polynomial w1(x) ¼ x5 + x3 + x2 + 1 by w2(x) ¼ x3 + 1, and find the dividend and remainder polynomials. Definition Let w1(x) and w(x) be polynomials with binary coefficients. The remainder polynomial which is obtained after the division of w1(x) by w(x) is denoted as r ðxÞ ¼ RwðxÞ ½w1 ðxÞ

ð4:4Þ

where Rw(x)[] is the remainder function. Note To calculate the remainder polynomial r(x) obtained after the division of w1(x) by w(x), we equate w(x) to zero, write the highest-order term in terms of the lowerdegree ones, put this expression in w1(x), and continue like this until we get a polynomial with order less than the order of w(x). Example 4.5 Let w1(x) ¼ x4 + x + 1 and w(x) ¼ x2 + x + 1. Find r(x) ¼ Rw(x)[w1(x)]. Solution 4.5 From w(x) ¼ 0, we obtain x2 ¼ x þ 1:

ð4:5Þ

When Eq. (4.5) is used in x4 + x + 1 repeatedly, we get  2 x4 þ x þ 1 ! x2 þ x þ 1 ! ðx þ 1Þ2 þ x þ 1 ! x2 þ x ! x þ 1 þ x ! 1: Hence, we have r(x) ¼ 1. Cyclic Shift Operation by Polynomials The cyclic shift of an n-bit word can be expressed using the polynomials. The polynomial representation of the word w ¼ [an  1. . .a1 a0] can be formed as wðxÞ ¼ an1 xn1 þ an2 xn2 þ . . . þ a1 x1 þ a0 x0 :

ð4:6Þ

When the word w ¼ [an  1. . .a1 a0] is cyclically shifted toward left, we obtain

122

4 Cyclic Codes

w1 ¼ ½an2 . . . a1 a0 an1  which can be represented in polynomial form as w1 ðxÞ ¼ an2 xn1 þ an3 xn2 þ . . . þ a0 x1 þ an1 x0 :

ð4:7Þ

The relation between the polynomials w(x) and w1(x) can be written as w1 ðxÞ ¼ Rxn þ1 ½x  wðxÞ:

ð4:8Þ

In fact, the polynomial x  w(x) can be written as x  wðxÞ ¼ an1 xn þ an2 xn1 þ . . . þ a1 x2 þ a0 x1 : To find the remainder polynomial w1(x), we substitute xn + 1 ¼ 0 ! xn ¼ 1 in Eq. (4.8), and we obtain an2 xn1 þ . . . þ a1 x2 þ a0 x1 þ an1

ð4:9Þ

which is the polynomial in Eq. (4.7). Example 4.6 The word w ¼ [101100] can be represented in polynomial form as w ð xÞ ¼ 1  x5 þ 0  x4 þ 1  x3 þ 1  x2 þ 0  x1 þ 0  x0 ! w ð xÞ ¼ x5 þ x3 þ x2 : When the word w ¼ [101100] is cyclically shifted toward left, we obtain w1 ¼ CSLðwÞ ! w1 ¼ ½011001 which can be represented in polynomial form as w 1 ð xÞ ¼ x4 þ x3 þ x0 :

ð4:10Þ

We can show that the polynomial w1(x) can be obtained as w1 ðxÞ ¼ Rx6 þ1 ½x  wðxÞ:

ð4:11Þ

Indeed, the polynomial x  w(x) can be formed as x  wðxÞ ¼ x6 þ x4 þ x3 :

ð4:12Þ

4.4 Non-Systematic Encoding of Cyclic Codes

123

Substituting x6 ¼ 1 in Eq. (4.12), we get the remainder polynomial which is obtained after the division of Eq. (4.12) by x6 + 1, and the obtained remainder polynomial is the same as Eq. (4.10). Note The degree of w1(x) obtained as w1 ðxÞ ¼ Rxn þ1 ½x  wðxÞ

ð4:13Þ

does not exceed n  1.

4.3

The Generator Polynomial for Cyclic Codes

The generator polynomial of the cyclic code C(n, k) has the form gðxÞ ¼ ank xnk þ ank1 xnk1 þ . . . þ a2 x2 þ a1 x1 þ a0 x0

ð4:14Þ

where an  k ¼ a0 ¼ 1 and ai 2 F ¼ {0, 1}, i ¼ 1, . . ., n  k  1. The degree of the generator polynomial is n  k which is equal to the number of parity bits in codewords, i.e., number of redundant bits available in code-words. The generator polynomial is selected from the smallest-degree code-word polynomials, and all the other code-word polynomials have degree greater than or equal to n  k. Once we have the generator polynomial of a cyclic code, we can get a code-word for an information word just by multiplying the information word polynomial by the generator polynomial. The data-word polynomials have degree less than or equal to k  1.

4.4

Non-Systematic Encoding of Cyclic Codes

Assume that we have a cyclic code with generator polynomial g(x). For the dataword d ¼ [dk  1. . .d1 d0], let d(x) be the polynomial representation of this data-word. The encoding operation for the data-word d ¼ [dk  1. . .d1 d0] can be achieved using their polynomial representations as cðxÞ ¼ d ðxÞgðxÞ:

ð4:15Þ

Example 4.7 Hamming codes are cyclic codes. The generator polynomial of the cyclic code

124

4 Cyclic Codes

Cðn ¼ 7, k ¼ 4Þ is given as gðxÞ ¼ x3 þ x þ 1: Encode the data-word d ¼ [0101] using polynomial multiplication. Solution 4.7 The polynomial representation of the data-word can be obtained as dðxÞ ¼ x2 þ 1: The code-word polynomial for the given data-word polynomial can be calculated as    cðxÞ ¼ d ðxÞgðxÞ ! cðxÞ ¼ x2 þ 1 x3 þ x þ 1 ! cðxÞ ¼ x5 þ x2 þ x þ 1: ð4:16Þ The code-word polynomial obtained in Eq. (4.16) can be written in bit vector form as c ¼ ½0100111:

ð4:17Þ

Note that the code-word length is n ¼ 7. For this reason, when code-word polynomials are represented by bits, we pay attention to the length of the bit vector and pad the most significant bits by zeros when the polynomial representation involves less number of bits than the code-word length.

4.5

Systematic Encoding of Cyclic Codes

In systematic code-words, data-bits and parity bits are placed into two concatenated bit vectors, and a systematic code-word has the form of either c ¼ ½d p ! c ¼ ½d k1 dk2 . . . d 0 pnk1 pnk2 . . . p0  or c ¼ ½p d ! c ¼ ½pnk1 pnk2 . . . p0 d k1 dk2 . . . d 0 : Before explaining the systematic encoding of cyclic codes, let’s prepare ourselves considering some fundamental concepts.

4.5 Systematic Encoding of Cyclic Codes

125

Zero Padding of Bit Vectors Let the data vector be represented as d ¼ ½dk1 . . . d1 d0 :

ð4:18Þ

If we concatenate (n  k) zeros to the end of d, we obtain 2

3

d1 ¼ 4dk1 . . . d 1 d0 |fflfflffl 0 0ffl{zfflfflffl . . .ffl0}5:

ð4:19Þ

nk zeros

The polynomial form of d is d ðxÞ ¼ dk1 xk1 þ dk2 xk2 þ . . . þ d1 x1 þ d0 x0

ð4:20Þ

and the polynomial form of d1 is d 1 ðxÞ ¼ dk1 xn1 þ d k2 xn2 þ . . . þ d1 xnkþ1 þ d 0 xnk :

ð4:21Þ

If we compare Eq. (4.20) to (4.21), we see that Eq. (4.21) can be written in terms of Eq. (4.20) as d1 ðxÞ ¼ xnk dðxÞ

ð4:22Þ

which means that multiplying a polynomial by xn  k equals to zero padding its bit vector representation by (n  k) zeros. In short, multiplying a data vector d by xn  k, we obtain the zero padded vector   d 01ðnkÞ : Example 4.8 A data vector and its polynomial representation are given as d ¼ ½0101 ! dðxÞ ¼ x2 þ 1: If we multiply the polynomial d(x) by x3, we obtain d 1 ð xÞ ¼ x3 d ð xÞ ! d 1 ð xÞ ¼ x5 þ x3 and the bit vector representation of d1(x) can be formed as d1 ¼ ½0101000:

ð4:23Þ

126

4 Cyclic Codes

Example 4.9 Consider the polynomials gð x Þ ¼ x 3 þ x þ 1 d 1 ð x Þ ¼ x 5 þ x 4 þ x 3 : (a) Find the remainder polynomial p(x) ¼ Rg(x)[d1(x)]. (b) Using the result of part (a), find the remainder polynomial p1(x) ¼ Rg(x)[d1(x) + p (x)]. Solution 4.9 (a) Equating the polynomial g(x) ¼ x3 + x + 1 to zero, we obtain x3 ¼ x þ 1: When Eq. (4.24) is used in d1(x) ¼ x5 + x4 + x3, we obtain x5 þ x4 þ x3 ! x3 x2 þ x3 x þ x3 ! ðx þ 1Þx2 þ ðx þ 1Þx þ x þ 1 ! x3 þ x2 þ x2 þ x þ x þ 1 ! x3 þ 1 ! x þ 1 þ 1 ! x: Hence, p(x) ¼ x. (b) We can write p1 ðxÞ ¼ RgðxÞ ½d1 ðxÞ þ pðxÞ as p1 ðxÞ ¼ RgðxÞ ½d1 ðxÞ þ RgðxÞ ½pðxÞ which can be calculated as p1 ðxÞ ¼ x þ x ! p1 ðxÞ ¼ 0: Example 4.10 Let g(x) be a polynomial in the form gðxÞ ¼ ank xnk þ ank1 xnk1 þ . . . þ a2 x2 þ a1 x1 þ a0 x0 : Let p(x) ¼ Rg(x)[d1(x)] be a remainder polynomial where d 1 ðxÞ ¼ dk1 xn1 þ d k2 xn2 þ . . . þ d1 xnkþ1 þ d 0 xnk : Find the remainder polynomial

ð4:24Þ

4.5 Systematic Encoding of Cyclic Codes

127

p1 ðxÞ ¼ RgðxÞ ½d1 ðxÞ þ pðxÞ: Answer 4.10 p1 ðxÞ ¼ 0:

4.5.1

Code-Word in Systematic Form

The code-word in systematic form h i c1n ¼ d1k p1ðnkÞ

ð4:25Þ

can be written as h i i   h c1n ¼ d1k p1ðnkÞ ! c1n ¼ d1k 01ðnkÞ þ 0 p1ðnkÞ

ð4:26Þ

which can be represented in polynomial form as cðxÞ ¼ xnk d ðxÞ þ pðxÞ

ð4:27Þ

where p(x) has the form pðxÞ ¼ pnk1 xnk1 þ pnk2 xnk2 þ . . . þ p1 x1 þ p0 x0 :

ð4:28Þ

The degree of p(x) is n  k  1 which is smaller than the degree of the generator polynomial gðxÞ ¼ ank xnk þ ank1 xnk1 þ . . . þ a2 x2 þ a1 x1 þ a0 x0

ð4:29Þ

whose degree is n  k. We conclude that RgðxÞ ½pðxÞ ¼ pðxÞ: Since c(x) is a code-word polynomial, it should be in the form cðxÞ ¼ dðxÞgðxÞ

ð4:30Þ

where d(x) and g(x) are data-word and generator polynomials. Equation (4.30) implies that

128

4 Cyclic Codes

RgðxÞ ½cðxÞ ¼ 0:

ð4:31Þ

When Eq. (4.27) is used in Eq. (4.31), we obtain     RgðxÞ xnk dðxÞ þ pðxÞ ¼ 0 ! RgðxÞ xnk d ðxÞ þ RgðxÞ ½pðxÞ ¼ 0 ! |fflfflfflfflfflffl{zfflfflfflfflfflffl} 

RgðxÞ x

nk



¼pðxÞ

dðxÞ ¼ pðxÞ:

ð4:32Þ

Now let’s gather the results we obtained in formulas (4.27) and (4.32) and summarize the systematic encoding algorithm of the cyclic codes as follows. Systematic Encoding of Cyclic Codes 1. Obtain the polynomial form d(x) of the data-word d and calculate xn  kd(x). 2. Find the remainder parity polynomial p(x) ¼ Rg(x)[xn  kd(x)]. 3. Form the code-word in systematic form as cðxÞ ¼ xnk d ðxÞ þ pðxÞ: Example 4.11 The generator polynomial of C(n ¼ 7, k ¼ 4) cyclic code is given as gðxÞ ¼ x3 þ x þ 1: Systematically encode the data-word d ¼ [0101] and obtain the code-word in systematic form. Solution 4.11 The parameters of the code C(n ¼ 7, k ¼ 4) are n ¼ 7, k ¼ 4. The polynomial representation of the data-word d ¼ [0101] can be written as dðxÞ ¼ x2 þ 1: We can obtain the systematic code-word for the given data-word as follows. 1. First, we multiply d(x) by xn  k as in   xnk d ðxÞ ! x3  x2 þ 1 ! xnk dðxÞ ¼ x5 þ x3 : 2. In the second step, we calculate the remainder polynomial p(x) ¼ Rg(x)[xn  kd(x)]. For this purpose, we write g(x) ¼ 0 from which we get x3 ¼ x + 1, and using the equality x3 ¼ x + 1 in xn  kd(x) repeatedly, we obtain the remainder polynomial as in

4.6 Decoding of Cyclic Codes

129

x5 þ x3 ! x3 x2 þ x3 ! ðx þ 1Þx2 þ ðx þ 1Þ ! x3 þ x2 þ x þ 1 ! ð x þ 1Þ þ x 2 þ x þ 1 ! x 2 : Hence, the remainder polynomial is found as p(x) ¼ x2. 3. In the final step, we construct the systematic code-word using the equation cðxÞ ¼ xnk d ðxÞ þ pðxÞ as   cðxÞ ¼ x74 x2 þ 1 þ x2 ! cðxÞ ¼ x5 þ x3 þ x2 : We can express the code-word polynomial c(x) ¼ x5 + x3 + x2 in bit vector as 2

3

c ¼ 4|ffl{zffl} 0101 |{z} 100 5 d

p

where we see that the first 4-bits of the code-word are the data bits, and the next three bits are the parity bits. Exercise The generator polynomial of C(n ¼ 7, k ¼ 4) cyclic code is given as gðxÞ ¼ x3 þ x þ 1: Systematically encode the data-word d ¼ [1101] and obtain the code-word in systematic form.

4.6

Decoding of Cyclic Codes

Since cyclic codes are a class of linear block codes, they can be decoded using the syndrome tables which are used for the decoding of linear block codes. The syndromes for the cyclic codes can be expressed in polynomial forms, and similarly, the syndrome tables can be constructed using the polynomials. For the code-word polynomial c(x), we can write the received word polynomial r (x) as r ðxÞ ¼ cðxÞ þ eðxÞ

ð4:33Þ

where e(x) is the error word polynomial. Substituting c(x) ¼ d(x)g(x) in Eq. (4.33), we obtain

130

4 Cyclic Codes

r ðxÞ ¼ dðxÞgðxÞ þ eðxÞ:

ð4:34Þ

The syndrome polynomial for r(x) is defined as sðxÞ ¼ RgðxÞ ½r ðxÞ

ð4:35Þ

in which substituting Eq. (4.34), we obtain sðxÞ ¼ RgðxÞ ½dðxÞgðxÞ þ eðxÞ ! sðxÞ ¼ RgðxÞ ½d ðxÞgðxÞ þ RgðxÞ ½eðxÞ ! |fflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflffl} ¼0

sðxÞ ¼ RgðxÞ ½eðxÞ:

ð4:36Þ

The syndrome decoding operation for cyclic codes can be outlined as follows. Let c(x) be the code-word polynomial, and r(x) is the received word polynomial such that r(x) ¼ c(x) + e(x) where e(x) is the error polynomial. 1. Using r(x), we determine the syndrome polynomial s(x) ¼ Rg(x)[r(x)]. 2. Using the syndrome table, we determine the error polynomial ebðxÞ corresponding to the syndrome s(x). 3. In the last step, the decoder’s estimate about the transmitted code-word is calculated using cbðxÞ ¼ r ðxÞ þ ebðxÞ:

ð4:37Þ

Example 4.12 The generator polynomial of single-error-correcting C(n ¼ 7, k ¼ 4) cyclic code is given as gðxÞ ¼ x3 þ x þ 1: Construct the syndrome table of this code. Solution 4.12 First, we list all the possible single-error patterns on the leftmost column as shown in Table 4.1. In the next step, the polynomials for the error patterns are written in the second column as in Table 4.2. In the third step, we calculate the syndrome using sðxÞ ¼ RgðxÞ ½eðxÞ:

4.7 Selection of Generator Polynomials of the Cyclic Codes Table 4.1 Syndrome table construction for Example 4.12

e 0000001 0000010 0000100 0001000 0010000 0100000 1000000

Table 4.2 Syndrome table construction for Example 4.12

e 0000001 0000010 0000100 0001000 0010000 0100000 1000000

Table 4.3 Syndrome table construction for Example 4.12

e 0000001 0000010 0000100 0001000 0010000 0100000 1000000

131

e(x) 1 x x2 x3 x4 x5 x6

e(x) 1 x x2 x3 x4 x5 x6

s(x) ¼ Rg(x)[e(x)] 1 x x2 x+1 x2 + x x2 + x + 1 x2 + 1

For the syndrome calculation, we use g(x) ¼ x3 + x + 1 ¼ 0 ! x3 ¼ x + 1 equation to calculate the remainder polynomials; for instance, if e(x) ¼ x4, the remainder polynomial can be calculated as x4 ! x3 x ! ðx þ 1Þx ! x2 þ x: The syndromes can be calculated as shown in Table 4.3.

4.7

Selection of Generator Polynomials of the Cyclic Codes

Assume that we want to design a cyclic code C(n, k). There are several questions to be answered for this design. The first one is “How to determine the values of n and k? Is there a relation between n and k? Can we choose arbitrary values for n and k?”

132

4 Cyclic Codes

The second question is “How to determine the generator polynomial g(x) whose degree is n  k?” Let’s answer all of these questions as follows. The generator polynomial g(x) must be a divider of xn + 1. For this reason, there is a relation between n and k, and we cannot select arbitrary value for k. Let’s illustrate the concept by an example. Example 4.13 Find the generator polynomials of the cyclic codes C(n, k) where n ¼ 7. Solution 4.13 The generator polynomial g(x) with degree n  k should be a divider of xn þ 1 ! x7 þ 1: We can factorize x7 + 1 as in    x 7 þ 1 ¼ ð x þ 1Þ x 3 þ x 2 þ 1 x 3 þ x þ 1 : We can choose the generator polynomial g(x) considering the factors of x7 + 1. We can select the generator polynomials, and accordingly, we can calculate the value of k and determine the cyclic codes as gð x Þ ¼ x þ 1 ! n  k ¼ 1 ! 7  k ¼ 1 ! k ¼ 6 ! Cðn ¼ 7, k ¼ 6Þ cyclic code exists gð x Þ ¼ x3 þ x 2 þ 1 ! n  k ¼ 3 ! 7  k ¼ 3 ! k ¼ 4 ! Cðn ¼ 7, k ¼ 4Þ cyclic code exists gð x Þ ¼ x3 þ x þ 1 ! n  k ¼ 3 ! 7  k ¼ 3 ! k ¼ 4 ! Cðn ¼ 7, k ¼ 4Þ cyclic code exists   gð x Þ ¼ ð x þ 1Þ x 3 þ x 2 þ 1 ! n  k ¼ 4 ! 7  k ¼ 4 ! k ¼ 3 ! Cðn ¼ 7, k ¼ 3Þ cyclic code exists    gð x Þ ¼ x 3 þ x 2 þ 1 x 3 þ x þ 1 ! n  k ¼ 6 ! 7  k ¼ 6 ! k ¼ 1 ! Cðn ¼ 7, k ¼ 1Þ cyclic code exists

4.7 Selection of Generator Polynomials of the Cyclic Codes

133

Table 4.4 Factorization of xn + 1 for n ¼ 1, 2, . . ., 31 x1 + 1 ! (x + 1) x2 + 1 ! (x + 1)2 x3 + 1 ! (x + 1)(x2 + x + 1) x4 + 1 ! (x + 1)4 x5 + 1 ! (x + 1)(x4 + x3 + x2 + x + 1) x6 + 1 ! (x + 1)2(x2 + x + 1)2 x7 + 1 ! (x + 1)(x3 + x + 1)(x3 + x2 + 1) x8 + 1 ! (x + 1)8 x9 + 1 ! (x + 1)(x2 + x + 1)(x6 + x3 + 1) x10 + 1 ! (x + 1)2(x4 + x3 + x2 + x + 1)2 x11 + 1 ! (x + 1)(x10 + x9 + x8 + x7 + x6 + x5 + x4 + x3 + x2 + x + 1) x12 + 1 ! (x + 1)4(x2 + x + 1)4 x13 + 1 ! (x + 1)(x12 + x11 + x10 + x9 + x8 + x7 + x6 + x5 + x4 + x3 + x2 + x + 1) x14 + 1 ! (x + 1)2(x3 + x + 1)2(x3 + x2 + 1)2 x15 + 1 ! (x + 1)(x2 + x + 1)(x4 + x + 1)(x4 + x3 + 1)(x4 + x3 + x2 + x + 1) x16 + 1 ! (x + 1)16 x17 + 1 ! (x + 1)(x8 + x5 + x4 + x3 + 1)(x8 + x7 + x6 + x4 + x2 + x + 1) x18 + 1 ! (x + 1)2(x2 + x + 1)2(x6 + x3 + 1)2 x19 + 1 ! (x + 1)(x18 + x17 + x16 + x15 + x14 +    + x + 1) x20 + 1 ! (x + 1)4(x4 + x3 + x2 + x + 1)4 x21 + 1 ! (x + 1)(x2 + x + 1)(x3 + x + 1)(x3 + x2 + 1)(x6 + x4 + x2 + x + 1)(x6 + x5 + x4 + x2 + 1) x22 + 1 ! (x + 1)2(x10 + x9 + x8 + x7 + x6 + x5 + x4 + x3 + x2 + x + 1)2 x23 + 1 ! (x + 1)(x11 + x9 + x7 + x6 + x5 + x + 1)(x11 + x10 + x6 + x5 + x4 + x2 + 1) x24 + 1 ! (x + 1)8(x2 + x + 1)8 x25 + 1 ! (x + 1)(x4 + x3 + x2 + x + 1)(x20 + x15 + x10 + x5 + 1) x26 + 1 ! (x + 1)2(x12 + x11 + x10 + x9 + x8 + x7 + x6 + x5 + x4 + x3 + x2 + x + 1)2 x27 + 1 ! (x + 1)(x2 + x + 1)(x6 + x3 + 1)(x18 + x9 + 1) x28 + 1 ! (x + 1)4(x3 + x + 1)4(x3 + x2 + 1)4 x29 + 1 ! (x + 1)(x28 + x27 + x26 +    + x + 1) x30 + 1 ! (x + 1)2(x2 + x + 1)2(x4 + x + 1)2(x4 + x3 + 1)2(x4 + x3 + x2 + x + 1)2 x31 + 1 ! (x + 1)(x5 + x2 + 1)(x5 + x3 + 1)(x5 + x3 + x2 + x + 1)(x5 + x4 + x2 + x + 1) (x5 + x4 + x3 + x + 1)(x5 + x4 + x3 + x2 + 1)

  gð x Þ ¼ ð x þ 1Þ x 3 þ x þ 1 ! n  k ¼ 4 ! 7  k ¼ 4 ! k ¼ 3 ! Cðn ¼ 7, k ¼ 3Þ cyclic code exists: Although we obtained more than one cyclic code with the same parameters n and k, their code-words are different, since their generator polynomials are different. Factorization of xn + 1 for n ¼ 1, 2, . . ., 31 is tabulated in Table 4.4 which can be used for the design of cyclic codes.

134

4 Cyclic Codes

Example 4.14 The factorization of x9 + 1 is given as    x 9 þ 1 ¼ ð x þ 1Þ x 2 þ x þ 1 x 6 þ x 3 þ 1 : Find the generator polynomials of the cyclic codes C(n, k) where n ¼ 9, and determine the value of k considering each generator polynomial found. Solution 4.14 We can choose the generator polynomial g(x) considering the factors of x9 + 1. We can select the generator polynomials, and accordingly, we can determine the value of k and determine the cyclic code as gð x Þ ¼ x þ 1 ! n  k ¼ 1 ! 9  k ¼ 1 ! k ¼ 8 ! Cðn ¼ 9, k ¼ 8Þ cyclic code exists gð x Þ ¼ x 2 þ x þ 1 ! n  k ¼ 2 ! 9  k ¼ 2 ! k ¼ 7 ! Cðn ¼ 9, k ¼ 7Þ cyclic code exists gð x Þ ¼ x 6 þ x 3 þ 1 ! n  k ¼ 6 ! 9  k ¼ 6 ! k ¼ 3 ! Cðn ¼ 9, k ¼ 3Þ cyclic code exists   gð x Þ ¼ ð x þ 1Þ x2 þ x þ 1 ! n  k ¼ 3 ! 9  k ¼ 3 ! k ¼ 6 ! Cðn ¼ 9, k ¼ 6Þ cyclic code exists   gð x Þ ¼ ð x þ 1Þ x 6 þ x 3 þ 1 ! n  k ¼ 7 ! 9  k ¼ 7 ! k ¼ 2 ! Cðn ¼ 9, k ¼ 2Þ cyclic code exists    gð x Þ ¼ x 2 þ x þ 1 x 6 þ x 3 þ 1 ! n  k ¼ 8 ! 9  k ¼ 8 ! k ¼ 1 ! Cðn ¼ 9, k ¼ 1Þ cyclic code exists:

4.8

Parity Check Polynomials of the Cyclic Codes

Let g(x) be the generator polynomial of a cyclic code. The parity check polynomial h (x) of a cyclic code is found from

4.8 Parity Check Polynomials of the Cyclic Codes

gðxÞhðxÞ ¼ xn þ 1

135

ð4:38Þ

where the degree of the generator polynomial is n  k and the degree of the parity check polynomial is k. The parity check polynomial can be written as hðxÞ ¼ xk þ bk1 xk1 þ . . . þ b2 x2 þ b1 x1 þ x0 :

ð4:39Þ

Let d(x) be the data-word polynomial. The code-word polynomial for d(x) can be obtained as cðxÞ ¼ d ðxÞgðxÞ:

ð4:40Þ

Rxn þ1 ½cðxÞhðxÞ:

ð4:41Þ

If we substitute Eq. (4.40) in

we obtain Rxn þ1 ½d ðxÞgðxÞhðxÞ in which using Eq. (4.38), we get Rxn þ1 ½d ðxÞðxn þ 1Þ ¼ 0: Hence, we showed that Rxn þ1 ½cðxÞhðxÞ ¼ 0:

ð4:42Þ

The Eq. (4.42) can be utilized for an alternative equation for the calculation of syndrome polynomial. The received word polynomial can be written as r ðxÞ ¼ cðxÞ þ eðxÞ: Substituting gð x Þ ¼

xn þ 1 hð x Þ

in sðxÞ ¼ RgðxÞ ½r ðxÞ, we obtain

ð4:43Þ

136

4 Cyclic Codes

sðxÞ ¼ Rxn þ1 ½r ðxÞ hðxÞ

which can be written as sðxÞ ¼ Rxn þ1 ½r ðxÞhðxÞ:

ð4:44Þ

If we use r(x) ¼ c(x) + e(x) in Eq. (4.44), we obtain sðxÞ ¼ Rxn þ1 ½eðxÞhðxÞ:

ð4:45Þ

Hence, using the parity check polynomial, we can calculate the syndrome polynomial using either sðxÞ ¼ Rxn þ1 ½r ðxÞhðxÞ

ð4:46Þ

sðxÞ ¼ Rxn þ1 ½eðxÞhðxÞ:

ð4:47Þ

or

Example 4.15 The generator polynomial of single-error-correcting C(n ¼ 7, k ¼ 4) cyclic code is given as gðxÞ ¼ x3 þ x2 þ 1: Find the parity check polynomial. Solution 4.15 The parity check polynomial can be calculated as hð x Þ ¼

xn þ 1 x7 þ 1 ! hðxÞ ¼ 3 ! hðxÞ ¼ x4 þ x3 þ x2 þ 1: gð x Þ x þ x2 þ 1

The encoding, syndrome calculation, and orthogonality formulas for the cyclic codes can be expressed using matrices and polynomials as shown in Table 4.5.

Table 4.5 Encoding, syndrome calculation, and orthogonality formulas for cyclic codes Matrix form c ¼ dG GHT ¼ 0 cHT ¼ 0 s ¼ rHT or s ¼ eHT

Polynomial form c(x) ¼ d(x)g(x) Rxn þ1 ðgðxÞhðxÞÞ ¼ 0 Rxn þ1 ðcðxÞhðxÞÞ ¼ 0 sðxÞ ¼ Rxn þ1 ðr ðxÞhðxÞÞ or sðxÞ ¼ RgðxÞ ðr ðxÞÞ

4.9 Dual Cyclic Codes

4.9

137

Dual Cyclic Codes

The parity check polynomial of cyclic codes is NOT the generator polynomial of the dual cyclic code, but it is used to calculate the generator polynomial of the dual cyclic code. If h(x) is the parity check polynomial of a cyclic code, then the generator polynomial of the dual cyclic code is calculated using   gd ðxÞ ¼ xm h x1 where m is the degree of h(x). Example 4.16 The generator polynomial of single-error-correcting C(n ¼ 7, k ¼ 4) cyclic code is given as gðxÞ ¼ x3 þ x þ 1: Find the generator polynomial of the dual cyclic code. Solution 4.16 We can find the parity check polynomial of the given cyclic code as hð x Þ ¼

xn þ 1 x7 þ 1 ! hð x Þ ¼ 3 ! hðxÞ ¼ x4 þ x2 þ x þ 1: gð x Þ x þxþ1

Using the parity check polynomial, we can calculate the generator polynomial of the dual code as     gd ðxÞ ¼ xm h x1 ! gd ðxÞ ¼ x4 x4 þ x2 þ x1 þ 1 ! gd ðxÞ ¼ x4 þ x3 þ x2 þ 1: The bit vector representation of h(x) ¼ x4 + x2 + x + 1 is h ¼ ½1 0 1 1 1

ð4:48Þ

and the bit vector representation of gd(x) ¼ x4 + x3 + x2 + 1 is gd ¼ ½1 1 1 0 1:

ð4:49Þ

When Eqs. (4.48) and (4.49) are compared to each other, we see that they are the reverse of each other.

138

4 Cyclic Codes

Exercise The generator polynomial of C(n ¼ 9, k ¼ 6) cyclic code is given as gðxÞ ¼ x3 þ 1: Find the parity check polynomial of this code, and using the parity check polynomial, obtain the generator polynomial of the dual cyclic code.

4.10

Generator and Parity Check Matrices for Cyclic Codes

Generator Matrices of the Cyclic Codes Cyclic codes are a type of linear block codes. For this reason, cyclic codes have generator and parity check matrices. The generator and parity check matrices can be constructed using the binary coefficients of generator and parity check polynomials. Let g(x) be the generator polynomial of a cyclic code such that gðxÞ ¼ ank xnk þ ank1 xnk1 þ . . . þ a1 x1 þ a0 x0 where ai 2 F ¼ {0, 1}. Using the binary coefficients of the generator polynomial, we construct the generator matrix as 2

ank ank1 . . . a2 a1 a0 0 0 . . . 0 0 0

3

7 6 6 0 ank ank1 . . . a2 a1 a0 0 . . . 0 0 0 7 7 6 7 6 7 : 0 0 a G¼6 a . . . a a a 0 . . . 0 0 nk nk1 2 1 0 7 6 7 6 7 6 ⋮ 5 4 0 0 0 . . . 0 0 ank ank1 . . . a2 a1 a0 kn

ð4:50Þ

Example 4.17 The generator polynomial of single-error-correcting C(n ¼ 7, k ¼ 4) cyclic code is given as gðxÞ ¼ x3 þ x2 þ 1: Find the generator matrix of this cyclic code.

4.10

Generator and Parity Check Matrices for Cyclic Codes

139

Solution 4.17 The generator polynomial g(x) ¼ x3 + x2 + 1 can be expressed by a bit vector as g ¼ ½1 1 0 1: The size of the generator matrix is k  n ¼ 4  7. If we zero pad the vector g ¼ [1 1 0 1] such that its length equals to 7, we obtain g1 ¼ ½1 1 0 1 0 0 0: If we rotate the bits of g1 to the right by one unit, we obtain g2 ¼ ½0 1 1 0 1 0 0: If we rotate the bits of g2 to the right by one unit, we obtain g3 ¼ ½0 0 1 1 0 1 0: If we rotate the bits of g3 to the right by one unit, we obtain g4 ¼ ½0 0 0 1 1 0 1: The generator matrix of the cyclic code can be formed as 2

g1

3

2

1101000

3

7 6 6 7 60 1 1 0 1 0 07 6 g2 7 7 6 6 7 G¼6 7!G¼6 7: 60 0 1 1 0 1 07 6 g3 7 5 4 4 5 g4

ð4:51Þ

0001101

To obtain the parity check matrix of the cyclic code, we can obtain the systematic form of Eq. (4.51), and using the systematic form of the generator matrix, we can construct the parity check matrix of the cyclic code. Parity Check Matrices of the Cyclic Codes Let h(x) be the parity check polynomial of a cyclic code such that hðxÞ ¼ bk xk þ bk1 xk1 þ . . . þ b0 x1 þ b0 x0

ð4:52Þ

where ai 2 F ¼ {0, 1}. Using the binary coefficients of the parity check polynomial, we construct the parity check matrix as

140

4 Cyclic Codes

2

b 0 b1 6 6 0 b0 6 H¼6 6 0 0 6 4⋮ ⋮ 0 0

b2 b1

. . . bk1 b2 . . .

b0

b1

⋮ 0

⋮ ...

... 0 0 ...

bk bk1

0 bk

0 0

b2

...

bk1

bk

0

⋮ 0

⋮ 0

⋮ b0

⋮ b1

⋮ b2

0

0 0 ...

⋮ ⋮ . . . bk1

3 0 7 0 7 7 0 7 : 7 7 ⋮5 bk ðnkÞn ð4:53Þ

Example 4.18 The generator polynomial of a single-error-correcting C(n ¼ 7, k ¼ 4) cyclic code is given as gðxÞ ¼ x3 þ x2 þ 1: Find the parity check matrix of this cyclic code. Solution 4.18 We can find the parity check polynomial of the given cyclic code as hð x Þ ¼

xn þ 1 x7 þ 1 ! hðxÞ ¼ 3 ! hðxÞ ¼ x4 þ x3 þ x2 þ 1: gð x Þ x þ x2 þ 1

The size of the parity check matrix is (n  k)  n ¼ 3  7. The parity check polynomial h(x) ¼ x4 + x3 + x2 + 1 can be represented by a bit vector as h ¼ ½1 1 1 0 1:

ð4:54Þ

If we reverse the bit vector in Eq. (4.54), we get hr ¼ ½1 0 1 1 1: If we zero pad the vector hr ¼ [1 0 1 1 1] such that its length equals to 7, we obtain hr1 ¼ ½1 0 1 1 1 0 0: If we rotate the bits of hr1 to the right by one unit, we obtain hr2 ¼ ½0 1 0 1 1 1 0: If we rotate the bits of hr2 to the right by one unit, we obtain hr3 ¼ ½0 0 1 0 1 1 1: The parity check matrix of the cyclic code can be formed as

Problems

141

2

hr1

3

2

1011100

3

6 7 6 7 7 6 7 H¼6 4 hr2 5 ! H ¼ 4 0 1 0 1 1 1 0 5: 0010111 hr3

ð4:55Þ

The generator and parity check matrices given in Eqs. (4.51) and (4.55) satisfy GH T ¼ 0: That is, 2

100

3

7 6 60 1 07 3 2 7 6 1101000 000 7 6 7 6 1 0 17 7 7 6 6 60 1 1 0 1 0 07 6 60 0 07 7 7 6 7 6 6 T T GH ¼ 6 7  61 1 07 7: 7 ! GH ¼ 6 7 60 0 1 1 0 1 07 6 6 0 0 0 7 5 6 5 4 4 61 1 17 7 6 0001101 000 7 6 60 1 17 5 4 001 2

3

Problems 1. The polynomial x9 + 1 can be factorized as    x 9 þ 1 ¼ ð x þ 1Þ x 2 þ x þ 1 x 6 þ x 3 þ 1 : The generator polynomial of a cyclic code with block length n ¼ 9 is given as gðxÞ ¼ x6 þ x3 þ 1: (a) Determine the value of k. (b) Find the parity check polynomial and generator polynomial of the dual cyclic code. (c) Find the generator and parity check matrices of this cyclic code. (d) Find the minimum distance of this code. (e) Construct the syndrome polynomial table of this cyclic code.

142

4 Cyclic Codes

2. The generator polynomial of C(n ¼ 8, k ¼ 4) cyclic code is given as gðxÞ ¼ x4 þ 1: (a) Find the parity check polynomial of this code. (b) Express the data vector d ¼ [1 0 1 1] in polynomial form, and encode the data polynomial using non-systematic and systematic encoding methods. Obtain the systematic and non-systematic code-word and determine the locations of both data and parity bits in each code-word. 3. A cyclic code is used to encode a data polynomial, and the code-word cð xÞ ¼ x5 þ x4 þ 1 is obtained. What can be the parameters of the cyclic code used, and determine a generator matrix for this code. After determining the generator polynomial, find the data-word polynomial which yields the given code-word after encoding operation. 4. Using the factorization     x15 þ 1 ¼ ðx þ 1Þ x2 þ x þ 1 x4 þ x þ 1 x4 þ x3 þ x2 þ x þ 1 (a) Determine the number of cyclic codes C(n ¼ 15, k). (b) Find the generator polynomials of the cyclic codes C(n ¼ 15, k ¼ 11). (c) Find the generator polynomial, parity check polynomial, generator matrix, and parity check matrix of the cyclic code C(n ¼ 15, k ¼ 7).

Chapter 5

Galois Fields

5.1

Equation Roots and Concept of Field Extension

A polynomial is defined with powers of a dummy parameter x and coefficients selected from a field (F,  , ). For instance, consider the field of real numbers for which ordinary addition and multiplication operations, i.e., mod-10 addition and multiplication operations, are defined, and a polynomial is given as pðxÞ ¼ x2  2:5x þ 1:5

ð5:1Þ

where the coefficients are selected from the real numbers, i.e., real number field (R, + , ). Now consider the equation pðxÞ ¼ 0 ! x2  2:5x þ 1:5 ¼ 0:

ð5:2Þ

The roots of Eq. (5.1) can be found as α1 ¼ 1 and α2 ¼ 1.5. When 1 is substituted for x in Eq. (5.1), we get 12  2:5  1 þ 1:5 ! 0: In a similar manner, when 1.5 is substituted for x in Eq. (5.1), we get 1:52  2:5  1:5 þ 1:5 ! 0: That is, the roots satisfy the Eq. (5.1), and the roots are also real numbers, i.e., they are available in the real number field (R, + , ). Now consider the polynomial

© Springer Nature Switzerland AG 2020 O. Gazi, Forward Error Correction via Channel Coding, https://doi.org/10.1007/978-3-030-33380-5_5

143

144

5 Galois Fields

pð x Þ ¼ x 2 þ 1 where we see that the coefficients are selected from the real numbers, i.e., real number field (R, + , ). Now, let’s try to solve the equation pðxÞ ¼ 0 ! x2 þ 1 ¼ 0:

ð5:3Þ

The roots of Eq. (5.3) can NOT be found in the real number field, i.e., in (R, + , ). That is, we cannot find an α 2 R satisfying Eq. (5.3), i.e., there is no α 2 R such that α2 + 1 ¼ 0. If the solution is not available in real number field, we should look for the solution in another field which includes the real number field as its subset. Such a field is the complex number field C , and assume that in this field we have i 2 C such that i2 þ 1 ¼ 0 ! i2 ¼ 1:

ð5:4Þ

The elements of the complex number field can be obtained as C ¼ fRg [ fR þ i  Rg:

ð5:5Þ

And defining two new operators (+, ) for the addition and multiplication of two complex numbers, we can extend the real number field to the complex number field. This extension can be symbolically indicated by R ! C: Let’s try to illustrate the field extension concept by some examples. Example 5.1 The finite field (F3,  , ) is defined as F 3 ¼ f0, 1, 2g  ! Mod  3 additon operation ⨂ ! Mod  3 multiplication operation: Consider the polynomial pðxÞ ¼ x2 þ 2x þ 2: We see that the coefficients of Eq. (5.6) are selected from F ¼ {0, 1, 2}. Now consider the solution of the equation

ð5:6Þ

5.1 Equation Roots and Concept of Field Extension

pðxÞ ¼ 0 ! x2 þ 2x þ 2 ¼ 0:

145

ð5:7Þ

We should look for the solution from the field elements F ¼ {0, 1, 2}. Let’s try each field element in the Eq. (5.7), and decide the ones that satisfy Eq. (5.7) as follows: x ¼ 0 ! x2 þ 2x þ 2 ¼ 0 ! 02 þ 2  0 þ 2 ¼ 0 ! 2 ¼ 0 ! incorrect

ð5:8Þ

x ¼ 1 ! x2 þ 2x þ 2 ¼ 0 ! 12 þ 2  1 þ 2 ¼ 0 ! 2 ¼ 0 ! incorrect

ð5:9Þ

x ¼ 2 ! x2 þ 2x þ 2 ¼ 0 ! 22 þ 2  2 þ 2 ¼ 0 ! 1 ¼ 0 ! incorrect: ð5:10Þ Thus, considering Eqs. (5.8), (5.9) and (5.10), we can say that there is no root of Eq. (5.7) in the field F3 ¼ {0, 1, 2}. We should look for the roots in another field which contains the field F3 ¼ {0, 1, 2} as its subset. Assume that we have such a field, and let’s show this field as E ¼ f0, 1, 2, α, . . .g

ð5:11Þ

where the element α is the root of Eq. (5.7), i.e., x ¼ α ! x2 þ 2x þ 2 ¼ 0 ! α2 þ 2α þ 2 ¼ 0:√ From Eq. (5.11), it is clear that F3 ⊂ E. Since E is a field, then it should satisfy all the properties of a field. To check whether such a field exists or not, we need to find all the other elements of E. Then, we ask the question “How can we determine all the other elements of E ?” This question can also be stated as “How can we extend the finite field F3 to another finite field E such that the extended field contains an element α which is a root of Eq. (5.7)?” In fact, this is the main topic of this chapter, and we will first explain the extension of finite fields in details.

5.1.1

Extension of Finite Fields

In this section, we will only study the extension of binary field, i.e., Galois field, indicated by F, F2, or GF(2). We have stated in Chap. 1 that a set of polynomials may satisfy the properties of a field, and the coefficients of the polynomials are selected from a number field.

146

5 Galois Fields

For instance, consider the binary field F ¼ {0, 1} and the set of all the polynomials with degrees less than three. The coefficients of the polynomials are selected from the field F ¼ {0, 1}. The polynomial set can be written as   G ¼ 0, 1, α, α þ 1, α2 , α2 þ 1, α2 þ α, α2 þ α þ 1 :

ð5:12Þ

If we make a multiplication and addition table for the elements of Eq. (5.12), we can see from the tables that all the properties of a field are satisfied. Thus, we can say that G is a field under polynomial multiplication and addition operations. Now consider the polynomial p(x) ¼ x3 + x + 1 whose coefficients are selected from the elements of the binary field F ¼ {0, 1}. Let’s try to find the solution of the equation pð x Þ ¼ 0 ! x3 þ x þ 1 ¼ 0

ð5:13Þ

in the binary field. If we try the elements 0 and 1 in Eq. (5.13), we see that neither of them are the solutions of Eq. (5.13), i.e., x ¼ 0 ! x3 þ x þ 1 ¼ 0 ! 03 þ 0 þ 1 ¼ 0 ! 1 ¼ 0 ! incorrect x ¼ 1 ! x3 þ x þ 1 ¼ 0 ! 13 þ 1 þ 1 ¼ 0 ! 1 ¼ 0 ! incorrect: Then we should look for the solution in another field extended from F ¼ {0, 1}. Assume that α is a root of the equation, i.e., x ¼ α ! α3 þ α þ 1 ¼ 0 and α is available in another field which includes the binary field as its subset, then the extended field can written as GF ¼ f0, 1, α, . . .g: We wonder the other elements of GF. However, we previously showed that the set of polynomials in Eq. (5.12) is a field. Then, we can use it as our extended field. The extended field in Eq. (5.12) includes eight elements, and for this reason, we can show the extended field as GF(8). That is, our extended field which includes the solution of the equation x3 þ x þ 1 ¼ 0

ð5:14Þ

  GF ð8Þ ¼ 0, 1, α, α þ 1, α2 , α2 þ 1, α2 þ α, α2 þ α þ 1 :

ð5:15Þ

can be written as

There are three roots of the equation

5.1 Equation Roots and Concept of Field Extension

147

x3 þ x þ 1 ¼ 0: One of the roots is α; this means that α3 + α + 1 ¼ 0 from which we can write that α3 ¼ α þ 1:

ð5:16Þ

What about the other roots? Are they available in Eq. (5.15)? If we check the elements of Eq. (5.15) one by one, we see that α2 and α2 + α are also roots of Eq. (5.13). That is, if we put x ¼ α2 in Eq. (5.13), we get  2 3 α þ α2 þ 1 ¼ 0 where, employing Eq. (5.16), we obtain ðα þ 1Þ2 þ α2 þ 1 ¼ 0 ! α2 þ 1 þ α2 þ 1 ¼ 0 ! 0 ¼ 0√ which is a correct equality. In a similar manner, if we use x ¼ α2 + α in Eq. (5.13), we see that it is also a root of the given polynomial.

5.1.2

Irreducible Polynomial

The polynomial p(x) with degree r is an irreducible polynomial if p(x) divides the polynomial xn þ 1

ð5:17Þ

n ¼ 2r  1

ð5:18Þ

where

and p(x) divides at least one polynomial xm þ 1

ð5:19Þ

m < 2r  1:

ð5:20Þ

where

An irreducible polynomial cannot be factorized. Example 5.2 The polynomial p(x) ¼ x4 + x3 + x2 + x + 1 divides x15 + 1 where 15 ¼ 24  1, and p(x) also divides x5 + 1. Thus, we can conclude that the polynomial

148

5 Galois Fields

pð x Þ ¼ x 4 þ x 3 þ x 2 þ x þ 1 is an irreducible polynomial, and it cannot be factorized.

5.1.3

Primitive Polynomial

The polynomial p(x) with degree r is a primitive polynomial if p(x) divides the polynomial xn þ 1 where n ¼ 2r  1 and p(x) does NOT divide a polynomial of the form xm þ 1 where m < 2r  1: Example 5.3 Let’s show that the polynomial pð x Þ ¼ x 3 þ x þ 1 is a primitive polynomial. The degree of p(x) is r ¼ 3. If p(x) is a primitive polynomial, then it should divide x7 + 1, 7 ¼ 23  1, and it should not divide all the polynomials xm + 1 where m < 7. We can show that x3 þ x þ 1 divides x7 þ 1 x3 þ x þ 1 does NOT divide x6 þ 1 x3 þ x þ 1 does NOT divide x5 þ 1 x3 þ x þ 1 does NOT divide x4 þ 1 x3 þ x þ 1 does NOT divide x3 þ 1: Thus, we can conclude that p(x) ¼ x3 + x + 1 is a primitive polynomial.

5.2 Construction of Extended Finite Fields

149

Exercise Show that the polynomials p1 ð x Þ ¼ x 4 þ x þ 1 and p2 ð x Þ ¼ x 4 þ x 3 þ 1 are primitive polynomials. Note Let p(x) be a polynomial with degree m. If 2m  1 is a prime number, then we can say that p(x) is a primitive polynomial. On the other hand, if 2m  1 is NOT a prime number, then p(x) may or may not be a primitive polynomial. Example 5.4 The polynomial p(x) ¼ x3 + x + 1 is a primitive polynomial, since 23  1 ¼ 7 is a prime number. The polynomial p(x) ¼ x4 + x + 1 is a primitive polynomial, although 24  1 ¼ 15 is NOT a prime number. The polynomial p(x) ¼ x4 + x3 + x2 + x + 1 is NOT a primitive polynomial, and 4 2  1 ¼ 15 is NOT a prime number.

5.2

Construction of Extended Finite Fields

Let p(x) be a primitive polynomial with degree m. Using the primitive polynomial, we can generate all the elements of the extended field GF(2m) via a recursive computation. The generation of the elements of the extended field is outlined as follows: 1. We assume that α is a root of p(x) such that pðαÞ ¼ 0:

ð5:21Þ

2. From Eq. (5.21), we write a recursive statement in the form αm ¼ c1 αm1 þ c2 αm2 þ . . . þ cm α0 such that ci 2 F ¼ f0, 1g, i ¼ 1, . . . , m: ð5:22Þ 3. The elements of the extended Galois field GF(2m) can be written as

150

5 Galois Fields

  GF ð2m Þ ¼ 0, 1, α, α2 , . . . , αr where r ¼ 2m  2:

ð5:23Þ

If we want to write the polynomial expressions for the elements of extended field GF(2m), then we use Eq. (5.22) to simplify the αi expressions in Eq. (5.23). Example 5.5 The primitive polynomial p(x) is given as pðxÞ ¼ x3 þ x þ 1: Using the given primitive polynomial, construct the extended field GF(23). Solution 5.5 Let’s follow the steps mentioned in the previous paragraphs for the determination of elements of the extended field. 1. Let α be a root of p(x) ¼ x3 + x + 1; then, we can write that α3 þ α þ 1 ¼ 0:

ð5:24Þ

2. From Eq. (5.24), we obtain the recursive statement α3 ¼ α þ 1:

ð5:25Þ

3. The elements of the extended field GF(23) can be written as     GF 23 ¼ 0, 1, α, α2 , . . . , α6 where 6 ¼ 23  2:

ð5:26Þ

The αi terms in Eq. (5.26) can be expressed in polynomial form using Eq. (5.25) as in α3 ! α þ 1 α4 ! α  α3 ! αðα þ 1Þ ! α2 þ α   α5 ! α  α4 ! α  α2 þ α ! α3 þ α2 ! α2 þ α þ 1   α6 ! α  α5 ! α  α2 þ α þ 1 ! α3 þ α2 þ α ! α2 þ 1:

ð5:27Þ

Using the polynomial equivalents of αi terms, we can write the extended field in Eq. (5.26) as in     GF 23 ¼ 0, 1, α, α2 , α2 þ α, α2 þ 1, α2 þ α þ 1 :

5.2 Construction of Extended Finite Fields

151

Construction of the Extended Field Using an Irreducible Polynomial Let p(x) be an irreducible polynomial with order m. We can construct the extended field GF(2m) with the help of p(x) as follows. 1. We assume that α is a root of p(x) such that pðαÞ ¼ 0:

ð5:28Þ

2. From Eq. (5.28), we write a recursive statement in the form αm ¼ c1 αm1 þ c2 αm2 þ . . . þ cm α0 such that ci 2 F ¼ f0, 1g, i ¼ 1, . . . , m: ð5:29Þ 3. There exists a polynomial of α, i.e., β ¼ f(α), with degree less than m, and using this polynomial, we can construct the extended field as   GF ð2m Þ ¼ 0, 1, β, β2 , . . . , βr where r ¼ 2m  2:

ð5:30Þ

Using the recursive statement in Eq. (5.29), we can write the field elements of Eq. (5.30) as polynomials. Example 5.6 The irreducible polynomial p(x) is given as pðxÞ ¼ x4 þ x3 þ x2 þ x þ 1:

ð5:31Þ

Using the given irreducible polynomial, construct the extended field GF(24) (Table 5.1). Solution 5.6 1. We assume that α is a root of p(x) such that pðαÞ ¼ 0:

ð5:32Þ

2. From Eq. (5.32), we write a recursive statement in the form α4 ¼ α3 þ α2 þ α þ 1: 3. Let’s choose a polynomial of α as

ð5:33Þ

152

5 Galois Fields

Table 5.1 List of irreducible and primitive polynomials with their hexadecimal representations n 1 2 3 4 5

6

Primitive polynomials x!2 x+1!3 x2 + x + 1 ! 7 x3 + x + 1 ! B x3 + x2 + 1 ! D x4 + x + 1 ! 13 x4 + x3 + 1 ! 19 x5 + x4 + x3 + x2 + 1 ! 3D x5 + x4 + x2 + x + 1 ! 37 x5 + x3 + x2 + x + 1 ! 2F x5 + x4 + x3 + x + 1 ! 3B x5 + x3 + 1 ! 29 x5 + x2 + 1 ! 25 x6 + x + 1 ! 43 x6 + x5 + 1 ! 61 x6 + x5 + x3 + x2 + 1 ! 49 x6 + x5 + x4 + x + 1 ! 73 x6 + x4 + x3 + x + 1 ! 5B x6 + x5 + x2 + x + 1 ! 57

Irreducible polynomials – – – x4 + x3 + x2 + x + 1 ! 1F –

x6 + x2 + 1 ! 45

f ðαÞ ¼ α þ 1 ! β ¼ α þ 1: Using Eq. (5.33), we can calculate the powers of β as in β1 ! α þ 1 β2 ! ββ ! α2 þ 1  β3 ! β2 β ! α2 þ 1 ðα þ 1Þ ! α3 þ α2 þ α þ 1   β4 ! β3 β ! α3 þ α2 þ α þ 1 ðα þ 1Þ ! α4 þ α3 þ α2 þ α þ α3 þ α2 þ α þ 1 

! α3 þ α2 þ α

  β5 ! β4 β ! α3 þ α2 þ α ðα þ 1Þ ! α4 þ α3 þ α2 þ α3 þ α2 þ α

! α3 þ α2 þ 1   β6 ! β5 β ! α3 þ α2 þ 1 ðα þ 1Þ ! α4 þ α3 þ α þ α3 þ α2 þ 1 ! α3   β7 ! β6 β ! α3 ðα þ 1Þ ! α4 þ α3 ! α2 þ α þ 1   β8 ! β7 β ! α2 þ α þ 1 ðα þ 1Þ ! α3 þ α2 þ α þ α2 þ α þ 1 ! α3 þ 1   β9 ! β8 β ! α3 þ 1 ðα þ 1Þ ! α4 þ α þ α3 þ 1 ! α2   β10 ! β9 β ! α2 ðα þ 1Þ ! α3 þ α2

5.3 Conjugate Classes

153

  β11 ! β10 β ! α3 þ α2 ðα þ 1Þ ! α4 þ α3 þ α3 þ α2 ! α3 þ α þ 1   β12 ! β11 β ! α3 þ α þ 1 ðα þ 1Þ ! α4 þ α2 þ α þ α3 þ α þ 1 ! α β13 ! β12 β ! ðαÞðα þ 1Þ ! α2 þ α   β14 ! β13 β ! α2 þ α ðα þ 1Þ ! α3 þ α: The extended field GF(24) can be written as     GF 24 ¼ 0, 1, β, β2 , β3 , β4 , β5 , β6 , β7 , β8 , β9 , β10 , β11 , β12 , β13 , β14 or using the polynomial form of βi, we can express the extended field GF(24) as    GF 24 ¼ 0, 1, α þ 1, α2 þ 1, α3 þ α2 þ α þ 1, α3 þ α2 þ α, α3 þ α2 þ 1, α3 , α2 þ α þ 1, α3 þ 1, α2 , α3 þ α2 , α3 þ α þ 1,  α, α2 þ α, α3 þ α: Exercise The polynomial p(x) ¼ x5 + x2 + 1 is a primitive polynomial. Using p(x), generate all the elements of GF(25), i.e., construct the extended field GF(25) from the base field F ¼ {0, 1}, i.e., binary field.

5.3

Conjugate Classes

Consider the solution of the equation x2  2x þ 2 ¼ 0

ð5:34Þ

in complex number field. There are two roots of this equation, and the roots are 1 þ j and 1  j:

ð5:35Þ

The roots in Eq. (5.35) are said to be conjugates of each other, and we can make a set consisting of the roots which are conjugate of each other as f1 þ j, 1  jg which can be called as a conjugate class.

154

5 Galois Fields

A similar concept can be pursued for the solution of equations in finite field. The roots of the equation p(x) ¼ 0 in a finite field appear as conjugates of each other. For instance, the equation x3 þ x þ 1 ¼ 0 has three roots in GF(28), and the roots are conjugates of each other. In fact, in GF (28), every element is a root of a polynomial equation, and conjugates of this root are also available in GF(28). In fact, three elements of GF(28) are the roots of x3 þ x þ 1 ¼ 0 and another three are the roots of x3 þ x2 þ 1 ¼ 0 and the remaining two are the roots of x ¼ 0 and x ¼ 1: Let β be an element of the extended field GF(2m). We know that β is a root of an equation p(x) ¼ 0. Assume that there are r roots of p(x) ¼ 0. The other roots of p (x) ¼ 0, i.e., conjugates of β, can be calculated as r

ð5:36Þ

β2 , i ¼ 1, . . . , r:

ð5:37Þ

β2 þ1 ¼ β:

ð5:38Þ

β2 , β 4 , β 8 , . . . , β2 or in short we can write Eq. (5.36) as i

and we have r

The conjugate class including β can be written as  2 4 8 r β, β , β , β , . . . , β2

ð5:39Þ

such that β2 þ1 ¼ β: r

Example 5.7 Using the primitive polynomial p(x) ¼ x3 + x + 1, construct the extended field GF(23). Find the conjugates of α3, and determine the polynomial for which α3 is a root.

5.3 Conjugate Classes

155

Solution 5.7 If α is a root of pð x Þ ¼ 0 ! x 3 þ x þ 1 ¼ 0 then we have α3 þ α þ 1 ¼ 0 ! α3 ¼ α þ 1:

ð5:40Þ

The extended field GF(28) can be written as     GF 28 ¼ 0, 1, α, α2 , α3 , α4 , α5 , α6 where α7 ¼ 1 and αi, i ¼ 1, . . ., 6 can be converted to polynomial expressions using the recursive statement in Eq. (5.40). The conjugates of β ¼ α3 can be calculated as follows. The first conjugate of β is  2 β2 ! α3 ! α6 :

ð5:41Þ

The second conjugate of β is  2  2 α7 α5 ! α5 : β4 ! β2 ! α6 ! α12 ! |{z}

ð5:42Þ

¼1

The third conjugate of β is  2  2 β8 ! β4 ! α5 ! α10 ! |{z} α7 α3 ! α3

ð5:43Þ

¼1

which is the same as β. Then, there is no third conjugate. There are only two conjugates of β ¼ α3, and the conjugates are  2 4   β , β ! α6 , α5 : The conjugate class including β can be written as 

   β, β2 , β4 ! α3 , α6 , α5 :

Since the elements β, β2, β4 are the roots of an equation qð x Þ ¼ 0 the polynomial q(x) can be written as

156

5 Galois Fields

   qðxÞ ¼ ðx þ βÞ x þ β2 x þ β4 in which, inserting α3, α6, α5 for β, β2, β4, we obtain     qðxÞ ¼ x þ α3 x þ α6 x þ α5 :

ð5:44Þ

Note There is no “” operator defined in GF(2); only mod-2 addition and multiplication operations are defined. For this reason, it is not correct to write the polynomial q(x) as     qðxÞ ¼ x  α3 x  α6 x  α5 : Expanding Eq. (5.44) and using the recursive statement in Eq. (5.40) we can simplify Eq. (5.44) as 

      x þ α3 x þ α6 x þ α5 ! x2 þ α6 x þ α3 x þ α9 x þ α5

α9 x þ α5 x2 þ |{z} α11 x þ |{z} α8 x þ |{z} α14 ! x3 þ α6 x2 þ α3 x2 þ |{z} ¼α2

¼α

¼α4

¼1

! x þ α x þ α x þ α x þ α x þ α x þ αx þ 1 3

6 2

3 2

2

5 2

4

which can be simplified as     x3 þ α6 þ α3 þ α5 x2 þ α2 þ α4 þ α x þ 1:

ð5:45Þ

It is a convention to express the coefficients of the polynomials as powers of α. The coefficients in Eq. (5.45) can be expressed as powers of α. For this purpose, we first write the polynomial equivalents of each αi term; next, we sum the polynomials; and, lastly, we express the summation results using powers of α. Accordingly, the coefficients of Eq. (5.45) can be converted to the powers of α as in α6 þ |{z} α3 þ |{z} α5 ! α2 þ 1 þ α þ 1 þ α2 þ α þ 1 ! 1 |{z} α2 þ1

αþ1

α2 þαþ1

α2 þ |{z} α4 þ α ! α2 þ α2 þ α þ α ! 0: α2 þα

Thus, the polynomials in Eq. (5.45) happen to be as x3 þ x2 þ 1 which has no coefficients involving α terms. All the coefficients are available in the base field, i.e., binary field GF(2) ¼ {0, 1}.

5.3 Conjugate Classes

157

Note The equation whose roots are the complex numbers 1 + j and 1  j can be determined as x2  2x þ 2 ¼ 0 where we see that the coefficients of the polynomials x2  2x + 2 are all real numbers belonging to the real number field, i.e., belonging to the base field, and the roots are available in the complex number field, i.e., available in the extended field. Example 5.8 Find all the conjugates of α3 in the extended field GF(24). Solution 5.8 For GF(24), we have α15 ¼ 1. If β 2 GF(24), then the conjugates of β are generated according to β2 , β4 , β 8 , . . . until a repetition occurs in the generated elements. Accordingly, we can generate the conjugates of β ¼ α3 as follows:  2 β2 ! α3 ! α6  2 β4 ! α6 ! α12  2 β8 ! α12 ! α24 ! α9  2 β16 ! α9 ! α18 ! α3 is the same as β; stop here: Thus, the conjugate class including β ¼ α3 can be written as 

   β, β2 , β4 , β8 ! α3 , α6 , α12 , α9 :

Example 5.9 For the previous example, find the conjugates of α6. Solution 5.9 Let β ¼ α6; the conjugates of β can be found as  2 β2 ! α6 ! α12  2 β4 ! α12 ! α24 ! α9  2 β8 ! α9 ! α18 ! α3  2 β16 ! α3 ! α6 ! α6 is the same as β; stop here: Hence we found the conjugates of α6 as

158

5 Galois Fields

 3 12 9  α ,α ,α :

5.4

Order of a Finite Field Element

Let β be an element of the extended field GF(2m). The order of β is an integer n such that βn ¼ 1: Example 5.10 Let p(x) be a primitive polynomial with degree 4. If α is a root of the equation p(x) ¼ 0, then the powers of α can be used to construct the extended field GF(24) as     GF 24 ¼ 0, 1, α, α2 , α3 , . . . , α14 and we have α15 ¼ 1:

ð5:46Þ

The order of the elements β1 ¼ α5 and β2 ¼ α10 is 3, since we have  3 ðβ1 Þ3 ¼ α5 ! ðβ1 Þ3 ¼ α15 ! 1  3 ðβ2 Þ3 ¼ α10 ! ðβ2 Þ3 ¼ α30 ! 1: Remark In a conjugate class, all the elements have the same order. Remark Let β be an element of the extended field GF(2m). If the order of β is an integer r, i.e., βr ¼ 1, then we can say that r is a divider of 2m  1. Remark The element β of the extended field GF(2m) is a primitive element, if the order of β is 2m  1. Primitive element is the element such that by taking its successive powers we can generate all the other field elements. Example 5.11 What can be the order of the elements in the extended field GF(26)? Solution 5.11 The orders of elements are the dividers of 26  1 ¼ 63. The integer 63 can be written as 63 ¼ 3  3  7 from which we can conclude that the order of an element in GF(26) can be one of the numbers

5.5 Minimal Polynomials

159

3, 9, 7, 21, and 63: Example 5.12 In GF(24), the order of the elements α, α2, α4, α7, α8, α11, α13, α14 is the same, and it is 1. This means that they are all primitive elements. Remark Using the powers of primitive elements, we can generate all the field elements.

5.5

Minimal Polynomials

Minimal polynomials are defined for conjugate classes. Each conjugate class has its own minimal polynomial. If a conjugate class is given as J ¼ fβ 1 , β 2 , . . . β k g

ð5:47Þ

then the minimal polynomial of the conjugate class J is calculated as mðxÞ ¼ ðx þ β1 Þðx þ β2 Þ . . . ðx þ βk Þ:

ð5:48Þ

When the equation Eq. (5.48) is expanded, we get a polynomial with binary coefficients, i.e., extended field elements other than the binary ones do not appear as the coefficients of the polynomial. In other words, although the roots are in the extended field, the coefficients of the polynomial are all in the base field. Note Minimal polynomials are irreducible polynomials, and they can also be primitive polynomials. Example 5.13 Assume that the polynomial p(x) ¼ x3 + x + 1 is used to construct the extended field GF(23). Find the conjugates of β ¼ α3, and find the minimal polynomial of the conjugate class. Solution 5.13 The conjugates of α3 can be evaluated as  2 β2 ! α3 ! α6  2 β4 ! α6 ! α12 ! α5  2 β8 ! α5 ! α10 ! α3 is the same as β: Thus the conjugate class including β can be written as     J ¼ β, β2 , β4 ! J ¼ α3 , α6 , α5 : The minimal polynomial of J can be formed as

160

5 Galois Fields

       mðxÞ ¼ ðx þ βÞ x þ β2 x þ β4 ! mðxÞ ¼ x þ α3 x þ α6 x þ α5 which can be simplified using as the recursive equation α3 ¼ α + 1, α7 ¼ 1, and extended field elements 8 9 =  3 < 2 αffl{zffl þ ffl1}, |fflffl α2ffl{zfflffl þ fflα}, |fflfflfflfflfflffl α2 þffl{zfflfflfflfflfflffl α þ ffl1}, α þ 1 GF 2 ¼ 0, 1, α, α2 , |ffl |fflfflffl{zfflfflffl}; : α3

α4

α5

ð5:49Þ

α6

as     mðxÞ ¼ x þ α3 x þ α6 x þ α5 0 1     α9 A x þ α5 ¼ @x2 þ α6 þ α3 x þ |{z} 0

1

α6 þ |{z} α5 þ |{z} α3 Ax2 þ ¼ x3 þ @|{z} α2 þ1

α2 þαþ1

αþ1

¼α2



  α6 þ α3 α5 þ α2 x þ |{z} α14

0

1

¼1

¼ x3 þ x2 þ @|{z} α4 þ α þ α2 Ax þ 1 α2 þα

¼ x3 þ x2 þ 1: Hence, we found the minimal polynomial of the conjugate class J ¼ {α3, α6, α5} as mðxÞ ¼ x3 þ x2 þ 1: The conjugate classes and the corresponding minimal polynomials for GF(23) are depicted in Table 5.2. If we multiply the minimal polynomials m1(x), m2(x), and m3(x), we get    ðx þ 1Þ x3 þ x þ 1 x3 þ x2 þ 1 ! x7 þ 1: We used the polynomial p(x) ¼ x3 + x + 1 to generate the GF(23). When we inspect the Table 5.2, we see that the polynomial used to generate the extended field is one of the minimal polynomials of conjugate classes.

5.5 Minimal Polynomials

161

Table 5.2 The conjugate classes and the corresponding minimal polynomials for GF (23)

Conjugate classes in GF(23) J0 ¼ {0} J1 ¼ {1} J2 ¼ {α, α2, α4} J3 ¼ {α3, α5, α6}

Table 5.3 Generation of GF (23) by different primitive polynomials

p(x) ¼ x3 + x + 1 0!0 1!1 α!α α2 ! α 2 α3 ! α + 1 α4 ! α2 + α α5 ! α2 + α + 1 α6 ! α2 + 1

Minimal polynomials m0(x) ¼ x m1(x) ¼ x + 1 m2(x) ¼ x3 + x + 1 m3(x) ¼ x3 + x2 + 1 p(x) ¼ x3 + x2 + 1 0!0 1!1 α!α α2 ! α2 α3 ! α2 + 1 α4 ! α2 + α + 1 α5 ! α + 1 α6 ! α2 + α

If we use the polynomial p(x) ¼ x3 + x2 + 1 to generate the field elements, we obtain the extended field GF(23) as 8 9 =  3 < 2 α2ffl{zfflffl þ ffl1}, |fflfflfflfflfflffl α2 þffl{zfflfflfflfflfflffl α þ ffl1}, α þ 1 , α þ α GF 2 ¼ 0, 1, α, α2 , |fflffl |fflffl{zfflffl} |fflfflffl{zfflfflffl};: : α3

α4

ð5:50Þ

α6

α5

If we compare Eqs. (5.50) to (5.49), we see that, although the same set of polynomials are generated, the corresponding αi terms of the polynomials are different from each other. This comparison is depicted in Table 5.3. The minimal polynomial of the conjugate class J ¼ {α3, α6, α5} using α3 ¼ α2 + 1, 7 α ¼ 1 and extended field elements 8 9 =  3 < 2 2 2 þ 1 , α þ α þ 1 , α þ 1 , α þ α GF 2 ¼ 0, 1, α, α2 , α |fflfflffl{zfflfflffl} |fflfflfflfflfflfflffl{zfflfflfflfflfflfflffl} |fflffl{zfflffl} |fflfflffl{zfflfflffl}; : α3

α4

α5

can be calculated as     mðxÞ ¼ x þ α3 x þ α6 x þ α5 0 1     α9 A x þ α5 ¼ @x2 þ α6 þ α3 x þ |{z} ¼α2

α6

162

5 Galois Fields

0

1

¼ x3 þ @|{z} α6 þ |{z} α5 þ |{z} α 3 Ax2 þ α2 þα

αþ1

α2 þ1



  α14 α6 þ α3 α5 þ α2 x þ |{z}

0

1

¼1

¼ x3 þ 0x2 þ @ |{z} α4 þ α þ α2 Ax þ 1 α2 þαþ1

¼ x3 þ x þ 1: Thus, we see that if p(x) ¼ x3 + x + 1 is used for the generation of extended field GF(23), then the minimal polynomial of the conjugate class J ¼ {α3, α6, α5} happens to be mðxÞ ¼ x3 þ x2 þ 1: On the other hand, if p(x) ¼ x3 + x2 + 1 is used for the generation of extended field GF(23), then the minimal polynomial of the conjugate class J ¼ {α3, α6, α5} happens to be mðxÞ ¼ x3 þ x þ 1: Example 5.14 Assume that p(x) is a primitive polynomial with degree 4, and it is used for the generation of the extended field GF(24). Write all the conjugate classes, and show that the extended field GF(24) can be written as the union of all conjugate classes. Solution 5.14 In GF(24), we have α15 ¼ 1. Using the equality α15 ¼ 1, we can form the conjugates of β ¼ α as in β2 ! α2  2 β4 ! α2 ! α4  2 β8 ! α4 ! α8  2 β16 ! α8 ! α16 ! α which is the same as β: Thus, the conjugate class including α can be written as   J 2 ¼ α, α2 , α4 , α8 :

5.5 Minimal Polynomials

163

To find another conjugate class, first, we look for an element of GF(24) which is not available in the previously constructed conjugate classes. Such an element is α3, since α3 2 GF(24) and α3 2 = J2. The conjugates of β ¼ α3 can be determined as  2 β2 ! α3 ! α6  2 β4 ! α6 ! α12  2 β8 ! α12 ! α24 ! α9  2 β16 ! α9 ! α18 ! α3 which is the same as β: Thus, the conjugate class including α3 can be written as   J 3 ¼ α3 , α6 , α12 , α9 : To find another conjugate class, we look for an element of GF(24) which is not available in J2 and J3. Such an element is α5, since α5 2 GF(24) and α5 2 = J2, α5 2 = J 3. 5 The conjugates of β ¼ α can be determined as  2 β2 ! α5 ! α10  2 β4 ! α10 ! α5 which is the same as β: Thus, the conjugate class including α5 can be written as   J 4 ¼ α5 , α10 : To find another conjugate class, we look for an element of GF(24) which is not available in J2, J3, and J4. Such an element is α7, since α7 2 GF(24) and α7 2 = J 2, α7 2 = J3, α7 2 = J4. The conjugates of β ¼ α7 can be determined as  2 β2 ! α7 ! α14  2 β4 ! α14 ! α28 ! α13  2 β8 ! α13 ! α26 ! α11

164

5 Galois Fields

Table 5.4 Conjugate classes for GF(24)

J0 ¼ {0} J1 ¼ {1} J2 ¼ {α, α2, α4, α8} J3 ¼ {α3, α6, α12, α9} J4 ¼ {α5, α10} J5 ¼ {α7, α14, α13, α11}

 2 β16 ! α11 ! α7 which is the same as β: Thus, the conjugate class including α7 can be written as   J 5 ¼ α7 , α14 , α13 , α11 : Considering the base field elements, we can write all the conjugate classes as in Table 5.4. The extended field GF(24) can be written as the union of conjugate classes, i.e., we have   GF 24 ¼ J 0 [ J 1 [ J 2 [ J 3 [ J 4 [ J 5 : Example 5.15 Using the primitive polynomial p(x) ¼ x4 + x + 1, generate the extended field GF(24), and obtain the minimal polynomials of all the conjugate classes. Solution 5.15 If α is a root of the equation p(x) ¼ 0, we can write the recursive expression α4 ¼ α þ 1:

ð5:51Þ

The extended field elements using the powers of α can be written as     GF 24 ¼ 0, 1, α, α2 , α3 , α4 , α,5 , α6 , α7 , α8 , α9 , α10 , α11 , α12 , α13 , α14 :

ð5:52Þ

We can obtain the polynomial equivalents of power of α in Eq. (5.52) using Eq. (5.51) as in

5.5 Minimal Polynomials

165

0!0 1!1 α!α α2 ! α2 α3 ! α3 α4 ! α þ 1 α5 ! α2 þ α α6 ! α3 þ α2 α7 ! α3 þ α þ 1 α8 ! α2 þ 1

ð5:53Þ

α9 ! α3 þ α α10 ! α2 þ α þ 1 α11 ! α3 þ α2 þ α α12 ! α3 þ α2 þ α þ 1 α13 ! α3 þ α2 þ 1 α14 ! α3 þ 1: The conjugate classes of the extended field GF(24) are evaluated in the previous example, and they are given in Table 5.4 as J 0 ¼ f0g J 1 ¼ f1g   J 2 ¼ α, α2 , α4 , α8   J 3 ¼ α3 , α6 , α12 , α9   J 4 ¼ α5 , α10   J 5 ¼ α7 , α14 , α13 , α11 : The minimal polynomials of the conjugate classes can be formed as J 0 ¼ f0g ! m0 ðxÞ ¼ x þ 0 J 1 ¼ f1g ! m1 ðxÞ ¼ x þ 1      J 2 ¼ α, α2 , α4 , α8 ! m2 ðxÞ ¼ ðx þ αÞ x þ α2 x þ α4 x þ α8        J 3 ¼ α3 , α6 , α12 , α9 ! m3 ðxÞ ¼ x þ α3 x þ α6 x þ α12 x þ α9      J 4 ¼ α5 , α10 ! m4 ðxÞ ¼ x þ α5 x þ α10 

166

5 Galois Fields

       J 5 ¼ α7 , α14 , α13 , α11 ! m5 ðxÞ ¼ x þ α7 x þ α14 x þ α134 x þ α11 where the minimal polynomials can be simplified using the polynomial equivalents of powers of α in Eq. (5.53) and the equality α15 ¼ 1 as J 0 ¼ f0g ! m0 ðxÞ ¼ x þ 0 ! m0 ðxÞ ¼ x J 1 ¼ f1g ! m1 ðxÞ ¼ x þ 1 ! m1 ðxÞ ¼ x þ 1   J 2 ¼ α, α2 , α4 , α8 ! m2 ðxÞ ¼ x4 þ x þ 1   J 3 ¼ α3 , α6 , α12 , α9 ! m3 ðxÞ ¼ x4 þ x3 þ x2 þ x þ 1   J 4 ¼ α5 , α10 ! m4 ðxÞ ¼ x2 þ x þ 1   J 5 ¼ α7 , α14 , α13 , α11 ! m5 ðxÞ ¼ x4 þ x3 þ 1 in which we see that a minimal polynomial includes coefficients only from the base field. Example 5.16 Assume that, using a primitive polynomial p(x) of degree 5, we generate the extended field GF(25). The minimal polynomial of a conjugate class is given as mðxÞ ¼ x3 þ α2 x þ x þ α3 : Comment on the calculated minimal polynomial. Comment The minimal polynomial given in the question contains coefficients from the extended field elements. Such a minimal polynomial cannot exist. It is a fake minimal polynomial.

5.6

Polynomials in Extended Fields

Polynomials can be constructed using the extended field GF(2m) elements for the coefficients of xi terms. For instance, using the elements of     GF 23 ¼ 0, 1, α, α2 , α3 , α4 , α5 , α6 we can define the polynomials p1 ðxÞ ¼ α3 x5 þ αx3 þ α3 x2 þ x þ α4

5.6 Polynomials in Extended Fields

167

p2 ðxÞ ¼ α6 x6 þ α3 x4 þ α5 x2 þ 1: While adding or multiplying two polynomials in GF(2m), we use the recursive statement obtained from p(α) ¼ 0, where p(x) is a primitive polynomial and α is a root of p(x), and αm  1 ¼ 1 for the simplification of the coefficients in the resulting polynomial. Example 5.17 Using the primitive polynomial p(x) ¼ x3 + x + 1, we generate the extended field GF(23). Two polynomials over GF(23) are defined as p1 ðxÞ ¼ αx6 þ α2 x4 þ α3 x2 þ α p2 ðxÞ ¼ α6 x6 þ α3 x4 þ α5 x2 þ 1: Find p1(x) + p2(x) and p1(x)  p2(x). Solution 5.17 The extended field GF(23) can be written as     GF 23 ¼ 0, 1, α, α2 , α3 , α4 , α5 , α6 where the αi terms can be expressed by polynomials as 0!0 1!1 α!α α2 ! α2 α3 ! α þ 1 α4 ! α2 þ α α5 ! α2 þ α þ 1 α6 ! α2 þ 1: In addition, we have α7 ¼ 1 and α3 ¼ α þ 1: The addition of polynomials p1(x) and p1(x) results in pð x Þ ¼ p1 ð x Þ þ p2 ð x Þ !     pðxÞ ¼ α þ α x6 þ α2 þ α3 x4 þ α3 þ α5 x2 þ α þ 1 

 6

where the coefficients can be simplified as

168

5 Galois Fields

α þ α6 ! α þ α2 þ 1 ! α5 α2 þ α3 ! α2 þ α þ 1 ! α5 α3 þ α5 ! α þ 1 þ α2 þ α þ 1 ! α2 α þ 1 ! α3 leading to the simplified expression pðxÞ ¼ α5 x6 þ α5 x4 þ α2 x2 þ α3 : The multiplication of p1(x) and p2(x) can be performed as    p1 ðxÞ  p2 ðxÞ ¼ αx6 þ α2 x4 þ α3 x2 þ α α6 x6 þ α3 x4 þ α5 x2 þ 1 ¼ α7 x12 þ α4 x10 þ α6 x8 þ αx6 þ α8 x10 þ α5 x8 þ α7 x6 þ α2 x4 þ α9 x8 þ α6 x6 þ α8 x4 þ α3 x2 þ α7 x6 þ α4 x4 þ α6 x2 þ α in which, adding the confidents of the same powers of x, we obtain     p1 ðxÞ  p2 ðxÞ ¼ α7 x12 þ α4 þ α8 x10 þ α6 þ α5 þ α9 x8       þ α þ α7 þ α6 þ α7 x6 þ α2 þ α8 þ α4 x4 þ α3 þ α6 x2 þ α in which, using α7 ¼ 1 and polynomial forms in the powers of α, we obtain the expression     p1 ðxÞ  p2 ðxÞ ¼ x12 þ α2 þ α þ α x10 þ α2 þ 1 þ α2 þ α þ 1 þ α2 x8       þ α þ α2 þ 1 x6 þ α2 þ α þ α2 þ α x4 þ α þ 1 þ α2 þ 1 x2 þ α leading to       p1 ðxÞ  p2 ðxÞ ¼ x12 þ α2 x10 þ α þ α2 x8 þ α þ α2 þ 1 x6 þ ð0Þx4   þ α þ α 2 x2 þ α in which, expressing the coefficients as powers of α, we get the simplified expression p1 ðxÞ  p2 ðxÞ ¼ x12 þ α2 x10 þ α4 x8 þ α5 x6 þ α4 x2 þ α:

5.7 Binary Representation of Extended Field Elements

5.7

169

Binary Representation of Extended Field Elements

In Chap. 1, we stated that the polynomials can be represented by number vectors, and the vector elements are the coefficients of the polynomials. This rule is valid for the polynomials in finite extended fields. However, in this case, since the coefficients of the polynomials are also polynomials, we can also represent the coefficients by binary vectors. Example 5.18 We can represent the polynomial p1 ðxÞ ¼ α5 x6 þ α4 x4 þ α3 x2 þ α whose coefficients are selected from the extended finite field GF(23), which is constructed using the primitive polynomial p(x) ¼ x3 + x + 1, in vector form as   p1 ¼ α5 0 α4 0 α3 0 α :

ð5:54Þ

The powers of α in Eq. (5.54) can be represented in polynomial forms as α5 ! α2 þ α þ 1 α4 ! α2 þ α α3 ! α þ 1 α1 ! α where the polynomials can be expressed using bit groups consisting of three bits as α5 ! α2 þ α þ 1 ! 111 α4 ! α2 þ α ! 110 α3 ! α þ 1 ! 011 α1 ! α ! 010:

ð5:55Þ

Using the binary representation of the polynomials in Eq. (5.55), we obtain its vector form as p1 ¼ ½111 000 110 000 011 000 010: Note that 0 polynomial is represented as 000.

ð5:56Þ

170

5.8

5 Galois Fields

Equations in Extended Fields

We can define equations having coefficients from an extended finite field. For instance, using some elements of the extended field GF(23) for coefficients, we can define the equation pair α2 x þ αy ¼ α4 αx þ α3 y ¼ α5 : To find the solutions of the equations with coefficients from the extended field, we follow the same method while finding the solutions of equations having coefficients in the real number field. We try to eliminate one of the variables, in case that there is more than one variable. Example 5.19 Assume that, using the primitive polynomial p(x) ¼ x3 + x + 1, we construct the extended field GF(23), and two equations in GF(23) are given as α2 x þ α3 y ¼ α4 α4 x þ α2 y ¼ α5 :

ð5:57Þ

Find the solution of Eq. (5.57). Solution 5.19 The elements of the extended field GF(23) can be written as 0!0 1!1 α!α α2 ! α2 α3 ! α þ 1 α4 ! α2 þ α α5 ! α2 þ α þ 1 α6 ! α2 þ 1: Using the polynomial form of the extended field elements and the equality α7 ¼ 1, we can find the solution of Eq. (5.57) as follows: We multiply the first equation by α2 and sum the two equations, i.e.,   α2 α2 x þ α3 y ¼ α4

5.9 Matrices in Extended Fields

171

α4 x þ α2 y ¼ α5 leading to 

   α5 þ α2 y ¼ α6 þ α5 ! α2 þ α þ 1 þ α2 y ¼ α2 þ 1 þ α2 þ α þ 1 ! ðα þ 1Þy ¼ α ! α3 y ¼ α ! α4 α3 y ¼ α4 α ! y ¼ α5 :

Putting the root y ¼ α5 into α2x + α3y ¼ α4, we get α2 x þ α3 α5 ¼ α4 ! α2 x þ α ¼ α4 ! α2 x ¼ α4 þ α ! α2 x ¼ α2 þ α þ α ! x ¼ 1: Thus, the roots of the equation pair are   ðx, yÞ ¼ 1, α5 : Exercise Assume that, using the primitive polynomial p(x) ¼ x3 + x + 1, we construct the extended field GF(23) and two equations in GF(23) are given as α4 x þ α2 y ¼ α3 α2 x þ α3 y ¼ α2

ð5:58Þ

Find the solution of Eq. (5.58).

5.9

Matrices in Extended Fields

As in real number field, we can define matrices with elements in finite fields. Once we define a matrix, we can calculate its determinant or inverse. Example 5.20 In GF(23) constructed using p(x) ¼ x3 + x + 1, a square matrix is given as

α2 A¼ α Find the inverse of Eq. (5.59)

α4 : α2

ð5:59Þ

172

5 Galois Fields

Solution 5.20 The determinant of Eq. (5.59) is calculated as 2 α α2

α4 ¼ α2 α2 þ α2 α4 ! α4 þ α6 ¼ α2 þ α þ α2 þ 1 ! α þ 1 ! α3 : α2

Using the determinant, we can calculate the inverse of Eq. (5.59) as in

α2

α4

α

α2

1 ¼

1 α2 α3 α4

α



α2

!

1 α9 α3 α4

α8 α9



!

α6

α5

α

α6

:

Properties Consider the polynomial pðxÞ ¼ an xn þ an1 xn1 þ a1 x þ a0 defined in the extended field GF(2m). The square of the polynomial is calculated as ½pðxÞ2 ¼ ðan Þ2 x2n þ ðan1 Þ2 x2ðn1Þ þ ða1 Þ2 x2 þ ða0 Þ2 : In general, for k ¼ 2r, we can write that ½pðxÞk ¼ ðan Þk xkn þ ðan1 Þk xkðn1Þ þ ða1 Þk xk þ ða0 Þk :

ð5:60Þ

Example 5.21 We can write that  3 2 x þ x2 ¼ x6 þ x4  2  2  3 2  x þ x2 þ x ¼ x3 þ x2 þ x ! x3 þ x2 þ x2 ! x6 þ x4 þ x2 : Another example is 

x5 þ x3 þ x þ 1

4

¼ x20 þ x12 þ x4 þ 1:

In GF(24), we can write that  2 3 8  8 α x þ x þ α5 ¼ α16 x24 þ x8 þ α40 ! α2 x3 þ x þ α5 ¼ x24 þ x8 þ α8 where we used the equality α16 ¼ 1.

Matrices in Extended Fields

173

Example 5.22 Simplify the following mathematical term in GF(24)  3 2 8 α x þ α2 x þ α : Solution 5.22 Using the property in Eq. (5.60) and equality α15 ¼ 1, we can evaluate (α3x2 + α2x + α)8 as in 

α3 x2 þ α2 x þ α

8

 8  8 ! α3 x2 þ α2 x þ α8 ! α9 x16 þ αx þ α8 :

Theorem The roots of xn + 1 where m ¼ 2m  1 are all the nonzero elements of the extended field GF(2m). Theorem The minimal polynomials of the conjugate classes are either irreducible or primitive polynomials. Note that primitive polynomials are already irreducible polynomials. Property A polynomial in GF(2m) can be represented by an m-bit vector. Notation The conjugates of β ¼ αi are evaluated according to  2 4 8  β, β , β , β , . . . :

ð5:61Þ

The minimal polynomial of the conjugate class can be denoted by m(x), or considering the powers of the elements in Eq. (5.61), we can denote the same minimal polynomial by mi ðxÞ, m2i ðxÞ, m4i ðxÞ, . . . that is, mðxÞ ¼ mi ðxÞ ¼ m2i ðxÞ ¼ m4i ðxÞ . . . Although the minimal polynomial is defined for a conjugate class, we can label the minimal polynomial considering its roots which are the elements of the conjugate class.

174

5 Galois Fields

Problems 1. Decide whether the polynomials x4 þ x þ 1

x4 þ x2 þ x þ 1

are irreducible polynomials or not. 2. Construct the extended field GF(24) using the primitive polynomial p (x) ¼ x4 + x3 + 1. Repeat the construction process using the primitive polynomial p(x) ¼ x4 + x + 1. Comment on the field elements for both constructions. 3. Decide whether the polynomial pð x Þ ¼ x 5 þ x 4 þ x 2 þ x þ 1 is a primitive polynomial or not. 4. Find all the conjugate classes of GF(25). How many minimal polynomials do we have in GF(25)? 5. Obtain the binary representation of the polynomial pðαÞ ¼ α2 þ α in GF(23) and GF(25). 6. Assume that the extended field GF(25) is constructed using the primitive polynomial p(x) ¼ x5 + x3 + 1. Obtain the conjugates of α3 in GF(25), and find the minimal polynomial for the obtained conjugate class. 7. Factorize x15 + 1. 8. Expand (x4 + α2x3 + α5x + α3)4 in GF(23). 9. Obtain the binary representation of the polynomial p(x) ¼ x4 + α4x3 + α12x + α9 in GF(23) and GF(25). Assume that the primitive polynomials p(x) ¼ x3 + x + 1 and p(x) ¼ x5 + x3 + x2 + x + 1 are used for the construction of the extended fields GF(23) and GF(25). 10. Evaluate the inverses of α2, α2 + 1 in GF(23). Use the primitive polynomial p (x) ¼ x3 + x2 + 1. pffiffiffiffiffi pffiffiffiffiffi pffiffiffiffiffi 11. Calculate 3 α4 , 2 α3 , 5 α2 in GF(23). 12. Find the roots of x3 + α3x2 + α5x + α ¼ 0 in GF(24). Determine the p(x) used to construct the extended field GF(24) by yourself. 13. Using p(x) ¼ x2 + x + 1, construct GF(22). Find all the conjugate classes; calculate the minimal polynomials. 14. Solve the equation set

Problems

175

α3 x þ αy ¼ α2 α5 x þ α2 y ¼ α4 in GF(23). Use p(x) ¼ x3 + x + 1 as your primitive polynomial. 15. Find the determinant of the matrix A¼

α

α2

α3

α8



in GF(24). Use p(x) ¼ x4 + x + 1 as your primitive polynomial. 16. Calculate the inverse of the matrix A¼

α4

α2

α5

α8



in GF(24). Use p(x) ¼ x4 + x + 1 as your primitive polynomial. 17. Calculate the inverse of the matrix 2

α2

α6

α7

α4 α9

6 A ¼ 4 α3

α5

3

7 α4 5 α12

in GF(24). Use p(x) ¼ x4 + x + 1 as your primitive polynomial. 18. Find the solution of the equation set α3 x þ α9 y þ αz ¼ α5 α7 x þ α2 y þ α2 z ¼ α13 α3 x þ α4 y þ α3 z ¼ α6 in GF(24). Use p(x) ¼ x4 + x + 1 as your primitive polynomial.

Chapter 6

BCH Codes

6.1

BCH Codes and Generator Polynomials of BCH Codes

Consider that using a primitive polynomial, we generate the extended field GF(2m) which is written as   GF ð2m Þ ¼ 0, 1, α, α2 , . . . , αl

where l ¼ 2m  2:

ð6:1Þ

Let’s denote the minimal polynomial of the conjugate class in which αi appears by mi(x); in other words, mi(x) is the minimal polynomial of αi. The generator polynomial of a t-error-correcting BCH code is obtained as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, m5 ðxÞ, . . . , m2t1 g

ð6:2Þ

where LCM denotes the least common multiple operation. The parameters of a BCH code can be specified as BCH ðn, kÞ ¼ BCH ð2m  1, 2m  1  r Þ

ð6:3Þ

where r is the degree of the generator polynomial g(x) given in Eq. (6.2). BCH codes are cyclic codes. Example 6.1 Obtain the generator polynomial of the single-error-correcting BCH code. Use GF(23) which is constructed using the primitive polynomial p (x) ¼ x3 + x + 1. Solution 6.1 The conjugate classes and the corresponding minimal polynomials can be obtained as in Table 6.1. The generator polynomial of the single-error-correcting BCH code can be calculated as

© Springer Nature Switzerland AG 2020 O. Gazi, Forward Error Correction via Channel Coding, https://doi.org/10.1007/978-3-030-33380-5_6

177

178

6 BCH Codes

Table 6.1 Conjugate classes and minimal polynomials for GF(23)

Conjugate classes 0 1 α, α2, α4 α3, α5, α6

Minimal polynomials x x+1 m1(x) ¼ x3 + x + 1 m3(x) ¼ x3 + x2 + 1

gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞg ! gðxÞ ¼ m1 ðxÞ ! gðxÞ ¼ x3 þ x þ 1: The degree of the generator polynomial is r ¼ 3. Then, the parameters of the BCH code can be calculated using m ¼ 3 and r ¼ 6 as BCH ðn, kÞ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH ð7, 4Þ: Example 6.2 Obtain the generator polynomial of the double-error-correcting BCH code. Use GF(23) which is constructed using the primitive polynomial p (x) ¼ x3 + x + 1. Solution 6.2 Using Table 6.1, the generator polynomial of the double-errorcorrecting BCH code can be calculated as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞg ! gðxÞ ¼ m1 ðxÞm3 ðxÞ ! gðxÞ ¼ x6 þ x5 þ x4 þ x3 þ x2 þ x þ 1: The degree of the generator polynomial is r ¼ 6. Then, the parameters of the BCH code can be calculated using m ¼ 3 and r ¼ 6 as BCH ðn, kÞ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH ð7, 1Þ which is a repetition code. If we count the nonzero coefficients of the generator polynomial, we see that the minimum distance of the code is dmin ¼ 7, and this means that the designed code can correct up to three-bit errors. That is, although we started to design a BCH code that can correct two-bit errors, we came up with a code that can correct up to three-bit errors. Example 6.3 Obtain the generator polynomial of the single-error-correcting BCH code. Use GF(24) which is constructed using the primitive polynomial p (x) ¼ x4 + x + 1. Solution 6.3 Using the minimal polynomials of Table 6.2, the generator polynomial of the single-error-correcting BCH code can be calculated as

6.1 BCH Codes and Generator Polynomials of BCH Codes Table 6.2 Conjugate classes and minimal polynomials for GF(24)

Conjugate classes 0 1 α, α2, α4, α6 α3, α6, α9, α12 α5, α10 α7, α11, α13, α14

179 Minimal polynomials x x+1 m1(x) ¼ x4 + x + 1 m3(x) ¼ x4 + x3 + x2 + x + 1 m5(x) ¼ x2 + x + 1 m7(x) ¼ x4 + x3 + 1

gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞg ! gðxÞ ¼ m1 ðxÞ ! gðxÞ ¼ x4 þ x þ 1: The degree of the generator polynomial is r ¼ 4. Then, the parameters of the BCH code can be calculated as   BCH ðn, k Þ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH 24  1, 24  1  4 ! BCH ð15, 11Þ: Exercise For the previous example, calculate the generator matrix using the generator polynomial. Example 6.4 Obtain the generator polynomial of the double-error-correcting BCH code. Use GF(24) which is constructed using the primitive polynomial p (x) ¼ x4 + x + 1. Solution 6.4 The conjugate classes and the corresponding minimal polynomials are given in Table 6.2. The generator polynomial of the double-error-correcting BCH code can be calculated as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞg !    gðxÞ ¼ m1 ðxÞm3 ðxÞ ! gðxÞ ¼ x4 þ x þ 1 x4 þ x3 þ x2 þ x þ 1 !    gðxÞ ¼ x4 þ x þ 1 x4 þ x3 þ x2 þ x þ 1 ! gðxÞ ¼ x8 þ x7 þ x6 þ x4 þ 1: The degree of the generator polynomial is r ¼ 8. Then, the parameters of the BCH code can be calculated as   BCH ðn, k Þ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH 24  1, 24  1  8 ! BCH ð15, 7Þ: Exercise For the previous example, using the generator polynomial, construct the generator matrix of the BCH(15, 7) cyclic code.

180

6 BCH Codes

Example 6.5 Obtain the generator polynomial of the triple-error-correcting BCH code. Use GF(24) which is constructed using the primitive polynomial p (x) ¼ x4 + x + 1. Solution 6.5 The conjugate classes and the corresponding minimal polynomials can be obtained as in Table 6.2. The generator polynomial of the double-error-correcting BCH code can be calculated as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, m5 ðxÞg ! gðxÞ ¼ m1 ðxÞm3 ðxÞm5 ðxÞ !  4    gð x Þ ¼ x þ x þ 1 x 4 þ x 3 þ x 2 þ x þ 1 x 2 þ x þ 1 ! gðxÞ ¼ x10 þ x8 þ x5 þ x4 þ x2 þ x þ 1: The degree of the generator polynomial is r ¼ 10. Then, the parameters of the BCH code can be calculated as   BCH ðn, k Þ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH 24  1, 24  1  10 ! BCH ð15, 5Þ: Example 6.6 Obtain the generator polynomial of the four-bit error-correcting BCH code. Use GF(24) which is constructed using the primitive polynomial p (x) ¼ x4 + x + 1. Solution 6.6 The conjugate classes and the corresponding minimal polynomials are given in Table 6.2. The generator polynomial of the double-error-correcting BCH code can be calculated as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, m5 ðxÞ, m7 ðxÞg ! gðxÞ ¼ m1 ðxÞm3 ðxÞm5 ðxÞm7 ðxÞ !      gð x Þ ¼ x 4 þ x þ 1 x 4 þ x 3 þ x 2 þ x þ 1 x 2 þ x þ 1 x 4 þ x 3 þ 1 ! 

gðxÞ ¼ x14 þ x13 þ x12 þ x11 þ x10 þ x9 þ x8 þ x7 þ x6 þ x5 þ x4 þ x3 þ x2 þ x þ 1: The degree of the generator polynomial is r ¼ 14. Then, the parameters of the BCH code can be calculated as   BCH ðn, k Þ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH 24  1, 24  1  14 ! BCH ð15, 1Þ

6.1 BCH Codes and Generator Polynomials of BCH Codes

181

Table 6.3 BCH codes generated over GF(24) Code designed BCH(15,11) BCH(15,7) BCH(15,5) BCH(15,1)

Generator polynomial g(x) ¼ x4 + x + 1 g(x) ¼ x8 + x7 + x6 + x4 + 1 g(x) ¼ x10 + x8 + x5 + x4 + x2 + x + 1 g(x) ¼ x14 + x13 + x12 + x11 + x10 + x9 + x8 + x7 + x6 + x5 + x4 + x3 + x2 + x + 1

Table 6.4 Conjugate classes and minimal polynomials for GF(25)

Conjugate classes 0 1 α, α2, α4, α8, α16 α3, α6, α12, α24, α17 α5, α10, α20, α9, α18 α7, α14, α28, α25, α19 α11, α22, α13, α26, α21 α15, α30, α29, α27, α23

Minimum distance and error correction capability dmin ¼ 3 tc ¼ 1 dmin ¼ 5 tc ¼ 2 dmin ¼ 7 tc ¼ 3 dmin ¼ 15 tc ¼ 7

Minimal polynomials x x+1 m1(x) ¼ x5 + x2 +1 m3(x) ¼ x5 + x4 + x3 + x2 +1 m5(x) ¼ x5 + x4 + x2 + x + 1 m7(x) ¼ x5 + x3 + x2 + x + 1 m11(x) ¼ x5 + x4 + x3 + x + 1 m15(x) ¼ x5 + x3 + 1

which is a repetition code. If we count the nonzero coefficients of the generator polynomial, we see that the minimum distance of the code is dmin ¼ 15, and this means that the designed code can correct up to seven-bit errors. That is, although we started to design a BCH code that can correct five-bit errors, we came up with a code that can correct up to seven-bit errors. The BCH(n, k) codes designed in GF(24), constructed using the private polynomial, can be summarized in Table 6.3. Example 6.7 Obtain the generator polynomial of the single-error-correcting BCH code. Use GF(25) which is constructed using the primitive polynomial p (x) ¼ x5 + x2 + 1. Solution 6.7 Using the minimal polynomials of Table 6.4, the generator polynomial of the single-error-correcting BCH code can be calculated as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞg ! gðxÞ ¼ m1 ðxÞ ! gðxÞ ¼ x5 þ x2 þ 1: The degree of the generator polynomial is r ¼ 5. Then, the parameters of the BCH code can be calculated as   BCH ðn, k Þ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH 25  1, 25  1  5 ! BCH ð31, 26Þ:

182

6 BCH Codes

Example 6.8 Obtain the generator polynomial of the double-error-correcting BCH code. Use GF(25) which is constructed using the primitive polynomial p (x) ¼ x5 + x2 + 1. Solution 6.8 Using the minimal polynomials of Table 6.4, the generator polynomial of the double-error-correcting BCH code can be calculated as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞg ! gðxÞ ¼ m1 ðxÞm3 ðxÞ !   gð x Þ ¼ x þ x 2 þ 1 x 5 þ x 4 þ x 3 þ x 2 þ 1 ! 

5

gðxÞ ¼ x10 þ x9 þ x8 þ x6 þ x5 þ x3 þ 1: The degree of the generator polynomial is r ¼ 10. Then, the parameters of the BCH code can be calculated as   BCH ðn, k Þ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH 25  1, 25  1  10 ! BCH ð31, 21Þ: Considering the nonzero coefficients of the generator polynomial, we can calculate the minimum distance of the code as dmin ¼ 7. This means that the designed code can correct up to three bits. Example 6.9 Obtain the generator polynomial of the triple-error-correcting BCH code. Use GF(25) which is constructed using the primitive polynomial p (x) ¼ x5 + x2 + 1. Solution 6.9 Using the minimal polynomials of Table 6.4, the generator polynomial of the triple-error-correcting BCH code can be calculated as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, m5 ðxÞg ! gðxÞ ¼ m1 ðxÞm3 ðxÞm5 ðxÞ !     gð x Þ ¼ x 5 þ x 2 þ 1 x 5 þ x 4 þ x 3 þ x 2 þ 1 x 5 þ x 4 þ x 2 þ x þ 1 ! 

gðxÞ ¼ x15 þ x11 þ x10 þ x9 þ x8 þ x7 þ x5 þ x3 þ x2 þ x þ 1: The degree of the generator polynomial is r ¼ 15. Then, the parameters of the BCH code can be calculated as   BCH ðn, k Þ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH 25  1, 25  1  15 ! BCH ð31, 16Þ: Considering the nonzero coefficients of the generator polynomial, we can calculate the minimum distance of the code as dmin ¼ 11. This means that the designed code can correct up to five bits.

6.2 Parity Check and Generator Matrices of BCH Codes

183

Example 6.10 Obtain the generator polynomial of the four-bit error-correcting BCH code. Use GF(25) which is constructed using the primitive polynomial p (x) ¼ x5 + x2 + 1. Solution 6.10 Using the minimal polynomials of Table 6.4, the generator polynomial of the four-bit error-correcting BCH code can be calculated as gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g ! gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, m5 ðxÞ, m7 ðxÞg ! gðxÞ ¼ m1 ðxÞm3 ðxÞm5 ðxÞm7 ðxÞ !    gð x Þ ¼ x 5 þ x 2 þ 1 x 5 þ x 4 þ x 3 þ x 2 þ 1 x 5 þ x 4 þ x 2 þ x þ 1    x 5 þ x3 þ x2 þ x þ 1 ! 

gðxÞ ¼ x20 þ x18 þ x17 þ x13 þ x10 þ x9 þ x8 þ x7 þ x4 þ x2 þ 1: The degree of the generator polynomial is r ¼ 20. Then, the parameters of the BCH code can be calculated as   BCH ðn, k Þ ¼ BCH ð2m  1, 2m  1  r Þ ! BCH 25  1, 25  1  20 ! BCH ð31, 11Þ: Considering the nonzero coefficients of the generator polynomial, we can calculate the minimum distance of the code as dmin ¼ 11. This means that the designed code can correct up to five-bit errors. Exercise Repeat the previous example for GF(25) which is constructed using the primitive polynomial p(x) ¼ x5 + x3 + 1. Note The elements of GF(25) generated by p(x) ¼ x5 + x2 + 1 are given in Table 6.5.

6.2

Parity Check and Generator Matrices of BCH Codes

The parity and generator matrices of BCH codes can be obtained via two methods. Let’s now explain these two methods. Method 1 Since the BCH codes are binary cyclic codes, the methods presented in Chap. 4 for the construction of the generator and parity check matrices of the cyclic codes are also valid for BCH codes. For the reminder, if the generator polynomial of BCH code is given as gðxÞ ¼ ank xnk þ ank1 xnk1 þ . . . þ a2 x2 þ a1 x1 þ a0 x0 then the generator matrix of the BCH code is formed as

ð6:4Þ

184

6 BCH Codes

Table 6.5 Generation of GF (25) using the primitive polynomial p(x) ¼ x5 + x2 + 1

αi form 0 1 α α2 α3 α4 α5 α6 α7 α8 α9 α10 α11 α12 α13 α14 α15 α16 α17 α18 α19 α20 α21 α22 α23 α24 α25 α26 α27 α28 α29 α30

Vector form 00000 00001 00010 001000 01000 10000 00101 01010 10100 01101 11010 10001 00111 01110 11100 11101 11111 11011 10011 00011 00110 01100 11000 10101 01111 11110 11001 10111 01011 10110 01001 10010

Polynomial form 0 1 α α2 α3 α4 α2 + 1 α3 + α α4 + α2 α3 + α2 + 1 α4 + α3 + α α4 + 1 α2 + α + 1 α3 + α2 + α α4 + α3 + α2 α4 + α3 + α2 + 1 α4 + α3 + α2 + α + 1 α4 + α3 + α + 1 α4 + α + 1 α+1 α2 + α α3 + α2 α4 + α3 α4 + α2 + 1 α3 + α2 + α + 1 α4 + α3 + α2 + 1 α4 + α3 + 1 α4 + α2 + α + 1 α3 + α + 1 α4 + α2 + α α3 + 1 α4 + α

3 ank ank1 . . . a2 a1 a0 0 0 . . . 0 0 0 7 6 6 0 ank ank1 . . . a2 a1 a0 0 . . . 0 0 0 7 7 6 7 G¼6 6 0 0 ank ank1 . . . a2 a1 a0 0 . . . 0 0 7 7 6 ⋮ 5 4 0 0 0 . . . 0 0 ank ank1 . . . a2 a1 a0 kn 2

ð6:5Þ

On the other hand, if h(x) is the parity check polynomial of a cyclic code such that

6.2 Parity Check and Generator Matrices of BCH Codes

185

hðxÞ ¼ bk xk þ bk1 xk1 þ . . . þ b0 x1 þ b0 x0

ð6:6Þ

where bi 2 F ¼ {0, 1}, then, using the binary coefficients of the parity check polynomial, we construct the parity check matrix as 2

b0 b1 b2 . . . bk1 bk 0 0 . . . 0 0 0

3

7 6 6 0 b0 b1 b2 . . . bk1 bk 0 . . . 0 0 0 7 7 6 7 H¼6 6 0 0 b0 b1 b2 . . . bk1 bk 0 . . . 0 0 7 7 6 ⋮ 5 4 0 0 0 . . . 0 0 b0 b1 b2 . . . bk1 bk

:

ð6:7Þ

ðnk Þn

Example 6.11 The generator polynomial of BCH(15, 7) code is given as gðxÞ ¼ x8 þ x7 þ x6 þ x4 þ 1: Find the generator and parity check matrices of BCH(15, 7) code. Solution 6.11 The coefficients of the generator matrix can be written in bit vector form as ½111010001: Using the coefficients of the generator polynomial, the first row of the generator matrix including 15 bits is formed as ½111010001000000 and rotating the first row to the right by one bit, we get the second row of the generator matrix as "

111010001000000

#

011101000100000 and rotating the second row to the right by one bit, we get the third row of the generator matrix as 2

111010001000000

3

6 7 6 011101000100000 7 4 5 001110100010000 and rotating the third row to the right by one bit, we get the fourth row of the generator matrix as

186

6 BCH Codes

2

111010001000000

3

7 6 6 011101000100000 7 7 6 7 6 6 001110100010000 7 5 4 000111010001000 and rotating the fourth row to the right by one bit, we get the fifth row of the generator matrix as 2

111010001000000

3

7 6 6 011101000100000 7 7 6 7 6 6 001110100010000 7 7 6 7 6 6 000111010001000 7 5 4 000011101000100 and rotating the fifth row to the right by one bit, we get the sixth row of the generator matrix as 2

111010001000000

3

7 6 6 011101000100000 7 7 6 7 6 6 001110100010000 7 7 6 7 6 6 000111010001000 7 7 6 7 6 6 000011101000100 7 5 4 000001110100010 and rotating the sixth row to the right by one bit, we get the generator matrix as 2

111010001000000

3

7 6 6 011101000100000 7 7 6 7 6 6 001110100010000 7 7 6 7 6 6 G ¼ 6 000111010001000 7 7: 7 6 6 000011101000100 7 7 6 7 6 6 000001110100010 7 5 4 000000111010001

6.2 Parity Check and Generator Matrices of BCH Codes

187

For the generation of the parity check matrix, we need the parity check polynomial of the given code. The parity check polynomial of the given code can be calculated as hð x Þ ¼

xn þ 1 x15 þ 1 ! hð x Þ ¼ 8 ! hðxÞ ¼ x7 þ x6 þ x4 þ 1: 7 gðxÞ x þ x þ x6 þ x4 þ 1

The parity check polynomial can be expressed in bit vector form as ½11010001:

ð6:8Þ

When the bit vector in Eq. (6.8) is reversed, we obtain ½10001011:

ð6:9Þ

Using the reversed bit vector in Eq. (6.9), the first row of the parity check matrix including 15 bits is formed as ½100010110000000 and rotating the first row to the right by one bit, we get the second row of the parity check matrix as "

100010110000000

#

010001011000000 and rotating the second row to the right by one bit, we get the third row of the parity check matrix as 2

100010110000000

3

6 7 6 010001011000000 7 4 5 001000101100000 and rotating the third row to the right by one bit, we get the fourth row of the parity check matrix as 2

100010110000000

3

7 6 6 010001011000000 7 7 6 7 6 6 001000101100000 7 5 4 000100010110000

188

6 BCH Codes

and rotating the fourth row to the right by one bit, we get the fifth row of the parity check matrix as 2

100010110000000

3

7 6 6 010001011000000 7 7 6 7 6 6 001000101100000 7 7 6 7 6 6 000100010110000 7 5 4 000010001011000 and rotating the fifth row to the right by one bit, we get the sixth row of the parity check matrix as 2

100010110000000

3

7 6 6 010001011000000 7 7 6 7 6 6 001000101100000 7 7 6 7 6 6 000100010110000 7 7 6 7 6 6 000010001011000 7 5 4 000001000101100 and rotating the sixth row to the right by one bit, we get the seventh row of the parity check matrix as 2

100010110000000

3

6 7 6 010001011000000 7 6 7 6 7 6 001000101100000 7 6 7 6 7 6 000100010110000 7 6 7 6 7 6 000010001011000 7 7 6 7 6 6 000001000101100 7 5 4 000000100010110 and rotating the seventh row to the right by one bit, we get the parity check matrix as

6.2 Parity Check and Generator Matrices of BCH Codes

2

100010110000000

189

3

7 6 6 010001011000000 7 7 6 7 6 6 001000101100000 7 7 6 7 6 6 000100010110000 7 7 6 H¼6 7: 6 000010001011000 7 7 6 7 6 6 000001000101100 7 7 6 7 6 6 000000100010110 7 5 4 000000010001011 It can be verified that the obtained matrices G and H satisfy GH T ¼ 0:

6.2.1

ð6:10Þ

Second Method to Obtain the Generator and Parity Check Matrices of BCH Codes

The second method to obtain the generator and parity check matrices of the BCH codes rely on the use of polynomials which are the elements of the extended field GF (2m). For a t-error-correcting BCH(n, k) code, the parity check matrix is formed as 2

1

6 1 6 6 H¼6 6 1 6 4⋮ 1

αn1

3



ðαn1 Þ

5

 ⋮

ðαn1 Þ ⋮

2t1



α2

ðαÞ3

ðα2 Þ

ðαÞ5 ⋮

ðα2 Þ ⋮

ðαÞ2t1

ðα2 Þ

3



α

ðαn1 Þ

3 5

7 7 7 7: 7 7 5

ð6:11Þ

2t1

The generator matrix for a t-error-correcting BCH(n, k) code is obtained as

190

6 BCH Codes

2

3

2 1 6 7 6 g2 7 6 6 7 6 1 6 7 6 6 g3 7 6 1 6 7 6 G¼6 7¼6 6 g4 7 6 1 6 7 6 6 7 6 6⋮7 4⋮ 4 5 1 gl g1

1

1

1

α

α2

ðαÞ3

ðα2 Þ

3

ðαÞ5 ⋮

ðα2 Þ ⋮

5

ðαÞm

ðα 2 Þ

3

1

7 αn1 7 3 7    ðαn1 Þ 7 7 7 n1 5 7    ðα Þ 7 7 ⋮ ⋮ 5 m    ðαn1 Þ 

m

ð6:12Þ

where m ¼ 2l  3, l  2, and l < k. Example 6.12 Find the generator and parity check matrices of the double-errorcorrecting BCH(15, 7) code. Use GF(24) constructed using the primitive polynomial p(x) ¼ x4 + x + 1. Solution 6.12 The parity check matrix can be formed for t ¼ 2 using Eq. (6.11) as " H¼

α3

α4

1

α

α2

1

ðαÞ3

ðα2 Þ

ðα3 Þ

α11

α12

α10 ðα10 Þ

3

3

ðα11 Þ

3

3

ðα4 Þ

α5  5 3 α

3

α13 3

ðα12 Þ

ðα13 Þ

α6  6 3 α #

α14 3

ðα14 Þ

α7 ðα7 Þ

α8 3

ðα8 Þ

α9 3

ðα 9 Þ

3

3

which can be simplified using α15 ¼ 1 as  H¼

1

α

α2

α3

α4

α5

α6

α7

α8

α9

α10

α11

α12

α13

1

α3

α6

α9

α12

1

α3

α6

α9

α12

1

α3

α6

α9

 : α12 α14

ð6:13Þ The αi, i ¼ 1, . . ., 14 terms in Eq. (6.13) can be represented by polynomials in GF (2 ), and these polynomials can be expressed by three-bit column vectors as in 4

2 3 2 3 1 0 6 7 6 7 607 607 6 7 6 7 0!0!6 7 1!1!6 7 607 607 4 5 4 5 0

0

2 3 0 6 7 617 6 7 α!α!6 7 607 4 5 0

2 3 0 6 7 607 6 7 α2 ! α2 ! 6 7 617 4 5 0

2 3 2 3 2 3 2 3 0 1 0 0 607 617 617 607 6 7 6 7 6 7 6 7 α3 ! α3 ! 6 7 α4 ! α þ 1 ! 6 7 α5 ! α2 þ α ! 6 7 α6 ! α3 þ α2 ! 6 7 405 405 415 415 1 0 0 1

6.2 Parity Check and Generator Matrices of BCH Codes

191

2 3 1 6 7 617 6 7 α7 ! α3 þ α þ 1 ! 6 7 607 4 5 1

α10

α12

2 3 2 3 1 0 6 7 6 7 607 617 6 7 6 7 α8 ! α2 þ 1 ! 6 7 α9 ! α3 þ α ! 6 7 617 607 4 5 4 5 0 1 2 3 2 3 1 0 6 7 6 7 617 617 6 7 6 7 ! α2 þ α þ 1 ! 6 7 α11 ! α3 þ α2 þ α ! 6 7 617 617 4 5 4 5

0 2 3 1 6 7 617 6 7 ! α3 þ α2 þ α þ 1 ! 6 7 617 4 5

α13

1 2 3 1 6 7 607 6 7 ! α3 þ α2 þ 1 ! 6 7 617 4 5

1

α14

1

2 3 1 6 7 607 6 7 ! α3 þ 1 ! 6 7: 607 4 5 1

Replacing the αi terms by their column vector equivalents, we get the parity check matrix in bit form as 2

100010011010111

3

6 010011010111100 7 7 6 7 6 6 001001101011110 7 7 6 7 6 6 000100110101111 7 7 6 7 H¼6 6          7: 7 6 6 100011000110001 7 7 6 6 000110001100011 7 7 6 7 6 4 001010010100101 5 011110111101111 Example 6.13 The extended field GF(24) is constructed using the primitive polynomial p(x) ¼ x4 + x + 1. The generator polynomial of triple-error-correcting BCH (15, 5) code over GF(24) is evaluated as

192

6 BCH Codes

gðxÞ ¼ x10 þ x8 þ x5 þ x4 þ x2 þ x þ 1: Find the parity check and generator matrices of BCH(15, 5) code. Solution 6.13 Using Eq. (6.11), we can form the parity check matric of BCH(15, 5) as in 2

1

α

6 H ¼ 4 1 α3 1 α5

α2

α3

α4

α5

α6

α7

α8

α9

α10

α11

α12

α13

α6 α10

α9 α15

α12 α20

α15 α25

α18 α30

α21 α35

α24 α40

α27 α45

α30 α50

α33 α55

α36 α60

α39 α65

α14

3

7 α42 5 α70

which can be simplified using α15 ¼ 1 as 2

1

6 H ¼ 41 1

α

α2

α3

α4

α5

α6

α7

α8

α9

α10

α11

α12

α13

α3 α5

α6 α10

α9 1

α12 α5

1 α10

α3 1

α6 α5

α9 α10

α12 1

1 α5

α3 α10

α6 1

α9 α5

α14

3

7 α12 5 α10

in which, expressing the αi terms by their polynomial representations and representing each polynomial by its column bit vector equivalent, we get the parity check matrix 3 100010011010111 6 010011010111100 7 7 6 7 6 6 001001101011110 7 7 6 6 000100110101111 7 7 6 7 6 6        7 7 6 6 100011000110001 7 7 6 7 6 6 000110001100011 7 7 H¼6 6 001010010100101 7 7 6 7 6 6 011110111101111 7 7 6 6        7 7 6 7 6 6 101101101101101 7 7 6 6 011011011011011 7 7 6 7 6 4 011011011011011 5 000000000000000 2

ð6:14Þ

where it is seen that the last row of the matrix is zero, and the rows 10 and 11 are the same. For this reason, omitting the last two rows of Eq. (6.14), we obtain the final form of the parity check matrix as in

6.2 Parity Check and Generator Matrices of BCH Codes

193

3 100010011010111 6 010011010111100 7 7 6 7 6 6 001001101011110 7 7 6 6 000100110101111 7 7 6 7 6 6        7 7 6 6 100011000110001 7 7 6 H¼6 7: 6 000110001100011 7 7 6 6 001010010100101 7 7 6 7 6 6 011110111101111 7 7 6 6        7 7 6 7 6 4 101101101101101 5 2

ð6:15Þ

011011011011011 The size of the matrix in Eq. (6.14) is 12  15 which is NOT correct, and on the other hand, the size of the matrix in Eq. (6.15) is 10  15 which is correct, since the size of the parity check matrix should be (n  k)  k, and for the BCH(15, 5) code, we have n ¼ 15 and k ¼ 5. The generator matrix can be formed using Eq. (6.12) as  G¼

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1 α

α2

α3

α4

α5

α6

α7

α8

α9

α10

α11

α12

α13

α14



where, expressing each term by a column bit vector including five bits and eliminating the redundant rows, we obtain 2

111111111111111

3

7 6 6 100010011010111 7 7 6 7 6 6 G ¼ 6 010011010111100 7 7: 7 6 6 001001101011110 7 5 4 000100110101111 We can verify that GHT ¼ 0, i.e., we have

194

6 BCH Codes

 3  1000  1000  10 6 0100  0001  01 7  7  6  7  6 6 0010  0011  11 7  7  6 6 0001  0101  10 7  7  6  7  6 6 1100  1111  01 7  7 2  6 3 36 2  7  0000000000 111111111111111 6 0110  1000  11 7   7 6 7 6  7 6 0000000000 7  7 6 100010011010111 76 6 0011  0001  10 7 6 7 7 6  7 6  6 T 6 7 6 GH ¼ 0 ! 6 010011010111100 76 1101  0011  01 7 ¼ 6 0000000000 7 7:   7 6 7 76 6   7 6 4 001001101011110 56 1010  0101  11 7 4 0000000000 5  7  6 0000000000 000100110101111 6 0101  1111  10 7  7  6 6 1110  1000  01 7  7  6  7  6 6 0111  0001  11 7  7  6 6 1111  0011  10 7  7  6  7  6 4 1011  0101  01 5   1001  1111  11 2

Example 6.14 Find the parity check and generator matrices of double-errorcorrecting BCH(31, 16) code designed using the elements of GF(25) which is constructed using the primitive polynomial p(x) ¼ x5 + x2 + 1. Solution 6.14 Using Eq. (6.11), we obtain the parity check matrix of the BCH (31, 16) code as 2

6 H ¼ 41

α

α2

ðαÞ3

ðα 2 Þ

3

1

ðαÞ5

ðα 2 Þ

5

1

3



α30



ðα30 Þ

3    ðα30 Þ 7 5 5

in which, simplifying the αi, i ¼ 31, . . ., 150 using α31 ¼ 1, expressing each αi, i ¼ 1, . . ., 30 in terms of polynomials, and finally converting each polynomial to a column vector involving five bits, removing redundant rows if necessary, we obtain the parity check matrix as

6.3 Syndrome Calculation for BCH Codes

2

1000010010110011111000110111010 0100001001011001111100011011101

195

3

7 6 7 6 7 6 6 0010010110011111000110111010100 7 7 6 6 0001001011001111100011011101010 7 7 6 7 6 6 0000100101100111110001101110101 7 7 6 6                  7 7 6 7 6 6 1000011001001111101110001010110 7 7 6 7 6 6 0011111011100010101101000011001 7 7 6 7 H¼6 6 0000110010011111011100010101101 7: 7 6 6 0111110111000101011010000110010 7 7 6 6 0001010110100001100100111110111 7 7 6 7 6 6                  7 7 6 6 1111010001001010110000111001101 7 7 6 7 6 6 0001001010110000111001101111101 7 7 6 6 0101100001110011011111010001001 7 7 6 7 6 4 0001110011011111010001001010110 5 0011011111010001001010110000111

6.3

Syndrome Calculation for BCH Codes

The generator polynomial of a t-error-correcting BCH code can be obtained using gðxÞ ¼ LCM fm1 ðxÞ, m3 ðxÞ, . . . , m2t1 g:

ð6:16Þ

It is possible to show that α, α2, α3, . . ., α2t are the roots of g(x), and this means that   g αi ¼ 0 i ¼ 1, 2, . . . , 2t:

ð6:17Þ

Since the BCH codes are cyclic codes, for a given data-word polynomial d(x), the code-word polynomial can be written as cðxÞ ¼ dðxÞgðxÞ

ð6:18Þ

in which, employing Eq. (6.17), we get   c αi ¼ 0 i ¼ 1, 2, . . . , 2t:

ð6:19Þ

196

6 BCH Codes

Table 6.6 Encoding, syndrome calculation, and orthogonality formulas for linear block, linear cyclic, and BCH cyclic codes Linear block c ¼ dG GHT ¼ 0 cHT ¼ 0 s ¼ rHT or s ¼ eHT

Cyclic c(x) ¼ d(x)g(x) Rxn þ1 ðgðxÞhðxÞÞ ¼ 0 Rxn þ1 ðcðxÞhðxÞÞ ¼ 0 sðxÞ ¼ Rxn þ1 ðr ðxÞhðxÞÞ or sðxÞ ¼ RgðxÞ ðr ðxÞÞ

BCH cyclic c(x) ¼ d(x)g(x) Rxn þ1 ðgðxÞhðxÞÞ ¼ 0 Rxn þ1 ðcðxÞhðxÞÞ ¼ 0 Si ¼ r(αi) i ¼ 1, 2, . . ., 2t

Now, let’s consider the transmission of a code-word c(x), and at the receiver side, we have the received word polynomial r ðxÞ ¼ cðxÞ þ eðxÞ

ð6:20Þ

where e(x) corresponds to the error word polynomial. Syndromes for BCH Codes For a received word polynomial r(x), there are 2t syndromes, and these syndromes are calculated using   Si ¼ r αi where i ¼ 1, 2, . . . , 2t:

ð6:21Þ

Note that error syndromes are the elements of an extended field GF(2m). In Table 6.6, encoding, syndrome calculation, and orthogonality formulas for linear block, linear cyclic, and BCH cyclic codes are summarized. Example 6.15 The generator polynomial of the double-error-correcting BCH(15, 7) cyclic code is given as gðxÞ ¼ x8 þ x7 þ x6 þ x4 þ 1: The data-word polynomial is d(x) ¼ x5 + x2 + 1. Obtain the systematic and non-systematic code-words for d(x). Solution 6.15 The non-systematic code-word resulting in the encoding of d(x) can be calculated as    cðxÞ ¼ d ðxÞgðxÞ ! cðxÞ ¼ x5 þ x2 þ 1 x8 þ x7 þ x6 þ x4 þ 1 leading to cðxÞ ¼ x13 þ x12 þ x11 þ x10 þ x7 þ x5 þ x4 þ x2 þ 1: The systematic form of the code-word can be obtained as follows. First, we multiply d(x) by xn  k ! x8 resulting in

6.3 Syndrome Calculation for BCH Codes

197

x8 d ðxÞ ! x13 þ x10 þ x8 : Next, we calculate the remainder polynomial using   r ðxÞ ¼ RgðxÞ xxk dðxÞ as r ðxÞ ¼ x6 þ x þ 1: Finally, the systematic code-word is obtained as cðxÞ ¼ xnk dðxÞ þ r ðxÞ ! cðxÞ ¼ x13 þ x10 þ x8 þ x6 þ x þ 1: Example 6.16 The double-error-correcting BCH(15, 7) cyclic code is designed in GF(24) which is constructed using the primitive polynomial p(x) ¼ x4 + x + 1. A code-word polynomial of BCH(15, 7) is given as cðxÞ ¼ x13 þ x10 þ x8 þ x6 þ x þ 1: Show that c(αi) ¼ 0 for i ¼ 1, 2, 3, 4. Solution 6.16 For the reminder, first, let’s sort the extended field GF(24) elements generated by the primitive polynomial p(x) ¼ x4 + x + 1 as in 0!0 1!1 α!α α2 ! α2 α3 ! α3 α4 ! α þ 1 α5 ! α2 þ α α6 ! α3 þ α2 α7 ! α3 þ α þ 1 α8 ! α2 þ 1 α9 ! α3 þ α α10 ! α2 þ α þ 1 α11 ! α3 þ α2 þ α α12 ! α3 þ α2 þ α þ 1 α13 ! α3 þ α2 þ 1 α14 ! α3 þ 1:

ð6:22Þ

198

6 BCH Codes

Using the field elements and the identity α15 ¼ 1, we can evaluate cðxÞ ¼ x13 þ x10 þ x8 þ x6 þ x þ 1 for x ¼ αi, i ¼ 1, 2, 3, 4 as x ¼ α ! cðαÞ ¼ α13 þ α10 þ α8 þ α6 þ α þ 1 !         cðαÞ ¼ α3 þ α2 þ 1 þ α2 þ α þ 1 þ α2 þ 1 þ α3 þ α2 þ α þ 1 ! cð α Þ ¼ 0   x ¼ α2 ! c α2 ¼ α26 þ α20 þ α16 þ α12 þ α2 þ 1 !   c α2 ¼ α11 þ α5 þ α1 þ α12 þ α2 þ 1         c α2 ¼ α3 þ α2 þ α þ α2 þ α þ α1 þ α3 þ α2 þ α þ 1 þ α2 þ 1 !   c α2 ¼ 0   x ¼ α3 ! c α3 ¼ α39 þ α30 þ α24 þ α18 þ α3 þ 1 !     c α3 ¼ α9 þ α0 þ α9 þ α3 þ α3 þ 1 ! c α3 ¼ 0   x ¼ α4 ! c α4 ¼ α52 þ α40 þ α32 þ α24 þ α4 þ 1 !   c α4 ¼ α7 þ α10 þ α2 þ α9 þ α4 þ 1         c α4 ¼ α3 þ α þ 1 þ α2 þ α þ 1 þ α2 þ α3 þ α þ ðα þ 1Þ þ 1 !   c α4 ¼ 0: Thus, we showed that       cðαÞ ¼ c α2 ¼ c α3 ¼ c α4 ¼ 0: In fact, if c(α) ¼ 0, then using the property ðx1 þ x2 þ . . . þ xi Þ2 ¼ x21 þ x22 þ . . . þ x2i we can write that     c α2 ¼ c α4 ¼ 0:

6.4 Syndrome Equations and Syndrome Decoding

6.4

199

Syndrome Equations and Syndrome Decoding

The error pattern that corrupts the transmitted code-word can be expressed in polynomial form. If there are v bit errors during the communication, then we can express the error word in polynomial form as eðxÞ ¼ xp1 þ xp2 þ . . . þ xpv

ð6:23Þ

where the exponential terms p1, p2, . . ., pv indicate the positions of the errors. Example 6.17 For the code-word length n ¼ 8, an error word is given as e ¼ ½01000101

ð6:24Þ

where the bits “1’s” indicate the errors at the received word. The positions of “1’s” are explicitly shown in 2

3

e ¼ 4|{z} 0 |{z} 1 |{z} 0 |{z} 0 |{z} 0 |{z} 1 |{z} 0 |{z} 1 5 7

6

5

4

3

2

1

0

from which we see that the errors occur at the bit positions 0, 2, and 6. The polynomial form of e can be written as eð xÞ ¼ x6 þ x2 þ x0 where it is clear that the exponents of x correspond to the positions of the bit errors. Syndrome Equations Considering the transmission of the code-word polynomial c(x), the received word polynomial can be written as r ðxÞ ¼ cðxÞ þ eðxÞ: where the error polynomial e(x) can be expressed as in Eq. (6.23). Using r(x), we can calculate the syndromes as         Si ¼ r αi ! Si ¼ c αi þ e αi ! Si ¼ e αi i ¼ 1, 2, . . . , 2t |ffl{zffl} ¼0

in which, employing Eq. (6.23), we obtain the syndrome equations

200

6 BCH Codes

S1 ¼ eðαÞ ! S1 ¼ αp1 þ αp2 þ    þ αpv   S2 ¼ e α2 ! S2 ¼ α2p1 þ α2p2 þ    þ α2pv   S3 ¼ e α3 ! S3 ¼ α3p1 þ α3p2 þ    þ α3pv   S4 ¼ e α4 ! S4 ¼ α4p1 þ α4p2 þ    þ α4pv ⋮   S2t ¼ e α2t ! S2t ¼ α2tp1 þ α2tp2 þ    þ α2tpv

ð6:25Þ

where, using the property S2i ¼ S2i , we get the reduced set of syndrome equations S1 ¼ eðαÞ ! S1 ¼ αp1 þ αp2 þ    þ αpv   S3 ¼ e α3 ! S3 ¼ α3p1 þ α3p2 þ    þ α3pv   S5 ¼ e α5 ! S5 ¼ α5p1 þ α5p2 þ    þ α5pv ⋮   S2t1 ¼ e α2t1 ! S2t1 ¼ αð2t1Þp1 þ    þ αð2t1Þpv

ð6:26Þ

In Eq. (6.25), making use of the parameter change as X i ¼ αpi , we express Eq. (6.25) as S1 ¼ X 1 þ X 2 þ    þ X v S2 ¼ X 21 þ X 22 þ    þ X 2v S3 ¼ X 31 þ X 32 þ    þ X 3v ⋮

ð6:27Þ

2t 2t S2t ¼ X 2t 1 þ X2 þ    þ Xv

and Eq. (6.26) as S1 ¼ X 1 þ X 2 þ    þ X v S3 ¼ X 31 þ X 32 þ    þ X 3v S5 ¼ X 51 þ X 52 þ    þ X 5v ⋮ S2t1 ¼ X 2t1 þ X 2t1 þ    þ X 2t1 1 2 v Example 6.18 For t ¼ v ¼ 3, Eq. (6.28) reduces to S1 ¼ X 1 þ X 2 þ X 3 S3 ¼ X 31 þ X 32 þ X 33 : S5 ¼ X 51 þ X 52 þ X 53

ð6:28Þ

6.4 Syndrome Equations and Syndrome Decoding

201

In Eq. (6.28), there are t equations and v unknowns. If v  t, then there exists a solution of Eq. (6.28). This means that the number of bit errors occurred is less than the error correction capability of the code. That is, all the bit error positions can be determined, and error correction can be performed successfully. If v  t, then the number of unknowns in Eq. (6.26) becomes greater than the number of equations, i.e., t. This means that the solution of Eq. (6.26) does not exist. Example 6.19 The syndrome equation set for a BCH code is given as S1 ¼ X 1 þ X 2 þ X 3 þ X 4 S2 ¼ X 21 þ X 22 þ X 23 þ X 24 : S3 ¼

X 31

þ

X 32

þ

X 33

þ

ð6:29Þ

X 34

(a) What is the error correction capability of this code? (b) What is the assumed number of errors occurred? (c) Can this equation set be solved? Solution 6.19 If we compare the given equation set to the Eq. (6.28), we see that t ¼ 2 and v ¼ 4: Since the assumed number of errors occurred is greater than the error correction capability of the code, i.e., v > t, in other words, the number of unknowns is greater than the number of equations in (6.29), the equation set does not have a solution. This result can also be interpreted as the code is not capable of correcting these many bit errors. Example 6.20 The extended field GF(24) is constructed using the primitive polynomial p(x) ¼ x4 + x + 1. The double-error-correcting BCH(15, 7) code is designed over GF(24). A code-word polynomial of BCH(15, 7) is given as cðxÞ ¼ x13 þ x10 þ x8 þ x6 þ x þ 1: After transmission of c(x), the received word polynomial incurs the error word polynomial eðxÞ ¼ x2 þ x: Find the received word polynomial, and obtain the syndrome equations. Solve the syndrome equations and determine the erroneous bit positions. Solution 6.20 The received word polynomial can be calculated as r ðxÞ ¼ cðxÞ þ eðxÞ ! r ðxÞ ¼ x13 þ x10 þ x8 þ x6 þ x þ 1 þ x2 þ x leading to

202

6 BCH Codes

r ðxÞ ¼ x13 þ x10 þ x8 þ x6 þ x2 þ 1: Since our code is a double-error-correcting code, i.e., t ¼ 2, we need to calculate the syndromes S1 , S3 , . . . , S2t1 ! S1 , S3 : The syndromes S1 and S3 can be calculated using the field elements in Eq. (6.22) and the equality α15 ¼ 1 as S1 ¼ r ðαÞ ! S1 ¼ α13 þ α10 þ α8 þ α6 þ α2 þ 1 !         S1 ¼ α3 þ α2 þ 1 þ α2 þ α þ 1 þ α2 þ 1 þ α3 þ α2 þ α2 þ 1 ! S1 ¼ α2 þ α ! S1 ¼ α5 :

  S3 ¼ r α3 ! S3 ¼ α39 þ α30 þ α24 þ α18 þ α6 þ 1 ! S3 ¼ α9 þ α0 þ α9 þ α3 þ α6 þ 1 ! S3 ¼ α3 þ α6 ! S3 ¼ α3 þ α3 þ α2 ! S3 ¼ α2 : We assume that v ¼ t, i.e., the number of bit errors equals to the number of correctable bit errors. Referring to Eq. (6.28), we can write the syndrome equations as S1 ¼ X 1 þ X 2 S3 ¼ X 31 þ X 32 in which, using the calculated syndromes, we get X 1 þ X 2 ¼ α5 X 31 þ X 32 ¼ α2

ð6:30Þ

Now, let’s solve the equation pair in Eq. (6.30). If we take the cube of the first equation, we get X 31 þ X 32 þ X 21 X 2 þ X 1 X 22 ¼ α15 which can be written as X 31 þ X 32 þ X 1 X 2 ðX 1 þ X 2 Þ ¼ α15 in which, using the identities in Eq. (6.30), we get

6.4 Syndrome Equations and Syndrome Decoding

203

  α2 þ X 1 X 2 α5 ¼ α15 from which we obtain X1X2 ¼

1 þ α2 α8 ! X 1 X 2 ¼ 5 ! X 1 X 2 ¼ α3 : 5 α α

ð6:31Þ

Using X1 + X2 ¼ α5, we can write that X 1 ¼ X 2 þ α5 :

ð6:32Þ

Substituting Eq. (6.32) into Eq. (6.31), we obtain 

 X 2 þ α5 X 2 ¼ α3

from which we obtain X 22 þ α5 X 2 þ α3 ¼ 0:

ð6:33Þ

Making use of the parameter change, the equation in Eq. (6.33) can be written as X 2 þ α5 X þ α3 ¼ 0:

ð6:34Þ

The roots of Eq. (6.34) can be found in a trivial manner trying the field elements α, α2, α3, . . ., α14 in Eq. (6.34) and deciding on those satisfying the equality. The two roots of Eq. (6.12) are X1 and X2. If we try X ¼ α in Eq. (6.34), we get α2 þ α5 α þ α3 ¼ 0 which can be simplified as   α2 þ α3 þ α2 þ α3 ¼ 0 ! 0 ¼ 0: Thus, we understand that X ¼ α is a root of Eq. (6.34). Now, if we try X ¼ α2 in Eq. (6.34), we get α4 þ α5 α2 þ α3 ¼ 0 which can be simplified as   ðα þ 1Þ þ α3 þ α þ 1 þ α3 ¼ 0 ! 0 ¼ 0

204

6 BCH Codes

from which we understand that X ¼ α2 is a root of Eq. (6.34). Then, we can conclude that X 1 ¼ α X 2 ¼ α2 where the powers of α indicate the positions of errors. Hence, we can write the error polynomial as eðxÞ ¼ x2 þ x: Using the error polynomial, we can get the decoded code-word as cbðxÞ ¼ r ðxÞ þ eðxÞ leading to cbðxÞ ¼ x13 þ x10 þ x8 þ x6 þ x þ 1: Exercise For the previous example, if the received word polynomial is r ðxÞ ¼ x13 þ x10 þ x7 þ x6 þ x þ 1 find the error polynomial using syndrome equations. Exercise The extended field GF(25) is constructed using the primitive polynomial p (x) ¼ x5 + x2 + 1. The generator polynomial of BCH(31, 16) code over this field can be calculated as gðxÞ ¼ x15 þ x11 þ x10 þ x9 þ x8 þ x7 þ x5 þ x3 þ x2 þ x þ 1: Encode the data-word polynomial d(x) ¼ x11 + x9 + x8 + x4 + x2 + x + 1 with this code. Let c(x) be the code-word polynomial obtained after encoding operation. The error polynomial is given as eðxÞ ¼ x7 þ x5 þ 1: Write the received word polynomial, and using syndrome decoding, calculate the error polynomial.

6.4 Syndrome Equations and Syndrome Decoding

6.4.1

205

The Error Location Polynomial

In the previous example, we found that for the double-error-correcting BCH code, the location of the errors can be determined considering the roots of X 2 þ α5 X þ α3 ¼ 0: We can generalize this issue for the t-error-correcting BCH codes. We can state that, for a t-error-correcting BCH code, the error locations can be determined considering the roots of xv þ σ 1 xv1 þ . . . þ σ v1 x þ σ v ¼ 0

ð6:35Þ

where v is the bit error number such that v  t. The polynomial whose roots are the reciprocal of the roots of Eq. (6.35), i.e., reciprocal of the error locations, is called the error location polynomial, and it is obtained by substituting 1/x in Eq. (6.35) as

v

v1

1 1 1 þ σ1 þ . . . þ σ v1 þ σv ¼ 0 ! x x x σ 0 þ σ 1 x þ . . . þ σ v1 xv1 þ σ v xv ¼ 0:

ð6:36Þ

The error location polynomial is denoted by σ(x), i.e., σ ðxÞ ¼ σ 0 þ σ 1 x þ . . . þ σ v1 xv1 þ σ v xv :

ð6:37Þ

If we denote the roots of Eq. (6.37) by X1, X2, . . ., Xv, then the error location polynomial is σ(x) which can be written as σ ð xÞ ¼







1 1 1 xþ xþ  x þ : X1 X2 Xv

ð6:38Þ

Equating Eq. (6.38) to zero, we get xþ

1 X1





1 1  x þ ¼ 0 ! ðxX 1 þ 1ÞðxX 2 þ 1Þ  ðxX v þ 1Þ ¼ 0: ð6:39Þ X2 Xv

Now, equating Eqs. (6.36) and (6.39), we get σ 0 þ σ 1 x þ . . . þ σ v1 xv1 þ σ v xv ¼ ðxX 1 þ 1ÞðxX 2 þ 1Þ  ðxX v þ 1Þ

ð6:40Þ

where, expanding the polynomial on the right and equating the coefficients of terms xi with the same exponential value, we obtain the set of equations

206

6 BCH Codes

σ0 ¼ 1 σ 1 ¼ X 1 þ X 2 þ    þ X v1 þ X v σ 2 ¼ X 1 X 2 þ X 2 X 3 þ    þ X v1 X v

ð6:41Þ

⋮ σ v ¼ X 1 X 2 X 3 . . . X v1 X v Example 6.21 For v ¼ 4, Eq. (6.41) reduces to σ0 ¼ 1 σ1 ¼ X1 þ X 2 þ X3 þ X 4 σ2 ¼ X1X 2 þ X2 X3 þ X3 X4 : σ3 ¼ X1X 2X3 þ X2X 3X4 σ4 ¼ X1X 2X3 X4 Now, let’s express the syndromes in Eq. (6.27) in terms of the coefficients appearing in Eq. (6.41). The syndrome equations in Eq. (6.27) and the coefficient equations in Eq. (6.41) are given below for reminder S1 ¼ X 1 þ X 2 þ    þ X v S2 ¼ X 21 þ X 22 þ    þ X 2v S3 ¼ X 31 þ X 32 þ    þ X 3v ⋮ 2t 2t S2t ¼ X 2t 1 þ X2 þ    þ Xv ð6:42Þ σ0 ¼ 1 σ 1 ¼ X 1 þ X 2 þ    þ X v1 þ X v σ 2 ¼ X 1 X 2 þ X 2 X 3 þ    þ X v1 X v ⋮ σ v ¼ X 1 X 2 X 3 . . . X v1 X v : Assuming that v  t, the syndromes Si, i ¼ 1, . . ., 2v in Eq. (6.42) can be expressed in terms of the coefficients σ j, j ¼ 1, . . ., v as

6.4 Syndrome Equations and Syndrome Decoding

207

S1 ¼ σ 1 S2 ¼ σ 1 S1 S3 ¼ σ 1 S2 þ σ 2 S1 þ σ 3 S4 ¼ σ 1 S3 þ σ 2 S2 þ σ 3 S1 ⋮

ð6:43Þ

Sv ¼ σ 1 Sv1 þ σ 2 Sv2 þ    þ σ v2 S2 þ σ v1 S1 þ vσ v Svþ1 ¼ σ 1 Sv þ σ 2 Sv1 þ    þ σ v1 S2 þ σ v S1 Svþ2 ¼ σ 1 Svþ2 þ σ 2 Sv þ    þ σ v1 S3 þ σ v S2 S2v ¼ σ 1 S2v1 þ σ 2 S2v1 þ    þ σ v1 Svþ1 þ σ v Sv which can be written in matrix form as 2

S1

3

2

1

6 S2 7 6 S1 7 6 6 7 6 6 6 S3 7 6 S2 7 6 6 6 S 7 6 S 6 4 7 6 3 7 6 6 6 ⋮ 7 6 ⋮ 7 6 6 6 S 7¼6S 6 v 7 6 v1 7 6 6 6 Svþ1 7 6 Sv 7 6 6 6S 7 6 S 6 vþ2 7 6 vþ1 7 6 6 4 ⋮ 5 4 ⋮ S2v S2v1

0

0

...

0

0 S1

0 1

... ...

0 0

S2 ⋮

S1 ⋮

... ...

0 ⋮

Sv2

Sv3

...

S1

Sv1 Sv

Sv2 Sv1

... ...

S2 S3

⋮ S2v2

⋮ S2v3

... ⋮ . . . Svþ1

0

32

σ1

3

76 σ 2 7 76 7 76 7 76 σ 3 7 76 7 7 6 0 7 76 σ 4 7 76 7 ⋮ 76 ⋮ 7 76 7 7 6 v 7 76 ⋮ 7 76 7 7 6 S1 7 76 σ v3 7 7 6 S2 76 σ v2 7 7 76 7 5 4 ⋮ σ v1 5 Sv σv 0 0

ð6:44Þ

where, employing the property S2i ¼ S2i , we get the simplified form of Eq. (6.44) as 3 2 1 S1 7 6 6 6 S3 7 6 S2 7 6 6 6 S5 7 ¼ 6 S4 7 6 6 7 6 6 4 ⋮ 5 4 ⋮ S2v1 S2v1 2

0 S1

0 1

... ...

0 0

S3 ⋮

S2 ⋮

... ...

0 ⋮

S2v2

S2v3

. . . Svþ1

32 3 σ1 0 76 7 0 76 σ 2 7 76 7 7 6 0 7 76 ⋮ 7 76 7 ⋮ 54 σ v1 5 Sv σv

ð6:45Þ

Example 6.22 For v ¼ 4, construct the matrix form of syndrome equations given in Eqs. (6.44) and (6.45). Solution 6.22 If we inspect Eq. (6.44), we see that the syndrome Sj, j  v is calculated according to

208

6 BCH Codes

3 σ1 7 6 6 σ2 7 7 6 7 Sv ¼ ½Sv1 Sv2 . . . S2 S1 v6 6 ⋮ 7 7 6 4 σ v1 5 σv 2

ð6:46Þ

and the syndrome Sj, j > v is calculated using 3 σ1 7 6 6 σ2 7 7 6 7 Si  6 6 ⋮ 7: 7 6 4 σ v1 5 σv 2

Svþi ¼ ½Svþi1 Svþi2 . . . Siþ2 Siþ1

ð6:47Þ

For v ¼ 4, considering Eq. (6.46), the syndromes S1, S2, S3, and S4 are calculated according to 2

3 σ1 6σ 7 6 27 S1 ¼ ½1 0 0 06 7 4 σ3 5

ð6:48Þ

σ4 2 3 2 3 σ1 2 3 σ1 6σ 7 6σ 7 6 27 6 27 S2 ¼ 4S1 |{z} 2 0 056 7 ! S2 ¼ ½S1 0 0 06 7 4 σ3 5 4 σ3 5

ð6:49Þ

¼0

σ4 σ4 2 3 2 3 σ1 2 3 σ1 6σ 7 6σ 7 6 27 6 27 S3 ¼ 4S2 S1 |{z} 3 056 7 ! S3 ¼ ½S2 S1 1 06 7 4 σ3 5 4 σ3 5 ¼1

σ4 3

2

2

σ4 3

σ1 3 σ1 6σ 7 6σ 7 6 27 6 27 S4 ¼ 4S3 S2 S1 |{z} 4 5 6 7 ! S3 ¼ ½ S3 S2 S1 0 6 7 4 σ3 5 4 σ3 5 2

¼0

σ4

ð6:50Þ

ð6:51Þ

σ4

and considering Eq. (6.47) the syndromes S5, S6, S7, and S8 are calculated according to

6.4 Syndrome Equations and Syndrome Decoding

209

2

3 σ1 6σ 7 6 27 S5 ¼ ½ S4 S3 S2 S1  6 7 4 σ3 5 2

σ4 σ1

ð6:52Þ

3

6σ 7 6 27 S6 ¼ ½ S5 S4 S3 S2  6 7 4 σ3 5 2

σ4 σ1

ð6:53Þ

3

6σ 7 6 27 S7 ¼ ½ S6 S5 S4 S3  6 7 4 σ3 5 2

σ4 σ1

ð6:54Þ

3

6σ 7 6 27 S8 ¼ ½S7 S6 S5 S4 6 7: 4 σ3 5

ð6:55Þ

σ4 Now, using the equations from Eqs. (6.48) to (6.55), we can construct the syndrome matrix equation in Eq. (6.44) as 2

S1

3

2 6 7 6 S2 7 6 7 6 6 7 6 6 S3 7 6 6 7 6 6 7 6 6 S4 7 6 6 7 6 6 7¼6 6 S5 7 6 6 7 6 6 7 6 6 S6 7 6 6 7 6 6 7 4 6 S7 7 4 5 S8

3

1

0

0

0

S1

0

0

S2 S3

S1 S2

1 S1

S4 S5

S3 S4

S2 S3

S6

S5

S4

07 7 72 3 0 7 σ1 7 6 7 07 76 σ 2 7 76 7: S1 74 σ 3 5 7 S2 7 7 σ4 7 S3 5

S7

S6

S5

S4

ð6:56Þ

Eliminating the rows for S2, S4, S8 from Eq. (6.56), we obtain 2

3

2 1 6 7 6 S3 7 6 S 6 7 6 2 6 7¼6 6 S5 7 4 S4 4 5 S6 S S1

7

0

32

σ1

3

0

0

S1 S3

1 S2

6 7 07 76 σ 2 7 76 7: S1 54 σ 3 5

S5

S4

S3

σ4

ð6:57Þ

210

6 BCH Codes

Example 6.23 For any double-error-correcting BCH code, find the coefficients of error location polynomial in terms of the syndromes. Solution 6.23 For v ¼ t ¼ 2, the error location polynomial can be written as σ ð xÞ ¼ σ 0 þ σ 1 x þ σ 2 x2 : Using Eq. (6.45), we can write that 

S1



 ¼

S3

1

0

S2

S1



σ1



σ2

from which we obtain that 

σ1 σ2





1 ¼ S2 2

0 S1

1 

S1 S3 3





σ1 ! σ2



 1 S1 ¼ S1 S2

0 1



S1 S3





σ1 ! σ2



S1 ¼ 4 S1 S2 þ S3 5 : S1

That is, σ 0 ¼ 1 σ 1 ¼ S1

σ2 ¼

S3 þ S3 S1 S2 þ S 3 ! σ2 ¼ 1 : S1 S1

ð6:58Þ

Note that syndromes are known quantities, and they are calculated from the received word polynomial. Example 6.24 For any triple-error-correcting BCH code, find the coefficients of the error location polynomial in terms of the syndromes. Solution 6.24 For v ¼ t ¼ 3, the error location polynomial can be written as σ ðxÞ ¼ σ 0 þ σ 1 x þ σ 2 x2 þ σ 3 x3 : Using Eq. (6.45), we can write that 2

3 2 S1 1 6 7 6 4 S3 5 ¼ 4 S2

0 S1

S4

S3

S5 from which we can write

32 3 0 σ1 76 7 1 54 σ 2 5 S2 σ3

6.4 Syndrome Equations and Syndrome Decoding

211

σ 1 ¼ S1

ð6:59Þ

and S3 ¼ σ 1 S2 þ σ 2 S1 þ σ 3 ! S 3 ¼ S1 S2 þ σ 2 S1 þ σ 3 S5 ¼ σ 1 S4 þ σ 2 S3 þ σ 3 S2 ! S 5 ¼ S1 S4 þ σ 2 S3 þ σ 3 S2 from which we obtain σ 2 S1 þ σ 3 ¼ S3 þ S1 S2

ð6:60Þ

σ 2 S3 þ σ 3 S2 ¼ S5 þ S1 S4

where, multiplying the first equation by S2 and adding it to the second one, we get the equation involving only σ 2 as σ 2 S1 S2 þ σ 2 S3 ¼ S2 S3 þ S1 S22 þ S5 þ S1 S4 where, using S2 ¼ S21 and S4 ¼ S22 , we obtain   σ 2 S31 þ S3 ¼ S21 S3 þ S5 þ S1 S41 þ S1 S41 |fflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflffl} ¼0

from which we get σ2 ¼

S21 S3 þ S5 : S31 þ S3

ð6:61Þ

Finally, substituting Eq. (6.61) into Eq. (6.60), and solving for σ 3, we obtain σ 2 S1 þ σ 3 ¼ S3 þ S1 S2 ! σ 3 ¼ S31 þ S3 þ

S31 S3 þ S1 S5 : S31 þ S3

Hence, the coefficients can be written as σ 0 ¼ 1 σ 1 ¼ S1

σ2 ¼

S21 S3 þ S5 S31 þ S3

σ 3 ¼ S31 þ S3 þ S1 σ 2

and the error location polynomial can be expressed as σ ð xÞ ¼ σ 0 þ σ 1 x þ σ 2 x2 þ σ 3 x3 !

212

6 BCH Codes

σ ð x Þ ¼ 1 þ S1 x þ

S21 S3 þ S5 2 S61 þ S23 þ S31 S3 þ S1 S5 3 x þ x : S31 þ S3 S31 þ S3

Exercise For a triple-error-correcting BCH code, the syndromes S1, S3, and S5 over GF(24) are given as S1 ¼ α8

S3 ¼ α 7

S5 ¼ α10 :

Assume that the primitive polynomial p(x) ¼ x4 + x + 1 is used for the construction of GF(24). Find the coefficients of the error location polynomial. Example 6.26 For any four-error-correcting BCH code, find the coefficients of error location polynomial in terms of the syndromes. Solution 6.26 For v ¼ t ¼ 4, the error location polynomial can be written as σ ð xÞ ¼ σ 0 þ σ 1 x þ σ 2 x2 þ σ 3 x3 þ σ 4 x4 : Using Eq. (6.45), we obtain 2

S1

3

2

1

6S 7 6S 6 37 6 2 6 7¼6 4 S5 5 4 S4 S7

S6

0

0

S1

1

S3 S5

S2 S4

0

32

σ1

3

6 7 07 76 σ 2 7 76 7 S1 54 σ 3 5 S3

σ4

from which the coefficients σ 1, σ 2, σ 3, and σ 4 can be found as

σ 1 ¼ S1   σ 3 ¼ S31 þ S3 þ S1 σ 1

6.4.2

    S1 S7 þ S71 þ S3 S51 þ S5    σ2 ¼  3 S3 S1 þ S3 þ S1 S51 þ S5  2    S S3 þ S5 þ S31 þ S3 σ 2 σ4 ¼ 1 : S1

The Peterson-Gorenstein-Zierler (PGZ) Decoder

In Eq. (6.47), we obtained that

6.4 Syndrome Equations and Syndrome Decoding

213

3 σ1 7 6 6 σ2 7 7 6 7 Si  6 6 ⋮ 7: 7 6 4 σ v1 5 σv 2

Svþi ¼ ½Svþi1 Svþi2 . . . Siþ2 Siþ1

ð6:62Þ

Evaluating Eq. (6.62) for i ¼ 1, . . ., v, and using the results as the rows of a matrix, we get 2

3 2 Svþ1 S1 6S 7 6 S 6 vþ2 7 6 2 6 7¼6 4 ⋮ 5 4⋮ S2v

Sv

S2 S3 ⋮ Svþ1

... ...

Sv1 Sv

... ⋮ . . . S2v2

32 3 σv Sv 6 7 Svþ1 7 76 σ v1 7 76 7: ⋮ 54 ⋮ 5 σ1 S2v1

ð6:63Þ

Equation (6.63) can be written as S ¼ Mσ from which we can write that σ ¼ M 1 S:

ð6:64Þ

The inverse of M in Eq. (6.64) exists if there are exactly v-bit errors in the received word, and we have v  t where t is the maximum number of errors that can be corrected by our code. However, in practice, we cannot know the exact number of bit errors at the receiver side. For this reason, first, we assume that maximum number of errors occurred, i.e., we take v ¼ t, and calculate the inverse of M in Eq. (6.64). If the matrix M is a singular one, then we understand that less number of bit errors occurred. In this case, we construct the M matrix in Eq. (6.64) for v  1 and check its determinant. Now, let’s state the Peterson’s algorithm to determine the coefficients of error location polynomial. PGZ Algorithm Calculate the syndromes S1, S2, . . ., S2t using the received word polynomial r(x). Construct the syndrome matrix in Eq. (6.64) for v ¼ t, i.e., size of M is t  t. Compute the determinant of M, and if it is nonzero, go to Step 5. Delete the last row and last column of M and go to Step 3. Computer M21 and determine the coefficients of the error location polynomial using σ ¼ M21S. 6. Determine the roots of the error location polynomial σ(x). If there are an incorrect number of roots or repeated roots, in this case, we declare a decoding failure. 1. 2. 3. 4. 5.

214

6 BCH Codes

7. Determine the reciprocals of the roots of σ(x) and find the error location numbers. 8. Construct the error word polynomial, and add it to the received word polynomial to correct the transmission errors. Example 6.27 For the triple-error-correcting BCH(15, 5) code constructed on the extended field GF(24) which is obtained using the primitive polynomial p (x) ¼ x4 + x + 1, the generator polynomial can be formed using the minimal polynomials m1(x), m3(x), and m5(x) as     gð x Þ ¼ x 4 þ x þ 1 x 4 þ x 3 þ x 2 þ x þ 1 x 2 þ x þ 1 which can be simplified as gðxÞ ¼ x10 þ x8 þ x5 þ x4 þ x2 þ x þ 1: Assume that a data-word is encoded, and the generated code-word is transmitted. The received word at the receiver side is expressed in polynomial form as r ðxÞ ¼ x8 þ x5 þ x2 þ x þ 1: Determine the transmitted code-word using the PGZ algorithm. Solution 6.27 The syndromes Si ¼ r(αi), i ¼ 1, . . ., 2t can be calculated using the GF(24) field elements in Eq. (6.22) as S1 ¼ r ðαÞ ! S1 ¼ α2   S2 ¼ r α2 ¼ S21 ! S2 ¼ α4   S3 ¼ r α3 ! S3 ¼ α11   S4 ¼ r α4 ¼ S22 ! S4 ¼ α8   S5 ¼ r α 5 ! S5 ¼ 0   S6 ¼ r α6 ¼ S23 ! S6 ¼ α7 : The PGZ decoding algorithm can be outlined as follows: Step 1: Using the calculated syndromes, we construct the syndrome matrix M of size 3  3 as in 2

S1

6 M ¼ 4 S2 S3

S2 S3 S4

S3

3

2

α2

7 6 S4 5 ! M ¼ 4 α 4 S5 α11

α4 α11 α8

α11

3

7 α8 5: 0

Step 2: The determinant of the matrix is evaluated using the first column as

6.4 Syndrome Equations and Syndrome Decoding

  α2   jM j ¼  α4   α11  11 α jM j ¼ α2  8 α

215

 α11   α8  !  0 

α4 α11 α8

  4  α8  4 α þ α   α8 0

  4  α11  11  α þ α   α11 0

 α11  ! α8 

jM j ¼ 0: Step 3: Since the determinant of the matrix is 0, i.e., the matrix is a singular matrix, i.e., its inverse does not exist, we decrease the row and column size of the matrix by 1. For this purpose, we remove the last row and last column of the matrix, and we get  M¼

α2

α4

α4

α11

 :

Step 4: The determinant of the modified matrix of Step 3 can be calculated as  2 α jM j ¼  4 α

 α4  ! jM j ¼ α2 α11 þ α4 α4 ! jM j ¼ α3 : α11 

Step 5: Since the determinant of the matrix in Step 4 is not zero, we can proceed to find the coefficients of error location polynomial as " σ¼M

21

S!

σ2 σ1

#



α2 ¼ α4

α4 α11

1 " α11 # α8

" !

σ2 σ1

#

" ¼

α14 α2

# :

Note that the determinant of the matrix M is calculated using M 1 ¼

adjðM Þ jM j

where the element of the adjoint matrix adj(M) at location (i, j) is calculated as   adj M ij ¼ Remove ith row and jth colum of M and calculate the determinant of remaining matrix: Step 6: Using the coefficients found in Step 5, the error location polynomial σ(x) is formed as

216

6 BCH Codes

σ ðxÞ ¼ 1 þ σ 1 x þ σ 2 x2 ! σ ðxÞ ¼ 1 þ α2 x þ α14 x2 : Step 7: The roots of the error location polynomial in Step 6 can be determined trivially trying all field elements one by one, i.e., equating σ(x) to zero, we get σ ðxÞ ¼ 0 ! 1 þ α2 x þ α14 x2 ¼ 0: The roots can be found as α5 and α11 trivially. Step 8: Calculate the reciprocals of the roots as X1 ¼

1 α15 ! X 1 ¼ 5 ! X 1 ¼ α10 5 α α

X2 ¼

1 α15 ! X 2 ¼ 11 ! X 2 ¼ α4 : 11 α α

Step 9: Considering the powers of X1 and X2, the error polynomial is formed as eðxÞ ¼ x10 þ x4 : Step 10: The transmitted code-word is decided as cbðxÞ ¼ r ðxÞ þ eðxÞ ! cbðxÞ ¼ x10 þ x8 þ x5 þ x4 þ x2 þ x þ 1: Exercise For the double-error-correcting BCH(31, 21) code, constructed on the extended field GF(25) which is obtained using the primitive polynomial p (x) ¼ x5 + x2 + 1, the generator polynomial can be formed using the minimal polynomials m1(x) and m3(x) as    gð x Þ ¼ x 5 þ x 2 þ 1 x 5 þ x 4 þ x 3 þ x 2 þ 1 which can be simplified as gðxÞ ¼ x10 þ x9 þ x8 þ x6 þ x5 þ x3 þ 1: Assume that a data-word is encoded and the generated code-word is transmitted. The received word at the receiver side is expressed in polynomial form as r ðxÞ ¼ x12 þ x11 þ x8 þ x7 þ x2 : Determine the transmitted code-word.

Problems

217

Problems 1. Obtain the generator polynomial of the single-error-correcting BCH code. Use GF(23) which is constructed using the primitive polynomial p(x) ¼ x3 + x2 + 1. 2. Obtain the generator polynomial of the double-error-correcting BCH code. Use GF(24) which is constructed using the primitive polynomial p(x) ¼ x4 + x3 + 1. 3. Obtain the generator polynomial of the triple-error-correcting BCH code. Use GF (25) which is constructed using the primitive polynomial p(x) ¼ x5 + x3 + 1. 4. Find the generator and parity check matrices of the double-error-correcting BCH code obtained using GF(24). Use p(x) ¼ x4 + x3 + 1 for the construction of GF (24). 5. Find the generator and parity check matrices of the double-error-correcting BCH code. Use GF(25) constructed using the primitive polynomial p(x) ¼ x5 + x3 + 1. 6. The extended field GF(24) is constructed using the primitive polynomial p (x) ¼ x4 + x + 1. The generator polynomial of the triple-error-correcting BCH (15, 5) code over GF(24) is evaluated as gðxÞ ¼ x10 þ x8 þ x5 þ x4 þ x2 þ x þ 1: Find the parity check and generator matrices of the dual code. 7. The generator polynomial of the double-error-correcting BCH(15, 7) cyclic code is given as gðxÞ ¼ x8 þ x7 þ x6 þ x4 þ 1: The data-word polynomial is d(x) ¼ x6 + x3 + x + 1. Obtain the systematic and non-systematic code-words for d(x). 8. For any triple-error-correcting BCH code, find the coefficients of error location polynomial in terms of the syndromes. 9. The triple-error-correcting BCH(15, 5) code is constructed on the extended field GF(24). The extended field GF(24) is obtained using the primitive polynomial p (x) ¼ x4 + x3 + 1. The data-word polynomial is d(x) ¼ x6 + x3 + x + 1. Assume that a data-word is encoded and the generated code-word c(x) is transmitted. The received word at the receiver side is expressed in polynomial form as r ðxÞ ¼ cðxÞ þ eðxÞ where e(x) ¼ x4 + x2. Using r(x), determine the transmitted code-word using the PGZ algorithm.

Chapter 7

Reed-Solomon Codes

7.1

Reed-Solomon Codes and Generator Polynomials of Reed-Solomon Codes

For a t-error-correcting Reed-Solomon code, the generator polynomial is constructed using     gðxÞ ¼ ðx þ βÞ x þ β2 . . . x þ β2t

ð7:1Þ

where β is an extended field element, i.e., β 2 GF(2m). If the degree of the generator polynomial is r, the parameters of the Reed-Solomon code RS(n, k) are calculated as n ¼ 2m  1 k ¼ n  r:

ð7:2Þ

The error correction capability of Reed-Solomon code RS(n, k) is computed using  tc ¼

 nk : 2

ð7:3Þ

The minimum distance of RS(n, k) is dmin ¼ n  k + 1. Reed-Solomon codes satisfy the Singleton bound with equality, i.e., we have d min ¼ n  k þ 1:

ð7:4Þ

For this reason, Reed-Solomon codes are maximum distance separable codes. Example 7.1 The extended field GF(23) is generated using the primitive polynomial p(x) ¼ x3 + x + 1. Find the generator polynomial of the single-error-correcting Reed-Solomon code over GF(23).

© Springer Nature Switzerland AG 2020 O. Gazi, Forward Error Correction via Channel Coding, https://doi.org/10.1007/978-3-030-33380-5_7

219

220

7 Reed-Solomon Codes

Solution 7.1 Let α be the root of the equation p(x) ¼ 0. Choosing β ¼ α, the generator polynomial of the single-error-correcting Reed-Solomon code can be calculated using       gðxÞ ¼ ðx þ αÞ x þ α2 . . . x þ α2t ! gðxÞ ¼ ðx þ αÞ x þ α2 !   gðxÞ ¼ x2 þ α2 þ α x þ α3 where, using the recursive expression α3 ¼ α + 1, we can write the coefficients as powers of α and obtain the polynomial expression as gðxÞ ¼ x2 þ α4 x þ α3 : The degree of the generator polynomial is r ¼ 2. The parameters of the ReedSolomon code can be calculated as n ¼ 2m  1 ! n ¼ 23  1 ! n ¼ 7 k ¼ n  r ! k ¼ 7  2 ! k ¼ 5: Hence, we can refer to the Reed-Solomon code as RS(7, 5). Note that in GF(2m) the polynomials are represented by m-bit binary vectors. In GF(23), we can represent the polynomials using 3 bits. The generator polynomial of the RS(7, 5) code can be represented by a bit vector as in gðxÞ ¼ x2 þ α4 x þ α3 ! g ¼ ½001 110 100:

ð7:5Þ

Note that in Eq. (7.5), the bits are not concatenated, but they are grouped, and each group includes three bits. Example 7.2 Express the data vector d ¼ [1 0 α α5 α2] in bit vector form. The elements of the data vector are chosen from GF(23) which is constructed using the primitive polynomial p(x) ¼ x3 + x + 1. Solution 7.2 Any polynomial in GF(23) can be represented using a bit vector consisting of three bits. Accordingly, the data vector given in the question can be represented as     d ¼ 1 0 α α5 α2 ! d ¼ 1 0 α α2 þ α þ 1 α2 ! d ¼ ½001 000 010 111 100: Example 7.3 Encode the data vector d ¼ [1 0 α α5 α2] using the generator polynomial of the Reed-Solomon code RS(7, 5). Solution 7.3 In the previous example, we calculated the generator polynomial of the Reed-Solomon code as

7.1 Reed-Solomon Codes and Generator Polynomials of Reed-Solomon Codes

221

gðxÞ ¼ x2 þ α4 x þ α3 : The data vector given in the question can be expressed in polynomial form as d ðxÞ ¼ x4 þ αx2 þ α5 x þ α2 : Using the generator polynomial and data-word polynomial, we can compute the code-word polynomial as    cðxÞ ¼ dðxÞgðxÞ ! cðxÞ ¼ x4 þ αx2 þ α5 x þ α2 x2 þ α4 x þ α3 which is simplified as cðxÞ ¼ x6 þ α6 x5 þ x4 þ α4 x2 þ α5 x þ α5 :

ð7:6Þ

The code-word obtained in Eq. (7.6) is in non-systematic form. Since ReedSolomon codes are nonbinary cyclic codes, to obtain the code-words in systematic form, we can follow the steps explained in Chap. 5 for the systematic encoding of cyclic codes. The systematic code-word for Reed-Solomon code for the given dataword can be obtained as follows. Step (1) We calculate xn  kd(x) as   xnk dðxÞ ! x2 dðxÞ ¼ x2 x4 þ αx2 þ α5 x þ α2 ! x2 dðxÞ ¼ x6 þ αx4 þ α5 x3 þ α2 x2 : Step (2) We divide x2d(x) by g(x) and obtain the remainder polynomial as   r ðxÞ ¼ RgðxÞ x2 dðxÞ ! r ðxÞ ¼ x þ α2 : Step (3) We form the code-word polynomial as cðxÞ ¼ xnk dðxÞ þ r ðxÞ ! cðxÞ ¼ x2 dðxÞ þ r ðxÞ leading to cðxÞ ¼ x6 þ αx4 þ α5 x3 þ α2 x2 þ x þ α2 :

222

7 Reed-Solomon Codes

Exercise Construct the generator polynomial of three-error-correcting ReedSolomon code over GF(24) which is obtained using the primitive polynomial p (x) ¼ x4 + x + 1.

7.2

Decoding of Reed-Solomon Codes

For binary codes, an error pattern including v errors can be expressed in polynomial form as eðxÞ ¼ xp1 þ xp2 þ . . . þ xpv

ð7:7Þ

where the exponentials p1, p2, . . ., pv indicate the error locations. On the other hand, for Reed-Solomon codes, the error polynomial is expressed in the form eðxÞ ¼ yp1 xp1 þ yp2 xp2 þ . . . þ ypv xpv

ð7:8Þ

where the exponentials p1, p2, . . ., pv indicate the error locations and yp1 , yp2 , . . . , ypv denote the error magnitudes at the corresponding error locations. Example 7.4 The generator polynomial of the double-error-correcting ReedSolomon code RS(7, 3) over GF(23), constructed using the primitive polynomial p (x) ¼ x3 + x + 1, can be calculated as gðxÞ ¼ x4 þ α3 x3 þ x2 þ αx þ α3 : When the data-word polynomial d(x) ¼ α5x2 + α3x + α is systematically encoded, we get the code-word cðxÞ ¼ α5 x6 þ α3 x5 þ αx4 þ α6 x3 þ α4 x2 þ α2 x þ 1: The elements of the GF(23) are given in Eq. (7.9) for the reminder 0!0 1!1 α!α α2 ! α2 α3 ! α þ 1 α4 ! α2 þ α α5 ! α2 þ α þ 1 α6 ! α2 þ 1: The code-word polynomial can be represented by a vector as

ð7:9Þ

7.2 Decoding of Reed-Solomon Codes

223

  c ¼ α5 α3 α α6 α4 α2 1 !

 c ¼ α2 þ α þ 1

αþ1

α

α2 þ 1

α2 þ α

 1 :

α2

where, expressing the polynomials by 3-bit words, we get c ¼ ½111 011 010 101 110 100 001: Let the error-word polynomial be eðxÞ ¼ α3 x4 þ α6 x2 :

ð7:10Þ

Equation (7.10) can be expressed by a vector as     e ¼ 0 0 α3 0 α6 0 0 ! e ¼ 0 0 α þ 1 0 α2 þ 1 0 0 where, expressing the polynomials by 3-bit words, we get e ¼ ½000 000 011 000 101 000 000: The received word can be expressed in polynomial form as r ðxÞ ¼ cðxÞ þ eðxÞ ! 3 4 r ðxÞ ¼ |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl α5 x6 þ α3 x5 þ αx4 þffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl α6 x3 þ α4 x2 þ α2 x þ ffl1} þ α x ffl{zfflfflfflfflfflfflffl þ α6 xffl}2 |fflfflfflfflfflfflffl cð xÞ

eðxÞ

which can be simplified as r ðxÞ ¼ α5 x6 þ α3 x5 þ x4 þ α6 x3 þ α3 x2 þ α2 x þ 1:

ð7:11Þ

Equation (7.11) can be represented by a vector as   r ¼ α5 α3 1 α6 α3 α2 1 !

 r ¼ α2 þ α þ 1

αþ1

1 α2 þ 1

αþ1

α2

where, expressing the polynomials by 3-bit words, we get r ¼ ½111

011

001

101

011 100

If we compare the binary vectors c, e, and r, we see that

001:

1



224

7 Reed-Solomon Codes

r¼cþe! ½111

011

101

001

001 ¼

011 100

½111 011 010 101 110 100 001 þ ½000 000 011 000 101 000 000 where we see that 001 ¼ 010 + 011 and 011 ¼ 110 + 101. If we inspect the error vector 2

3

e ¼ 4|{z} 000 |{z} 000 |{z} 011 |{z} 000 |{z} 101 |{z} 000 |{z} 0005 6

5

4

3

2

1

0

we see that the errors occur at positions 2 and 4, and the magnitudes of the errors are 101 and 011 which can be expressed using integers as 101 ! 5

011 ! 3:

We can express the error-word in polynomial form as in eðxÞ ¼ ð101Þx2 þ ð011Þx4 ! eðxÞ ¼ 5x2 þ 3x4 : The decoding operation of the Reed-Solomon codes involves determination of error locations and error magnitudes. For the determination of error locations, we can use the approach used for BCH codes. Once we determine the error locations, we can proceed to determine the error magnitudes.

7.2.1

Syndrome Decoding of Reed-Solomon Codes

The received word polynomial r(x) can be written as r ðxÞ ¼ cðxÞ þ eðxÞ where c(x) is the code-word polynomial and e(x) is the error-word polynomial defined as eðxÞ ¼ yp1 xp1 þ yp2 xp2 þ . . . þ ypv xpv :

ð7:12Þ

The code-word polynomial satisfies c(αi) ¼ 0, i ¼ 1, . . ., 2t. The syndromes for Reed-Solomon codes can be calculated using

7.2 Decoding of Reed-Solomon Codes

225

        Si ¼ r αi ! Si ¼ c αi þ e αi ! Si ¼ e αi i ¼ 1, . . . , 2t: |ffl{zffl}

ð7:13Þ

¼0

Calculating the syndromes for i ¼ 1, . . ., 2t, we get the set of equations S1 ¼ yp1 αp1 þ yp2 αp2 þ . . . þ ypv αpv S2 ¼ yp1 α2p1 þ yp2 α2p2 þ . . . þ ypv α2pv ⋮ S2t ¼ yp1 α2tp1 þ yp2 α2tp2 þ . . . þ ypv α2tpv in which, making use of the parameter change X i ¼ αpi and Y i ¼ ypi , we obtain the equation set S1 ¼ Y 1 X 1 þ Y 2 X 2 þ . . . þ Y v X v S2 ¼ Y 1 X 21 þ Y 2 X 22 þ . . . þ Y v X 2v ⋮ 2t 2t S2t ¼ Y 1 X 2t 1 þ Y 2X2 þ . . . Y vXv :

ð7:14Þ

In general, we can express a syndrome as Sm ¼

v X

Y lXm l :

ð7:15Þ

l¼1

The error location polynomial is expressed as σ ð xÞ ¼

v Y

ð1 þ X l xÞ ! σ ðxÞ ¼ σ v xv þ σ v1 xv1 þ . . . þ σ 1 x þ σ 0

ð7:16Þ

l¼1

where σ v ¼ σ 0 ¼ 1. The error location gets the value of 0 when x ¼ X 1 l , i.e., we have   ¼0! σ X 1 l vþ1 σ v X v þ . . . þ σ 1 X 1 l þ σ v1 X l l þ σ 0 ¼ 0:

ð7:17Þ

Multiplying both sides of Eq. (7.17) by Y l X m l , we obtain   Y l σ v X mv þ σ v1 X mvþ1 þ . . . þ σ 1 X m1 þ σ0Xm ¼ 0: l l l l Summing Eq. (7.18) over all indices l, we obtain

ð7:18Þ

226

σv

7 Reed-Solomon Codes v X

Y l X mv þ σ v1 l

l¼1

v X

Y l X mvþ1 þ . . . þ σ1 l

v X

l¼1

Y l X m1 þ σ0 l

l¼1

v X

Y lXm l ¼ 0

l¼1

in which using Sm ¼

v X

ð7:19Þ

Y lXm l

l¼1

we obtain σ v Smv þ σ v1 Smvþ1 þ . . . þ σ 1 Sm1 þ σ 0 Sm ¼ 0

ð7:20Þ

where using σ 0 ¼ 1, we get σ v Smv þ σ v1 Smvþ1 þ . . . þ σ 1 Sm1 ¼ Sm :

ð7:21Þ

Assuming v ¼ t, we can express Eq. (7.21) in matrix form as 2

S1 6 6 S2 6 6 ⋮ 6 6 4 St1 St

S2 S3

 





St Stþ1

 

3 2 3 2 3 Stþ1 σt St 7 6 7 6 7 6 7 76 Stþ1 76 σ t1 7 6 Stþ2 7 7 6 7 76 7 6 7 6 ⋮ 7 76 ⋮ 7 ¼ 6 ⋮ 7: 7 6 7 76 S2t2 56 σ 2 7 6 S2t1 7 5 4 5 4 S2t1 σ1 S2t

ð7:22Þ

Using Eq. (7.22), we determine the coefficients of the error location polynomial σ(x). The reciprocals of the roots of σ(x) carry information about the error locations. The equation set in Eq. (7.14) can be written as 2

X1

6 X2 6 1 6 4⋮ X 2t 1

X2



X 22 ⋮

 

X 2t 2



2 3 2 3 3 Y1 S1 6 7 6 7 6 7 6 7 X 2v 7 76 Y 2 7 6 S2 7 76 7 ¼ 6 7 ⋮ 56 ⋮ 7 6 ⋮ 7 4 5 4 5 X 2t v Y S Xv

v

2t

which can be expressed in short as XY ¼ S from which the error magnitude vector can be obtained via

ð7:23Þ

7.2 Decoding of Reed-Solomon Codes

227

Y ¼ X 2 1 S:

7.2.2

ð7:24Þ

The Error Evaluator Polynomial

The syndrome polynomial S(x) is defined as SðxÞ ¼ S1 þ S2 x þ S3 x2 þ . . . þ S2t x2t1 :

ð7:25Þ

We define the error evaluator polynomial as BðxÞ ¼ Rx2t fSðxÞσ ðxÞg

ð7:26Þ

which is the remainder polynomial obtained from the division of S(x)σ(x) by x2t. B(x) is a polynomial in the form BðxÞ ¼ b1 þ b2 x þ b3 x2 þ . . . þ bvþ1 xv

ð7:27Þ

where the polynomial coefficients are calculated according to b1 ¼ 1 b2 ¼ S1 þ σ 1 b3 ¼ S2 þ S1 σ 1 þ σ 2

ð7:28Þ

⋮ bv ¼ Sv1 þ Sv2 σ 1 þ . . . þ σ v1 : In general the coefficient bi can be calculated from the product of two vectors as in 2

σ i1

3

7 6 6 σ i2 7 7 6 7 6 7: bi ¼ ½1 S1 . . . Si1 6 ⋮ 7 6 7 6 6 σ1 7 5 4 1 The error magnitudes can be calculated using the error evaluator polynomial A(x) and derivative of the error location polynomial as

228

7 Reed-Solomon Codes

  B X 1 l Y l ¼ 0  1  σ Xl

ð7:29Þ

  where the derivative polynomial σ 0 X 1 is evaluated using l v Y     1 þ X i X 1 σ 0 X 1 ¼ X : l l l

ð7:30Þ

i¼1, i6¼l

Example 7.5 Using the elements of GF(24), the generator polynomial of the tripleerror-correcting Reed-Solomon code, RS(15, 9), is obtained. For the construction of GF(24), the primitive polynomial p(x) ¼ x4 + x + 1 is used. Assume that a data-word is encoded and transmitted. The received word is given as r ðxÞ ¼ α3 x12 þ x8 þ α10 x7 þ α2 x5 þ α8 x4 þ α14 x3 þ α6 : The syndromes for the received word are calculated using Si ¼ r(αi), i ¼ 1, . . ., 6 as S1 ¼ α6

S2 ¼ 0

S3 ¼ α14

S4 ¼ α11

S5 ¼ α14

S6 ¼ α9 :

Using PGZ method, we can calculate the error location polynomial as σ ðxÞ ¼ 1 þ x þ α11 x2 þ α4 x3 from which the error location numbers can be calculated as X 1 ¼ α12

X 2 ¼ α5

X 3 ¼ α:

For v ¼ 3, the error evaluator polynomial can be written as AðxÞ ¼ b1 þ b2 x þ b3 x2 þ b4 x3 for which the coefficients b1, b2, b3, and b4 are calculated as b1 ¼ 1 ! b0 ¼ 1 b2 ¼ S1 þ σ 1 ! σ 2 ¼ α6 þ 1 ! σ 2 ¼ α3 þ α2 þ 1 ! b2 ¼ α13 b3 ¼ S2 þ S1 σ 1 þ σ 2 ! b3 ¼ 0 þ α6 þ α11 ! b3 ¼ α b4 ¼ S3 þ S2 σ 1 þ S1 σ 2 þ σ 3 ! b4 ¼ α14 þ 0 þ α6 α11 þ α4 ! b4 ¼ α11 : Using the calculated coefficients, we can write the error evaluator polynomial as in

7.2 Decoding of Reed-Solomon Codes

229

BðxÞ ¼ 1 þ α13 x þ αx2 þ α11 x3 : We can calculate the error magnitudes using   B X 1 l Y l ¼ 0  1  σ Xl where v Y     σ 0 X 1 1 þ X i X 1 ¼ X l l l i¼1, i6¼l

as in     B X 1 B X 1 1 2 Y 1 ¼ 0  1  Y 2 ¼ 0  1  σ X1 σ X2

  B X 1 3 Y 3 ¼ 0  1  σ X3

which can be written as     B X 1 B X 1 1 2   Y2 ¼    Y1 ¼  1 1 X 1 1 þ X 1 X 2 1 þ X 1 1 X2 1 þ X1 X3 2 X1 1 þ X2 X3   B X 1 3     Y3 ¼ 1 X 3 1 þ X 1 3 X1 1 þ X3 X2 leading to Y 1 ¼ α3 Y 2 ¼ α3 Y 3 ¼ α9 : Thus the error polynomial can be written as eðxÞ ¼ α3 x12 þ α3 x5 þ α9 x1 :

7.2.3

Berlekamp Algorithm

The PGZ algorithm can be used to find the error locations for BCH and RS codes. The PGZ algorithm involves inverse matrix calculation. Hence, as the error correction capability of a code increases, the use of PGZ algorithm becomes infeasible due to heavy computational requirement needed for the calculation of the matrix inverse. For this reason, a less computationally burdensome algorithm called Berlekamp

230

7 Reed-Solomon Codes

algorithm is proposed in the literature. The Berlekamp algorithm determines the coefficients of the error location polynomial σ(x) in an iterative manner. Whenever a set of coefficients are calculated using the Berlekamp algorithm, they are checked employing them for the calculation of a syndrome. If the check fails, in the next iteration, a correction factor is used for the calculation of coefficients of the error location polynomial. Now let’s provide the Berlekamp algorithm. Berlekamp Algorithm Before giving the algorithm, let’s introduce some definitions. The error location polynomial for the ith iteration is given as σ i ðxÞ ¼ 1 þ σ i1 x þ σ i2 x2 þ . . . þ σ iri xri

ð7:31Þ

where ri is the degree of the polynomial σ i(x). To check whether the coefficients are correct or not, we use Newton’s equation 2

Svþ1

3

2

Sv1



Sv ⋮

 ⋮

S2v2



Sv

7 6 6 Svþ2 7 6 S 7 6 vþ1 6 7¼6 6 6 ⋮7 4 ⋮ 5 4 S2v1 S 2v

2 3 3 σ1 6 7 6 7 S2 7 76 σ 2 7 76 7 ⋮ 56 ⋮ 7 4 5 Sv σ S1

ð7:32Þ

v

from which we can write Sbiþ1 ¼ σ i1 Si þ σ i1 Si1 þ    þ σ iri Siþ1ri

ð7:33Þ

where Sbiþ1 is the estimated syndrome obtained using the estimated coefficients σ i1 , σ i2 , . . . , σ iri . Let’s define the discrepancy factor as di ¼ Sbiþ1 þ Siþ1 :

ð7:34Þ

If the estimated coefficients are correct, then the estimated syndrome Sbiþ1 becomes equal to the calculated syndrome Si + 1, and in this case, we get di ¼ Sbiþ1 þ Siþ1 ! di ¼ 0: Otherwise, we have di ¼ Sbiþ1 þ Siþ1 ! di 6¼ 0: Let’s define the parameter nk as

7.2 Decoding of Reed-Solomon Codes

231

nk ¼ k  r k

ð7:35Þ

where rk is the degree of σ k(x) and k is the iteration index. Now, let’s explain the Berlekamp algorithm in steps. 1. The iteration index i is initialized to 1, i.e., i ¼  1, and for i ¼  1, we have σ 1 ðxÞ ¼ 1 r 1 ¼ 0 d1 ¼ 0 n1 ¼ 1 and for i ¼ 0, we have σ 0 ðxÞ ¼ 1 r 0 ¼ 0 d0 ¼ S1 n0 ¼ 0: 2. The iterations are performed for i ¼ 1, . . ., 2t. 3. For iteration index i, calculate the estimated syndrome using Sbiþ1 ¼ σ 01 Si þ σ 02 Si1 þ    þ σ 0ri Siþ1ri

ð7:36Þ

where ri is the degree of σ i(x). Using the estimated syndrome and calculated syndrome, compute the discrepancy factor as di ¼ Sbiþ1 þ Siþ1 :

ð7:37Þ

4. If di ¼ 0, then we have σ iþ1 ðxÞ ¼ σ i ðxÞ

r iþ1 ¼ r i

ð7:38Þ

where ri + 1 denotes the degree of σ i + 1(x) and ri is the degree of σ i(x). If di 6¼ 0, then we have σ iþ1 ðxÞ ¼ σ i ðxÞ þ ei ðxÞ

ð7:39Þ

xi d i σ k ð xÞ xk d k

ð7:40Þ

where e(x) is calculated as ei ðxÞ ¼

k