Semiconductors are materials with electrical properties between conductors and insulators. Doping semiconductors with impurities creates either excess electrons (N-type) or holes (P-type). Diodes are formed by joining a P-type and N-type semiconductor, creating a PN junction. Current flows easily through the diode in one direction under forward bias but is blocked under reverse bias, allowing rectification of alternating current into direct current.