Dynamics of pattern formation in cellular neural networks