1
\$\begingroup\$

I have a serial input stream which has left data in posedge of the clock, and right data in negedge of the clock.

I would like to synchronize and bring them to the posedge of the same clock.

I could do that using another clock with twice of the frequency.

How to synchronize the data using the same clock?

\$\endgroup\$
1
\$\begingroup\$

Use the negedge of the clock to sample the "right" data and store it to a register, then use the posedge to sample the "left" data and the register.

reg r;
always @(negedge clock) begin
    r <= right_data;
end

always @(posedge clock) begin
    // use left_data and r here
end
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.