Simple combinatorial PAL/GAL reader

Why is ‘x’ being incremented by 2??? Why are you adding binLength-x to the pin number???