HDL is connecting wires together, not assigning variable values. This is an important distinction.
The signal name on the left of the '=' is a signal (I/O pin) in the part being used; the name on the right is a signal (I/O pin or internal wire) in the part being designed.
Read the Hardware Construction Survival Kit
and Helpful HDL Philosophy
[Forum etiquette is not to post complete solutions. Please edit your post to remove the correct solution to And.]