see the slides of the module Electronic systems and devices https://sites.units.it/carrato/didatt/ESD_web/index.html