The conventional supervised deep learning frameworks for image classification focus on finding the minimizer of an objective function. However, for a lifelong learning system, the network has to be able to dynamically learn new tasks with very few examples. In biological neural networks it is observed that neuromodulation acts as a key factor in continual learning. In this work, we propose a dynamic learning system, ModNet, wherein a modulatory unit regulates the learning depending on the context and internal state of the system. The modulatory unit, consisting of a group of neurons, exercises the use of neuromodulation and Hebbian plasticity mechanisms over a population of neurons instead of relying on backpropagation of error gradients. An efficient digital architecture with on-chip training and resource sharing is proposed to facilitate the efficacy of task-based processing.