Logic gate P is NAND gate and Q is OR gate.
The Boolean expression for NAND gate is
`X^(')=bar(A.B)=barA+barB`
The Boolean expression for the combination of gates is
`X=X^(')+B=(barA+barB)+B`
`=barA+(barB+B)=barA+1 [ :' bar+B=1]`
The truth table for the combination of gates is shown below.
`|{:(A,B,barA,barB,barA+barB,X=(barA+barB)+B),(0,0,1,1,1,1),(0,1,1,0,1,1),(1,0,0,1,1,1),(1,1,0,0,0,1):}|`
It means output is always 1 whatever may be the values of inputs A and B.