in a project I've made recently (Quartus, Cyclone 2, altera) I wanted to produce both VGA graphical output, and sound output (via another board). I've noticed a large amount of logic cells went on arrays (which contained a lookup table for sine waves for example). On the other hand, I've made many graphical objects containing bitmaps of great numbers (500X300[*8bit color vector per each cell]) which obviously needed to be saved somewhere, but never took any space (memory bits) on my board.
Needles to say, they should have taken a lot more space than any other array I've had (if I'm merely summing it up bit-wise). I've made all objects by myself from scratch, creating all arrays the same way, so no difference in any definition that I know of, but somehow the Quartus/Chip handles them differently and optimizes the space utilization for them - transferring them to LC combinationals and registers, rather than to Memory bits on the board.
How can I know or control this behaviour beforehand? and how does it "know" the difference between a "color bitmap" array to a "sine-values" array for example (both 8-bit per cell)? in this case, it was a surprised it actually worked (taking only ~15% of memory bits, but ~70% of logic elements). *didn't use any megafunction wizard stuff.