How is 2D convolution calculated? I wish to implement the 2D convolution on an FPGA, so Ineed to understand how it is calculated in practice. The main difficulty that I found apparently 2 different ways showcases how to do it.
The first is to center the kernel to a position and calculate the sum of the overlapping products:
http://www.songho.ca/dsp/convolution/convolution2d_example.html
Making sense of indices in 2D convolution operations

And the other one that involves shifting the kernel
https://www.allaboutcircuits.com/technical-articles/two-dimensional-convolution-in-image-processing/

So what is the way?
Or perhaps they are equivalent in way that I don't recognise?
Technically, shifting the kernel above the still image, or shifting the image "below" the centered kernel are equivalent. This is because convolution of a kernel and an image is a commutative operation:

$$\sum_{k_1=-\infty}^{\infty} \sum_{k_2=-\infty}^{\infty} h(k_1,k_2)x(n_1-k_1,n_2-k_2) = \sum_{k_1=-\infty}^{\infty} \sum_{k_2=-\infty}^{\infty} x(k_1,k_2)h(n_1-k_1,n_2-k_2) $$

This however assumes infinite extend, etc. Whether it can easily be used to program an FPGA is a different topic.