---------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 01:49:24 08/13/2006 -- Design Name: -- Module Name: PRG05 - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- ---------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; ---- Uncomment the following library declaration if instantiating ---- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; ENTITY CRYCNT IS PORT( CLK : IN std_logic; SBIT : IN std_logic; Q : out std_logic ); END CRYCNT; ARCHITECTURE rtl of CRYCNT IS SIGNAL counter : std_logic_vector(17 downto 0); BEGIN PROCESS(CLK) BEGIN -- if(CLK'event and CLK='1') then if((CLK'event and CLK='0' ) and SBIT = '1' ) then if( counter = 199999 ) then counter <= CONV_STD_LOGIC_VECTOR(0,18); else counter <= counter + 1; end if; end if; END PROCESS; Q <= counter(17); end rtl;