Understanding the Purpose of Diodes