Patent ID: 8683278

Claim:
A semiconductor device, comprising: a user circuit having a plurality of flip-flops; and a connection path which, while in test mode, connects the plurality of flip-flops and forms a scan chain, and while in user mode, disconnects the plurality of flip-flops and does not form the scan chain, wherein the connection path has an XOR or XNOR operation circuit which performs an XOR or XNOR operation on a first output value and a prescribed value and outputs a second output value, the first output value being an output value of at least one of the plurality of flip-flops, the second output value being different from the first output value or being same as the first output value depending on the prescribed value, the XOR or XNOR operation circuit being included in the scan chain while in test mode, and the first output value is restorable based on the prescribed value and a logic of the XOR or XNOR operation circuit.