# Binary encoding function problem

consider the binary encoding function that sends (a1,a2,a3) into (a1,a2,a3,a1+a2, a2+a3, a1+a3,a1+a2+a3). First , how can I give a generator matrix of this code
. then how can I provide the parity check matrix , giving n,k and the minimum distance of the code. Finall, how to decode m1=1100010 and m2= 0111010

Related Calculus and Beyond Homework Help News on Phys.org
chiro

consider the binary encoding function that sends (a1,a2,a3) into (a1,a2,a3,a1+a2, a2+a3, a1+a3,a1+a2+a3). First , how can I give a generator matrix of this code
. then how can I provide the parity check matrix , giving n,k and the minimum distance of the code. Finall, how to decode m1=1100010 and m2= 0111010
Hey there sara and welcome to the forums.

Since the transformation you are looking for is a linear transformation, we know that we can use linear algebra (ie a matrix).

So we have a three dimensional input and we want to generate a seven dimensional output.

So lets assign our vector as a 1x3 (row vector) and our output as a 1x7 (column vector).

So we have to compose a transformation that goes from
1x3 x (axb) = 1x7

This means that our transformation matrix has dimensions 3x7.

Using this information and the properties of matrix multiplication can you now populate your 3x7 matrix with values?

Thank you very much

ok I could get the generator matrix , but I still do not know how to find the parity check matrix and the minimum distance and then decode m1= 1100010 and m2 = 0111010
Many thanks
Sara

chiro

What kind of codes are you dealing with?

The older parity codes only used one bit for the block, but it seems here you are using four bits for the error correction. So two questions?

1) What is the error correction code mechanism you are using?
2) Is the distance you are referring to called the "Hamming distance"?

Mark44
Mentor

$$\left[ \begin{array} {c c c} 1&0&0\\0&1&0\\0&0&1\\ 1&1&0\\0&1&1\\1&0&1\\1&1&1\end{array} \right]$$
The bottom four rows are used for error detection.

Since you're dealing with binary values, there are eight possible values for an input (a1, a2, a3), so there are eight possible output vectors.

I would guess that the minimum distance you mentioned is the shortest distance between any two of the eight possible output vectors. I'm not sure that this is what you're supposed to do, as it would entail finding the distance between all pairs of the eight vectors, which would be pretty tedious.

On the other hand, maybe what you're supposed to do for the two vectors you are supposed to decode, is to find which of the eight output vectors is the closest. So for example, if the vector you're supposed to decode is (1,1,0,0,0,1,0), and you determine that the closest vector is (1,1,0,0,1,1,0), then the latter would be the corrected vector, which you could decode as a1 = 1, a2 = 1, and a3 = 0.