Matrix Creation from VHDL Input

In summary, the goal of the conversation was to figure out how to store integers from a Din signal into an 8 x 8 matrix using a process function. The code provided includes a loop to assign the integers to the matrix, and it is recommended to declare the variables as static to ensure their values are reset correctly each time the function is called.
  • #1
perplexabot
Gold Member
329
5
Hello all. So there is a Din signal that is sending some integers according to some clock, my goal is to get each one of these integers and store it in a 8 x 8 matrix. Here is the code I have done, please tell me what you think. Also a quick question: In my code I have assumed that when the compiler goes in and out of the process function, my variables ii and jj will retain there values, so in C++ for example I would assign them as static variables. Is my assumption true? Thank you.
Code:
                PROCESS (Din)	
			if (jj < 8) LOOP		
				if (ii < 8) LOOP
					InBlock(jj,ii) := Din; -- assigning array slot to Dinput...
					
					IF ii = 7 THEN
						jj := jj + 1;
						ii := 0;	
					END IF;
					
					ii := ii + 1;
				END LOOP;
			END LOOP;
		END PROCESS;

PS: I hope this isn't a misplaced post
 
Technology news on Phys.org
  • #2
.Your code looks OK, but it would be best to declare the variables ii and jj as static so that they retain their values when the process function is called. This will ensure that their values are reset correctly every time the process function is called.
 

Related to Matrix Creation from VHDL Input

1. What is VHDL and how is it used in matrix creation?

VHDL (VHSIC Hardware Description Language) is a programming language used for the design and simulation of digital electronic circuits. It is often used in the creation of matrices because it allows for the description of complex hardware structures using a concise and structured syntax.

2. How does the VHDL input translate into a matrix?

VHDL input is typically used to describe the structure and behavior of a digital circuit. This description can be translated into a matrix by assigning each component of the circuit to a specific element in the matrix. The values of the elements in the matrix can then be manipulated to simulate the behavior of the circuit.

3. What are the benefits of using VHDL for matrix creation?

VHDL offers several benefits for matrix creation, including its ability to describe complex hardware structures, its conciseness and structure, and its ability to simulate the behavior of the circuit. Additionally, VHDL is a standardized language, making it easier for different users to collaborate and share their designs.

4. Are there any limitations to using VHDL for matrix creation?

While VHDL is a powerful tool for matrix creation, it does have some limitations. One limitation is that it is primarily used for digital circuit design, so it may not be the best choice for more complex or analog matrices.

5. How can I learn more about using VHDL for matrix creation?

There are several resources available for learning about VHDL and its applications in matrix creation. These include online tutorials, textbooks, and courses offered by universities or specialized training institutes. Additionally, practicing and experimenting with VHDL code can also help improve understanding and proficiency.

Similar threads

  • Programming and Computer Science
Replies
4
Views
692
  • Programming and Computer Science
Replies
17
Views
2K
  • Programming and Computer Science
Replies
2
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
6
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
5K
  • Programming and Computer Science
Replies
4
Views
12K
  • Programming and Computer Science
Replies
13
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
Back
Top