资源预览内容
第1页 / 共6页
第2页 / 共6页
第3页 / 共6页
第4页 / 共6页
第5页 / 共6页
第6页 / 共6页
亲,该文档总共6页全部预览完了,如果喜欢就下载吧!
资源描述
计算机通信与网络实验课程实验报告实验一 : LAB1 Coding on error dectecting algorithms(C+)实验名称:LAB1 Coding on error dectectingalgorithms(C)1.实验内容1. Cyclic redundancy checkUsing the polynomials below to encode random generated data stream (40-100bits). Show the FEC, and encoded data frame.CRC-4 x4+x+1 ITU G.704CRC-16 x16+x15+x2+1 IBM SDLCCRC-32 x32+x26+x23+.+x2+x+1 ZIP, RAR, IEEE 802 LAN/FDDI, IEEE 1394, PPP-FCSFor the error patter listed below, what the conclusion does the receiver get? Can the receiver findthe errors?Case Error patternNo error 00000000One error 1000.000Two errors 100.001Random errors Random error pattern2.Parity checkUsing even or odd parity check on random generated data stream (8-20bits).Show encoded data frame.For the error patter listed below, what the conclusion does the receiver get? Can the receiver find the errors?Case Error patternNo error 00000000One error 1000.000Two errors 100.0012.实验结果一、二、3.实验程序一、#include #include #include stdlib.hunsigned int char2int(char *str)unsigned int count=0, ret=0;for(count = 0; count1;return c;void CRC(char *scode, char *p, char*g )unsigned int iP = char2int(p);unsigned int iG = char2int(g);unsigned int r= getR(g);unsigned int code = iP = getRi(iG);) yx = yx (iG#include void fun(char *s)int i=0;int sum=0;for(i=0;i200;i+)sum=sum+si;if(sum+1)%2=0)printf(+1 通过偶校验);if(sum+0)%2!=0)printf(+0 通过奇校验);if(sum+1)%2=1)printf(+1 通过奇校验);if(sum+0)%2=0)printf(+0 通过偶校验);int main()printf(输入二进制码:n);char scr200;gets(scr);fun(scr);奇校验:就是让原有数据序列中(包括你要加上的一位)1 的个数为奇数。偶校验:就是让原有数据序列中(包括你要加上的一位)1 的个数为偶数
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号