Hi there,
I just need to divide a 50mhz clock, into a 1hz one.
being new to vhdl, im not sure about the size of the logic_vector?
Im also unsure about the two comparing statements CT1<50.etc
and how to create an accurate 1 hz, with an accurate 50% duty cycle..
thanks for your time, i'd be grateful for any help at all.
heres the code.
Vish
entity Cntr50 is
Port (CLOCK : in STD_LOGIC;
C_OUT1 : out STD_LOGIC);
end Cntr50;
architecture Cntr50_Arch of Cntr50 is
signal CT1: STD_LOGIC_VECTOR (24 downto 0);
begin
process (CLOCK)
begin
if (rising_edge(CLOCK)) then
if CT1 < 50E6 then
CT1 <= CT1 + 1;
else
CT1 <= "0000000000000000000000000";
end if;
if CT1 < 25E6 then
C_OUT1 <= '0';
else
C_OUT1 <='1';
end if;
end if;
end process;
end Cntr50_Arch;
I just need to divide a 50mhz clock, into a 1hz one.
being new to vhdl, im not sure about the size of the logic_vector?
Im also unsure about the two comparing statements CT1<50.etc
and how to create an accurate 1 hz, with an accurate 50% duty cycle..
thanks for your time, i'd be grateful for any help at all.
heres the code.
Vish
entity Cntr50 is
Port (CLOCK : in STD_LOGIC;
C_OUT1 : out STD_LOGIC);
end Cntr50;
architecture Cntr50_Arch of Cntr50 is
signal CT1: STD_LOGIC_VECTOR (24 downto 0);
begin
process (CLOCK)
begin
if (rising_edge(CLOCK)) then
if CT1 < 50E6 then
CT1 <= CT1 + 1;
else
CT1 <= "0000000000000000000000000";
end if;
if CT1 < 25E6 then
C_OUT1 <= '0';
else
C_OUT1 <='1';
end if;
end if;
end process;
end Cntr50_Arch;