Professional Documents
Culture Documents
Date:
pogra eafoy
dee chm
Coxttehen Jor 713 bis AsCI Codep Uang
lamnminq Gdes o CRc Denonstade the packel
Captured tracesOsh Wireshade lacke Araly
bol for pees Mode
Leatning Obechves
Studenh
unduutand Dak Liok
La 6S Mede.
2. Studenk w i be able to ndestand hamming
Cde o d CK
hep
Conmpuli Nehooda aro Dkhon and Cerrechon
CondihaM nen Teceivey s dos hoT
i
Matdh Sendus ip. D rig hensmisiDoigitu
3ignas
the oinauy travelima gedrho
Yecei ve Tha MLANJ
chaunge
ViCe vrA ,
Me popuua LOr-cdektch m econiqvAA aR
lwdiMensíonal Cwt
Simple asihy
Page
Date
Che eeavm
Cuclic redwnolounC che ch
Ha
FamMina_ Codes
Hamui de se erfev cofrehon
Locdes the be Used to deteck
-cofectbt evrors na Can ouUY-
daka MOVed chyred le ofhin eTo Ca recha
cecdt, aMming cocle ales ue 3 He concep
pau ty nd pauit bit wtuicn
ddedt dak Hha thevalSdih doa
clheched whe its read O
has bren Yeceve okaka ransaisci.
OSína ore hau ne pauly- bit eTo-Ly echo
Lede ns ma iden
the dath Ont_ buuk ib locahion in he da
Unit
6
d d dr d
Ted wnola bits
Sn Hamminy Code each ht e VRC or
combinahby bis he VAC bit
is
Uornbinohon dala bis Tad n.
cach daka bie y e hludrd n Mbve hg
VRC (allah
Lal elated using
all b posi hovs whese
bivary prawah nLude 1 in e iahhaet poshg
heo fhe voariovs bis a r e parity bib
b Lnmbina ha
Dbit 3,5 7,1,
T2 bib 2, 6, 7, 10,
bi ,5,6,1
bitsL,1, 1D,
T ake ae ze bib
3
deldddd T4aes car ns
dd TS ueA Ca
2 14 A+
nO cunsdant bik are A
Deeamin fue
redundan bits he bis ave placed
powus ie 2 1,8
Loo
A
eleaminiq ekemrig he
i s AC r bjts 3,5, 1 1,1
hddi nq allolel 1
Y VRC or bit 2 d6 1o
Mdy Y
isVRC biA,5,6,1
Addiag Yh 4 3 2
s VR o hit 81 1O,
Page:
Date:
AAdirg 8
10 1 543
w zampe s ve e binasy
nomb LOTYespands doúmal
hewep bt no _Comlaind n errD oLoet
error bit yeyud rom O to 1
Rerece-lerekc
Da CRc
Crigina Menage _ 0 O O oO
Genead PALunarial
O) ** (O) + I ( )
CRC Geneato
H-57E
means X-oR)
MEAS
Page
Date
Sener Re cei e
oO otO0o o'O Oo
O10IOO
OO
Do LLOLL
O oI
Oo1
Mesya toe tra nsmtHed
Zee mea
dalaacceptes
Condusio
tene We haye shodied UOr dekechon Correchbn
Usina
Assignment No. 3
Program:
Hamming Code
#include <IOstream
#includesmath.h>
using namespace std;
Int main01
int data1 1J.ree[11].parity[4
cout < "Hamming Code" << endl;
cout<nSender's Side: \n";
cout"Enter 7 Bit data to send separated by space:";
for(int i-10;i-0;i-)
ifi-O|-1|i3-7)
continue;
cin>>data|i}
IParity Bit Calculation
data[O]-data[2]'data[4]data[6]'data[8] data[10]:
data[1]=data[2/'data[51 data|6] data[9]'data[ 10};
data[3]-data[4]'data|S/data|6];
data[7]=data8]'data|9/'data[10}:
cout"nlnput Data";
for(int i-10,i>-0;i-)
ifi Ol1||i3|-7)
continue;
coutcdata[i};
cout<<"nEncoded Data: ";
for(int i10;i>-0;i--)
coutdata[i};
cout<"nnFor Error CheckinginReceiver's Side:";
cout"inEnter received data bit by bit: ";
forint i10;i>-0;i--)
cin>recli
parity[0]-rec[0/ree[2/°rec[4) rec[6)'rec[8]°rel[10];
parity[1]-rec[1 ree[2/'rece[5]'rec[6)'°rec[9]°ree[10];
parity[2]rec[3)°rec[4)rec[5]°rec[6]:
parity[3]-ree[7°rec[8]°rec[9/'ree[10];
ifparity[0]-0&&parity[ |]-0&&parity[2]-0&&parity[3]-0)
cout<"Data is Correct. No error."
else
cout<"nError in the code.InError Position(Binary): ";
for(int i-3;=0;i-)
coutcparity[i|;
int pos- 0;
for(int i-0;ic4;it+)
return 0
Output
Code
kammi
ender's Side:
inter7 Bit data to send separated space:1 0 01 101
nput Data1001101
ncoded Data: 10011100101
or Error Checking
eceiver s S1de
inter received data bit by bit: 1 0 010100101
rror in the code.
irror Position (Binary): 0111
rror Position (Decimal) : 7
#include <iostream>
using namespace std;
int main 0
int ij.k,l;
/Get Frame
int f
cout" n Enter Frame size: ":
cin>>fs;
int f120]:
I/Get Generator
int g
coutcenI ter Generator size: "
cin>>gs;
int g[20];
cout[i);
cout " n Generator:";
for(i-0;igs;i++)
coutg;
WAppend 0's
int rsgs-l;
coute"n Number of O's to be appended: "<<es;
for (i-fs;icfstrs;it+)
int temp[20]:
for(i-O;i<20;i++)
temp[i)-i:
cout stemp[i):
/Division
for(i-0;ifsit+)
j-0;
k-i;
l/check whether it is divisible or not
if(temp[k}> sü))
forg-0,k=ijgsjt+;k++)
temp[k]-temp[k] sb}/XOR operation
I/CRC
int cre[15]:
for(i-0j-fs;iss;it++j++)
cre[i)-templ
"
cout<<tii
fori-0;i<fs+rsit+)
temp[il-i]
Division
for(i=0;isfstrs;it+)
j0;
k-i;
if (temp[ksU))
forg-0.k-ijgsjt+k++)
temp[k]=temp[k]' gli]; //XOR OPERATION
remj= temp[ik
for(i-0:irsi+)
coutcerrem|ij;
int flag-0;
for(i-0;isrs;it+)
ifrem[il-0)
flag-l;
if( flag-0)
coute"in Since Remainder Is 0 Hence Message Transmitted From Sender To Receriver
Is Correct":
clse
return
Output
nter Frame:1 00
10
nter benerator s1zes 4
Enter Generator:1 1 0 1
Sender Side
enerator :1101
umber o Stoe
Os 100100000
CRC bits E
ransaitted Frame: 100100091
ever S1de
ecelved rame: 1e10
enalnoer
iince Renainder Is Hence Nessage Transaitted From Sender To Receriver 1s Correct