I'm looking after a reason or an answer for my problem which is : My VHDL code is working, i'm trying to create a frequency divider by 10. The problem is that the simulation report keep giving me an undefined output(no value).
This is my VHDL code, I'd be so grateful for any help! Thank You!
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;
