Efficient Simulation and Implementation of Neural Networks on Resource-Constrained Platforms