Altera_Forum
Honored Contributor
15 years agodelayed pulse generator
hello , i must do a delayed circuit pulse generator.(i can set delay and width of pulse). My code works fine, but quartusII make a warning (complex event).
can i do this circuit in another mode? my code: module GateGENERATORASSER(clk,start,outPulse); input clk,start; output outPulse; reg started=0; reg outPulse=0; reg[11:0] Start=0; reg[12:0] Stop=0; reg[11:0] StartREF=10; reg[12:0] StopREF=4700; always @(negedge start or posedge(Start==StartREF)) //COMPLEX EVENT!! if(Start==StartREF) started<=0; else started<=1; always @(posedge clk) if(started) Start<=Start+1; else if(Start==StartREF) Start<=0; always @(posedge clk) if(Start==StartREF) outPulse<=1; else if(Stop==StopREF) begin outPulse<=0; Stop<=0; end else if(outPulse) Stop<=Stop+1; endmodule