-- file:toggle.vhd ------------------------------------------ -- Divide the input frequency by 2 -- -- By Ahmed Allam -- October 9, 1999 -- University of Alberta, EE552. library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity toggle is port(input : in std_logic; q : buffer std_logic ); end toggle; architecture archdev of toggle is signal j,k :std_logic ; begin j <= '1'; k <= '1'; toggle:process (input) begin if rising_edge (input) then q <= (j and not q ) or (not k and q) ; end if ; end process toggle; end archdev;