Explain the functioning of a semiconductor diode. How is this basic semiconductor component used in electronic circuits?