------------------------------------------------------------------------ -- BtnDemo.vhd -- Demonstrate D2SB On-Board Button and LED ------------------------------------------------------------------------ -- Author: Clint Cole -- Copyright 2003 Digilent, Inc. ------------------------------------------------------------------------ -- This module demonstrates connects the button to the LED on the D2FT board. -- -- Inputs: -- btn - button on the D2-SB board -- -- Outputs: -- led - discrete LED on the D2-SB board -- ------------------------------------------------------------------------ -- Revision History: -- 09/18/2003(ClintC): created ------------------------------------------------------------------------ library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity D2SBBtnDemo is Port ( btn, mclk : in std_logic; led : out std_logic); end D2SBBtnDemo; architecture Behavioral of D2SBBtnDemo is ------------------------------------------------------------------------ -- Component Declarations ------------------------------------------------------------------------ ------------------------------------------------------------------------ -- Signal Declarations ------------------------------------------------------------------------ signal cntClk : std_logic_vector(23 downto 0); ------------------------------------------------------------------------ -- Module Implementation ------------------------------------------------------------------------ begin process (mclk) begin if mclk = '1' and mclk'Event then cntClk <= cntClk + 1; end if; end process; led <= cntClk(23) or btn; end Behavioral;