Skip to article frontmatterSkip to article content

Block Codes

Codewords

A qq-ary block code, denoted C\mathcal{C}, consists of a set of MM vectors, referred to as codewords.

Each codeword is of fixed length nn and is represented as:

cm=(cm1,cm2,,cmn),\vec{c}_m = (c_{m1}, c_{m2}, \ldots, c_{mn}),

where mm is the index of the codeword (1mM1 \leq m \leq M), and each component cmic_{mi} (for 1in1 \leq i \leq n) is a symbol from an alphabet of size qq.

The code can be mathematically expressed as:

C={c1,c2,,cM}Xn,\mathcal{C} = \{\vec{c}_1, \vec{c}_2, \ldots, \vec{c}_M\} \subseteq \mathcal{X}^n,

where X\mathcal{X} is the alphabet with X=q|\mathcal{X}| = q, and Xn\mathcal{X}^n denotes the set of all possible sequences of length nn over X\mathcal{X}.

Alphabet and Symbols

The alphabet X\mathcal{X} comprises qq distinct symbols, such as {0,1}\{0, 1\} for a binary code (q=2q = 2) or {0,1,2,3}\{0, 1, 2, 3\} for a quaternary code (q=4q = 4).

Each component of a codeword, cmiXc_{mi} \in \mathcal{X}, determines the code’s structure and its applicability in various systems.

Binary Codes

When q=2q = 2, the alphabet is binary, consisting of symbols {0,1}\{0, 1\}, and the code is termed a binary code.

In this case, each codeword is a vector of nn bits:

cm{0,1}n.\vec{c}_m \in \{0, 1\}^n.

For example, a binary codeword of length n=4n = 4 might be c1=(1,0,1,1)\vec{c}_1 = (1, 0, 1, 1).

Relation Between qq-ary and Binary Representation

If the alphabet size is a power of 2, i.e., q=2bq = 2^b for some positive integer bb, each qq-ary symbol can be represented as a bb-bit binary sequence.

For instance, if q=4=22q = 4 = 2^2, the alphabet {0,1,2,3}\{0, 1, 2, 3\} can be mapped as:

000,101,210,311.0 \to 00, \quad 1 \to 01, \quad 2 \to 10, \quad 3 \to 11.

This mapping enables efficient encoding of qq-ary symbols into binary form for storage or transmission.

Transformation of Nonbinary Codes to Binary Codes

A nonbinary code with block length KK consists of codewords with KK qq-ary symbols.

Such a code can be transformed into a binary code of length n=bKn = bK by representing each qq-ary symbol (where q=2bq = 2^b) as its bb-bit binary equivalent.

For example, consider a quaternary code (q=4q = 4) with block length K=2K = 2 and a codeword c1=(2,3)\vec{c}_1 = (2, 3).

Using the mapping above, 2102 \to 10 and 3113 \to 11, the codeword is transformed into a binary sequence of length n=bK=2×2=4n = bK = 2 \times 2 = 4:

c1(1,0,1,1).\vec{c}_1 \to (1, 0, 1, 1).

Formally, a nonbinary code CXK\mathcal{C} \subseteq \mathcal{X}^K (with X=q|\mathcal{X}| = q) is converted to a binary code C{0,1}bK\mathcal{C}' \subseteq \{0, 1\}^{bK}, where each symbol in X\mathcal{X} is expanded into bb bits.

Example of a qq-ary Block Code

A qq-ary block code C\mathcal{C} is defined with:

The code consists of all possible sequences of length K=2K = 2:

C={(0,0),(0,1),(0,2),(1,0),(1,1),(1,2),(2,0),(2,1),(2,2)}.\begin{split} \mathcal{C} = \{ &(0,0), (0,1), (0,2), \\ &(1,0), (1,1), (1,2), \\ &(2,0), (2,1), (2,2)\}. \end{split}

Each codeword cm=(cm1,cm2)\vec{c}_m = (c_{m1}, c_{m2}), with cmi{0,1,2}c_{mi} \in \{0, 1, 2\}, satisfies CXK\mathcal{C} \subseteq \mathcal{X}^K, where XK=32=9|\mathcal{X}|^K = 3^2 = 9.

This code has no error-correcting capability (minimum Hamming distance 1), but it exemplifies a qq-ary block code structure.

Conversion to Binary Block Code

To convert C\mathcal{C} to a binary block code C\mathcal{C}', each ternary symbol is mapped to a 2-bit sequence (b=log23=2b = \lceil \log_2 3 \rceil = 2):

