----------------------------------------------------------------------------------
-- Company:        CERN
-- Engineer:       Carlos Gil Soriano
-- 
-- Create Date:    16:26:32 10/07/2011 
-- Design Name:    Basic debouncer
-- Module Name:    debouncer - Behavioral 
-- Project Name:   CTDAH
-- Target Devices: Spartan 6
-- Tool versions: 
-- Description: 
--
-- Dependencies: 
--
-- Revision: 
-- Revision 0.01 - File Created
-- Additional Comments: 
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;


entity gc_ff is
  port(
        Q   : out STD_LOGIC;
        C   : in  STD_LOGIC;
        CLR : in  STD_LOGIC;
        D   : in  STD_LOGIC
      );
end gc_ff;

architecture Behavioral of gc_ff is

begin

  reg_proc: process(C)
  begin
    if rising_edge(C) then
      if CLR = '1' then
        Q <= '0';
      else
        Q <= D;
      end if;
    else
    end if;
  end process;

end Behavioral;
