Hi, I am trying to understand the following two circuits: I noticed that unless and until I place 10k pmosfet is not working as a switch? , I would like to know the reason:
It sounds like your "signal" line is either on or floating. The 10k makes sure the voltage on the gate is pulled either up or down when "signal" is turned off. A mosfet is a voltage controlled device, treat the gate like a capacitor. If nothing pulls it up or down explicitly, it will be left floating and will have indeterminate behavior. You could get rid of the 10k if "signal" would both pull up and down.
It will work as a switch if the input is either at ground or high.
As noted, you can't leave the input floating.
A floating input here is not zero volts, it's undetermined.
We guessed your input is a dry contact switch to the opposite "rail" as the resistor. (="supply" =Vcc, or return"=0V)
The shunt gate resistor simply biases Gate to Source or Vgs=0 to the OFF state when disconnected.
Since single stage transistor switches are inverting, the control voltage goes towards the opposite rail as the output.
Pch. type has the source from Positive supply and called a high side switch. ( also PNP type) ( thus low input for active high output)
Nch. type has the source to Negative or 0V called a low side switch. ( also NPN type)
Generally the threshold for enchanced MOSFETs is at some standard like 100 uA current. In datasheets it is always called Vgs(th) but in textbooks simply Vt.
Originally, they were all 2 to 4V tolerance threshold and needed 2.5 times this voltage minimum to achieve the rated Ron or RdsOn. Now "logic level" FETs are lower level threshold and need at least only 2x Vt to reach Ron.
Get used to the various abbreviations used in datasheets (P-ch, or PFET) and learn how to select the current rating much higher than what you think you need as they are rated for current with heatsinks that control case temp always to 25'C.