]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
edge detection logic - cu
authorhadaq <hadaq>
Tue, 5 Mar 2013 10:23:02 +0000 (10:23 +0000)
committerhadaq <hadaq>
Tue, 5 Mar 2013 10:23:02 +0000 (10:23 +0000)
tdc_releases/tdc_v1.3/fallingEdgeDetect.vhd [new file with mode: 0644]
tdc_releases/tdc_v1.3/risingEdgeDetect.vhd [new file with mode: 0644]

diff --git a/tdc_releases/tdc_v1.3/fallingEdgeDetect.vhd b/tdc_releases/tdc_v1.3/fallingEdgeDetect.vhd
new file mode 100644 (file)
index 0000000..f413d0b
--- /dev/null
@@ -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 (file)
index 0000000..fad9f7e
--- /dev/null
@@ -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;