Layered diode