Hierarchical neural networks perform both serial and parallel processing