kevindog
Newbie level 4
Verilog code about pulse generation
I am new to Verilog. Working on a project involving in pulse generation using verilog. Could someone else help me go through this code I got from web?
Another question is that this code generate a single pulse based on a trigger, if it's possible to generate a series of same pulse, like 5 same pulse sequence?
Thanks a lot in advance!
I am new to Verilog. Working on a project involving in pulse generation using verilog. Could someone else help me go through this code I got from web?
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 module pulse_gen ( input Trigger, output Pulse_Out, input [31:0] Pulse_Width, input Clock ); reg [1:0] trig; always @(posedge Clock) trig <= {trig[0],Trigger}; wire ld_cnt = (trig == 2'b01) ? 1'b1 : 1'b0; reg [32:0] cnt; always @(posedge Clock) if ( ld_cnt ) cnt <= {1'b1,Pulse_Width}; else if ( !cnt[32] ) cnt <= cnt; else cnt <= cnt - 1'b1; assign Pulse_Out = cnt[32]; endmodule
Another question is that this code generate a single pulse based on a trigger, if it's possible to generate a series of same pulse, like 5 same pulse sequence?
Thanks a lot in advance!
Last edited: