An encoder circuit and A/D converter that can minimize the error of an
encoder output with respect to all the possible combinations of
thermometer codes are desired to be provided. To this end, an encoder
circuit has a logic thereof configured to take a thermometer code as an
input and to output as an encoded value a center value of a range in
which one or more encoded values are distributed, the one or more encoded
values corresponding to positions of one or more boundaries between "0"
and "1" appearing in the thermometer code.