Creating a 5x5 keypad without using micro-controllers
Here is a diode matrix for seven buttons and three bits. (Updated after Andy's correction.) Expand it to get 25 buttons. 







simulate this circuit &ndash; Schematic created using CircuitLab