Generate pulse on change

  • Thread starter Kenneth Brun Nielsen
  • Start date
K

Kenneth Brun Nielsen

I want to monitor a (vector) signal and generate a pulse of a
specified length (in time) whenever (any of the bits in) the signal
changes value.

Does VHDL feature a simple way to do that?

A primitive solution would be to XOR each signal bit with a delayed
replica of itself, but I assume that VHDL has better ways of
implementing this?

It does only have to work in simulations.

Best regards,
Kenneth
 
T

Tricky

I want to monitor a (vector) signal and generate a pulse of a
specified length (in time) whenever (any of the bits in) the signal
changes value.

Does VHDL feature a simple way to do that?

A primitive solution would be to XOR each signal bit with a delayed
replica of itself, but I assume that VHDL has better ways of
implementing this?

It does only have to work in simulations.

Best regards,
Kenneth

If its for simulation only, try this (modify for your own needs:

pulse_proc : process
begin
--initialise pulse (if you havent already)
pulse <= '0';

while true loop --only needed if you leave the above line in
wait until my_bus'event;
pulse <= '1', '0' after 10ns;
end loop;

end process;


With this, the pulse will be extended if there is another change
during the pulse high period.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top