Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20641 Discussions

Time delay in VHDL

Altera_Forum
Honored Contributor II
1,508 Views

I need to implement a time delay element in FPGA by VHDL language to delay a signal for a specified time. 

Please, any one here can help me. 

 

thanks very much.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
549 Views

you will need a counter, and then use that to wait until the specified time. 

 

delays, like 

a <= b after 10 ns;  

are not synthesisable. The delay part is ignored.
0 Kudos
Altera_Forum
Honored Contributor II
549 Views

If You want to delay N cycles, then use N level pipelining.

0 Kudos
Altera_Forum
Honored Contributor II
549 Views

Maha, 

 

Both replies before mine are correct. I suspect you might need a little bit more to fully understand what is going on. 

 

You will need to use a clock in your design. You will need to decide what the speed of that clock is going to be (this is the frequency of an oscillator out side of the FPGA that might be in a test board as an example). You can take that clock into the FPGA (as a signal called clk if you like) and use that to feed a counter. 

 

For every count of the counter, you will then havea certain amount of "time" that will be consumed. 

 

From there, you can take your input signal, and gate it with the result of the counter reaching a certain value, then allowing the signal to pass (basically and AND function when the counter reaches a desired length). 

-------- 

 

If the time delay is not very large (compared to the frequency of the clock, then you simply use a series of Registers and pass along the signal for the input to out for the number of registers * 1/f of the clock. Result is a Delay of the signal as it clocks through the registers to the final output (this is basically a shift register). 

------- 

It really all depends on the amount of delay and the speed of the clock as to which is the best way to do it. (Best here meaning how much internal resources you can afford to use in the FPGA to accomplish the desired result). 

 

Good lunk in your studies. 

 

Avatar
0 Kudos
Reply