gates function in a similar way as cell membrane :
cell membrane seperate the external enivironment from the cell while gate even seperate the external environment from the house
cell membrane controls the exit and entry of the cell, gate controls the entry and exit of the house