Architectural synthesis for VLSI neural networks