You're using a byte array to hold 16 bit values but byte is defined as unsigned 8 bit value. Change it to int or unsigned int.
I'm not sure why you want to store powers of two, they are easy/fast enough to generate on the fly with the shift operator:
int bit = 1 << row ;