# 01 - Hamming Codes (Theory)

The preliminary requirements for this assignment: \

- Git installed (see Dev > Git) \
- The assignment template forked (see Dev > template)

The first assignment will help you to understand how Hamming Codes work and how to convert the matrices.

Thus, we will have a deeper look onto the extended Hamming Code `$(8, 4)$`

.

The code is capable of detecting a single-bit error and correct it and, by using an additional (overall) parity bit, it can detect (but not to correct) double-bit errors.

**Deadline for submission: Sunday, 05.11.2023, 23:59 // 11:59 pm (CET)Please upload your solution as PDF file into your own Gitlab repository.**

## Task 1

Create the non-systematic generator matrix `$G_{4,8}'$`

and the parity-check matrix `$H'_{4,8}$`

.

Follow the rules for optimal codes from the Hamming Code specifications.

- Construct
`$G'$`

by adding the binary representation in the correct order (SEC-DED).

Each binary representation should have exactly`$k$`

bits with the least significant bit (LSB) at the bottom.- Mark the columns containing the parity bits with
`$p_{1} \cdots p_{r}$`

and the data bits with`$d_{1} \cdots d_{k}$`

.

- Mark the columns containing the parity bits with
- Derive
`$H'$`

from`$G'$`

considering the order of the data and parity bits.

Take into account that you need the transpose of the corresponding row bits from`$G'$`

.- If not already done extend
`$H'$`

to match the matrix definition`$H'_{4,8}$`

. - Mark the columns holding the parity bits with
`$p_{1} \cdots p_{r}$`

and the data bits with`$d_{1} \cdots d_{k}$`

.

- If not already done extend

## Task 2

Create the systematic generator matrix `$G_{4,8}$`

and the parity-check matrix `$H_{4,8}$`

.

Use your previously generated `$G'_{4,8}$`

as start matrix.

- Convert
`$G'$`

into standard form (RREF) using**row-reduction**only. - For each row, write down the calculation steps necessary for the conversion.
- Write down the resulting matrix after each row processed.

- Derive
`$H$`

from`$G$`

.- For both matrices, mark the columns holding the parity bits with
`$p_{1} \cdots p_{r}$`

and the data bits with`$d_{1} \cdots d_{k}$`

.

- For both matrices, mark the columns holding the parity bits with

## Task 3

Encode the following words `$\overrightarrow{a}$`

using the non-systematic generator matrix `$G'_{4,8}$`

created in Task 1:

`$\overrightarrow{a} = (0100)$`

`$\overrightarrow{a} = (1001)$`

`$\overrightarrow{a} = (0011)$`

`$\overrightarrow{a} = (1101)$`

Since we use a SEC-DED code, the increased error detection capabilities are achieved by adding an overall parity bit that is calculated upon all `$n$`

bits of the encoded word.
You can check your result against the parity table to see, if the values match for `$p_{4}$`

at the corresponding position.

## Task 4

Decode the following words `$\overrightarrow{x}$`

using the systematic parity-check matrix `$H_{4,8}$`

created in Task 2:

`$\overrightarrow{x} = (11001101)$`

`$\overrightarrow{x} = (10011001)$`

`$\overrightarrow{x} = (11011011)$`

`$\overrightarrow{x} = (11010101)$`

Were these words transmitted successfully? If this is not the case, write down the number of detected errors and attempt to correct them.

You can follow these steps:

- Check if the overall parity bit
`$p_{4}$`

is correct. - Calculate the syndrome vector
`$\overrightarrow{z}$`

and write down the matching pattern.- Use the overall parity bit and the syndrome to check for errors following the error pattern table.

- Correct errors if possible and write down the original (source) word.

Take into account that this might not be possible in some cases.

Don’t forget about the order of the bits (`$d$`

and `$p$`

at specific positions).