Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple rising edges(clocks), falling edge

Status
Not open for further replies.

tassingremi

Programmer
May 6, 2003
3
0
0
CN
Hi all,
i would really appreciate to get some help here.

Basically, i have a component with 3 inputs(buttons) and i need to check if any of them has been pressed or released for further use. So i wanted to deal with them as they were just clocks. But it seems like multiple clocks are not supported in VHDL.

Is it there any way to overcome this problem?
I saw this post: but it didn't have any satisfaying solution, so falling edge still a nightmare for me since i want to check rising and falling edge seperately and for different "clocks".

It's really urgent, help P-L-E-A-S-E!
 
I try using multiple architectures for the same entity but still don't if it will work.
 
hi,
if you have a clock in your design then you can detect rising and falling edges by synchronising these signals to the clocks and using one or two (if you want to be sure that you're not sampling noises) Flip Flops and comparing the input signal and the output of the Flip Flop

example:

entity ...
port(
a : in std_logic
);

architecture ...

signal a1 : std_logic;

begin

process(clk)
begin
if clk'event and clk = '1' then
a1 <= a;
if a = '0' and a1 = '1' then -- falling edge detection
-- .......
end if;
-- or
if a = '1' and a1 = '0' then -- rising edge detection
-- .......
end if;
end if;
end process;
 
yeah!
That's what i did.
thanx anyway.
The multiple architectures stuff didn't work because the compiler was only considering the last one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top