Question: why nmos is connected to ground?
Answer: This is the reason it is connected to Ground. ... Because the voltage between the Ground and the Source in the NMOS transistor has to be positive, so the logical choice is to connect the Source to the ground. In PMOS, the voltage between the Gate and the Source has to be negative, so you connect the Source to VDD.