-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsynchronizer_2ff.vhd
53 lines (44 loc) · 1.25 KB
/
synchronizer_2ff.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
52
53
-------------------------------------------------------------------------------------
-- synchronizer-2ff.vhd
-------------------------------------------------------------------------------------
-- Authors: Maxwell Phillips
-- Copyright: Ohio Northern University, 2023.
-- License: GPL v3
-- Description: Simple two-flip-flop CDC synchronizer.
-------------------------------------------------------------------------------------
library IEEE;
use IEEE.std_logic_1164.all;
entity synchronizer_2ff is
port (
input : in std_logic;
dest_clk : in std_logic;
reset : in std_logic;
output : out std_logic
);
end synchronizer_2ff;
architecture behavioral of synchronizer_2ff is
component d_flip_flop is
port (
input : in std_logic;
clk : in std_logic;
reset : in std_logic;
output : out std_logic
);
end component;
signal q1_to_d2 : std_logic;
begin
sync_ff_1 : d_flip_flop
port map (
input => input,
clk => dest_clk,
reset => reset,
output => q1_to_d2
);
sync_ff_2 : d_flip_flop
port map (
input => q1_to_d2,
clk => dest_clk,
reset => reset,
output => output
);
end architecture behavioral;