【发布时间】:2021-11-15 12:00:03
【问题描述】:
我需要在 vhdl 中除频,因此得到的频率将为 0.01 Hz,但我不知道该怎么做。我尝试使用通用地图,但后来出现错误。我正在使用 Nexys3。我知道 Nexys3 的频率是 100 MHz,所以我试着把它分成 0.01。
entity stotinkasekunde is
port (
izlaz: out std_logic_vector(3 downto 0);
led: out std_logic_vector(6 downto 0);
clk, ss: in std_logic
);
end stotinkasekunde;
architecture Behavioral of stotinkasekunde is
signal clk_o: std_logic;
signal temp: std_logic_vector(3 downto 0);
begin
s1: entity work.frekdiv generic map(10000000000) port map(clk, clk_o);
process (clk_o)
begin
if (clk_o'event and clk_o='1') then
if (ss='1') then
temp <= temp+1;
if (temp >= 1010) then
temp <= "0000";
end if;
end if;
end if;
end process;
错误:第 18 行:文字 10000000000 超出最大整数值。
【问题讨论】:
-
你知道输入频率吗?因为这看起来像是来自 Nexys3 上的时钟源?
-
我希望现在好多了。
-
您可以检查它是否与
1000的分隔器一起使用,如果可以,则您知道您对frekdiv组件的使用是正确的,然后您可以简单地级联多个分隔器。跨度> -
@user16145658 我想你算错了零。泛型中的值是 10,000,000,000 ,在大多数(如果不是全部?)实现也限制整数的 32 位之外。
-
您没有向我们展示相关实体
frekdiv。如果这是您自己的,请考虑重新设计它以启用更大的除数。如果无法更改,请考虑使用两个级联实例。