I have to use a multibit counter signal in another clock domain from the one that is generated. If there is no relation between the 2 clocks, is it safe to use gray code and classic 2 sync FFs and just read the coded value after that (just like it is done for pointers in asynchronous fifos)? In my understanding this would introduce less delay than using handshake signals ...
Asked
Active
Viewed 433 times
1
-
but in this case i am assuming a counter value , so if this value has to cross a domain maybe handshaking is not required? – user2609910 Sep 15 '21 at 06:23
-
i mean that that an x-bit counter is not a 'multi-bit arbitrary value' signal, it increments by one , so if this signal is gray coded and then transfered to another domain, it would not need handshake signals? Just like the write and read pointers in asynchronous fifos are not transfered with handshake signals (if i understand correct)? – user2609910 Sep 15 '21 at 18:32
-
2See [ask] and [help/on-topic]. [electronics.se] may be better suited for digital design issues (noting the lack of a programming question here). – user16145658 Sep 15 '21 at 22:49
1 Answers
1
Yes, using Gray encoding/decoding of the counter value over the Clock Domain Crossing (CDC) is the usual way to do it.
For this to work, the skew of the bits in the Gray encoded counter value plus the settling time for meta-stability must be less than the clock period. So remember to constrain the synthesis and Static Timing Analysis (STA).

Morten Zilmer
- 15,586
- 3
- 30
- 49