forked from peterotte/A2ExpTrigger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pulser.vhd
52 lines (40 loc) · 1.08 KB
/
Pulser.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
44
45
46
47
48
49
50
51
--
-- Clock Input, e.g. 50MHz
-- Now provide the DividingPower integer:
-- 0 --> Rate(Sig_Out) = clock/2**1
-- 1 --> Rate(Sig_Out) = clock/2**2
-- 2 --> Rate(Sig_Out) = clock/2**3
--
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Pulser is
generic (
DividingPower : integer;
OutputWidth : integer
);
Port ( clock : in STD_LOGIC;
Sig_Out : out STD_LOGIC);
end Pulser;
architecture Behavioral of Pulser is
signal ClockCounter : std_logic_vector(DividingPower downto 0);
signal InterSig_Out : std_logic;
component GateShortener
generic (
NCh : integer
);
Port ( sig_in : in STD_LOGIC;
sig_out : out STD_LOGIC;
clock : in STD_LOGIC);
end component;
begin
process (clock)
begin
if rising_edge(clock) then
ClockCounter <= ClockCounter +1;
end if;
end process;
InterSig_Out <= ClockCounter(DividingPower);
GateShortener_1 : GateShortener GENERIC MAP (NCh => OutputWidth) PORT MAP (sig_in => InterSig_Out, sig_out => Sig_Out, clock => clock);
end Behavioral;