Is there chance that your encoder 24V is the maximum rated voltage? Have you tried it with 5V?
Jim, 4 bits can be used to make 0 to 15 and the understanding of bits can let you work with 4 bits as 1 number/
However the encoder bits tell you the physical state of the encoder switches that have a pattern within those 4 bits.
Where those things intersect is your answer, is why I ask what the possible encoder states are, as bits the intersection shows itself.
The computer itself runs on bits, each wire HIGH or LOW. A byte of memory is an array of 8 bits. The low bit is worth 0 or 1, the next higher bit is 0 or 2 and each doubles in value until the top bit that is 0 or 128. With decimal numbering each higher digit is 10 times more, with binary it is 2 times more but you only need 1 finger to count a binary digit, it is up or down only.
With 10 fingers you can count from 0 to 1023. My early teachers would say we needed to take our shoes and socks off to count to 20, even te ones that showed us binary which I thought was a bit dense.