已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
基于FPGA的数字跑表设计报告姓 名:学 号:指导老师:李颖摘要:本文详细介绍了数字秒表的设计指标,设计思路,设计方案,系统电路设计,系统单元模块设计,系统硬件实现与测试的结果。一 引言科技高度发展的今天,集成电路和计算机应用得到了高速发展。尤其是计算机应用的发展。它在人们日常生活已逐渐崭露头角。大多数电子产品多是由计算机电路组成,如:手机、mp3等。而且将来的不久他们的身影将会更频繁的出现在我们身边。各种家用电器多会实现微电脑技术。电脑各部分在工作时多是一时间为基准的。本文就是基于计算机电路的时钟脉冲信号、状态控制等原理设计出的数字秒表。秒表在很多领域充当一个重要的角色。在各种比赛中对秒表的精确度要求很高,尤其是一些科学实验。他们对时间精确度达到了几纳秒级别。二 项目任务与设计思路 本项目的任务是掌握使用VHDL语言的设计思想;熟悉ise软件的使用;了解XILINX学生EDA实验板。了解 EDA 技术,对计算机系统中时钟控制系统进一步了解,掌握状态机工作原理,同时了解计算机时钟脉冲是怎么产生和工作的。在掌握所学的计算机组成与结构课程理论知识时。通过对数字秒表的设计,进行理论与实际的结合,提高与计算机有关设计能力,提高分析、解决 计算机技术实际问题的能力。通过课程设计深入理解计算机结构与控制实现的技术,达到课程设计的目标。 项目任务与设计思路 本项目的指标:1、跑表精度为0.01秒2、跑表计时范围为:1小时3、设置开始计时/停止计时、复位两个按钮4、显示工作方式:用六位BCD七段数码管显示读数。显示格式: 分 秒 0.01秒三 基于VHDL方法设计方案VHDL 的设计流程主要包括以下几个步骤:1.文本编辑:用任何文本编辑器都可以进行,也可以用专用的HDL编辑环境。通常VHDL文件保存为.vhd文件2.功能仿真:将文件调入 HDL仿真软件进行功能仿真,检查逻辑功能是否正确。3.逻辑综合:将源文件调入逻辑综合软件进行综合,即把语言综合成最简的布尔表达式。逻辑综合软件会生成.edf 或.edif 的 EDA 工业标准文件。 4.布局布线:将.edf 文件调入PLD 厂家提供的软件中进行布线,即把设计好的逻辑安放PLD/FPGA 内。5.时序仿真: 需要利用在布局布线中获得的精确参数,用仿真软件验证电路的时序。(也叫后仿 真) 通常以上过程可以都在 PLD/FPGA 厂家提供的开发工具。 6.器件编程。四 系统电路设计五 系统单元模块设计一 分频器代码实现:Freq:process(clk) variable fcount1,fcount2:integer; begin if clkevent and clk=1 then if fcount1=24000 then fcount1=1; clk_1k= not clk_1k;else fcount1=fcount1+1; end if; if fcount2= then fcount2=1;clk_100=not clk_100; else fcount2=fcount2+1; end if; end if; end process;二 计数器代码实现: Count:process(rst,clk_100,pause) begin if rst=1 then count_1=0000; count_2=0000; count_3=0000; count_4=0000; count_5=0000; count_6=0000; elsif pause=1 then NULL; else if clk_100event and clk_100=1 then if count_1=1001 then count_1=0000;if count_2=1001 then count_2=0000; if count_3=0101 then count_3=0000; if count_4=1001 then count_4=0000; if count_5=1001 then count_5=0000; if count_6=0101 then count_6=0000; else count_6=count_6+1; end if; else count_5=count_5+1; end if; else count_4=count_4+1; end if; else count_3=count_3+1; end if; else count_2=count_2+1; end if; else count_1=count_1+1; end if; end if; end if; end process;三 译码显示控制代码实现:Countscan:process(clk1) begin if clk_1kevent and clk_1k=1 then if count_s=101 then count_s=000; else count_s=count_s+1; end if; end if; end process;choose data data data data data dataNULL; end case; end process;shuma:process(data)begincase data iswhen 0000= light light light light light light light light light light NULL;end case;end process;六 系统硬件实现与测试一 程序代码:entity szpb isport(clk:in std_logic; allout:out std_logic_vector(6 downto 0); rst:in std_logic; choose:out std_logic_vector(2 downto 0); inen:in std_logic; outen:out std_logic; pause:in std_logic );end szpb;architecture of szpb issignal clk1,clk2:std_logic:=0;signal count_1,count_2,count_3,count_4,count_5,count_6:std_logic_vector(3 downto 0):=”0000”;signal count_s:std_logic_vector(2 downto 0):=”000”;signal data:std_logic_vector(3 downto 0):=”0000”;begin Freq:process(clk) variable con1,con2:integer; begin if clkevent and clk=1 then if con1=23999 then con1:=0;clk1= not clk1;else con1:=con1+1; end if; if con2= then con2:=0;clk2=not clk2; else con2:=con2+1; end if; end if; end process; Count:process(rst,clk2,pause) begin if rst=1 then count_1=0000; count_2=0000; count_3=0000; count_4=0000; count_5=0000; count_6=0000; elsif pause=1 then NULL; else if clk2event and clk2=1 then if count_1=1001 then count_1=0000;if count_2=1001 then count_2=0000; if count_3=0101 then count_3=0000; if count_4=1001 then count_4=0000; if count_5=1001 then count_5=0000; if count_6=0101 then count_6=0000; else count_6=count_6+1; end if; else count_5=count_5+1; end if; else count_4=count_4+1; end if; else count_3=count_3+1; end if; else count_2=count_2+1; end if; else count_1=count_1+1; end if; end if; end if; end process; Countscan:process(clk1) begin if clk1event and clk1=1 then if count_s=101 then count_s=000; else count_s=count_s+1; end if; end if; end process;choose data data data data data dataNULL; end case; end process;shuma:process(data)begincase data iswhen 0000= light light allout allout allout allout allout allout allout allout NULL;end case;end process; outen=inen;end szpb;二 仿真实现三 下载过程:光标移至【Generate Programing File】后单击鼠标右键,然后单击【Properties】在打开的对话框的左侧栏选中【Configuration Options】将右侧的Unused IOB Pins这一项改为Pull Up,单击OK。在界面的左下角双击【 Generate Programing File】,软件将自动对整个系统进行编译并生成可执行文件FRYALL.bit。将弹出的对话框关掉,双击【 Generate Prom, ACE,or JTAG File】在弹出的对话框中点击Finish,在随后出现的对话框中选择FRYALL.bit,然后点击打开,在随后的对话框中点击Bypass。右键单击左边图标选择Program,在随后的对话框中单击OK,文件将自动下载到开发板上,成功后,接入函数发生器进行测试。七 过程故障分析与处理 收获及改进意见在程序设计的起步阶段,由于对VHDL语言掌握不够,以及ISE软计使用不熟练,会出现各种小的语法错误和操作失误,通过一段时间的锻炼,程序设计的问题已经得到解
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 主要诊断填写的试题及对应答案
- 粤点制作基础水平测试题目与答案
- 2026年高处安装维护拆除作业考试试卷试题及答案
- 2026年登革热媒介伊蚊监测防控指南培训考试试卷试题及答案
- 二建工程造价相关试题及答案解析
- 2026年病历复印借阅管理实务考试试卷试题及答案
- 2026年危化品生产岗位完整试题及答案
- 2026年特种设备安全管理人员考试题库(含答案)
- 2026年术后镇痛方案选择题库(含答案)
- 2026年重庆市北师大版高中语文必修4第5单元诗歌鉴赏综合测试
- GB/T 48023-2026数据中心冷板式液冷系统技术规范
- 妇产科医疗质量管理制度
- 《管理心理学》题库及答案
- 基层防汛工作知识培训
- 2026年浙江杭州市中考英语试题(附答案)
- 2025-2026学年第二学期期末考试高一语文试卷及答案
- 2026年浙江省安全员《B证》考试题库及答案
- 2026年高考语文全国卷二真题解读课件
- 2026美容仪器市场消费需求分析与竞争格局评估报告
- 精神科护理中的人文关怀与护理管理
- 护理在全球健康中的地位
评论
0/150
提交评论