Guest
#6692327
Hello, I want to control a LED matrix on a FPGA to implement a simple version of the game Space Invaders. But I encounter a problem : my FPGA is limited to 160 logic elements but my code needs 314. I implemented the led matrix on an array (7 rows) of std_logic_vectors (1 to 5). All worked fine when I operate on the rows but lots of logic elements (mainly multiplexers and "and gates") arose when I access a single element of the matrix (ex : when I have to switch on lights corresponding to the shoot of the player). The code is composed of 5 entities : 2 buttons to move the player, 1 button to shoot, 1 entity to display the led matrix (a multiplexer) and 1 pseudo random generator to generate the ennemies randomly. Here is my question : Are there any ways to optimize the number of logic elements ? By changing the representation of the datas, changing the entities,...? I attached my code. I am a beginner so I apologize for the common mistakes. Thanks in advance!
