0% found this document useful (0 votes)
43 views4 pages

Tugas Lab Session 2

This document provides information about applying table lookup decoding to a (7,4) Hamming code. It includes: - The values of n=7 and k=4 for the code - The generator and parity check matrices G and H - A table listing the codewords, corresponding messages, and weights for the code obtained through simulation - Questions about the minimum hamming distance, number of errors the code can detect and correct It also provides a MATLAB code to construct a lookup table for a (6,3) block code generated by a given submatrix.

Uploaded by

Norman andika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views4 pages

Tugas Lab Session 2

This document provides information about applying table lookup decoding to a (7,4) Hamming code. It includes: - The values of n=7 and k=4 for the code - The generator and parity check matrices G and H - A table listing the codewords, corresponding messages, and weights for the code obtained through simulation - Questions about the minimum hamming distance, number of errors the code can detect and correct It also provides a MATLAB code to construct a lookup table for a (6,3) block code generated by a given submatrix.

Uploaded by

Norman andika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Reindy Gerian Pranata

1110117421417

EXERCISES
1. Apply table lookup decoding to (7,4) hamming code. The P submatrix is given as

1 0 1

a) Write the value of n and k.


[ ]
1
1
0
1
1
1
1
0
1

N= 7 , k=4

b) Create G and H matrices.

1 0 1 1 0 0 0

[
G= 1
1
0
1
1
1
1
0
1
0
0
0
1
0
0
0
1
0
0
0
1
]
1 0 0 1 1 1 0

[
H= [ Ikxk |Pt ¿= 0 1 0 0 1 1 1
0 0 1 1 1 0 1 ]
c) Tabulate the code words through simulation and write their corresponding
weights.
Message Code Vector Weigths
0000 0000000 -
0001 0110001 3
0010 1100010 3
0011 1010011 4
0100 1110100 4
0101 1000101 3
0110 0010110 3
0111 0100111 4
1000 1011000 3
1001 1101001 4
1010 0111010 4
1011 0001011 3
1100 0101100 3
1101 0011101 4
1110 1001110 4
1111 1111111 7
Reindy Gerian Pranata
1110117421417

d) The minimum hamming distance = 3


e) The no. of errors this code can detect is
f) The no. of errors this code can correct is

PROGRAM:

%Linear Block Code


clc;
clear all;
% Input Generator Matrix
G=input('Masukkan Generator Matrix: ')
disp ('G = ')
[n,k] = size(transpose(G))
for i = 1:2^k
for j = k:-1:1
if rem(i-1,2^(-j+k+1))>=2^(-j+k)
u(i,j)=1;
else
u(i,j)=0;
end
end
end
u;
parmat2=gen2par(G)
disp('Tampilkan Codeword:')
c = rem(u*G,2)
disp('Nilai Minimum Hamming Distance (dmin) adalah : ')
d_min = min(sum((c(2:2^k,:))'))
Reindy Gerian Pranata
1110117421417

2. Write MATLAB code to construct lookup table for the (6,3) block code generated by the
submatrix.

1 1 0

[ ]
0 1 1
1 0 1
Reindy Gerian Pranata
1110117421417

PROGRAM :
%Linear Block Code
clc;
clear all;
% Input Generator Matrix
G=input('Masukkan Generator Matrix: ')
disp ('G = ')

You might also like