




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、实验五利用压控振荡器测量电压-、实验目的(1)以555定时器为基础设计压控振荡器(2)设计一个具有如下功能的简易频率计。1 .可以测量压控振荡器产生的频率,用4位数码管显示2 .测量结果直接用十进制数值显示3 .被测信号是压控振荡器产生的方波脉冲信号,根据设计的压控振荡器确定电压值4 .具有超量程警告(可以用LED灯显示)二、实验设备与器材(1)计算机:Quartusn16.嗽件;(2)硬件:CycloneDE0-CVFPGA开发平台、555定时器、电阻、电容、可变电阻三、利用Multisim搭建仿真电路四、实验程序libraryieee;useieee.std_logic_1164.all;
2、useieee.std_logic_unsigned.all;-计数器entitycnt10isport(rst,fx,ena:instd_logic;cout:outstd_logic;outy:outstd_logic_vector(3downto0);endcnt10;architecturebehvofcnt10isbeginprocess(rst,ena,fx)- -定义变量- -0是对数组cqi所有元素赋值0ifrst=1thencqi:=(others=0);elsiffxeventandfx=1thenifena=1thenifcqi9thencqi:=cqi+1;cout0)
3、;cout0);endif;endif;outyfx,rst=rst,ena=ena,cout=e(0),outy=d(3downto0);u2:cnt10portmap(fx=e(0),rst=rst,ena=ena,cout=e,outy=d(7downto4);u3:cnt10portmap(fx=e,rst=rst,ena=ena,cout=e(2),outy=d(11downto8);u4:cnt10portmap(fx=e(2),rst=rst,ena=ena,cout=e(3),outy=d(15downto12);u5:led_heheportmap(ena=e(3),clk=
4、clk,q=led_a);endarchitectureone;- -16位锁存器latch=闩libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entitylatch4isport(d:instd_logic_vector(15downto0);ena,clk:instd_logic;q:outstd_logic_vector(15downto0);endlatch4;architectureoneoflatch4isbeginprocess(clk,ena,d)variablecqi:std_logi
5、c_vector(15downto0);beginifena=0thencqi:=cqi;-ena=0锁存上次的数据elsifclkeventandclk=1thencqi:=d;-clk=1&ena=1计入新数据endif;q=cqi;endprocess;endone;- -报警ledhehelibraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityled_heheisport(ena,clk:instd_logic;q:outstd_logic);endled_hehe;architecture
6、oneofled_heheisbeginprocess(clk,ena)variablecqi:std_logic;beginifena=0thencqi:=cqi;-ena=0锁存上次的数据elsifclkeventandclk=1thencqi:=notcqi;-clk=1&ena=1计入新数据endif;qaaaaaaaaaaaaaaaanull;endcase;endprocess;end;- -控制模块(每隔一次clk,就翻转ena和rst)libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;en
7、titycontrolisport(clk:instd_logic;rst,ena:outstd_logic);endcontrol;architecturebehvofcontrolisbeginprocess(clk)variablecqi:std_logic_vector(2downto0);beginifclkeventandclk=1thenifcqi1thencqi:=cqi+1;ena=1;rst0);ena=0;rst=1;endif;endif;endprocess;endbehv;- -时钟(1hz)发生器libraryieee;useieee.std_logic_1164
8、.all;entityfreq_divisport(clk:instd_logic;clk_out:outstd_logic);endfreq_div;architecturefwmoffreq_divisconstantm:integer:=25000;signaltmp:std_logic;beginprocess(clk,tmp)variablecout:integer:=0;beginifclkeventandclk=1thencout:=cout+1;ifcout=mthentmp=0;elsifcoutm*2thentmp=1;elsecout:=0;endif;endif;end
9、process;clk_outclk,clk_out=clk_base);u2:controlportmap(clk=clk_base,ena=x,rst=z);u3:cnt10_4portmap(fx=fx,rst=z,ena=x,d=g,led_a=leds(28),clk=clk_base);u4:latch4portmap(clk=clk_base,ena=x,d=g,q=h);u5:led_controllerportmap(d(3downto0)=h(3downto0),a(6downto0)=leds(6downto0);u6:led_controllerportmap(d(3d
10、ownto0)=h(7downto4),a(6downto0)=leds(13downto7);u7:led_controllerportmap(d(3downto0)=h(11downto8),a(6downto0)=leds(20downto14);u8:led_controllerportmap(d(3downto0)=h(15downto12),a(6downto0)=leds(27downto21);ledout=leds;end;- 引脚配置说明:- -port(clk:instd_logic;- -fx:instd_logic;- -ledout:outstd_logic_vector(27downto0);-数码管7*4clk五、实验结
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 文职考试题型及答案
- 电商和农业产业深度融合试题及答案
- 概率自考试题及答案
- 小学教师跨学科反思与改进策略试题及答案
- 建筑农民工权益保障与用工模式变革下的劳动力市场供需平衡策略研究报告
- 连锁药店行业扩张路径与药店员工激励机制研究报告
- 数学知识小试题及答案
- 消费与零售行业环保产品市场增长动力研究
- 小学艺术教育中的反思与改进试题及答案
- 施工安全与资源管理的协同方式及试题与答案
- 医学教材 《疟疾》课件
- 比较思想政治教育智慧树知到期末考试答案章节答案2024年西南大学
- JG-T+100-1999塔式起重机操作使用规程
- 山东省济南市高新区2023-2024学年八年级下学期期末物理试题
- DLT 5285-2018 输变电工程架空导线(800mm以下)及地线液压压接工艺规程
- 中国兔子行业上下游产业链全景、发展历程回顾及市场前景预测
- 10以上20以内加减法
- 急产分娩应急演练方案
- JBT 11699-2013 高处作业吊篮安装、拆卸、使用技术规程
- 24春国家开放大学《离散数学》大作业参考答案
- 2024年1月普通高等学校招生全国统一考试适应性测试(九省联考)化学试题(适用地区安徽)(试卷)
评论
0/150
提交评论