Clock domain crossing problem

Status
Not open for further replies.

biju4u90

Full Member level 3
Joined
Dec 10, 2014
Messages
172
Helped
3
Reputation
6
Reaction score
3
Trophy points
18
Activity points
1,437
This is an interview question I found:
I have three clock domains A, B and C.
I have some data coming from clock domain A and clock domain B.
I want to do some combinational operation and send the resulting data to clock domain C.
How can I do this?
 

Hi,

This is how I´d do it.

In detail it depends on signal timings and clock frequencies.

Example:
It will fail if signal A is a 100ns pulse and Clock_C frequency is 1MHz (1000ns).
It will work when signal A is a 1000ns pulse while Clock_C frequency is 10MHz (100ns).

Klaus
 

This is an interview question I found:
I have three clock domains A, B and C.
I have some data coming from clock domain A and clock domain B.
I want to do some combinational operation and send the resulting data to clock domain C.
How can I do this?

1. You cannot simply synchronize data from clock domain A and B to clock domain C and then perform the combinational operation. This will result in classic problem of re-convergence. With synchronizers you cannot guarantee that data will be sampled in 2 clock cycles (assuming double flops for synchronizers). There can be delay. Hence, when output of 2 synchronizers re-converge at a combinational logic, you cannot guarantee that it is functionally correct.
2. Because of #1, you will have to sample data from clock domain A to clock domain B (i.e add synchronizer from A->B), then perform combinational logic operation. Now one more problems arise. You cannot simply synchronize data of combinational logic to clock domain C. Combinational logic in front of synchronizer might result in glitch to be sampled (again functional problem)
3. Because of #2, you will have to add a flop to output of combinational logic (clock of course from B). Now you are good to add synchronizer to move to clock domain C.

Let me know if you have any more questions.
 

while all of this is true, OP's question is so vague that I don't know if it applies. I mean, why would you have any output to be combinational to begin with? This is frowned up.
 

while all of this is true, OP's question is so vague that I don't know if it applies. I mean, why would you have any output to be combinational to begin with? This is frowned up.

This is interview question which test possible issues with synchronizations. Nothing more than that
 


Looks like a perfect answer to the question. Thank you for the help.
 


in #3, you cant just add synchronizers if you the data is multibit.
 

in #3, you cant just add synchronizers if you the data is multibit.

Of course you cannot add synchronizer for multi bit data and this is due to reason #1 (no guarantee for delay). You will need DMUX synchronizer or FIFO for multi bit data.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…