J
javid
Guest
Hello,
I would like to know if a two stage syncronizer is implemented in the
following way:
SYNC_NAS: process (CLK, RST)
begin
if (RST = '1') then
NAS_1 <= '1';
elsif ( rising_edge(CLK) ) then
NAS_1 <= NAS;
end if;
end process;
SYNC_NAS_1: process (CLK, RST)
begin
if (RST = '1') then
NAS_2 <= '1';
elsif ( rising_edge(CLK) ) then
NAS_2 <= NAS_1;
end if;
end process;
As you can see I have included the RST signal (in my case an external
asynchronous Reset signal), is this RST signal needed for the two
stage synchronizer?. I mean, should I write the two stage synchronizer
as before or:
SYNC_NAS: process (CLK)
begin
if ( rising_edge(CLK) ) then
NAS_1 <= NAS;
end if;
end process;
SYNC_NAS_1: process (CLK)
begin
if( rising_edge(CLK) ) then
NAS_2 <= NAS_1;
end if;
end process;
-----------------------------------------------------------------------------
And another question about Reset and State Machine:
In my State Machine I have:
....
STATE_FLOPS: process (CLK, RST)
begin
if (RST='1') then
PRESENT_STATE <= S0;
elsif ( rising_edge(CLK) ) then
EPRESENT_STATE <= NEXT_STATE;
end if;
end process;
....
the RST is coming asynchronously from the outside world. should I use
also for the RST signal the two stage synchronizer in order to avoid
glitches?
Thanks a lot and best regards,
Javi
I would like to know if a two stage syncronizer is implemented in the
following way:
SYNC_NAS: process (CLK, RST)
begin
if (RST = '1') then
NAS_1 <= '1';
elsif ( rising_edge(CLK) ) then
NAS_1 <= NAS;
end if;
end process;
SYNC_NAS_1: process (CLK, RST)
begin
if (RST = '1') then
NAS_2 <= '1';
elsif ( rising_edge(CLK) ) then
NAS_2 <= NAS_1;
end if;
end process;
As you can see I have included the RST signal (in my case an external
asynchronous Reset signal), is this RST signal needed for the two
stage synchronizer?. I mean, should I write the two stage synchronizer
as before or:
SYNC_NAS: process (CLK)
begin
if ( rising_edge(CLK) ) then
NAS_1 <= NAS;
end if;
end process;
SYNC_NAS_1: process (CLK)
begin
if( rising_edge(CLK) ) then
NAS_2 <= NAS_1;
end if;
end process;
-----------------------------------------------------------------------------
And another question about Reset and State Machine:
In my State Machine I have:
....
STATE_FLOPS: process (CLK, RST)
begin
if (RST='1') then
PRESENT_STATE <= S0;
elsif ( rising_edge(CLK) ) then
EPRESENT_STATE <= NEXT_STATE;
end if;
end process;
....
the RST is coming asynchronously from the outside world. should I use
also for the RST signal the two stage synchronizer in order to avoid
glitches?
Thanks a lot and best regards,
Javi