Forum Discussion
Altera_Forum
Honored Contributor
17 years agoMy FPGA is not detecting the XOR edge..
I have this verilog code, which depends on either the posedge of the clock or the XOR of my data with its delayed version. assign x1 = data;
assign x2 = ~x1;
assign x3 = ~x2;
assign XORData =...
Altera_Forum
Honored Contributor
17 years agoAs a supplement, I append an asynchronous delay line, basically copied from the stx_cookbook V3.0, used as edge detector. The 10 element line produces a pulse width of about 3 ns according to Quartus timing simulator with Cyclone III.
module edge_detect (inp,out);
parameter DELAY = 10;
input inp;
output out;
wire delay_line /* synthesis keep */;
genvar i;
generate
for (i=1; i<DELAY; i=i+1)
begin : del
assign delay_line = delay_line;
end
endgenerate
assign delay_line = inp;
assign out = delay_line ^ inp;
endmodule