PROBLEM TO BE SOLVED: To provide a compact semiconductor device which can be equipped with a peripheral circuit, and an endoscope equipped with the semiconductor device.SOLUTION: A semiconductor device 140 is a multilayer substrate, so to speak, and is mainly provided with an imaging element connection board 141 and a cable connection board 150. The imaging element connection board 141 is rectangular parallelepiped, electrically connected and fixed to the cable connection board 150 via a reverse surface 144. The cable connection board 150 has a shape in which two rectangular parallelepiped are connected, and is mainly provided with a board part 151 and a lid part 152 that compose one rectangular parallelepiped and an intermediate part 153 composing the other rectangular parallelepiped. The board part 151 is provided with a component mounting part 154 that is a bottomed cylinder and formed in a flat rectangle surface inside the board part 151. In the component mounting part 154, electric wiring is formed, and a plurality of passive components 125 are electrically connected and fixed by a solder to a land provided on the electric wiring. Thus, a peripheral circuit is formed in the component mounting part 154.