How to encode binary sequence if the number of bits are odd to e.g. 4-PAM? (Beginner)
This problem is solved in the upper layers of the communication system, not at the PHY.
For example, in the data link layer (DLL), the transmission unit is a frame. Frames are designed to be compatible with the PHY, so that problems like the one you describe don't occur. Also, many DLL protocols allow for fixed-size frames to be padded, or for variable-size frames, which provide some flexibility.