[SOLVED] Rising Edge Detector Synchronization Problem

Status
Not open for further replies.

hsnhsyn1

Junior Member level 1
Joined
Mar 19, 2013
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,400
hello, i designed an edge detector in verilog. it's RTL seems correct, but in simulation the output pulse is delayed. The examples on the internet, the pulse starts exactly with the rising edge of the clock signal. i used no delay in simulation.
capture from the simulation


and the code
Code:
module re_detector(Clk, sign_in, Sync_clk);

// input ports
input Clk, sign_in;
// output ports
output wire Sync_clk;
reg 	Q;
wire 	sign_in;

always@(posedge Clk)begin
	Q <= sign_in;
end
assign Sync_clk = sign_in & (~Q);
endmodule
 

What's your problem? The simulation is obviously a timing simulation, using realistic chip timing. The output like expectable from a real chip.

Apparently you are using Altera QSIM which does a gate level timing simulation.
 

yes, i'm using quartus simulator. i'm new to designing in HDL and i don't know whether the results are correct. because in the examples i looked up, the output pulse (sync_clk) toggles as the input signal (sign_in) goes up. like in this one
PHP:
http://fpgacenter.com/examples/basic/edge_detector.php
 

Both results are correct, they just represent different types of simulation. Please consider that most of delay shown in the timing simulation is actually IO delay, which is large compared to internal logic cell delay.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…