- 1、本文档共6页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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]
您可能关注的文档
- 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
- 隐形变异作风问题的检视与整改培训讲座PPT课件.pptx
- 内蒙古自治区赤峰第四中学2023-2024学年高二下学期5月期中物理试题 含解析.docx
- 内蒙古自治区巴彦淖尔市第一中学2024-2025学年高一下学期4月期中考试 物理 含答案.docx
- 内蒙古自治区赤峰市第四中学2024-2025学年高二下学期4月月考试题 物理 含答案.docx
- 内蒙古自治区鄂尔多斯市达拉特旗达拉特旗第一中学2023-2024学年高一下学期7月期末考试物理试题 含解析.docx
- 新修订《代表法》五大亮点解读.pptx
- 幼儿园夏季防暑降温安全课主题活动PPT课件.pptx
- 2025年宜明昂科分析报告:CD47融合蛋白安全性及疗效优秀,市场空间广阔.pdf
- 2-数学_数学答案.pdf
- 幼儿园小学端午节习俗文化教育教学主题班会PPT课件.pptx
文档评论(0)