EmbDev.net

Forum: FPGA, VHDL & Verilog Help with code for SPGA


von Vadhiraj (Guest)


Rate this post
0 useful
not useful
Hi,

I need a code to generate 4 different pulse signals, at same time. all 
are at frequency of 50Hz.
1st one starts after a delay of 0.01sec and ends at 0.011 sec.
2st one starts after a delay of 0.005sec and ends at 0.008 sec.
3st one starts after a delay of 0.01sec and ends at 0.015 sec.
4st one starts after a delay of 0.004sec and ends at 0.01 sec.

can any one help with the code.
all these signals are independent of each other. and have to be 
pulsating always.

von Vancouver (Guest)


Rate this post
0 useful
not useful
FPGA, I think?

Obviously you need a resolution of 1ms. Write a 5-bit counter that ist 
clocked at 1kHz. The first output is set to 1 between counter=10 and 
counter=11 and 0 else. The second output is set 1 between counter=5 and 
counter=8 and 0 else, etc. The counter is reset after counter=19, since 
your period is 20ms.

von Lothar M. (lkmiller) (Moderator)


Rate this post
0 useful
not useful
Vadhiraj wrote:
> can any one help with the code.
Which code?

> can any one help with the code.
First you must generate a "timertic" of 1ms.
Then you take a pattern of each timing:
signal_1 = "00000000001000000000"
signal_2 = "00000111000000000000"
signal_3 = "00000000001111100000"
signal_4 = "00001111110000000000"
With that you can simply run through those pattern with an index that is 
reset each 20ms.

> I need a code
No one here will do your homework. So you start with something and 
then we discuss the problems (if there are any).

> I need a code
Which language, what target and toolchain?
I could write that in C, Basic, VHDL and some more, but not in Verilog. 
So its essential neccessary to know your target.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.