The goal is to design a First In First Out (FIFO) buffer with parameterizable bit width and capacity. The FIFO should be mixed clock (that is separate clocks for read and write). The diagram below shows the input/output ports
The equations below show the FSM design for a FIFO of capacity 3. E and D refers to the enqueue and dequeue inputs respectively. For a FIFO with capacity c, there are c+2 states, where the 2 extra states correspond to empty and full FIFO.
Mealy Machine
Extended Mealy machine
The systhesis is shown schematically below. The green parts are combinatorial and the blue parts are sequential
The source code is available here.