An all-optical adder/subtractor (A/S) unit with the help of terahertz optical asymmetric demultiplexer (TOAD) is proposed. The all-optical A/S unit with a set of all-optical full-adders and optical exclusive-ORs (XORs), can be used to perform a fast central processor unit using optical hardware components. We try to exploit the advantages of TOAD-based optical switch to design an integrated all-optical circuit which can perform binary addition and subtraction. With computer simulation results confirming the described methods, conclusions are given. © 2009 Chinese Optics Letters. © 2009 Chinese Optics Letters.