You can't replace an eye yet, but you can easily replace a diode. The material in the diode as you can see from the above picture is separated into two sections, N type and P type crystals. Then the N type is alloyed with a metal base. Keep in mind that N and P type can also be determined by the rate growth at the time the crystal is grown. There are different ways of making N and P type, some of these methods include diffusion or the rate growth that I briefly mentioned.
Diffusion is more preferred in the manufacturing industry.
Because of this exchange, the area of exchange becomes void of carriers, whether they might be holes or electrons. The N side gets it's energy from the negative terminal of the battery. I did not loose you.