Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

hello this homework must be in computer engineering and i didnt find the major i

ID: 3773739 • Letter: H

Question

hello

this homework must be in computer engineering

and i didnt find the major

its about digital communcation course

The basic formulas for encoding and decoding: Modulo-2 multiplication: for modulo-2 matrix multiplication use the following formulas a. For codeword generating For Syndrome calculation Write a MATLAB code to generate codeword from a data word, and find the syndrome of a codeword and indicate the location of the error (use the G and H matrices given in the class). The code should give the option at the beginning for either generate a codeword from a given dataword. or extract the syndrome bits from a codeword with indicating the bit error location. Find the codeword for the dataword (dtwrd) retrieved form code below (four lines). Add the following code at the beginning of your code to generate a dataword (dtwrd) and let your program shows the codeword, (show your program output)

Explanation / Answer

g=input('Enter The Generator Matrix: ')
disp ('G = ')
disp ('The Order of Linear block Code for given Generator Matrix is:')
[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;
disp('The Possible Codewords are :')
c = rem(u*g,2)
disp('The Minimum Hamming Distance dmin for given Block Code is= ')
d_min = min(sum((c(2:2^k,:))'))

% Code Word
r = input('Enter the Received Code Word:')
p = [g(:,n-k+2:n)];
h = [transpose(p),eye(n-k)];
disp('Hammimg Code')
ht = transpose(h)
disp('Syndrome of a Given Codeword is :')
s = rem(r*ht,2)
for i = 1:1:size(ht)
if(ht(i,1:3)==s)
r(i) = 1-r(i);
break;
end
end
disp('The Error is in bit:')