Diode is the simplest and most fundamental nonlinear circuit element. Just like a resistor, the diode has two terminals; but unlike the resistor , which has a linear (straight-line) relationship between the current flowing through it and the voltage appearing across it, the diode has a nonlinear i-v characteristic.
A diode may be defined as a near-unidirectional conductor whose state of conductivity is determined by the polarity of its terminal voltage. It is made from a small piece of semiconductor material, usually silicon, in which half is doped as a p region and half is doped as an n region with a pn junction and depletion region in between. The p region is called the anode and is connected to a conductive terminal. The n region is called the cathode and is connected to a second conductive terminal.