用VHDL语言设计555压控振荡器测频率.doc

用VHDL语言设计555压控振荡器测频率.doc

ID:49871368

大小:903.25 KB

页数:9页

时间:2020-03-05

用VHDL语言设计555压控振荡器测频率.doc_第1页
用VHDL语言设计555压控振荡器测频率.doc_第2页
用VHDL语言设计555压控振荡器测频率.doc_第3页
用VHDL语言设计555压控振荡器测频率.doc_第4页
用VHDL语言设计555压控振荡器测频率.doc_第5页
资源描述:

《用VHDL语言设计555压控振荡器测频率.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、实验五利用压控振荡器测量电压一、实验目的(1)以555定时器为基础设计压控振荡器(2)设计一个具有如下功能的简易频率计。1.可以测量压控振荡器产生的频率,用4位数码管显示2.测量结果直接用十进制数值显示3.被测信号是压控振荡器产生的方波脉冲信号,根据设计的压控振荡器确定电压值4.具有超量程警告(可以用LED灯显示)二、实验设备与器材(1)计算机:QuartusⅡ16.0软件;(2)硬件:CycloneDE0-CVFPGA开发平台、555定时器、电阻、电容、可变电阻三、利用Multisim搭建仿真电路四、实验程序libraryieee;useieee.std_logic_1164.all;us

2、eieee.std_logic_unsigned.all;--计数器entitycnt10isport(rst,fx,ena:instd_logic;cout:outstd_logic;outy:outstd_logic_vector(3downto0));endcnt10;architecturebehvofcnt10isbeginprocess(rst,ena,fx)--定义变量--<=是对信号赋值;而:=是对变量进行赋值variablecqi:std_logic_vector(3downto0);begin--others=>'0'是对数组cqi所有元素赋值0ifrst='1'then

3、cqi:=(others=>'0');elsiffx'eventandfx='1'thenifena='1'thenifcqi<9thencqi:=cqi+1;cout<='0';elsifcqi=9thencqi:=(others=>'0');cout<='1';endif;elsifena='0'thencqi:=(others=>'0');endif;endif;outy<=cqi;endprocess;endbehv;--4位10进计数器libraryieee;useieee.std_logic_1164.all;entitycnt10_4isport(fx,rst,ena,clk:

4、instd_logic;d:outstd_logic_vector(15downto0);led_a:outstd_logic);endentity;architectureoneofcnt10_4iscomponentcnt10port(rst,fx,ena:instd_logic;cout:outstd_logic;outy:outstd_logic_vector(3downto0));endcomponent;componentled_heheport(ena,clk:instd_logic;q:outstd_logic);endcomponent;signale:std_logic_

5、vector(3downto0);begin--整体使用相同的rst和ena,fx作为进位使用。u1:cnt10portmap(fx=>fx,rst=>rst,ena=>ena,cout=>e(0),outy=>d(3downto0));u2:cnt10portmap(fx=>e(0),rst=>rst,ena=>ena,cout=>e(1),outy=>d(7downto4));u3:cnt10portmap(fx=>e(1),rst=>rst,ena=>ena,cout=>e(2),outy=>d(11downto8));u4:cnt10portmap(fx=>e(2),rst=>rst

6、,ena=>ena,cout=>e(3),outy=>d(15downto12));u5:led_heheportmap(ena=>e(3),clk=>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));

7、endlatch4;architectureoneoflatch4isbeginprocess(clk,ena,d)variablecqi:std_logic_vector(15downto0);beginifena='0'thencqi:=cqi;---ena=0锁存上次的数据elsifclk'eventandclk='1'thencqi:=d;---clk=1&&ena=1计入新数据endif;q<=cq

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。