library ieee; use ieee.std_logic_1164.all; entity klokdeler_second is generic(Distance : natural := 100000000); port( clkin : in std_logic; clkout : out std_logic); end entity klokdeler_second; architecture behavioral of klokdeler_second is begin process(clkin) variable cntr : integer range 0 to Distance; begin if rising_edge(clkin) then if (cntr < 50000000) then cntr := cntr+1; clkout <= '0'; elsif (cntr >= 50000000 and cntr < Distance) then cntr := cntr+1; clkout <= '1'; else cntr := 0; end if; end if; end process; end architecture behavioral;