I'm really confused with the representation of PMOS device shown in the figure. Since conventional current direction in PMOS is from source to drain, shouldn't the current source be pointing upwards(from node Y to VDD)?
NMOS and PMOS current sources
nmospmos
Related Solutions
Your assumption is correct -- when a MOSFET is off, \$V_{DS}\$ can be anything.\$^1\$ You can see this in N2, where \$V_{DS} = V_{DD}\$. If \$V_{in2}\$ is grounded, then N2's \$V_{GS} = 0 \mathrm V\$ regardless of \$V_{DS}\$.
The solution is also correct. The tricky part is that the source voltage of N1 is not fixed. P1 and P2's source voltages are fixed at \$V_{DD}\$, and N2's is fixed at ground. But only N1's gate voltage is fixed -- the other two terminals both vary based on the circuit conditions. Let's consider every possible situation for N2.
\$V_G = V_{in1} = 0 \mathrm V\$. Since 0V is the lowest available voltage in the circuit, \$V_{GS}\$ can never be greater than zero. Thus, N1 must be off. P1 is on, so \$V_D = V_{DD}\$.
- If N2 is on, \$V_S = 0 \mathrm V\$.
- If N2 is off, \$V_S\$ floats, and its voltage is unknown.\$^2\$
\$V_G = V_{in1} = V_{DD}\$. Now it's possible for N1 to be on.
- If N2 is on, \$V_S = 0 \mathrm V\$, which means \$V_{GS} = V_{DD}\$, so N1 is on. As a consequence, \$V_{DS} = 0 \mathrm V\$, so \$V_D = 0 \mathrm V\$ too.
- If N2 is off, then P2 is on and \$V_D = V_{DD}\$. But \$V_S\$ is not fixed, so we don't know whether N1 is on or off. Let's think about both cases.
- If N1 is on, \$V_{DS} = 0 \mathrm V\$. This means \$V_S = V_{DD}\$. But that would mean \$V_{GS} = V_{DD} - V_{DD} = 0 \mathrm V\$, which implies that N1 is off. Contradiction! So this can't be right.
- If N1 is off, \$V_S\$ is floating again. But any voltage below \$V_{DD}\$ will mean \$V_{GS} > 0\$, which turns on the transistor and raises \$V_S\$. So the only stable state is \$V_S = V_{DD}\$.
Sometimes this guess-and-check method is the easiest way to solve a problem, which is why the solution used it.
\$^1\$ I'm only talking about DC here. A time-varying model of this circuit would include the parasitic capacitances of the MOSFETs. \$V_{DS}\$ would also be limited by the body diodes. Also, I'm ignoring the threshold voltage.
\$^2\$ Again, the real voltage would be limited by the body diodes and parasitic capacitance. Leakage current would also play a role.
UPDATE: You asked two follow-up questions in the comments:
So to clarify, I can use the reasoning that because P1 is off, id = 0, and this is the same current flowing through N1, which automatically means N1 is off when Vin1 = Vdd right?
This is wrong in two ways. First, N1's drain is connected to both P1 and P2. (The PMOSFETs are in parallel.) So P1 being off does not imply that N1's current is zero. It is zero in this case, but that's because of N2, not P1.
Second, a current of zero does not mean that N1 must be off! In CMOS logic, there is (ideally) never any DC current! A MOSFET is on when there's a conductive channel between the drain and source due to the gate voltage. This is called "channel inversion".
Also, I am still slightly confused. If a mosfet is in cut-off, is it safe to assume Vds/Vsd = 0?
No, it is not. When the MOSFET is off, it acts (ideally) like an open circuit, and can have any voltage across it. Here's a simple example:
simulate this circuit – Schematic created using CircuitLab
The solution says something more subtle -- if N1 conducts and N2 does not, then N1's \$V_{DS}\$ will eventually reach zero. It might help to think about parasitic capacitance. Here's a simplified circuit that shows what I mean:
Imagine that we start with \$V_{in1}\$ low and \$V_{in2}\$ high. The capacitor is fully discharged through N2. N1's \$V_{DS} = V_{DD}\$. Now we make \$V_{in1}\$ high and \$V_{in2}\$ low. N2 cuts off. N1 turns on and starts charging up the capacitor. The capacitor prevents N1's \$V_S\$ from changing instantly, so at the start, N1's \$V_S = 0 \mathrm V\$. As the capacitor charges, \$V_S\$ rises, which reduces \$V_{GS}\$ and \$V_{DS}\$. Since the gate and drain voltages are the same, \$V_{GS}\$ will reach zero (full cut-off) at exactly the same time that \$V_{DS}\$ reaches zero.
The capacitor holds N1's \$V_S\$ at \$V_{DD}\$. If it leaks, \$V_{GS}\$ is no longer zero, so N1 turns back on and recharges the capacitor. Now in real life, you have to worry about the threshold voltage and leakage currents and AC performance and lots of other messy stuff, but this is a simple digital circuit, so let's keep it simple today. :-)
I'm assuming you would relate this to the most basic forms of CMOS logic, the inverter:
For the PMOS it is still common to also use \$Vgs > Vt\$ for the ON condition. But note that then the PMOS Vt would then be negative !
Condition 2 \$Id = 0\$ can also be achieved with both transistors OFF. So condition 2 does not always imply condition 1. But for the inverter powered with a sufficient Vdd (If Vdd = 0, that would also imply Id = 0) then either the NMOS or the PMOS transistor is ON (in a conductiong state). That is assuming Vin is either equal to 0 V or Vdd. (If Vin = roughly \$Vdd/2\$ then both transistors are conducting and Id would not be 0).
Id = 0 is not related to the state of the circuit. It is similar to the situation that a light switch can be ON or OFF, it does not mean a current has to flow. Removing the lightbulb (so no current can flow) does not prevent the switch from being in the ON or OFF position).
Likewise in an inverter depending on it's state either the NMOS or the PMOS is in a conducting state, that does not mean a current Id has to flow. This is the great benefit of CMOS logic, (almost) no current flows when the logic is in a static position.
Best Answer
Simplest way to remember current direction is by the little arrow indicator on the transistor, for NMOS it is pointing out of the drain thus current flows from source to drain. And for PMOS the arrow is into the source, so flows from source to drain. It is important to remember that the source is indicated by the arrow location. So in the case drawn, NMOS source is on the bottom and PMOS source is on the top.