A diode is a type of electrical device that allows the current to move through it in only one direction. ... A resistor is an electric component that is used to provide resistance to current in the circuit. They are mostly used to produce heat or light. The two terminals of the diodes are known as anode and cathode.