In order to solve the three problems of terahertz optical asymmetric demultiplexer-cross phase modulation effect based all-optical exclusive-OR gate,which are that the strict demand of synchronization;cannot be applied in the situation of not return to zero signal input;the speed of exclusive-OR operation is limited by carrier recovery speed of semiconductor optical amplifier.An all-optical exclusive-OR gate was proposed which utilizes the structure of terahertz optical asymmetric demultiplexer and is based on four wave mixing effect,because of based on four wave mixing,this exclusive-OR gate can radically solve the mentioned three problems of terahertz optical asymmetric demultiplexer-cross phase modulation based exclusive-OR gate.This paper illustrates the principle of this exclusive-OR gate through theoretic analyse,and realizes the exclusive-OR operation for the input of 40Gbps,return to zero signal;80Gbps,return to zero signal;10 Gbps,not return to zero signal.The Qfactor and bit error rate of exclusive-OR operation for above three kinds of input are 11.7,2.4×10-18;8,1.1×10-10;22,1.3×10-40.And then,we analyse the influence on the quality of exclusive-OR output signal which is generated by change of parameter of main elements of terahertz optical asymmetric demultiplexer and temperature and dispersion effect.The feasibility and effectiveness of this exclusive-OR gate for solving the three problems of terahertz optical asymmetric demultiplexer-cross phase modulation based all-optical exclusive-OR gate are verified by theoretic analyse and simulation.