Trying to sketch up a circuit which will divide, say a 5-bit binary number by 5 to produce a 4-bit binary quotient. We can assume that the input doesn't actually reach 31, instead it's limited to 30, or 25.
I'd like to use only 2 ~ 4 input NAND gates. The inputs A, B, C, D, and E will be available from toggle switches. Any solution which uses 22 or fewer gates and inverters (not counting the five inverters for the inputs) is acceptable.