forked from filipamator/vu_meter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtriggen.vhd
More file actions
39 lines (32 loc) · 653 Bytes
/
triggen.vhd
File metadata and controls
39 lines (32 loc) · 653 Bytes
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
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity triggen is
generic (
CLKCOUNTER : natural := 5000000
);
port (
clock : in std_logic;
reset_n : in std_logic;
enable : out std_logic
);
end entity triggen;
architecture rtl of triggen is
signal counter : integer range 0 to CLKCOUNTER-1;
begin
process (clock, reset_n)
begin
if (reset_n='0') then
counter <= 0;
elsif (clock='1' and clock'event) then
if (counter=CLKCOUNTER-1) then
counter <= 0;
enable <= '1';
else
enable <= '0';
counter <= counter + 1;
end if;
end if;
end process;
end rtl;