<p>A single-chip microcomputer includes a microprocessor (102), a subprocessor (103) for performing peripheral functions, an external port (105) for controlling an input/output operation from/to an external device and a multi-functional logic-in-memory (104) for inputting a plurality of data from at least one of the microprocessor, the subprocessor and the external port and selecting write data from among the plurality of data in accordance with predetermined priorities. <IMAGE></p>