From 4df4d368be5d2ba886835978e877182fd6da54b4 Mon Sep 17 00:00:00 2001 From: hadaq Date: Tue, 5 Mar 2013 10:23:02 +0000 Subject: [PATCH] edge detection logic - cu --- tdc_releases/tdc_v1.3/fallingEdgeDetect.vhd | 17 +++++++++++++++++ tdc_releases/tdc_v1.3/risingEdgeDetect.vhd | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tdc_releases/tdc_v1.3/fallingEdgeDetect.vhd create mode 100644 tdc_releases/tdc_v1.3/risingEdgeDetect.vhd diff --git a/tdc_releases/tdc_v1.3/fallingEdgeDetect.vhd b/tdc_releases/tdc_v1.3/fallingEdgeDetect.vhd new file mode 100644 index 0000000..f413d0b --- /dev/null +++ b/tdc_releases/tdc_v1.3/fallingEdgeDetect.vhd @@ -0,0 +1,17 @@ +library IEEE; +use IEEE.STD_LOGIC_1164.all; + +entity fallingEdgeDetect is + port (CLK : in std_logic; + SIGNAL_IN : in std_logic; + PULSE_OUT : out std_logic); +end fallingEdgeDetect; + +architecture Behavioral of fallingEdgeDetect is + + signal signal_d : std_logic; + +begin + signal_d <= SIGNAL_IN when rising_edge(CLK); + PULSE_OUT <= (not SIGNAL_IN) and signal_d when rising_edge(CLK); +end Behavioral; diff --git a/tdc_releases/tdc_v1.3/risingEdgeDetect.vhd b/tdc_releases/tdc_v1.3/risingEdgeDetect.vhd new file mode 100644 index 0000000..fad9f7e --- /dev/null +++ b/tdc_releases/tdc_v1.3/risingEdgeDetect.vhd @@ -0,0 +1,17 @@ +library IEEE; +use IEEE.STD_LOGIC_1164.all; + +entity risingEdgeDetect is + port (CLK : in std_logic; + SIGNAL_IN : in std_logic; + PULSE_OUT : out std_logic); +end risingEdgeDetect; + +architecture Behavioral of risingEdgeDetect is + + signal signal_d : std_logic; + +begin + signal_d <= SIGNAL_IN when rising_edge(CLK); + PULSE_OUT <= (not signal_d) and SIGNAL_IN when rising_edge(CLK); +end Behavioral; -- 2.43.0