000,101,210.0 \to 00, \quad 1 \to 01, \quad 2 \to 10.

Each codeword of length K=2K = 2 becomes a binary codeword of length:

n=bK=2×2=4.n = bK = 2 \times 2 = 4.

Transforming the codewords:

The binary code is:

C={(0,0,0,0),(0,0,0,1),(0,0,1,0),(0,1,0,0),(0,1,0,1),(0,1,1,0),(1,0,0,0),(1,0,0,1),(1,0,1,0)}.\begin{split} \mathcal{C}' = \{ &(0,0,0,0), (0,0,0,1), (0,0,1,0), \\ &(0,1,0,0), (0,1,0,1), (0,1,1,0), \\ &(1,0,0,0), (1,0,0,1), (1,0,1,0) \}. \end{split}

Parameters of C\mathcal{C}'

The code C{0,1}4\mathcal{C}' \subseteq \{0, 1\}^4, with {0,1}4=24=16|\{0, 1\}^4| = 2^4 = 16, preserves the size M=9M = 9 and has a minimum Hamming distance of 1, consistent with the original code.

Review of Hamming Distance

The Hamming distance is a metric to measure the difference between two codewords of equal length.

It quantifies the number of positions at which their corresponding symbols differ, assessing a code’s error-detecting and error-correcting capabilities.

Definition

For two codewords c1=(c11,c12,,c1n)\vec{c}_1 = (c_{11}, c_{12}, \ldots, c_{1n}) and c2=(c21,c22,,c2n)\vec{c}_2 = (c_{21}, c_{22}, \ldots, c_{2n}) of length nn over an alphabet X\mathcal{X}, the Hamming distance, denoted dH(c1,c2)d_H(\vec{c}_1, \vec{c}_2), is defined as:

dH(c1,c2)=i=1nδ(c1i,c2i),d_H(\vec{c}_1, \vec{c}_2) = \sum_{i=1}^n \delta(c_{1i}, c_{2i}),

where:

