- 1、本文档共6页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
计网实验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]
您可能关注的文档
- lab6_实验7.doc
- 海灯LED-关于LED灯具知识.doc
- LED OB封装与LED.doc
- lab1MIPS实验报告.doc
- LAB07_解线性方程组的基本迭代法实验.doc
- C语言实验lab07.doc
- 2012年LED辞典.docx
- 劳动合同labor contract -.docx
- GPS使用技能以及相关测量技巧.doc
- Sql_Lab2 连接查询和嵌套查询.doc
- 2025至2030年中国单柄浅煲市场分析及竞争策略研究报告.docx
- 2025至2030年中国单组份环氧树脂胶粘剂市场分析及竞争策略研究报告.docx
- 2025至2030年中国挡风玻璃胶市场分析及竞争策略研究报告.docx
- 2025至2030年中国登山扣指南针市场现状分析及前景预测报告.docx
- 2025至2030年中国地产交易电话短信查询系统市场分析及竞争策略研究报告.docx
- 2025至2030年中国低起泡性精炼剂市场分析及竞争策略研究报告.docx
- 2025至2030年中国套装雨衣行业发展研究报告.docx
- 2025-2031年中国扑克牌行业发展前景预测及投资战略规划研究报告.docx
- 2025年中国进油细管数据监测报告.docx
- 2025年中国后搁板数据监测报告.docx
文档评论(0)