 A typical use of Gray code counters is building a FIFO (first-in, first-out) data buffer that has read and write ports that exist in different clock domains.The input and output counters inside such a dual-port FIFO are often stored using Gray code to prevent invalid transient states from being captured when the count crosses clock domains.The updated read and write pointers need to be passed between clock domains when they change, to be able to track FIFO empty and full status in each domain.