作业帮 > 综合 > 作业

用vhdl语言编写一个程序,要求测量方波频率,显示在4个数码管上.只要求写出测量方波频率的那一个模块的程

来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/10/02 08:26:44
用vhdl语言编写一个程序,要求测量方波频率,显示在4个数码管上.只要求写出测量方波频率的那一个模块的程
用vhdl语言编写一个程序,要求测量方波频率,显示在4个数码管上.只要求写出测量方波频率的那一个模块的程
说直接点这就是频率计的问题
一般有两种测量模式
1:计数测频
例如:在T=1s的时间内,计数待测方波的上升沿次数既是方波频率(但是很明显有误差,但是待测频率越高 误差越小)
这个代码很简单,
2:等精度测频
测频精度高,但是应用范围不如计数测频广
主程序
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
library std;
use std.standard.all;
library work;
use work.all;
entity counter is
port(
clk,rest,en:in std_logic;
overflow,cnt:out std_logic);
end;
architecture art of counter is
constant reset_active :std_logic:='0';
signal c:std_logic_vector(19 downto 0);
begin
process(rest,en,clk)
begin
if rest=rest_active then
overflow