entity clkgen is
port (
reset : in std_logic;
128mhz : in std_logic;
64mhz : out std_logic;
shifted_64mhz : out std_logic);
end entity;
architecture arch of clkgen is
signal int1, int2 : std_logic;
begin
process(128mhz, reset) is
begin
if (reset = 1) then
int1 <= '0';
elsif (128mhz = 1 and 128mhz 'event) then
int1 <= not int1;
end if;
64mhz <= int1;
end process;
process(128mhz, reset) is
begin
if (reset = 1) then
int2 <= '0';
elsif (128mhz = 0 and 128mhz 'event) then
int2 <= not int2;
end if;
shifted_64mhz <= int2;
end process;
end architecture;