Two-state voltage fluctuations between a hyperpolarized down-state and a depolarized up-state have been observed experimentally in a wide variety of neurons across brain regions. Using a biophysical model, we show that synaptic input by NMDA receptors can cause such membrane potential fluctuations. In this model, when a neuron is driven by two input pathways with different AMPA/NMDA receptor content, the NMDA-rich input causes up-state transitions, whereas the AMPA-rich input generates spikes only in the up-state. Therefore the NMDA-rich pathway can gate input from an AMPA pathway in an all-or-none fashion by switching between different membrane potential states. Furthermore, once in the up-state, the NMDA-rich pathway multiplicatively increases the gain of a neuron responding to AMPArich input. This proposed mechanism for two-state fluctuations directly suggests specific computations, such as gating and gain modulation based on the distinct receptor composition of different neuronal pathways. The dynamic gating of input by up- and down-states may be an elementary operation for the selective routing of signals in neural circuits, which may explain the ubiquity of two-state fluctuations across brain regions.