A two-dimensional model of the avalanche effects in MOS transistors