Generate pulse on change

  • Thread starter Kenneth Brun Nielsen
  • Start date
K

Kenneth Brun Nielsen

Guest
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
 
On 12 May, 16:33, Kenneth Brun Nielsen
<kenneth.brun.niel...@googlemail.com> wrote:
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.
 
On 12 Maj, 17:45, Tricky <Trickyh...@gmail.com> wrote:

    pulse <= '1', '0' after 10ns;
Thanks. Just what I needed :)

/Kenneth
 

Welcome to EDABoard.com

Sponsor

Back
Top