δ(c1i,c2i)={1if c1ic2i,0if c1i=c2i.\delta(c_{1i}, c_{2i}) = \begin{cases} 1 & \text{if } c_{1i} \neq c_{2i}, \\ 0 & \text{if } c_{1i} = c_{2i}. \end{cases}

Thus, dH(c1,c2)d_H(\vec{c}_1, \vec{c}_2) counts the number of indices ii (for 1in1 \leq i \leq n) where c1ic2ic_{1i} \neq c_{2i}.

Example

Consider a ternary (q=3q = 3) block code with codewords of length n=3n = 3 over X={0,1,2}\mathcal{X} = \{0, 1, 2\}.

Let two codewords be:

c1=(0,1,2),c2=(0,2,1).\vec{c}_1 = (0, 1, 2), \quad \vec{c}_2 = (0, 2, 1).

Compute the Hamming distance:

Thus:

dH(c1,c2)=0+1+1=2.d_H(\vec{c}_1, \vec{c}_2) = 0 + 1 + 1 = 2.

The Hamming distance between c1\vec{c}_1 and c2\vec{c}_2 is 2, indicating they differ in two positions.

Note that the Hamming distance of 2 refers to the distance between two specific codewords, c1=(0,1,2)\vec{c}_1 = (0, 1, 2) and c2=(0,2,1)\vec{c}_2 = (0, 2, 1), which differ in two positions.

This does not imply that 2 is the minimum distance of the code, as other pairs in the (unspecified) code could have smaller distances.

Application in Error Detection and Correction

The minimum Hamming distance of a code, mincicjdH(ci,cj)\min_{\vec{c}_i \neq \vec{c}_j} d_H(\vec{c}_i, \vec{c}_j), determines its error-correcting capability.

A code can detect up to d1d-1 errors and correct up to (d1)/2\lfloor (d-1)/2 \rfloor errors, where dd is the minimum distance.

(n,k)(n, k) Code

In a binary block code of length nn, there are 2n2^n possible codewords, representing all possible combinations of nn bits over the alphabet {0,1}\{0, 1\}.

From this set, M=2kM = 2^k codewords, where k<nk < n, are selected to form an (n,k)(n, k) code.

Each codeword uniquely corresponds to a kk-bit information block, with the nkn - k redundant bits enabling error detection or correction.

This encoding process, often implemented via a generator matrix or systematic encoding, defines the code’s structure.

The code rate, given by:

Rc=kn,R_c = \frac{k}{n},

quantifies the fraction of information bits per codeword, reflecting the trade-off between data efficiency and error-correcting capability.

For a general qq-ary code over an alphabet of qq symbols, there are qnq^n possible codewords.

Selecting M=qkM = q^k codewords, where k<nk < n, allows the encoding of kk-symbol information blocks, with each symbol carrying log2q\log_2 q bits of information.

This generalizes the binary case (q=2q = 2), offering increased flexibility in code design for diverse applications, such as high-density data transmission or robust error correction in nonbinary channels.

The code rate remains Rc=knR_c = \frac{k}{n}, and the choice of qq influences the code’s error-correcting power, often measured by the minimum Hamming distance.

Connection Between (n,k)(n, k) Code and qq-ary Block Code

We can say that the (n,k)(n, k) code is a specific parameterization of a qq-ary block code tailored for error control.

Recall the general structure as:

Thus, we can see that the (n,k)(n, k) code is a qq-ary block code with a constrained size, where the number of codewords is M=qkM = q^k.

The qq-ary block code is a more general concept, allowing any MqnM \leq q^n, whereas the (n,k)(n, k) code fixes MM to encode exactly kk qq-ary symbols of information, introducing structure for error control.

Weight (Overview)

A key codeword parameter is its weight, defined as the number of nonzero elements it contains, reflecting its density of active symbols.

Each codeword in a code typically has a unique weight, and the collection of all weights forms the weight distribution.

If all MM codewords share the same weight, the code is classified as a fixed-weight or constant-weight code.

Linear Block Codes

Linear block codes (LBCs), a prominent subset of block codes, have been extensively studied over recent decades due to their advantageous properties.

Their linearity ensures easier implementation and analysis, as operations follow algebraic rules, reducing computational complexity.

LBCs perform comparably to the broader class of block codes, making them practical without significant loss in efficacy.

An LBC C\mathcal{C} is a kk-dimensional subspace within an nn-dimensional space, termed an (n,k)(n, k) code.

For binary LBCs, C\mathcal{C} contains 2k2^k sequences of length nn, closed under addition: if c1,c2C\vec{c}_1, \vec{c}_2 \in \mathcal{C}, then c1+c2C\vec{c}_1 + \vec{c}_2 \in \mathcal{C}.

This closure ensures the all-zero vector 0\vec{0} is always a codeword, a property stemming from the linear structure.

Review of Arithmetic in GF(2)\text{GF}(2)

In coding theory, particularly for binary linear block codes, the underlying algebraic structure is the finite field GF(2)\text{GF}(2).

Arithmetic operations (addition, subtraction, multiplication, and division, where applicable) are computed with the result taken modulo 2, ensuring that outputs remain in the set {0,1}\{0, 1\}.

The operations in GF(2)\text{GF}(2) are defined as follows:

Generator Matrix for LBC

In an LBC, the mapping from M=2kM = 2^k information sequences of length kk to 2k2^k codewords of length nn is represented by a k×nk \times n generator matrix G\mathbf{G}, where:

cm=umG,1m2k\vec{c}_m = \vec{u}_m \mathbf{G}, \quad 1 \leq m \leq 2^k

Here, um\vec{u}_m is a kk-bit information sequence, and cm\vec{c}_m is its corresponding codeword.

The matrix G\mathbf{G} encapsulates the linear transformation, enabling systematic encoding by defining how information bits generate codewords, streamlining both design and hardware realization.

The rows of G\mathbf{G}, denoted gi\vec{g}_i for 1ik1 \leq i \leq k, are codewords corresponding to the kk standard basis vectors of the information space (e.g., (1,0,,0)(1,0,\ldots,0), etc.), structured as:

G=[g1g2gk]\mathbf{G} = \begin{bmatrix} \vec{g}_1 \\ \vec{g}_2 \\ \vdots \\ \vec{g}_k \end{bmatrix}

Thus, a codeword is:

cm=i=1kumigi\vec{c}_m = \sum_{i=1}^{k} u_{mi} \vec{g}_i

where summation occurs in the Galois Field GF(2)\mathrm{GF}(2) (modulo-2 arithmetic), ensuring binary operations.

The code C\mathcal{C} is the row space of G\mathbf{G}, encompassing all linear combinations of its rows.

Two LBCs, C1\mathcal{C}_1 and C2\mathcal{C}_2, are equivalent if their generator matrices share the same row space, possibly after column permutation, indicating that code properties depend on the subspace, not the specific matrix representation.

Parity Check Bits

When the generator matrix G\mathbf{G} of a linear block code is structured as Proakis (2007, Eq. (7.2-4)):

G=[IkP]\mathbf{G} = [\mathbf{I}_k | \mathbf{P}]

where Ik\mathbf{I}_k is a k×kk \times k identity matrix and P\mathbf{P} is a k×(nk)k \times (n - k) matrix, the code is classified as systematic.

In systematic codes, the first kk components of a codeword directly correspond to the information sequence, explicitly retaining the original data.

The subsequent nkn - k components, termed parity check bits, are generated from the information bits using P\mathbf{P} and provide redundancy to mitigate transmission errors.

It is noteworthy that any linear block code can be converted into an equivalent systematic form, as represented by the above equation, through elementary row operations (such as row swapping or addition) and column permutations, preserving the code’s essential characteristics while achieving this structured format.

Example

To demonstrate the conversion of a linear block code into an equivalent systematic form, consider a (4,2)(4, 2) binary linear block code (codeword length n=4n = 4, information bits k=2k = 2) with the generator matrix:

G1=[11010111]\mathbf{G}_1 = \begin{bmatrix} 1 & 1 & 0 & 1 \\ 0 & 1 & 1 & 1 \end{bmatrix}

This matrix is not in systematic form, as it lacks the structure G=[IkP]\mathbf{G} = [\mathbf{I}_k | \mathbf{P}], where Ik\mathbf{I}_k is the 2×22 \times 2 identity matrix.

Perform Elementary Row Operations

The objective is to transform the first k=2k = 2 columns into the identity matrix I2=[1001]\mathbf{I}_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}.

