reg based fifo final version 1.1