This is one possibility. It might be possible that number of gates could be less than this. There is no algorithm to find minimum number of gates.
@ankitgupta.1729 Why there's no algorithm? Means, this problem is undecidable?
You can draw and find the direct or best implementation, as shown above.