A substrate processing apparatus that can reduce the number of parts. The transistor can include an oxide semiconductor layer. The collection of such switching elements and latches are provided on a single silicon chip which includes of the functions of the invention.