This operation:
A!=B
determines if A is not equal to B. If they’re not equal, it evaluates to true. If they are equal, it evaluates to false. It’s just a boolean comparison operation.
This operation:
A=!B
is not a boolean comparison. It sets the value of A to the negated value of B. (When used in this context it also evaluates to the new value of A, but isn’t really a “comparison” in that regard.) So if B is true then this will set the value of A to false. It can be seen much more clearly as:
A = !B
The first operation only compares, it doesn’t modify anything. The second operation modifies A.
A!=B means “A is not equal to B”.
A=!B means “Assign the complement of B to A, and yield the lvalue of A”. It can (should) be rewritten to be A = !B or A = (!B).