Re: transistors
For simple understanding:
nmos is n-channel mosfet and is identical to npn transistor where you need positive voltage at the gate (base) to turn in on. pmos is identical to pnp and needs a negative voltage applied to the gate to turn it on. In CMOS, both transistors (nmos and pmos) are used.
When +ve voltage is applied, the nmos will be on and the transistor will be sinking current from output to ground. The output will be at logical '0'.
When -ve voltage is applied, the pmos will be on and the transistor will source current from VDD to the outpt. The output will be at logical '1'.
Hope that helps.