Lots of input switches

For 50 switches, you'll need 7 + 8 = 15 pins. (7 * 8 = 56)
You could use a serial in parallel out shift register with open collector outputs for the 8 rows, and read the 7 columns with normal digital input pins, or using a parallel in serial out shift register.
Using SPI, this is really fast.
In this case you'll need only 5 pins for all 50 switches. (3 SPI pins and two latch/slave select lines.)

Pieter