I just finished a Coursera course on hardware design (nand2tetris) and I want to take the next step and implement the design in an FPGA. Being fairly new to the hardware aspect of computing in general, I needed to clear a few questions regarding memory. In particular, I want to implement a memory design that is organized into square arrays of 16 bit wide registers. The data would be accessed by specifying an array and then either a row or column (with the goal of expediting matrix multiplication). However, I am unsure if such a design will fit into an FPGA (I believe I can afford at most a Cyclone V or something equivalent). Since GPUs can be implemented on FPGAs, there must be a more efficient way of doing this that does not require using the D flip flops in each logic element to store a bit from an individual register. If there is not, how do people handle arrays of data in parallel on FPGAs? Any information would be really helpful and since this is all a purely pedagogical exercise, pointers to learning materials on the subject are appreciated.
Your 'most limited resource' is likely going to be the number of multipliers on the FPGA.
Your matrix multiplication logic will then consists of a stream of numbers read from a source, fed into a bundle of multipliers and the result stored again.
Two-dimensional access is easiest implemented using register albeit it also uses a lot of logic to select the outputs. I have implemented a two-dimensional memory using standard (one dimensional) memory chips but that was patented. I think you will just need to spend some cycle 'rotating' the matrix. Or be clever how you write the result. You might even consider storing each matrix twice.
I am more concerned about precision.
I have no idea what your numbers are, but I do recollect colleges at Delft University about the problems with maintaining precision when repeatedly using floating point numbers. In your case it will be worse because the multiplier in an FPGA has only a limited number of integer bits. Unless you want to implement massive parallel floating point multiplication.