VHDL Signal Leading Lagging

Status
Not open for further replies.

shahsali

Newbie level 4
Joined
Mar 8, 2005
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,330
How to find out whether Signal A is leading over Signal B and if it is leading then how much it is leading using VHDL.
 

Here is how you can do it!

process (A,B)
variable start_A : time;
variable leading_by : time;
begin
if (A'event) then
start_A := now;
end if;

if (B'event) then
if (start_A < now) then
leading_by := now - start_A;
end if;
end if;
end process;
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…