The first column of G1\mathbf{G}_1 is already [10]\begin{bmatrix} 1 \\ 0 \end{bmatrix}.

To achieve [01]\begin{bmatrix} 0 \\ 1 \end{bmatrix} in the second column, we need a 0 in position (1, 2) (currently 1) and a 1 in position (2, 2) (already 1).

Perform the row operation: Row 1Row 1+Row 2\text{Row 1} \gets \text{Row 1} + \text{Row 2} (in GF(2)\text{GF}(2), addition is XOR):

[1101]+[0111]=[1010]\begin{bmatrix} 1 & 1 & 0 & 1 \end{bmatrix} + \begin{bmatrix} 0 & 1 & 1 & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 1 & 0 \end{bmatrix}

The resulting matrix is:

G2=[10100111]\mathbf{G}_2 = \begin{bmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 1 \end{bmatrix}

The first two columns now form I2\mathbf{I}_2, so the matrix is in systematic form:

G2=[I2P],whereP=[1011]\mathbf{G}_2 = [\mathbf{I}_2 | \mathbf{P}], \quad \text{where} \quad \mathbf{P} = \begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix}

Note that no column permutations were required here, as the first two columns were transformed into I2\mathbf{I}_2 using row operations.

Preservation of Code Characteristics

The matrix G2\mathbf{G}_2 generates codewords equivalent to those of G1\mathbf{G}_1. For an information sequence u=[u1,u2]\vec{u} = [u_1, u_2], the codeword using G2\mathbf{G}_2 is:

c=uG2=[u1,u2,u1+u2,u2]\vec{c} = \vec{u} \mathbf{G}_2 = [u_1, u_2, u_1 + u_2, u_2]

The original matrix G1\mathbf{G}_1 produces:

c=uG1=[u1,u1+u2,u2,u1+u2]\vec{c}' = \vec{u} \mathbf{G}_1 = [u_1, u_1 + u_2, u_2, u_1 + u_2]

The codewords span the same code (up to permutation), preserving the error-correcting properties, such as the minimum distance.

This example shows how a single row operation transforms G1\mathbf{G}_1 into the systematic G2\mathbf{G}_2, maintaining the code’s essential characteristics.

Dual Code and Parity Check Matrix

An orthogonal complement of code C\mathcal{C} consists of all nn-dimensional binary vectors orthogonal to every codeword in C\mathcal{C}.

Since C\mathcal{C} constitutes a kk-dimensional subspace within the nn-dimensional binary vector space, its orthogonal complement forms an (nk)(n - k)-dimensional subspace.

