Simple combinatorial PAL/GAL reader

byte numBits = 10; // 2^numBits must be big enough to include the number n
char b; // <--- this is only 8 bits - not enough for above