Dec 10, 2005 #1 D dimitris01 Newbie level 3 Joined Dec 9, 2005 Messages 4 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,315 hi can anyone tell me how can I formulate matrices using VHDL?
Dec 10, 2005 #2 M maksya Full Member level 3 Joined Jun 2, 2005 Messages 151 Helped 16 Reputation 32 Reaction score 3 Trophy points 1,298 Activity points 2,256 Re: VHDL design // definition of matrix m*n of integers (0, 1...9) TYPE matrix IS array (m-1 downto 0, n-1 downto 0) of integer range 9 downto 0; // instantiating matrix VARIABLE matrix_instance: matrix; // using matrix matrix_instance( 1 , 1 ) := 5;
Re: VHDL design // definition of matrix m*n of integers (0, 1...9) TYPE matrix IS array (m-1 downto 0, n-1 downto 0) of integer range 9 downto 0; // instantiating matrix VARIABLE matrix_instance: matrix; // using matrix matrix_instance( 1 , 1 ) := 5;
Dec 10, 2005 #3 D dimitris01 Newbie level 3 Joined Dec 9, 2005 Messages 4 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,315 VHDL design matrix_instance( 1 , 1 ) := 5; can u explain me this line? thx dimitris
Dec 10, 2005 #4 M maksya Full Member level 3 Joined Jun 2, 2005 Messages 151 Helped 16 Reputation 32 Reaction score 3 Trophy points 1,298 Activity points 2,256 Re: VHDL design "matrix_instance" is the matrix of integers range from 0 to 9. So, the element with index (1,1) take on a value 5. (note: elements of matrix are instaniate like variables. That is why I wrote :=) Any other questions? I'm ready to answer.
Re: VHDL design "matrix_instance" is the matrix of integers range from 0 to 9. So, the element with index (1,1) take on a value 5. (note: elements of matrix are instaniate like variables. That is why I wrote :=) Any other questions? I'm ready to answer.
Dec 10, 2005 #5 D dimitris01 Newbie level 3 Joined Dec 9, 2005 Messages 4 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 1,315 VHDL design ok if i want to create a Nx1 matrix I write? constant N : integer := 1; constant M : integer := 7; type NM is array(0 to N, 0 to M) of integer; and by using the matrix_instance I can assign the values of the elements of the matrix? thx
VHDL design ok if i want to create a Nx1 matrix I write? constant N : integer := 1; constant M : integer := 7; type NM is array(0 to N, 0 to M) of integer; and by using the matrix_instance I can assign the values of the elements of the matrix? thx
Dec 12, 2005 #6 M maksya Full Member level 3 Joined Jun 2, 2005 Messages 151 Helped 16 Reputation 32 Reaction score 3 Trophy points 1,298 Activity points 2,256 Re: VHDL design matrix_instance is only the name of instance. It is not a keyword. In your case you can operate with matrix elements using something like this: constant N : integer := 1; constant M : integer := 7; type NM is array(0 to N, 0 to M) of integer; VARIABLE matrix_instance: NM; VARIABLE some_variable: integer; ... NM(1,2) := 1; some_variable := NM(0,3); ...
Re: VHDL design matrix_instance is only the name of instance. It is not a keyword. In your case you can operate with matrix elements using something like this: constant N : integer := 1; constant M : integer := 7; type NM is array(0 to N, 0 to M) of integer; VARIABLE matrix_instance: NM; VARIABLE some_variable: integer; ... NM(1,2) := 1; some_variable := NM(0,3); ...