A diode is an active device that consist of a pn junction that was made on s semiconductor. The junction is usually realised by consecutive diffusion of acceptor and donor dopants one one side of a semiconductor or by ion implantation.
The figure for the band energy diagram of a diode is below.
When the pn junction is realised, because of the intimate contact between the two sides, at the contact zone, a part of electrons that are in excess in the n semiconductor fall into the p semiconductor and the holes from the p semiconductor occupy the n semiconductor. Thus two things happen. First The Fermi level (the energy level that has a probability of being filled with electrons of 0.5) will be the same on both sides (pinned on the donor level in the p side and pinned on the acceptor level on the n side). Second an internal electric field field will be created. For a Silicon pn junction the value of the potential of this field is 0.7 V. When a external voltage is applied with positive potential to the p side and negative potential to the n side, this internal field will be diminished until it completely vanishes, thus letting the current flow through the junction. When the external voltage is applied inversely, it will further increase the internal field of the junction, which in turn will oppose the flow of the current through the structure.
Thus a diode is a device that allows the current to flow only in one direction through it. This is why it is called an active device.
look at the link:
In electronics , a diode is a type of two- terminal electronic component with nonlinear resistance and conductance (i.e., anonlinear current–voltage characteristic ), distinguishing it from components such as two-terminal linear resistors whichobey Ohm's law . A semiconductor diode , the most common type today, is a crystalline piece of semiconductor material connected to two electrical terminals. [ 1 ] A vacuumtube diode (now rarely used except in some high-power technologies) is a vacuum tube with two electrodes : a plate and a cathode .
The most common function of a diode is to allow an electric current to pass in one direction (called the diode's forward direction), while blocking current in the opposite direction (the reverse direction). Thus, the diodecan be thought of as an electronic version of a check valve . This unidirectional behavioris called rectification , and is used to convert alternating current to direct current , and to extract modulation from radio signals in radio receivers—these diodes are forms of rectifiers .