Valleytronics is an emerging field of research utilizing the valley-pseudospin degree of freedom. In this work, we propose to exploit spin-valley locking in two-dimensional materials, such as silicene, germanene, stanene, and 1T′ transition-metal dichalcogenides, to realize the logic devices with multiple voltage-controlled gate contacts. These materials possess space-inversion and time-reversal symmetries and have two valleys at the non-time-reversal invariant momenta, K and K′, related by time-reversal symmetry. Due to these properties, the valley-spin polarization in these materials can be switched by electric field, and the device conductance and the output voltage can be controlled by the polarity of the input gate voltage. Based on the explicit quantum-transport calculations, we demonstrate the realization of seven logic gates, namely not, xnor, xor, and, nand, or, and nor.