In reply to Pooja Pathak:
That code would be problematic for a synchronous fifo if there was a simultaneous read and write on the same clock cycle and the fifo was empty or full. You would have a race condition with the read and write operations on whether or not they generate an error.