Quantum-mechanical analysis of the electrostatics in silicon-nanowire and carbon-nanotube FETs