【发布时间】:2014-02-14 19:36:53
【问题描述】:
我正在寻找我的问题的原因或答案: 我的 VHDL 代码正在运行,我正在尝试创建一个 10 分频器。 问题是模拟报告一直给我一个未定义的输出(没有值)。
这是我的 VHDL 代码,如果有任何帮助,我将不胜感激!谢谢你!
Library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity Frequency_divider is
port(clk: in std_logic;
Q:out std_logic);
end Frequency_divider;
architecture desc_freq_divider_10 of Frequency_divider is
signal S: std_logic:='0';
begin
process(clk,S)
variable cpt: integer:=0;
begin
if (rising_edge(clk)) then
cpt:=cpt+1;
end if;
if (cpt=5) then
S<=not(S);
cpt:=0;
end if;
end process;
Q<=S;
end desc_freq_divider_10;
【问题讨论】:
标签: vhdl simulation