It’s been very kindly pointed out to me via email (by Tricky) that I was talking complete rubbish saying that VHDL is rubbish at 2d arrays.

What I should’ve said was “VHDL is rubbish at arrays of other arrays”, which is a subtle but critical difference! Arrays of other arrays are very useful (for example in register files), and the fact that the dimensions of one of the arrays must be known at compile time can make some things tricky to impossible. For example, a generic mux with a variable number of inputs can’t easily also have a generic number of bits on each input.

This has no bearing at all on the reading, storage and writing of images! The reason I wrote what I did stems back (I think!) to the fact that I first wrote an image reading library many years ago at work and it’s worked in a similar way ever since, Now the code I published the other day is completely new, written straight out of my head, but with my “ancient” prejudices attached to it.

When Tricky wrote to me saying what’s wrong with proper 2d arrays, the light bulb pinged and I spent several hours wandering the house kicking myself! Still, it’s good to learn new things, even if you thought you already knew about them – clearly I hadn’t got them ingrained enough!

So, I’ve created a new version of the page in question, which creates a much tidier image access library.

Sorry for any confusion caused!

Leave a comment

Your email address will not be published. Required fields are marked *