Model organisms usually possess a small nervous system but nevertheless execute a large array of complex behaviors, suggesting that some neurons are likely multifunctional and may encode multiple behavioral outputs. Here, we show that the C. elegans interneuron AIY regulates two distinct behavioral outputs: locomotion speed and direction-switch by recruiting two different circuits. The "speed" circuit is excitatory with a wide dynamic range, which is well suited to encode speed, an analog-like output. The "direction-switch" circuit is inhibitory with a narrow dynamic range, which is ideal for encoding direction-switch, a digital-like output. Both circuits employ the neurotransmitter ACh but utilize distinct postsynaptic ACh receptors, whose distinct biophysical properties contribute to the distinct dynamic ranges of the two circuits. This mechanism enables graded C. elegans synapses to encode both analog- and digital-like outputs. Our studies illustrate how an interneuron in a simple organism encodes multiple behavioral outputs at the circuit, synaptic, and molecular levels.