Re: Asynchronous fifo cdc question
In FIFO style #1, the FIFO memory can be completely full, so an additional write will overwrite the oldest element.
If you write when the FIFO is full, the correct behavior is to ignore the write. It is not OK to destroy data that is already in the FIFO.
The AND gate prevents the overwrite.
A read will not destroy anything, so no need to AND the read signals. The logic inside "FIFO rptr & empty" will not increment the read pointer when the FIFO is empty.
In FIFO style #2 it is necessary to use "almost full" and "almost empty" signals. This means that there will be some slack, so a write when the FIFO is "almost full" will not destroy anything.
The memory in FIFO style #2 can never be completely full.