--									E235   11 1101
-- KK01-30 Edge Detectors, Behavioral Method
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--|||||||||||||||||||||||||||||||||||||||||
entity Edge_detectors is 
	port 
	(
	clk: 	 in 	std_logic;
	input: in 	std_logic;
	
	rising: 	 out 	std_logic
	); 
end Edge_detectors;

--|||||||||||||||||||||||||||||||||||||||||
architecture behavioral of Edge_detectors is 

signal prev_in : std_logic := '0';

--=========================================
begin
	process (clk) is
	begin
		if rising_edge(clk) then
			if (input = '1') then
				if (prev_in = '0') then
					prev_in <= '1';
					rising <= '1';
				else
					rising <= '0';
				end if;
			else
				prev_in <= '0';
				rising <= '0';
			end if;	
		end if;
	end process;
end architecture behavioral;