ImageVerifierCode 换一换
格式:DOCX , 页数:10 ,大小:16.72KB ,
资源ID:10459461      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/10459461.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(用VHDL语言设计555压控振荡器测频率之欧阳体创编.docx)为本站会员(b****7)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

用VHDL语言设计555压控振荡器测频率之欧阳体创编.docx

1、用VHDL语言设计555压控振荡器测频率之欧阳体创编实验五利用压控振荡器测量电压时间:2021.02.03创作:欧阳体一、实验目的(1)以555定时器为基础设计压控振荡器(2)设计一个具有如下功能的简易频率计。 1. 可以测量压控振荡器产生的频率,用4位数码管显示 2.测量结果直接用十进制数值显示 3. 被测信号是压控振荡器产生的方波脉冲信号,根据设计的压控振荡器确定电压值 4. 具有超量程警告(可以用 LED 灯显示)二、实验设备与器材(1)计算机:Quartus 16.0软件;(2)硬件:Cyclone DE0-CV FPGA开发平台、555定时器、电阻、电容、可变电阻三、利用Multis

2、im搭建仿真电路四、实验程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;- 计数器entity cnt10 is port (rst,fx,ena:in std_logic; cout: out std_logic; outy :out std_logic_vector(3 downto 0);end cnt10;architecture behv of cnt10 isbegin process (rst,ena,fx) - 定义变量 - 0是对数组cqi所有元素赋值0 if rst=1 t

3、hen cqi :=(others =0); elsif fxevent and fx=1 then if ena =1 then if cqi 9 then cqi:=cqi+1;cout0); cout0); end if; end if; outy fx,rst=rst,ena=ena,cout=e(0),outy=d(3 downto 0);u2:cnt10 port map(fx=e(0),rst=rst,ena=ena,cout=e(1),outy=d(7 downto 4);u3:cnt10 port map(fx=e(1),rst=rst,ena=ena,cout=e(2),o

4、uty=d(11 downto 8);u4:cnt10 port map(fx=e(2),rst=rst,ena=ena,cout=e(3),outy=d(15 downto 12);u5:led_hehe port map(ena=e(3),clk=clk,q=led_a);end architecture one;- 16位锁存器 latch=闩library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity latch4 isport(d:in std_logic_vector(15 downt

5、o 0);ena,clk:in std_logic;q:out std_logic_vector(15 downto 0);end latch4;architecture one of latch4 isbegin process(clk,ena,d) variable cqi:std_logic_vector(15 downto 0); begin if ena=0 then cqi:=cqi;- ena=0 锁存上次的数据 elsif clkevent and clk=1 then cqi:=d;-clk=1&ena=1 计入新数据 end if; q=cqi; end process;e

6、nd one;- 报警led hehelibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity led_hehe isport(ena,clk:in std_logic;q:out std_logic);end led_hehe;architecture one of led_hehe isbegin process(clk,ena) variable cqi:std_logic; begin if ena=0 then cqi:=cqi;- ena=0 锁存上次的数据 elsif clkev

7、ent and clk=1 then cqi:= not cqi;-clk=1&ena=1 计入新数据 end if; q a a a a a a a a a a a a a a a a null; end case; end process;end;- 控制模块(每隔一次clk,就翻转ena和rst)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity control is port (clk:in std_logic; rst,ena: out std_logic);end contr

8、ol;architecture behv of control isbegin process (clk) variable cqi :std_logic_vector(2 downto 0); begin if clkevent and clk=1 then if cqi 1 then cqi:=cqi+1;ena=1;rst0); ena=0;rst=1; end if; end if; end process;end behv;- 时钟(1hz)发生器library ieee;use ieee.std_logic_1164.all;entity freq_div is port (clk

9、:in std_logic; clk_out:out std_logic); end freq_div;architecture fwm of freq_div isconstant m: integer:= 25000;signal tmp:std_logic;begin process(clk,tmp) variable cout:integer:=0; begin if clkevent and clk=1 then cout:=cout+1; if cout=m then tmp=0; elsif coutm*2 then tmp=1; else cout:=0; end if; en

10、d if; end process;clk_outclk,clk_out=clk_base);u2: control port map(clk=clk_base,ena=x,rst=z);u3: cnt10_4 port map(fx=fx,rst=z,ena=x,d=g,led_a=leds(28),clk=clk_base);u4: latch4 port map(clk=clk_base,ena=x,d=g,q=h);u5: led_controller port map(d(3 downto 0)=h(3 downto 0),a(6 downto 0)=leds(6 downto 0)

11、;u6: led_controller port map(d(3 downto 0)=h(7 downto 4),a(6 downto 0)=leds(13 downto 7);u7: led_controller port map(d(3 downto 0)=h(11 downto 8),a(6 downto 0)=leds(20 downto 14);u8: led_controller port map(d(3 downto 0)=h(15 downto 12),a(6 downto 0)=leds(27 downto 21);ledout=leds;end;-引脚配置说明:- port(clk:in std_logic;- fx:in std_logic;- ledout:out std_logic_vector(27 downto 0);- 数码管7*4clk五、实验结果1、搭建555实际电路2、用示波器测量实际电路的频率和电压:3、用已经下载了程序的开发板来测量实际电路的频率(由于开发板的数码管最后一个一直不稳定,所以把原本应该是最后一个的管脚绑到了第一个管脚,读频率的时候第一个数是个位,第二个数是千位,第三个数是百位,第四个数是十位;读出来的频率数乘以十就是单位为Hz的频率数)时间:2021.02.03创作:欧阳体

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1