




免费预览已结束,剩余2页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
EDA技术实验报告实验名称:循环冗余校验(CRC)模块设计姓名:xxx班级:xxxx学号:xxxxx实验日期:指导教师:一、 实验设计要求编译示例文件,给出仿真波形。建立一个新的设计,调入crcm模块。把其中的CRC校验生成模块和CRC校验查错模块连接在一起,协调工作。引出必要的信号,锁定引脚,并在EDA实验系统上实现。二、设计原理电路结构图或原理图:Crcm:Crcma:电路功能描述:把crcm模块的datacrco和datacrci连接起来,hrecv和hsend连接起来,输入有效数据后CRC校验生成模块对数据进行特殊运算,产生5位校验码,并和原数据并接成17位传输数据,CRC校验查错模块取出传输数据后12位并对它进行同样的特殊运算,得到5位校验码,于传输数据钱5位比较,如果一样那么传输无误,不一样说明数据在传输途中错误了。三、实验程序程序一:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity crcm isport(clk,hrecv,datald,rst:in std_logic; sdata:in std_logic_vector(11 downto 0); datacrco:out std_logic_vector(16 downto 0); datacrci:in std_logic_vector(16 downto 0); rdata:out std_logic_vector(11 downto 0); datafini:out std_logic; error0,hsend:out std_logic);end crcm;architecture comm of crcm is constant multi_coef: std_logic_vector(5 downto 0) :=110101; signal cnt,rcnt:std_logic_vector(4 downto 0); signal dtemp,sdatam,rdtemp:std_logic_vector(11 downto 0); signal rdatacrc:std_logic_vector(16 downto 0); signal st,rt:std_logic;beginprocess(rst,clk) variable crcvar :std_logic_vector(5 downto 0);beginif rst =1 then st =0 ; elsif(clkevent and clk =1)then if(st = 0 and datald =1) then dtemp = sdata;sdatam = sdata;cnt 0); hsend=0; st=1; elsif(st =1 and cnt 7) then cnt = cnt + 1; if(dtemp(11)=1) then crcvar :=dtemp(11 downto 6)xor multi_coef; dtemp = crcvar(4 downto 0) & dtemp(5 downto 0) & 0; else dtemp = dtemp(10 downto 0) & 0;end if; elsif(st=1 and cnt=7)then datacrco=sdatam & dtemp(11 downto 7); hsend =1;cnt =cnt + 1; elsif(st=1 and cnt =8) then hsend = 0;st = 0; end if; end if;end process;process(rst,hrecv,clk) variable rcrcvar : std_logic_vector(5 downto 0);beginif rst =1 then rt =0; elsif(clkevent and clk =1)then if(rt = 0 and hrecv =1)then rdtemp =datacrci(16 downto 5); rdatacrc =datacrci;rcnt 0);error0= 0;rt=1; elsif(rt = 1 and rcnt7)then datafini=0;rcnt=rcnt+1; if(rdtemp(11) = 1)then rcrcvar := rdtemp(11 downto 6)xor multi_coef; rdtemp= rcrcvar(4 downto 0) & rdtemp(5 downto 0) & 0; else rdtemp= rdtemp(10 downto 0)&0;end if; elsif(rt=1 and rcnt=7)then datafini=1; rdata=rdatacrc(16 downto 5); rt=0; if(rdatacrc(4 downto 0)/=rdtemp(11 downto 7)then error0rst,clk=clk,sdata=sdata,datald=datald,datacrco=datacrcp,hrecv=hsenp,hsend=hsenp,datacrci=datacrcp,rdata=rdata,error0=error0,datafini=datafini);end architecture comm;四、编译及仿真结果选用器件型号、编译后使用器件资源情况、引脚配置情况(硬件实验):时序分析结果(最大延时路径、最大时钟频率等等):程序仿真波形图(结合文字分析仿真结果):五、总结程序有点长,输入过程中注意漏字,漏符号。六、思考题library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity crcm isport(clk,hrecv,datald,rst:in std_logic; sdata:in std_logic_vector(11 downto 0); datacrco:out std_logic_vector(16 downto 0); datacrci:in std_logic_vector(16 downto 0); rdata:out std_logic_vector(11 downto 0); datafini:out std_logic; error0,hsend:out std_logic);end crcm;architecture comm of crcm is constant multi_coef: std_logic_vector(5 downto 0) :=110101; signal cnt,rcnt:std_logic_vector(4 downto 0); signal dtemp,sdatam,rdtemp:std_logic_vector(11 downto 0); signal rdatacrc:std_logic_vector(16 downto 0); signal st,rt:std_logic;beginprocess(rst,clk) variable crcvar :std_logic_vector(5 downto 0);beginif rst =1 then st =0 ; elsif(clkevent and clk =1)then if(st = 0 and datald =1) then dtemp = sdata;sdatam = sdata;cnt 0); hsend=0; st=1; elsif(st =1 and cnt 7) then cnt = cnt + 1; if(dtemp(11)=1) then crcvar :=dtemp(11 downto 6)xor multi_coef; dtemp = crcvar(4 downto 0) & dtemp(5 downto 0) & 0; else dtemp = dtemp(10 downto 0) & 0;end if; elsif(st=1 and cnt=7)then datacrco=sdatam & dtemp(11 downto 7); hsend =1;cnt =cnt + 1; elsif(st=1 and cnt =8) then hsend = 0;st = 0; end if; end if;end process;process(rst,hrecv,clk) variable rcrcvar : std_logic_vector(5 downto 0);beginif rst =1 then rt =0; elsif(clkevent and clk =1)then if(rt = 0 and hrecv =1)then rdtemp =datacrci(16 downto 5); rdatacrc =datacrci;rcnt 0);error0= 0;rt=1; elsif(rt = 1 and rcnt7)then datafini=0;rcnt=rcnt+1; if(rdtemp(11) = 1)then rcrcvar := rdtemp(11 downto 6)xor multi_coef; rdtemp= rcrcvar(4 downto 0) & rdtemp(5 downto 0) & 0; els
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 知识产权保护措施具体实施计划方案
- 网络通信设备更新细则
- 电商平台内容编辑更新执行规范策略
- 电子书中AR和VR交互技术的用户体验研究-洞察及研究
- 气候模型的不确定性评估-洞察及研究
- 智能化服务创新-洞察及研究
- 病毒流感多重耐药性研究-洞察及研究
- 竞争者营销策略调整-洞察及研究
- 经济型酒店竞争力提升路径-洞察及研究
- 草制品抗菌功能的体外筛选与表征-洞察及研究
- 2025年全国共青团团员知识竞赛题库及答案(共150题)
- pbo纤维课件教学课件
- 人教版九年级数学上册全册单元检测卷及答案(包含:期中、期末试卷)
- 脑梗死临床路径表单
- 2020年全国II卷英语高考真题试题(答案+解析)
- 《林佳明经方实践录》记录
- 宅基地转让协议书
- 十年(2015-2024)高考真题数学分项汇编(全国)专题25 新定义综合(数列新定义、函数新定义、集合新定义及其他新定义)(教师卷)
- 日语N2必备单词
- 燃气行业数字化转型实施路径
- 抖音短视频运营直播带货KPI绩效考核指标(抖音直播运营规划方案 抖音直播部门组织架构及职责说明)
评论
0/150
提交评论