A method for controlling a convolutional neural network, CNN, hardware accelerator, comprising: if it is determined that a convolution operation is to be performed, utilizing one or more processing elements to perform the convolution; if it is determined that an operation other than a convolution is to be performed, determining whether a deconvolution operation is to be performed; characterized in that if it is determined that a deconvolution operation is to be performed, extracting smaller convolution filters from a deconvolution filter having a depth based on stride by splitting the deconvolution filter in blocks of stride x stride x depth and selecting values from each of the blocks; reflecting each of the smaller convolution filters along an x and y axes; utilizing the one or more processing elements to perform convolution by performing the convolution of the smaller convolution filters with padded input data to obtain convolution results comprising different output planes; interlacing the convolution results based on the relative position in the deconvolution filter of the corresponding blocks associated with each smaller convolution filter to produce output data; wherein each of the one or more processing elements comprises a first input, a second input, a cache coupled to the second input, and a dot-product unit coupled to the first input and to the cache, wherein the first input is used to stream feature map data as non-repeated data, wherein the second input is used to stream coefficient data, and wherein caches of different processing elements store different coefficient data of convolution filters as repeated data to process the different output planes. if it is determined that a convolution operation is to be performed, utilizing one or more processing elements to perform the convolution; if it is determined that an operation other than a convolution is to be performed, determining whether a deconvolution operation is to be performed; characterized in that if it is determined that a deconvolution operation is to be performed, extracting smaller convolution filters from a deconvolution filter having a depth based on stride by splitting the deconvolution filter in blocks of stride x stride x depth and selecting values from each of the blocks; reflecting each of the smaller convolution filters along an x and y axes; utilizing the one or more processing elements to perform convolution by performing the convolution of the smaller convolution filters with padded input data to obtain convolution results comprising different output planes; interlacing the convolution results based on the relative position in the deconvolution filter of the corresponding blocks associated with each smaller convolution filter to produce output data; wherein each of the one or more processing elements comprises a first input, a second input, a cache coupled to the second input, and a dot-product unit coupled to the first input and to the cache, wherein the first input is used to stream feature map data as non-repeated data, wherein the second input is used to stream coefficient data, and wherein caches of different processing elements store different coefficient data of convolution filters as repeated data to process the different output planes. <EOS>