A semiconductor device, for detecting a distribution of a physical quantity, including a matrix of unit elements, each unit element including a charge generator for generating a charge corresponding to an input electromagnetic wave, and a unit signal generator for generating an analog unit signal containing a standard component and a signal component, the semiconductor device comprising:
- a comparator for comparing a reference signal for generating digital data of the signal component with each of signals corresponding to the standard component and the signal component;
- a counter for performing a counting operation in one of a down-count mode and an up-count mode in parallel with the comparison operation of the comparator, and storing a count at the moment at the moment the comparator completes the comparison operation, and
- a controller for switching the count mode of the counter depending on whether the comparator performs the comparison operation on the standard component or the signal component,
- wherein the controller is operable to perform a control process to perform the comparison operation and the counting operation on the standard component in a first step, and to perform the comparison operation and the count process on the signal component in a second step.