Refer to Master Slave Negative Edge D Flip-flop before you read the next paragraph.
- When clock=0, P1 and P2 are high (i-e P1=P2=1). keeping the values of Q and Q' intact.
- At the same time P4= complement of D and P3=D.
- Now when clock=1 (at positive edge), the values of P3 (equal D) and P4 (complement of D) passes through P1 and P2.
- Now P1=D' and P2=D which means Q=D and Q'=D'
- When D=0, P2=0 which will keep the value of P4=1 regardless of the value of D
- When D=1, P2 and P3 remains high regardless of the value of D.