This subspace defines an (n,nk)(n, n - k) code, denoted C\mathcal{C}^\perp, referred to as the dual code of C\mathcal{C}.

The generator matrix of C\mathcal{C}^\perp, an (nk)×n(n - k) \times n matrix, has rows orthogonal to those of G\mathbf{G}, the generator matrix of C\mathcal{C}.

This matrix, known as the parity check matrix of C\mathcal{C} and denoted H\mathbf{H}, satisfies the condition that for every codeword cC\vec{c} \in \mathcal{C}:

cHT=0\vec{c} \, \mathbf{H}^{\sf T} = \vec{0}

This orthogonality property enables H\mathbf{H} to serve as a mechanism for verifying membership in C\mathcal{C}, leveraging the algebraic structure of linear codes for error detection.

Parity Check Matrix Properties

A binary nn-dimensional vector c\vec{c} satisfies cHT=0\vec{c} \, \mathbf{H}^{\sf T} = \vec{0} if and only if it resides in the orthogonal complement of the row space of H\mathbf{H}, which corresponds exactly to C\mathcal{C}.

Thus, this equation establishes a necessary and sufficient condition for c{0,1}n\vec{c} \in \{0, 1\}^n to be a codeword, rendering H\mathbf{H} an effective tool for codeword identification.

Given that the rows of G\mathbf{G} are codewords, it follows that:

GHT=0\mathbf{G} \mathbf{H}^{\sf T} = \vec{0}

For systematic codes where G=[IkP]\mathbf{G} = [\mathbf{I}_k | \mathbf{P}], the parity check matrix is expressed as Proakis (2007, Eq. (7.2-7)):

H[PTInk]\mathbf{H} \triangleq [ -\mathbf{P}^{\sf T} | \mathbf{I}_{n-k} ]

In the binary field (GF(2)), where modulo-2 arithmetic applies, PT=PT-\mathbf{P}^{\sf T} = \mathbf{P}^{\sf T}, simplifying H\mathbf{H} to [PTInk][ \mathbf{P}^{\sf T} | \mathbf{I}_{n-k} ].

This configuration ensures that the product GHT=0\mathbf{G} \mathbf{H}^{\sf T} = \vec{0} holds, as the interaction between P\mathbf{P} and PT\mathbf{P}^{\sf T} aligns with the identity matrices to satisfy the orthogonality condition.

Example

We illustrate the concepts of the dual code and parity check matrix, consider a (4,2)(4, 2) linear block code C\mathcal{C} over GF(2)\text{GF}(2), with codeword length n=4n = 4 and information bits k=2k = 2.

The dual code C\mathcal{C}^\perp is a (4,nk)=(4,2)(4, n - k) = (4, 2) code.

Define the Code C\mathcal{C}

Let the generator matrix of C\mathcal{C} be:

G=[10100111]\mathbf{G} = \begin{bmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 1 \end{bmatrix}

This is in systematic form, G=[I2P]\mathbf{G} = [\mathbf{I}_2 | \mathbf{P}], where:

I2=[1001],P=[1011]\mathbf{I}_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \quad \mathbf{P} = \begin{bmatrix} 1 & 0 \\ 1 & 1 \end{bmatrix}

The codewords are generated as c=uG\vec{c} = \vec{u} \mathbf{G} for u=[u1,u2]\vec{u} = [u_1, u_2]. Computing all codewords:

Thus:

C={[0,0,0,0],[1,0,1,0],[0,1,1,1],[1,1,0,1]}\mathcal{C} = \{ [0, 0, 0, 0], [1, 0, 1, 0], [0, 1, 1, 1], [1, 1, 0, 1] \}

This is a 2-dimensional subspace of F24\mathbb{F}_2^4.

Find the Dual Code C\mathcal{C}^\perp

Note that all arithmetic is mod 2.

The dual code C\mathcal{C}^\perp consists of all x=[x1,x2,x3,x4]F24\vec{x} = [x_1, x_2, x_3, x_4] \in \mathbb{F}_2^4 such that xc=0\vec{x} \cdot \vec{c} = 0 for all cC\vec{c} \in \mathcal{C}.

Since C\mathcal{C} is spanned by the rows of G\mathbf{G}, x\vec{x} must be orthogonal to:

Let x3=ax_3 = a, x4=bx_4 = b. Then x1=ax_1 = a, x2=a+bx_2 = a + b, so x=[a,a+b,a,b]\vec{x} = [a, a + b, a, b].

The codewords are:

Thus:

C={[0,0,0,0],[1,1,1,0],[0,1,0,1],[1,0,1,1]}\mathcal{C}^\perp = \{ [0, 0, 0, 0], [1, 1, 1, 0], [0, 1, 0, 1], [1, 0, 1, 1] \}

This is a (4,2)(4, 2) code, with dimension nk=2n - k = 2.

Construct the Parity Check Matrix H\mathbf{H}

The parity check matrix H\mathbf{H} of C\mathcal{C} is the generator matrix of C\mathcal{C}^\perp, an (nk)×n=2×4(n - k) \times n = 2 \times 4 matrix. For a systematic G\mathbf{G}, we have:

H=[PTI2],PT=[1101]\mathbf{H} = [\mathbf{P}^{\sf T} | \mathbf{I}_2], \quad \mathbf{P}^{\sf T} = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}

