版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、 eda课程设计报告书题 目:8位十进制数字频率计的设计姓 名:学 号:所属学院:专业年级:指导教师:完成时间:8位十进制数字频率计的设计一、 设计介绍数字频率计是采用数字电路制做成的能实现对周期性变化信号频率测量的仪器。频率计主要用于测量正弦波、矩形波、三角波和尖脉冲等周期信号的频率值。其扩展功能可以测量信号的周期和脉冲宽度。通常说的,数字频率计是指电子计数式频率计。频率计主要由四个部分构成:输入电路、时基(t)电路、计数显示电路以及控制电路。在电子技术领域,频率是一个最基本的参数。数字频率计作为一种最基本的测量仪器以其测量精度高、速度快、操作简便、数字显示等特点被广泛应用。许多物理量,例如
2、温度、压力、流量、液位、ph值、振动、位移、速度等通过传感器转换成信号频率,可用数字频率计来测量。尤其是将数字频率计与微处理器相结合,可实现测量仪器的多功能化、程控化和智能化.随着现代科技的发展,基于数字式频率计组成的各种测量仪器、控制设备、实时监测系统已应用到国际民生的各个方面。2、 设计目的(1) 熟悉quatus 11软件的基本使用方法。(2) 熟悉eda实验开发系统的使用方法。(3) 学习时序电路的设计、仿真和硬件设计,进一步熟悉vhdl设计技术。 三、数字频率计的基本原理数字频率计的基本原理是用一个频率稳定度高的频率源作为基准时钟,通常情况下计算每秒内待测信号的脉冲个数,此时我们称闸
3、门时间为1秒。闸门时间也可以大于或小于一秒。闸门时间越长,得到的频率值就越准确,但闸门时间越长则每测一次频率的间隔就越长。闸门时间越短,测的频率值刷新就越快,但测得的频率精度就受影响。数字频率计的主要功能是测量周期信号的频率。频率是单位时间(1s)内信号发生周期变化的次数。如果我们能在给定的1s时间内对信号波形计数,并将计数结果显示出来,就能读取被测信号的频率。数字频率计首先必须获得相对稳定与准确的时间,同时将被测信号转换成幅度与波形均能被数字电路识别的脉冲信号,然后通过计数器计算这一段时间间隔内的脉冲个数,将其换算后显示出来。这就是数字频率计的基本原理。频率计测量频率需要设计整形电路使被测周
4、期性信号整形成脉冲,然后设计计数器对整形后的脉冲在单位时间内重复变化的次数进行计数,计数器计出的数字经锁存器锁存后送往译码驱动显示电路用数码管将数字显示出来,需要设计控制电路产生允许产生的门匣信号,计数器的清零信号和锁存器的锁存信号使电路正常工作,再设计一个量程自动转换使测量范围更广。四 系统总体框架 图 3.1 系统总体框架图总体框图设计思路:由50mhz系统时钟分频得到0.5hz的基准时钟。在基准时钟的1s 高电平期间计被测频率的脉冲个数,1s高电平结束时计数结束,所记录的脉冲个数是被测信号的频率,为了在数码管上显示计数结果需要锁存器将所计的数锁存,因此,在基准时钟下降沿来的时候锁存器实现
5、锁存功能。为了下次计数必须将本次计数的结果清零,所以在基准时钟低电平期间对计数器清零。被测频率从计数器的是中端输入实现频率的测试。将锁存器锁存的数据输入扫描器,通过译码器将锁存的二进制数译成十进制然后显示到数码管上,最终被读出来。5、 设计内容实验条件: (1)开发条件:quatus 11软件。 (2)实验设备:gw48-es eda实验开发系统,电脑。 (3)拟用芯片: epf10k20tc144-4芯片。源程序:-test controler(测频控制器)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned
6、.all;entity testctl isport (clkk : in std_logic ;-test 1hz control clkcnt_en,rst_cnt,load : out std_logic); -clear the enable , count,end testctl;architecture behav of testctl issignal div2clk : std_logic ;beginprocess (clkk)beginif clkk'event and clkk = '1' thendiv2clk <= not div2clk
7、;end if;end process;process(clkk,div2clk)beginif clkk = '0' and div2clk = '0' then rst_cnt <= '1'else rst_cnt <= '0'end if;end process;load <= not div2clk;cnt_en <= div2clk;end behav;- count10 (cnt10.vhd)(十进制计数器)library ieee;use ieee.std_logic_1164.all;use
8、 ieee.std_logic_unsigned.all;entity cnt10 isport(clk : in std_logic; clr : in std_logic; enb : in std_logic; outy: out std_logic_vector(3 downto 0); cout: out std_logic);end cnt10;architecture behav of cnt10 isbeginprocess(clk,clr,enb)variable cqi : std_logic_vector (3 downto 0);begin if clr = '
9、1' then cqi :="0000"elsif clk'event and clk = '1' thenif enb = '1' thenif cqi < "1001" then cqi := cqi+1;else cqi :="0000"end if;end if;end if;outy <= cqi;cout <= cqi(0) and (not cqi(1) and (not cqi(2) and cqi(3);end process;end behav;-r
10、egister (reg4b.vhd)(4位锁存器)library ieee;use ieee.std_logic_1164.all;entity reg4b isport (load : in std_logic; din : in std_logic_vector(3 downto 0); dout : out std_logic_vector (3 downto 0);end reg4b;architecture behav of reg4b isbegin process (load ,din)beginif load'event and load = '1'
11、then dout <= din ; -suo cunend if;end process;end behav;8位十进制频率计library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity choose isport( clk:in std_logic; a,b,c,d,e,f,g,h:in std_logic_vector(3 downto 0); x,y:out std_logic_vector(7 downto 0);end;architecture one of choose is
12、signal ain:std_logic_vector(2 downto 0);signal bin:std_logic_vector(3 downto 0);beginprocess(clk) begin if(clk'event and clk='1') then if(ain="111") then ain<="000" else ain<=ain+'1' end if; end if; end process;process(ain)begincase ain iswhen"000&q
13、uot;=>bin<=a;y<="11111110"when"001"=>bin<=b;y<="11111101"when"010"=>bin<=c;y<="11111011"when"011"=>bin<=d;y<="11110111"when"100"=>bin<=e;y<="11101111"when"101&q
14、uot;=>bin<=f;y<="11011111"when"110"=>bin<=g;y<="10111111"when"111"=>bin<=h;y<="01111111"when others=>null;end case;end process;process(bin)begincase bin iswhen"0000"=>x<="11111100"when"0001
15、"=>x<="01100000"when"0010"=>x<="11011010"when"0011"=>x<="11110010"when"0100"=>x<="01100110"when"0101"=>x<="10110110"when"0110"=>x<="10111110"when&quo
16、t;0111"=>x<="11100000"when"1000"=>x<="11111110"when"1001"=>x<="11110110"when others=>null;end case;end process;end;-quent1library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity quent1 isport(clkin :
17、in std_logic; fin : in std_logic; scan : out std_logic_vector(7 downto 0); seg : out std_logic_vector(7 downto 0); coutt: out std_logic );end entity quent1;architecture one of quent1 iscomponent chooseport( clk:in std_logic; a,b,c,d,e,f,g,h:in std_logic_vector(3 downto 0); x,y:out std_logic_vector(7
18、 downto 0);end component; component testctlport (clkk : in std_logic;cnt_en , rst_cnt,load : out std_logic);end component;component cnt10port (clk : in std_logic; clr : in std_logic; enb : in std_logic; outy: out std_logic_vector(3 downto 0); cout: out std_logic);end component;component reg4bport (l
19、oad : in std_logic; din : in std_logic_vector(3 downto 0); dout : out std_logic_vector(3 downto 0);end component;signal a_ena,b_rst,c_load,cout1,cout2,cout3,cout4,cout5,cout6,cout7 : std_logic;signal outy1,outy2,outy3,outy4,outy5,outy6,outy7,outy8,out1,out2,out3,out4,out5,out6,out7,out8 : std_logic_
20、vector(3 downto 0);beginu1 : testctl port map (clkk=> clkin,cnt_en=>a_ena,rst_cnt=>b_rst,load=>c_load);u2 : cnt10 port map(clk=> fin,clr=>b_rst,enb=>a_ena,outy=>outy1,cout=>cout1);u3 : cnt10 port map(clk=> cout1,clr=>b_rst,enb=>a_ena,outy=>outy2,cout=>cout2)
21、;u4 : cnt10 port map(clk=> cout2,clr=>b_rst,enb=>a_ena,outy=>outy3,cout=>cout3);u5 : cnt10 port map(clk=> cout3,clr=>b_rst,enb=>a_ena,outy=>outy4,cout=>cout4);u6 : cnt10 port map(clk=> cout4,clr=>b_rst,enb=>a_ena,outy=>outy5,cout=>cout5);u7 : cnt10 port m
22、ap(clk=> cout5,clr=>b_rst,enb=>a_ena,outy=>outy6,cout=>cout6);u8 : cnt10 port map(clk=> cout6,clr=>b_rst,enb=>a_ena,outy=>outy7,cout=>cout7);u9 : cnt10 port map(clk=> cout7,clr=>b_rst,enb=>a_ena,outy=>outy8,cout=>coutt);u10 : reg4b port map(load=> c_lo
23、ad,din=> outy1,dout=>out1);u11 : reg4b port map(load=> c_load,din=> outy2,dout=>out2);u12 : reg4b port map(load=> c_load,din=> outy3,dout=>out3);u13 : reg4b port map(load=> c_load,din=> outy4,dout=>out4);u14 : reg4b port map(load=> c_load,din=> outy5,dout=>o
24、ut5);u15 : reg4b port map(load=> c_load,din=> outy6,dout=>out6);u16 : reg4b port map(load=> c_load,din=> outy7,dout=>out7);u17 : reg4b port map(load=> c_load,din=> outy8,dout=>out8);u18 : choose port map(clk=>fin,a=>out1,b=>out2,c=>out3,d=>out4,e=>out5,f=>out6,g=>out7,h=>out8,x=>
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 聊城市一级建造师考试(通信与广电工程管理与实务)真题及答案
- 2026年上半年教师资格证考试《教育教学知识与能力》(小学)真题附答案
- 靶向药物临床应用中国指南(2026 版)
- 居家拔罐保健适用人群与禁忌指南 (2026 版)
- 环保工程工作报告
- Flupenthixol-decanoate-生命科学试剂-MCE
- 护理查房中的患者满意度
- 2026net的面试题及答案
- 2026linux c 面试题及答案
- 恶性肿瘤患者的健康教育
- 银行保安服务投标方案(完整技术标)
- 拒绝文身主题班会课件
- 项目部人员绩效考核表实用文档
- 汽车行走的艺术学习通课后章节答案期末考试题库2023年
- 食品检验工(高级)5
- JJF 1941-2021 光学仪器检具校准规范 高清晰版
- 张爱玲《金锁记》教学课件
- GA/T 1028.2-2022机动车驾驶人考试系统通用技术条件第2部分:驾驶理论考试系统
- GB/Z 26209-2010光辐射探测器光谱响应的确定方法
- 室分交维评估报告-tjd
- 中考语文非连续性文本阅读10篇专项练习及答案
评论
0/150
提交评论