Based on the polarization switching mechanism in an optically injected vertical cavity surface emitting laser (VCSEL), and the new electro-optic modulation theory, we propose a novel approach to implement optoelectric logic gates. Here, the two linearly polarized lights from the output of the laser are considered as two logic outputs. Under the electro-optic modulation, one of the logic outputs is the NOT operation with the other one. With the same logic input signal, we perform various digital signal processing (AND, OR, XNOR, NAND, NOR and XOR) in the optical domain, controlling the logic operation of the applied electric field between the two logic input signals. On this basis, the logic operation of half-adder is further implemented.