Forum Discussion
Anonymous
3 years agoNot applicable
Periodic Pulses Pattern
Hello,
I'm a new Verilog programmer and still rely on examples to write code.
I didn't find any example of what I need.
I need to generate two pulses periodicaly like this following schema:
...
Anonymous
3 years agoNot applicable
Here are the expected periodicaly outputs of the test bench:
I tried this code. What is the problem?
`timescale 1us/1ns
module Pulses(clk, pulse1, pulse2);
output clk, pulse1, pulse2;
wire c, p1, p2;
initial
begin
c = 0;
p1 = 0;
p2 = 0;
repeat(1000) //1000 cycles repeated
begin
#0 c = 1;
#1 c = 0;
#2 p1 = 1;
#1 p2 = 1;
#1 p1 = 0;
#2 p2 = 0;
#1 ;
end
assign clk = c;
assign pulse1 = p1;
assign pulse2 = p2;
end
endmodule
Thank you