A semiconductor device according to an embodiment of the present invention includes: an oscillating circuit including a plurality of logic circuits connected in series; and an error detecting circuit receiving output signals of at least two of the plurality of logic circuits, and suspending an operation of the oscillating circuit to notify other blocks of the oscillating circuit that an error occurs in the oscillating circuit if a phase difference between the output signals is not within a predetermined phase difference range.