中国硬件创新大赛
直播中

阿依诺

8年用户 29经验值
擅长:可编程逻辑 嵌入式技术 EDA/IC设计 可编程逻辑 嵌入式技术 EDA/IC设计
私信 关注
[问答]

quartusII 做频率计输出有误差 怎么调小 用下面的程序现在输出是1分频 错的离谱

0_5hz
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity fenpin is
port(clk: in std_logic;clk0_5Hz:out std_logic);
end fenpin;

architecture segled of fenpin is
begin
p1:process(clk)
variable count:integer range 0 to 6249999;
begin
    if clk'event and clk='1' then
    if count<=3124999 then
      clk0_5Hz<='0';
      count:=count+1;
      elsif count>3124999 and count<=6249999 then
              clk0_5Hz<='1';
              count:=count+1;
          else count:=0;
        end if;
        end if;
end process p1;
END ARCHITECTURE SEGLED;

1hz分频计程序
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity fenpin1 is
port(clk: in std_logic;clk1Hz:out std_logic);
end fenpin1;

architecture segled of fenpin1 is
begin
p1:process(clk)
variable count:integer range 0 to 49999999;
begin
    if clk'event and clk='1' then
    if count<=24999999 then
      clk1Hz<='0';
      count:=count+1;
      elsif count>24999999 and count<=49999999 then
              clk1Hz<='1';
              count:=count+1;
          else count:=0;
        end if;
        end if;
end process p1;
END ARCHITECTURE SEGLED; 频率计原理图.png

频率计工作时序电路.png

频率计工作时序波形.png

频率计顶层电路原理图.png

两位十进制频率计测频率计测频仿真波形.png

两位十进制计数器工作波形.png

含有时钟使能的两位十进制计数器.png

测频时序控制电路工作波形.png

测频时序控制电路.png

xs2.png

2位十进制频率计顶层设计原理图文件.png


已退回1积分

更多回帖

发帖
×
20
完善资料,
赚取积分