Thus:

H=[11100101]\mathbf{H} = \begin{bmatrix} 1 & 1 & 1 & 0 \\ 0 & 1 & 0 & 1 \end{bmatrix}

The rows [1,1,1,0][1, 1, 1, 0] and [0,1,0,1][0, 1, 0, 1] are in C\mathcal{C}^\perp.

Verify Orthogonality

For every cC\vec{c} \in \mathcal{C}, we must have cHT=0\vec{c} \, \mathbf{H}^{\sf T} = \vec{0}, where:

HT=[10111001]\mathbf{H}^{\sf T} = \begin{bmatrix} 1 & 0 \\ 1 & 1 \\ 1 & 0 \\ 0 & 1 \end{bmatrix}

Verify for each codeword:

All satisfy cHT=0\vec{c} \, \mathbf{H}^{\sf T} = \vec{0}.

Error Detection

The matrix H\mathbf{H} enables error detection. For a received vector r\vec{r}, the syndrome is s=rHT\vec{s} = \vec{r} \mathbf{H}^{\sf T}. If s=0\vec{s} = \vec{0}, then rC\vec{r} \in \mathcal{C}. For example, test r=[1,0,0,0]\vec{r} = [1, 0, 0, 0]:

s=[1,0,0,0]HT=[1,0]0\vec{s} = [1, 0, 0, 0] \mathbf{H}^{\sf T} = [1, 0] \neq \vec{0}

This indicates rC\vec{r} \notin \mathcal{C}, detecting an error.

This example demonstrates that H\mathbf{H} is the parity check matrix of C\mathcal{C}, generates C\mathcal{C}^\perp, and supports error detection, as described.

EXAMPLE: (7, 4) Linear Block Code

Consider a (7, 4) linear block code with the generator matrix:

G=[I4P]=[1000101010011100101100001011]\mathbf{G} = [\mathbf{I}_4 | \mathbf{P}] = \begin{bmatrix} 1 & 0 & 0 & 0 & 1 & 0 & 1 \\ 0 & 1 & 0 & 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 1 & 0 & 1 & 1 \end{bmatrix}

This structure, featuring a 4×4 identity matrix I4\mathbf{I}_4 followed by a 4×3 matrix P\mathbf{P}, identifies it as a systematic code, where the first four bits of each codeword mirror the information sequence.

The corresponding parity check matrix is:

H=[PTInk]=[111010001110101101001]\mathbf{H} = [\mathbf{P}^{\sf T} | \mathbf{I}_{n-k}] = \begin{bmatrix} 1 & 1 & 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 1 & 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 1 & 0 & 0 & 1 \end{bmatrix}

For an information sequence u=(u1,u2,u3,u4)\vec{u} = (u_1, u_2, u_3, u_4), the codeword c=(c1,c2,,c7)\vec{c} = (c_1, c_2, \ldots, c_7) is computed as:

c1=u1,c2=u2,c3=u3,c4=u4,c5=u1+u2+u3,c6=u2+u3+u4,c7=u1+u2+u4\begin{split} &c_1 = u_1, \quad c_2 = u_2, \quad c_3 = u_3, \quad c_4 = u_4, \\ & c_5 = u_1 + u_2 + u_3, \quad c_6 = u_2 + u_3 + u_4, \\ & c_7 = u_1 + u_2 + u_4 \end{split}

Here, the first four components copy the input, while the last three (parity bits) are linear combinations over GF(2), enhancing error detection capability.

References
  1. Proakis, J. (2007). Digital Communications (5th ed.). McGraw-Hill Professional.