Hi
In Vhdl if i have matrix 2x2 , and want all matrix zero we use this :
(others => (others=>0));
if i have MxN matrix, how i can give all arrow and column zero value ?
thanks.
type matrix_08 is array (integer range <>, integer range <>) of signed( 7 downto 0);
type matrix_16 is array (integer range <>, integer range <>) of signed( 15 downto 0);
and this my input matrix :
Code:
PORT (
a: IN matrix_08(1 to M, 1 to N); -- MxN matrix ;
b: IN matrix_08(1 to N, 1 to K); -- NxK matrix ;
clk: IN STD_LOGIC;
aclr: IN STD_LOGIC;
c: OUT matrix_16(1 to N, 1 to K)
) ;
and M,N,K are Generic :
Code:
GENERIC (M : integer:=20;
K : integer:=20;
N : integer:=20);
yes Thanks for help .
you right ,but my code it's too long and not finished for now ,x_a and x_b it's signal , i'm forget to said that .
anyway , thank you for help
yes Thanks for help .
you right ,but my code it's too long and not finished for now ,x_a and x_b it's signal , i'm forget to said that .
anyway , thank you for help
imbichie Answerd my question, my friends.
Matrix 20x20 it's 2D matrix, right so just (others => (others=>'0')); it's enough , i think .
for now my whole code not finished , i want to wright testbench for whole my code but , i my code didn't work for now, so asked that . but apparently i have some problem else ...
so Thanks my friend <3
But Imbichie is wrong, what you posted origionally correct IF x_a and x_b are matrix_16. This is why asked to see the declarations of x_a and x_b, to see their type.
you need an "others" for EACH dimension, you have a 2D array of a 1D array type, hence you need 3 "others", not 2. But this would work fine: