-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGateShortener.vhd
44 lines (37 loc) · 1016 Bytes
/
GateShortener.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--------------------------------------------------------
-- author: Peter Otte
-- 6.10.2011
--
-- Gate Shortener
-- Basic idea: shortens a long signal
-- maximum length: NCh * Clock+0..1*Clock (jitter)
--
-- note: the VUPROM output NIM_OUT adds an additional
-- 20ns because of the design of the hardware
--------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity GateShortener is
generic (
NCh : integer
);
Port ( sig_in : in STD_LOGIC;
sig_out : out STD_LOGIC;
clock : in STD_LOGIC);
end GateShortener;
architecture Behavioral of GateShortener is
signal sr : std_logic_vector(NCh downto 0);
begin
sig_out <= '1' when ((sig_in = '1') and (sr(NCh) = '0')) else '0';
process (clock, sig_in)
begin
if rising_edge(clock) then
for i in 0 to NCh-1 loop
sr(i+1) <= sr(i);
end loop;
sr(0)<=sig_in;
end if;
end process;
end Behavioral;