网站大量收购独家精品文档,联系QQ:2885784924

计网实验LAB1 Coding on error dectecting algorithms(C++).doc

计网实验LAB1 Coding on error dectecting algorithms(C++).doc

  1. 1、本文档共6页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
计网实验LAB1Codingonerrordectectingalgorithms(C)

《计算机通信与网络实验》 课程实验报告 实验一 : LAB1 Coding on error dectecting algorithms(C++) 实验名称:LAB1 Coding on error dectectingalgorithms(C) 1.实验内容 1. Cyclic redundancy check Using 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.704 CRC-16 x16+x15+x2+1 IBM SDLC CRC-32 x32+x26+x23+...+x2+x+1 ZIP, RAR, IEEE 802 LAN/FDDI, IEEE 1394, PPP-FCS For the error patter listed below, what the conclusion does the receiver get? Can the receiver find the errors? Case Error pattern No error 0000……0000 One error 1000…..000 Two errors 100….001 Random errors Random error pattern 2.Parity check Using 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? CaseError patternNo error0000……0000One error1000…..000Two errors100….001 2.实验结果 一、 二、 3.实验程序 一、 #include stdio.h #include string.h #include stdlib.h unsigned int char2int(char *str) { unsigned int count=0, ret=0; for(count = 0; countstrlen(str);count++) { ret = ret1; if(0 != str[count]) { ret+=1;} } return ret; } unsigned int getR(char *str) { unsigned int c =0 ; int ret = strlen(str)-1; for(c=0;c strlen(str);c++) { if(str[c] != 0) {return ret-c;} } } int getRi(unsigned int num) { int c =0; for(;num != 0; c++) {num = num1;} 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 r; unsigned int yx = code; for(;getRi(yx) = getRi(iG);) { yx = yx ^ (iG(getRi(yx) - getRi(iG)));} code += yx; itoa(code,scode,2); } void main() { char data[8]= , bds[8]

文档评论(0)

xcs88858 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8130065136000003

1亿VIP精品文档

相关文档