版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026湖南怀化市靖州苗族侗族自治县事业单位引进高层次及急需紧缺人才26人备考题库附答案详解ab卷
- 2025年学历类成考专升本教育理论民法参考题库含答案解析
- 2025年事业单位工勤技能安徽安徽计算机信息处理员五级(初级)题库典型考点含答案解析
- 2026江苏建筑职业技术大学招聘专职辅导员备考题库含答案详解(综合题)
- 2026河北承德市双桥区选聘急需紧缺学科教师10人备考题库含答案详解(培优b卷)
- 2025年全国安全生产月知识培训考试试题含参考答案
- 潍坊市公开招聘2026届山东省公费师范毕业生备考题库(82人)含答案详解(夺分金卷)
- 西部超导材料科技股份有限公司2026届硕博春季招聘备考题库含答案详解(b卷)
- 豫信电子科技集团有限公司2026届校园招聘备考题库附答案详解(培优a卷)
- 2025年《护理值班与交接班制度》考试试题(含答案)
- 酒店防偷拍管理制度
- 肿瘤患者的心理护理和人文关怀
- 《企业用电安全培训课件 - 工业电路与电器设备安全管理》
- 《高效流程审核技巧》课件
- 2025年巨量创意营销初级1.0考试题库
- 雾化吸入疗法合理用药专家共识(2024版)解读
- 国家职业技能培训政策讲解
- 运营管理策划方案(5篇)
- 辽宁省盘锦市兴隆台区盘锦市第一完全中学2024-2025学年八年级上学期11月期中数学试题
- 临床试验总结报告样本
- 食品安全管理台账制度
评论
0/150
提交评论